diff --git a/src/datashare/README.md b/src/datashare/README.md index 9b8be0ab66..0799618530 100644 --- a/src/datashare/README.md +++ b/src/datashare/README.md @@ -1,201 +1,5 @@ -# Azure CLI datashare Extension # -This package is for the 'datashare' extension, i.e. 'az datashare'. More info on what is [Data Share](https://docs.microsoft.com/azure/data-share/). - -### How to use ### -Install this extension using the below CLI command -``` -az extension add --name datashare -``` - -Register DataShare Resource Provider for your default susbcription. -``` -az provider register -n "Microsoft.DataShare" -``` - -### Included Features -#### Datashare Account Management -*Examples:* - -##### Create a Datashare Account - -``` -az datashare account create \ ---location "West US 2" \ ---tags tag1=Red tag2=White \ ---name "cli_test_account" \ ---resource-group "datashare_provider_rg" -``` - -##### Wait for the Datashare Account to be provisioned -``` -az datashare account wait \ ---name "cli_test_account" \ ---resource-group "datashare_provider_rg" \ ---created -``` - -#### Datashare Resource Management for a Provider -*Examples:* - -##### Create a Datashare -``` -az datashare create \ ---account-name "cli_test_account" \ ---resource-group "datashare_provider_rg" \ ---description "share description" \ ---share-kind "CopyBased" \ ---terms "Confidential" \ ---name "cli_test_share" -``` - -##### Create a Data Set -``` -az datashare dataset create \ ---account-name "cli_test_account" \ ---name "cli_test_data_set" \ ---resource-group "datashare_provider_rg" \ ---share-name "cli_test_share" \ ---dataset "{\"container_name\":\"mycontainer\",\"storage_account_name\":\"mysa\",\"kind\":\"Container\"}" -``` - -Please make sure the datashare account has the right permission of the data source when creating a data set upon it. -For instance, you can use `az datashare account show` to get 'identity.principalId' of the account, then assign the right role to it. -``` -az role assignment create \ ---role "Storage Blob Data Reader" \ ---assignee-object-id {DatashareAccountPrincipalId} \ ---assignee-principal-type ServicePrincipal \ ---scope {StorageAccountId} -``` - -##### Create a Synchronization Setting -``` -az datashare synchronization-setting create \ ---account-name cli_test_account \ ---resource-group datashare_provider_rg \ ---share-name cli_test_share \ ---name cli_test_synchronization_setting \ ---recurrence-interval Day \ ---synchronization-time "2020-04-05 10:50:00 +00:00" \ ---kind ScheduleBased -``` - -##### List Synchronization History -``` -az datashare synchronization list \ ---account-name "cli_test_account" \ ---resource-group "datashare_provider_rg" \ ---share-name "cli_test_share" -``` - -##### Create a Datashare Invitation -``` -az datashare invitation create \ ---account-name "cli_test_account" \ ---target-email "myname@microsoft.com" \ ---name "cli_test_invitation" \ ---resource-group "datashare_provider_rg" \ ---share-name "cli_test_share" -``` - -##### List Share Subscriptions -``` -az datashare provider-share-subscription list \ ---account-name "cli_test_account" \ ---resource-group "datashare_provider_rg" \ ---share-name "cli_test_share" -``` -Share subscriptions are created by Datashare consumers when they accept invitations. - -##### Revoke Datashare for a Share Subscription -``` -az datashare provider-share-subscription revoke \ ---account-name "cli_test_account" \ ---share-subscription "{ProviderShareSubscriptionObjectId}" \ ---resource-group "datashare_provider_rg" \ ---share-name "cli_test_share" -``` - -##### Reinstate Datashare for a Share Subscription -``` -az datashare provider-share-subscription reinstate \ ---account-name "cli_test_account" \ ---share-subscription "{ProviderShareSubscriptionObjectId}" \ ---resource-group "datashare_provider_rg" \ ---share-name "cli_test_share" -``` - -#### Datashare Resource Management for a Consumer -*Examples:* - -##### List received Invitations -``` -az datashare consumer invitation list -``` - -##### Create a Share Subscription from an Invitation -``` -az datashare consumer share-subscription create \ ---account-name "cli_test_consumer_account" \ ---resource-group "datashare_consumer_rg" \ ---invitation-id "{InvitationId1}" \ ---source-share-location "sourceShareLocation" \ ---name "cli_test_share_subscription" -``` - -##### List Source Data Sets in the Share Subscription -``` -az datashare consumer share-subscription list-source-dataset \ ---account-name "cli_test_consumer_account" \ ---resource-group "datashare_consumer_rg" \ ---share-subscription-name "cli_test_share_subscription" -``` - -##### Create a Data Set Mapping of the Source Data Set -``` -az datashare consumer dataset-mapping create \ ---account-name "cli_test_consumer_account" \ ---name "cli_test_data_set_mapping" \ ---resource-group "datashare_consumer_rg" \ ---share-subscription-name "cli_test_share_subscription" \ ---mapping "{\"data_set_id\":\"2036a39f-add6-4347-9c82-a424dfaf4e8d\", \ -\"container_name\":\"newcontainer\", \"storage_account_name\":\"consumersa\", \ -\"kind\":\"BlobFolder\",\"prefix\":\"myprefix\"}" -``` -Please make sure the datashare consumer account has the right permission of the data target when creating a data set mapping on it. For instance, you can use `az datashare account show` to get 'identity.principalId' of the account, then assign the right role to it. -``` -az role assignment create \ ---role "Storage Blob Data Contributor" \ ---assignee-object-id "{ConsumerDatashareAccountPrincipalId}" \ ---assignee-principal-type ServicePrincipal \ ---scope "{ConsumerStorageAccountId}" -``` - -##### List the synchronization settings of the Source Datashare -``` -az datashare consumer share-subscription list-source-share-synchronization-setting \ ---account-name "cli_test_consumer_account" \ ---resource-group "datashare_consumer_rg" \ ---share-subscription-name "cli_test_share_subscription" -``` - -##### Create a trigger for the Share Subsciption -``` -az datashare consumer trigger create \ ---account-name "cli_test_consumer_account" \ ---resource-group "datashare_consumer_rg" \ ---share-subscription-name "cli_test_share_subscription" \ ---name "cli_test_trigger" \ ---recurrence-interval Day \ ---synchronization-time "2020-04-05 10:50:00 +00:00" \ ---kind ScheduleBased -``` - -##### Start a synchronization for the Share Subscription -``` -az datashare consumer share-subscription synchronization start \ ---account-name "cli_test_consumer_account" \ ---resource-group "datashare_consumer_rg" \ ---share-subscription-name "cli_test_share_subscription" \ ---synchronization-mode "Incremental" -``` +Microsoft Azure CLI 'datashare' Extension +========================================== + +This package is for the 'datashare' extension. +i.e. 'az datashare' diff --git a/src/datashare/azext_datashare/__init__.py b/src/datashare/azext_datashare/__init__.py index 505737b668..1c1b0b8876 100644 --- a/src/datashare/azext_datashare/__init__.py +++ b/src/datashare/azext_datashare/__init__.py @@ -1,12 +1,15 @@ -# -------------------------------------------------------------------------------------------- +# -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# pylint: disable=unused-argument -# pylint: disable=unused-import +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- from azure.cli.core import AzCommandsLoader -from azext_datashare._help import helps +from azext_datashare.generated._help import helps # pylint: disable=unused-import class DataShareManagementClientCommandsLoader(AzCommandsLoader): @@ -15,17 +18,14 @@ def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType from azext_datashare.generated._client_factory import cf_datashare datashare_custom = CliCommandType( - operations_tmpl='azext_datashare.manual.custom#{}', # modified + operations_tmpl='azext_datashare.custom#{}', client_factory=cf_datashare) - super(DataShareManagementClientCommandsLoader, self).__init__(cli_ctx=cli_ctx, - custom_command_type=datashare_custom) + parent = super(DataShareManagementClientCommandsLoader, self) + parent.__init__(cli_ctx=cli_ctx, custom_command_type=datashare_custom) def load_command_table(self, args): - try: - from azext_datashare.generated.commands import load_command_table - load_command_table(self, args) - except ImportError: - pass + from azext_datashare.generated.commands import load_command_table + load_command_table(self, args) try: from azext_datashare.manual.commands import load_command_table as load_command_table_manual load_command_table_manual(self, args) @@ -34,11 +34,8 @@ def load_command_table(self, args): return self.command_table def load_arguments(self, command): - try: - from azext_datashare.generated._params import load_arguments - load_arguments(self, command) - except ImportError: - pass + from azext_datashare.generated._params import load_arguments + load_arguments(self, command) try: from azext_datashare.manual._params import load_arguments as load_arguments_manual load_arguments_manual(self, command) diff --git a/src/datashare/azext_datashare/_params.py b/src/datashare/azext_datashare/_params.py deleted file mode 100644 index d1283049ba..0000000000 --- a/src/datashare/azext_datashare/_params.py +++ /dev/null @@ -1,16 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# pylint: disable=wildcard-import -# pylint: disable=unused-wildcard-import - -try: - from .generated._params import * # noqa: F403 -except ImportError: - pass - -try: - from .manual._params import * # noqa: F403 -except ImportError: - pass diff --git a/src/datashare/azext_datashare/action.py b/src/datashare/azext_datashare/action.py index 4ad472a8c5..a846b2766c 100644 --- a/src/datashare/azext_datashare/action.py +++ b/src/datashare/azext_datashare/action.py @@ -1,15 +1,16 @@ -# -------------------------------------------------------------------------------------------- +# -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- # pylint: disable=wildcard-import # pylint: disable=unused-wildcard-import -try: - from .generated.action import * # noqa: F403 -except ImportError: - pass - +from .generated.action import * # noqa: F403 try: from .manual.action import * # noqa: F403 except ImportError: diff --git a/src/datashare/azext_datashare/_help.py b/src/datashare/azext_datashare/custom.py similarity index 53% rename from src/datashare/azext_datashare/_help.py rename to src/datashare/azext_datashare/custom.py index c0b36e140d..7f31674ce9 100644 --- a/src/datashare/azext_datashare/_help.py +++ b/src/datashare/azext_datashare/custom.py @@ -1,16 +1,17 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# pylint: disable=wildcard-import -# pylint: disable=unused-wildcard-import - -# try: -# from .generated._help import * # noqa: F403 -# except ImportError: -# pass - -try: - from .manual._help import * # noqa: F403 -except ImportError: - pass +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=wildcard-import +# pylint: disable=unused-wildcard-import + +from .generated.custom import * # noqa: F403 +try: + from .manual.custom import * # noqa: F403 +except ImportError: + pass diff --git a/src/datashare/azext_datashare/generated/__init__.py b/src/datashare/azext_datashare/generated/__init__.py index c9cfdc73e7..ee0c4f36bd 100644 --- a/src/datashare/azext_datashare/generated/__init__.py +++ b/src/datashare/azext_datashare/generated/__init__.py @@ -1,12 +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. -# -------------------------------------------------------------------------- - -__path__ = __import__('pkgutil').extend_path(__path__, __name__) +# 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. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/datashare/azext_datashare/generated/_client_factory.py b/src/datashare/azext_datashare/generated/_client_factory.py index bba6d6bcfb..de67f414f1 100644 --- a/src/datashare/azext_datashare/generated/_client_factory.py +++ b/src/datashare/azext_datashare/generated/_client_factory.py @@ -1,7 +1,12 @@ -# -------------------------------------------------------------------------------------------- +# -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- def cf_datashare(cli_ctx, *_): diff --git a/src/datashare/azext_datashare/generated/_help.py b/src/datashare/azext_datashare/generated/_help.py new file mode 100644 index 0000000000..5298002c56 --- /dev/null +++ b/src/datashare/azext_datashare/generated/_help.py @@ -0,0 +1,927 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-lines + +from knack.help_files import helps + + +helps['datashare account'] = """ + type: group + short-summary: datashare account +""" + +helps['datashare account list'] = """ + type: command + short-summary: List Accounts in Subscription + examples: + - name: Accounts_ListByResourceGroup + text: |- + az datashare account list --resource-group "SampleResourceGroup" +""" + +helps['datashare account show'] = """ + type: command + short-summary: Get an account + examples: + - name: Accounts_Get + text: |- + az datashare account show --name "Account1" --resource-group "SampleResourceGroup" +""" + +helps['datashare account create'] = """ + type: command + short-summary: Create an account + examples: + - name: Accounts_Create + text: |- + az datashare account create --location "West US 2" --tags tag1="Red" tag2="White" --name "Account1" --re\ +source-group "SampleResourceGroup" +""" + +helps['datashare account update'] = """ + type: command + short-summary: Patch an account + examples: + - name: Accounts_Update + text: |- + az datashare account update --name "Account1" --tags tag1="Red" tag2="White" --resource-group "SampleRes\ +ourceGroup" +""" + +helps['datashare account delete'] = """ + type: command + short-summary: DeleteAccount + examples: + - name: Accounts_Delete + text: |- + az datashare account delete --name "Account1" --resource-group "SampleResourceGroup" +""" + +helps['datashare account wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the datashare account is met. + examples: + - name: Pause executing next line of CLI script until the datashare account is successfully created. + text: |- + az datashare account wait --name "Account1" --resource-group "SampleResourceGroup" --created + - name: Pause executing next line of CLI script until the datashare account is successfully deleted. + text: |- + az datashare account wait --name "Account1" --resource-group "SampleResourceGroup" --deleted +""" + +helps['datashare consumer-invitation'] = """ + type: group + short-summary: datashare consumer-invitation +""" + +helps['datashare consumer-invitation show'] = """ + type: command + short-summary: Get an invitation + examples: + - name: ConsumerInvitations_Get + text: |- + az datashare consumer-invitation show --invitation-id "dfbbc788-19eb-4607-a5a1-c74181bfff03" --location \ +"East US 2" +""" + +helps['datashare consumer-invitation list-invitation'] = """ + type: command + short-summary: Lists invitations + examples: + - name: ConsumerInvitations_ListInvitations + text: |- + az datashare consumer-invitation list-invitation +""" + +helps['datashare consumer-invitation reject-invitation'] = """ + type: command + short-summary: Reject an invitation + examples: + - name: ConsumerInvitations_RejectInvitation + text: |- + az datashare consumer-invitation reject-invitation --invitation-id "dfbbc788-19eb-4607-a5a1-c74181bfff03\ +" --location "East US 2" +""" + +helps['datashare data-set'] = """ + type: group + short-summary: datashare data-set +""" + +helps['datashare data-set list'] = """ + type: command + short-summary: List DataSets in a share + examples: + - name: DataSets_ListByShare + text: |- + az datashare data-set list --account-name "Account1" --resource-group "SampleResourceGroup" --share-name\ + "Share1" +""" + +helps['datashare data-set show'] = """ + type: command + short-summary: Get a DataSet in a share + examples: + - name: DataSets_Get + text: |- + az datashare data-set show --account-name "Account1" --name "Dataset1" --resource-group "SampleResourceG\ +roup" --share-name "Share1" +""" + +helps['datashare data-set create'] = """ + type: command + short-summary: Create a DataSet + parameters: + - name: --a-d-l-s-gen1-file-data-set + short-summary: An ADLS Gen 1 file data set. + long-summary: | + Usage: --a-d-l-s-gen1-file-data-set account-name=XX file-name=XX folder-path=XX resource-group=XX subscript\ +ion-id=XX kind=XX + + account-name: Required. The ADLS account name. + file-name: Required. The file name in the ADLS account. + folder-path: Required. The folder path within the ADLS account. + resource-group: Required. Resource group of ADLS account. + subscription-id: Required. Subscription id of ADLS account. + kind: Required. Kind of data set. + - name: --a-d-l-s-gen1-folder-data-set + short-summary: An ADLS Gen 1 folder data set. + long-summary: | + Usage: --a-d-l-s-gen1-folder-data-set account-name=XX folder-path=XX resource-group=XX subscription-id=XX k\ +ind=XX + + account-name: Required. The ADLS account name. + folder-path: Required. The folder path within the ADLS account. + resource-group: Required. Resource group of ADLS account. + subscription-id: Required. Subscription id of ADLS account. + kind: Required. Kind of data set. + - name: --a-d-l-s-gen2-file-data-set + short-summary: An ADLS Gen 2 file data set. + long-summary: | + Usage: --a-d-l-s-gen2-file-data-set file-path=XX file-system=XX resource-group=XX storage-account-name=XX s\ +ubscription-id=XX kind=XX + + file-path: Required. File path within the file system. + file-system: Required. File system to which the file belongs. + resource-group: Required. Resource group of storage account + storage-account-name: Required. Storage account name of the source data set + subscription-id: Required. Subscription id of storage account + kind: Required. Kind of data set. + - name: --a-d-l-s-gen2-file-system-data-set + short-summary: An ADLS Gen 2 file system data set. + long-summary: | + Usage: --a-d-l-s-gen2-file-system-data-set file-system=XX resource-group=XX storage-account-name=XX subscri\ +ption-id=XX kind=XX + + file-system: Required. The file system name. + resource-group: Required. Resource group of storage account + storage-account-name: Required. Storage account name of the source data set + subscription-id: Required. Subscription id of storage account + kind: Required. Kind of data set. + - name: --a-d-l-s-gen2-folder-data-set + short-summary: An ADLS Gen 2 folder data set. + long-summary: | + Usage: --a-d-l-s-gen2-folder-data-set file-system=XX folder-path=XX resource-group=XX storage-account-name=\ +XX subscription-id=XX kind=XX + + file-system: Required. File system to which the folder belongs. + folder-path: Required. Folder path within the file system. + resource-group: Required. Resource group of storage account + storage-account-name: Required. Storage account name of the source data set + subscription-id: Required. Subscription id of storage account + kind: Required. Kind of data set. + - name: --blob-container-data-set + short-summary: An Azure storage blob container data set. + long-summary: | + Usage: --blob-container-data-set container-name=XX resource-group=XX storage-account-name=XX subscription-i\ +d=XX kind=XX + + container-name: Required. BLOB Container name. + resource-group: Required. Resource group of storage account + storage-account-name: Required. Storage account name of the source data set + subscription-id: Required. Subscription id of storage account + kind: Required. Kind of data set. + - name: --blob-data-set + short-summary: An Azure storage blob data set. + long-summary: | + Usage: --blob-data-set container-name=XX file-path=XX resource-group=XX storage-account-name=XX subscriptio\ +n-id=XX kind=XX + + container-name: Required. Container that has the file path. + file-path: Required. File path within the source data set + resource-group: Required. Resource group of storage account + storage-account-name: Required. Storage account name of the source data set + subscription-id: Required. Subscription id of storage account + kind: Required. Kind of data set. + - name: --blob-folder-data-set + short-summary: An Azure storage blob folder data set. + long-summary: | + Usage: --blob-folder-data-set container-name=XX prefix=XX resource-group=XX storage-account-name=XX subscri\ +ption-id=XX kind=XX + + container-name: Required. Container that has the file path. + prefix: Required. Prefix for blob folder + resource-group: Required. Resource group of storage account + storage-account-name: Required. Storage account name of the source data set + subscription-id: Required. Subscription id of storage account + kind: Required. Kind of data set. + - name: --kusto-cluster-data-set + short-summary: A kusto cluster data set. + long-summary: | + Usage: --kusto-cluster-data-set kusto-cluster-resource-id=XX kind=XX + + kusto-cluster-resource-id: Required. Resource id of the kusto cluster. + kind: Required. Kind of data set. + - name: --kusto-database-data-set + short-summary: A kusto database data set. + long-summary: | + Usage: --kusto-database-data-set kusto-database-resource-id=XX kind=XX + + kusto-database-resource-id: Required. Resource id of the kusto database. + kind: Required. Kind of data set. + - name: --sql-d-b-table-data-set + short-summary: A SQL DB table data set. + long-summary: | + Usage: --sql-d-b-table-data-set database-name=XX schema-name=XX sql-server-resource-id=XX table-name=XX kin\ +d=XX + + database-name: Database name of the source data set + schema-name: Schema of the table. Default value is dbo. + sql-server-resource-id: Resource id of SQL server + table-name: SQL DB table name. + kind: Required. Kind of data set. + - name: --sql-d-w-table-data-set + short-summary: A SQL DW table data set. + long-summary: | + Usage: --sql-d-w-table-data-set data-warehouse-name=XX schema-name=XX sql-server-resource-id=XX table-name=\ +XX kind=XX + + data-warehouse-name: DataWarehouse name of the source data set + schema-name: Schema of the table. Default value is dbo. + sql-server-resource-id: Resource id of SQL server + table-name: SQL DW table name. + kind: Required. Kind of data set. + examples: + - name: DataSets_Create + text: |- + az datashare data-set create --account-name "Account1" --blob-data-set container-name="C1" file-path="fi\ +le21" resource-group="SampleResourceGroup" storage-account-name="storage2" subscription-id="433a8dfd-e5d5-4e77-ad86-90a\ +cdc75eb1a" --name "Dataset1" --resource-group "SampleResourceGroup" --share-name "Share1" + - name: DataSets_KustoCluster_Create + text: |- + az datashare data-set create --account-name "Account1" --kusto-cluster-data-set kusto-cluster-resource-i\ +d="/subscriptions/433a8dfd-e5d5-4e77-ad86-90acdc75eb1a/resourceGroups/SampleResourceGroup/providers/Microsoft.Kusto/clu\ +sters/Cluster1" --name "Dataset1" --resource-group "SampleResourceGroup" --share-name "Share1" + - name: DataSets_KustoDatabase_Create + text: |- + az datashare data-set create --account-name "Account1" --kusto-database-data-set kusto-database-resource\ +-id="/subscriptions/433a8dfd-e5d5-4e77-ad86-90acdc75eb1a/resourceGroups/SampleResourceGroup/providers/Microsoft.Kusto/c\ +lusters/Cluster1/databases/Database1" --name "Dataset1" --resource-group "SampleResourceGroup" --share-name "Share1" + - name: DataSets_SqlDBTable_Create + text: |- + az datashare data-set create --account-name "Account1" --sql-d-b-table-data-set database-name="SqlDB1" s\ +chema-name="dbo" sql-server-resource-id="/subscriptions/433a8dfd-e5d5-4e77-ad86-90acdc75eb1a/resourceGroups/SampleResou\ +rceGroup/providers/Microsoft.Sql/servers/Server1" table-name="Table1" --name "Dataset1" --resource-group "SampleResourc\ +eGroup" --share-name "Share1" + - name: DataSets_SqlDWTable_Create + text: |- + az datashare data-set create --account-name "Account1" --sql-d-w-table-data-set data-warehouse-name="Dat\ +aWarehouse1" schema-name="dbo" sql-server-resource-id="/subscriptions/433a8dfd-e5d5-4e77-ad86-90acdc75eb1a/resourceGrou\ +ps/SampleResourceGroup/providers/Microsoft.Sql/servers/Server1" table-name="Table1" --name "Dataset1" --resource-group \ +"SampleResourceGroup" --share-name "Share1" +""" + +helps['datashare data-set delete'] = """ + type: command + short-summary: Delete a DataSet in a share + examples: + - name: DataSets_Delete + text: |- + az datashare data-set delete --account-name "Account1" --name "Dataset1" --resource-group "SampleResourc\ +eGroup" --share-name "Share1" +""" + +helps['datashare data-set wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the datashare data-set is met. + examples: + - name: Pause executing next line of CLI script until the datashare data-set is successfully deleted. + text: |- + az datashare data-set wait --account-name "Account1" --name "Dataset1" --resource-group "SampleResourceG\ +roup" --share-name "Share1" --deleted +""" + +helps['datashare data-set-mapping'] = """ + type: group + short-summary: datashare data-set-mapping +""" + +helps['datashare data-set-mapping list'] = """ + type: command + short-summary: List DataSetMappings in a share subscription + examples: + - name: DataSetMappings_ListByShareSubscription + text: |- + az datashare data-set-mapping list --account-name "Account1" --resource-group "SampleResourceGroup" --sh\ +are-subscription-name "ShareSubscription1" +""" + +helps['datashare data-set-mapping show'] = """ + type: command + short-summary: Get a DataSetMapping in a shareSubscription + examples: + - name: DataSetMappings_Get + text: |- + az datashare data-set-mapping show --account-name "Account1" --name "DatasetMapping1" --resource-group "\ +SampleResourceGroup" --share-subscription-name "ShareSubscription1" +""" + +helps['datashare data-set-mapping create'] = """ + type: command + short-summary: Create a DataSetMapping + parameters: + - name: --a-d-l-s-gen2-file-data-set-mapping + short-summary: An ADLS Gen2 file data set mapping. + long-summary: | + Usage: --a-d-l-s-gen2-file-data-set-mapping data-set-id=XX file-path=XX file-system=XX output-type=XX resou\ +rce-group=XX storage-account-name=XX subscription-id=XX kind=XX + + data-set-id: Required. The id of the source data set. + file-path: Required. File path within the file system. + file-system: Required. File system to which the file belongs. + output-type: Type of output file + resource-group: Required. Resource group of storage account. + storage-account-name: Required. Storage account name of the source data set. + subscription-id: Required. Subscription id of storage account. + kind: Required. Kind of data set mapping. + - name: --a-d-l-s-gen2-file-system-data-set-mapping + short-summary: An ADLS Gen2 file system data set mapping. + long-summary: | + Usage: --a-d-l-s-gen2-file-system-data-set-mapping data-set-id=XX file-system=XX resource-group=XX storage-\ +account-name=XX subscription-id=XX kind=XX + + data-set-id: Required. The id of the source data set. + file-system: Required. The file system name. + resource-group: Required. Resource group of storage account. + storage-account-name: Required. Storage account name of the source data set. + subscription-id: Required. Subscription id of storage account. + kind: Required. Kind of data set mapping. + - name: --a-d-l-s-gen2-folder-data-set-mapping + short-summary: An ADLS Gen2 folder data set mapping. + long-summary: | + Usage: --a-d-l-s-gen2-folder-data-set-mapping data-set-id=XX file-system=XX folder-path=XX resource-group=X\ +X storage-account-name=XX subscription-id=XX kind=XX + + data-set-id: Required. The id of the source data set. + file-system: Required. File system to which the folder belongs. + folder-path: Required. Folder path within the file system. + resource-group: Required. Resource group of storage account. + storage-account-name: Required. Storage account name of the source data set. + subscription-id: Required. Subscription id of storage account. + kind: Required. Kind of data set mapping. + - name: --blob-container-data-set-mapping + short-summary: A Blob container data set mapping. + long-summary: | + Usage: --blob-container-data-set-mapping container-name=XX data-set-id=XX resource-group=XX storage-account\ +-name=XX subscription-id=XX kind=XX + + container-name: Required. BLOB Container name. + data-set-id: Required. The id of the source data set. + resource-group: Required. Resource group of storage account. + storage-account-name: Required. Storage account name of the source data set. + subscription-id: Required. Subscription id of storage account. + kind: Required. Kind of data set mapping. + - name: --blob-data-set-mapping + short-summary: A Blob data set mapping. + long-summary: | + Usage: --blob-data-set-mapping container-name=XX data-set-id=XX file-path=XX output-type=XX resource-group=\ +XX storage-account-name=XX subscription-id=XX kind=XX + + container-name: Required. Container that has the file path. + data-set-id: Required. The id of the source data set. + file-path: Required. File path within the source data set + output-type: File output type + resource-group: Required. Resource group of storage account. + storage-account-name: Required. Storage account name of the source data set. + subscription-id: Required. Subscription id of storage account. + kind: Required. Kind of data set mapping. + - name: --blob-folder-data-set-mapping + short-summary: A Blob folder data set mapping. + long-summary: | + Usage: --blob-folder-data-set-mapping container-name=XX data-set-id=XX prefix=XX resource-group=XX storage-\ +account-name=XX subscription-id=XX kind=XX + + container-name: Required. Container that has the file path. + data-set-id: Required. The id of the source data set. + prefix: Required. Prefix for blob folder + resource-group: Required. Resource group of storage account. + storage-account-name: Required. Storage account name of the source data set. + subscription-id: Required. Subscription id of storage account. + kind: Required. Kind of data set mapping. + - name: --kusto-cluster-data-set-mapping + short-summary: A Kusto cluster data set mapping + long-summary: | + Usage: --kusto-cluster-data-set-mapping data-set-id=XX kusto-cluster-resource-id=XX kind=XX + + data-set-id: Required. The id of the source data set. + kusto-cluster-resource-id: Required. Resource id of the sink kusto cluster. + kind: Required. Kind of data set mapping. + - name: --kusto-database-data-set-mapping + short-summary: A Kusto database data set mapping + long-summary: | + Usage: --kusto-database-data-set-mapping data-set-id=XX kusto-cluster-resource-id=XX kind=XX + + data-set-id: Required. The id of the source data set. + kusto-cluster-resource-id: Required. Resource id of the sink kusto cluster. + kind: Required. Kind of data set mapping. + - name: --sql-d-b-table-data-set-mapping + short-summary: A SQL DB Table data set mapping. + long-summary: | + Usage: --sql-d-b-table-data-set-mapping database-name=XX data-set-id=XX schema-name=XX sql-server-resource-\ +id=XX table-name=XX kind=XX + + database-name: Required. DatabaseName name of the sink data set + data-set-id: Required. The id of the source data set. + schema-name: Required. Schema of the table. Default value is dbo. + sql-server-resource-id: Required. Resource id of SQL server + table-name: Required. SQL DB table name. + kind: Required. Kind of data set mapping. + - name: --sql-d-w-table-data-set-mapping + short-summary: A SQL DW Table data set mapping. + long-summary: | + Usage: --sql-d-w-table-data-set-mapping data-set-id=XX data-warehouse-name=XX schema-name=XX sql-server-res\ +ource-id=XX table-name=XX kind=XX + + data-set-id: Required. The id of the source data set. + data-warehouse-name: Required. DataWarehouse name of the source data set + schema-name: Required. Schema of the table. Default value is dbo. + sql-server-resource-id: Required. Resource id of SQL server + table-name: Required. SQL DW table name. + kind: Required. Kind of data set mapping. + examples: + - name: DataSetMappings_Create + text: |- + az datashare data-set-mapping create --account-name "Account1" --blob-data-set-mapping container-name="C\ +1" data-set-id="a08f184b-0567-4b11-ba22-a1199336d226" file-path="file21" resource-group="SampleResourceGroup" storage-a\ +ccount-name="storage2" subscription-id="433a8dfd-e5d5-4e77-ad86-90acdc75eb1a" --name "DatasetMapping1" --resource-group\ + "SampleResourceGroup" --share-subscription-name "ShareSubscription1" + - name: DataSetMappings_SqlDB_Create + text: |- + az datashare data-set-mapping create --account-name "Account1" --sql-d-b-table-data-set-mapping database\ +-name="Database1" data-set-id="a08f184b-0567-4b11-ba22-a1199336d226" schema-name="dbo" sql-server-resource-id="/subscri\ +ptions/433a8dfd-e5d5-4e77-ad86-90acdc75eb1a/resourceGroups/SampleResourceGroup/providers/Microsoft.Sql/servers/Server1"\ + table-name="Table1" --name "DatasetMapping1" --resource-group "SampleResourceGroup" --share-subscription-name "ShareSu\ +bscription1" + - name: DataSetMappings_SqlDWDataSetToAdlsGen2File_Create + text: |- + az datashare data-set-mapping create --account-name "Account1" --a-d-l-s-gen2-file-data-set-mapping data\ +-set-id="a08f184b-0567-4b11-ba22-a1199336d226" file-path="file21" file-system="fileSystem" output-type="Csv" resource-g\ +roup="SampleResourceGroup" storage-account-name="storage2" subscription-id="433a8dfd-e5d5-4e77-ad86-90acdc75eb1a" --nam\ +e "DatasetMapping1" --resource-group "SampleResourceGroup" --share-subscription-name "ShareSubscription1" + - name: DataSetMappings_SqlDW_Create + text: |- + az datashare data-set-mapping create --account-name "Account1" --sql-d-w-table-data-set-mapping data-set\ +-id="a08f184b-0567-4b11-ba22-a1199336d226" data-warehouse-name="DataWarehouse1" schema-name="dbo" sql-server-resource-i\ +d="/subscriptions/433a8dfd-e5d5-4e77-ad86-90acdc75eb1a/resourceGroups/SampleResourceGroup/providers/Microsoft.Sql/serve\ +rs/Server1" table-name="Table1" --name "DatasetMapping1" --resource-group "SampleResourceGroup" --share-subscription-na\ +me "ShareSubscription1" +""" + +helps['datashare data-set-mapping delete'] = """ + type: command + short-summary: Delete a DataSetMapping in a shareSubscription + examples: + - name: DataSetMappings_Delete + text: |- + az datashare data-set-mapping delete --account-name "Account1" --name "DatasetMapping1" --resource-group\ + "SampleResourceGroup" --share-subscription-name "ShareSubscription1" +""" + +helps['datashare invitation'] = """ + type: group + short-summary: datashare invitation +""" + +helps['datashare invitation list'] = """ + type: command + short-summary: List invitations in a share + examples: + - name: Invitations_ListByShare + text: |- + az datashare invitation list --account-name "Account1" --resource-group "SampleResourceGroup" --share-na\ +me "Share1" +""" + +helps['datashare invitation show'] = """ + type: command + short-summary: Get an invitation in a share + examples: + - name: Invitations_Get + text: |- + az datashare invitation show --account-name "Account1" --name "Invitation1" --resource-group "SampleReso\ +urceGroup" --share-name "Share1" +""" + +helps['datashare invitation create'] = """ + type: command + short-summary: Create an invitation + examples: + - name: Invitations_Create + text: |- + az datashare invitation create --account-name "Account1" --target-email "receiver@microsoft.com" --name \ +"Invitation1" --resource-group "SampleResourceGroup" --share-name "Share1" +""" + +helps['datashare invitation delete'] = """ + type: command + short-summary: Delete an invitation in a share + examples: + - name: Invitations_Delete + text: |- + az datashare invitation delete --account-name "Account1" --name "Invitation1" --resource-group "SampleRe\ +sourceGroup" --share-name "Share1" +""" + +helps['datashare share'] = """ + type: group + short-summary: datashare share +""" + +helps['datashare share list'] = """ + type: command + short-summary: List shares in an account + examples: + - name: Shares_ListByAccount + text: |- + az datashare share list --account-name "Account1" --resource-group "SampleResourceGroup" +""" + +helps['datashare share show'] = """ + type: command + short-summary: Get a share + examples: + - name: Shares_Get + text: |- + az datashare share show --account-name "Account1" --resource-group "SampleResourceGroup" --name "Share1" +""" + +helps['datashare share create'] = """ + type: command + short-summary: Create a share + examples: + - name: Shares_Create + text: |- + az datashare share create --account-name "Account1" --resource-group "SampleResourceGroup" --description\ + "share description" --share-kind "CopyBased" --terms "Confidential" --name "Share1" +""" + +helps['datashare share delete'] = """ + type: command + short-summary: Delete a share + examples: + - name: Shares_Delete + text: |- + az datashare share delete --account-name "Account1" --resource-group "SampleResourceGroup" --name "Share\ +1" +""" + +helps['datashare share list-synchronization'] = """ + type: command + short-summary: List synchronizations of a share + examples: + - name: Shares_ListSynchronizations + text: |- + az datashare share list-synchronization --account-name "Account1" --resource-group "SampleResourceGroup"\ + --name "Share1" +""" + +helps['datashare share list-synchronization-detail'] = """ + type: command + short-summary: List synchronization details + examples: + - name: Shares_ListSynchronizationDetails + text: |- + az datashare share list-synchronization-detail --account-name "Account1" --resource-group "SampleResourc\ +eGroup" --name "Share1" --synchronization-id "7d0536a6-3fa5-43de-b152-3d07c4f6b2bb" +""" + +helps['datashare share wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the datashare share is met. + examples: + - name: Pause executing next line of CLI script until the datashare share is successfully deleted. + text: |- + az datashare share wait --account-name "Account1" --resource-group "SampleResourceGroup" --name "Share1"\ + --deleted +""" + +helps['datashare provider-share-subscription'] = """ + type: group + short-summary: datashare provider-share-subscription +""" + +helps['datashare provider-share-subscription list'] = """ + type: command + short-summary: List share subscriptions in a provider share + examples: + - name: ProviderShareSubscriptions_ListByShare + text: |- + az datashare provider-share-subscription list --account-name "Account1" --resource-group "SampleResource\ +Group" --share-name "Share1" +""" + +helps['datashare provider-share-subscription get-by-share'] = """ + type: command + short-summary: Get share subscription in a provider share + examples: + - name: ProviderShareSubscriptions_GetByShare + text: |- + az datashare provider-share-subscription get-by-share --account-name "Account1" --provider-share-subscri\ +ption-id "4256e2cf-0f82-4865-961b-12f83333f487" --resource-group "SampleResourceGroup" --share-name "Share1" +""" + +helps['datashare provider-share-subscription reinstate'] = """ + type: command + short-summary: Reinstate share subscription in a provider share + examples: + - name: ProviderShareSubscriptions_Reinstate + text: |- + az datashare provider-share-subscription reinstate --account-name "Account1" --provider-share-subscripti\ +on-id "4256e2cf-0f82-4865-961b-12f83333f487" --resource-group "SampleResourceGroup" --share-name "Share1" +""" + +helps['datashare provider-share-subscription revoke'] = """ + type: command + short-summary: Revoke share subscription in a provider share + examples: + - name: ProviderShareSubscriptions_Revoke + text: |- + az datashare provider-share-subscription revoke --account-name "Account1" --provider-share-subscription-\ +id "4256e2cf-0f82-4865-961b-12f83333f487" --resource-group "SampleResourceGroup" --share-name "Share1" +""" + +helps['datashare share-subscription'] = """ + type: group + short-summary: datashare share-subscription +""" + +helps['datashare share-subscription list'] = """ + type: command + short-summary: List share subscriptions in an account + examples: + - name: ShareSubscriptions_ListByAccount + text: |- + az datashare share-subscription list --account-name "Account1" --resource-group "SampleResourceGroup" +""" + +helps['datashare share-subscription show'] = """ + type: command + short-summary: Get a shareSubscription in an account + examples: + - name: ShareSubscriptions_Get + text: |- + az datashare share-subscription show --account-name "Account1" --resource-group "SampleResourceGroup" --\ +name "ShareSubscription1" +""" + +helps['datashare share-subscription create'] = """ + type: command + short-summary: Create a shareSubscription in an account + examples: + - name: ShareSubscriptions_Create + text: |- + az datashare share-subscription create --account-name "Account1" --resource-group "SampleResourceGroup" \ +--invitation-id "12345678-1234-1234-12345678abd" --source-share-location "eastus2" --name "ShareSubscription1" +""" + +helps['datashare share-subscription delete'] = """ + type: command + short-summary: Delete a shareSubscription in an account + examples: + - name: ShareSubscriptions_Delete + text: |- + az datashare share-subscription delete --account-name "Account1" --resource-group "SampleResourceGroup" \ +--name "ShareSubscription1" +""" + +helps['datashare share-subscription cancel-synchronization'] = """ + type: command + short-summary: Request to cancel a synchronization. + examples: + - name: ShareSubscriptions_CancelSynchronization + text: |- + az datashare share-subscription cancel-synchronization --account-name "Account1" --resource-group "Sampl\ +eResourceGroup" --name "ShareSubscription1" --synchronization-id "7d0536a6-3fa5-43de-b152-3d07c4f6b2bb" +""" + +helps['datashare share-subscription list-source-share-synchronization-setting'] = """ + type: command + short-summary: Get synchronization settings set on a share + examples: + - name: ShareSubscriptions_ListSourceShareSynchronizationSettings + text: |- + az datashare share-subscription list-source-share-synchronization-setting --account-name "Account1" --re\ +source-group "SampleResourceGroup" --name "ShareSub1" +""" + +helps['datashare share-subscription list-synchronization'] = """ + type: command + short-summary: List synchronizations of a share subscription + examples: + - name: ShareSubscriptions_ListSynchronizations + text: |- + az datashare share-subscription list-synchronization --account-name "Account1" --resource-group "SampleR\ +esourceGroup" --name "ShareSub1" +""" + +helps['datashare share-subscription list-synchronization-detail'] = """ + type: command + short-summary: List synchronization details + examples: + - name: ShareSubscriptions_ListSynchronizationDetails + text: |- + az datashare share-subscription list-synchronization-detail --account-name "Account1" --resource-group "\ +SampleResourceGroup" --name "ShareSub1" --synchronization-id "7d0536a6-3fa5-43de-b152-3d07c4f6b2bb" +""" + +helps['datashare share-subscription synchronize'] = """ + type: command + short-summary: Initiate a copy + examples: + - name: ShareSubscriptions_Synchronize + text: |- + az datashare share-subscription synchronize --account-name "Account1" --resource-group "SampleResourceGr\ +oup" --name "ShareSubscription1" --synchronization-mode "Incremental" +""" + +helps['datashare share-subscription wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the datashare share-subscription is met. + examples: + - name: Pause executing next line of CLI script until the datashare share-subscription is successfully deleted. + text: |- + az datashare share-subscription wait --account-name "Account1" --resource-group "SampleResourceGroup" --\ +name "ShareSubscription1" --deleted + - name: Pause executing next line of CLI script until the datashare share-subscription is successfully created. + text: |- + az datashare share-subscription wait --account-name "Account1" --resource-group "SampleResourceGroup" --\ +name "ShareSubscription1" --created +""" + +helps['datashare consumer-source-data-set'] = """ + type: group + short-summary: datashare consumer-source-data-set +""" + +helps['datashare consumer-source-data-set list'] = """ + type: command + short-summary: Get source dataSets of a shareSubscription + examples: + - name: ConsumerSourceDataSets_ListByShareSubscription + text: |- + az datashare consumer-source-data-set list --account-name "Account1" --resource-group "SampleResourceGro\ +up" --share-subscription-name "Share1" +""" + +helps['datashare synchronization-setting'] = """ + type: group + short-summary: datashare synchronization-setting +""" + +helps['datashare synchronization-setting list'] = """ + type: command + short-summary: List synchronizationSettings in a share + examples: + - name: SynchronizationSettings_ListByShare + text: |- + az datashare synchronization-setting list --account-name "Account1" --resource-group "SampleResourceGrou\ +p" --share-name "Share1" +""" + +helps['datashare synchronization-setting show'] = """ + type: command + short-summary: Get a synchronizationSetting in a share + examples: + - name: SynchronizationSettings_Get + text: |- + az datashare synchronization-setting show --account-name "Account1" --resource-group "SampleResourceGrou\ +p" --share-name "Share1" --name "SyncrhonizationSetting1" +""" + +helps['datashare synchronization-setting create'] = """ + type: command + short-summary: Create or update a synchronizationSetting + parameters: + - name: --scheduled-synchronization-setting + short-summary: A type of synchronization setting based on schedule + long-summary: | + Usage: --scheduled-synchronization-setting recurrence-interval=XX synchronization-time=XX kind=XX + + recurrence-interval: Required. Recurrence Interval + synchronization-time: Required. Synchronization time + kind: Required. Kind of synchronization + examples: + - name: SynchronizationSettings_Create + text: |- + az datashare synchronization-setting create --account-name "Account1" --resource-group "SampleResourceGr\ +oup" --share-name "Share1" --scheduled-synchronization-setting recurrence-interval="Day" synchronization-time="2018-11-\ +14T04:47:52.9614956Z" --name "Dataset1" +""" + +helps['datashare synchronization-setting delete'] = """ + type: command + short-summary: Delete a synchronizationSetting in a share + examples: + - name: SynchronizationSettings_Delete + text: |- + az datashare synchronization-setting delete --account-name "Account1" --resource-group "SampleResourceGr\ +oup" --share-name "Share1" --name "SyncrhonizationSetting1" +""" + +helps['datashare synchronization-setting wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the datashare synchronization-setting is met. + examples: + - name: Pause executing next line of CLI script until the datashare synchronization-setting is successfully delet\ +ed. + text: |- + az datashare synchronization-setting wait --account-name "Account1" --resource-group "SampleResourceGrou\ +p" --share-name "Share1" --name "SyncrhonizationSetting1" --deleted +""" + +helps['datashare trigger'] = """ + type: group + short-summary: datashare trigger +""" + +helps['datashare trigger list'] = """ + type: command + short-summary: List Triggers in a share subscription + examples: + - name: Triggers_ListByShareSubscription + text: |- + az datashare trigger list --account-name "Account1" --resource-group "SampleResourceGroup" --share-subsc\ +ription-name "ShareSubscription1" +""" + +helps['datashare trigger show'] = """ + type: command + short-summary: Get a Trigger in a shareSubscription + examples: + - name: Triggers_Get + text: |- + az datashare trigger show --account-name "Account1" --resource-group "SampleResourceGroup" --share-subsc\ +ription-name "ShareSubscription1" --name "Trigger1" +""" + +helps['datashare trigger create'] = """ + type: command + short-summary: Create a Trigger + parameters: + - name: --scheduled-trigger + short-summary: A type of trigger based on schedule + long-summary: | + Usage: --scheduled-trigger recurrence-interval=XX synchronization-mode=XX synchronization-time=XX kind=XX + + recurrence-interval: Required. Recurrence Interval + synchronization-mode: Synchronization mode + synchronization-time: Required. Synchronization time + kind: Required. Kind of synchronization + examples: + - name: Triggers_Create + text: |- + az datashare trigger create --account-name "Account1" --resource-group "SampleResourceGroup" --share-sub\ +scription-name "ShareSubscription1" --scheduled-trigger recurrence-interval="Day" synchronization-mode="Incremental" sy\ +nchronization-time="2018-11-14T04:47:52.9614956Z" --name "Trigger1" +""" + +helps['datashare trigger delete'] = """ + type: command + short-summary: Delete a Trigger in a shareSubscription + examples: + - name: Triggers_Delete + text: |- + az datashare trigger delete --account-name "Account1" --resource-group "SampleResourceGroup" --share-sub\ +scription-name "ShareSubscription1" --name "Trigger1" +""" + +helps['datashare trigger wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the datashare trigger is met. + examples: + - name: Pause executing next line of CLI script until the datashare trigger is successfully created. + text: |- + az datashare trigger wait --account-name "Account1" --resource-group "SampleResourceGroup" --share-subsc\ +ription-name "ShareSubscription1" --name "Trigger1" --created + - name: Pause executing next line of CLI script until the datashare trigger is successfully deleted. + text: |- + az datashare trigger wait --account-name "Account1" --resource-group "SampleResourceGroup" --share-subsc\ +ription-name "ShareSubscription1" --name "Trigger1" --deleted +""" diff --git a/src/datashare/azext_datashare/generated/_params.py b/src/datashare/azext_datashare/generated/_params.py new file mode 100644 index 0000000000..89c944ed78 --- /dev/null +++ b/src/datashare/azext_datashare/generated/_params.py @@ -0,0 +1,468 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements + +from azure.cli.core.commands.parameters import ( + tags_type, + get_enum_type, + resource_group_name_type, + get_location_type +) +from azure.cli.core.commands.validators import get_default_location_from_resource_group +from azext_datashare.action import ( + AddADLSGen1FileDataSet, + AddADLSGen1FolderDataSet, + AddADLSGen2FileDataSet, + AddADLSGen2FileSystemDataSet, + AddADLSGen2FolderDataSet, + AddBlobContainerDataSet, + AddBlobDataSet, + AddBlobFolderDataSet, + AddKustoClusterDataSet, + AddKustoDatabaseDataSet, + AddSqlDBTableDataSet, + AddSqlDWTableDataSet, + AddADLSGen2FileDataSetMapping, + AddADLSGen2FileSystemDataSetMapping, + AddADLSGen2FolderDataSetMapping, + AddBlobContainerDataSetMapping, + AddBlobDataSetMapping, + AddBlobFolderDataSetMapping, + AddKustoClusterDataSetMapping, + AddKustoDatabaseDataSetMapping, + AddSqlDBTableDataSetMapping, + AddSqlDWTableDataSetMapping, + AddScheduledSynchronizationSetting, + AddScheduledTrigger +) + + +def load_arguments(self, _): + + with self.argument_context('datashare account list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('skip_token', help='Continuation token') + + with self.argument_context('datashare account show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', options_list=['--name', '-n'], help='The name of the share account.', + id_part='name') + + with self.argument_context('datashare account create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', options_list=['--name', '-n'], help='The name of the share account.') + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('tags', tags_type) + + with self.argument_context('datashare account update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', options_list=['--name', '-n'], help='The name of the share account.', + id_part='name') + c.argument('tags', tags_type) + + with self.argument_context('datashare account delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', options_list=['--name', '-n'], help='The name of the share account.', + id_part='name') + + with self.argument_context('datashare account wait') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', options_list=['--name', '-n'], help='The name of the share account.', + id_part='name') + + with self.argument_context('datashare consumer-invitation show') as c: + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('invitation_id', help='An invitation id') + + with self.argument_context('datashare consumer-invitation list-invitation') as c: + c.argument('skip_token', help='The continuation token') + + with self.argument_context('datashare consumer-invitation reject-invitation') as c: + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('invitation_id', help='Unique id of the invitation.') + + with self.argument_context('datashare data-set list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.') + c.argument('share_name', help='The name of the share.') + c.argument('skip_token', help='continuation token') + c.argument('filter', help='Filters the results using OData syntax.') + c.argument('orderby', help='Sorts the results using OData syntax.') + + with self.argument_context('datashare data-set show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.', id_part='name') + c.argument('share_name', help='The name of the share.', id_part='child_name_1') + c.argument('data_set_name', options_list=['--name', '-n'], help='The name of the dataSet.', id_part='child_name' + '_2') + + with self.argument_context('datashare data-set create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.') + c.argument('share_name', help='The name of the share to add the data set to.') + c.argument('data_set_name', options_list=['--name', '-n'], help='The name of the dataSet.') + c.argument('a_d_l_s_gen1_file_data_set', action=AddADLSGen1FileDataSet, nargs='+', help='An ADLS Gen 1 file dat' + 'a set.', arg_group='DataSet') + c.argument('a_d_l_s_gen1_folder_data_set', action=AddADLSGen1FolderDataSet, nargs='+', help='An ADLS Gen 1 fold' + 'er data set.', arg_group='DataSet') + c.argument('a_d_l_s_gen2_file_data_set', action=AddADLSGen2FileDataSet, nargs='+', help='An ADLS Gen 2 file dat' + 'a set.', arg_group='DataSet') + c.argument('a_d_l_s_gen2_file_system_data_set', action=AddADLSGen2FileSystemDataSet, nargs='+', help='An ADLS G' + 'en 2 file system data set.', arg_group='DataSet') + c.argument('a_d_l_s_gen2_folder_data_set', action=AddADLSGen2FolderDataSet, nargs='+', help='An ADLS Gen 2 fold' + 'er data set.', arg_group='DataSet') + c.argument('blob_container_data_set', action=AddBlobContainerDataSet, nargs='+', help='An Azure storage blob co' + 'ntainer data set.', arg_group='DataSet') + c.argument('blob_data_set', action=AddBlobDataSet, nargs='+', help='An Azure storage blob data set.', + arg_group='DataSet') + c.argument('blob_folder_data_set', action=AddBlobFolderDataSet, nargs='+', help='An Azure storage blob folder d' + 'ata set.', arg_group='DataSet') + c.argument('kusto_cluster_data_set', action=AddKustoClusterDataSet, nargs='+', + help='A kusto cluster data set.', arg_group='DataSet') + c.argument('kusto_database_data_set', action=AddKustoDatabaseDataSet, nargs='+', help='A kusto database data se' + 't.', arg_group='DataSet') + c.argument('sql_d_b_table_data_set', action=AddSqlDBTableDataSet, nargs='+', help='A SQL DB table data set.', + arg_group='DataSet') + c.argument('sql_d_w_table_data_set', action=AddSqlDWTableDataSet, nargs='+', help='A SQL DW table data set.', + arg_group='DataSet') + + with self.argument_context('datashare data-set delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.', id_part='name') + c.argument('share_name', help='The name of the share.', id_part='child_name_1') + c.argument('data_set_name', options_list=['--name', '-n'], help='The name of the dataSet.', id_part='child_name' + '_2') + + with self.argument_context('datashare data-set wait') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.', id_part='name') + c.argument('share_name', help='The name of the share.', id_part='child_name_1') + c.argument('data_set_name', options_list=['--name', '-n'], help='The name of the dataSet.', id_part='child_name' + '_2') + + with self.argument_context('datashare data-set-mapping list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.') + c.argument('share_subscription_name', help='The name of the share subscription.') + c.argument('skip_token', help='Continuation token') + c.argument('filter', help='Filters the results using OData syntax.') + c.argument('orderby', help='Sorts the results using OData syntax.') + + with self.argument_context('datashare data-set-mapping show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.', id_part='name') + c.argument('share_subscription_name', help='The name of the shareSubscription.', id_part='child_name_1') + c.argument('data_set_mapping_name', options_list=['--name', '-n'], help='The name of the dataSetMapping.', + id_part='child_name_2') + + with self.argument_context('datashare data-set-mapping create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.') + c.argument('share_subscription_name', help='The name of the share subscription which will hold the data set sin' + 'k.') + c.argument('data_set_mapping_name', options_list=['--name', '-n'], help='The name of the data set mapping to be' + ' created.') + c.argument('a_d_l_s_gen2_file_data_set_mapping', action=AddADLSGen2FileDataSetMapping, nargs='+', help='An ADLS' + ' Gen2 file data set mapping.', arg_group='DataSetMapping') + c.argument('a_d_l_s_gen2_file_system_data_set_mapping', action=AddADLSGen2FileSystemDataSetMapping, nargs='+', + help='An ADLS Gen2 file system data set mapping.', arg_group='DataSetMapping') + c.argument('a_d_l_s_gen2_folder_data_set_mapping', action=AddADLSGen2FolderDataSetMapping, nargs='+', help='An ' + 'ADLS Gen2 folder data set mapping.', arg_group='DataSetMapping') + c.argument('blob_container_data_set_mapping', action=AddBlobContainerDataSetMapping, nargs='+', help='A Blob co' + 'ntainer data set mapping.', arg_group='DataSetMapping') + c.argument('blob_data_set_mapping', action=AddBlobDataSetMapping, nargs='+', help='A Blob data set mapping.', + arg_group='DataSetMapping') + c.argument('blob_folder_data_set_mapping', action=AddBlobFolderDataSetMapping, nargs='+', help='A Blob folder d' + 'ata set mapping.', arg_group='DataSetMapping') + c.argument('kusto_cluster_data_set_mapping', action=AddKustoClusterDataSetMapping, nargs='+', help='A Kusto clu' + 'ster data set mapping', arg_group='DataSetMapping') + c.argument('kusto_database_data_set_mapping', action=AddKustoDatabaseDataSetMapping, nargs='+', help='A Kusto d' + 'atabase data set mapping', arg_group='DataSetMapping') + c.argument('sql_d_b_table_data_set_mapping', action=AddSqlDBTableDataSetMapping, nargs='+', help='A SQL DB Tabl' + 'e data set mapping.', arg_group='DataSetMapping') + c.argument('sql_d_w_table_data_set_mapping', action=AddSqlDWTableDataSetMapping, nargs='+', help='A SQL DW Tabl' + 'e data set mapping.', arg_group='DataSetMapping') + + with self.argument_context('datashare data-set-mapping delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.', id_part='name') + c.argument('share_subscription_name', help='The name of the shareSubscription.', id_part='child_name_1') + c.argument('data_set_mapping_name', options_list=['--name', '-n'], help='The name of the dataSetMapping.', + id_part='child_name_2') + + with self.argument_context('datashare invitation list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.') + c.argument('share_name', help='The name of the share.') + c.argument('skip_token', help='The continuation token') + c.argument('filter', help='Filters the results using OData syntax.') + c.argument('orderby', help='Sorts the results using OData syntax.') + + with self.argument_context('datashare invitation show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.', id_part='name') + c.argument('share_name', help='The name of the share.', id_part='child_name_1') + c.argument('invitation_name', options_list=['--name', '-n'], help='The name of the invitation.', id_part='child' + '_name_2') + + with self.argument_context('datashare invitation create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.') + c.argument('share_name', help='The name of the share to send the invitation for.') + c.argument('invitation_name', options_list=['--name', '-n'], help='The name of the invitation.') + c.argument('target_active_directory_id', help='The target Azure AD Id. Can\'t be combined with email.') + c.argument('target_email', help='The email the invitation is directed to.') + c.argument('target_object_id', help='The target user or application Id that invitation is being sent to. Must b' + 'e specified along TargetActiveDirectoryId. This enables sending invitations to specific users or ap' + 'plications in an AD tenant.') + + with self.argument_context('datashare invitation delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.', id_part='name') + c.argument('share_name', help='The name of the share.', id_part='child_name_1') + c.argument('invitation_name', options_list=['--name', '-n'], help='The name of the invitation.', id_part='child' + '_name_2') + + with self.argument_context('datashare share list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.') + c.argument('skip_token', help='Continuation Token') + c.argument('filter', help='Filters the results using OData syntax.') + c.argument('orderby', help='Sorts the results using OData syntax.') + + with self.argument_context('datashare share show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.', id_part='name') + c.argument('share_name', options_list=['--name', '-n'], help='The name of the share to retrieve.', id_part='chi' + 'ld_name_1') + + with self.argument_context('datashare share create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.') + c.argument('share_name', options_list=['--name', '-n'], help='The name of the share.') + c.argument('description', help='Share description.') + c.argument('share_kind', arg_type=get_enum_type(['CopyBased', 'InPlace']), help='Share kind.') + c.argument('terms', help='Share terms.') + + with self.argument_context('datashare share delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.', id_part='name') + c.argument('share_name', options_list=['--name', '-n'], help='The name of the share.', id_part='child_name_1') + + with self.argument_context('datashare share list-synchronization') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.') + c.argument('share_name', options_list=['--name', '-n'], help='The name of the share.') + c.argument('skip_token', help='Continuation token') + c.argument('filter', help='Filters the results using OData syntax.') + c.argument('orderby', help='Sorts the results using OData syntax.') + + with self.argument_context('datashare share list-synchronization-detail') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.') + c.argument('share_name', options_list=['--name', '-n'], help='The name of the share.') + c.argument('skip_token', help='Continuation token') + c.argument('filter', help='Filters the results using OData syntax.') + c.argument('orderby', help='Sorts the results using OData syntax.') + c.argument('consumer_email', help='Email of the user who created the synchronization') + c.argument('consumer_name', help='Name of the user who created the synchronization') + c.argument('consumer_tenant_name', help='Tenant name of the consumer who created the synchronization') + c.argument('duration_ms', help='synchronization duration') + c.argument('end_time', help='End time of synchronization') + c.argument('message', help='message of synchronization') + c.argument('start_time', help='start time of synchronization') + c.argument('status', help='Raw Status') + c.argument('synchronization_id', help='Synchronization id') + + with self.argument_context('datashare share wait') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.', id_part='name') + c.argument('share_name', options_list=['--name', '-n'], help='The name of the share to retrieve.', id_part='chi' + 'ld_name_1') + + with self.argument_context('datashare provider-share-subscription list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.') + c.argument('share_name', help='The name of the share.') + c.argument('skip_token', help='Continuation Token') + + with self.argument_context('datashare provider-share-subscription get-by-share') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.', id_part='name') + c.argument('share_name', help='The name of the share.', id_part='child_name_1') + c.argument('provider_share_subscription_id', help='To locate shareSubscription', id_part='child_name_2') + + with self.argument_context('datashare provider-share-subscription reinstate') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.', id_part='name') + c.argument('share_name', help='The name of the share.', id_part='child_name_1') + c.argument('provider_share_subscription_id', help='To locate shareSubscription', id_part='child_name_2') + + with self.argument_context('datashare provider-share-subscription revoke') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.', id_part='name') + c.argument('share_name', help='The name of the share.', id_part='child_name_1') + c.argument('provider_share_subscription_id', help='To locate shareSubscription', id_part='child_name_2') + + with self.argument_context('datashare share-subscription list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.') + c.argument('skip_token', help='Continuation Token') + c.argument('filter', help='Filters the results using OData syntax.') + c.argument('orderby', help='Sorts the results using OData syntax.') + + with self.argument_context('datashare share-subscription show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.', id_part='name') + c.argument('share_subscription_name', options_list=['--name', '-n'], help='The name of the shareSubscription.', + id_part='child_name_1') + + with self.argument_context('datashare share-subscription create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.') + c.argument('share_subscription_name', options_list=['--name', '-n'], + help='The name of the shareSubscription.') + c.argument('invitation_id', help='The invitation id.') + c.argument('source_share_location', help='Source share location.') + + with self.argument_context('datashare share-subscription delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.', id_part='name') + c.argument('share_subscription_name', options_list=['--name', '-n'], help='The name of the shareSubscription.', + id_part='child_name_1') + + with self.argument_context('datashare share-subscription cancel-synchronization') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.', id_part='name') + c.argument('share_subscription_name', options_list=['--name', '-n'], help='The name of the shareSubscription.', + id_part='child_name_1') + c.argument('synchronization_id', help='Synchronization id') + + with self.argument_context('datashare share-subscription list-source-share-synchronization-setting') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.') + c.argument('share_subscription_name', options_list=['--name', '-n'], + help='The name of the shareSubscription.') + c.argument('skip_token', help='Continuation token') + + with self.argument_context('datashare share-subscription list-synchronization') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.') + c.argument('share_subscription_name', options_list=['--name', '-n'], + help='The name of the share subscription.') + c.argument('skip_token', help='Continuation token') + c.argument('filter', help='Filters the results using OData syntax.') + c.argument('orderby', help='Sorts the results using OData syntax.') + + with self.argument_context('datashare share-subscription list-synchronization-detail') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.') + c.argument('share_subscription_name', options_list=['--name', '-n'], + help='The name of the share subscription.') + c.argument('skip_token', help='Continuation token') + c.argument('filter', help='Filters the results using OData syntax.') + c.argument('orderby', help='Sorts the results using OData syntax.') + c.argument('synchronization_id', help='Synchronization id') + + with self.argument_context('datashare share-subscription synchronize') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.', id_part='name') + c.argument('share_subscription_name', options_list=['--name', '-n'], help='The name of share subscription', + id_part='child_name_1') + c.argument('synchronization_mode', arg_type=get_enum_type(['Incremental', 'FullSync']), help='Mode of synchroni' + 'zation used in triggers and snapshot sync. Incremental by default') + + with self.argument_context('datashare share-subscription wait') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.', id_part='name') + c.argument('share_subscription_name', options_list=['--name', '-n'], help='The name of the shareSubscription.', + id_part='child_name_1') + + with self.argument_context('datashare consumer-source-data-set list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.') + c.argument('share_subscription_name', help='The name of the shareSubscription.') + c.argument('skip_token', help='Continuation token') + + with self.argument_context('datashare synchronization-setting list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.') + c.argument('share_name', help='The name of the share.') + c.argument('skip_token', help='continuation token') + + with self.argument_context('datashare synchronization-setting show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.', id_part='name') + c.argument('share_name', help='The name of the share.', id_part='child_name_1') + c.argument('synchronization_setting_name', options_list=['--name', '-n'], help='The name of the synchronization' + 'Setting.', id_part='child_name_2') + + with self.argument_context('datashare synchronization-setting create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.') + c.argument('share_name', help='The name of the share to add the synchronization setting to.') + c.argument('synchronization_setting_name', options_list=['--name', '-n'], help='The name of the synchronization' + 'Setting.') + c.argument('scheduled_synchronization_setting', action=AddScheduledSynchronizationSetting, nargs='+', help='A t' + 'ype of synchronization setting based on schedule', arg_group='SynchronizationSetting') + + with self.argument_context('datashare synchronization-setting delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.', id_part='name') + c.argument('share_name', help='The name of the share.', id_part='child_name_1') + c.argument('synchronization_setting_name', options_list=['--name', '-n'], help='The name of the synchronization' + 'Setting .', id_part='child_name_2') + + with self.argument_context('datashare synchronization-setting wait') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.', id_part='name') + c.argument('share_name', help='The name of the share.', id_part='child_name_1') + c.argument('synchronization_setting_name', options_list=['--name', '-n'], help='The name of the synchronization' + 'Setting.', id_part='child_name_2') + + with self.argument_context('datashare trigger list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.') + c.argument('share_subscription_name', help='The name of the share subscription.') + c.argument('skip_token', help='Continuation token') + + with self.argument_context('datashare trigger show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.', id_part='name') + c.argument('share_subscription_name', help='The name of the shareSubscription.', id_part='child_name_1') + c.argument('trigger_name', options_list=['--name', '-n'], help='The name of the trigger.', id_part='child_name_' + '2') + + with self.argument_context('datashare trigger create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.') + c.argument('share_subscription_name', help='The name of the share subscription which will hold the data set sin' + 'k.') + c.argument('trigger_name', options_list=['--name', '-n'], help='The name of the trigger.') + c.argument('scheduled_trigger', action=AddScheduledTrigger, nargs='+', help='A type of trigger based on schedul' + 'e', arg_group='Trigger') + + with self.argument_context('datashare trigger delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.', id_part='name') + c.argument('share_subscription_name', help='The name of the shareSubscription.', id_part='child_name_1') + c.argument('trigger_name', options_list=['--name', '-n'], help='The name of the trigger.', id_part='child_name_' + '2') + + with self.argument_context('datashare trigger wait') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', help='The name of the share account.', id_part='name') + c.argument('share_subscription_name', help='The name of the shareSubscription.', id_part='child_name_1') + c.argument('trigger_name', options_list=['--name', '-n'], help='The name of the trigger.', id_part='child_name_' + '2') diff --git a/src/datashare/azext_datashare/generated/_validators.py b/src/datashare/azext_datashare/generated/_validators.py new file mode 100644 index 0000000000..e5ac783867 --- /dev/null +++ b/src/datashare/azext_datashare/generated/_validators.py @@ -0,0 +1,9 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- diff --git a/src/datashare/azext_datashare/generated/action.py b/src/datashare/azext_datashare/generated/action.py new file mode 100644 index 0000000000..742b1d9187 --- /dev/null +++ b/src/datashare/azext_datashare/generated/action.py @@ -0,0 +1,722 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=protected-access + +import argparse +from knack.util import CLIError +from collections import defaultdict + + +class AddADLSGen1FileDataSet(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.a_d_l_s_gen1_file_data_set = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'account-name': + d['account_name'] = v[0] + elif kl == 'file-name': + d['file_name'] = v[0] + elif kl == 'folder-path': + d['folder_path'] = v[0] + elif kl == 'resource-group': + d['resource_group'] = v[0] + elif kl == 'subscription-id': + d['subscription_id'] = v[0] + d['kind'] = 'AdlsGen1File' + return d + + +class AddADLSGen1FolderDataSet(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.a_d_l_s_gen1_folder_data_set = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'account-name': + d['account_name'] = v[0] + elif kl == 'folder-path': + d['folder_path'] = v[0] + elif kl == 'resource-group': + d['resource_group'] = v[0] + elif kl == 'subscription-id': + d['subscription_id'] = v[0] + d['kind'] = 'AdlsGen1Folder' + return d + + +class AddADLSGen2FileDataSet(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.a_d_l_s_gen2_file_data_set = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'file-path': + d['file_path'] = v[0] + elif kl == 'file-system': + d['file_system'] = v[0] + elif kl == 'resource-group': + d['resource_group'] = v[0] + elif kl == 'storage-account-name': + d['storage_account_name'] = v[0] + elif kl == 'subscription-id': + d['subscription_id'] = v[0] + d['kind'] = 'AdlsGen2File' + return d + + +class AddADLSGen2FileSystemDataSet(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.a_d_l_s_gen2_file_system_data_set = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'file-system': + d['file_system'] = v[0] + elif kl == 'resource-group': + d['resource_group'] = v[0] + elif kl == 'storage-account-name': + d['storage_account_name'] = v[0] + elif kl == 'subscription-id': + d['subscription_id'] = v[0] + d['kind'] = 'AdlsGen2FileSystem' + return d + + +class AddADLSGen2FolderDataSet(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.a_d_l_s_gen2_folder_data_set = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'file-system': + d['file_system'] = v[0] + elif kl == 'folder-path': + d['folder_path'] = v[0] + elif kl == 'resource-group': + d['resource_group'] = v[0] + elif kl == 'storage-account-name': + d['storage_account_name'] = v[0] + elif kl == 'subscription-id': + d['subscription_id'] = v[0] + d['kind'] = 'AdlsGen2Folder' + return d + + +class AddBlobContainerDataSet(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.blob_container_data_set = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'container-name': + d['container_name'] = v[0] + elif kl == 'resource-group': + d['resource_group'] = v[0] + elif kl == 'storage-account-name': + d['storage_account_name'] = v[0] + elif kl == 'subscription-id': + d['subscription_id'] = v[0] + d['kind'] = 'Container' + return d + + +class AddBlobDataSet(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.blob_data_set = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'container-name': + d['container_name'] = v[0] + elif kl == 'file-path': + d['file_path'] = v[0] + elif kl == 'resource-group': + d['resource_group'] = v[0] + elif kl == 'storage-account-name': + d['storage_account_name'] = v[0] + elif kl == 'subscription-id': + d['subscription_id'] = v[0] + d['kind'] = 'Blob' + return d + + +class AddBlobFolderDataSet(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.blob_folder_data_set = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'container-name': + d['container_name'] = v[0] + elif kl == 'prefix': + d['prefix'] = v[0] + elif kl == 'resource-group': + d['resource_group'] = v[0] + elif kl == 'storage-account-name': + d['storage_account_name'] = v[0] + elif kl == 'subscription-id': + d['subscription_id'] = v[0] + d['kind'] = 'BlobFolder' + return d + + +class AddKustoClusterDataSet(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.kusto_cluster_data_set = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'kusto-cluster-resource-id': + d['kusto_cluster_resource_id'] = v[0] + d['kind'] = 'KustoCluster' + return d + + +class AddKustoDatabaseDataSet(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.kusto_database_data_set = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'kusto-database-resource-id': + d['kusto_database_resource_id'] = v[0] + d['kind'] = 'KustoDatabase' + return d + + +class AddSqlDBTableDataSet(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.sql_d_b_table_data_set = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'database-name': + d['database_name'] = v[0] + elif kl == 'schema-name': + d['schema_name'] = v[0] + elif kl == 'sql-server-resource-id': + d['sql_server_resource_id'] = v[0] + elif kl == 'table-name': + d['table_name'] = v[0] + d['kind'] = 'SqlDBTable' + return d + + +class AddSqlDWTableDataSet(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.sql_d_w_table_data_set = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'data-warehouse-name': + d['data_warehouse_name'] = v[0] + elif kl == 'schema-name': + d['schema_name'] = v[0] + elif kl == 'sql-server-resource-id': + d['sql_server_resource_id'] = v[0] + elif kl == 'table-name': + d['table_name'] = v[0] + d['kind'] = 'SqlDWTable' + return d + + +class AddADLSGen2FileDataSetMapping(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.a_d_l_s_gen2_file_data_set_mapping = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'data-set-id': + d['data_set_id'] = v[0] + elif kl == 'file-path': + d['file_path'] = v[0] + elif kl == 'file-system': + d['file_system'] = v[0] + elif kl == 'output-type': + d['output_type'] = v[0] + elif kl == 'resource-group': + d['resource_group'] = v[0] + elif kl == 'storage-account-name': + d['storage_account_name'] = v[0] + elif kl == 'subscription-id': + d['subscription_id'] = v[0] + d['kind'] = 'AdlsGen2File' + return d + + +class AddADLSGen2FileSystemDataSetMapping(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.a_d_l_s_gen2_file_system_data_set_mapping = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'data-set-id': + d['data_set_id'] = v[0] + elif kl == 'file-system': + d['file_system'] = v[0] + elif kl == 'resource-group': + d['resource_group'] = v[0] + elif kl == 'storage-account-name': + d['storage_account_name'] = v[0] + elif kl == 'subscription-id': + d['subscription_id'] = v[0] + d['kind'] = 'AdlsGen2FileSystem' + return d + + +class AddADLSGen2FolderDataSetMapping(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.a_d_l_s_gen2_folder_data_set_mapping = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'data-set-id': + d['data_set_id'] = v[0] + elif kl == 'file-system': + d['file_system'] = v[0] + elif kl == 'folder-path': + d['folder_path'] = v[0] + elif kl == 'resource-group': + d['resource_group'] = v[0] + elif kl == 'storage-account-name': + d['storage_account_name'] = v[0] + elif kl == 'subscription-id': + d['subscription_id'] = v[0] + d['kind'] = 'AdlsGen2Folder' + return d + + +class AddBlobContainerDataSetMapping(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.blob_container_data_set_mapping = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'container-name': + d['container_name'] = v[0] + elif kl == 'data-set-id': + d['data_set_id'] = v[0] + elif kl == 'resource-group': + d['resource_group'] = v[0] + elif kl == 'storage-account-name': + d['storage_account_name'] = v[0] + elif kl == 'subscription-id': + d['subscription_id'] = v[0] + d['kind'] = 'Container' + return d + + +class AddBlobDataSetMapping(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.blob_data_set_mapping = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'container-name': + d['container_name'] = v[0] + elif kl == 'data-set-id': + d['data_set_id'] = v[0] + elif kl == 'file-path': + d['file_path'] = v[0] + elif kl == 'output-type': + d['output_type'] = v[0] + elif kl == 'resource-group': + d['resource_group'] = v[0] + elif kl == 'storage-account-name': + d['storage_account_name'] = v[0] + elif kl == 'subscription-id': + d['subscription_id'] = v[0] + d['kind'] = 'Blob' + return d + + +class AddBlobFolderDataSetMapping(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.blob_folder_data_set_mapping = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'container-name': + d['container_name'] = v[0] + elif kl == 'data-set-id': + d['data_set_id'] = v[0] + elif kl == 'prefix': + d['prefix'] = v[0] + elif kl == 'resource-group': + d['resource_group'] = v[0] + elif kl == 'storage-account-name': + d['storage_account_name'] = v[0] + elif kl == 'subscription-id': + d['subscription_id'] = v[0] + d['kind'] = 'BlobFolder' + return d + + +class AddKustoClusterDataSetMapping(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.kusto_cluster_data_set_mapping = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'data-set-id': + d['data_set_id'] = v[0] + elif kl == 'kusto-cluster-resource-id': + d['kusto_cluster_resource_id'] = v[0] + d['kind'] = 'KustoCluster' + return d + + +class AddKustoDatabaseDataSetMapping(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.kusto_database_data_set_mapping = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'data-set-id': + d['data_set_id'] = v[0] + elif kl == 'kusto-cluster-resource-id': + d['kusto_cluster_resource_id'] = v[0] + d['kind'] = 'KustoDatabase' + return d + + +class AddSqlDBTableDataSetMapping(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.sql_d_b_table_data_set_mapping = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'database-name': + d['database_name'] = v[0] + elif kl == 'data-set-id': + d['data_set_id'] = v[0] + elif kl == 'schema-name': + d['schema_name'] = v[0] + elif kl == 'sql-server-resource-id': + d['sql_server_resource_id'] = v[0] + elif kl == 'table-name': + d['table_name'] = v[0] + d['kind'] = 'SqlDBTable' + return d + + +class AddSqlDWTableDataSetMapping(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.sql_d_w_table_data_set_mapping = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'data-set-id': + d['data_set_id'] = v[0] + elif kl == 'data-warehouse-name': + d['data_warehouse_name'] = v[0] + elif kl == 'schema-name': + d['schema_name'] = v[0] + elif kl == 'sql-server-resource-id': + d['sql_server_resource_id'] = v[0] + elif kl == 'table-name': + d['table_name'] = v[0] + d['kind'] = 'SqlDWTable' + return d + + +class AddScheduledSynchronizationSetting(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.scheduled_synchronization_setting = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'recurrence-interval': + d['recurrence_interval'] = v[0] + elif kl == 'synchronization-time': + d['synchronization_time'] = v[0] + d['kind'] = 'ScheduleBased' + return d + + +class AddScheduledTrigger(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.scheduled_trigger = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'recurrence-interval': + d['recurrence_interval'] = v[0] + elif kl == 'synchronization-mode': + d['synchronization_mode'] = v[0] + elif kl == 'synchronization-time': + d['synchronization_time'] = v[0] + d['kind'] = 'ScheduleBased' + return d diff --git a/src/datashare/azext_datashare/generated/commands.py b/src/datashare/azext_datashare/generated/commands.py new file mode 100644 index 0000000000..950f215d40 --- /dev/null +++ b/src/datashare/azext_datashare/generated/commands.py @@ -0,0 +1,153 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from azure.cli.core.commands import CliCommandType + + +def load_command_table(self, _): + + from azext_datashare.generated._client_factory import cf_account + datashare_account = CliCommandType( + operations_tmpl='azext_datashare.vendored_sdks.datashare.operations._account_operations#AccountOperations.{}', + client_factory=cf_account) + with self.command_group('datashare account', datashare_account, client_factory=cf_account, + is_experimental=True) as g: + g.custom_command('list', 'datashare_account_list') + g.custom_show_command('show', 'datashare_account_show') + g.custom_command('create', 'datashare_account_create', supports_no_wait=True) + g.custom_command('update', 'datashare_account_update') + g.custom_command('delete', 'datashare_account_delete', supports_no_wait=True) + g.custom_wait_command('wait', 'datashare_account_show') + + from azext_datashare.generated._client_factory import cf_consumer_invitation + datashare_consumer_invitation = CliCommandType( + operations_tmpl='azext_datashare.vendored_sdks.datashare.operations._consumer_invitation_operations#ConsumerInv' + 'itationOperations.{}', + client_factory=cf_consumer_invitation) + with self.command_group('datashare consumer-invitation', datashare_consumer_invitation, + client_factory=cf_consumer_invitation, is_experimental=True) as g: + g.custom_show_command('show', 'datashare_consumer_invitation_show') + g.custom_command('list-invitation', 'datashare_consumer_invitation_list_invitation') + g.custom_command('reject-invitation', 'datashare_consumer_invitation_reject_invitation') + + from azext_datashare.generated._client_factory import cf_data_set + datashare_data_set = CliCommandType( + operations_tmpl='azext_datashare.vendored_sdks.datashare.operations._data_set_operations#DataSetOperations.{}', + client_factory=cf_data_set) + with self.command_group('datashare data-set', datashare_data_set, client_factory=cf_data_set, + is_experimental=True) as g: + g.custom_command('list', 'datashare_data_set_list') + g.custom_show_command('show', 'datashare_data_set_show') + g.custom_command('create', 'datashare_data_set_create') + g.custom_command('delete', 'datashare_data_set_delete', supports_no_wait=True) + g.custom_wait_command('wait', 'datashare_data_set_show') + + from azext_datashare.generated._client_factory import cf_data_set_mapping + datashare_data_set_mapping = CliCommandType( + operations_tmpl='azext_datashare.vendored_sdks.datashare.operations._data_set_mapping_operations#DataSetMapping' + 'Operations.{}', + client_factory=cf_data_set_mapping) + with self.command_group('datashare data-set-mapping', datashare_data_set_mapping, + client_factory=cf_data_set_mapping, is_experimental=True) as g: + g.custom_command('list', 'datashare_data_set_mapping_list') + g.custom_show_command('show', 'datashare_data_set_mapping_show') + g.custom_command('create', 'datashare_data_set_mapping_create') + g.custom_command('delete', 'datashare_data_set_mapping_delete') + + from azext_datashare.generated._client_factory import cf_invitation + datashare_invitation = CliCommandType( + operations_tmpl='azext_datashare.vendored_sdks.datashare.operations._invitation_operations#InvitationOperations' + '.{}', + client_factory=cf_invitation) + with self.command_group('datashare invitation', datashare_invitation, client_factory=cf_invitation, + is_experimental=True) as g: + g.custom_command('list', 'datashare_invitation_list') + g.custom_show_command('show', 'datashare_invitation_show') + g.custom_command('create', 'datashare_invitation_create') + g.custom_command('delete', 'datashare_invitation_delete') + + from azext_datashare.generated._client_factory import cf_share + datashare_share = CliCommandType( + operations_tmpl='azext_datashare.vendored_sdks.datashare.operations._share_operations#ShareOperations.{}', + client_factory=cf_share) + with self.command_group('datashare share', datashare_share, client_factory=cf_share, is_experimental=True) as g: + g.custom_command('list', 'datashare_share_list') + g.custom_show_command('show', 'datashare_share_show') + g.custom_command('create', 'datashare_share_create') + g.custom_command('delete', 'datashare_share_delete', supports_no_wait=True) + g.custom_command('list-synchronization', 'datashare_share_list_synchronization') + g.custom_command('list-synchronization-detail', 'datashare_share_list_synchronization_detail') + g.custom_wait_command('wait', 'datashare_share_show') + + from azext_datashare.generated._client_factory import cf_provider_share_subscription + datashare_provider_share_subscription = CliCommandType( + operations_tmpl='azext_datashare.vendored_sdks.datashare.operations._provider_share_subscription_operations#Pro' + 'viderShareSubscriptionOperations.{}', + client_factory=cf_provider_share_subscription) + with self.command_group('datashare provider-share-subscription', datashare_provider_share_subscription, + client_factory=cf_provider_share_subscription, is_experimental=True) as g: + g.custom_command('list', 'datashare_provider_share_subscription_list') + g.custom_command('get-by-share', 'datashare_provider_share_subscription_get_by_share') + g.custom_command('reinstate', 'datashare_provider_share_subscription_reinstate') + g.custom_command('revoke', 'datashare_provider_share_subscription_revoke') + + from azext_datashare.generated._client_factory import cf_share_subscription + datashare_share_subscription = CliCommandType( + operations_tmpl='azext_datashare.vendored_sdks.datashare.operations._share_subscription_operations#ShareSubscri' + 'ptionOperations.{}', + client_factory=cf_share_subscription) + with self.command_group('datashare share-subscription', datashare_share_subscription, + client_factory=cf_share_subscription, is_experimental=True) as g: + g.custom_command('list', 'datashare_share_subscription_list') + g.custom_show_command('show', 'datashare_share_subscription_show') + g.custom_command('create', 'datashare_share_subscription_create') + g.custom_command('delete', 'datashare_share_subscription_delete', supports_no_wait=True) + g.custom_command('cancel-synchronization', 'datashare_share_subscription_cancel_synchronization', + supports_no_wait=True) + g.custom_command('list-source-share-synchronization-setting', 'datashare_share_subscription_list_source_share_s' + 'ynchronization_setting') + g.custom_command('list-synchronization', 'datashare_share_subscription_list_synchronization') + g.custom_command('list-synchronization-detail', 'datashare_share_subscription_list_synchronization_detail') + g.custom_command('synchronize', 'datashare_share_subscription_synchronize', supports_no_wait=True) + g.custom_wait_command('wait', 'datashare_share_subscription_show') + + from azext_datashare.generated._client_factory import cf_consumer_source_data_set + datashare_consumer_source_data_set = CliCommandType( + operations_tmpl='azext_datashare.vendored_sdks.datashare.operations._consumer_source_data_set_operations#Consum' + 'erSourceDataSetOperations.{}', + client_factory=cf_consumer_source_data_set) + with self.command_group('datashare consumer-source-data-set', datashare_consumer_source_data_set, + client_factory=cf_consumer_source_data_set, is_experimental=True) as g: + g.custom_command('list', 'datashare_consumer_source_data_set_list') + + from azext_datashare.generated._client_factory import cf_synchronization_setting + datashare_synchronization_setting = CliCommandType( + operations_tmpl='azext_datashare.vendored_sdks.datashare.operations._synchronization_setting_operations#Synchro' + 'nizationSettingOperations.{}', + client_factory=cf_synchronization_setting) + with self.command_group('datashare synchronization-setting', datashare_synchronization_setting, + client_factory=cf_synchronization_setting, is_experimental=True) as g: + g.custom_command('list', 'datashare_synchronization_setting_list') + g.custom_show_command('show', 'datashare_synchronization_setting_show') + g.custom_command('create', 'datashare_synchronization_setting_create') + g.custom_command('delete', 'datashare_synchronization_setting_delete', supports_no_wait=True) + g.custom_wait_command('wait', 'datashare_synchronization_setting_show') + + from azext_datashare.generated._client_factory import cf_trigger + datashare_trigger = CliCommandType( + operations_tmpl='azext_datashare.vendored_sdks.datashare.operations._trigger_operations#TriggerOperations.{}', + client_factory=cf_trigger) + with self.command_group('datashare trigger', datashare_trigger, client_factory=cf_trigger, + is_experimental=True) as g: + g.custom_command('list', 'datashare_trigger_list') + g.custom_show_command('show', 'datashare_trigger_show') + g.custom_command('create', 'datashare_trigger_create', supports_no_wait=True) + g.custom_command('delete', 'datashare_trigger_delete', supports_no_wait=True) + g.custom_wait_command('wait', 'datashare_trigger_show') diff --git a/src/datashare/azext_datashare/generated/custom.py b/src/datashare/azext_datashare/generated/custom.py new file mode 100644 index 0000000000..bb8b7d748a --- /dev/null +++ b/src/datashare/azext_datashare/generated/custom.py @@ -0,0 +1,717 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-lines + +import json +from knack.util import CLIError +from azure.cli.core.util import sdk_no_wait + + +def datashare_account_list(client, + resource_group_name=None, + skip_token=None): + if resource_group_name: + return client.list_by_resource_group(resource_group_name=resource_group_name, + skip_token=skip_token) + return client.list_by_subscription(skip_token=skip_token) + + +def datashare_account_show(client, + resource_group_name, + account_name): + return client.get(resource_group_name=resource_group_name, + account_name=account_name) + + +def datashare_account_create(client, + resource_group_name, + account_name, + location=None, + tags=None, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_create, + resource_group_name=resource_group_name, + account_name=account_name, + location=location, + tags=tags, + identity=json.loads("{\"type\": \"SystemAssigned\"}")) + + +def datashare_account_update(client, + resource_group_name, + account_name, + tags=None): + return client.update(resource_group_name=resource_group_name, + account_name=account_name, + tags=tags) + + +def datashare_account_delete(client, + resource_group_name, + account_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + resource_group_name=resource_group_name, + account_name=account_name) + + +def datashare_consumer_invitation_show(client, + location, + invitation_id): + return client.get(location=location, + invitation_id=invitation_id) + + +def datashare_consumer_invitation_list_invitation(client, + skip_token=None): + return client.list_invitation(skip_token=skip_token) + + +def datashare_consumer_invitation_reject_invitation(client, + location, + invitation_id): + return client.reject_invitation(location=location, + invitation_id=invitation_id) + + +def datashare_data_set_list(client, + resource_group_name, + account_name, + share_name, + skip_token=None, + filter=None, + orderby=None): + return client.list_by_share(resource_group_name=resource_group_name, + account_name=account_name, + share_name=share_name, + skip_token=skip_token, + filter=filter, + orderby=orderby) + + +def datashare_data_set_show(client, + resource_group_name, + account_name, + share_name, + data_set_name): + return client.get(resource_group_name=resource_group_name, + account_name=account_name, + share_name=share_name, + data_set_name=data_set_name) + + +def datashare_data_set_create(client, + resource_group_name, + account_name, + share_name, + data_set_name, + a_d_l_s_gen1_file_data_set=None, + a_d_l_s_gen1_folder_data_set=None, + a_d_l_s_gen2_file_data_set=None, + a_d_l_s_gen2_file_system_data_set=None, + a_d_l_s_gen2_folder_data_set=None, + blob_container_data_set=None, + blob_data_set=None, + blob_folder_data_set=None, + kusto_cluster_data_set=None, + kusto_database_data_set=None, + sql_d_b_table_data_set=None, + sql_d_w_table_data_set=None): + all_data_set = [] + if a_d_l_s_gen1_file_data_set is not None: + all_data_set.append(a_d_l_s_gen1_file_data_set) + if a_d_l_s_gen1_folder_data_set is not None: + all_data_set.append(a_d_l_s_gen1_folder_data_set) + if a_d_l_s_gen2_file_data_set is not None: + all_data_set.append(a_d_l_s_gen2_file_data_set) + if a_d_l_s_gen2_file_system_data_set is not None: + all_data_set.append(a_d_l_s_gen2_file_system_data_set) + if a_d_l_s_gen2_folder_data_set is not None: + all_data_set.append(a_d_l_s_gen2_folder_data_set) + if blob_container_data_set is not None: + all_data_set.append(blob_container_data_set) + if blob_data_set is not None: + all_data_set.append(blob_data_set) + if blob_folder_data_set is not None: + all_data_set.append(blob_folder_data_set) + if kusto_cluster_data_set is not None: + all_data_set.append(kusto_cluster_data_set) + if kusto_database_data_set is not None: + all_data_set.append(kusto_database_data_set) + if sql_d_b_table_data_set is not None: + all_data_set.append(sql_d_b_table_data_set) + if sql_d_w_table_data_set is not None: + all_data_set.append(sql_d_w_table_data_set) + if len(all_data_set) > 1: + raise CLIError('at most one of a_d_l_s_gen1_file_data_set, a_d_l_s_gen1_folder_data_set, a_d_l_s_gen2_file_dat' + 'a_set, a_d_l_s_gen2_file_system_data_set, a_d_l_s_gen2_folder_data_set, blob_container_data_set' + ', blob_data_set, blob_folder_data_set, kusto_cluster_data_set, kusto_database_data_set, sql_d_b' + '_table_data_set, sql_d_w_table_data_set is needed for data_set!') + if len(all_data_set) != 1: + raise CLIError('data_set is required. but none of a_d_l_s_gen1_file_data_set, a_d_l_s_gen1_folder_data_set, a_d' + '_l_s_gen2_file_data_set, a_d_l_s_gen2_file_system_data_set, a_d_l_s_gen2_folder_data_set, blob_' + 'container_data_set, blob_data_set, blob_folder_data_set, kusto_cluster_data_set, kusto_database' + '_data_set, sql_d_b_table_data_set, sql_d_w_table_data_set is provided!') + data_set = all_data_set[0] if len(all_data_set) == 1 else None + return client.create(resource_group_name=resource_group_name, + account_name=account_name, + share_name=share_name, + data_set_name=data_set_name, + data_set=data_set) + + +def datashare_data_set_delete(client, + resource_group_name, + account_name, + share_name, + data_set_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + resource_group_name=resource_group_name, + account_name=account_name, + share_name=share_name, + data_set_name=data_set_name) + + +def datashare_data_set_mapping_list(client, + resource_group_name, + account_name, + share_subscription_name, + skip_token=None, + filter=None, + orderby=None): + return client.list_by_share_subscription(resource_group_name=resource_group_name, + account_name=account_name, + share_subscription_name=share_subscription_name, + skip_token=skip_token, + filter=filter, + orderby=orderby) + + +def datashare_data_set_mapping_show(client, + resource_group_name, + account_name, + share_subscription_name, + data_set_mapping_name): + return client.get(resource_group_name=resource_group_name, + account_name=account_name, + share_subscription_name=share_subscription_name, + data_set_mapping_name=data_set_mapping_name) + + +def datashare_data_set_mapping_create(client, + resource_group_name, + account_name, + share_subscription_name, + data_set_mapping_name, + a_d_l_s_gen2_file_data_set_mapping=None, + a_d_l_s_gen2_file_system_data_set_mapping=None, + a_d_l_s_gen2_folder_data_set_mapping=None, + blob_container_data_set_mapping=None, + blob_data_set_mapping=None, + blob_folder_data_set_mapping=None, + kusto_cluster_data_set_mapping=None, + kusto_database_data_set_mapping=None, + sql_d_b_table_data_set_mapping=None, + sql_d_w_table_data_set_mapping=None): + all_data_set_mapping = [] + if a_d_l_s_gen2_file_data_set_mapping is not None: + all_data_set_mapping.append(a_d_l_s_gen2_file_data_set_mapping) + if a_d_l_s_gen2_file_system_data_set_mapping is not None: + all_data_set_mapping.append(a_d_l_s_gen2_file_system_data_set_mapping) + if a_d_l_s_gen2_folder_data_set_mapping is not None: + all_data_set_mapping.append(a_d_l_s_gen2_folder_data_set_mapping) + if blob_container_data_set_mapping is not None: + all_data_set_mapping.append(blob_container_data_set_mapping) + if blob_data_set_mapping is not None: + all_data_set_mapping.append(blob_data_set_mapping) + if blob_folder_data_set_mapping is not None: + all_data_set_mapping.append(blob_folder_data_set_mapping) + if kusto_cluster_data_set_mapping is not None: + all_data_set_mapping.append(kusto_cluster_data_set_mapping) + if kusto_database_data_set_mapping is not None: + all_data_set_mapping.append(kusto_database_data_set_mapping) + if sql_d_b_table_data_set_mapping is not None: + all_data_set_mapping.append(sql_d_b_table_data_set_mapping) + if sql_d_w_table_data_set_mapping is not None: + all_data_set_mapping.append(sql_d_w_table_data_set_mapping) + if len(all_data_set_mapping) > 1: + raise CLIError('at most one of a_d_l_s_gen2_file_data_set_mapping, a_d_l_s_gen2_file_system_data_set_mapping, ' + 'a_d_l_s_gen2_folder_data_set_mapping, blob_container_data_set_mapping, blob_data_set_mapping, b' + 'lob_folder_data_set_mapping, kusto_cluster_data_set_mapping, kusto_database_data_set_mapping, s' + 'ql_d_b_table_data_set_mapping, sql_d_w_table_data_set_mapping is needed for data_set_mapping!') + if len(all_data_set_mapping) != 1: + raise CLIError('data_set_mapping is required. but none of a_d_l_s_gen2_file_data_set_mapping, a_d_l_s_gen2_file' + '_system_data_set_mapping, a_d_l_s_gen2_folder_data_set_mapping, blob_container_data_set_mapping' + ', blob_data_set_mapping, blob_folder_data_set_mapping, kusto_cluster_data_set_mapping, kusto_da' + 'tabase_data_set_mapping, sql_d_b_table_data_set_mapping, sql_d_w_table_data_set_mapping is prov' + 'ided!') + data_set_mapping = all_data_set_mapping[0] if len(all_data_set_mapping) == 1 else None + return client.create(resource_group_name=resource_group_name, + account_name=account_name, + share_subscription_name=share_subscription_name, + data_set_mapping_name=data_set_mapping_name, + data_set_mapping=data_set_mapping) + + +def datashare_data_set_mapping_delete(client, + resource_group_name, + account_name, + share_subscription_name, + data_set_mapping_name): + return client.delete(resource_group_name=resource_group_name, + account_name=account_name, + share_subscription_name=share_subscription_name, + data_set_mapping_name=data_set_mapping_name) + + +def datashare_invitation_list(client, + resource_group_name, + account_name, + share_name, + skip_token=None, + filter=None, + orderby=None): + return client.list_by_share(resource_group_name=resource_group_name, + account_name=account_name, + share_name=share_name, + skip_token=skip_token, + filter=filter, + orderby=orderby) + + +def datashare_invitation_show(client, + resource_group_name, + account_name, + share_name, + invitation_name): + return client.get(resource_group_name=resource_group_name, + account_name=account_name, + share_name=share_name, + invitation_name=invitation_name) + + +def datashare_invitation_create(client, + resource_group_name, + account_name, + share_name, + invitation_name, + target_active_directory_id=None, + target_email=None, + target_object_id=None): + return client.create(resource_group_name=resource_group_name, + account_name=account_name, + share_name=share_name, + invitation_name=invitation_name, + target_active_directory_id=target_active_directory_id, + target_email=target_email, + target_object_id=target_object_id) + + +def datashare_invitation_delete(client, + resource_group_name, + account_name, + share_name, + invitation_name): + return client.delete(resource_group_name=resource_group_name, + account_name=account_name, + share_name=share_name, + invitation_name=invitation_name) + + +def datashare_share_list(client, + resource_group_name, + account_name, + skip_token=None, + filter=None, + orderby=None): + return client.list_by_account(resource_group_name=resource_group_name, + account_name=account_name, + skip_token=skip_token, + filter=filter, + orderby=orderby) + + +def datashare_share_show(client, + resource_group_name, + account_name, + share_name): + return client.get(resource_group_name=resource_group_name, + account_name=account_name, + share_name=share_name) + + +def datashare_share_create(client, + resource_group_name, + account_name, + share_name, + description=None, + share_kind=None, + terms=None): + return client.create(resource_group_name=resource_group_name, + account_name=account_name, + share_name=share_name, + description=description, + share_kind=share_kind, + terms=terms) + + +def datashare_share_delete(client, + resource_group_name, + account_name, + share_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + resource_group_name=resource_group_name, + account_name=account_name, + share_name=share_name) + + +def datashare_share_list_synchronization(client, + resource_group_name, + account_name, + share_name, + skip_token=None, + filter=None, + orderby=None): + return client.list_synchronization(resource_group_name=resource_group_name, + account_name=account_name, + share_name=share_name, + skip_token=skip_token, + filter=filter, + orderby=orderby) + + +def datashare_share_list_synchronization_detail(client, + resource_group_name, + account_name, + share_name, + skip_token=None, + filter=None, + orderby=None, + consumer_email=None, + consumer_name=None, + consumer_tenant_name=None, + duration_ms=None, + end_time=None, + message=None, + start_time=None, + status=None, + synchronization_id=None): + return client.list_synchronization_detail(resource_group_name=resource_group_name, + account_name=account_name, + share_name=share_name, + skip_token=skip_token, + filter=filter, + orderby=orderby, + consumer_email=consumer_email, + consumer_name=consumer_name, + consumer_tenant_name=consumer_tenant_name, + duration_ms=duration_ms, + end_time=end_time, + message=message, + start_time=start_time, + status=status, + synchronization_id=synchronization_id) + + +def datashare_provider_share_subscription_list(client, + resource_group_name, + account_name, + share_name, + skip_token=None): + return client.list_by_share(resource_group_name=resource_group_name, + account_name=account_name, + share_name=share_name, + skip_token=skip_token) + + +def datashare_provider_share_subscription_get_by_share(client, + resource_group_name, + account_name, + share_name, + provider_share_subscription_id): + return client.get_by_share(resource_group_name=resource_group_name, + account_name=account_name, + share_name=share_name, + provider_share_subscription_id=provider_share_subscription_id) + + +def datashare_provider_share_subscription_reinstate(client, + resource_group_name, + account_name, + share_name, + provider_share_subscription_id): + return client.reinstate(resource_group_name=resource_group_name, + account_name=account_name, + share_name=share_name, + provider_share_subscription_id=provider_share_subscription_id) + + +def datashare_provider_share_subscription_revoke(client, + resource_group_name, + account_name, + share_name, + provider_share_subscription_id): + return client.begin_revoke(resource_group_name=resource_group_name, + account_name=account_name, + share_name=share_name, + provider_share_subscription_id=provider_share_subscription_id) + + +def datashare_share_subscription_list(client, + resource_group_name, + account_name, + skip_token=None, + filter=None, + orderby=None): + return client.list_by_account(resource_group_name=resource_group_name, + account_name=account_name, + skip_token=skip_token, + filter=filter, + orderby=orderby) + + +def datashare_share_subscription_show(client, + resource_group_name, + account_name, + share_subscription_name): + return client.get(resource_group_name=resource_group_name, + account_name=account_name, + share_subscription_name=share_subscription_name) + + +def datashare_share_subscription_create(client, + resource_group_name, + account_name, + share_subscription_name, + invitation_id, + source_share_location): + return client.create(resource_group_name=resource_group_name, + account_name=account_name, + share_subscription_name=share_subscription_name, + invitation_id=invitation_id, + source_share_location=source_share_location) + + +def datashare_share_subscription_delete(client, + resource_group_name, + account_name, + share_subscription_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + resource_group_name=resource_group_name, + account_name=account_name, + share_subscription_name=share_subscription_name) + + +def datashare_share_subscription_cancel_synchronization(client, + resource_group_name, + account_name, + share_subscription_name, + synchronization_id, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_cancel_synchronization, + resource_group_name=resource_group_name, + account_name=account_name, + share_subscription_name=share_subscription_name, + synchronization_id=synchronization_id) + + +def datashare_share_subscription_list_source_share_synchronization_setting(client, + resource_group_name, + account_name, + share_subscription_name, + skip_token=None): + return client.list_source_share_synchronization_setting(resource_group_name=resource_group_name, + account_name=account_name, + share_subscription_name=share_subscription_name, + skip_token=skip_token) + + +def datashare_share_subscription_list_synchronization(client, + resource_group_name, + account_name, + share_subscription_name, + skip_token=None, + filter=None, + orderby=None): + return client.list_synchronization(resource_group_name=resource_group_name, + account_name=account_name, + share_subscription_name=share_subscription_name, + skip_token=skip_token, + filter=filter, + orderby=orderby) + + +def datashare_share_subscription_list_synchronization_detail(client, + resource_group_name, + account_name, + share_subscription_name, + synchronization_id, + skip_token=None, + filter=None, + orderby=None): + return client.list_synchronization_detail(resource_group_name=resource_group_name, + account_name=account_name, + share_subscription_name=share_subscription_name, + skip_token=skip_token, + filter=filter, + orderby=orderby, + synchronization_id=synchronization_id) + + +def datashare_share_subscription_synchronize(client, + resource_group_name, + account_name, + share_subscription_name, + synchronization_mode=None, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_synchronize, + resource_group_name=resource_group_name, + account_name=account_name, + share_subscription_name=share_subscription_name, + synchronization_mode=synchronization_mode) + + +def datashare_consumer_source_data_set_list(client, + resource_group_name, + account_name, + share_subscription_name, + skip_token=None): + return client.list_by_share_subscription(resource_group_name=resource_group_name, + account_name=account_name, + share_subscription_name=share_subscription_name, + skip_token=skip_token) + + +def datashare_synchronization_setting_list(client, + resource_group_name, + account_name, + share_name, + skip_token=None): + return client.list_by_share(resource_group_name=resource_group_name, + account_name=account_name, + share_name=share_name, + skip_token=skip_token) + + +def datashare_synchronization_setting_show(client, + resource_group_name, + account_name, + share_name, + synchronization_setting_name): + return client.get(resource_group_name=resource_group_name, + account_name=account_name, + share_name=share_name, + synchronization_setting_name=synchronization_setting_name) + + +def datashare_synchronization_setting_create(client, + resource_group_name, + account_name, + share_name, + synchronization_setting_name, + scheduled_synchronization_setting=None): + all_synchronization_setting = [] + if scheduled_synchronization_setting is not None: + all_synchronization_setting.append(scheduled_synchronization_setting) + if len(all_synchronization_setting) > 1: + raise CLIError('at most one of scheduled_synchronization_setting is needed for synchronization_setting!') + if len(all_synchronization_setting) != 1: + raise CLIError('synchronization_setting is required. but none of scheduled_synchronization_setting is provided!' + '') + synchronization_setting = all_synchronization_setting[0] if len(all_synchronization_setting) == 1 else None + return client.create(resource_group_name=resource_group_name, + account_name=account_name, + share_name=share_name, + synchronization_setting_name=synchronization_setting_name, + synchronization_setting=synchronization_setting) + + +def datashare_synchronization_setting_delete(client, + resource_group_name, + account_name, + share_name, + synchronization_setting_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + resource_group_name=resource_group_name, + account_name=account_name, + share_name=share_name, + synchronization_setting_name=synchronization_setting_name) + + +def datashare_trigger_list(client, + resource_group_name, + account_name, + share_subscription_name, + skip_token=None): + return client.list_by_share_subscription(resource_group_name=resource_group_name, + account_name=account_name, + share_subscription_name=share_subscription_name, + skip_token=skip_token) + + +def datashare_trigger_show(client, + resource_group_name, + account_name, + share_subscription_name, + trigger_name): + return client.get(resource_group_name=resource_group_name, + account_name=account_name, + share_subscription_name=share_subscription_name, + trigger_name=trigger_name) + + +def datashare_trigger_create(client, + resource_group_name, + account_name, + share_subscription_name, + trigger_name, + scheduled_trigger=None, + no_wait=False): + all_trigger = [] + if scheduled_trigger is not None: + all_trigger.append(scheduled_trigger) + if len(all_trigger) > 1: + raise CLIError('at most one of scheduled_trigger is needed for trigger!') + if len(all_trigger) != 1: + raise CLIError('trigger is required. but none of scheduled_trigger is provided!') + trigger = all_trigger[0] if len(all_trigger) == 1 else None + return sdk_no_wait(no_wait, + client.begin_create, + resource_group_name=resource_group_name, + account_name=account_name, + share_subscription_name=share_subscription_name, + trigger_name=trigger_name, + trigger=trigger) + + +def datashare_trigger_delete(client, + resource_group_name, + account_name, + share_subscription_name, + trigger_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + resource_group_name=resource_group_name, + account_name=account_name, + share_subscription_name=share_subscription_name, + trigger_name=trigger_name) diff --git a/src/datashare/azext_datashare/manual/__init__.py b/src/datashare/azext_datashare/manual/__init__.py index c9cfdc73e7..ee0c4f36bd 100644 --- a/src/datashare/azext_datashare/manual/__init__.py +++ b/src/datashare/azext_datashare/manual/__init__.py @@ -1,12 +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. -# -------------------------------------------------------------------------- - -__path__ = __import__('pkgutil').extend_path(__path__, __name__) +# 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. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/datashare/azext_datashare/tests/__init__.py b/src/datashare/azext_datashare/tests/__init__.py index c9cfdc73e7..5f8f1fd97a 100644 --- a/src/datashare/azext_datashare/tests/__init__.py +++ b/src/datashare/azext_datashare/tests/__init__.py @@ -1,12 +1,71 @@ -# 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. -# -------------------------------------------------------------------------- - -__path__ = __import__('pkgutil').extend_path(__path__, __name__) +# 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 inspect +import os +import sys +import traceback +from azure.core.exceptions import AzureError +from azure.cli.testsdk.exceptions import CliTestError, CliExecutionError, JMESPathCheckAssertionError + + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) +exceptions = [] + + +def try_manual(func): + def import_manual_function(origin_func): + from importlib import import_module + decorated_path = inspect.getfile(origin_func) + module_path = __path__[0] + if not decorated_path.startswith(module_path): + raise Exception("Decorator can only be used in submodules!") + manual_path = os.path.join( + decorated_path[module_path.rfind(os.path.sep) + 1:]) + manual_file_path, manual_file_name = os.path.split(manual_path) + module_name, _ = os.path.splitext(manual_file_name) + manual_module = "..manual." + \ + ".".join(manual_file_path.split(os.path.sep) + [module_name, ]) + return getattr(import_module(manual_module, package=__name__), origin_func.__name__) + + def get_func_to_call(): + func_to_call = func + try: + func_to_call = import_manual_function(func) + print("Found manual override for {}(...)".format(func.__name__)) + except (ImportError, AttributeError): + pass + return func_to_call + + def wrapper(*args, **kwargs): + func_to_call = get_func_to_call() + print("running {}()...".format(func.__name__)) + try: + return func_to_call(*args, **kwargs) + except (AssertionError, AzureError, CliTestError, CliExecutionError, JMESPathCheckAssertionError) as e: + print("--------------------------------------") + print("step exception: ", e) + print("--------------------------------------", file=sys.stderr) + print("step exception in {}: {}".format(func.__name__, e), file=sys.stderr) + traceback.print_exc() + exceptions.append((func.__name__, sys.exc_info())) + + if inspect.isclass(func): + return get_func_to_call() + return wrapper + + +def raise_if(): + if exceptions: + if len(exceptions) <= 1: + raise exceptions[0][1][1] + message = "{}\nFollowed with exceptions in other steps:\n".format(str(exceptions[0][1][1])) + message += "\n".join(["{}: {}".format(h[0], h[1][1]) for h in exceptions[1:]]) + raise exceptions[0][1][0](message).with_traceback(exceptions[0][1][2]) diff --git a/src/datashare/azext_datashare/tests/latest/preparers.py b/src/datashare/azext_datashare/tests/latest/preparers.py new file mode 100644 index 0000000000..4702355b2b --- /dev/null +++ b/src/datashare/azext_datashare/tests/latest/preparers.py @@ -0,0 +1,159 @@ +# -------------------------------------------------------------------------- +# 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 os +from datetime import datetime +from azure_devtools.scenario_tests import SingleValueReplacer +from azure.cli.testsdk.preparers import NoTrafficRecordingPreparer +from azure.cli.testsdk.exceptions import CliTestError +from azure.cli.testsdk.reverse_dependency import get_dummy_cli + + +KEY_RESOURCE_GROUP = 'rg' +KEY_VIRTUAL_NETWORK = 'vnet' +KEY_VNET_SUBNET = 'subnet' +KEY_VNET_NIC = 'nic' + + +class VirtualNetworkPreparer(NoTrafficRecordingPreparer, SingleValueReplacer): + def __init__(self, name_prefix='clitest.vn', + parameter_name='virtual_network', + resource_group_name=None, + resource_group_key=KEY_RESOURCE_GROUP, + dev_setting_name='AZURE_CLI_TEST_DEV_VIRTUAL_NETWORK_NAME', + random_name_length=24, key=KEY_VIRTUAL_NETWORK): + if ' ' in name_prefix: + raise CliTestError( + 'Error: Space character in name prefix \'%s\'' % name_prefix) + super(VirtualNetworkPreparer, self).__init__( + name_prefix, random_name_length) + self.cli_ctx = get_dummy_cli() + self.parameter_name = parameter_name + self.key = key + self.resource_group_name = resource_group_name + self.resource_group_key = resource_group_key + self.dev_setting_name = os.environ.get(dev_setting_name, None) + + def create_resource(self, name, **_): + if self.dev_setting_name: + return {self.parameter_name: self.dev_setting_name, } + + if not self.resource_group_name: + self.resource_group_name = self.test_class_instance.kwargs.get( + self.resource_group_key) + if not self.resource_group_name: + raise CliTestError("Error: No resource group configured!") + + tags = {'product': 'azurecli', 'cause': 'automation', + 'date': datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%SZ')} + if 'ENV_JOB_NAME' in os.environ: + tags['job'] = os.environ['ENV_JOB_NAME'] + tags = ' '.join(['{}={}'.format(key, value) + for key, value in tags.items()]) + template = 'az network vnet create --resource-group {} --name {} --subnet-name default --tag ' + tags + self.live_only_execute(self.cli_ctx, template.format( + self.resource_group_name, name)) + + self.test_class_instance.kwargs[self.key] = name + return {self.parameter_name: name} + + def remove_resource(self, name, **_): + # delete vnet if test is being recorded and if the vnet is not a dev rg + if not self.dev_setting_name: + self.live_only_execute( + self.cli_ctx, + 'az network vnet delete --name {} --resource-group {}'.format(name, self.resource_group_name)) + + +class VnetSubnetPreparer(NoTrafficRecordingPreparer, SingleValueReplacer): + def __init__(self, name_prefix='clitest.vn', + parameter_name='subnet', + resource_group_key=KEY_RESOURCE_GROUP, + vnet_key=KEY_VIRTUAL_NETWORK, + address_prefixes="11.0.0.0/24", + dev_setting_name='AZURE_CLI_TEST_DEV_VNET_SUBNET_NAME', + key=KEY_VNET_SUBNET): + if ' ' in name_prefix: + raise CliTestError( + 'Error: Space character in name prefix \'%s\'' % name_prefix) + super(VnetSubnetPreparer, self).__init__(name_prefix, 15) + self.cli_ctx = get_dummy_cli() + self.parameter_name = parameter_name + self.key = key + self.resource_group = [resource_group_key, None] + self.vnet = [vnet_key, None] + self.address_prefixes = address_prefixes + self.dev_setting_name = os.environ.get(dev_setting_name, None) + + def create_resource(self, name, **_): + if self.dev_setting_name: + return {self.parameter_name: self.dev_setting_name, } + + if not self.resource_group[1]: + self.resource_group[1] = self.test_class_instance.kwargs.get( + self.resource_group[0]) + if not self.resource_group[1]: + raise CliTestError("Error: No resource group configured!") + if not self.vnet[1]: + self.vnet[1] = self.test_class_instance.kwargs.get(self.vnet[0]) + if not self.vnet[1]: + raise CliTestError("Error: No vnet configured!") + + self.test_class_instance.kwargs[self.key] = 'default' + return {self.parameter_name: name} + + def remove_resource(self, name, **_): + pass + + +class VnetNicPreparer(NoTrafficRecordingPreparer, SingleValueReplacer): + def __init__(self, name_prefix='clitest.nic', + parameter_name='subnet', + resource_group_key=KEY_RESOURCE_GROUP, + vnet_key=KEY_VIRTUAL_NETWORK, + dev_setting_name='AZURE_CLI_TEST_DEV_VNET_NIC_NAME', + key=KEY_VNET_NIC): + if ' ' in name_prefix: + raise CliTestError( + 'Error: Space character in name prefix \'%s\'' % name_prefix) + super(VnetNicPreparer, self).__init__(name_prefix, 15) + self.cli_ctx = get_dummy_cli() + self.parameter_name = parameter_name + self.key = key + self.resource_group = [resource_group_key, None] + self.vnet = [vnet_key, None] + self.dev_setting_name = os.environ.get(dev_setting_name, None) + + def create_resource(self, name, **_): + if self.dev_setting_name: + return {self.parameter_name: self.dev_setting_name, } + + if not self.resource_group[1]: + self.resource_group[1] = self.test_class_instance.kwargs.get( + self.resource_group[0]) + if not self.resource_group[1]: + raise CliTestError("Error: No resource group configured!") + if not self.vnet[1]: + self.vnet[1] = self.test_class_instance.kwargs.get(self.vnet[0]) + if not self.vnet[1]: + raise CliTestError("Error: No vnet configured!") + + template = 'az network nic create --resource-group {} --name {} --vnet-name {} --subnet default ' + self.live_only_execute(self.cli_ctx, template.format( + self.resource_group[1], name, self.vnet[1])) + + self.test_class_instance.kwargs[self.key] = name + return {self.parameter_name: name} + + def remove_resource(self, name, **_): + if not self.dev_setting_name: + self.live_only_execute( + self.cli_ctx, + 'az network nic delete --name {} --resource-group {}'.format(name, self.resource_group[1])) diff --git a/src/datashare/azext_datashare/tests/latest/test_datashare_scenario.py b/src/datashare/azext_datashare/tests/latest/test_datashare_scenario.py index 43245c24f3..ace330ea4f 100644 --- a/src/datashare/azext_datashare/tests/latest/test_datashare_scenario.py +++ b/src/datashare/azext_datashare/tests/latest/test_datashare_scenario.py @@ -1,599 +1,731 @@ -# -------------------------------------------------------------------------------------------- +# -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- +# 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 os -import unittest +from azure.cli.testsdk import ScenarioTest +from .. import try_manual, raise_if +from azure.cli.testsdk import ResourceGroupPreparer -from azure_devtools.scenario_tests import AllowLargeResponse -from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer, StorageAccountPreparer) TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) +@try_manual +def setup(test, rg): + pass + + +# EXAMPLE: /Accounts/put/Accounts_Create +@try_manual +def step__accounts_put_accounts_create(test, rg): + test.cmd('az datashare account create ' + '--location "West US 2" ' + '--tags tag1="Red" tag2="White" ' + '--name "{Account1}" ' + '--resource-group "{rg}"', + checks=[]) + test.cmd('az datashare account wait --created ' + '--name "{Account1}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: /Accounts/get/Accounts_Get +@try_manual +def step__accounts_get_accounts_get(test, rg): + test.cmd('az datashare account show ' + '--name "{Account1}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: /Accounts/get/Accounts_ListByResourceGroup +@try_manual +def step__accounts_get_accounts_listbyresourcegroup(test, rg): + test.cmd('az datashare account list ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: /Accounts/get/Accounts_ListBySubscription +@try_manual +def step__accounts_get_accounts_listbysubscription(test, rg): + test.cmd('az datashare account list ' + '-g ""', + checks=[]) + + +# EXAMPLE: /Accounts/patch/Accounts_Update +@try_manual +def step__accounts_patch_accounts_update(test, rg): + test.cmd('az datashare account update ' + '--name "{Account1}" ' + '--tags tag1="Red" tag2="White" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: /ConsumerInvitations/get/ConsumerInvitations_Get +@try_manual +def step__consumerinvitations_get_consumerinvitations_get(test, rg): + test.cmd('az datashare consumer-invitation show ' + '--invitation-id "dfbbc788-19eb-4607-a5a1-c74181bfff03" ' + '--location "East US 2"', + checks=[]) + + +# EXAMPLE: /ConsumerInvitations/get/ConsumerInvitations_ListInvitations +@try_manual +def step__consumerinvitations_get_consumerinvitations_listinvitations(test, rg): + test.cmd('az datashare consumer-invitation list-invitation', + checks=[]) + + +# EXAMPLE: /ConsumerInvitations/post/ConsumerInvitations_RejectInvitation +@try_manual +def step__consumerinvitations_post_consumerinvitations_rejectinvitation(test, rg): + test.cmd('az datashare consumer-invitation reject-invitation ' + '--invitation-id "dfbbc788-19eb-4607-a5a1-c74181bfff03" ' + '--location "East US 2"', + checks=[]) + + +# EXAMPLE: /ShareSubscriptions/put/ShareSubscriptions_Create +@try_manual +def step__sharesubscriptions_put_sharesubscriptions_create(test, rg): + test.cmd('az datashare share-subscription create ' + '--account-name "{Account1}" ' + '--resource-group "{rg}" ' + '--invitation-id "12345678-1234-1234-12345678abd" ' + '--source-share-location "eastus2" ' + '--name "{ShareSubscription1}"', + checks=[]) + + +# EXAMPLE: /DataSetMappings/put/DataSetMappings_Create +@try_manual +def step__datasetmappings_put_datasetmappings_create(test, rg): + test.cmd('az datashare data-set-mapping create ' + '--account-name "{Account1}" ' + '--blob-data-set-mapping container-name="C1" data-set-id="a08f184b-0567-4b11-ba22-a1199336d226" file-path=' + '"file21" resource-group="SampleResourceGroup" storage-account-name="storage2" subscription-id="433a8dfd-e' + '5d5-4e77-ad86-90acdc75eb1a" ' + '--name "{DatasetMapping1}" ' + '--resource-group "{rg}" ' + '--share-subscription-name "{ShareSubscription1}"', + checks=[]) + + +# EXAMPLE: /DataSetMappings/put/DataSetMappings_SqlDB_Create +@try_manual +def step__datasetmappings_put_datasetmappings_sqldb_create(test, rg): + test.cmd('az datashare data-set-mapping create ' + '--account-name "{Account1}" ' + '--sql-d-b-table-data-set-mapping database-name="Database1" data-set-id="a08f184b-0567-4b11-ba22-a1199336d' + '226" schema-name="dbo" sql-server-resource-id="/subscriptions/{subscription_id}/resourceGroups/{rg}/provi' + 'ders/Microsoft.Sql/servers/Server1" table-name="Table1" ' + '--name "{DatasetMapping1}" ' + '--resource-group "{rg}" ' + '--share-subscription-name "{ShareSubscription1}"', + checks=[]) + + +# EXAMPLE: /DataSetMappings/put/DataSetMappings_SqlDWDataSetToAdlsGen2File_Create +@try_manual +def step__datasetmappings_put_datasetmappings_sqldwdatasettoadlsgen2file_create(test, rg): + test.cmd('az datashare data-set-mapping create ' + '--account-name "{Account1}" ' + '--a-d-l-s-gen2-file-data-set-mapping data-set-id="a08f184b-0567-4b11-ba22-a1199336d226" file-path="file21' + '" file-system="fileSystem" output-type="Csv" resource-group="SampleResourceGroup" storage-account-name="s' + 'torage2" subscription-id="433a8dfd-e5d5-4e77-ad86-90acdc75eb1a" ' + '--name "{DatasetMapping1}" ' + '--resource-group "{rg}" ' + '--share-subscription-name "{ShareSubscription1}"', + checks=[]) + + +# EXAMPLE: /DataSetMappings/put/DataSetMappings_SqlDW_Create +@try_manual +def step__datasetmappings_put_datasetmappings_sqldw_create(test, rg): + test.cmd('az datashare data-set-mapping create ' + '--account-name "{Account1}" ' + '--sql-d-w-table-data-set-mapping data-set-id="a08f184b-0567-4b11-ba22-a1199336d226" data-warehouse-name="' + 'DataWarehouse1" schema-name="dbo" sql-server-resource-id="/subscriptions/{subscription_id}/resourceGroups' + '/{rg}/providers/Microsoft.Sql/servers/Server1" table-name="Table1" ' + '--name "{DatasetMapping1}" ' + '--resource-group "{rg}" ' + '--share-subscription-name "{ShareSubscription1}"', + checks=[]) + + +# EXAMPLE: /DataSetMappings/get/DataSetMappings_Get +@try_manual +def step__datasetmappings_get_datasetmappings_get(test, rg): + test.cmd('az datashare data-set-mapping show ' + '--account-name "{Account1}" ' + '--name "{DatasetMapping1}" ' + '--resource-group "{rg}" ' + '--share-subscription-name "{ShareSubscription1}"', + checks=[]) + + +# EXAMPLE: /DataSetMappings/get/DataSetMappings_ListByShareSubscription +@try_manual +def step__datasetmappings_get_datasetmappings_listbysharesubscription(test, rg): + test.cmd('az datashare data-set-mapping list ' + '--account-name "{Account1}" ' + '--resource-group "{rg}" ' + '--share-subscription-name "{ShareSubscription1}"', + checks=[]) + + +# EXAMPLE: /Shares/put/Shares_Create +@try_manual +def step__shares_put_shares_create(test, rg): + test.cmd('az datashare share create ' + '--account-name "{Account1}" ' + '--resource-group "{rg}" ' + '--description "share description" ' + '--share-kind "CopyBased" ' + '--terms "Confidential" ' + '--name "{Share1}"', + checks=[]) + + +# EXAMPLE: /DataSets/put/DataSets_KustoCluster_Create +@try_manual +def step__datasets_put_datasets_kustocluster_create(test, rg): + test.cmd('az datashare data-set create ' + '--account-name "{Account1}" ' + '--kusto-cluster-data-set kusto-cluster-resource-id="/subscriptions/{subscription_id}/resourceGroups/{rg}/' + 'providers/Microsoft.Kusto/clusters/Cluster1" ' + '--name "{Dataset1}" ' + '--resource-group "{rg}" ' + '--share-name "{Share1}"', + checks=[]) + + +# EXAMPLE: /DataSets/put/DataSets_KustoDatabase_Create +@try_manual +def step__datasets_put_datasets_kustodatabase_create(test, rg): + test.cmd('az datashare data-set create ' + '--account-name "{Account1}" ' + '--kusto-database-data-set kusto-database-resource-id="/subscriptions/{subscription_id}/resourceGroups/{rg' + '}/providers/Microsoft.Kusto/clusters/Cluster1/databases/Database1" ' + '--name "{Dataset1}" ' + '--resource-group "{rg}" ' + '--share-name "{Share1}"', + checks=[]) + + +# EXAMPLE: /DataSets/put/DataSets_SqlDBTable_Create +@try_manual +def step__datasets_put_datasets_sqldbtable_create(test, rg): + test.cmd('az datashare data-set create ' + '--account-name "{Account1}" ' + '--sql-d-b-table-data-set database-name="SqlDB1" schema-name="dbo" sql-server-resource-id="/subscriptions/' + '{subscription_id}/resourceGroups/{rg}/providers/Microsoft.Sql/servers/Server1" table-name="Table1" ' + '--name "{Dataset1}" ' + '--resource-group "{rg}" ' + '--share-name "{Share1}"', + checks=[]) + + +# EXAMPLE: /DataSets/put/DataSets_SqlDWTable_Create +@try_manual +def step__datasets_put_datasets_sqldwtable_create(test, rg): + test.cmd('az datashare data-set create ' + '--account-name "{Account1}" ' + '--sql-d-w-table-data-set data-warehouse-name="DataWarehouse1" schema-name="dbo" sql-server-resource-id="/' + 'subscriptions/{subscription_id}/resourceGroups/{rg}/providers/Microsoft.Sql/servers/Server1" table-name="' + 'Table1" ' + '--name "{Dataset1}" ' + '--resource-group "{rg}" ' + '--share-name "{Share1}"', + checks=[]) + + +# EXAMPLE: /DataSets/put/DataSets_Create +@try_manual +def step__datasets_put_datasets_create(test, rg): + test.cmd('az datashare data-set create ' + '--account-name "{Account1}" ' + '--blob-data-set container-name="C1" file-path="file21" resource-group="SampleResourceGroup" storage-accou' + 'nt-name="storage2" subscription-id="433a8dfd-e5d5-4e77-ad86-90acdc75eb1a" ' + '--name "{Dataset1}" ' + '--resource-group "{rg}" ' + '--share-name "{Share1}"', + checks=[]) + + +# EXAMPLE: /DataSets/get/DataSets_ListByShare +@try_manual +def step__datasets_get_datasets_listbyshare(test, rg): + test.cmd('az datashare data-set list ' + '--account-name "{Account1}" ' + '--resource-group "{rg}" ' + '--share-name "{Share1}"', + checks=[]) + + +# EXAMPLE: /Invitations/put/Invitations_Create +@try_manual +def step__invitations_put_invitations_create(test, rg): + test.cmd('az datashare invitation create ' + '--account-name "{Account1}" ' + '--target-email "receiver@microsoft.com" ' + '--name "{Invitation1}" ' + '--resource-group "{rg}" ' + '--share-name "{Share1}"', + checks=[]) + + +# EXAMPLE: /Invitations/get/Invitations_Get +@try_manual +def step__invitations_get_invitations_get(test, rg): + test.cmd('az datashare invitation show ' + '--account-name "{Account1}" ' + '--name "{Invitation1}" ' + '--resource-group "{rg}" ' + '--share-name "{Share1}"', + checks=[]) + + +# EXAMPLE: /Invitations/get/Invitations_ListByShare +@try_manual +def step__invitations_get_invitations_listbyshare(test, rg): + test.cmd('az datashare invitation list ' + '--account-name "{Account1}" ' + '--resource-group "{rg}" ' + '--share-name "{Share1}"', + checks=[]) + + +# EXAMPLE: /ProviderShareSubscriptions/get/ProviderShareSubscriptions_GetByShare +@try_manual +def step__providersharesubscriptions_get_providersharesubscriptions_getbyshare(test, rg): + test.cmd('az datashare provider-share-subscription get-by-share ' + '--account-name "{Account1}" ' + '--provider-share-subscription-id "4256e2cf-0f82-4865-961b-12f83333f487" ' + '--resource-group "{rg}" ' + '--share-name "{Share1}"', + checks=[]) + + +# EXAMPLE: /ProviderShareSubscriptions/get/ProviderShareSubscriptions_ListByShare +@try_manual +def step__providersharesubscriptions_get_providersharesubscriptions_listbyshare(test, rg): + test.cmd('az datashare provider-share-subscription list ' + '--account-name "{Account1}" ' + '--resource-group "{rg}" ' + '--share-name "{Share1}"', + checks=[]) + + +# EXAMPLE: /ProviderShareSubscriptions/post/ProviderShareSubscriptions_Reinstate +@try_manual +def step__providersharesubscriptions_post_providersharesubscriptions_reinstate(test, rg): + test.cmd('az datashare provider-share-subscription reinstate ' + '--account-name "{Account1}" ' + '--provider-share-subscription-id "4256e2cf-0f82-4865-961b-12f83333f487" ' + '--resource-group "{rg}" ' + '--share-name "{Share1}"', + checks=[]) + + +# EXAMPLE: /ProviderShareSubscriptions/post/ProviderShareSubscriptions_Revoke +@try_manual +def step__providersharesubscriptions_post_providersharesubscriptions_revoke(test, rg): + test.cmd('az datashare provider-share-subscription revoke ' + '--account-name "{Account1}" ' + '--provider-share-subscription-id "4256e2cf-0f82-4865-961b-12f83333f487" ' + '--resource-group "{rg}" ' + '--share-name "{Share1}"', + checks=[]) + + +# EXAMPLE: /DataSets/get/DataSets_Get +@try_manual +def step__datasets_get_datasets_get(test, rg): + test.cmd('az datashare data-set show ' + '--account-name "{Account1}" ' + '--name "{Dataset1}" ' + '--resource-group "{rg}" ' + '--share-name "{Share1}"', + checks=[]) + + +# EXAMPLE: /ConsumerSourceDataSets/get/ConsumerSourceDataSets_ListByShareSubscription +@try_manual +def step__consumersourcedatasets_get_consumersourcedatasets_listbysharesubscription(test, rg): + test.cmd('az datashare consumer-source-data-set list ' + '--account-name "{Account1}" ' + '--resource-group "{rg}" ' + '--share-subscription-name "{ShareSubscriptions_2}"', + checks=[]) + + +# EXAMPLE: /ShareSubscriptions/get/ShareSubscriptions_Get +@try_manual +def step__sharesubscriptions_get_sharesubscriptions_get(test, rg): + test.cmd('az datashare share-subscription show ' + '--account-name "{Account1}" ' + '--resource-group "{rg}" ' + '--name "{ShareSubscription1}"', + checks=[]) + + +# EXAMPLE: /ShareSubscriptions/get/ShareSubscriptions_ListByAccount +@try_manual +def step__sharesubscriptions_get_sharesubscriptions_listbyaccount(test, rg): + test.cmd('az datashare share-subscription list ' + '--account-name "{Account1}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: /ShareSubscriptions/post/ShareSubscriptions_CancelSynchronization +@try_manual +def step__sharesubscriptions_post_sharesubscriptions_cancelsynchronization(test, rg): + test.cmd('az datashare share-subscription cancel-synchronization ' + '--account-name "{Account1}" ' + '--resource-group "{rg}" ' + '--name "{ShareSubscription1}" ' + '--synchronization-id "7d0536a6-3fa5-43de-b152-3d07c4f6b2bb"', + checks=[]) + + +# EXAMPLE: /ShareSubscriptions/post/ShareSubscriptions_ListSourceShareSynchronizationSettings +@try_manual +def step__sharesubscriptions_post_sharesubscriptions_listsourcesharesynchronizationsettings(test, rg): + test.cmd('az datashare share-subscription list-source-share-synchronization-setting ' + '--account-name "{Account1}" ' + '--resource-group "{rg}" ' + '--name "{ShareSubscriptions_3}"', + checks=[]) + + +# EXAMPLE: /ShareSubscriptions/post/ShareSubscriptions_ListSynchronizationDetails +@try_manual +def step__sharesubscriptions_post_sharesubscriptions_listsynchronizationdetails(test, rg): + test.cmd('az datashare share-subscription list-synchronization-detail ' + '--account-name "{Account1}" ' + '--resource-group "{rg}" ' + '--name "{ShareSubscriptions_3}" ' + '--synchronization-id "7d0536a6-3fa5-43de-b152-3d07c4f6b2bb"', + checks=[]) + + +# EXAMPLE: /ShareSubscriptions/post/ShareSubscriptions_ListSynchronizations +@try_manual +def step__sharesubscriptions_post_sharesubscriptions_listsynchronizations(test, rg): + test.cmd('az datashare share-subscription list-synchronization ' + '--account-name "{Account1}" ' + '--resource-group "{rg}" ' + '--name "{ShareSubscriptions_3}"', + checks=[]) + + +# EXAMPLE: /ShareSubscriptions/post/ShareSubscriptions_Synchronize +@try_manual +def step__sharesubscriptions_post_sharesubscriptions_synchronize(test, rg): + test.cmd('az datashare share-subscription synchronize ' + '--account-name "{Account1}" ' + '--resource-group "{rg}" ' + '--name "{ShareSubscription1}" ' + '--synchronization-mode "Incremental"', + checks=[]) + + +# EXAMPLE: /Shares/get/Shares_Get +@try_manual +def step__shares_get_shares_get(test, rg): + test.cmd('az datashare share show ' + '--account-name "{Account1}" ' + '--resource-group "{rg}" ' + '--name "{Share1}"', + checks=[]) + + +# EXAMPLE: /Shares/get/Shares_ListByAccount +@try_manual +def step__shares_get_shares_listbyaccount(test, rg): + test.cmd('az datashare share list ' + '--account-name "{Account1}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: /Shares/post/Shares_ListSynchronizationDetails +@try_manual +def step__shares_post_shares_listsynchronizationdetails(test, rg): + test.cmd('az datashare share list-synchronization-detail ' + '--account-name "{Account1}" ' + '--resource-group "{rg}" ' + '--name "{Share1}" ' + '--synchronization-id "7d0536a6-3fa5-43de-b152-3d07c4f6b2bb"', + checks=[]) + + +# EXAMPLE: /Shares/post/Shares_ListSynchronizations +@try_manual +def step__shares_post_shares_listsynchronizations(test, rg): + test.cmd('az datashare share list-synchronization ' + '--account-name "{Account1}" ' + '--resource-group "{rg}" ' + '--name "{Share1}"', + checks=[]) + + +# EXAMPLE: /SynchronizationSettings/put/SynchronizationSettings_Create +@try_manual +def step__synchronizationsettings_put_synchronizationsettings_create(test, rg): + test.cmd('az datashare synchronization-setting create ' + '--account-name "{Account1}" ' + '--resource-group "{rg}" ' + '--share-name "{Share1}" ' + '--scheduled-synchronization-setting recurrence-interval="Day" synchronization-time="2018-11-14T04:47:52.9' + '614956Z" ' + '--name "{Dataset1}"', + checks=[]) + + +# EXAMPLE: /SynchronizationSettings/get/SynchronizationSettings_Get +@try_manual +def step__synchronizationsettings_get_synchronizationsettings_get(test, rg): + test.cmd('az datashare synchronization-setting show ' + '--account-name "{Account1}" ' + '--resource-group "{rg}" ' + '--share-name "{Share1}" ' + '--name "{SynchronizationSettings_2}"', + checks=[]) + + +# EXAMPLE: /SynchronizationSettings/get/SynchronizationSettings_ListByShare +@try_manual +def step__synchronizationsettings_get_synchronizationsettings_listbyshare(test, rg): + test.cmd('az datashare synchronization-setting list ' + '--account-name "{Account1}" ' + '--resource-group "{rg}" ' + '--share-name "{Share1}"', + checks=[]) + + +# EXAMPLE: /DataSets/delete/DataSets_Delete +@try_manual +def step__datasets_delete_datasets_delete(test, rg): + test.cmd('az datashare data-set delete ' + '--account-name "{Account1}" ' + '--name "{Dataset1}" ' + '--resource-group "{rg}" ' + '--share-name "{Share1}"', + checks=[]) + + +# EXAMPLE: /Triggers/put/Triggers_Create +@try_manual +def step__triggers_put_triggers_create(test, rg): + test.cmd('az datashare trigger create ' + '--account-name "{Account1}" ' + '--resource-group "{rg}" ' + '--share-subscription-name "{ShareSubscription1}" ' + '--scheduled-trigger recurrence-interval="Day" synchronization-mode="Incremental" synchronization-time="20' + '18-11-14T04:47:52.9614956Z" ' + '--name "{Trigger1}"', + checks=[]) + + +# EXAMPLE: /Triggers/get/Triggers_Get +@try_manual +def step__triggers_get_triggers_get(test, rg): + test.cmd('az datashare trigger show ' + '--account-name "{Account1}" ' + '--resource-group "{rg}" ' + '--share-subscription-name "{ShareSubscription1}" ' + '--name "{Trigger1}"', + checks=[]) + + +# EXAMPLE: /Triggers/get/Triggers_ListByShareSubscription +@try_manual +def step__triggers_get_triggers_listbysharesubscription(test, rg): + test.cmd('az datashare trigger list ' + '--account-name "{Account1}" ' + '--resource-group "{rg}" ' + '--share-subscription-name "{ShareSubscription1}"', + checks=[]) + + +# EXAMPLE: /DataSetMappings/delete/DataSetMappings_Delete +@try_manual +def step__datasetmappings_delete_datasetmappings_delete(test, rg): + test.cmd('az datashare data-set-mapping delete ' + '--account-name "{Account1}" ' + '--name "{DatasetMapping1}" ' + '--resource-group "{rg}" ' + '--share-subscription-name "{ShareSubscription1}"', + checks=[]) + + +# EXAMPLE: /Triggers/delete/Triggers_Delete +@try_manual +def step__triggers_delete_triggers_delete(test, rg): + test.cmd('az datashare trigger delete ' + '--account-name "{Account1}" ' + '--resource-group "{rg}" ' + '--share-subscription-name "{ShareSubscription1}" ' + '--name "{Trigger1}"', + checks=[]) + + +# EXAMPLE: /Invitations/delete/Invitations_Delete +@try_manual +def step__invitations_delete_invitations_delete(test, rg): + test.cmd('az datashare invitation delete ' + '--account-name "{Account1}" ' + '--name "{Invitation1}" ' + '--resource-group "{rg}" ' + '--share-name "{Share1}"', + checks=[]) + + +# EXAMPLE: /SynchronizationSettings/delete/SynchronizationSettings_Delete +@try_manual +def step__synchronizationsettings_delete_synchronizationsettings_delete(test, rg): + test.cmd('az datashare synchronization-setting delete ' + '--account-name "{Account1}" ' + '--resource-group "{rg}" ' + '--share-name "{Share1}" ' + '--name "{SynchronizationSettings_2}"', + checks=[]) + + +# EXAMPLE: /Shares/delete/Shares_Delete +@try_manual +def step__shares_delete_shares_delete(test, rg): + test.cmd('az datashare share delete ' + '--account-name "{Account1}" ' + '--resource-group "{rg}" ' + '--name "{Share1}"', + checks=[]) + + +# EXAMPLE: /ShareSubscriptions/delete/ShareSubscriptions_Delete +@try_manual +def step__sharesubscriptions_delete_sharesubscriptions_delete(test, rg): + test.cmd('az datashare share-subscription delete ' + '--account-name "{Account1}" ' + '--resource-group "{rg}" ' + '--name "{ShareSubscription1}"', + checks=[]) + + +# EXAMPLE: /Accounts/delete/Accounts_Delete +@try_manual +def step__accounts_delete_accounts_delete(test, rg): + test.cmd('az datashare account delete ' + '--name "{Account1}" ' + '--resource-group "{rg}"', + checks=[]) + + +@try_manual +def cleanup(test, rg): + pass + + +@try_manual +def call_scenario(test, rg): + setup(test, rg) + step__accounts_put_accounts_create(test, rg) + step__accounts_get_accounts_get(test, rg) + step__accounts_get_accounts_listbyresourcegroup(test, rg) + step__accounts_get_accounts_listbysubscription(test, rg) + step__accounts_patch_accounts_update(test, rg) + step__consumerinvitations_get_consumerinvitations_get(test, rg) + step__consumerinvitations_get_consumerinvitations_listinvitations(test, rg) + step__consumerinvitations_post_consumerinvitations_rejectinvitation(test, rg) + step__sharesubscriptions_put_sharesubscriptions_create(test, rg) + step__datasetmappings_put_datasetmappings_create(test, rg) + step__datasetmappings_put_datasetmappings_sqldb_create(test, rg) + step__datasetmappings_put_datasetmappings_sqldwdatasettoadlsgen2file_create(test, rg) + step__datasetmappings_put_datasetmappings_sqldw_create(test, rg) + step__datasetmappings_get_datasetmappings_get(test, rg) + step__datasetmappings_get_datasetmappings_listbysharesubscription(test, rg) + step__shares_put_shares_create(test, rg) + step__datasets_put_datasets_kustocluster_create(test, rg) + step__datasets_put_datasets_kustodatabase_create(test, rg) + step__datasets_put_datasets_sqldbtable_create(test, rg) + step__datasets_put_datasets_sqldwtable_create(test, rg) + step__datasets_put_datasets_create(test, rg) + step__datasets_get_datasets_listbyshare(test, rg) + step__invitations_put_invitations_create(test, rg) + step__invitations_get_invitations_get(test, rg) + step__invitations_get_invitations_listbyshare(test, rg) + step__providersharesubscriptions_get_providersharesubscriptions_getbyshare(test, rg) + step__providersharesubscriptions_get_providersharesubscriptions_listbyshare(test, rg) + step__providersharesubscriptions_post_providersharesubscriptions_reinstate(test, rg) + step__providersharesubscriptions_post_providersharesubscriptions_revoke(test, rg) + step__datasets_get_datasets_get(test, rg) + step__consumersourcedatasets_get_consumersourcedatasets_listbysharesubscription(test, rg) + step__sharesubscriptions_get_sharesubscriptions_get(test, rg) + step__sharesubscriptions_get_sharesubscriptions_listbyaccount(test, rg) + step__sharesubscriptions_post_sharesubscriptions_cancelsynchronization(test, rg) + step__sharesubscriptions_post_sharesubscriptions_listsourcesharesynchronizationsettings(test, rg) + step__sharesubscriptions_post_sharesubscriptions_listsynchronizationdetails(test, rg) + step__sharesubscriptions_post_sharesubscriptions_listsynchronizations(test, rg) + step__sharesubscriptions_post_sharesubscriptions_synchronize(test, rg) + step__shares_get_shares_get(test, rg) + step__shares_get_shares_listbyaccount(test, rg) + step__shares_post_shares_listsynchronizationdetails(test, rg) + step__shares_post_shares_listsynchronizations(test, rg) + step__synchronizationsettings_put_synchronizationsettings_create(test, rg) + step__synchronizationsettings_get_synchronizationsettings_get(test, rg) + step__synchronizationsettings_get_synchronizationsettings_listbyshare(test, rg) + step__datasets_delete_datasets_delete(test, rg) + step__triggers_put_triggers_create(test, rg) + step__triggers_get_triggers_get(test, rg) + step__triggers_get_triggers_listbysharesubscription(test, rg) + step__datasetmappings_delete_datasetmappings_delete(test, rg) + step__triggers_delete_triggers_delete(test, rg) + step__invitations_delete_invitations_delete(test, rg) + step__synchronizationsettings_delete_synchronizationsettings_delete(test, rg) + step__shares_delete_shares_delete(test, rg) + step__sharesubscriptions_delete_sharesubscriptions_delete(test, rg) + step__accounts_delete_accounts_delete(test, rg) + cleanup(test, rg) + + +@try_manual class DataShareManagementClientScenarioTest(ScenarioTest): - @ResourceGroupPreparer(name_prefix='cli_test_datashare_provider_rg'[:12], location='westus2', key='ProviderResourceGroup') - @StorageAccountPreparer(name_prefix='clitestdatashareprovidersa'[:12], location='westus2', key='ProviderStorageAccount') - @AllowLargeResponse() - def test_datashare(self, resource_group, storage_account): + @ResourceGroupPreparer(name_prefix='clitestdatashare_SampleResourceGroup'[:7], key='rg', parameter_name='rg') + def test_datashare(self, rg): self.kwargs.update({ - 'ConsumerSubscription': '00000000-0000-0000-0000-000000000000', # change this value in live test - 'ConsumerResourceGroup': 'datashare_consumer_rg', # this is a pre-existing reosurce group in consumer subscription - 'ConsumerStorageAccount': 'datashareconsumersa', # this is a pre-existing storage account in consumer subscription - 'ProviderEmail': 'provider@microsoft.com', # change this value in live test - 'ConsumerEmail': 'consumer@microsoft.com', # change this value in live test - 'ProviderAccount': 'cli_test_account', - 'ConsumerAccount': 'cli_test_consumer_account', - 'ProviderDataset': 'cli_test_data_set', - 'ConsumerDatasetMapping': 'cli_test_data_set_mapping', - 'ProviderInvitation': 'cli_test_invitation', - 'ProviderShare': 'cli_test_share', - 'ConsumerShareSubscription': 'cli_test_share_subscription', - 'ProviderSynchronizationSetting': 'cli_test_synchronization_setting', - 'ConsumerTrigger': 'cli_test_trigger', - 'ProviderContainer': 'clitestcontainer', - 'ConsumerContainer': 'clitestconsumercontainer', + 'subscription_id': self.get_subscription_id() }) - # Provider commands - datashareAccount = self.cmd('az datashare account create ' - '--location "West US 2" ' - '--tags tag1=Red tag2=White ' - '--name "{ProviderAccount}" ' - '--resource-group "{ProviderResourceGroup}"', - checks=[self.check('name', '{ProviderAccount}'), - self.check('location', 'westus2'), - self.check('resourceGroup', '{ProviderResourceGroup}'), - self.check('tags.tag1', 'Red'), - self.check('tags.tag2', 'White') - ]).get_output_in_json() - - self.cmd('az datashare account wait ' - '--name "{ProviderAccount}" ' - '--resource-group "{ProviderResourceGroup}" ' - '--created', - checks=[]) - - accountId = datashareAccount['id'] - self.cmd('az datashare account show ' - '-n "{ProviderAccount}" ' - '--resource-group "{ProviderResourceGroup}"', - checks=[self.check('name', '{ProviderAccount}'), - self.check('location', 'westus2'), - self.check('provisioningState', 'Succeeded'), - self.check('resourceGroup', '{ProviderResourceGroup}'), - self.check('tags.tag1', 'Red'), - self.check('tags.tag2', 'White') - ]) - - self.cmd('az datashare account show ' - '--ids {}'.format(accountId), - checks=[self.check('name', '{ProviderAccount}'), - self.check('location', 'westus2'), - self.check('provisioningState', 'Succeeded'), - self.check('resourceGroup', '{ProviderResourceGroup}'), - self.check('tags.tag1', 'Red'), - self.check('tags.tag2', 'White') - ]) - - self.cmd('az datashare account list ' - '--resource-group "{ProviderResourceGroup}"', - checks=[self.check("[?id=='{}'].name | [0]".format(accountId), '{ProviderAccount}'), - self.check("[?id=='{}'].location | [0]".format(accountId), 'westus2'), - self.check("[?id=='{}'].resourceGroup | [0]".format(accountId), '{ProviderResourceGroup}'), - self.check("[?id=='{}'].tags | [0].tag1".format(accountId), 'Red'), - self.check("[?id=='{}'].tags | [0].tag2".format(accountId), 'White')]) - - self.cmd('az datashare account update ' - '--name "{ProviderAccount}" ' - '--tags tag1=Green ' - '--resource-group "{ProviderResourceGroup}"', - checks=[self.check('name', '{ProviderAccount}'), - self.check('location', 'westus2'), - self.check('provisioningState', 'Succeeded'), - self.check('resourceGroup', '{ProviderResourceGroup}'), - self.check('tags.tag1', 'Green')]) - - datashare = self.cmd('az datashare create ' - '--account-name "{ProviderAccount}" ' - '--resource-group "{ProviderResourceGroup}" ' - '--description "share description" ' - '--share-kind "CopyBased" ' - '--terms "Confidential" ' - '--name "{ProviderShare}"', - checks=[self.check('name', '{ProviderShare}'), - self.check('description', 'share description'), - self.check('shareKind', 'CopyBased'), - self.check('terms', 'Confidential')]).get_output_in_json() - - self.cmd('az datashare show ' - '--account-name "{ProviderAccount}" ' - '--resource-group "{ProviderResourceGroup}" ' - '--name "{ProviderShare}"', - checks=[self.check('name', '{ProviderShare}'), - self.check('description', 'share description'), - self.check('shareKind', 'CopyBased'), - self.check('terms', 'Confidential')]) - - datashareId = datashare['id'] - self.cmd('az datashare show ' - '--ids {}'.format(datashareId), - checks=[self.check('name', '{ProviderShare}'), - self.check('description', 'share description'), - self.check('shareKind', 'CopyBased'), - self.check('terms', 'Confidential')]) - - self.cmd('az datashare list ' - '--account-name "{ProviderAccount}" ' - '--resource-group "{ProviderResourceGroup}"', - checks=[self.check("[?id=='{}'].name | [0]".format(datashareId), '{ProviderShare}'), - self.check("[?id=='{}'].description | [0]".format(datashareId), 'share description'), - self.check("[?id=='{}'].shareKind | [0]".format(datashareId), 'CopyBased'), - self.check("[?id=='{}'].terms | [0]".format(datashareId), 'Confidential')]) - - storage_account_json = self.cmd('az storage account show ' - '-n {ProviderStorageAccount} ' - '-g {ProviderResourceGroup}').get_output_in_json() - - accountPrincipalId = datashareAccount['identity']['principalId'] - if self.is_live or self.in_recording: - import time - self.cmd('az role assignment create ' - '--role "2a2b9908-6ea1-4ae2-8e65-a410df84e7d1" ' # Storage Blob Data Reader - '--assignee-object-id {} ' - '--assignee-principal-type ServicePrincipal ' - '--scope {}'.format(accountPrincipalId, storage_account_json['id'])) - time.sleep(5) - - self.cmd('az storage container create ' - '--account-name {ProviderStorageAccount} ' - '--name {ProviderContainer}') - - datasetContent = {"container_name": "{}".format(self.kwargs.get('ProviderContainer', '')), "storage_account_name": "{}".format(storage_account), "kind": "Container"} self.kwargs.update({ - 'ProviderDatasetContent': datasetContent + 'Account1': 'Account1', + 'Share1': 'Share1', + 'ShareSubscription1': 'ShareSubscription1', + 'ShareSubscriptions_2': 'Share1', + 'ShareSubscriptions_3': 'ShareSub1', + 'Dataset1': 'Dataset1', + 'SynchronizationSettings_2': 'SyncrhonizationSetting1', + 'Trigger1': 'Trigger1', + 'Dataset1': 'Dataset1', + 'DatasetMapping1': 'DatasetMapping1', + 'Invitation1': 'Invitation1', }) - self.cmd('az datashare dataset create ' - '--account-name "{ProviderAccount}" ' - '--dataset "{ProviderDatasetContent}" ' - '--name "{ProviderDataset}" ' - '--resource-group "{ProviderResourceGroup}" ' - '--share-name "{ProviderShare}"', - checks=[self.check('containerName', '{ProviderContainer}'), - self.check('storageAccountName', '{ProviderStorageAccount}'), - self.check('kind', 'Container'), - self.check('name', '{ProviderDataset}')]) - - self.cmd('az datashare dataset show ' - '--account-name "{ProviderAccount}" ' - '--name "{ProviderDataset}" ' - '--resource-group "{ProviderResourceGroup}" ' - '--share-name "{ProviderShare}"', - checks=[self.check('containerName', '{ProviderContainer}'), - self.check('storageAccountName', '{ProviderStorageAccount}'), - self.check('kind', 'Container'), - self.check('name', '{ProviderDataset}')]) - - self.cmd('az datashare dataset list ' - '--account-name "{ProviderAccount}" ' - '--resource-group "{ProviderResourceGroup}" ' - '--share-name "{ProviderShare}"', - checks=[self.check('[0].containerName', '{ProviderContainer}'), - self.check('[0].storageAccountName', '{ProviderStorageAccount}'), - self.check('[0].kind', 'Container'), - self.check('[0].name', '{ProviderDataset}')]) - - self.cmd('az datashare synchronization-setting create ' - '--account-name "{ProviderAccount}" ' - '--resource-group "{ProviderResourceGroup}" ' - '--share-name "{ProviderShare}" ' - '--name "{ProviderSynchronizationSetting}" ' - '--recurrence-interval "Day" ' - '--synchronization-time "2020-04-05 10:50:00 +00:00"', - checks=[self.check('kind', 'ScheduleBased'), - self.check('name', '{ProviderSynchronizationSetting}'), - self.check('recurrenceInterval', 'Day'), - self.check('resourceGroup', '{ProviderResourceGroup}'), - self.check('synchronizationTime', '2020-04-05T10:50:00+00:00')]) - - self.cmd('az datashare synchronization-setting show ' - '--account-name "{ProviderAccount}" ' - '--resource-group "{ProviderResourceGroup}" ' - '--share-name "{ProviderShare}" ' - '--name "{ProviderSynchronizationSetting}"', - checks=[self.check('kind', 'ScheduleBased'), - self.check('name', '{ProviderSynchronizationSetting}'), - self.check('recurrenceInterval', 'Day'), - self.check('resourceGroup', '{ProviderResourceGroup}'), - self.check('synchronizationTime', '2020-04-05T10:50:00+00:00')]) - - self.cmd('az datashare synchronization-setting list ' - '--account-name "{ProviderAccount}" ' - '--resource-group "{ProviderResourceGroup}" ' - '--share-name "{ProviderShare}"', - checks=[self.check('[0].kind', 'ScheduleBased'), - self.check('[0].name', '{ProviderSynchronizationSetting}'), - self.check('[0].recurrenceInterval', 'Day'), - self.check('[0].resourceGroup', '{ProviderResourceGroup}'), - self.check('[0].synchronizationTime', '2020-04-05T10:50:00+00:00')]) - - self.cmd('az datashare synchronization list ' - '--account-name "{ProviderAccount}" ' - '--resource-group "{ProviderResourceGroup}" ' - '--share-name "{ProviderShare}"', - checks=[]) - - # self.cmd('az datashare synchronization list-detail ' - # '--account-name "{ProviderAccount}" ' - # '--resource-group "{ProviderResourceGroup}" ' - # '--share-name "{ProviderShare}" ' - # '--synchronization-id "7d0536a6-3fa5-43de-b152-3d07c4f6b2bb"', - # checks=[]) - - self.cmd('az datashare invitation create ' - '--account-name "{ProviderAccount}" ' - '--target-email "{ConsumerEmail}" ' - '--name "{ProviderInvitation}" ' - '--resource-group "{ProviderResourceGroup}" ' - '--share-name "{ProviderShare}"', - checks=[self.check('invitationStatus', 'Pending'), - self.check('name', '{ProviderInvitation}'), - self.check('resourceGroup', '{ProviderResourceGroup}'), - self.check('targetEmail', '{ConsumerEmail}')]) - - self.cmd('az datashare invitation list ' - '--account-name "{ProviderAccount}" ' - '--resource-group "{ProviderResourceGroup}" ' - '--share-name "{ProviderShare}"', - checks=[self.check('[0].invitationStatus', 'Pending'), - self.check('[0].name', '{ProviderInvitation}'), - self.check('[0].resourceGroup', '{ProviderResourceGroup}'), - self.check('[0].targetEmail', '{ConsumerEmail}')]) - - self.cmd('az datashare invitation show ' - '--account-name "{ProviderAccount}" ' - '--name "{ProviderInvitation}" ' - '--resource-group "{ProviderResourceGroup}" ' - '--share-name "{ProviderShare}"', - checks=[self.check('invitationStatus', 'Pending'), - self.check('name', '{ProviderInvitation}'), - self.check('resourceGroup', '{ProviderResourceGroup}'), - self.check('targetEmail', '{ConsumerEmail}')]) - - # Consumer commands - datashareConsumerAccount = self.cmd('az datashare account create ' - '--location "West US 2" ' - '--name "{ConsumerAccount}" ' - '--resource-group "{ConsumerResourceGroup}" ' - '--subscription "{ConsumerSubscription}"', - checks=[self.check('name', '{ConsumerAccount}'), - self.check('location', 'westus2'), - self.check('resourceGroup', '{ConsumerResourceGroup}')]).get_output_in_json() - - invitations = self.cmd('az datashare consumer invitation list ' - '--subscription "{ConsumerSubscription}"', - checks=[self.check('[0].invitationStatus', 'Pending'), - self.check('[0].name', '{ProviderInvitation}'), - self.check('[0].shareName', '{ProviderShare}'), - self.check('[0].providerEmail', '{ProviderEmail}')]).get_output_in_json() - - invitationId = invitations[0]['invitationId'] - sourceShareLocation = invitations[0]['location'] - self.kwargs.update({'InvitationId1': invitationId, - 'Location1': sourceShareLocation}) - - self.cmd('az datashare consumer invitation show ' - '--invitation-id "{InvitationId1}" ' - '--subscription "{ConsumerSubscription}" ' - '--location "{Location1}"', - checks=[self.check('invitationStatus', 'Pending'), - self.check('name', '{ProviderInvitation}'), - self.check('shareName', '{ProviderShare}'), - self.check('providerEmail', '{ProviderEmail}')]) - -# self.cmd('az datashare consumer invitation reject ' -# '--invitation-id 00000000-0000-0000-0000-000000000000 ' -# checks=[]) - - self.cmd('az datashare account wait ' - '--name "{ConsumerAccount}" ' - '--resource-group "{ConsumerResourceGroup}" ' - '--created ' - '--subscription "{ConsumerSubscription}"', - checks=[]) - - self.cmd('az datashare consumer share-subscription create ' - '--account-name "{ConsumerAccount}" ' - '--resource-group "{ConsumerResourceGroup}" ' - '--invitation-id "{InvitationId1}" ' - '--source-share-location "{Location1}" ' - '--name "{ConsumerShareSubscription}" ' - '--subscription "{ConsumerSubscription}"', - checks=[self.check('invitationId', '{InvitationId1}'), - self.check('name', '{ConsumerShareSubscription}'), - self.check('resourceGroup', '{ConsumerResourceGroup}'), - self.check('shareName', '{ProviderShare}'), - self.check('shareKind', 'CopyBased'), - self.check('sourceShareLocation', '{Location1}')]) - - self.cmd('az datashare consumer share-subscription show ' - '--account-name "{ConsumerAccount}" ' - '--resource-group "{ConsumerResourceGroup}" ' - '--name "{ConsumerShareSubscription}" ' - '--subscription "{ConsumerSubscription}"', - checks=[self.check('invitationId', '{InvitationId1}'), - self.check('name', '{ConsumerShareSubscription}'), - self.check('resourceGroup', '{ConsumerResourceGroup}'), - self.check('shareName', '{ProviderShare}'), - self.check('shareKind', 'CopyBased'), - self.check('sourceShareLocation', '{Location1}')]) - - self.cmd('az datashare consumer share-subscription list ' - '--account-name "{ConsumerAccount}" ' - '--resource-group "{ConsumerResourceGroup}" ' - '--subscription "{ConsumerSubscription}"', - checks=[self.check('[0].invitationId', '{InvitationId1}'), - self.check('[0].name', '{ConsumerShareSubscription}'), - self.check('[0].resourceGroup', '{ConsumerResourceGroup}'), - self.check('[0].shareName', '{ProviderShare}'), - self.check('[0].shareKind', 'CopyBased'), - self.check('[0].sourceShareLocation', '{Location1}')]) - - sourceDatasets = self.cmd('az datashare consumer share-subscription list-source-dataset ' - '--account-name "{ConsumerAccount}" ' - '--resource-group "{ConsumerResourceGroup}" ' - '--share-subscription-name "{ConsumerShareSubscription}" ' - '--subscription "{ConsumerSubscription}"', - checks=[self.check('[0].dataSetName', '{ProviderDataset}'), - self.check('[0].dataSetType', 'Container')]).get_output_in_json() - sourceDatasetId = sourceDatasets[0]['dataSetId'] - - storage_account2_json = self.cmd('az storage account show ' - '-n {ConsumerStorageAccount} ' - '-g {ConsumerResourceGroup} ' - '--subscription "{ConsumerSubscription}"').get_output_in_json() - - accountPrincipalId2 = datashareConsumerAccount['identity']['principalId'] - self.kwargs.update({ - "AccountPrincipalId2": accountPrincipalId2, - "StorageAccountId2": storage_account2_json['id']}) - - if self.is_live or self.in_recording: - import time - self.cmd('az role assignment create ' - '--role "ba92f5b4-2d11-453d-a403-e96b0029c9fe" ' # Storage Blob Data Contributor - '--assignee-object-id "{AccountPrincipalId2}" ' - '--assignee-principal-type ServicePrincipal ' - '--scope "{StorageAccountId2}" ' - '--subscription "{ConsumerSubscription}"') - time.sleep(5) - - datasetMappingContent = {"data_set_id": "{}".format(sourceDatasetId), - "container_name": "{}".format(self.kwargs.get('ConsumerContainer', '')), - "storage_account_name": "{}".format(self.kwargs.get('ConsumerStorageAccount', '')), - "kind": "BlobFolder", - "prefix": "{}".format(self.kwargs.get('ProviderDataset', ''))} - self.kwargs.update({ - 'ConsumerDatasetMappingContent': datasetMappingContent - }) - self.cmd('az datashare consumer dataset-mapping create ' - '--account-name "{ConsumerAccount}" ' - '--name "{ConsumerDatasetMapping}" ' - '--resource-group "{ConsumerResourceGroup}" ' - '--share-subscription-name "{ConsumerShareSubscription}" ' - '--mapping "{ConsumerDatasetMappingContent}" ' - '--subscription "{ConsumerSubscription}"', - checks=[self.check('kind', 'BlobFolder'), - self.check('name', '{ConsumerDatasetMapping}'), - self.check('prefix', '{ProviderDataset}'), - self.check('storageAccountName', '{ConsumerStorageAccount}')]) - - self.cmd('az datashare consumer share-subscription synchronization start ' - '--account-name "{ConsumerAccount}" ' - '--resource-group "{ConsumerResourceGroup}" ' - '--share-subscription-name "{ConsumerShareSubscription}" ' - '--synchronization-mode "Incremental" ' - '--subscription "{ConsumerSubscription}"', - checks=[self.check('status', 'Queued'), - self.check('synchronizationMode', 'Incremental')]) - - self.cmd('az datashare consumer dataset-mapping show ' - '--account-name "{ConsumerAccount}" ' - '--name "{ConsumerDatasetMapping}" ' - '--resource-group "{ConsumerResourceGroup}" ' - '--share-subscription-name "{ConsumerShareSubscription}" ' - '--subscription "{ConsumerSubscription}"', - checks=[self.check('kind', 'BlobFolder'), - self.check('name', '{ConsumerDatasetMapping}'), - self.check('prefix', '{ProviderDataset}'), - self.check('storageAccountName', '{ConsumerStorageAccount}')]) - - self.cmd('az datashare consumer dataset-mapping list ' - '--account-name "{ConsumerAccount}" ' - '--resource-group "{ConsumerResourceGroup}" ' - '--share-subscription-name "{ConsumerShareSubscription}" ' - '--subscription "{ConsumerSubscription}"', - checks=[self.check('[0].kind', 'BlobFolder'), - self.check('[0].name', '{ConsumerDatasetMapping}'), - self.check('[0].prefix', '{ProviderDataset}'), - self.check('[0].storageAccountName', '{ConsumerStorageAccount}')]) - - self.cmd('az datashare consumer share-subscription synchronization list ' - '--account-name "{ConsumerAccount}" ' - '--resource-group "{ConsumerResourceGroup}" ' - '--share-subscription-name "{ConsumerShareSubscription}" ' - '--subscription "{ConsumerSubscription}"', - checks=[self.check('[0].synchronizationMode', 'Incremental')]) - -# self.cmd('az datashare consumer share-subscription synchronization list-detail ' -# '--account-name "{ConsumerAccount}" ' -# '--resource-group "{ConsumerResourceGroup}" ' -# '--share-subscription-name "{ConsumerShareSubscription}" ' -# '--synchronization-id "7d0536a6-3fa5-43de-b152-3d07c4f6b2bb" ' -# '--subscription "{ConsumerSubscription}"', -# checks=[]) - -# self.cmd('az datashare consumer share-subscription synchronization cancel ' -# '--account-name "{ConsumerAccount}" ' -# '--resource-group "{ConsumerResourceGroup}" ' -# '--share-subscription-name "{ConsumerShareSubscription}" ' -# '--synchronization-id "7d0536a6-3fa5-43de-b152-3d07c4f6b2bb" ' -# '--subscription "{ConsumerSubscription}"', -# checks=[]) - - self.cmd('az datashare consumer share-subscription list-source-share-synchronization-setting ' - '--account-name "{ConsumerAccount}" ' - '--resource-group "{ConsumerResourceGroup}" ' - '--share-subscription-name "{ConsumerShareSubscription}" ' - '--subscription "{ConsumerSubscription}"', - checks=[self.check('[0].recurrenceInterval', 'Day'), - self.check('[0].kind', 'ScheduleBased')]) - - self.cmd('az datashare consumer trigger create ' - '--account-name "{ConsumerAccount}" ' - '--resource-group "{ConsumerResourceGroup}" ' - '--share-subscription-name "{ConsumerShareSubscription}" ' - '--name "{ConsumerTrigger}" ' - '--recurrence-interval "Day" ' - '--synchronization-time "2020-04-05 10:50:00 +00:00" ' - '--subscription "{ConsumerSubscription}"', - checks=[self.check('properties.recurrenceInterval', 'Day'), # TODO properties is not removed in the response structure - self.check('properties.synchronizationMode', 'Incremental')]) - - self.cmd('az datashare consumer trigger show ' - '--account-name "{ConsumerAccount}" ' - '--resource-group "{ConsumerResourceGroup}" ' - '--share-subscription-name "{ConsumerShareSubscription}" ' - '--name "{ConsumerTrigger}" ' - '--subscription "{ConsumerSubscription}"', - checks=[self.check('recurrenceInterval', 'Day'), - self.check('synchronizationMode', 'Incremental')]) - - self.cmd('az datashare consumer trigger list ' - '--account-name "{ConsumerAccount}" ' - '--resource-group "{ConsumerResourceGroup}" ' - '--share-subscription-name "{ConsumerShareSubscription}" ' - '--subscription "{ConsumerSubscription}"', - checks=[self.check('[0].recurrenceInterval', 'Day'), - self.check('[0].synchronizationMode', 'Incremental')]) - - # Provider commands - providerShareSubscriptions = self.cmd('az datashare provider-share-subscription list ' - '--account-name "{ProviderAccount}" ' - '--resource-group "{ProviderResourceGroup}" ' - '--share-name "{ProviderShare}"', - checks=[self.check('[0].consumerEmail', '{ConsumerEmail}'), - self.check('[0].providerEmail', '{ProviderEmail}'), - self.check('[0].shareSubscriptionStatus', 'Active'), - self.check('[0].name', '{ConsumerShareSubscription}')]).get_output_in_json() - shareSubscriptionObjectId = providerShareSubscriptions[0]['shareSubscriptionObjectId'] - self.kwargs.update({'ProviderShareSubscriptionObjectId': shareSubscriptionObjectId}) - - self.cmd('az datashare provider-share-subscription show ' - '--account-name "{ProviderAccount}" ' - '--share-subscription "{ProviderShareSubscriptionObjectId}" ' - '--resource-group "{ProviderResourceGroup}" ' - '--share-name "{ProviderShare}"', - checks=[self.check('consumerEmail', '{ConsumerEmail}'), - self.check('providerEmail', '{ProviderEmail}'), - self.check('shareSubscriptionStatus', 'Active'), - self.check('name', '{ConsumerShareSubscription}'), - self.check('shareSubscriptionObjectId', '{ProviderShareSubscriptionObjectId}')]) - - self.cmd('az datashare provider-share-subscription revoke ' - '--account-name "{ProviderAccount}" ' - '--share-subscription "{ProviderShareSubscriptionObjectId}" ' - '--resource-group "{ProviderResourceGroup}" ' - '--share-name "{ProviderShare}"', - checks=[self.check('consumerEmail', '{ConsumerEmail}'), - self.check('providerEmail', '{ProviderEmail}'), - self.check('shareSubscriptionStatus', 'Revoking'), - self.check('name', '{ConsumerShareSubscription}'), - self.check('shareSubscriptionObjectId', '{ProviderShareSubscriptionObjectId}')]) - - if self.is_live or self.in_recording: - import time - time.sleep(5) - - self.cmd('az datashare provider-share-subscription reinstate ' - '--account-name "{ProviderAccount}" ' - '--share-subscription "{ProviderShareSubscriptionObjectId}" ' - '--resource-group "{ProviderResourceGroup}" ' - '--share-name "{ProviderShare}"', - checks=[self.check('consumerEmail', '{ConsumerEmail}'), - self.check('providerEmail', '{ProviderEmail}'), - self.check('shareSubscriptionStatus', 'Active'), - self.check('name', '{ConsumerShareSubscription}'), - self.check('shareSubscriptionObjectId', '{ProviderShareSubscriptionObjectId}')]) - - # Provider Clean up - self.cmd('az datashare synchronization-setting delete ' - '--account-name "{ProviderAccount}" ' - '--resource-group "{ProviderResourceGroup}" ' - '--share-name "{ProviderShare}" ' - '--name "{ProviderSynchronizationSetting}" ' - '--yes', - checks=[]) - - # self.cmd('az datashare invitation delete ' - # '--account-name "{ProviderAccount}" ' - # '--name "{ProviderInvitation}" ' - # '--resource-group "{ProviderResourceGroup}" ' - # '--share-name "{ProviderShare}"', - # checks=[]) - - self.cmd('az datashare dataset delete ' - '--account-name "{ProviderAccount}" ' - '--name "{ProviderDataset}" ' - '--resource-group "{ProviderResourceGroup}" ' - '--share-name "{ProviderShare}" ' - '--yes', - checks=[]) - - self.cmd('az datashare delete ' - '--account-name "{ProviderAccount}" ' - '--resource-group "{ProviderResourceGroup}" ' - '--name "{ProviderShare}" ' - '--yes', - checks=[]) - - self.cmd('az datashare account delete ' - '--name "{ProviderAccount}" ' - '--resource-group "{ProviderResourceGroup}" ' - '--no-wait ' - '--yes', - checks=[]) - - self.cmd('az datashare consumer trigger delete ' - '--account-name "{ConsumerAccount}" ' - '--resource-group "{ConsumerResourceGroup}" ' - '--share-subscription-name "{ConsumerShareSubscription}" ' - '--name "{ConsumerTrigger}" ' - '--yes ' - '--subscription "{ConsumerSubscription}"', - checks=[]) - self.cmd('az datashare consumer dataset-mapping delete ' - '--account-name "{ConsumerAccount}" ' - '--name "{ConsumerDatasetMapping}" ' - '--resource-group "{ConsumerResourceGroup}" ' - '--share-subscription-name "{ConsumerShareSubscription}" ' - '--yes ' - '--subscription "{ConsumerSubscription}"', - checks=[]) - self.cmd('az datashare consumer share-subscription delete ' - '--account-name "{ConsumerAccount}" ' - '--resource-group "{ConsumerResourceGroup}" ' - '--name "{ConsumerShareSubscription}" ' - '--yes ' - '--subscription "{ConsumerSubscription}"', - checks=[]) - self.cmd('az datashare account delete ' - '--name "{ConsumerAccount}" ' - '--resource-group "{ConsumerResourceGroup}" ' - '--no-wait ' - '--yes ' - '--subscription "{ConsumerSubscription}"', - checks=[]) + + call_scenario(self, rg) + raise_if() diff --git a/src/datashare/azext_datashare/vendored_sdks/__init__.py b/src/datashare/azext_datashare/vendored_sdks/__init__.py index 8d86d5a6be..ee0c4f36bd 100644 --- a/src/datashare/azext_datashare/vendored_sdks/__init__.py +++ b/src/datashare/azext_datashare/vendored_sdks/__init__.py @@ -9,4 +9,4 @@ # regenerated. # -------------------------------------------------------------------------- -__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/__init__.py b/src/datashare/azext_datashare/vendored_sdks/datashare/__init__.py index eb57d0ef34..d6d4131905 100644 --- a/src/datashare/azext_datashare/vendored_sdks/datashare/__init__.py +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/__init__.py @@ -8,3 +8,9 @@ from ._data_share_management_client import DataShareManagementClient __all__ = ['DataShareManagementClient'] + +try: + from ._patch import patch_sdk + patch_sdk() +except ImportError: + pass diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/_configuration.py b/src/datashare/azext_datashare/vendored_sdks/datashare/_configuration.py index 88932a1125..d321d21a82 100644 --- a/src/datashare/azext_datashare/vendored_sdks/datashare/_configuration.py +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/_configuration.py @@ -6,11 +6,17 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any +from typing import TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + VERSION = "unknown" class DataShareManagementClientConfiguration(Configuration): @@ -20,7 +26,7 @@ class DataShareManagementClientConfiguration(Configuration): attributes. :param credential: Credential needed for the client to connect to Azure. - :type credential: azure.core.credentials.TokenCredential + :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The subscription identifier. :type subscription_id: str """ @@ -41,6 +47,8 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2019-11-01" + self.credential_scopes = ['https://management.azure.com/.default'] + self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) kwargs.setdefault('sdk_moniker', 'datasharemanagementclient/{}'.format(VERSION)) self._configure(**kwargs) @@ -58,4 +66,4 @@ def _configure( self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) self.authentication_policy = kwargs.get('authentication_policy') if self.credential and not self.authentication_policy: - self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, **kwargs) + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/_data_share_management_client.py b/src/datashare/azext_datashare/vendored_sdks/datashare/_data_share_management_client.py index c36cabec84..c0a848374f 100644 --- a/src/datashare/azext_datashare/vendored_sdks/datashare/_data_share_management_client.py +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/_data_share_management_client.py @@ -6,11 +6,17 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional +from typing import TYPE_CHECKING -from azure.core import PipelineClient +from azure.mgmt.core import ARMPipelineClient from msrest import Deserializer, Serializer +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential + from ._configuration import DataShareManagementClientConfiguration from .operations import AccountOperations from .operations import ConsumerInvitationOperations @@ -55,10 +61,11 @@ class DataShareManagementClient(object): :ivar trigger: TriggerOperations operations :vartype trigger: data_share_management_client.operations.TriggerOperations :param credential: Credential needed for the client to connect to Azure. - :type credential: azure.core.credentials.TokenCredential + :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The subscription identifier. :type subscription_id: str :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -72,7 +79,7 @@ def __init__( if not base_url: base_url = 'https://management.azure.com' self._config = DataShareManagementClientConfiguration(credential, subscription_id, **kwargs) - self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/aio/_configuration_async.py b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/_configuration_async.py index a5c30f8ec3..55d7e7cb29 100644 --- a/src/datashare/azext_datashare/vendored_sdks/datashare/aio/_configuration_async.py +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/_configuration_async.py @@ -6,11 +6,15 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any +from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + VERSION = "unknown" class DataShareManagementClientConfiguration(Configuration): @@ -20,14 +24,14 @@ class DataShareManagementClientConfiguration(Configuration): attributes. :param credential: Credential needed for the client to connect to Azure. - :type credential: azure.core.credentials.TokenCredential + :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The subscription identifier. :type subscription_id: str """ def __init__( self, - credential: "TokenCredential", + credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any ) -> None: @@ -40,6 +44,8 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2019-11-01" + self.credential_scopes = ['https://management.azure.com/.default'] + self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) kwargs.setdefault('sdk_moniker', 'datasharemanagementclient/{}'.format(VERSION)) self._configure(**kwargs) @@ -56,4 +62,4 @@ def _configure( self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) self.authentication_policy = kwargs.get('authentication_policy') if self.credential and not self.authentication_policy: - self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, **kwargs) + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/aio/_data_share_management_client_async.py b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/_data_share_management_client_async.py index 0609b8e259..5e6674687e 100644 --- a/src/datashare/azext_datashare/vendored_sdks/datashare/aio/_data_share_management_client_async.py +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/_data_share_management_client_async.py @@ -6,11 +6,15 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional +from typing import Any, Optional, TYPE_CHECKING -from azure.core import AsyncPipelineClient +from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + from ._configuration_async import DataShareManagementClientConfiguration from .operations_async import AccountOperations from .operations_async import ConsumerInvitationOperations @@ -55,15 +59,16 @@ class DataShareManagementClient(object): :ivar trigger: TriggerOperations operations :vartype trigger: data_share_management_client.aio.operations_async.TriggerOperations :param credential: Credential needed for the client to connect to Azure. - :type credential: azure.core.credentials.TokenCredential + :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The subscription identifier. :type subscription_id: str :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( self, - credential: "TokenCredential", + credential: "AsyncTokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any @@ -71,7 +76,7 @@ def __init__( if not base_url: base_url = 'https://management.azure.com' self._config = DataShareManagementClientConfiguration(credential, subscription_id, **kwargs) - self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_account_operations_async.py b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_account_operations_async.py index 5c29363059..aea13e8054 100644 --- a/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_account_operations_async.py +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_account_operations_async.py @@ -5,7 +5,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -13,6 +13,8 @@ from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models @@ -41,6 +43,77 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + def list_by_subscription( + self, + skip_token: Optional[str] = None, + **kwargs + ) -> AsyncIterable["models.AccountList"]: + """List Accounts in Subscription. + + List Accounts in a subscription. + + :param skip_token: Continuation token. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AccountList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_share_management_client.models.AccountList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AccountList"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + 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 = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", 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 = {} # type: Dict[str, Any] + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AccountList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataShare/accounts'} # type: ignore + async def get( self, resource_group_name: str, @@ -56,16 +129,17 @@ async def get( :param account_name: The name of the share account. :type account_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: Account or the result of cls(response) + :return: Account, or the result of cls(response) :rtype: ~data_share_management_client.models.Account :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Account"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore 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'), @@ -89,15 +163,15 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Account', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}'} # type: ignore async def _create_initial( self, @@ -109,14 +183,15 @@ async def _create_initial( **kwargs ) -> "models.Account": cls = kwargs.pop('cls', None) # type: ClsType["models.Account"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _account = models.Account(location=location, tags=tags, identity=identity) api_version = "2019-11-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._create_initial.metadata['url'] + url = self._create_initial.metadata['url'] # type: ignore 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'), @@ -145,7 +220,7 @@ async def _create_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -155,10 +230,10 @@ async def _create_initial( deserialized = self._deserialize('Account', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}'} + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}'} # type: ignore async def create( self, @@ -187,13 +262,17 @@ async def create( :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :return: An instance of LROPoller that returns Account - :rtype: ~azure.core.polling.LROPoller[~data_share_management_client.models.Account] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: Account, or the result of cls(response) + :rtype: ~data_share_management_client.models.Account :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Account"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._create_initial( resource_group_name=resource_group_name, account_name=account_name, @@ -204,6 +283,9 @@ async def create( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): deserialized = self._deserialize('Account', pipeline_response) @@ -211,15 +293,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) - if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}'} + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}'} # type: ignore async def _delete_initial( self, @@ -228,11 +306,12 @@ async def _delete_initial( **kwargs ) -> "models.OperationResponse": cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResponse"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" # Construct URL - url = self._delete_initial.metadata['url'] + url = self._delete_initial.metadata['url'] # type: ignore 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'), @@ -256,17 +335,17 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: deserialized = self._deserialize('OperationResponse', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}'} + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}'} # type: ignore async def delete( self, @@ -286,13 +365,17 @@ async def delete( :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :return: An instance of LROPoller that returns OperationResponse - :rtype: ~azure.core.polling.LROPoller[~data_share_management_client.models.OperationResponse] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: OperationResponse, or the result of cls(response) + :rtype: ~data_share_management_client.models.OperationResponse :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._delete_initial( resource_group_name=resource_group_name, account_name=account_name, @@ -300,6 +383,9 @@ async def delete( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): deserialized = self._deserialize('OperationResponse', pipeline_response) @@ -307,15 +393,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) - if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}'} + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}'} # type: ignore async def update( self, @@ -335,19 +417,20 @@ async def update( :param tags: Tags on the azure resource. :type tags: dict[str, str] :keyword callable cls: A custom type or function that will be passed the direct response - :return: Account or the result of cls(response) + :return: Account, or the result of cls(response) :rtype: ~data_share_management_client.models.Account :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Account"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _account_update_parameters = models.AccountUpdateParameters(tags=tags) api_version = "2019-11-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.update.metadata['url'] + url = self.update.metadata['url'] # type: ignore 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'), @@ -376,92 +459,22 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Account', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}'} - - def list_by_subscription( - self, - skip_token: Optional[str] = None, - **kwargs - ) -> "models.AccountList": - """List Accounts in Subscription. - - List Accounts in a subscription. - - :param skip_token: Continuation token. - :type skip_token: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AccountList or the result of cls(response) - :rtype: ~data_share_management_client.models.AccountList - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AccountList"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2019-11-01" - - 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) - else: - url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('AccountList', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(models.DataShareError, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataShare/accounts'} + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}'} # type: ignore def list_by_resource_group( self, resource_group_name: str, skip_token: Optional[str] = None, **kwargs - ) -> "models.AccountList": + ) -> AsyncIterable["models.AccountList"]: """List Accounts in ResourceGroup. List Accounts in a resource group. @@ -471,32 +484,33 @@ def list_by_resource_group( :param skip_token: Continuation token. :type skip_token: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: AccountList or the result of cls(response) - :rtype: ~data_share_management_client.models.AccountList + :return: An iterator like instance of either AccountList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_share_management_client.models.AccountList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AccountList"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_resource_group.metadata['url'] + url = self.list_by_resource_group.metadata['url'] # type: ignore 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 = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -521,11 +535,11 @@ async def get_next(next_link=None): if response.status_code not in [200]: error = self._deserialize(models.DataShareError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged( get_next, extract_data ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts'} + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts'} # type: ignore diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_consumer_invitation_operations_async.py b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_consumer_invitation_operations_async.py index 97d9f26ea3..b3a46ed6e2 100644 --- a/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_consumer_invitation_operations_async.py +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_consumer_invitation_operations_async.py @@ -5,13 +5,14 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models @@ -40,36 +41,102 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config - async def reject_invitation( + def list_invitation( + self, + skip_token: Optional[str] = None, + **kwargs + ) -> AsyncIterable["models.ConsumerInvitationList"]: + """Lists invitations. + + List the invitations. + + :param skip_token: The continuation token. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ConsumerInvitationList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_share_management_client.models.ConsumerInvitationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerInvitationList"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_invitation.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", 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 = {} # type: Dict[str, Any] + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ConsumerInvitationList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_invitation.metadata = {'url': '/providers/Microsoft.DataShare/ListInvitations'} # type: ignore + + async def get( self, location: str, invitation_id: str, **kwargs ) -> "models.ConsumerInvitation": - """Reject an invitation. + """Get an invitation. - Rejects the invitation identified by invitationId. + Gets the invitation identified by invitationId. :param location: Location of the invitation. :type location: str - :param invitation_id: Unique id of the invitation. + :param invitation_id: An invitation id. :type invitation_id: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: ConsumerInvitation or the result of cls(response) + :return: ConsumerInvitation, or the result of cls(response) :rtype: ~data_share_management_client.models.ConsumerInvitation :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerInvitation"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - - _invitation = models.ConsumerInvitation(invitation_id=invitation_id) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" - content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.reject_invitation.metadata['url'] + url = self.get.metadata['url'] # type: ignore 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) @@ -79,59 +146,57 @@ async def reject_invitation( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' # Construct and send request - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_invitation, 'ConsumerInvitation') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - + request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConsumerInvitation', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - reject_invitation.metadata = {'url': '/providers/Microsoft.DataShare/locations/{location}/RejectInvitation'} + get.metadata = {'url': '/providers/Microsoft.DataShare/locations/{location}/consumerInvitations/{invitationId}'} # type: ignore - async def get( + async def reject_invitation( self, location: str, invitation_id: str, **kwargs ) -> "models.ConsumerInvitation": - """Get an invitation. + """Reject an invitation. - Gets the invitation identified by invitationId. + Rejects the invitation identified by invitationId. :param location: Location of the invitation. :type location: str - :param invitation_id: An invitation id. + :param invitation_id: Unique id of the invitation. :type invitation_id: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: ConsumerInvitation or the result of cls(response) + :return: ConsumerInvitation, or the result of cls(response) :rtype: ~data_share_management_client.models.ConsumerInvitation :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerInvitation"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + _invitation = models.ConsumerInvitation(invitation_id=invitation_id) api_version = "2019-11-01" + content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.get.metadata['url'] + url = self.reject_invitation.metadata['url'] # type: ignore 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) @@ -141,88 +206,27 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_invitation, 'ConsumerInvitation') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConsumerInvitation', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/providers/Microsoft.DataShare/locations/{location}/consumerInvitations/{invitationId}'} - - def list_invitation( - self, - skip_token: Optional[str] = None, - **kwargs - ) -> "models.ConsumerInvitationList": - """Lists invitations. - - List the invitations. - - :param skip_token: The continuation token. - :type skip_token: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ConsumerInvitationList or the result of cls(response) - :rtype: ~data_share_management_client.models.ConsumerInvitationList - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerInvitationList"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2019-11-01" - - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_invitation.metadata['url'] - else: - url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('ConsumerInvitationList', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(models.DataShareError, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_invitation.metadata = {'url': '/providers/Microsoft.DataShare/ListInvitations'} + reject_invitation.metadata = {'url': '/providers/Microsoft.DataShare/locations/{location}/RejectInvitation'} # type: ignore diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_consumer_source_data_set_operations_async.py b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_consumer_source_data_set_operations_async.py index 65443ffd30..2aeadd0bfa 100644 --- a/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_consumer_source_data_set_operations_async.py +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_consumer_source_data_set_operations_async.py @@ -5,13 +5,14 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models @@ -47,7 +48,7 @@ def list_by_share_subscription( share_subscription_name: str, skip_token: Optional[str] = None, **kwargs - ) -> "models.ConsumerSourceDataSetList": + ) -> AsyncIterable["models.ConsumerSourceDataSetList"]: """Get source dataSets of a shareSubscription. Get source dataSets of a shareSubscription. @@ -61,18 +62,19 @@ def list_by_share_subscription( :param skip_token: Continuation token. :type skip_token: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: ConsumerSourceDataSetList or the result of cls(response) - :rtype: ~data_share_management_client.models.ConsumerSourceDataSetList + :return: An iterator like instance of either ConsumerSourceDataSetList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_share_management_client.models.ConsumerSourceDataSetList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerSourceDataSetList"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_share_subscription.metadata['url'] + url = self.list_by_share_subscription.metadata['url'] # type: ignore 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'), @@ -80,15 +82,15 @@ def prepare_request(next_link=None): 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -113,11 +115,11 @@ async def get_next(next_link=None): if response.status_code not in [200]: error = self._deserialize(models.DataShareError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged( get_next, extract_data ) - list_by_share_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/ConsumerSourceDataSets'} + list_by_share_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/ConsumerSourceDataSets'} # type: ignore diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_data_set_mapping_operations_async.py b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_data_set_mapping_operations_async.py index acf0170149..a759583ba0 100644 --- a/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_data_set_mapping_operations_async.py +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_data_set_mapping_operations_async.py @@ -5,13 +5,14 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models @@ -61,16 +62,17 @@ async def get( :param data_set_mapping_name: The name of the dataSetMapping. :type data_set_mapping_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataSetMapping or the result of cls(response) + :return: DataSetMapping, or the result of cls(response) :rtype: ~data_share_management_client.models.DataSetMapping :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DataSetMapping"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore 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'), @@ -96,15 +98,15 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('DataSetMapping', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/dataSetMappings/{dataSetMappingName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/dataSetMappings/{dataSetMappingName}'} # type: ignore async def create( self, @@ -132,17 +134,18 @@ async def create( :param data_set_mapping: Destination data set configuration details. :type data_set_mapping: ~data_share_management_client.models.DataSetMapping :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataSetMapping or the result of cls(response) - :rtype: ~data_share_management_client.models.DataSetMapping or ~data_share_management_client.models.DataSetMapping + :return: DataSetMapping, or the result of cls(response) + :rtype: ~data_share_management_client.models.DataSetMapping :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DataSetMapping"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.create.metadata['url'] + url = self.create.metadata['url'] # type: ignore 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'), @@ -173,7 +176,7 @@ async def create( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -183,10 +186,10 @@ async def create( deserialized = self._deserialize('DataSetMapping', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/dataSetMappings/{dataSetMappingName}'} + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/dataSetMappings/{dataSetMappingName}'} # type: ignore async def delete( self, @@ -209,16 +212,17 @@ async def delete( :param data_set_mapping_name: The name of the dataSetMapping. :type data_set_mapping_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) + :return: None, or the result of cls(response) :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" # Construct URL - url = self.delete.metadata['url'] + url = self.delete.metadata['url'] # type: ignore 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'), @@ -243,12 +247,12 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/dataSetMappings/{dataSetMappingName}'} + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/dataSetMappings/{dataSetMappingName}'} # type: ignore def list_by_share_subscription( self, @@ -256,8 +260,10 @@ def list_by_share_subscription( account_name: str, share_subscription_name: str, skip_token: Optional[str] = None, + filter: Optional[str] = None, + orderby: Optional[str] = None, **kwargs - ) -> "models.DataSetMappingList": + ) -> AsyncIterable["models.DataSetMappingList"]: """List DataSetMappings in a share subscription. List DataSetMappings in a share subscription. @@ -270,19 +276,24 @@ def list_by_share_subscription( :type share_subscription_name: str :param skip_token: Continuation token. :type skip_token: str + :param filter: Filters the results using OData syntax. + :type filter: str + :param orderby: Sorts the results using OData syntax. + :type orderby: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataSetMappingList or the result of cls(response) - :rtype: ~data_share_management_client.models.DataSetMappingList + :return: An iterator like instance of either DataSetMappingList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_share_management_client.models.DataSetMappingList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DataSetMappingList"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_share_subscription.metadata['url'] + url = self.list_by_share_subscription.metadata['url'] # type: ignore 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'), @@ -290,15 +301,19 @@ def prepare_request(next_link=None): 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if orderby is not None: + query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -323,11 +338,11 @@ async def get_next(next_link=None): if response.status_code not in [200]: error = self._deserialize(models.DataShareError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged( get_next, extract_data ) - list_by_share_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/dataSetMappings'} + list_by_share_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/dataSetMappings'} # type: ignore diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_data_set_operations_async.py b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_data_set_operations_async.py index 077f29e040..d5a8277739 100644 --- a/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_data_set_operations_async.py +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_data_set_operations_async.py @@ -5,7 +5,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -13,6 +13,8 @@ from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models @@ -62,16 +64,17 @@ async def get( :param data_set_name: The name of the dataSet. :type data_set_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataSet or the result of cls(response) + :return: DataSet, or the result of cls(response) :rtype: ~data_share_management_client.models.DataSet :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DataSet"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore 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'), @@ -97,15 +100,15 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('DataSet', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets/{dataSetName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets/{dataSetName}'} # type: ignore async def create( self, @@ -131,17 +134,18 @@ async def create( :param data_set: The new data set information. :type data_set: ~data_share_management_client.models.DataSet :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataSet or the result of cls(response) - :rtype: ~data_share_management_client.models.DataSet or ~data_share_management_client.models.DataSet + :return: DataSet, or the result of cls(response) + :rtype: ~data_share_management_client.models.DataSet :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DataSet"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.create.metadata['url'] + url = self.create.metadata['url'] # type: ignore 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'), @@ -172,7 +176,7 @@ async def create( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -182,10 +186,10 @@ async def create( deserialized = self._deserialize('DataSet', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets/{dataSetName}'} + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets/{dataSetName}'} # type: ignore async def _delete_initial( self, @@ -196,11 +200,12 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" # Construct URL - url = self._delete_initial.metadata['url'] + url = self._delete_initial.metadata['url'] # type: ignore 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'), @@ -225,12 +230,12 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets/{dataSetName}'} + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets/{dataSetName}'} # type: ignore async def delete( self, @@ -256,13 +261,17 @@ async def delete( :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: None, or the result of cls(response) + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._delete_initial( resource_group_name=resource_group_name, account_name=account_name, @@ -272,19 +281,18 @@ async def delete( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) - if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets/{dataSetName}'} + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets/{dataSetName}'} # type: ignore def list_by_share( self, @@ -292,8 +300,10 @@ def list_by_share( account_name: str, share_name: str, skip_token: Optional[str] = None, + filter: Optional[str] = None, + orderby: Optional[str] = None, **kwargs - ) -> "models.DataSetList": + ) -> AsyncIterable["models.DataSetList"]: """List DataSets in a share. List DataSets in a share. @@ -306,19 +316,24 @@ def list_by_share( :type share_name: str :param skip_token: continuation token. :type skip_token: str + :param filter: Filters the results using OData syntax. + :type filter: str + :param orderby: Sorts the results using OData syntax. + :type orderby: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataSetList or the result of cls(response) - :rtype: ~data_share_management_client.models.DataSetList + :return: An iterator like instance of either DataSetList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_share_management_client.models.DataSetList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DataSetList"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_share.metadata['url'] + url = self.list_by_share.metadata['url'] # type: ignore 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'), @@ -326,15 +341,19 @@ def prepare_request(next_link=None): 'shareName': self._serialize.url("share_name", share_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if orderby is not None: + query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -359,11 +378,11 @@ async def get_next(next_link=None): if response.status_code not in [200]: error = self._deserialize(models.DataShareError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged( get_next, extract_data ) - list_by_share.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets'} + list_by_share.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets'} # type: ignore diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_invitation_operations_async.py b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_invitation_operations_async.py index c53ea9c8e8..aef5bfec40 100644 --- a/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_invitation_operations_async.py +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_invitation_operations_async.py @@ -5,13 +5,14 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models @@ -61,16 +62,17 @@ async def get( :param invitation_name: The name of the invitation. :type invitation_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: Invitation or the result of cls(response) + :return: Invitation, or the result of cls(response) :rtype: ~data_share_management_client.models.Invitation :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Invitation"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore 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'), @@ -96,15 +98,15 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Invitation', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/invitations/{invitationName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/invitations/{invitationName}'} # type: ignore async def create( self, @@ -138,19 +140,20 @@ async def create( invitations to specific users or applications in an AD tenant. :type target_object_id: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: Invitation or the result of cls(response) - :rtype: ~data_share_management_client.models.Invitation or ~data_share_management_client.models.Invitation + :return: Invitation, or the result of cls(response) + :rtype: ~data_share_management_client.models.Invitation :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Invitation"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _invitation = models.Invitation(target_active_directory_id=target_active_directory_id, target_email=target_email, target_object_id=target_object_id) api_version = "2019-11-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.create.metadata['url'] + url = self.create.metadata['url'] # type: ignore 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'), @@ -181,7 +184,7 @@ async def create( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -191,10 +194,10 @@ async def create( deserialized = self._deserialize('Invitation', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/invitations/{invitationName}'} + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/invitations/{invitationName}'} # type: ignore async def delete( self, @@ -217,16 +220,17 @@ async def delete( :param invitation_name: The name of the invitation. :type invitation_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) + :return: None, or the result of cls(response) :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" # Construct URL - url = self.delete.metadata['url'] + url = self.delete.metadata['url'] # type: ignore 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'), @@ -251,12 +255,12 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/invitations/{invitationName}'} + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/invitations/{invitationName}'} # type: ignore def list_by_share( self, @@ -264,8 +268,10 @@ def list_by_share( account_name: str, share_name: str, skip_token: Optional[str] = None, + filter: Optional[str] = None, + orderby: Optional[str] = None, **kwargs - ) -> "models.InvitationList": + ) -> AsyncIterable["models.InvitationList"]: """List invitations in a share. List all Invitations in a share. @@ -278,19 +284,24 @@ def list_by_share( :type share_name: str :param skip_token: The continuation token. :type skip_token: str + :param filter: Filters the results using OData syntax. + :type filter: str + :param orderby: Sorts the results using OData syntax. + :type orderby: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: InvitationList or the result of cls(response) - :rtype: ~data_share_management_client.models.InvitationList + :return: An iterator like instance of either InvitationList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_share_management_client.models.InvitationList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.InvitationList"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_share.metadata['url'] + url = self.list_by_share.metadata['url'] # type: ignore 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'), @@ -298,15 +309,19 @@ def prepare_request(next_link=None): 'shareName': self._serialize.url("share_name", share_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if orderby is not None: + query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -331,11 +346,11 @@ async def get_next(next_link=None): if response.status_code not in [200]: error = self._deserialize(models.DataShareError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged( get_next, extract_data ) - list_by_share.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/invitations'} + list_by_share.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/invitations'} # type: ignore diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_operation_operations_async.py b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_operation_operations_async.py index 397c94d67b..19db89281b 100644 --- a/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_operation_operations_async.py +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_operation_operations_async.py @@ -5,13 +5,14 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models @@ -43,31 +44,32 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> "models.OperationList": + ) -> AsyncIterable["models.OperationList"]: """List of available operations. Lists the available operations. :keyword callable cls: A custom type or function that will be passed the direct response - :return: OperationList or the result of cls(response) - :rtype: ~data_share_management_client.models.OperationList + :return: An iterator like instance of either OperationList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_share_management_client.models.OperationList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.OperationList"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list.metadata['url'] + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -92,11 +94,11 @@ async def get_next(next_link=None): if response.status_code not in [200]: error = self._deserialize(models.DataShareError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/providers/Microsoft.DataShare/operations'} + list.metadata = {'url': '/providers/Microsoft.DataShare/operations'} # type: ignore diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_provider_share_subscription_operations_async.py b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_provider_share_subscription_operations_async.py index e516dc2824..04fb6675a3 100644 --- a/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_provider_share_subscription_operations_async.py +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_provider_share_subscription_operations_async.py @@ -5,7 +5,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -13,6 +13,8 @@ from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models @@ -41,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config - async def get_by_share( + async def reinstate( self, resource_group_name: str, account_name: str, @@ -49,9 +51,9 @@ async def get_by_share( provider_share_subscription_id: str, **kwargs ) -> "models.ProviderShareSubscription": - """Get share subscription in a provider share. + """Reinstate share subscription in a provider share. - Get 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 @@ -62,16 +64,17 @@ async def get_by_share( :param provider_share_subscription_id: To locate shareSubscription. :type provider_share_subscription_id: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: ProviderShareSubscription or the result of cls(response) + :return: ProviderShareSubscription, or the result of cls(response) :rtype: ~data_share_management_client.models.ProviderShareSubscription :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProviderShareSubscription"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" # Construct URL - url = self.get_by_share.metadata['url'] + url = self.reinstate.metadata['url'] # type: ignore 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'), @@ -90,104 +93,22 @@ async def get_by_share( header_parameters['Accept'] = 'application/json' # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ProviderShareSubscription', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) 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: str, - account_name: str, - share_name: str, - skip_token: Optional[str] = None, - **kwargs - ) -> "models.ProviderShareSubscriptionList": - """List share subscriptions in a provider share. - - List of available share subscriptions to 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ProviderShareSubscriptionList or the result of cls(response) - :rtype: ~data_share_management_client.models.ProviderShareSubscriptionList - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProviderShareSubscriptionList"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2019-11-01" - - 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) - else: - url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('ProviderShareSubscriptionList', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(models.DataShareError, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_share.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions'} + reinstate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions/{providerShareSubscriptionId}/reinstate'} # type: ignore async def _revoke_initial( self, @@ -198,11 +119,12 @@ async def _revoke_initial( **kwargs ) -> "models.ProviderShareSubscription": cls = kwargs.pop('cls', None) # type: ClsType["models.ProviderShareSubscription"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" # Construct URL - url = self._revoke_initial.metadata['url'] + url = self._revoke_initial.metadata['url'] # type: ignore 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'), @@ -228,7 +150,7 @@ async def _revoke_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -238,10 +160,10 @@ async def _revoke_initial( deserialized = self._deserialize('ProviderShareSubscription', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - _revoke_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions/{providerShareSubscriptionId}/revoke'} + _revoke_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions/{providerShareSubscriptionId}/revoke'} # type: ignore async def revoke( self, @@ -267,13 +189,17 @@ async def revoke( :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :return: An instance of LROPoller that returns ProviderShareSubscription - :rtype: ~azure.core.polling.LROPoller[~data_share_management_client.models.ProviderShareSubscription] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: ProviderShareSubscription, or the result of cls(response) + :rtype: ~data_share_management_client.models.ProviderShareSubscription :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.ProviderShareSubscription"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._revoke_initial( resource_group_name=resource_group_name, account_name=account_name, @@ -283,6 +209,9 @@ async def revoke( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): deserialized = self._deserialize('ProviderShareSubscription', pipeline_response) @@ -290,17 +219,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) - if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling return await async_poller(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'} + revoke.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions/{providerShareSubscriptionId}/revoke'} # type: ignore - async def reinstate( + async def get_by_share( self, resource_group_name: str, account_name: str, @@ -308,9 +233,9 @@ async def reinstate( provider_share_subscription_id: str, **kwargs ) -> "models.ProviderShareSubscription": - """Reinstate share subscription in a provider share. + """Get share subscription in a provider share. - Reinstate 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 @@ -321,16 +246,17 @@ async def reinstate( :param provider_share_subscription_id: To locate shareSubscription. :type provider_share_subscription_id: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: ProviderShareSubscription or the result of cls(response) + :return: ProviderShareSubscription, or the result of cls(response) :rtype: ~data_share_management_client.models.ProviderShareSubscription :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProviderShareSubscription"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" # Construct URL - url = self.reinstate.metadata['url'] + url = self.get_by_share.metadata['url'] # type: ignore 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'), @@ -349,19 +275,102 @@ async def reinstate( header_parameters['Accept'] = 'application/json' # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ProviderShareSubscription', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - reinstate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions/{providerShareSubscriptionId}/reinstate'} + get_by_share.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions/{providerShareSubscriptionId}'} # type: ignore + + def list_by_share( + self, + resource_group_name: str, + account_name: str, + share_name: str, + skip_token: Optional[str] = None, + **kwargs + ) -> AsyncIterable["models.ProviderShareSubscriptionList"]: + """List share subscriptions in a provider share. + + List of available share subscriptions to 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProviderShareSubscriptionList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_share_management_client.models.ProviderShareSubscriptionList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ProviderShareSubscriptionList"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_share.metadata['url'] # type: ignore + 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 = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", 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 = {} # type: Dict[str, Any] + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProviderShareSubscriptionList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_share.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions'} # type: ignore diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_share_operations_async.py b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_share_operations_async.py index 0c7c5ef51f..fe2717baa6 100644 --- a/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_share_operations_async.py +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_share_operations_async.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import datetime -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -14,6 +14,8 @@ from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models @@ -42,6 +44,226 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + def list_synchronization_detail( + self, + resource_group_name: str, + account_name: str, + share_name: str, + skip_token: Optional[str] = None, + filter: Optional[str] = None, + orderby: Optional[str] = None, + consumer_email: Optional[str] = None, + consumer_name: Optional[str] = None, + consumer_tenant_name: Optional[str] = None, + duration_ms: Optional[int] = None, + end_time: Optional[datetime.datetime] = None, + message: Optional[str] = None, + start_time: Optional[datetime.datetime] = None, + status: Optional[str] = None, + synchronization_id: Optional[str] = None, + **kwargs + ) -> AsyncIterable["models.SynchronizationDetailsList"]: + """List synchronization details. + + List data set level details for a share 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_name: The name of the share. + :type share_name: str + :param skip_token: Continuation token. + :type skip_token: str + :param filter: Filters the results using OData syntax. + :type filter: str + :param orderby: Sorts the results using OData syntax. + :type orderby: str + :param consumer_email: Email of the user who created the synchronization. + :type consumer_email: str + :param consumer_name: Name of the user who created the synchronization. + :type consumer_name: str + :param consumer_tenant_name: Tenant name of the consumer who created the synchronization. + :type consumer_tenant_name: str + :param duration_ms: synchronization duration. + :type duration_ms: int + :param end_time: End time of synchronization. + :type end_time: ~datetime.datetime + :param message: message of synchronization. + :type message: str + :param start_time: start time of synchronization. + :type start_time: ~datetime.datetime + :param status: Raw Status. + :type status: str + :param synchronization_id: Synchronization id. + :type synchronization_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SynchronizationDetailsList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_share_management_client.models.SynchronizationDetailsList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SynchronizationDetailsList"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + _share_synchronization = models.ShareSynchronization(consumer_email=consumer_email, consumer_name=consumer_name, consumer_tenant_name=consumer_tenant_name, duration_ms=duration_ms, end_time=end_time, message=message, start_time=start_time, status=status, synchronization_id=synchronization_id) + api_version = "2019-11-01" + content_type = "application/json" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_synchronization_detail.metadata['url'] # type: ignore + 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 = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if orderby is not None: + query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') + + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_share_synchronization, 'ShareSynchronization') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SynchronizationDetailsList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_synchronization_detail.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/listSynchronizationDetails'} # type: ignore + + def list_synchronization( + self, + resource_group_name: str, + account_name: str, + share_name: str, + skip_token: Optional[str] = None, + filter: Optional[str] = None, + orderby: Optional[str] = None, + **kwargs + ) -> AsyncIterable["models.ShareSynchronizationList"]: + """List synchronizations of a share. + + List Synchronizations 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 filter: Filters the results using OData syntax. + :type filter: str + :param orderby: Sorts the results using OData syntax. + :type orderby: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ShareSynchronizationList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_share_management_client.models.ShareSynchronizationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSynchronizationList"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_synchronization.metadata['url'] # type: ignore + 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 = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if orderby is not None: + query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') + + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ShareSynchronizationList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_synchronization.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/listSynchronizations'} # type: ignore + async def get( self, resource_group_name: str, @@ -60,16 +282,17 @@ async def get( :param share_name: The name of the share to retrieve. :type share_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: Share or the result of cls(response) + :return: Share, or the result of cls(response) :rtype: ~data_share_management_client.models.Share :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Share"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore 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'), @@ -94,15 +317,15 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Share', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}'} # type: ignore async def create( self, @@ -131,19 +354,20 @@ async def create( :param terms: Share terms. :type terms: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: Share or the result of cls(response) - :rtype: ~data_share_management_client.models.Share or ~data_share_management_client.models.Share + :return: Share, or the result of cls(response) + :rtype: ~data_share_management_client.models.Share :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Share"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _share = models.Share(description=description, share_kind=share_kind, terms=terms) api_version = "2019-11-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.create.metadata['url'] + url = self.create.metadata['url'] # type: ignore 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'), @@ -173,7 +397,7 @@ async def create( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -183,10 +407,10 @@ async def create( deserialized = self._deserialize('Share', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}'} + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}'} # type: ignore async def _delete_initial( self, @@ -196,11 +420,12 @@ async def _delete_initial( **kwargs ) -> "models.OperationResponse": cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResponse"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" # Construct URL - url = self._delete_initial.metadata['url'] + url = self._delete_initial.metadata['url'] # type: ignore 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'), @@ -225,17 +450,17 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: deserialized = self._deserialize('OperationResponse', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}'} + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}'} # type: ignore async def delete( self, @@ -258,13 +483,17 @@ async def delete( :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :return: An instance of LROPoller that returns OperationResponse - :rtype: ~azure.core.polling.LROPoller[~data_share_management_client.models.OperationResponse] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: OperationResponse, or the result of cls(response) + :rtype: ~data_share_management_client.models.OperationResponse :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._delete_initial( resource_group_name=resource_group_name, account_name=account_name, @@ -273,6 +502,9 @@ async def delete( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): deserialized = self._deserialize('OperationResponse', pipeline_response) @@ -280,23 +512,21 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) - if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}'} + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}'} # type: ignore def list_by_account( self, resource_group_name: str, account_name: str, skip_token: Optional[str] = None, + filter: Optional[str] = None, + orderby: Optional[str] = None, **kwargs - ) -> "models.ShareList": + ) -> AsyncIterable["models.ShareList"]: """List shares in an account. List of available shares under an account. @@ -307,34 +537,43 @@ def list_by_account( :type account_name: str :param skip_token: Continuation Token. :type skip_token: str + :param filter: Filters the results using OData syntax. + :type filter: str + :param orderby: Sorts the results using OData syntax. + :type orderby: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShareList or the result of cls(response) - :rtype: ~data_share_management_client.models.ShareList + :return: An iterator like instance of either ShareList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_share_management_client.models.ShareList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ShareList"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_account.metadata['url'] + url = self.list_by_account.metadata['url'] # type: ignore 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 = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if orderby is not None: + query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -359,209 +598,11 @@ async def get_next(next_link=None): if response.status_code not in [200]: error = self._deserialize(models.DataShareError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares'} - - def list_synchronization( - self, - resource_group_name: str, - account_name: str, - share_name: str, - skip_token: Optional[str] = None, - **kwargs - ) -> "models.ShareSynchronizationList": - """List synchronizations of a share. - - List Synchronizations 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShareSynchronizationList or the result of cls(response) - :rtype: ~data_share_management_client.models.ShareSynchronizationList - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSynchronizationList"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2019-11-01" - - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_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'), - 'shareName': self._serialize.url("share_name", share_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - else: - url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('ShareSynchronizationList', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(models.DataShareError, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_synchronization.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/listSynchronizations'} - - def list_synchronization_detail( - self, - resource_group_name: str, - account_name: str, - share_name: str, - skip_token: Optional[str] = None, - consumer_email: Optional[str] = None, - consumer_name: Optional[str] = None, - consumer_tenant_name: Optional[str] = None, - duration_ms: Optional[int] = None, - end_time: Optional[datetime.datetime] = None, - message: Optional[str] = None, - start_time: Optional[datetime.datetime] = None, - status: Optional[str] = None, - synchronization_id: Optional[str] = None, - **kwargs - ) -> "models.SynchronizationDetailsList": - """List synchronization details. - - List data set level details for a share 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_name: The name of the share. - :type share_name: str - :param skip_token: Continuation token. - :type skip_token: str - :param consumer_email: Email of the user who created the synchronization. - :type consumer_email: str - :param consumer_name: Name of the user who created the synchronization. - :type consumer_name: str - :param consumer_tenant_name: Tenant name of the consumer who created the synchronization. - :type consumer_tenant_name: str - :param duration_ms: synchronization duration. - :type duration_ms: int - :param end_time: End time of synchronization. - :type end_time: ~datetime.datetime - :param message: message of synchronization. - :type message: str - :param start_time: start time of synchronization. - :type start_time: ~datetime.datetime - :param status: Raw Status. - :type status: str - :param synchronization_id: Synchronization id. - :type synchronization_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SynchronizationDetailsList or the result of cls(response) - :rtype: ~data_share_management_client.models.SynchronizationDetailsList - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SynchronizationDetailsList"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - _share_synchronization = models.ShareSynchronization(consumer_email=consumer_email, consumer_name=consumer_name, consumer_tenant_name=consumer_tenant_name, duration_ms=duration_ms, end_time=end_time, message=message, start_time=start_time, status=status, synchronization_id=synchronization_id) - api_version = "2019-11-01" - content_type = "application/json" - - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_synchronization_detail.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) - else: - url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' - - # Construct and send request - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_share_synchronization, 'ShareSynchronization') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('SynchronizationDetailsList', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(models.DataShareError, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged( get_next, extract_data ) - list_synchronization_detail.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/listSynchronizationDetails'} + list_by_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares'} # type: ignore diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_share_subscription_operations_async.py b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_share_subscription_operations_async.py index 4416c305e0..5cee322d26 100644 --- a/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_share_subscription_operations_async.py +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_share_subscription_operations_async.py @@ -5,7 +5,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -13,6 +13,8 @@ from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models @@ -41,105 +43,24 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config - async def get( - self, - resource_group_name: str, - account_name: str, - share_subscription_name: str, - **kwargs - ) -> "models.ShareSubscription": - """Get a shareSubscription in an account. - - Get 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShareSubscription or the result of cls(response) - :rtype: ~data_share_management_client.models.ShareSubscription - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSubscription"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2019-11-01" - - # 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('ShareSubscription', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}'} - - async def create( + async def _cancel_synchronization_initial( self, resource_group_name: str, account_name: str, share_subscription_name: str, - invitation_id: str, - source_share_location: str, + synchronization_id: str, **kwargs - ) -> "models.ShareSubscription": - """Create a shareSubscription in an account. - - Create 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 source_share_location: Source share location. - :type source_share_location: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShareSubscription or the result of cls(response) - :rtype: ~data_share_management_client.models.ShareSubscription or ~data_share_management_client.models.ShareSubscription - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSubscription"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + ) -> "models.ShareSubscriptionSynchronization": + cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSubscriptionSynchronization"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) - _share_subscription = models.ShareSubscription(invitation_id=invitation_id, source_share_location=source_share_location) + _share_subscription_synchronization = models.ShareSubscriptionSynchronization(synchronization_id=synchronization_id) api_version = "2019-11-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.create.metadata['url'] + url = self._cancel_synchronization_initial.metadata['url'] # type: ignore 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'), @@ -159,90 +80,42 @@ async def create( # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_share_subscription, 'ShareSubscription') + body_content = self._serialize.body(_share_subscription_synchronization, 'ShareSubscriptionSynchronization') body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('ShareSubscription', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ShareSubscription', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}'} - - async def _delete_initial( - self, - resource_group_name: str, - account_name: str, - share_subscription_name: str, - **kwargs - ) -> "models.OperationResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResponse"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2019-11-01" - - # Construct URL - url = self._delete_initial.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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + deserialized = self._deserialize('ShareSubscriptionSynchronization', pipeline_response) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationResponse', pipeline_response) + if response.status_code == 202: + deserialized = self._deserialize('ShareSubscriptionSynchronization', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}'} + _cancel_synchronization_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/cancelSynchronization'} # type: ignore - async def delete( + async def cancel_synchronization( self, resource_group_name: str, account_name: str, share_subscription_name: str, + synchronization_id: str, **kwargs - ) -> "models.OperationResponse": - """Delete a shareSubscription in an account. + ) -> "models.ShareSubscriptionSynchronization": + """Request to cancel a synchronization. - Delete shareSubscription in an account. + Request cancellation of a data share snapshot. :param resource_group_name: The resource group name. :type resource_group_name: str @@ -250,97 +123,108 @@ async def delete( :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 :keyword callable cls: A custom type or function that will be passed the direct response :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :return: An instance of LROPoller that returns OperationResponse - :rtype: ~azure.core.polling.LROPoller[~data_share_management_client.models.OperationResponse] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: ShareSubscriptionSynchronization, or the result of cls(response) + :rtype: ~data_share_management_client.models.ShareSubscriptionSynchronization :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResponse"] - raw_result = await self._delete_initial( + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSubscriptionSynchronization"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + raw_result = await self._cancel_synchronization_initial( resource_group_name=resource_group_name, account_name=account_name, share_subscription_name=share_subscription_name, + synchronization_id=synchronization_id, cls=lambda x,y,z: x, **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): - deserialized = self._deserialize('OperationResponse', pipeline_response) + deserialized = self._deserialize('ShareSubscriptionSynchronization', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) - if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}'} + cancel_synchronization.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/cancelSynchronization'} # type: ignore - def list_by_account( + def list_source_share_synchronization_setting( self, resource_group_name: str, account_name: str, + share_subscription_name: str, skip_token: Optional[str] = None, **kwargs - ) -> "models.ShareSubscriptionList": - """List share subscriptions in an account. + ) -> AsyncIterable["models.SourceShareSynchronizationSettingList"]: + """Get synchronization settings set on a share. - List of available share subscriptions under an account. + Get source share synchronization settings for 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 skip_token: Continuation Token. + :param share_subscription_name: The name of the shareSubscription. + :type share_subscription_name: str + :param skip_token: Continuation token. :type skip_token: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShareSubscriptionList or the result of cls(response) - :rtype: ~data_share_management_client.models.ShareSubscriptionList + :return: An iterator like instance of either SourceShareSynchronizationSettingList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_share_management_client.models.SourceShareSynchronizationSettingList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSubscriptionList"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + cls = kwargs.pop('cls', None) # type: ClsType["models.SourceShareSynchronizationSettingList"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_account.metadata['url'] + url = self.list_source_share_synchronization_setting.metadata['url'] # type: ignore 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 = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.post(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ShareSubscriptionList', pipeline_response) + deserialized = self._deserialize('SourceShareSynchronizationSettingList', pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -355,48 +239,60 @@ async def get_next(next_link=None): if response.status_code not in [200]: error = self._deserialize(models.DataShareError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged( get_next, extract_data ) - list_by_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions'} + list_source_share_synchronization_setting.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/listSourceShareSynchronizationSettings'} # type: ignore - def list_source_share_synchronization_setting( + def list_synchronization_detail( self, resource_group_name: str, account_name: str, share_subscription_name: str, + synchronization_id: str, skip_token: Optional[str] = None, + filter: Optional[str] = None, + orderby: Optional[str] = None, **kwargs - ) -> "models.SourceShareSynchronizationSettingList": - """Get synchronization settings set on a share. + ) -> AsyncIterable["models.SynchronizationDetailsList"]: + """List synchronization details. - Get source share synchronization settings for a shareSubscription. + List data set level details for a share subscription 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. + :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 filter: Filters the results using OData syntax. + :type filter: str + :param orderby: Sorts the results using OData syntax. + :type orderby: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: SourceShareSynchronizationSettingList or the result of cls(response) - :rtype: ~data_share_management_client.models.SourceShareSynchronizationSettingList + :return: An iterator like instance of either SynchronizationDetailsList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_share_management_client.models.SynchronizationDetailsList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SourceShareSynchronizationSettingList"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + cls = kwargs.pop('cls', None) # type: ClsType["models.SynchronizationDetailsList"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + _share_subscription_synchronization = models.ShareSubscriptionSynchronization(synchronization_id=synchronization_id) api_version = "2019-11-01" + content_type = "application/json" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_source_share_synchronization_setting.metadata['url'] + url = self.list_synchronization_detail.metadata['url'] # type: ignore 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'), @@ -404,25 +300,34 @@ def prepare_request(next_link=None): 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if orderby is not None: + query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_share_subscription_synchronization, 'ShareSubscriptionSynchronization') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + return request async def extract_data(pipeline_response): - deserialized = self._deserialize('SourceShareSynchronizationSettingList', pipeline_response) + deserialized = self._deserialize('SynchronizationDetailsList', pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -437,14 +342,14 @@ async def get_next(next_link=None): if response.status_code not in [200]: error = self._deserialize(models.DataShareError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged( get_next, extract_data ) - list_source_share_synchronization_setting.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/listSourceShareSynchronizationSettings'} + list_synchronization_detail.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/listSynchronizationDetails'} # type: ignore def list_synchronization( self, @@ -452,8 +357,10 @@ def list_synchronization( account_name: str, share_subscription_name: str, skip_token: Optional[str] = None, + filter: Optional[str] = None, + orderby: Optional[str] = None, **kwargs - ) -> "models.ShareSubscriptionSynchronizationList": + ) -> AsyncIterable["models.ShareSubscriptionSynchronizationList"]: """List synchronizations of a share subscription. List Synchronizations in a share subscription. @@ -466,19 +373,24 @@ def list_synchronization( :type share_subscription_name: str :param skip_token: Continuation token. :type skip_token: str + :param filter: Filters the results using OData syntax. + :type filter: str + :param orderby: Sorts the results using OData syntax. + :type orderby: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShareSubscriptionSynchronizationList or the result of cls(response) - :rtype: ~data_share_management_client.models.ShareSubscriptionSynchronizationList + :return: An iterator like instance of either ShareSubscriptionSynchronizationList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_share_management_client.models.ShareSubscriptionSynchronizationList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSubscriptionSynchronizationList"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_synchronization.metadata['url'] + url = self.list_synchronization.metadata['url'] # type: ignore 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'), @@ -486,15 +398,19 @@ def prepare_request(next_link=None): 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if orderby is not None: + query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -519,124 +435,33 @@ async def get_next(next_link=None): if response.status_code not in [200]: error = self._deserialize(models.DataShareError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged( get_next, extract_data ) - list_synchronization.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/listSynchronizations'} + list_synchronization.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/listSynchronizations'} # type: ignore - def list_synchronization_detail( + async def _synchronize_initial( self, resource_group_name: str, account_name: str, share_subscription_name: str, - synchronization_id: str, - skip_token: Optional[str] = None, + synchronization_mode: Optional[Union[str, "models.SynchronizationMode"]] = None, **kwargs - ) -> "models.SynchronizationDetailsList": - """List synchronization details. - - List data set level details for a share subscription synchronization. + ) -> "models.ShareSubscriptionSynchronization": + cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSubscriptionSynchronization"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) - :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SynchronizationDetailsList or the result of cls(response) - :rtype: ~data_share_management_client.models.SynchronizationDetailsList - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SynchronizationDetailsList"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - _share_subscription_synchronization = models.ShareSubscriptionSynchronization(synchronization_id=synchronization_id) + _synchronize = models.Synchronize(synchronization_mode=synchronization_mode) api_version = "2019-11-01" - content_type = "application/json" - - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_synchronization_detail.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) - else: - url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' - - # Construct and send request - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_share_subscription_synchronization, 'ShareSubscriptionSynchronization') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('SynchronizationDetailsList', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(models.DataShareError, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_synchronization_detail.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/listSynchronizationDetails'} - - async def _synchronize_initial( - self, - resource_group_name: str, - account_name: str, - share_subscription_name: str, - synchronization_mode: Optional[Union[str, "models.SynchronizationMode"]] = None, - **kwargs - ) -> "models.ShareSubscriptionSynchronization": - cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSubscriptionSynchronization"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - - _synchronize = models.Synchronize(synchronization_mode=synchronization_mode) - api_version = "2019-11-01" - content_type = kwargs.pop("content_type", "application/json") + content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._synchronize_initial.metadata['url'] + url = self._synchronize_initial.metadata['url'] # type: ignore 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'), @@ -666,7 +491,7 @@ async def _synchronize_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -676,10 +501,10 @@ async def _synchronize_initial( deserialized = self._deserialize('ShareSubscriptionSynchronization', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - _synchronize_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/Synchronize'} + _synchronize_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/Synchronize'} # type: ignore async def synchronize( self, @@ -706,13 +531,17 @@ async def synchronize( :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :return: An instance of LROPoller that returns ShareSubscriptionSynchronization - :rtype: ~azure.core.polling.LROPoller[~data_share_management_client.models.ShareSubscriptionSynchronization] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: ShareSubscriptionSynchronization, or the result of cls(response) + :rtype: ~data_share_management_client.models.ShareSubscriptionSynchronization :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSubscriptionSynchronization"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._synchronize_initial( resource_group_name=resource_group_name, account_name=account_name, @@ -722,6 +551,9 @@ async def synchronize( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): deserialized = self._deserialize('ShareSubscriptionSynchronization', pipeline_response) @@ -729,33 +561,113 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) - if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - synchronize.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/Synchronize'} + synchronize.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/Synchronize'} # type: ignore - async def _cancel_synchronization_initial( + async def get( self, resource_group_name: str, account_name: str, share_subscription_name: str, - synchronization_id: str, **kwargs - ) -> "models.ShareSubscriptionSynchronization": - cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSubscriptionSynchronization"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + ) -> "models.ShareSubscription": + """Get a shareSubscription in an account. - _share_subscription_synchronization = models.ShareSubscriptionSynchronization(synchronization_id=synchronization_id) + Get 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ShareSubscription, or the result of cls(response) + :rtype: ~data_share_management_client.models.ShareSubscription + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSubscription"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + 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 = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ShareSubscription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}'} # type: ignore + + async def create( + self, + resource_group_name: str, + account_name: str, + share_subscription_name: str, + invitation_id: str, + source_share_location: str, + **kwargs + ) -> "models.ShareSubscription": + """Create a shareSubscription in an account. + + Create 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 source_share_location: Source share location. + :type source_share_location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ShareSubscription, or the result of cls(response) + :rtype: ~data_share_management_client.models.ShareSubscription + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSubscription"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + _share_subscription = models.ShareSubscription(invitation_id=invitation_id, source_share_location=source_share_location) api_version = "2019-11-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._cancel_synchronization_initial.metadata['url'] + url = self.create.metadata['url'] # type: ignore 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'), @@ -775,42 +687,91 @@ async def _cancel_synchronization_initial( # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_share_subscription_synchronization, 'ShareSubscriptionSynchronization') + body_content = self._serialize.body(_share_subscription, 'ShareSubscription') body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('ShareSubscriptionSynchronization', pipeline_response) + deserialized = self._deserialize('ShareSubscription', pipeline_response) - if response.status_code == 202: - deserialized = self._deserialize('ShareSubscriptionSynchronization', pipeline_response) + if response.status_code == 201: + deserialized = self._deserialize('ShareSubscription', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - _cancel_synchronization_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/cancelSynchronization'} + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}'} # type: ignore - async def cancel_synchronization( + async def _delete_initial( self, resource_group_name: str, account_name: str, share_subscription_name: str, - synchronization_id: str, **kwargs - ) -> "models.ShareSubscriptionSynchronization": - """Request to cancel a synchronization. + ) -> "models.OperationResponse": + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResponse"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01" - Request cancellation of a data share snapshot. + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + 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 = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + account_name: str, + share_subscription_name: str, + **kwargs + ) -> "models.OperationResponse": + """Delete a shareSubscription in an account. + + Delete shareSubscription in an account. :param resource_group_name: The resource group name. :type resource_group_name: str @@ -818,41 +779,130 @@ async def cancel_synchronization( :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 :keyword callable cls: A custom type or function that will be passed the direct response :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :return: An instance of LROPoller that returns ShareSubscriptionSynchronization - :rtype: ~azure.core.polling.LROPoller[~data_share_management_client.models.ShareSubscriptionSynchronization] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: OperationResponse, or the result of cls(response) + :rtype: ~data_share_management_client.models.OperationResponse :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSubscriptionSynchronization"] - raw_result = await self._cancel_synchronization_initial( + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + raw_result = await self._delete_initial( resource_group_name=resource_group_name, account_name=account_name, share_subscription_name=share_subscription_name, - synchronization_id=synchronization_id, cls=lambda x,y,z: x, **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): - deserialized = self._deserialize('ShareSubscriptionSynchronization', pipeline_response) + deserialized = self._deserialize('OperationResponse', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) - if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling return await async_poller(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'} + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}'} # type: ignore + + def list_by_account( + self, + resource_group_name: str, + account_name: str, + skip_token: Optional[str] = None, + filter: Optional[str] = None, + orderby: Optional[str] = None, + **kwargs + ) -> AsyncIterable["models.ShareSubscriptionList"]: + """List share subscriptions in an account. + + List of available share subscriptions under 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 filter: Filters the results using OData syntax. + :type filter: str + :param orderby: Sorts the results using OData syntax. + :type orderby: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ShareSubscriptionList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_share_management_client.models.ShareSubscriptionList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSubscriptionList"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_account.metadata['url'] # type: ignore + 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 = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if orderby is not None: + query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') + + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ShareSubscriptionList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions'} # type: ignore diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_synchronization_setting_operations_async.py b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_synchronization_setting_operations_async.py index 78a95bd615..5b5b7df4be 100644 --- a/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_synchronization_setting_operations_async.py +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_synchronization_setting_operations_async.py @@ -5,7 +5,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -13,6 +13,8 @@ from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models @@ -62,16 +64,17 @@ async def get( :param synchronization_setting_name: The name of the synchronizationSetting. :type synchronization_setting_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: SynchronizationSetting or the result of cls(response) + :return: SynchronizationSetting, or the result of cls(response) :rtype: ~data_share_management_client.models.SynchronizationSetting :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SynchronizationSetting"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore 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'), @@ -97,15 +100,15 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('SynchronizationSetting', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/synchronizationSettings/{synchronizationSettingName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/synchronizationSettings/{synchronizationSettingName}'} # type: ignore async def create( self, @@ -131,17 +134,18 @@ async def create( :param synchronization_setting: The new synchronization setting information. :type synchronization_setting: ~data_share_management_client.models.SynchronizationSetting :keyword callable cls: A custom type or function that will be passed the direct response - :return: SynchronizationSetting or the result of cls(response) - :rtype: ~data_share_management_client.models.SynchronizationSetting or ~data_share_management_client.models.SynchronizationSetting + :return: SynchronizationSetting, or the result of cls(response) + :rtype: ~data_share_management_client.models.SynchronizationSetting :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SynchronizationSetting"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.create.metadata['url'] + url = self.create.metadata['url'] # type: ignore 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'), @@ -172,7 +176,7 @@ async def create( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -182,10 +186,10 @@ async def create( deserialized = self._deserialize('SynchronizationSetting', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/synchronizationSettings/{synchronizationSettingName}'} + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/synchronizationSettings/{synchronizationSettingName}'} # type: ignore async def _delete_initial( self, @@ -196,11 +200,12 @@ async def _delete_initial( **kwargs ) -> "models.OperationResponse": cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResponse"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" # Construct URL - url = self._delete_initial.metadata['url'] + url = self._delete_initial.metadata['url'] # type: ignore 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'), @@ -226,17 +231,17 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: deserialized = self._deserialize('OperationResponse', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/synchronizationSettings/{synchronizationSettingName}'} + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/synchronizationSettings/{synchronizationSettingName}'} # type: ignore async def delete( self, @@ -262,13 +267,17 @@ async def delete( :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :return: An instance of LROPoller that returns OperationResponse - :rtype: ~azure.core.polling.LROPoller[~data_share_management_client.models.OperationResponse] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: OperationResponse, or the result of cls(response) + :rtype: ~data_share_management_client.models.OperationResponse :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._delete_initial( resource_group_name=resource_group_name, account_name=account_name, @@ -278,6 +287,9 @@ async def delete( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): deserialized = self._deserialize('OperationResponse', pipeline_response) @@ -285,15 +297,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) - if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling return await async_poller(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}'} + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/synchronizationSettings/{synchronizationSettingName}'} # type: ignore def list_by_share( self, @@ -302,7 +310,7 @@ def list_by_share( share_name: str, skip_token: Optional[str] = None, **kwargs - ) -> "models.SynchronizationSettingList": + ) -> AsyncIterable["models.SynchronizationSettingList"]: """List synchronizationSettings in a share. List synchronizationSettings in a share. @@ -316,18 +324,19 @@ def list_by_share( :param skip_token: continuation token. :type skip_token: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: SynchronizationSettingList or the result of cls(response) - :rtype: ~data_share_management_client.models.SynchronizationSettingList + :return: An iterator like instance of either SynchronizationSettingList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_share_management_client.models.SynchronizationSettingList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SynchronizationSettingList"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_share.metadata['url'] + url = self.list_by_share.metadata['url'] # type: ignore 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'), @@ -335,15 +344,15 @@ def prepare_request(next_link=None): 'shareName': self._serialize.url("share_name", share_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -368,11 +377,11 @@ async def get_next(next_link=None): if response.status_code not in [200]: error = self._deserialize(models.DataShareError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged( get_next, extract_data ) - list_by_share.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/synchronizationSettings'} + list_by_share.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/synchronizationSettings'} # type: ignore diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_trigger_operations_async.py b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_trigger_operations_async.py index 18598bf412..f7119d2745 100644 --- a/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_trigger_operations_async.py +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_trigger_operations_async.py @@ -5,7 +5,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -13,6 +13,8 @@ from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models @@ -62,16 +64,17 @@ async def get( :param trigger_name: The name of the trigger. :type trigger_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: Trigger or the result of cls(response) + :return: Trigger, or the result of cls(response) :rtype: ~data_share_management_client.models.Trigger :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Trigger"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore 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'), @@ -97,15 +100,15 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Trigger', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers/{triggerName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers/{triggerName}'} # type: ignore async def _create_initial( self, @@ -117,12 +120,13 @@ async def _create_initial( **kwargs ) -> "models.Trigger": cls = kwargs.pop('cls', None) # type: ClsType["models.Trigger"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._create_initial.metadata['url'] + url = self._create_initial.metadata['url'] # type: ignore 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'), @@ -153,7 +157,7 @@ async def _create_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -163,10 +167,10 @@ async def _create_initial( deserialized = self._deserialize('Trigger', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers/{triggerName}'} + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers/{triggerName}'} # type: ignore async def create( self, @@ -196,13 +200,17 @@ async def create( :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :return: An instance of LROPoller that returns Trigger - :rtype: ~azure.core.polling.LROPoller[~data_share_management_client.models.Trigger] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: Trigger, or the result of cls(response) + :rtype: ~data_share_management_client.models.Trigger :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Trigger"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._create_initial( resource_group_name=resource_group_name, account_name=account_name, @@ -213,6 +221,9 @@ async def create( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): deserialized = self._deserialize('Trigger', pipeline_response) @@ -220,15 +231,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) - if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling return await async_poller(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}'} + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers/{triggerName}'} # type: ignore async def _delete_initial( self, @@ -239,11 +246,12 @@ async def _delete_initial( **kwargs ) -> "models.OperationResponse": cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResponse"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" # Construct URL - url = self._delete_initial.metadata['url'] + url = self._delete_initial.metadata['url'] # type: ignore 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'), @@ -269,17 +277,17 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: deserialized = self._deserialize('OperationResponse', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers/{triggerName}'} + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers/{triggerName}'} # type: ignore async def delete( self, @@ -305,13 +313,17 @@ async def delete( :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :return: An instance of LROPoller that returns OperationResponse - :rtype: ~azure.core.polling.LROPoller[~data_share_management_client.models.OperationResponse] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: OperationResponse, or the result of cls(response) + :rtype: ~data_share_management_client.models.OperationResponse :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = await self._delete_initial( resource_group_name=resource_group_name, account_name=account_name, @@ -321,6 +333,9 @@ async def delete( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): deserialized = self._deserialize('OperationResponse', pipeline_response) @@ -328,15 +343,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) - if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling return await async_poller(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}'} + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers/{triggerName}'} # type: ignore def list_by_share_subscription( self, @@ -345,7 +356,7 @@ def list_by_share_subscription( share_subscription_name: str, skip_token: Optional[str] = None, **kwargs - ) -> "models.TriggerList": + ) -> AsyncIterable["models.TriggerList"]: """List Triggers in a share subscription. List Triggers in a share subscription. @@ -359,18 +370,19 @@ def list_by_share_subscription( :param skip_token: Continuation token. :type skip_token: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: TriggerList or the result of cls(response) - :rtype: ~data_share_management_client.models.TriggerList + :return: An iterator like instance of either TriggerList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~data_share_management_client.models.TriggerList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.TriggerList"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_share_subscription.metadata['url'] + url = self.list_by_share_subscription.metadata['url'] # type: ignore 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'), @@ -378,15 +390,15 @@ def prepare_request(next_link=None): 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -411,11 +423,11 @@ async def get_next(next_link=None): if response.status_code not in [200]: error = self._deserialize(models.DataShareError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged( get_next, extract_data ) - list_by_share_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers'} + list_by_share_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers'} # type: ignore diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/models/__init__.py b/src/datashare/azext_datashare/vendored_sdks/datashare/models/__init__.py index 237bc58e2a..403c9091e1 100644 --- a/src/datashare/azext_datashare/vendored_sdks/datashare/models/__init__.py +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/models/__init__.py @@ -7,17 +7,17 @@ # -------------------------------------------------------------------------- try: + 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 Account from ._models_py3 import AccountList 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 @@ -68,8 +68,8 @@ from ._models_py3 import SourceShareSynchronizationSettingList from ._models_py3 import SqlDBTableDataSet from ._models_py3 import SqlDBTableDataSetMapping - from ._models_py3 import SqlDwTableDataSet - from ._models_py3 import SqlDwTableDataSetMapping + from ._models_py3 import SqlDWTableDataSet + from ._models_py3 import SqlDWTableDataSetMapping from ._models_py3 import SynchronizationDetails from ._models_py3 import SynchronizationDetailsList from ._models_py3 import SynchronizationSetting @@ -78,17 +78,17 @@ from ._models_py3 import Trigger from ._models_py3 import TriggerList except (SyntaxError, ImportError): + from ._models import ADLSGen1FileDataSet # type: ignore + from ._models import ADLSGen1FolderDataSet # type: ignore + from ._models import ADLSGen2FileDataSet # type: ignore + from ._models import ADLSGen2FileDataSetMapping # type: ignore + from ._models import ADLSGen2FileSystemDataSet # type: ignore + from ._models import ADLSGen2FileSystemDataSetMapping # type: ignore + from ._models import ADLSGen2FolderDataSet # type: ignore + from ._models import ADLSGen2FolderDataSetMapping # type: ignore from ._models import Account # type: ignore from ._models import AccountList # type: ignore from ._models import AccountUpdateParameters # type: ignore - from ._models import AdlsGen1FileDataSet # type: ignore - from ._models import AdlsGen1FolderDataSet # type: ignore - from ._models import AdlsGen2FileDataSet # type: ignore - from ._models import AdlsGen2FileDataSetMapping # type: ignore - from ._models import AdlsGen2FileSystemDataSet # type: ignore - from ._models import AdlsGen2FileSystemDataSetMapping # type: ignore - from ._models import AdlsGen2FolderDataSet # type: ignore - from ._models import AdlsGen2FolderDataSetMapping # type: ignore from ._models import BlobContainerDataSet # type: ignore from ._models import BlobContainerDataSetMapping # type: ignore from ._models import BlobDataSet # type: ignore @@ -139,8 +139,8 @@ from ._models import SourceShareSynchronizationSettingList # type: ignore from ._models import SqlDBTableDataSet # type: ignore from ._models import SqlDBTableDataSetMapping # type: ignore - from ._models import SqlDwTableDataSet # type: ignore - from ._models import SqlDwTableDataSetMapping # type: ignore + from ._models import SqlDWTableDataSet # type: ignore + from ._models import SqlDWTableDataSetMapping # type: ignore from ._models import SynchronizationDetails # type: ignore from ._models import SynchronizationDetailsList # type: ignore from ._models import SynchronizationSetting # type: ignore @@ -165,17 +165,17 @@ ) __all__ = [ + 'ADLSGen1FileDataSet', + 'ADLSGen1FolderDataSet', + 'ADLSGen2FileDataSet', + 'ADLSGen2FileDataSetMapping', + 'ADLSGen2FileSystemDataSet', + 'ADLSGen2FileSystemDataSetMapping', + 'ADLSGen2FolderDataSet', + 'ADLSGen2FolderDataSetMapping', 'Account', 'AccountList', 'AccountUpdateParameters', - 'AdlsGen1FileDataSet', - 'AdlsGen1FolderDataSet', - 'AdlsGen2FileDataSet', - 'AdlsGen2FileDataSetMapping', - 'AdlsGen2FileSystemDataSet', - 'AdlsGen2FileSystemDataSetMapping', - 'AdlsGen2FolderDataSet', - 'AdlsGen2FolderDataSetMapping', 'BlobContainerDataSet', 'BlobContainerDataSetMapping', 'BlobDataSet', @@ -226,8 +226,8 @@ 'SourceShareSynchronizationSettingList', 'SqlDBTableDataSet', 'SqlDBTableDataSetMapping', - 'SqlDwTableDataSet', - 'SqlDwTableDataSetMapping', + 'SqlDWTableDataSet', + 'SqlDWTableDataSetMapping', 'SynchronizationDetails', 'SynchronizationDetailsList', 'SynchronizationSetting', diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/models/_data_share_management_client_enums.py b/src/datashare/azext_datashare/vendored_sdks/datashare/models/_data_share_management_client_enums.py index a2a515c426..d48295f922 100644 --- a/src/datashare/azext_datashare/vendored_sdks/datashare/models/_data_share_management_client_enums.py +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/models/_data_share_management_client_enums.py @@ -8,15 +8,29 @@ from enum import Enum -class ProvisioningState(str, Enum): - """Provisioning state of the Account +class DataSetMappingStatus(str, Enum): + """Gets the status of the data set mapping. """ - succeeded = "Succeeded" - creating = "Creating" - deleting = "Deleting" - moving = "Moving" - failed = "Failed" + ok = "Ok" + broken = "Broken" + +class DataSetType(str, Enum): + """Type of data set + """ + + 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" + kusto_cluster = "KustoCluster" + kusto_database = "KustoDatabase" + sql_db_table = "SqlDBTable" + sql_dw_table = "SqlDWTable" class InvitationStatus(str, Enum): """The status of the invitation. @@ -43,40 +57,38 @@ class Kind(str, Enum): kusto_database = "KustoDatabase" sql_db_table = "SqlDBTable" sql_dw_table = "SqlDWTable" - -class SynchronizationKind(str, Enum): schedule_based = "ScheduleBased" -class ShareKind(str, Enum): - """Share kind. +class OutputType(str, Enum): + """Type of output file """ - copy_based = "CopyBased" - in_place = "InPlace" + csv = "Csv" + parquet = "Parquet" -class SynchronizationMode(str, Enum): - """Synchronization mode +class ProvisioningState(str, Enum): + """Provisioning state of the Account """ - incremental = "Incremental" - full_sync = "FullSync" + succeeded = "Succeeded" + creating = "Creating" + deleting = "Deleting" + moving = "Moving" + failed = "Failed" -class DataSetType(str, Enum): - """Type of the data set +class RecurrenceInterval(str, Enum): + """Recurrence Interval """ - 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" - kusto_cluster = "KustoCluster" - kusto_database = "KustoDatabase" - sql_db_table = "SqlDBTable" - sql_dw_table = "SqlDWTable" + hour = "Hour" + day = "Day" + +class ShareKind(str, Enum): + """Share kind. + """ + + copy_based = "CopyBased" + in_place = "InPlace" class ShareSubscriptionStatus(str, Enum): """Gets the status of share subscription @@ -98,12 +110,12 @@ class Status(str, Enum): failed = "Failed" canceled = "Canceled" -class RecurrenceInterval(str, Enum): - """Recurrence Interval +class SynchronizationMode(str, Enum): + """Synchronization mode """ - hour = "Hour" - day = "Day" + incremental = "Incremental" + full_sync = "FullSync" class TriggerStatus(str, Enum): """Gets the trigger state @@ -112,17 +124,3 @@ class TriggerStatus(str, Enum): active = "Active" inactive = "Inactive" source_synchronization_setting_deleted = "SourceSynchronizationSettingDeleted" - -class DataSetMappingStatus(str, Enum): - """Gets the status of the data set mapping. - """ - - ok = "Ok" - broken = "Broken" - -class OutputType(str, Enum): - """File output type - """ - - csv = "Csv" - parquet = "Parquet" diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/models/_models.py b/src/datashare/azext_datashare/vendored_sdks/datashare/models/_models.py index bee5d5e4df..a8bca9584e 100644 --- a/src/datashare/azext_datashare/vendored_sdks/datashare/models/_models.py +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/models/_models.py @@ -75,7 +75,7 @@ class Account(DefaultDto): :ivar created_at: Time at which the account was created. :vartype created_at: ~datetime.datetime :ivar provisioning_state: Provisioning state of the Account. Possible values include: - 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + "Succeeded", "Creating", "Deleting", "Moving", "Failed". :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState :ivar user_email: Email of the user who created the resource. :vartype user_email: str @@ -112,7 +112,7 @@ def __init__( **kwargs ): super(Account, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) + self.identity = kwargs['identity'] self.created_at = None self.provisioning_state = None self.user_email = None @@ -145,7 +145,7 @@ def __init__( ): super(AccountList, self).__init__(**kwargs) self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.value = kwargs['value'] class AccountUpdateParameters(msrest.serialization.Model): @@ -206,7 +206,7 @@ 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: AdlsGen1FileDataSet, AdlsGen1FolderDataSet, AdlsGen2FileDataSet, AdlsGen2FileSystemDataSet, AdlsGen2FolderDataSet, BlobDataSet, BlobFolderDataSet, BlobContainerDataSet, KustoClusterDataSet, KustoDatabaseDataSet, SqlDBTableDataSet, SqlDwTableDataSet. + sub-classes are: ADLSGen1FileDataSet, ADLSGen1FolderDataSet, ADLSGen2FileDataSet, ADLSGen2FileSystemDataSet, ADLSGen2FolderDataSet, BlobDataSet, BlobFolderDataSet, BlobContainerDataSet, KustoClusterDataSet, KustoDatabaseDataSet, SqlDBTableDataSet, SqlDWTableDataSet. Variables are only populated by the server, and will be ignored when sending a request. @@ -219,9 +219,9 @@ class DataSet(ProxyDto): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set.Constant filled by server. Possible values include: - 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', - 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', - 'ScheduleBased'. + "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", "AdlsGen2File", + "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", "SqlDBTable", "SqlDWTable", + "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind """ @@ -240,7 +240,7 @@ class DataSet(ProxyDto): } _subtype_map = { - 'kind': {'AdlsGen1File': 'AdlsGen1FileDataSet', 'AdlsGen1Folder': 'AdlsGen1FolderDataSet', 'AdlsGen2File': 'AdlsGen2FileDataSet', 'AdlsGen2FileSystem': 'AdlsGen2FileSystemDataSet', 'AdlsGen2Folder': 'AdlsGen2FolderDataSet', 'Blob': 'BlobDataSet', 'BlobFolder': 'BlobFolderDataSet', 'Container': 'BlobContainerDataSet', 'KustoCluster': 'KustoClusterDataSet', 'KustoDatabase': 'KustoDatabaseDataSet', 'SqlDBTable': 'SqlDBTableDataSet', 'SqlDWTable': 'SqlDwTableDataSet'} + 'kind': {'AdlsGen1File': 'ADLSGen1FileDataSet', 'AdlsGen1Folder': 'ADLSGen1FolderDataSet', 'AdlsGen2File': 'ADLSGen2FileDataSet', 'AdlsGen2FileSystem': 'ADLSGen2FileSystemDataSet', 'AdlsGen2Folder': 'ADLSGen2FolderDataSet', 'Blob': 'BlobDataSet', 'BlobFolder': 'BlobFolderDataSet', 'Container': 'BlobContainerDataSet', 'KustoCluster': 'KustoClusterDataSet', 'KustoDatabase': 'KustoDatabaseDataSet', 'SqlDBTable': 'SqlDBTableDataSet', 'SqlDWTable': 'SqlDWTableDataSet'} } def __init__( @@ -251,7 +251,7 @@ def __init__( self.kind = 'DataSet' -class AdlsGen1FileDataSet(DataSet): +class ADLSGen1FileDataSet(DataSet): """An ADLS Gen 1 file data set. Variables are only populated by the server, and will be ignored when sending a request. @@ -265,9 +265,9 @@ class AdlsGen1FileDataSet(DataSet): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set.Constant filled by server. Possible values include: - 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', - 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', - 'ScheduleBased'. + "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", "AdlsGen2File", + "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", "SqlDBTable", "SqlDWTable", + "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :param account_name: Required. The ADLS account name. :type account_name: str @@ -313,17 +313,17 @@ def __init__( self, **kwargs ): - super(AdlsGen1FileDataSet, self).__init__(**kwargs) + super(ADLSGen1FileDataSet, self).__init__(**kwargs) self.kind = 'AdlsGen1File' - self.account_name = kwargs.get('account_name', None) + self.account_name = kwargs['account_name'] 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.file_name = kwargs['file_name'] + self.folder_path = kwargs['folder_path'] + self.resource_group = kwargs['resource_group'] + self.subscription_id = kwargs['subscription_id'] -class AdlsGen1FolderDataSet(DataSet): +class ADLSGen1FolderDataSet(DataSet): """An ADLS Gen 1 folder data set. Variables are only populated by the server, and will be ignored when sending a request. @@ -337,9 +337,9 @@ class AdlsGen1FolderDataSet(DataSet): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set.Constant filled by server. Possible values include: - 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', - 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', - 'ScheduleBased'. + "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", "AdlsGen2File", + "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", "SqlDBTable", "SqlDWTable", + "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :param account_name: Required. The ADLS account name. :type account_name: str @@ -381,16 +381,16 @@ def __init__( self, **kwargs ): - super(AdlsGen1FolderDataSet, self).__init__(**kwargs) + super(ADLSGen1FolderDataSet, self).__init__(**kwargs) self.kind = 'AdlsGen1Folder' - self.account_name = kwargs.get('account_name', None) + self.account_name = kwargs['account_name'] 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.folder_path = kwargs['folder_path'] + self.resource_group = kwargs['resource_group'] + self.subscription_id = kwargs['subscription_id'] -class AdlsGen2FileDataSet(DataSet): +class ADLSGen2FileDataSet(DataSet): """An ADLS Gen 2 file data set. Variables are only populated by the server, and will be ignored when sending a request. @@ -404,9 +404,9 @@ class AdlsGen2FileDataSet(DataSet): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set.Constant filled by server. Possible values include: - 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', - 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', - 'ScheduleBased'. + "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", "AdlsGen2File", + "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", "SqlDBTable", "SqlDWTable", + "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :ivar data_set_id: Unique id for identifying a data set resource. :vartype data_set_id: str @@ -452,21 +452,21 @@ def __init__( self, **kwargs ): - super(AdlsGen2FileDataSet, self).__init__(**kwargs) + super(ADLSGen2FileDataSet, self).__init__(**kwargs) self.kind = 'AdlsGen2File' 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.file_path = kwargs['file_path'] + self.file_system = kwargs['file_system'] + self.resource_group = kwargs['resource_group'] + self.storage_account_name = kwargs['storage_account_name'] + self.subscription_id = kwargs['subscription_id'] class DataSetMapping(ProxyDto): """A data set mapping data transfer object. You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AdlsGen2FileDataSetMapping, AdlsGen2FileSystemDataSetMapping, AdlsGen2FolderDataSetMapping, BlobDataSetMapping, BlobFolderDataSetMapping, BlobContainerDataSetMapping, KustoClusterDataSetMapping, KustoDatabaseDataSetMapping, SqlDBTableDataSetMapping, SqlDwTableDataSetMapping. + sub-classes are: ADLSGen2FileDataSetMapping, ADLSGen2FileSystemDataSetMapping, ADLSGen2FolderDataSetMapping, BlobDataSetMapping, BlobFolderDataSetMapping, BlobContainerDataSetMapping, KustoClusterDataSetMapping, KustoDatabaseDataSetMapping, SqlDBTableDataSetMapping, SqlDWTableDataSetMapping. Variables are only populated by the server, and will be ignored when sending a request. @@ -479,9 +479,9 @@ class DataSetMapping(ProxyDto): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set mapping.Constant filled by server. Possible values - include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', - 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', - 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + include: "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", + "AdlsGen2File", "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", + "SqlDBTable", "SqlDWTable", "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind """ @@ -500,7 +500,7 @@ class DataSetMapping(ProxyDto): } _subtype_map = { - 'kind': {'AdlsGen2File': 'AdlsGen2FileDataSetMapping', 'AdlsGen2FileSystem': 'AdlsGen2FileSystemDataSetMapping', 'AdlsGen2Folder': 'AdlsGen2FolderDataSetMapping', 'Blob': 'BlobDataSetMapping', 'BlobFolder': 'BlobFolderDataSetMapping', 'Container': 'BlobContainerDataSetMapping', 'KustoCluster': 'KustoClusterDataSetMapping', 'KustoDatabase': 'KustoDatabaseDataSetMapping', 'SqlDBTable': 'SqlDBTableDataSetMapping', 'SqlDWTable': 'SqlDwTableDataSetMapping'} + 'kind': {'AdlsGen2File': 'ADLSGen2FileDataSetMapping', 'AdlsGen2FileSystem': 'ADLSGen2FileSystemDataSetMapping', 'AdlsGen2Folder': 'ADLSGen2FolderDataSetMapping', 'Blob': 'BlobDataSetMapping', 'BlobFolder': 'BlobFolderDataSetMapping', 'Container': 'BlobContainerDataSetMapping', 'KustoCluster': 'KustoClusterDataSetMapping', 'KustoDatabase': 'KustoDatabaseDataSetMapping', 'SqlDBTable': 'SqlDBTableDataSetMapping', 'SqlDWTable': 'SqlDWTableDataSetMapping'} } def __init__( @@ -511,7 +511,7 @@ def __init__( self.kind = 'DataSetMapping' -class AdlsGen2FileDataSetMapping(DataSetMapping): +class ADLSGen2FileDataSetMapping(DataSetMapping): """An ADLS Gen2 file data set mapping. Variables are only populated by the server, and will be ignored when sending a request. @@ -525,24 +525,24 @@ class AdlsGen2FileDataSetMapping(DataSetMapping): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set mapping.Constant filled by server. Possible values - include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', - 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', - 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + include: "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", + "AdlsGen2File", "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", + "SqlDBTable", "SqlDWTable", "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :param data_set_id: Required. The id of the source data set. :type data_set_id: str :ivar data_set_mapping_status: Gets the status of the data set mapping. Possible values - include: 'Ok', 'Broken'. + include: "Ok", "Broken". :vartype data_set_mapping_status: str or ~data_share_management_client.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'. + :param output_type: Type of output file. Possible values include: "Csv", "Parquet". :type output_type: str or ~data_share_management_client.models.OutputType :ivar provisioning_state: Provisioning state of the data set mapping. Possible values include: - 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + "Succeeded", "Creating", "Deleting", "Moving", "Failed". :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState :param resource_group: Required. Resource group of storage account. :type resource_group: str @@ -587,20 +587,20 @@ def __init__( self, **kwargs ): - super(AdlsGen2FileDataSetMapping, self).__init__(**kwargs) + super(ADLSGen2FileDataSetMapping, self).__init__(**kwargs) self.kind = 'AdlsGen2File' - self.data_set_id = kwargs.get('data_set_id', None) + self.data_set_id = kwargs['data_set_id'] self.data_set_mapping_status = None - self.file_path = kwargs.get('file_path', None) - self.file_system = kwargs.get('file_system', None) + self.file_path = kwargs['file_path'] + self.file_system = kwargs['file_system'] self.output_type = kwargs.get('output_type', None) self.provisioning_state = 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.resource_group = kwargs['resource_group'] + self.storage_account_name = kwargs['storage_account_name'] + self.subscription_id = kwargs['subscription_id'] -class AdlsGen2FileSystemDataSet(DataSet): +class ADLSGen2FileSystemDataSet(DataSet): """An ADLS Gen 2 file system data set. Variables are only populated by the server, and will be ignored when sending a request. @@ -614,9 +614,9 @@ class AdlsGen2FileSystemDataSet(DataSet): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set.Constant filled by server. Possible values include: - 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', - 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', - 'ScheduleBased'. + "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", "AdlsGen2File", + "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", "SqlDBTable", "SqlDWTable", + "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :ivar data_set_id: Unique id for identifying a data set resource. :vartype data_set_id: str @@ -658,16 +658,16 @@ def __init__( self, **kwargs ): - super(AdlsGen2FileSystemDataSet, self).__init__(**kwargs) + super(ADLSGen2FileSystemDataSet, self).__init__(**kwargs) self.kind = 'AdlsGen2FileSystem' 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.file_system = kwargs['file_system'] + self.resource_group = kwargs['resource_group'] + self.storage_account_name = kwargs['storage_account_name'] + self.subscription_id = kwargs['subscription_id'] -class AdlsGen2FileSystemDataSetMapping(DataSetMapping): +class ADLSGen2FileSystemDataSetMapping(DataSetMapping): """An ADLS Gen2 file system data set mapping. Variables are only populated by the server, and will be ignored when sending a request. @@ -681,20 +681,20 @@ class AdlsGen2FileSystemDataSetMapping(DataSetMapping): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set mapping.Constant filled by server. Possible values - include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', - 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', - 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + include: "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", + "AdlsGen2File", "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", + "SqlDBTable", "SqlDWTable", "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :param data_set_id: Required. The id of the source data set. :type data_set_id: str :ivar data_set_mapping_status: Gets the status of the data set mapping. Possible values - include: 'Ok', 'Broken'. + include: "Ok", "Broken". :vartype data_set_mapping_status: str or ~data_share_management_client.models.DataSetMappingStatus :param file_system: Required. The file system name. :type file_system: str :ivar provisioning_state: Provisioning state of the data set mapping. Possible values include: - 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + "Succeeded", "Creating", "Deleting", "Moving", "Failed". :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState :param resource_group: Required. Resource group of storage account. :type resource_group: str @@ -736,18 +736,18 @@ def __init__( self, **kwargs ): - super(AdlsGen2FileSystemDataSetMapping, self).__init__(**kwargs) + super(ADLSGen2FileSystemDataSetMapping, self).__init__(**kwargs) self.kind = 'AdlsGen2FileSystem' - self.data_set_id = kwargs.get('data_set_id', None) + self.data_set_id = kwargs['data_set_id'] self.data_set_mapping_status = None - self.file_system = kwargs.get('file_system', None) + self.file_system = kwargs['file_system'] self.provisioning_state = 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.resource_group = kwargs['resource_group'] + self.storage_account_name = kwargs['storage_account_name'] + self.subscription_id = kwargs['subscription_id'] -class AdlsGen2FolderDataSet(DataSet): +class ADLSGen2FolderDataSet(DataSet): """An ADLS Gen 2 folder data set. Variables are only populated by the server, and will be ignored when sending a request. @@ -761,9 +761,9 @@ class AdlsGen2FolderDataSet(DataSet): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set.Constant filled by server. Possible values include: - 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', - 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', - 'ScheduleBased'. + "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", "AdlsGen2File", + "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", "SqlDBTable", "SqlDWTable", + "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :ivar data_set_id: Unique id for identifying a data set resource. :vartype data_set_id: str @@ -809,17 +809,17 @@ def __init__( self, **kwargs ): - super(AdlsGen2FolderDataSet, self).__init__(**kwargs) + super(ADLSGen2FolderDataSet, self).__init__(**kwargs) self.kind = 'AdlsGen2Folder' 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.file_system = kwargs['file_system'] + self.folder_path = kwargs['folder_path'] + self.resource_group = kwargs['resource_group'] + self.storage_account_name = kwargs['storage_account_name'] + self.subscription_id = kwargs['subscription_id'] -class AdlsGen2FolderDataSetMapping(DataSetMapping): +class ADLSGen2FolderDataSetMapping(DataSetMapping): """An ADLS Gen2 folder data set mapping. Variables are only populated by the server, and will be ignored when sending a request. @@ -833,14 +833,14 @@ class AdlsGen2FolderDataSetMapping(DataSetMapping): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set mapping.Constant filled by server. Possible values - include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', - 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', - 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + include: "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", + "AdlsGen2File", "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", + "SqlDBTable", "SqlDWTable", "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :param data_set_id: Required. The id of the source data set. :type data_set_id: str :ivar data_set_mapping_status: Gets the status of the data set mapping. Possible values - include: 'Ok', 'Broken'. + include: "Ok", "Broken". :vartype data_set_mapping_status: str or ~data_share_management_client.models.DataSetMappingStatus :param file_system: Required. File system to which the folder belongs. @@ -848,7 +848,7 @@ class AdlsGen2FolderDataSetMapping(DataSetMapping): :param folder_path: Required. Folder path within the file system. :type folder_path: str :ivar provisioning_state: Provisioning state of the data set mapping. Possible values include: - 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + "Succeeded", "Creating", "Deleting", "Moving", "Failed". :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState :param resource_group: Required. Resource group of storage account. :type resource_group: str @@ -892,16 +892,16 @@ def __init__( self, **kwargs ): - super(AdlsGen2FolderDataSetMapping, self).__init__(**kwargs) + super(ADLSGen2FolderDataSetMapping, self).__init__(**kwargs) self.kind = 'AdlsGen2Folder' - self.data_set_id = kwargs.get('data_set_id', None) + self.data_set_id = kwargs['data_set_id'] self.data_set_mapping_status = None - self.file_system = kwargs.get('file_system', None) - self.folder_path = kwargs.get('folder_path', None) + self.file_system = kwargs['file_system'] + self.folder_path = kwargs['folder_path'] self.provisioning_state = 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.resource_group = kwargs['resource_group'] + self.storage_account_name = kwargs['storage_account_name'] + self.subscription_id = kwargs['subscription_id'] class BlobContainerDataSet(DataSet): @@ -918,9 +918,9 @@ class BlobContainerDataSet(DataSet): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set.Constant filled by server. Possible values include: - 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', - 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', - 'ScheduleBased'. + "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", "AdlsGen2File", + "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", "SqlDBTable", "SqlDWTable", + "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :param container_name: Required. BLOB Container name. :type container_name: str @@ -964,11 +964,11 @@ def __init__( ): super(BlobContainerDataSet, self).__init__(**kwargs) self.kind = 'Container' - self.container_name = kwargs.get('container_name', None) + self.container_name = kwargs['container_name'] 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.resource_group = kwargs['resource_group'] + self.storage_account_name = kwargs['storage_account_name'] + self.subscription_id = kwargs['subscription_id'] class BlobContainerDataSetMapping(DataSetMapping): @@ -985,20 +985,20 @@ class BlobContainerDataSetMapping(DataSetMapping): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set mapping.Constant filled by server. Possible values - include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', - 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', - 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + include: "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", + "AdlsGen2File", "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", + "SqlDBTable", "SqlDWTable", "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :param container_name: Required. BLOB Container name. :type container_name: str :param data_set_id: Required. The id of the source data set. :type data_set_id: str :ivar data_set_mapping_status: Gets the status of the data set mapping. Possible values - include: 'Ok', 'Broken'. + include: "Ok", "Broken". :vartype data_set_mapping_status: str or ~data_share_management_client.models.DataSetMappingStatus :ivar provisioning_state: Provisioning state of the data set mapping. Possible values include: - 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + "Succeeded", "Creating", "Deleting", "Moving", "Failed". :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState :param resource_group: Required. Resource group of storage account. :type resource_group: str @@ -1042,13 +1042,13 @@ def __init__( ): super(BlobContainerDataSetMapping, self).__init__(**kwargs) self.kind = 'Container' - self.container_name = kwargs.get('container_name', None) - self.data_set_id = kwargs.get('data_set_id', None) + self.container_name = kwargs['container_name'] + self.data_set_id = kwargs['data_set_id'] self.data_set_mapping_status = None self.provisioning_state = 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.resource_group = kwargs['resource_group'] + self.storage_account_name = kwargs['storage_account_name'] + self.subscription_id = kwargs['subscription_id'] class BlobDataSet(DataSet): @@ -1065,9 +1065,9 @@ class BlobDataSet(DataSet): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set.Constant filled by server. Possible values include: - 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', - 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', - 'ScheduleBased'. + "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", "AdlsGen2File", + "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", "SqlDBTable", "SqlDWTable", + "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :param container_name: Required. Container that has the file path. :type container_name: str @@ -1115,12 +1115,12 @@ def __init__( ): super(BlobDataSet, self).__init__(**kwargs) self.kind = 'Blob' - self.container_name = kwargs.get('container_name', None) + self.container_name = kwargs['container_name'] 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.file_path = kwargs['file_path'] + self.resource_group = kwargs['resource_group'] + self.storage_account_name = kwargs['storage_account_name'] + self.subscription_id = kwargs['subscription_id'] class BlobDataSetMapping(DataSetMapping): @@ -1137,24 +1137,24 @@ class BlobDataSetMapping(DataSetMapping): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set mapping.Constant filled by server. Possible values - include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', - 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', - 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + include: "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", + "AdlsGen2File", "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", + "SqlDBTable", "SqlDWTable", "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :param container_name: Required. Container that has the file path. :type container_name: str :param data_set_id: Required. The id of the source data set. :type data_set_id: str :ivar data_set_mapping_status: Gets the status of the data set mapping. Possible values - include: 'Ok', 'Broken'. + include: "Ok", "Broken". :vartype data_set_mapping_status: str or ~data_share_management_client.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'. + :param output_type: File output type. Possible values include: "Csv", "Parquet". :type output_type: str or ~data_share_management_client.models.OutputType :ivar provisioning_state: Provisioning state of the data set mapping. Possible values include: - 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + "Succeeded", "Creating", "Deleting", "Moving", "Failed". :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState :param resource_group: Required. Resource group of storage account. :type resource_group: str @@ -1201,15 +1201,15 @@ def __init__( ): super(BlobDataSetMapping, self).__init__(**kwargs) self.kind = 'Blob' - self.container_name = kwargs.get('container_name', None) - self.data_set_id = kwargs.get('data_set_id', None) + self.container_name = kwargs['container_name'] + self.data_set_id = kwargs['data_set_id'] self.data_set_mapping_status = None - self.file_path = kwargs.get('file_path', None) + self.file_path = kwargs['file_path'] self.output_type = kwargs.get('output_type', None) self.provisioning_state = 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.resource_group = kwargs['resource_group'] + self.storage_account_name = kwargs['storage_account_name'] + self.subscription_id = kwargs['subscription_id'] class BlobFolderDataSet(DataSet): @@ -1226,9 +1226,9 @@ class BlobFolderDataSet(DataSet): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set.Constant filled by server. Possible values include: - 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', - 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', - 'ScheduleBased'. + "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", "AdlsGen2File", + "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", "SqlDBTable", "SqlDWTable", + "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :param container_name: Required. Container that has the file path. :type container_name: str @@ -1276,12 +1276,12 @@ def __init__( ): super(BlobFolderDataSet, self).__init__(**kwargs) self.kind = 'BlobFolder' - self.container_name = kwargs.get('container_name', None) + self.container_name = kwargs['container_name'] 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.prefix = kwargs['prefix'] + self.resource_group = kwargs['resource_group'] + self.storage_account_name = kwargs['storage_account_name'] + self.subscription_id = kwargs['subscription_id'] class BlobFolderDataSetMapping(DataSetMapping): @@ -1298,22 +1298,22 @@ class BlobFolderDataSetMapping(DataSetMapping): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set mapping.Constant filled by server. Possible values - include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', - 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', - 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + include: "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", + "AdlsGen2File", "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", + "SqlDBTable", "SqlDWTable", "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :param container_name: Required. Container that has the file path. :type container_name: str :param data_set_id: Required. The id of the source data set. :type data_set_id: str :ivar data_set_mapping_status: Gets the status of the data set mapping. Possible values - include: 'Ok', 'Broken'. + include: "Ok", "Broken". :vartype data_set_mapping_status: str or ~data_share_management_client.models.DataSetMappingStatus :param prefix: Required. Prefix for blob folder. :type prefix: str :ivar provisioning_state: Provisioning state of the data set mapping. Possible values include: - 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + "Succeeded", "Creating", "Deleting", "Moving", "Failed". :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState :param resource_group: Required. Resource group of storage account. :type resource_group: str @@ -1359,14 +1359,14 @@ def __init__( ): super(BlobFolderDataSetMapping, self).__init__(**kwargs) self.kind = 'BlobFolder' - self.container_name = kwargs.get('container_name', None) - self.data_set_id = kwargs.get('data_set_id', None) + self.container_name = kwargs['container_name'] + self.data_set_id = kwargs['data_set_id'] self.data_set_mapping_status = None - self.prefix = kwargs.get('prefix', None) + self.prefix = kwargs['prefix'] self.provisioning_state = 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.resource_group = kwargs['resource_group'] + self.storage_account_name = kwargs['storage_account_name'] + self.subscription_id = kwargs['subscription_id'] class ConsumerInvitation(ProxyDto): @@ -1388,8 +1388,8 @@ class ConsumerInvitation(ProxyDto): :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'. + :ivar invitation_status: The status of the invitation. Possible values include: "Pending", + "Accepted", "Rejected", "Withdrawn". :vartype invitation_status: str or ~data_share_management_client.models.InvitationStatus :ivar location: invitation location. :vartype location: str @@ -1460,7 +1460,7 @@ def __init__( super(ConsumerInvitation, self).__init__(**kwargs) self.data_set_count = None self.description = None - self.invitation_id = kwargs.get('invitation_id', None) + self.invitation_id = kwargs['invitation_id'] self.invitation_status = None self.location = None self.provider_email = None @@ -1500,7 +1500,7 @@ def __init__( ): super(ConsumerInvitationList, self).__init__(**kwargs) self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.value = kwargs['value'] class ConsumerSourceDataSet(ProxyDto): @@ -1522,9 +1522,9 @@ class ConsumerSourceDataSet(ProxyDto): :vartype data_set_name: str :ivar data_set_path: DataSet path. :vartype data_set_path: str - :ivar data_set_type: Type of data set. Possible values include: 'Blob', 'Container', - 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', 'AdlsGen1Folder', - 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable'. + :ivar data_set_type: Type of data set. Possible values include: "Blob", "Container", + "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", "AdlsGen2File", "AdlsGen1Folder", + "AdlsGen1File", "KustoCluster", "KustoDatabase", "SqlDBTable", "SqlDWTable". :vartype data_set_type: str or ~data_share_management_client.models.DataSetType """ @@ -1588,7 +1588,7 @@ def __init__( ): super(ConsumerSourceDataSetList, self).__init__(**kwargs) self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.value = kwargs['value'] class DataSetList(msrest.serialization.Model): @@ -1617,7 +1617,7 @@ def __init__( ): super(DataSetList, self).__init__(**kwargs) self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.value = kwargs['value'] class DataSetMappingList(msrest.serialization.Model): @@ -1646,7 +1646,7 @@ def __init__( ): super(DataSetMappingList, self).__init__(**kwargs) self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.value = kwargs['value'] class DataShareError(msrest.serialization.Model): @@ -1671,7 +1671,7 @@ def __init__( **kwargs ): super(DataShareError, self).__init__(**kwargs) - self.error = kwargs.get('error', None) + self.error = kwargs['error'] class DataShareErrorInfo(msrest.serialization.Model): @@ -1706,9 +1706,9 @@ def __init__( **kwargs ): super(DataShareErrorInfo, self).__init__(**kwargs) - self.code = kwargs.get('code', None) + self.code = kwargs['code'] self.details = kwargs.get('details', None) - self.message = kwargs.get('message', None) + self.message = kwargs['message'] self.target = kwargs.get('target', None) @@ -1784,8 +1784,8 @@ class Invitation(ProxyDto): :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'. + :ivar invitation_status: The status of the invitation. Possible values include: "Pending", + "Accepted", "Rejected", "Withdrawn". :vartype invitation_status: str or ~data_share_management_client.models.InvitationStatus :ivar responded_at: The time the recipient responded to the invitation. :vartype responded_at: ~datetime.datetime @@ -1874,7 +1874,7 @@ def __init__( ): super(InvitationList, self).__init__(**kwargs) self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.value = kwargs['value'] class KustoClusterDataSet(DataSet): @@ -1891,9 +1891,9 @@ class KustoClusterDataSet(DataSet): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set.Constant filled by server. Possible values include: - 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', - 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', - 'ScheduleBased'. + "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", "AdlsGen2File", + "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", "SqlDBTable", "SqlDWTable", + "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :ivar data_set_id: Unique id for identifying a data set resource. :vartype data_set_id: str @@ -1902,7 +1902,7 @@ class KustoClusterDataSet(DataSet): :ivar location: Location of the kusto cluster. :vartype location: str :ivar provisioning_state: Provisioning state of the kusto cluster data set. Possible values - include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + include: "Succeeded", "Creating", "Deleting", "Moving", "Failed". :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState """ @@ -1935,7 +1935,7 @@ def __init__( super(KustoClusterDataSet, self).__init__(**kwargs) self.kind = 'KustoCluster' self.data_set_id = None - self.kusto_cluster_resource_id = kwargs.get('kusto_cluster_resource_id', None) + self.kusto_cluster_resource_id = kwargs['kusto_cluster_resource_id'] self.location = None self.provisioning_state = None @@ -1954,14 +1954,14 @@ class KustoClusterDataSetMapping(DataSetMapping): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set mapping.Constant filled by server. Possible values - include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', - 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', - 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + include: "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", + "AdlsGen2File", "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", + "SqlDBTable", "SqlDWTable", "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :param data_set_id: Required. The id of the source data set. :type data_set_id: str :ivar data_set_mapping_status: Gets the status of the data set mapping. Possible values - include: 'Ok', 'Broken'. + include: "Ok", "Broken". :vartype data_set_mapping_status: str or ~data_share_management_client.models.DataSetMappingStatus :param kusto_cluster_resource_id: Required. Resource id of the sink kusto cluster. @@ -1969,7 +1969,7 @@ class KustoClusterDataSetMapping(DataSetMapping): :ivar location: Location of the sink kusto cluster. :vartype location: str :ivar provisioning_state: Provisioning state of the data set mapping. Possible values include: - 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + "Succeeded", "Creating", "Deleting", "Moving", "Failed". :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState """ @@ -2003,9 +2003,9 @@ def __init__( ): super(KustoClusterDataSetMapping, self).__init__(**kwargs) self.kind = 'KustoCluster' - self.data_set_id = kwargs.get('data_set_id', None) + self.data_set_id = kwargs['data_set_id'] self.data_set_mapping_status = None - self.kusto_cluster_resource_id = kwargs.get('kusto_cluster_resource_id', None) + self.kusto_cluster_resource_id = kwargs['kusto_cluster_resource_id'] self.location = None self.provisioning_state = None @@ -2024,9 +2024,9 @@ class KustoDatabaseDataSet(DataSet): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set.Constant filled by server. Possible values include: - 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', - 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', - 'ScheduleBased'. + "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", "AdlsGen2File", + "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", "SqlDBTable", "SqlDWTable", + "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :ivar data_set_id: Unique id for identifying a data set resource. :vartype data_set_id: str @@ -2035,7 +2035,7 @@ class KustoDatabaseDataSet(DataSet): :ivar location: Location of the kusto cluster. :vartype location: str :ivar provisioning_state: Provisioning state of the kusto database data set. Possible values - include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + include: "Succeeded", "Creating", "Deleting", "Moving", "Failed". :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState """ @@ -2068,7 +2068,7 @@ def __init__( super(KustoDatabaseDataSet, self).__init__(**kwargs) self.kind = 'KustoDatabase' self.data_set_id = None - self.kusto_database_resource_id = kwargs.get('kusto_database_resource_id', None) + self.kusto_database_resource_id = kwargs['kusto_database_resource_id'] self.location = None self.provisioning_state = None @@ -2087,14 +2087,14 @@ class KustoDatabaseDataSetMapping(DataSetMapping): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set mapping.Constant filled by server. Possible values - include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', - 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', - 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + include: "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", + "AdlsGen2File", "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", + "SqlDBTable", "SqlDWTable", "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :param data_set_id: Required. The id of the source data set. :type data_set_id: str :ivar data_set_mapping_status: Gets the status of the data set mapping. Possible values - include: 'Ok', 'Broken'. + include: "Ok", "Broken". :vartype data_set_mapping_status: str or ~data_share_management_client.models.DataSetMappingStatus :param kusto_cluster_resource_id: Required. Resource id of the sink kusto cluster. @@ -2102,7 +2102,7 @@ class KustoDatabaseDataSetMapping(DataSetMapping): :ivar location: Location of the sink kusto cluster. :vartype location: str :ivar provisioning_state: Provisioning state of the data set mapping. Possible values include: - 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + "Succeeded", "Creating", "Deleting", "Moving", "Failed". :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState """ @@ -2136,9 +2136,9 @@ def __init__( ): super(KustoDatabaseDataSetMapping, self).__init__(**kwargs) self.kind = 'KustoDatabase' - self.data_set_id = kwargs.get('data_set_id', None) + self.data_set_id = kwargs['data_set_id'] self.data_set_mapping_status = None - self.kusto_cluster_resource_id = kwargs.get('kusto_cluster_resource_id', None) + self.kusto_cluster_resource_id = kwargs['kusto_cluster_resource_id'] self.location = None self.provisioning_state = None @@ -2169,7 +2169,7 @@ def __init__( ): super(OperationList, self).__init__(**kwargs) self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.value = kwargs['value'] class OperationMetaLogSpecification(msrest.serialization.Model): @@ -2359,7 +2359,7 @@ class OperationResponse(msrest.serialization.Model): :param start_time: start time. :type start_time: ~datetime.datetime :param status: Required. Operation state of the long running operation. Possible values - include: 'Accepted', 'InProgress', 'TransientFailure', 'Succeeded', 'Failed', 'Canceled'. + include: "Accepted", "InProgress", "TransientFailure", "Succeeded", "Failed", "Canceled". :type status: str or ~data_share_management_client.models.Status """ @@ -2382,7 +2382,7 @@ def __init__( 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) + self.status = kwargs['status'] class ProviderShareSubscription(ProxyDto): @@ -2413,7 +2413,7 @@ class ProviderShareSubscription(ProxyDto): :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'. + include: "Active", "Revoked", "SourceDeleted", "Revoking". :vartype share_subscription_status: str or ~data_share_management_client.models.ShareSubscriptionStatus """ @@ -2490,7 +2490,7 @@ def __init__( ): super(ProviderShareSubscriptionList, self).__init__(**kwargs) self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.value = kwargs['value'] class SourceShareSynchronizationSetting(msrest.serialization.Model): @@ -2502,9 +2502,9 @@ class SourceShareSynchronizationSetting(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :param kind: Required. Kind of synchronization.Constant filled by server. Possible values - include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', - 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', - 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + include: "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", + "AdlsGen2File", "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", + "SqlDBTable", "SqlDWTable", "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind """ @@ -2534,11 +2534,11 @@ class ScheduledSourceSynchronizationSetting(SourceShareSynchronizationSetting): All required parameters must be populated in order to send to Azure. :param kind: Required. Kind of synchronization.Constant filled by server. Possible values - include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', - 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', - 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + include: "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", + "AdlsGen2File", "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", + "SqlDBTable", "SqlDWTable", "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind - :param recurrence_interval: Recurrence Interval. Possible values include: 'Hour', 'Day'. + :param recurrence_interval: Recurrence Interval. Possible values include: "Hour", "Day". :type recurrence_interval: str or ~data_share_management_client.models.RecurrenceInterval :param synchronization_time: Synchronization time. :type synchronization_time: ~datetime.datetime @@ -2581,9 +2581,9 @@ class SynchronizationSetting(ProxyDto): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of synchronization.Constant filled by server. Possible values - include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', - 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', - 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + include: "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", + "AdlsGen2File", "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", + "SqlDBTable", "SqlDWTable", "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind """ @@ -2627,17 +2627,17 @@ class ScheduledSynchronizationSetting(SynchronizationSetting): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of synchronization.Constant filled by server. Possible values - include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', - 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', - 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + include: "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", + "AdlsGen2File", "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", + "SqlDBTable", "SqlDWTable", "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :ivar created_at: Time at which the synchronization setting was created. :vartype created_at: ~datetime.datetime :ivar provisioning_state: Gets or sets the provisioning state. Possible values include: - 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + "Succeeded", "Creating", "Deleting", "Moving", "Failed". :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState - :param recurrence_interval: Required. Recurrence Interval. Possible values include: 'Hour', - 'Day'. + :param recurrence_interval: Required. Recurrence Interval. Possible values include: "Hour", + "Day". :type recurrence_interval: str or ~data_share_management_client.models.RecurrenceInterval :param synchronization_time: Required. Synchronization time. :type synchronization_time: ~datetime.datetime @@ -2677,8 +2677,8 @@ def __init__( self.kind = 'ScheduleBased' self.created_at = None self.provisioning_state = None - self.recurrence_interval = kwargs.get('recurrence_interval', None) - self.synchronization_time = kwargs.get('synchronization_time', None) + self.recurrence_interval = kwargs['recurrence_interval'] + self.synchronization_time = kwargs['synchronization_time'] self.user_name = None @@ -2699,9 +2699,9 @@ class Trigger(ProxyDto): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of synchronization.Constant filled by server. Possible values - include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', - 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', - 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + include: "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", + "AdlsGen2File", "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", + "SqlDBTable", "SqlDWTable", "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind """ @@ -2745,25 +2745,25 @@ class ScheduledTrigger(Trigger): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of synchronization.Constant filled by server. Possible values - include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', - 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', - 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + include: "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", + "AdlsGen2File", "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", + "SqlDBTable", "SqlDWTable", "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :ivar created_at: Time at which the trigger was created. :vartype created_at: ~datetime.datetime - :ivar provisioning_state: Gets the provisioning state. Possible values include: 'Succeeded', - 'Creating', 'Deleting', 'Moving', 'Failed'. + :ivar provisioning_state: Gets the provisioning state. Possible values include: "Succeeded", + "Creating", "Deleting", "Moving", "Failed". :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState - :param recurrence_interval: Required. Recurrence Interval. Possible values include: 'Hour', - 'Day'. + :param recurrence_interval: Required. Recurrence Interval. Possible values include: "Hour", + "Day". :type recurrence_interval: str or ~data_share_management_client.models.RecurrenceInterval - :param synchronization_mode: Synchronization mode. Possible values include: 'Incremental', - 'FullSync'. + :param synchronization_mode: Synchronization mode. Possible values include: "Incremental", + "FullSync". :type synchronization_mode: str or ~data_share_management_client.models.SynchronizationMode :param synchronization_time: Required. Synchronization time. :type synchronization_time: ~datetime.datetime - :ivar trigger_status: Gets the trigger state. Possible values include: 'Active', 'Inactive', - 'SourceSynchronizationSettingDeleted'. + :ivar trigger_status: Gets the trigger state. Possible values include: "Active", "Inactive", + "SourceSynchronizationSettingDeleted". :vartype trigger_status: str or ~data_share_management_client.models.TriggerStatus :ivar user_name: Name of the user who created the trigger. :vartype user_name: str @@ -2804,9 +2804,9 @@ def __init__( self.kind = 'ScheduleBased' self.created_at = None self.provisioning_state = None - self.recurrence_interval = kwargs.get('recurrence_interval', None) + self.recurrence_interval = kwargs['recurrence_interval'] self.synchronization_mode = kwargs.get('synchronization_mode', None) - self.synchronization_time = kwargs.get('synchronization_time', None) + self.synchronization_time = kwargs['synchronization_time'] self.trigger_status = None self.user_name = None @@ -2827,9 +2827,9 @@ class Share(ProxyDto): :param description: Share description. :type description: str :ivar provisioning_state: Gets or sets the provisioning state. Possible values include: - 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + "Succeeded", "Creating", "Deleting", "Moving", "Failed". :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState - :param share_kind: Share kind. Possible values include: 'CopyBased', 'InPlace'. + :param share_kind: Share kind. Possible values include: "CopyBased", "InPlace". :type share_kind: str or ~data_share_management_client.models.ShareKind :param terms: Share terms. :type terms: str @@ -2902,7 +2902,7 @@ def __init__( ): super(ShareList, self).__init__(**kwargs) self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.value = kwargs['value'] class ShareSubscription(ProxyDto): @@ -2929,16 +2929,16 @@ class ShareSubscription(ProxyDto): :ivar provider_tenant_name: Tenant name of the provider who created the resource. :vartype provider_tenant_name: str :ivar provisioning_state: Provisioning state of the share subscription. Possible values - include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + include: "Succeeded", "Creating", "Deleting", "Moving", "Failed". :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState :ivar share_description: Description of share. :vartype share_description: str - :ivar share_kind: Kind of share. Possible values include: 'CopyBased', 'InPlace'. + :ivar share_kind: Kind of share. Possible values include: "CopyBased", "InPlace". :vartype share_kind: str or ~data_share_management_client.models.ShareKind :ivar share_name: Name of the share. :vartype share_name: str :ivar share_subscription_status: Gets the current status of share subscription. Possible values - include: 'Active', 'Revoked', 'SourceDeleted', 'Revoking'. + include: "Active", "Revoked", "SourceDeleted", "Revoking". :vartype share_subscription_status: str or ~data_share_management_client.models.ShareSubscriptionStatus :ivar share_terms: Terms of a share. @@ -2997,7 +2997,7 @@ def __init__( ): super(ShareSubscription, self).__init__(**kwargs) self.created_at = None - self.invitation_id = kwargs.get('invitation_id', None) + self.invitation_id = kwargs['invitation_id'] self.provider_email = None self.provider_name = None self.provider_tenant_name = None @@ -3007,7 +3007,7 @@ def __init__( self.share_name = None self.share_subscription_status = None self.share_terms = None - self.source_share_location = kwargs.get('source_share_location', None) + self.source_share_location = kwargs['source_share_location'] self.user_email = None self.user_name = None @@ -3038,7 +3038,7 @@ def __init__( ): super(ShareSubscriptionList, self).__init__(**kwargs) self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.value = kwargs['value'] class ShareSubscriptionSynchronization(msrest.serialization.Model): @@ -3060,8 +3060,8 @@ class ShareSubscriptionSynchronization(msrest.serialization.Model): :vartype status: str :param synchronization_id: Required. Synchronization id. :type synchronization_id: str - :ivar synchronization_mode: Synchronization Mode. Possible values include: 'Incremental', - 'FullSync'. + :ivar synchronization_mode: Synchronization Mode. Possible values include: "Incremental", + "FullSync". :vartype synchronization_mode: str or ~data_share_management_client.models.SynchronizationMode """ @@ -3095,7 +3095,7 @@ def __init__( self.message = None self.start_time = None self.status = None - self.synchronization_id = kwargs.get('synchronization_id', None) + self.synchronization_id = kwargs['synchronization_id'] self.synchronization_mode = None @@ -3125,7 +3125,7 @@ def __init__( ): super(ShareSubscriptionSynchronizationList, self).__init__(**kwargs) self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.value = kwargs['value'] class ShareSynchronization(msrest.serialization.Model): @@ -3151,8 +3151,8 @@ class ShareSynchronization(msrest.serialization.Model): :type status: str :param synchronization_id: Synchronization id. :type synchronization_id: str - :ivar synchronization_mode: Synchronization mode. Possible values include: 'Incremental', - 'FullSync'. + :ivar synchronization_mode: Synchronization mode. Possible values include: "Incremental", + "FullSync". :vartype synchronization_mode: str or ~data_share_management_client.models.SynchronizationMode """ @@ -3216,7 +3216,7 @@ def __init__( ): super(ShareSynchronizationList, self).__init__(**kwargs) self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.value = kwargs['value'] class SourceShareSynchronizationSettingList(msrest.serialization.Model): @@ -3245,7 +3245,7 @@ def __init__( ): super(SourceShareSynchronizationSettingList, self).__init__(**kwargs) self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.value = kwargs['value'] class SqlDBTableDataSet(DataSet): @@ -3262,9 +3262,9 @@ class SqlDBTableDataSet(DataSet): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set.Constant filled by server. Possible values include: - 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', - 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', - 'ScheduleBased'. + "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", "AdlsGen2File", + "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", "SqlDBTable", "SqlDWTable", + "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :param database_name: Database name of the source data set. :type database_name: str @@ -3325,20 +3325,20 @@ class SqlDBTableDataSetMapping(DataSetMapping): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set mapping.Constant filled by server. Possible values - include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', - 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', - 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + include: "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", + "AdlsGen2File", "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", + "SqlDBTable", "SqlDWTable", "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :param database_name: Required. DatabaseName name of the sink data set. :type database_name: str :param data_set_id: Required. The id of the source data set. :type data_set_id: str :ivar data_set_mapping_status: Gets the status of the data set mapping. Possible values - include: 'Ok', 'Broken'. + include: "Ok", "Broken". :vartype data_set_mapping_status: str or ~data_share_management_client.models.DataSetMappingStatus :ivar provisioning_state: Provisioning state of the data set mapping. Possible values include: - 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + "Succeeded", "Creating", "Deleting", "Moving", "Failed". :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState :param schema_name: Required. Schema of the table. Default value is dbo. :type schema_name: str @@ -3382,16 +3382,16 @@ def __init__( ): super(SqlDBTableDataSetMapping, self).__init__(**kwargs) self.kind = 'SqlDBTable' - self.database_name = kwargs.get('database_name', None) - self.data_set_id = kwargs.get('data_set_id', None) + self.database_name = kwargs['database_name'] + self.data_set_id = kwargs['data_set_id'] self.data_set_mapping_status = None self.provisioning_state = None - self.schema_name = kwargs.get('schema_name', None) - self.sql_server_resource_id = kwargs.get('sql_server_resource_id', None) - self.table_name = kwargs.get('table_name', None) + self.schema_name = kwargs['schema_name'] + self.sql_server_resource_id = kwargs['sql_server_resource_id'] + self.table_name = kwargs['table_name'] -class SqlDwTableDataSet(DataSet): +class SqlDWTableDataSet(DataSet): """A SQL DW table data set. Variables are only populated by the server, and will be ignored when sending a request. @@ -3405,9 +3405,9 @@ class SqlDwTableDataSet(DataSet): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set.Constant filled by server. Possible values include: - 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', - 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', - 'ScheduleBased'. + "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", "AdlsGen2File", + "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", "SqlDBTable", "SqlDWTable", + "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :ivar data_set_id: Unique id for identifying a data set resource. :vartype data_set_id: str @@ -3445,7 +3445,7 @@ def __init__( self, **kwargs ): - super(SqlDwTableDataSet, self).__init__(**kwargs) + super(SqlDWTableDataSet, self).__init__(**kwargs) self.kind = 'SqlDWTable' self.data_set_id = None self.data_warehouse_name = kwargs.get('data_warehouse_name', None) @@ -3454,7 +3454,7 @@ def __init__( self.table_name = kwargs.get('table_name', None) -class SqlDwTableDataSetMapping(DataSetMapping): +class SqlDWTableDataSetMapping(DataSetMapping): """A SQL DW Table data set mapping. Variables are only populated by the server, and will be ignored when sending a request. @@ -3468,20 +3468,20 @@ class SqlDwTableDataSetMapping(DataSetMapping): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set mapping.Constant filled by server. Possible values - include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', - 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', - 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + include: "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", + "AdlsGen2File", "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", + "SqlDBTable", "SqlDWTable", "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :param data_set_id: Required. The id of the source data set. :type data_set_id: str :ivar data_set_mapping_status: Gets the status of the data set mapping. Possible values - include: 'Ok', 'Broken'. + include: "Ok", "Broken". :vartype data_set_mapping_status: str or ~data_share_management_client.models.DataSetMappingStatus :param data_warehouse_name: Required. DataWarehouse name of the source data set. :type data_warehouse_name: str :ivar provisioning_state: Provisioning state of the data set mapping. Possible values include: - 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + "Succeeded", "Creating", "Deleting", "Moving", "Failed". :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState :param schema_name: Required. Schema of the table. Default value is dbo. :type schema_name: str @@ -3523,15 +3523,15 @@ def __init__( self, **kwargs ): - super(SqlDwTableDataSetMapping, self).__init__(**kwargs) + super(SqlDWTableDataSetMapping, self).__init__(**kwargs) self.kind = 'SqlDWTable' - self.data_set_id = kwargs.get('data_set_id', None) + self.data_set_id = kwargs['data_set_id'] self.data_set_mapping_status = None - self.data_warehouse_name = kwargs.get('data_warehouse_name', None) + self.data_warehouse_name = kwargs['data_warehouse_name'] self.provisioning_state = None - self.schema_name = kwargs.get('schema_name', None) - self.sql_server_resource_id = kwargs.get('sql_server_resource_id', None) - self.table_name = kwargs.get('table_name', None) + self.schema_name = kwargs['schema_name'] + self.sql_server_resource_id = kwargs['sql_server_resource_id'] + self.table_name = kwargs['table_name'] class SynchronizationDetails(msrest.serialization.Model): @@ -3541,9 +3541,9 @@ class SynchronizationDetails(msrest.serialization.Model): :ivar data_set_id: Id of data set. :vartype data_set_id: str - :ivar data_set_type: Type of the data set. Possible values include: 'Blob', 'Container', - 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', 'AdlsGen1Folder', - 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable'. + :ivar data_set_type: Type of the data set. Possible values include: "Blob", "Container", + "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", "AdlsGen2File", "AdlsGen1Folder", + "AdlsGen1File", "KustoCluster", "KustoDatabase", "SqlDBTable", "SqlDWTable". :vartype data_set_type: str or ~data_share_management_client.models.DataSetType :ivar duration_ms: Duration of data set level copy. :vartype duration_ms: int @@ -3657,7 +3657,7 @@ def __init__( ): super(SynchronizationDetailsList, self).__init__(**kwargs) self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.value = kwargs['value'] class SynchronizationSettingList(msrest.serialization.Model): @@ -3686,14 +3686,14 @@ def __init__( ): super(SynchronizationSettingList, self).__init__(**kwargs) self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.value = kwargs['value'] class Synchronize(msrest.serialization.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'. + Incremental by default. Possible values include: "Incremental", "FullSync". :type synchronization_mode: str or ~data_share_management_client.models.SynchronizationMode """ @@ -3735,4 +3735,4 @@ def __init__( ): super(TriggerList, self).__init__(**kwargs) self.next_link = kwargs.get('next_link', None) - self.value = kwargs.get('value', None) + self.value = kwargs['value'] diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/models/_models_py3.py b/src/datashare/azext_datashare/vendored_sdks/datashare/models/_models_py3.py index bc585b353f..de646aaac5 100644 --- a/src/datashare/azext_datashare/vendored_sdks/datashare/models/_models_py3.py +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/models/_models_py3.py @@ -12,6 +12,8 @@ from azure.core.exceptions import HttpResponseError import msrest.serialization +from ._data_share_management_client_enums import * + class DefaultDto(msrest.serialization.Model): """Base data transfer object implementation for default resources. @@ -81,7 +83,7 @@ class Account(DefaultDto): :ivar created_at: Time at which the account was created. :vartype created_at: ~datetime.datetime :ivar provisioning_state: Provisioning state of the Account. Possible values include: - 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + "Succeeded", "Creating", "Deleting", "Moving", "Failed". :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState :ivar user_email: Email of the user who created the resource. :vartype user_email: str @@ -221,7 +223,7 @@ 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: AdlsGen1FileDataSet, AdlsGen1FolderDataSet, AdlsGen2FileDataSet, AdlsGen2FileSystemDataSet, AdlsGen2FolderDataSet, BlobDataSet, BlobFolderDataSet, BlobContainerDataSet, KustoClusterDataSet, KustoDatabaseDataSet, SqlDBTableDataSet, SqlDwTableDataSet. + sub-classes are: ADLSGen1FileDataSet, ADLSGen1FolderDataSet, ADLSGen2FileDataSet, ADLSGen2FileSystemDataSet, ADLSGen2FolderDataSet, BlobDataSet, BlobFolderDataSet, BlobContainerDataSet, KustoClusterDataSet, KustoDatabaseDataSet, SqlDBTableDataSet, SqlDWTableDataSet. Variables are only populated by the server, and will be ignored when sending a request. @@ -234,9 +236,9 @@ class DataSet(ProxyDto): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set.Constant filled by server. Possible values include: - 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', - 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', - 'ScheduleBased'. + "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", "AdlsGen2File", + "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", "SqlDBTable", "SqlDWTable", + "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind """ @@ -255,7 +257,7 @@ class DataSet(ProxyDto): } _subtype_map = { - 'kind': {'AdlsGen1File': 'AdlsGen1FileDataSet', 'AdlsGen1Folder': 'AdlsGen1FolderDataSet', 'AdlsGen2File': 'AdlsGen2FileDataSet', 'AdlsGen2FileSystem': 'AdlsGen2FileSystemDataSet', 'AdlsGen2Folder': 'AdlsGen2FolderDataSet', 'Blob': 'BlobDataSet', 'BlobFolder': 'BlobFolderDataSet', 'Container': 'BlobContainerDataSet', 'KustoCluster': 'KustoClusterDataSet', 'KustoDatabase': 'KustoDatabaseDataSet', 'SqlDBTable': 'SqlDBTableDataSet', 'SqlDWTable': 'SqlDwTableDataSet'} + 'kind': {'AdlsGen1File': 'ADLSGen1FileDataSet', 'AdlsGen1Folder': 'ADLSGen1FolderDataSet', 'AdlsGen2File': 'ADLSGen2FileDataSet', 'AdlsGen2FileSystem': 'ADLSGen2FileSystemDataSet', 'AdlsGen2Folder': 'ADLSGen2FolderDataSet', 'Blob': 'BlobDataSet', 'BlobFolder': 'BlobFolderDataSet', 'Container': 'BlobContainerDataSet', 'KustoCluster': 'KustoClusterDataSet', 'KustoDatabase': 'KustoDatabaseDataSet', 'SqlDBTable': 'SqlDBTableDataSet', 'SqlDWTable': 'SqlDWTableDataSet'} } def __init__( @@ -263,10 +265,10 @@ def __init__( **kwargs ): super(DataSet, self).__init__(**kwargs) - self.kind = 'DataSet' + self.kind: str = 'DataSet' -class AdlsGen1FileDataSet(DataSet): +class ADLSGen1FileDataSet(DataSet): """An ADLS Gen 1 file data set. Variables are only populated by the server, and will be ignored when sending a request. @@ -280,9 +282,9 @@ class AdlsGen1FileDataSet(DataSet): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set.Constant filled by server. Possible values include: - 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', - 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', - 'ScheduleBased'. + "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", "AdlsGen2File", + "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", "SqlDBTable", "SqlDWTable", + "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :param account_name: Required. The ADLS account name. :type account_name: str @@ -334,8 +336,8 @@ def __init__( subscription_id: str, **kwargs ): - super(AdlsGen1FileDataSet, self).__init__(**kwargs) - self.kind = 'AdlsGen1File' + super(ADLSGen1FileDataSet, self).__init__(**kwargs) + self.kind: str = 'AdlsGen1File' self.account_name = account_name self.data_set_id = None self.file_name = file_name @@ -344,7 +346,7 @@ def __init__( self.subscription_id = subscription_id -class AdlsGen1FolderDataSet(DataSet): +class ADLSGen1FolderDataSet(DataSet): """An ADLS Gen 1 folder data set. Variables are only populated by the server, and will be ignored when sending a request. @@ -358,9 +360,9 @@ class AdlsGen1FolderDataSet(DataSet): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set.Constant filled by server. Possible values include: - 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', - 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', - 'ScheduleBased'. + "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", "AdlsGen2File", + "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", "SqlDBTable", "SqlDWTable", + "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :param account_name: Required. The ADLS account name. :type account_name: str @@ -407,8 +409,8 @@ def __init__( subscription_id: str, **kwargs ): - super(AdlsGen1FolderDataSet, self).__init__(**kwargs) - self.kind = 'AdlsGen1Folder' + super(ADLSGen1FolderDataSet, self).__init__(**kwargs) + self.kind: str = 'AdlsGen1Folder' self.account_name = account_name self.data_set_id = None self.folder_path = folder_path @@ -416,7 +418,7 @@ def __init__( self.subscription_id = subscription_id -class AdlsGen2FileDataSet(DataSet): +class ADLSGen2FileDataSet(DataSet): """An ADLS Gen 2 file data set. Variables are only populated by the server, and will be ignored when sending a request. @@ -430,9 +432,9 @@ class AdlsGen2FileDataSet(DataSet): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set.Constant filled by server. Possible values include: - 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', - 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', - 'ScheduleBased'. + "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", "AdlsGen2File", + "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", "SqlDBTable", "SqlDWTable", + "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :ivar data_set_id: Unique id for identifying a data set resource. :vartype data_set_id: str @@ -484,8 +486,8 @@ def __init__( subscription_id: str, **kwargs ): - super(AdlsGen2FileDataSet, self).__init__(**kwargs) - self.kind = 'AdlsGen2File' + super(ADLSGen2FileDataSet, self).__init__(**kwargs) + self.kind: str = 'AdlsGen2File' self.data_set_id = None self.file_path = file_path self.file_system = file_system @@ -498,7 +500,7 @@ class DataSetMapping(ProxyDto): """A data set mapping data transfer object. You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AdlsGen2FileDataSetMapping, AdlsGen2FileSystemDataSetMapping, AdlsGen2FolderDataSetMapping, BlobDataSetMapping, BlobFolderDataSetMapping, BlobContainerDataSetMapping, KustoClusterDataSetMapping, KustoDatabaseDataSetMapping, SqlDBTableDataSetMapping, SqlDwTableDataSetMapping. + sub-classes are: ADLSGen2FileDataSetMapping, ADLSGen2FileSystemDataSetMapping, ADLSGen2FolderDataSetMapping, BlobDataSetMapping, BlobFolderDataSetMapping, BlobContainerDataSetMapping, KustoClusterDataSetMapping, KustoDatabaseDataSetMapping, SqlDBTableDataSetMapping, SqlDWTableDataSetMapping. Variables are only populated by the server, and will be ignored when sending a request. @@ -511,9 +513,9 @@ class DataSetMapping(ProxyDto): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set mapping.Constant filled by server. Possible values - include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', - 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', - 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + include: "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", + "AdlsGen2File", "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", + "SqlDBTable", "SqlDWTable", "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind """ @@ -532,7 +534,7 @@ class DataSetMapping(ProxyDto): } _subtype_map = { - 'kind': {'AdlsGen2File': 'AdlsGen2FileDataSetMapping', 'AdlsGen2FileSystem': 'AdlsGen2FileSystemDataSetMapping', 'AdlsGen2Folder': 'AdlsGen2FolderDataSetMapping', 'Blob': 'BlobDataSetMapping', 'BlobFolder': 'BlobFolderDataSetMapping', 'Container': 'BlobContainerDataSetMapping', 'KustoCluster': 'KustoClusterDataSetMapping', 'KustoDatabase': 'KustoDatabaseDataSetMapping', 'SqlDBTable': 'SqlDBTableDataSetMapping', 'SqlDWTable': 'SqlDwTableDataSetMapping'} + 'kind': {'AdlsGen2File': 'ADLSGen2FileDataSetMapping', 'AdlsGen2FileSystem': 'ADLSGen2FileSystemDataSetMapping', 'AdlsGen2Folder': 'ADLSGen2FolderDataSetMapping', 'Blob': 'BlobDataSetMapping', 'BlobFolder': 'BlobFolderDataSetMapping', 'Container': 'BlobContainerDataSetMapping', 'KustoCluster': 'KustoClusterDataSetMapping', 'KustoDatabase': 'KustoDatabaseDataSetMapping', 'SqlDBTable': 'SqlDBTableDataSetMapping', 'SqlDWTable': 'SqlDWTableDataSetMapping'} } def __init__( @@ -540,10 +542,10 @@ def __init__( **kwargs ): super(DataSetMapping, self).__init__(**kwargs) - self.kind = 'DataSetMapping' + self.kind: str = 'DataSetMapping' -class AdlsGen2FileDataSetMapping(DataSetMapping): +class ADLSGen2FileDataSetMapping(DataSetMapping): """An ADLS Gen2 file data set mapping. Variables are only populated by the server, and will be ignored when sending a request. @@ -557,24 +559,24 @@ class AdlsGen2FileDataSetMapping(DataSetMapping): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set mapping.Constant filled by server. Possible values - include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', - 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', - 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + include: "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", + "AdlsGen2File", "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", + "SqlDBTable", "SqlDWTable", "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :param data_set_id: Required. The id of the source data set. :type data_set_id: str :ivar data_set_mapping_status: Gets the status of the data set mapping. Possible values - include: 'Ok', 'Broken'. + include: "Ok", "Broken". :vartype data_set_mapping_status: str or ~data_share_management_client.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'. + :param output_type: Type of output file. Possible values include: "Csv", "Parquet". :type output_type: str or ~data_share_management_client.models.OutputType :ivar provisioning_state: Provisioning state of the data set mapping. Possible values include: - 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + "Succeeded", "Creating", "Deleting", "Moving", "Failed". :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState :param resource_group: Required. Resource group of storage account. :type resource_group: str @@ -627,8 +629,8 @@ def __init__( output_type: Optional[Union[str, "OutputType"]] = None, **kwargs ): - super(AdlsGen2FileDataSetMapping, self).__init__(**kwargs) - self.kind = 'AdlsGen2File' + super(ADLSGen2FileDataSetMapping, self).__init__(**kwargs) + self.kind: str = 'AdlsGen2File' self.data_set_id = data_set_id self.data_set_mapping_status = None self.file_path = file_path @@ -640,7 +642,7 @@ def __init__( self.subscription_id = subscription_id -class AdlsGen2FileSystemDataSet(DataSet): +class ADLSGen2FileSystemDataSet(DataSet): """An ADLS Gen 2 file system data set. Variables are only populated by the server, and will be ignored when sending a request. @@ -654,9 +656,9 @@ class AdlsGen2FileSystemDataSet(DataSet): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set.Constant filled by server. Possible values include: - 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', - 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', - 'ScheduleBased'. + "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", "AdlsGen2File", + "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", "SqlDBTable", "SqlDWTable", + "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :ivar data_set_id: Unique id for identifying a data set resource. :vartype data_set_id: str @@ -703,8 +705,8 @@ def __init__( subscription_id: str, **kwargs ): - super(AdlsGen2FileSystemDataSet, self).__init__(**kwargs) - self.kind = 'AdlsGen2FileSystem' + super(ADLSGen2FileSystemDataSet, self).__init__(**kwargs) + self.kind: str = 'AdlsGen2FileSystem' self.data_set_id = None self.file_system = file_system self.resource_group = resource_group @@ -712,7 +714,7 @@ def __init__( self.subscription_id = subscription_id -class AdlsGen2FileSystemDataSetMapping(DataSetMapping): +class ADLSGen2FileSystemDataSetMapping(DataSetMapping): """An ADLS Gen2 file system data set mapping. Variables are only populated by the server, and will be ignored when sending a request. @@ -726,20 +728,20 @@ class AdlsGen2FileSystemDataSetMapping(DataSetMapping): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set mapping.Constant filled by server. Possible values - include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', - 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', - 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + include: "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", + "AdlsGen2File", "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", + "SqlDBTable", "SqlDWTable", "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :param data_set_id: Required. The id of the source data set. :type data_set_id: str :ivar data_set_mapping_status: Gets the status of the data set mapping. Possible values - include: 'Ok', 'Broken'. + include: "Ok", "Broken". :vartype data_set_mapping_status: str or ~data_share_management_client.models.DataSetMappingStatus :param file_system: Required. The file system name. :type file_system: str :ivar provisioning_state: Provisioning state of the data set mapping. Possible values include: - 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + "Succeeded", "Creating", "Deleting", "Moving", "Failed". :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState :param resource_group: Required. Resource group of storage account. :type resource_group: str @@ -787,8 +789,8 @@ def __init__( subscription_id: str, **kwargs ): - super(AdlsGen2FileSystemDataSetMapping, self).__init__(**kwargs) - self.kind = 'AdlsGen2FileSystem' + super(ADLSGen2FileSystemDataSetMapping, self).__init__(**kwargs) + self.kind: str = 'AdlsGen2FileSystem' self.data_set_id = data_set_id self.data_set_mapping_status = None self.file_system = file_system @@ -798,7 +800,7 @@ def __init__( self.subscription_id = subscription_id -class AdlsGen2FolderDataSet(DataSet): +class ADLSGen2FolderDataSet(DataSet): """An ADLS Gen 2 folder data set. Variables are only populated by the server, and will be ignored when sending a request. @@ -812,9 +814,9 @@ class AdlsGen2FolderDataSet(DataSet): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set.Constant filled by server. Possible values include: - 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', - 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', - 'ScheduleBased'. + "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", "AdlsGen2File", + "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", "SqlDBTable", "SqlDWTable", + "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :ivar data_set_id: Unique id for identifying a data set resource. :vartype data_set_id: str @@ -866,8 +868,8 @@ def __init__( subscription_id: str, **kwargs ): - super(AdlsGen2FolderDataSet, self).__init__(**kwargs) - self.kind = 'AdlsGen2Folder' + super(ADLSGen2FolderDataSet, self).__init__(**kwargs) + self.kind: str = 'AdlsGen2Folder' self.data_set_id = None self.file_system = file_system self.folder_path = folder_path @@ -876,7 +878,7 @@ def __init__( self.subscription_id = subscription_id -class AdlsGen2FolderDataSetMapping(DataSetMapping): +class ADLSGen2FolderDataSetMapping(DataSetMapping): """An ADLS Gen2 folder data set mapping. Variables are only populated by the server, and will be ignored when sending a request. @@ -890,14 +892,14 @@ class AdlsGen2FolderDataSetMapping(DataSetMapping): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set mapping.Constant filled by server. Possible values - include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', - 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', - 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + include: "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", + "AdlsGen2File", "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", + "SqlDBTable", "SqlDWTable", "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :param data_set_id: Required. The id of the source data set. :type data_set_id: str :ivar data_set_mapping_status: Gets the status of the data set mapping. Possible values - include: 'Ok', 'Broken'. + include: "Ok", "Broken". :vartype data_set_mapping_status: str or ~data_share_management_client.models.DataSetMappingStatus :param file_system: Required. File system to which the folder belongs. @@ -905,7 +907,7 @@ class AdlsGen2FolderDataSetMapping(DataSetMapping): :param folder_path: Required. Folder path within the file system. :type folder_path: str :ivar provisioning_state: Provisioning state of the data set mapping. Possible values include: - 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + "Succeeded", "Creating", "Deleting", "Moving", "Failed". :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState :param resource_group: Required. Resource group of storage account. :type resource_group: str @@ -956,8 +958,8 @@ def __init__( subscription_id: str, **kwargs ): - super(AdlsGen2FolderDataSetMapping, self).__init__(**kwargs) - self.kind = 'AdlsGen2Folder' + super(ADLSGen2FolderDataSetMapping, self).__init__(**kwargs) + self.kind: str = 'AdlsGen2Folder' self.data_set_id = data_set_id self.data_set_mapping_status = None self.file_system = file_system @@ -982,9 +984,9 @@ class BlobContainerDataSet(DataSet): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set.Constant filled by server. Possible values include: - 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', - 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', - 'ScheduleBased'. + "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", "AdlsGen2File", + "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", "SqlDBTable", "SqlDWTable", + "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :param container_name: Required. BLOB Container name. :type container_name: str @@ -1032,7 +1034,7 @@ def __init__( **kwargs ): super(BlobContainerDataSet, self).__init__(**kwargs) - self.kind = 'Container' + self.kind: str = 'Container' self.container_name = container_name self.data_set_id = None self.resource_group = resource_group @@ -1054,20 +1056,20 @@ class BlobContainerDataSetMapping(DataSetMapping): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set mapping.Constant filled by server. Possible values - include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', - 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', - 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + include: "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", + "AdlsGen2File", "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", + "SqlDBTable", "SqlDWTable", "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :param container_name: Required. BLOB Container name. :type container_name: str :param data_set_id: Required. The id of the source data set. :type data_set_id: str :ivar data_set_mapping_status: Gets the status of the data set mapping. Possible values - include: 'Ok', 'Broken'. + include: "Ok", "Broken". :vartype data_set_mapping_status: str or ~data_share_management_client.models.DataSetMappingStatus :ivar provisioning_state: Provisioning state of the data set mapping. Possible values include: - 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + "Succeeded", "Creating", "Deleting", "Moving", "Failed". :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState :param resource_group: Required. Resource group of storage account. :type resource_group: str @@ -1116,7 +1118,7 @@ def __init__( **kwargs ): super(BlobContainerDataSetMapping, self).__init__(**kwargs) - self.kind = 'Container' + self.kind: str = 'Container' self.container_name = container_name self.data_set_id = data_set_id self.data_set_mapping_status = None @@ -1140,9 +1142,9 @@ class BlobDataSet(DataSet): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set.Constant filled by server. Possible values include: - 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', - 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', - 'ScheduleBased'. + "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", "AdlsGen2File", + "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", "SqlDBTable", "SqlDWTable", + "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :param container_name: Required. Container that has the file path. :type container_name: str @@ -1195,7 +1197,7 @@ def __init__( **kwargs ): super(BlobDataSet, self).__init__(**kwargs) - self.kind = 'Blob' + self.kind: str = 'Blob' self.container_name = container_name self.data_set_id = None self.file_path = file_path @@ -1218,24 +1220,24 @@ class BlobDataSetMapping(DataSetMapping): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set mapping.Constant filled by server. Possible values - include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', - 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', - 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + include: "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", + "AdlsGen2File", "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", + "SqlDBTable", "SqlDWTable", "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :param container_name: Required. Container that has the file path. :type container_name: str :param data_set_id: Required. The id of the source data set. :type data_set_id: str :ivar data_set_mapping_status: Gets the status of the data set mapping. Possible values - include: 'Ok', 'Broken'. + include: "Ok", "Broken". :vartype data_set_mapping_status: str or ~data_share_management_client.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'. + :param output_type: File output type. Possible values include: "Csv", "Parquet". :type output_type: str or ~data_share_management_client.models.OutputType :ivar provisioning_state: Provisioning state of the data set mapping. Possible values include: - 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + "Succeeded", "Creating", "Deleting", "Moving", "Failed". :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState :param resource_group: Required. Resource group of storage account. :type resource_group: str @@ -1289,7 +1291,7 @@ def __init__( **kwargs ): super(BlobDataSetMapping, self).__init__(**kwargs) - self.kind = 'Blob' + self.kind: str = 'Blob' self.container_name = container_name self.data_set_id = data_set_id self.data_set_mapping_status = None @@ -1315,9 +1317,9 @@ class BlobFolderDataSet(DataSet): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set.Constant filled by server. Possible values include: - 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', - 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', - 'ScheduleBased'. + "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", "AdlsGen2File", + "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", "SqlDBTable", "SqlDWTable", + "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :param container_name: Required. Container that has the file path. :type container_name: str @@ -1370,7 +1372,7 @@ def __init__( **kwargs ): super(BlobFolderDataSet, self).__init__(**kwargs) - self.kind = 'BlobFolder' + self.kind: str = 'BlobFolder' self.container_name = container_name self.data_set_id = None self.prefix = prefix @@ -1393,22 +1395,22 @@ class BlobFolderDataSetMapping(DataSetMapping): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set mapping.Constant filled by server. Possible values - include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', - 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', - 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + include: "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", + "AdlsGen2File", "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", + "SqlDBTable", "SqlDWTable", "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :param container_name: Required. Container that has the file path. :type container_name: str :param data_set_id: Required. The id of the source data set. :type data_set_id: str :ivar data_set_mapping_status: Gets the status of the data set mapping. Possible values - include: 'Ok', 'Broken'. + include: "Ok", "Broken". :vartype data_set_mapping_status: str or ~data_share_management_client.models.DataSetMappingStatus :param prefix: Required. Prefix for blob folder. :type prefix: str :ivar provisioning_state: Provisioning state of the data set mapping. Possible values include: - 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + "Succeeded", "Creating", "Deleting", "Moving", "Failed". :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState :param resource_group: Required. Resource group of storage account. :type resource_group: str @@ -1460,7 +1462,7 @@ def __init__( **kwargs ): super(BlobFolderDataSetMapping, self).__init__(**kwargs) - self.kind = 'BlobFolder' + self.kind: str = 'BlobFolder' self.container_name = container_name self.data_set_id = data_set_id self.data_set_mapping_status = None @@ -1490,8 +1492,8 @@ class ConsumerInvitation(ProxyDto): :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'. + :ivar invitation_status: The status of the invitation. Possible values include: "Pending", + "Accepted", "Rejected", "Withdrawn". :vartype invitation_status: str or ~data_share_management_client.models.InvitationStatus :ivar location: invitation location. :vartype location: str @@ -1629,9 +1631,9 @@ class ConsumerSourceDataSet(ProxyDto): :vartype data_set_name: str :ivar data_set_path: DataSet path. :vartype data_set_path: str - :ivar data_set_type: Type of data set. Possible values include: 'Blob', 'Container', - 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', 'AdlsGen1Folder', - 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable'. + :ivar data_set_type: Type of data set. Possible values include: "Blob", "Container", + "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", "AdlsGen2File", "AdlsGen1Folder", + "AdlsGen1File", "KustoCluster", "KustoDatabase", "SqlDBTable", "SqlDWTable". :vartype data_set_type: str or ~data_share_management_client.models.DataSetType """ @@ -1910,8 +1912,8 @@ class Invitation(ProxyDto): :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'. + :ivar invitation_status: The status of the invitation. Possible values include: "Pending", + "Accepted", "Rejected", "Withdrawn". :vartype invitation_status: str or ~data_share_management_client.models.InvitationStatus :ivar responded_at: The time the recipient responded to the invitation. :vartype responded_at: ~datetime.datetime @@ -2024,9 +2026,9 @@ class KustoClusterDataSet(DataSet): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set.Constant filled by server. Possible values include: - 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', - 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', - 'ScheduleBased'. + "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", "AdlsGen2File", + "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", "SqlDBTable", "SqlDWTable", + "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :ivar data_set_id: Unique id for identifying a data set resource. :vartype data_set_id: str @@ -2035,7 +2037,7 @@ class KustoClusterDataSet(DataSet): :ivar location: Location of the kusto cluster. :vartype location: str :ivar provisioning_state: Provisioning state of the kusto cluster data set. Possible values - include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + include: "Succeeded", "Creating", "Deleting", "Moving", "Failed". :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState """ @@ -2068,7 +2070,7 @@ def __init__( **kwargs ): super(KustoClusterDataSet, self).__init__(**kwargs) - self.kind = 'KustoCluster' + self.kind: str = 'KustoCluster' self.data_set_id = None self.kusto_cluster_resource_id = kusto_cluster_resource_id self.location = None @@ -2089,14 +2091,14 @@ class KustoClusterDataSetMapping(DataSetMapping): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set mapping.Constant filled by server. Possible values - include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', - 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', - 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + include: "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", + "AdlsGen2File", "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", + "SqlDBTable", "SqlDWTable", "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :param data_set_id: Required. The id of the source data set. :type data_set_id: str :ivar data_set_mapping_status: Gets the status of the data set mapping. Possible values - include: 'Ok', 'Broken'. + include: "Ok", "Broken". :vartype data_set_mapping_status: str or ~data_share_management_client.models.DataSetMappingStatus :param kusto_cluster_resource_id: Required. Resource id of the sink kusto cluster. @@ -2104,7 +2106,7 @@ class KustoClusterDataSetMapping(DataSetMapping): :ivar location: Location of the sink kusto cluster. :vartype location: str :ivar provisioning_state: Provisioning state of the data set mapping. Possible values include: - 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + "Succeeded", "Creating", "Deleting", "Moving", "Failed". :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState """ @@ -2140,7 +2142,7 @@ def __init__( **kwargs ): super(KustoClusterDataSetMapping, self).__init__(**kwargs) - self.kind = 'KustoCluster' + self.kind: str = 'KustoCluster' self.data_set_id = data_set_id self.data_set_mapping_status = None self.kusto_cluster_resource_id = kusto_cluster_resource_id @@ -2162,9 +2164,9 @@ class KustoDatabaseDataSet(DataSet): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set.Constant filled by server. Possible values include: - 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', - 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', - 'ScheduleBased'. + "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", "AdlsGen2File", + "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", "SqlDBTable", "SqlDWTable", + "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :ivar data_set_id: Unique id for identifying a data set resource. :vartype data_set_id: str @@ -2173,7 +2175,7 @@ class KustoDatabaseDataSet(DataSet): :ivar location: Location of the kusto cluster. :vartype location: str :ivar provisioning_state: Provisioning state of the kusto database data set. Possible values - include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + include: "Succeeded", "Creating", "Deleting", "Moving", "Failed". :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState """ @@ -2206,7 +2208,7 @@ def __init__( **kwargs ): super(KustoDatabaseDataSet, self).__init__(**kwargs) - self.kind = 'KustoDatabase' + self.kind: str = 'KustoDatabase' self.data_set_id = None self.kusto_database_resource_id = kusto_database_resource_id self.location = None @@ -2227,14 +2229,14 @@ class KustoDatabaseDataSetMapping(DataSetMapping): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set mapping.Constant filled by server. Possible values - include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', - 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', - 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + include: "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", + "AdlsGen2File", "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", + "SqlDBTable", "SqlDWTable", "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :param data_set_id: Required. The id of the source data set. :type data_set_id: str :ivar data_set_mapping_status: Gets the status of the data set mapping. Possible values - include: 'Ok', 'Broken'. + include: "Ok", "Broken". :vartype data_set_mapping_status: str or ~data_share_management_client.models.DataSetMappingStatus :param kusto_cluster_resource_id: Required. Resource id of the sink kusto cluster. @@ -2242,7 +2244,7 @@ class KustoDatabaseDataSetMapping(DataSetMapping): :ivar location: Location of the sink kusto cluster. :vartype location: str :ivar provisioning_state: Provisioning state of the data set mapping. Possible values include: - 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + "Succeeded", "Creating", "Deleting", "Moving", "Failed". :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState """ @@ -2278,7 +2280,7 @@ def __init__( **kwargs ): super(KustoDatabaseDataSetMapping, self).__init__(**kwargs) - self.kind = 'KustoDatabase' + self.kind: str = 'KustoDatabase' self.data_set_id = data_set_id self.data_set_mapping_status = None self.kusto_cluster_resource_id = kusto_cluster_resource_id @@ -2534,7 +2536,7 @@ class OperationResponse(msrest.serialization.Model): :param start_time: start time. :type start_time: ~datetime.datetime :param status: Required. Operation state of the long running operation. Possible values - include: 'Accepted', 'InProgress', 'TransientFailure', 'Succeeded', 'Failed', 'Canceled'. + include: "Accepted", "InProgress", "TransientFailure", "Succeeded", "Failed", "Canceled". :type status: str or ~data_share_management_client.models.Status """ @@ -2593,7 +2595,7 @@ class ProviderShareSubscription(ProxyDto): :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'. + include: "Active", "Revoked", "SourceDeleted", "Revoking". :vartype share_subscription_status: str or ~data_share_management_client.models.ShareSubscriptionStatus """ @@ -2685,9 +2687,9 @@ class SourceShareSynchronizationSetting(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :param kind: Required. Kind of synchronization.Constant filled by server. Possible values - include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', - 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', - 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + include: "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", + "AdlsGen2File", "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", + "SqlDBTable", "SqlDWTable", "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind """ @@ -2708,7 +2710,7 @@ def __init__( **kwargs ): super(SourceShareSynchronizationSetting, self).__init__(**kwargs) - self.kind = None + self.kind: Optional[str] = None class ScheduledSourceSynchronizationSetting(SourceShareSynchronizationSetting): @@ -2717,11 +2719,11 @@ class ScheduledSourceSynchronizationSetting(SourceShareSynchronizationSetting): All required parameters must be populated in order to send to Azure. :param kind: Required. Kind of synchronization.Constant filled by server. Possible values - include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', - 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', - 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + include: "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", + "AdlsGen2File", "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", + "SqlDBTable", "SqlDWTable", "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind - :param recurrence_interval: Recurrence Interval. Possible values include: 'Hour', 'Day'. + :param recurrence_interval: Recurrence Interval. Possible values include: "Hour", "Day". :type recurrence_interval: str or ~data_share_management_client.models.RecurrenceInterval :param synchronization_time: Synchronization time. :type synchronization_time: ~datetime.datetime @@ -2745,7 +2747,7 @@ def __init__( **kwargs ): super(ScheduledSourceSynchronizationSetting, self).__init__(**kwargs) - self.kind = 'ScheduleBased' + self.kind: str = 'ScheduleBased' self.recurrence_interval = recurrence_interval self.synchronization_time = synchronization_time @@ -2767,9 +2769,9 @@ class SynchronizationSetting(ProxyDto): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of synchronization.Constant filled by server. Possible values - include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', - 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', - 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + include: "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", + "AdlsGen2File", "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", + "SqlDBTable", "SqlDWTable", "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind """ @@ -2796,7 +2798,7 @@ def __init__( **kwargs ): super(SynchronizationSetting, self).__init__(**kwargs) - self.kind = 'SynchronizationSetting' + self.kind: str = 'SynchronizationSetting' class ScheduledSynchronizationSetting(SynchronizationSetting): @@ -2813,17 +2815,17 @@ class ScheduledSynchronizationSetting(SynchronizationSetting): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of synchronization.Constant filled by server. Possible values - include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', - 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', - 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + include: "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", + "AdlsGen2File", "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", + "SqlDBTable", "SqlDWTable", "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :ivar created_at: Time at which the synchronization setting was created. :vartype created_at: ~datetime.datetime :ivar provisioning_state: Gets or sets the provisioning state. Possible values include: - 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + "Succeeded", "Creating", "Deleting", "Moving", "Failed". :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState - :param recurrence_interval: Required. Recurrence Interval. Possible values include: 'Hour', - 'Day'. + :param recurrence_interval: Required. Recurrence Interval. Possible values include: "Hour", + "Day". :type recurrence_interval: str or ~data_share_management_client.models.RecurrenceInterval :param synchronization_time: Required. Synchronization time. :type synchronization_time: ~datetime.datetime @@ -2863,7 +2865,7 @@ def __init__( **kwargs ): super(ScheduledSynchronizationSetting, self).__init__(**kwargs) - self.kind = 'ScheduleBased' + self.kind: str = 'ScheduleBased' self.created_at = None self.provisioning_state = None self.recurrence_interval = recurrence_interval @@ -2888,9 +2890,9 @@ class Trigger(ProxyDto): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of synchronization.Constant filled by server. Possible values - include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', - 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', - 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + include: "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", + "AdlsGen2File", "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", + "SqlDBTable", "SqlDWTable", "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind """ @@ -2917,7 +2919,7 @@ def __init__( **kwargs ): super(Trigger, self).__init__(**kwargs) - self.kind = 'Trigger' + self.kind: str = 'Trigger' class ScheduledTrigger(Trigger): @@ -2934,25 +2936,25 @@ class ScheduledTrigger(Trigger): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of synchronization.Constant filled by server. Possible values - include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', - 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', - 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + include: "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", + "AdlsGen2File", "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", + "SqlDBTable", "SqlDWTable", "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :ivar created_at: Time at which the trigger was created. :vartype created_at: ~datetime.datetime - :ivar provisioning_state: Gets the provisioning state. Possible values include: 'Succeeded', - 'Creating', 'Deleting', 'Moving', 'Failed'. + :ivar provisioning_state: Gets the provisioning state. Possible values include: "Succeeded", + "Creating", "Deleting", "Moving", "Failed". :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState - :param recurrence_interval: Required. Recurrence Interval. Possible values include: 'Hour', - 'Day'. + :param recurrence_interval: Required. Recurrence Interval. Possible values include: "Hour", + "Day". :type recurrence_interval: str or ~data_share_management_client.models.RecurrenceInterval - :param synchronization_mode: Synchronization mode. Possible values include: 'Incremental', - 'FullSync'. + :param synchronization_mode: Synchronization mode. Possible values include: "Incremental", + "FullSync". :type synchronization_mode: str or ~data_share_management_client.models.SynchronizationMode :param synchronization_time: Required. Synchronization time. :type synchronization_time: ~datetime.datetime - :ivar trigger_status: Gets the trigger state. Possible values include: 'Active', 'Inactive', - 'SourceSynchronizationSettingDeleted'. + :ivar trigger_status: Gets the trigger state. Possible values include: "Active", "Inactive", + "SourceSynchronizationSettingDeleted". :vartype trigger_status: str or ~data_share_management_client.models.TriggerStatus :ivar user_name: Name of the user who created the trigger. :vartype user_name: str @@ -2994,7 +2996,7 @@ def __init__( **kwargs ): super(ScheduledTrigger, self).__init__(**kwargs) - self.kind = 'ScheduleBased' + self.kind: str = 'ScheduleBased' self.created_at = None self.provisioning_state = None self.recurrence_interval = recurrence_interval @@ -3020,9 +3022,9 @@ class Share(ProxyDto): :param description: Share description. :type description: str :ivar provisioning_state: Gets or sets the provisioning state. Possible values include: - 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + "Succeeded", "Creating", "Deleting", "Moving", "Failed". :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState - :param share_kind: Share kind. Possible values include: 'CopyBased', 'InPlace'. + :param share_kind: Share kind. Possible values include: "CopyBased", "InPlace". :type share_kind: str or ~data_share_management_client.models.ShareKind :param terms: Share terms. :type terms: str @@ -3129,16 +3131,16 @@ class ShareSubscription(ProxyDto): :ivar provider_tenant_name: Tenant name of the provider who created the resource. :vartype provider_tenant_name: str :ivar provisioning_state: Provisioning state of the share subscription. Possible values - include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + include: "Succeeded", "Creating", "Deleting", "Moving", "Failed". :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState :ivar share_description: Description of share. :vartype share_description: str - :ivar share_kind: Kind of share. Possible values include: 'CopyBased', 'InPlace'. + :ivar share_kind: Kind of share. Possible values include: "CopyBased", "InPlace". :vartype share_kind: str or ~data_share_management_client.models.ShareKind :ivar share_name: Name of the share. :vartype share_name: str :ivar share_subscription_status: Gets the current status of share subscription. Possible values - include: 'Active', 'Revoked', 'SourceDeleted', 'Revoking'. + include: "Active", "Revoked", "SourceDeleted", "Revoking". :vartype share_subscription_status: str or ~data_share_management_client.models.ShareSubscriptionStatus :ivar share_terms: Terms of a share. @@ -3266,8 +3268,8 @@ class ShareSubscriptionSynchronization(msrest.serialization.Model): :vartype status: str :param synchronization_id: Required. Synchronization id. :type synchronization_id: str - :ivar synchronization_mode: Synchronization Mode. Possible values include: 'Incremental', - 'FullSync'. + :ivar synchronization_mode: Synchronization Mode. Possible values include: "Incremental", + "FullSync". :vartype synchronization_mode: str or ~data_share_management_client.models.SynchronizationMode """ @@ -3362,8 +3364,8 @@ class ShareSynchronization(msrest.serialization.Model): :type status: str :param synchronization_id: Synchronization id. :type synchronization_id: str - :ivar synchronization_mode: Synchronization mode. Possible values include: 'Incremental', - 'FullSync'. + :ivar synchronization_mode: Synchronization mode. Possible values include: "Incremental", + "FullSync". :vartype synchronization_mode: str or ~data_share_management_client.models.SynchronizationMode """ @@ -3489,9 +3491,9 @@ class SqlDBTableDataSet(DataSet): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set.Constant filled by server. Possible values include: - 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', - 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', - 'ScheduleBased'. + "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", "AdlsGen2File", + "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", "SqlDBTable", "SqlDWTable", + "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :param database_name: Database name of the source data set. :type database_name: str @@ -3535,7 +3537,7 @@ def __init__( **kwargs ): super(SqlDBTableDataSet, self).__init__(**kwargs) - self.kind = 'SqlDBTable' + self.kind: str = 'SqlDBTable' self.database_name = database_name self.data_set_id = None self.schema_name = schema_name @@ -3557,20 +3559,20 @@ class SqlDBTableDataSetMapping(DataSetMapping): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set mapping.Constant filled by server. Possible values - include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', - 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', - 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + include: "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", + "AdlsGen2File", "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", + "SqlDBTable", "SqlDWTable", "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :param database_name: Required. DatabaseName name of the sink data set. :type database_name: str :param data_set_id: Required. The id of the source data set. :type data_set_id: str :ivar data_set_mapping_status: Gets the status of the data set mapping. Possible values - include: 'Ok', 'Broken'. + include: "Ok", "Broken". :vartype data_set_mapping_status: str or ~data_share_management_client.models.DataSetMappingStatus :ivar provisioning_state: Provisioning state of the data set mapping. Possible values include: - 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + "Succeeded", "Creating", "Deleting", "Moving", "Failed". :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState :param schema_name: Required. Schema of the table. Default value is dbo. :type schema_name: str @@ -3619,7 +3621,7 @@ def __init__( **kwargs ): super(SqlDBTableDataSetMapping, self).__init__(**kwargs) - self.kind = 'SqlDBTable' + self.kind: str = 'SqlDBTable' self.database_name = database_name self.data_set_id = data_set_id self.data_set_mapping_status = None @@ -3629,7 +3631,7 @@ def __init__( self.table_name = table_name -class SqlDwTableDataSet(DataSet): +class SqlDWTableDataSet(DataSet): """A SQL DW table data set. Variables are only populated by the server, and will be ignored when sending a request. @@ -3643,9 +3645,9 @@ class SqlDwTableDataSet(DataSet): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set.Constant filled by server. Possible values include: - 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', - 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', - 'ScheduleBased'. + "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", "AdlsGen2File", + "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", "SqlDBTable", "SqlDWTable", + "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :ivar data_set_id: Unique id for identifying a data set resource. :vartype data_set_id: str @@ -3688,8 +3690,8 @@ def __init__( table_name: Optional[str] = None, **kwargs ): - super(SqlDwTableDataSet, self).__init__(**kwargs) - self.kind = 'SqlDWTable' + super(SqlDWTableDataSet, self).__init__(**kwargs) + self.kind: str = 'SqlDWTable' self.data_set_id = None self.data_warehouse_name = data_warehouse_name self.schema_name = schema_name @@ -3697,7 +3699,7 @@ def __init__( self.table_name = table_name -class SqlDwTableDataSetMapping(DataSetMapping): +class SqlDWTableDataSetMapping(DataSetMapping): """A SQL DW Table data set mapping. Variables are only populated by the server, and will be ignored when sending a request. @@ -3711,20 +3713,20 @@ class SqlDwTableDataSetMapping(DataSetMapping): :ivar type: Type of the azure resource. :vartype type: str :param kind: Required. Kind of data set mapping.Constant filled by server. Possible values - include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', - 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', - 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + include: "Blob", "Container", "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", + "AdlsGen2File", "AdlsGen1Folder", "AdlsGen1File", "KustoCluster", "KustoDatabase", + "SqlDBTable", "SqlDWTable", "ScheduleBased". :type kind: str or ~data_share_management_client.models.Kind :param data_set_id: Required. The id of the source data set. :type data_set_id: str :ivar data_set_mapping_status: Gets the status of the data set mapping. Possible values - include: 'Ok', 'Broken'. + include: "Ok", "Broken". :vartype data_set_mapping_status: str or ~data_share_management_client.models.DataSetMappingStatus :param data_warehouse_name: Required. DataWarehouse name of the source data set. :type data_warehouse_name: str :ivar provisioning_state: Provisioning state of the data set mapping. Possible values include: - 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + "Succeeded", "Creating", "Deleting", "Moving", "Failed". :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState :param schema_name: Required. Schema of the table. Default value is dbo. :type schema_name: str @@ -3772,8 +3774,8 @@ def __init__( table_name: str, **kwargs ): - super(SqlDwTableDataSetMapping, self).__init__(**kwargs) - self.kind = 'SqlDWTable' + super(SqlDWTableDataSetMapping, self).__init__(**kwargs) + self.kind: str = 'SqlDWTable' self.data_set_id = data_set_id self.data_set_mapping_status = None self.data_warehouse_name = data_warehouse_name @@ -3790,9 +3792,9 @@ class SynchronizationDetails(msrest.serialization.Model): :ivar data_set_id: Id of data set. :vartype data_set_id: str - :ivar data_set_type: Type of the data set. Possible values include: 'Blob', 'Container', - 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', 'AdlsGen1Folder', - 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable'. + :ivar data_set_type: Type of the data set. Possible values include: "Blob", "Container", + "BlobFolder", "AdlsGen2FileSystem", "AdlsGen2Folder", "AdlsGen2File", "AdlsGen1Folder", + "AdlsGen1File", "KustoCluster", "KustoDatabase", "SqlDBTable", "SqlDWTable". :vartype data_set_type: str or ~data_share_management_client.models.DataSetType :ivar duration_ms: Duration of data set level copy. :vartype duration_ms: int @@ -3948,7 +3950,7 @@ class Synchronize(msrest.serialization.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'. + Incremental by default. Possible values include: "Incremental", "FullSync". :type synchronization_mode: str or ~data_share_management_client.models.SynchronizationMode """ diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_account_operations.py b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_account_operations.py index 2b06a214c5..627717c36d 100644 --- a/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_account_operations.py +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_account_operations.py @@ -5,7 +5,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import TYPE_CHECKING import warnings from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -13,11 +13,17 @@ from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class AccountOperations(object): """AccountOperations operations. @@ -41,6 +47,78 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + def list_by_subscription( + self, + skip_token=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.AccountList"] + """List Accounts in Subscription. + + List Accounts in a subscription. + + :param skip_token: Continuation token. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AccountList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_share_management_client.models.AccountList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AccountList"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + 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 = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", 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 = {} # type: Dict[str, Any] + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AccountList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataShare/accounts'} # type: ignore + def get( self, resource_group_name, # type: str @@ -57,16 +135,17 @@ def get( :param account_name: The name of the share account. :type account_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: Account or the result of cls(response) + :return: Account, or the result of cls(response) :rtype: ~data_share_management_client.models.Account :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Account"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore 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'), @@ -90,15 +169,15 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Account', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}'} # type: ignore def _create_initial( self, @@ -111,14 +190,15 @@ def _create_initial( ): # type: (...) -> "models.Account" cls = kwargs.pop('cls', None) # type: ClsType["models.Account"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _account = models.Account(location=location, tags=tags, identity=identity) api_version = "2019-11-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._create_initial.metadata['url'] + url = self._create_initial.metadata['url'] # type: ignore 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'), @@ -147,7 +227,7 @@ def _create_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -157,10 +237,10 @@ def _create_initial( deserialized = self._deserialize('Account', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}'} + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}'} # type: ignore def begin_create( self, @@ -171,7 +251,7 @@ def begin_create( tags=None, # type: Optional[Dict[str, str]] **kwargs # type: Any ): - # type: (...) -> "models.Account" + # type: (...) -> LROPoller """Create an account. Create an account in the given resource group. @@ -190,13 +270,17 @@ def begin_create( :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod - :return: An instance of LROPoller that returns Account + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Account or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~data_share_management_client.models.Account] - :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Account"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._create_initial( resource_group_name=resource_group_name, account_name=account_name, @@ -207,6 +291,9 @@ def begin_create( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): deserialized = self._deserialize('Account', pipeline_response) @@ -214,15 +301,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) - if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}'} + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}'} # type: ignore def _delete_initial( self, @@ -232,11 +315,12 @@ def _delete_initial( ): # type: (...) -> "models.OperationResponse" cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResponse"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" # Construct URL - url = self._delete_initial.metadata['url'] + url = self._delete_initial.metadata['url'] # type: ignore 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'), @@ -260,17 +344,17 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: deserialized = self._deserialize('OperationResponse', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}'} + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}'} # type: ignore def begin_delete( self, @@ -278,7 +362,7 @@ def begin_delete( account_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationResponse" + # type: (...) -> LROPoller """DeleteAccount. Delete an account. @@ -291,13 +375,17 @@ def begin_delete( :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod - :return: An instance of LROPoller that returns OperationResponse + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either OperationResponse or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~data_share_management_client.models.OperationResponse] - :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._delete_initial( resource_group_name=resource_group_name, account_name=account_name, @@ -305,6 +393,9 @@ def begin_delete( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): deserialized = self._deserialize('OperationResponse', pipeline_response) @@ -312,15 +403,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) - if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}'} + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}'} # type: ignore def update( self, @@ -341,19 +428,20 @@ def update( :param tags: Tags on the azure resource. :type tags: dict[str, str] :keyword callable cls: A custom type or function that will be passed the direct response - :return: Account or the result of cls(response) + :return: Account, or the result of cls(response) :rtype: ~data_share_management_client.models.Account :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Account"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _account_update_parameters = models.AccountUpdateParameters(tags=tags) api_version = "2019-11-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.update.metadata['url'] + url = self.update.metadata['url'] # type: ignore 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'), @@ -382,86 +470,15 @@ def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Account', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}'} - - def list_by_subscription( - self, - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "models.AccountList" - """List Accounts in Subscription. - - List Accounts in a subscription. - - :param skip_token: Continuation token. - :type skip_token: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AccountList or the result of cls(response) - :rtype: ~data_share_management_client.models.AccountList - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AccountList"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2019-11-01" - - 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) - else: - url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('AccountList', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(models.DataShareError, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataShare/accounts'} + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}'} # type: ignore def list_by_resource_group( self, @@ -469,7 +486,7 @@ def list_by_resource_group( skip_token=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.AccountList" + # type: (...) -> Iterable["models.AccountList"] """List Accounts in ResourceGroup. List Accounts in a resource group. @@ -479,32 +496,33 @@ def list_by_resource_group( :param skip_token: Continuation token. :type skip_token: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: AccountList or the result of cls(response) - :rtype: ~data_share_management_client.models.AccountList + :return: An iterator like instance of either AccountList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_share_management_client.models.AccountList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AccountList"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_resource_group.metadata['url'] + url = self.list_by_resource_group.metadata['url'] # type: ignore 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 = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -529,11 +547,11 @@ def get_next(next_link=None): if response.status_code not in [200]: error = self._deserialize(models.DataShareError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged( get_next, extract_data ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts'} + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts'} # type: ignore diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_consumer_invitation_operations.py b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_consumer_invitation_operations.py index 61235cd44a..9c86a2d2fe 100644 --- a/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_consumer_invitation_operations.py +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_consumer_invitation_operations.py @@ -5,18 +5,23 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar +from typing import TYPE_CHECKING import warnings from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class ConsumerInvitationOperations(object): """ConsumerInvitationOperations operations. @@ -40,37 +45,104 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config - def reject_invitation( + def list_invitation( + self, + skip_token=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.ConsumerInvitationList"] + """Lists invitations. + + List the invitations. + + :param skip_token: The continuation token. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ConsumerInvitationList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_share_management_client.models.ConsumerInvitationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerInvitationList"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_invitation.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", 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 = {} # type: Dict[str, Any] + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ConsumerInvitationList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_invitation.metadata = {'url': '/providers/Microsoft.DataShare/ListInvitations'} # type: ignore + + def get( self, location, # type: str invitation_id, # type: str **kwargs # type: Any ): # type: (...) -> "models.ConsumerInvitation" - """Reject an invitation. + """Get an invitation. - Rejects the invitation identified by invitationId. + Gets the invitation identified by invitationId. :param location: Location of the invitation. :type location: str - :param invitation_id: Unique id of the invitation. + :param invitation_id: An invitation id. :type invitation_id: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: ConsumerInvitation or the result of cls(response) + :return: ConsumerInvitation, or the result of cls(response) :rtype: ~data_share_management_client.models.ConsumerInvitation :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerInvitation"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - - _invitation = models.ConsumerInvitation(invitation_id=invitation_id) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" - content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.reject_invitation.metadata['url'] + url = self.get.metadata['url'] # type: ignore 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) @@ -80,60 +152,58 @@ def reject_invitation( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' # Construct and send request - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_invitation, 'ConsumerInvitation') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - + request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConsumerInvitation', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - reject_invitation.metadata = {'url': '/providers/Microsoft.DataShare/locations/{location}/RejectInvitation'} + get.metadata = {'url': '/providers/Microsoft.DataShare/locations/{location}/consumerInvitations/{invitationId}'} # type: ignore - def get( + def reject_invitation( self, location, # type: str invitation_id, # type: str **kwargs # type: Any ): # type: (...) -> "models.ConsumerInvitation" - """Get an invitation. + """Reject an invitation. - Gets the invitation identified by invitationId. + Rejects the invitation identified by invitationId. :param location: Location of the invitation. :type location: str - :param invitation_id: An invitation id. + :param invitation_id: Unique id of the invitation. :type invitation_id: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: ConsumerInvitation or the result of cls(response) + :return: ConsumerInvitation, or the result of cls(response) :rtype: ~data_share_management_client.models.ConsumerInvitation :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerInvitation"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + _invitation = models.ConsumerInvitation(invitation_id=invitation_id) api_version = "2019-11-01" + content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.get.metadata['url'] + url = self.reject_invitation.metadata['url'] # type: ignore 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) @@ -143,89 +213,27 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_invitation, 'ConsumerInvitation') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConsumerInvitation', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/providers/Microsoft.DataShare/locations/{location}/consumerInvitations/{invitationId}'} - - def list_invitation( - self, - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "models.ConsumerInvitationList" - """Lists invitations. - - List the invitations. - - :param skip_token: The continuation token. - :type skip_token: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ConsumerInvitationList or the result of cls(response) - :rtype: ~data_share_management_client.models.ConsumerInvitationList - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerInvitationList"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2019-11-01" - - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_invitation.metadata['url'] - else: - url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('ConsumerInvitationList', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(models.DataShareError, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_invitation.metadata = {'url': '/providers/Microsoft.DataShare/ListInvitations'} + reject_invitation.metadata = {'url': '/providers/Microsoft.DataShare/locations/{location}/RejectInvitation'} # type: ignore diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_consumer_source_data_set_operations.py b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_consumer_source_data_set_operations.py index f45b883269..b19d8b8d58 100644 --- a/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_consumer_source_data_set_operations.py +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_consumer_source_data_set_operations.py @@ -5,18 +5,23 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar +from typing import TYPE_CHECKING import warnings from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class ConsumerSourceDataSetOperations(object): """ConsumerSourceDataSetOperations operations. @@ -48,7 +53,7 @@ def list_by_share_subscription( skip_token=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ConsumerSourceDataSetList" + # type: (...) -> Iterable["models.ConsumerSourceDataSetList"] """Get source dataSets of a shareSubscription. Get source dataSets of a shareSubscription. @@ -62,18 +67,19 @@ def list_by_share_subscription( :param skip_token: Continuation token. :type skip_token: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: ConsumerSourceDataSetList or the result of cls(response) - :rtype: ~data_share_management_client.models.ConsumerSourceDataSetList + :return: An iterator like instance of either ConsumerSourceDataSetList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_share_management_client.models.ConsumerSourceDataSetList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerSourceDataSetList"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_share_subscription.metadata['url'] + url = self.list_by_share_subscription.metadata['url'] # type: ignore 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'), @@ -81,15 +87,15 @@ def prepare_request(next_link=None): 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -114,11 +120,11 @@ def get_next(next_link=None): if response.status_code not in [200]: error = self._deserialize(models.DataShareError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged( get_next, extract_data ) - list_by_share_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/ConsumerSourceDataSets'} + list_by_share_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/ConsumerSourceDataSets'} # type: ignore diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_data_set_mapping_operations.py b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_data_set_mapping_operations.py index be59ce3d9b..33f2c81cc3 100644 --- a/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_data_set_mapping_operations.py +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_data_set_mapping_operations.py @@ -5,18 +5,23 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import TYPE_CHECKING import warnings from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class DataSetMappingOperations(object): """DataSetMappingOperations operations. @@ -62,16 +67,17 @@ def get( :param data_set_mapping_name: The name of the dataSetMapping. :type data_set_mapping_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataSetMapping or the result of cls(response) + :return: DataSetMapping, or the result of cls(response) :rtype: ~data_share_management_client.models.DataSetMapping :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DataSetMapping"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore 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'), @@ -97,15 +103,15 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('DataSetMapping', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/dataSetMappings/{dataSetMappingName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/dataSetMappings/{dataSetMappingName}'} # type: ignore def create( self, @@ -134,17 +140,18 @@ def create( :param data_set_mapping: Destination data set configuration details. :type data_set_mapping: ~data_share_management_client.models.DataSetMapping :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataSetMapping or the result of cls(response) - :rtype: ~data_share_management_client.models.DataSetMapping or ~data_share_management_client.models.DataSetMapping + :return: DataSetMapping, or the result of cls(response) + :rtype: ~data_share_management_client.models.DataSetMapping :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DataSetMapping"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.create.metadata['url'] + url = self.create.metadata['url'] # type: ignore 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'), @@ -175,7 +182,7 @@ def create( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -185,10 +192,10 @@ def create( deserialized = self._deserialize('DataSetMapping', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/dataSetMappings/{dataSetMappingName}'} + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/dataSetMappings/{dataSetMappingName}'} # type: ignore def delete( self, @@ -212,16 +219,17 @@ def delete( :param data_set_mapping_name: The name of the dataSetMapping. :type data_set_mapping_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) + :return: None, or the result of cls(response) :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" # Construct URL - url = self.delete.metadata['url'] + url = self.delete.metadata['url'] # type: ignore 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'), @@ -246,12 +254,12 @@ def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/dataSetMappings/{dataSetMappingName}'} + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/dataSetMappings/{dataSetMappingName}'} # type: ignore def list_by_share_subscription( self, @@ -259,9 +267,11 @@ def list_by_share_subscription( account_name, # type: str share_subscription_name, # type: str skip_token=None, # type: Optional[str] + filter=None, # type: Optional[str] + orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.DataSetMappingList" + # type: (...) -> Iterable["models.DataSetMappingList"] """List DataSetMappings in a share subscription. List DataSetMappings in a share subscription. @@ -274,19 +284,24 @@ def list_by_share_subscription( :type share_subscription_name: str :param skip_token: Continuation token. :type skip_token: str + :param filter: Filters the results using OData syntax. + :type filter: str + :param orderby: Sorts the results using OData syntax. + :type orderby: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataSetMappingList or the result of cls(response) - :rtype: ~data_share_management_client.models.DataSetMappingList + :return: An iterator like instance of either DataSetMappingList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_share_management_client.models.DataSetMappingList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DataSetMappingList"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_share_subscription.metadata['url'] + url = self.list_by_share_subscription.metadata['url'] # type: ignore 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'), @@ -294,15 +309,19 @@ def prepare_request(next_link=None): 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if orderby is not None: + query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -327,11 +346,11 @@ def get_next(next_link=None): if response.status_code not in [200]: error = self._deserialize(models.DataShareError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged( get_next, extract_data ) - list_by_share_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/dataSetMappings'} + list_by_share_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/dataSetMappings'} # type: ignore diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_data_set_operations.py b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_data_set_operations.py index 95929ba485..64b1f65c19 100644 --- a/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_data_set_operations.py +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_data_set_operations.py @@ -5,7 +5,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import TYPE_CHECKING import warnings from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -13,11 +13,17 @@ from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class DataSetOperations(object): """DataSetOperations operations. @@ -63,16 +69,17 @@ def get( :param data_set_name: The name of the dataSet. :type data_set_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataSet or the result of cls(response) + :return: DataSet, or the result of cls(response) :rtype: ~data_share_management_client.models.DataSet :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DataSet"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore 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'), @@ -98,15 +105,15 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('DataSet', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets/{dataSetName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets/{dataSetName}'} # type: ignore def create( self, @@ -133,17 +140,18 @@ def create( :param data_set: The new data set information. :type data_set: ~data_share_management_client.models.DataSet :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataSet or the result of cls(response) - :rtype: ~data_share_management_client.models.DataSet or ~data_share_management_client.models.DataSet + :return: DataSet, or the result of cls(response) + :rtype: ~data_share_management_client.models.DataSet :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DataSet"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.create.metadata['url'] + url = self.create.metadata['url'] # type: ignore 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'), @@ -174,7 +182,7 @@ def create( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -184,10 +192,10 @@ def create( deserialized = self._deserialize('DataSet', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets/{dataSetName}'} + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets/{dataSetName}'} # type: ignore def _delete_initial( self, @@ -199,11 +207,12 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" # Construct URL - url = self._delete_initial.metadata['url'] + url = self._delete_initial.metadata['url'] # type: ignore 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'), @@ -228,12 +237,12 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets/{dataSetName}'} + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets/{dataSetName}'} # type: ignore def begin_delete( self, @@ -243,7 +252,7 @@ def begin_delete( data_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> None + # type: (...) -> LROPoller """Delete a DataSet in a share. Delete DataSet in a share. @@ -260,13 +269,17 @@ def begin_delete( :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod - :return: An instance of LROPoller that returns None + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._delete_initial( resource_group_name=resource_group_name, account_name=account_name, @@ -276,19 +289,18 @@ def begin_delete( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) - if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets/{dataSetName}'} + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets/{dataSetName}'} # type: ignore def list_by_share( self, @@ -296,9 +308,11 @@ def list_by_share( account_name, # type: str share_name, # type: str skip_token=None, # type: Optional[str] + filter=None, # type: Optional[str] + orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.DataSetList" + # type: (...) -> Iterable["models.DataSetList"] """List DataSets in a share. List DataSets in a share. @@ -311,19 +325,24 @@ def list_by_share( :type share_name: str :param skip_token: continuation token. :type skip_token: str + :param filter: Filters the results using OData syntax. + :type filter: str + :param orderby: Sorts the results using OData syntax. + :type orderby: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataSetList or the result of cls(response) - :rtype: ~data_share_management_client.models.DataSetList + :return: An iterator like instance of either DataSetList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_share_management_client.models.DataSetList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DataSetList"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_share.metadata['url'] + url = self.list_by_share.metadata['url'] # type: ignore 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'), @@ -331,15 +350,19 @@ def prepare_request(next_link=None): 'shareName': self._serialize.url("share_name", share_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if orderby is not None: + query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -364,11 +387,11 @@ def get_next(next_link=None): if response.status_code not in [200]: error = self._deserialize(models.DataShareError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged( get_next, extract_data ) - list_by_share.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets'} + list_by_share.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets'} # type: ignore diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_invitation_operations.py b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_invitation_operations.py index f6d2e38dc1..889789cf62 100644 --- a/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_invitation_operations.py +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_invitation_operations.py @@ -5,18 +5,23 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import TYPE_CHECKING import warnings from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class InvitationOperations(object): """InvitationOperations operations. @@ -62,16 +67,17 @@ def get( :param invitation_name: The name of the invitation. :type invitation_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: Invitation or the result of cls(response) + :return: Invitation, or the result of cls(response) :rtype: ~data_share_management_client.models.Invitation :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Invitation"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore 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'), @@ -97,15 +103,15 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Invitation', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/invitations/{invitationName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/invitations/{invitationName}'} # type: ignore def create( self, @@ -140,19 +146,20 @@ def create( invitations to specific users or applications in an AD tenant. :type target_object_id: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: Invitation or the result of cls(response) - :rtype: ~data_share_management_client.models.Invitation or ~data_share_management_client.models.Invitation + :return: Invitation, or the result of cls(response) + :rtype: ~data_share_management_client.models.Invitation :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Invitation"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _invitation = models.Invitation(target_active_directory_id=target_active_directory_id, target_email=target_email, target_object_id=target_object_id) api_version = "2019-11-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.create.metadata['url'] + url = self.create.metadata['url'] # type: ignore 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'), @@ -183,7 +190,7 @@ def create( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -193,10 +200,10 @@ def create( deserialized = self._deserialize('Invitation', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/invitations/{invitationName}'} + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/invitations/{invitationName}'} # type: ignore def delete( self, @@ -220,16 +227,17 @@ def delete( :param invitation_name: The name of the invitation. :type invitation_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) + :return: None, or the result of cls(response) :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" # Construct URL - url = self.delete.metadata['url'] + url = self.delete.metadata['url'] # type: ignore 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'), @@ -254,12 +262,12 @@ def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/invitations/{invitationName}'} + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/invitations/{invitationName}'} # type: ignore def list_by_share( self, @@ -267,9 +275,11 @@ def list_by_share( account_name, # type: str share_name, # type: str skip_token=None, # type: Optional[str] + filter=None, # type: Optional[str] + orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.InvitationList" + # type: (...) -> Iterable["models.InvitationList"] """List invitations in a share. List all Invitations in a share. @@ -282,19 +292,24 @@ def list_by_share( :type share_name: str :param skip_token: The continuation token. :type skip_token: str + :param filter: Filters the results using OData syntax. + :type filter: str + :param orderby: Sorts the results using OData syntax. + :type orderby: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: InvitationList or the result of cls(response) - :rtype: ~data_share_management_client.models.InvitationList + :return: An iterator like instance of either InvitationList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_share_management_client.models.InvitationList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.InvitationList"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_share.metadata['url'] + url = self.list_by_share.metadata['url'] # type: ignore 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'), @@ -302,15 +317,19 @@ def prepare_request(next_link=None): 'shareName': self._serialize.url("share_name", share_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if orderby is not None: + query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -335,11 +354,11 @@ def get_next(next_link=None): if response.status_code not in [200]: error = self._deserialize(models.DataShareError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged( get_next, extract_data ) - list_by_share.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/invitations'} + list_by_share.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/invitations'} # type: ignore diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_operation_operations.py b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_operation_operations.py index ea88e363ce..174b83afdf 100644 --- a/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_operation_operations.py +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_operation_operations.py @@ -5,18 +5,23 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar +from typing import TYPE_CHECKING import warnings from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class OperationOperations(object): """OperationOperations operations. @@ -44,31 +49,32 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> "models.OperationList" + # type: (...) -> Iterable["models.OperationList"] """List of available operations. Lists the available operations. :keyword callable cls: A custom type or function that will be passed the direct response - :return: OperationList or the result of cls(response) - :rtype: ~data_share_management_client.models.OperationList + :return: An iterator like instance of either OperationList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_share_management_client.models.OperationList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.OperationList"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list.metadata['url'] + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -93,11 +99,11 @@ def get_next(next_link=None): if response.status_code not in [200]: error = self._deserialize(models.DataShareError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/providers/Microsoft.DataShare/operations'} + list.metadata = {'url': '/providers/Microsoft.DataShare/operations'} # type: ignore diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_provider_share_subscription_operations.py b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_provider_share_subscription_operations.py index 8c663fab40..421cceb072 100644 --- a/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_provider_share_subscription_operations.py +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_provider_share_subscription_operations.py @@ -5,7 +5,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import TYPE_CHECKING import warnings from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -13,11 +13,17 @@ from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class ProviderShareSubscriptionOperations(object): """ProviderShareSubscriptionOperations operations. @@ -41,7 +47,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config - def get_by_share( + def reinstate( self, resource_group_name, # type: str account_name, # type: str @@ -50,9 +56,9 @@ def get_by_share( **kwargs # type: Any ): # type: (...) -> "models.ProviderShareSubscription" - """Get share subscription in a provider share. + """Reinstate share subscription in a provider share. - Get 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 @@ -63,16 +69,17 @@ def get_by_share( :param provider_share_subscription_id: To locate shareSubscription. :type provider_share_subscription_id: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: ProviderShareSubscription or the result of cls(response) + :return: ProviderShareSubscription, or the result of cls(response) :rtype: ~data_share_management_client.models.ProviderShareSubscription :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProviderShareSubscription"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" # Construct URL - url = self.get_by_share.metadata['url'] + url = self.reinstate.metadata['url'] # type: ignore 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'), @@ -91,105 +98,22 @@ def get_by_share( header_parameters['Accept'] = 'application/json' # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ProviderShareSubscription', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) 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, # type: str - account_name, # type: str - share_name, # type: str - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "models.ProviderShareSubscriptionList" - """List share subscriptions in a provider share. - - List of available share subscriptions to 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ProviderShareSubscriptionList or the result of cls(response) - :rtype: ~data_share_management_client.models.ProviderShareSubscriptionList - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProviderShareSubscriptionList"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2019-11-01" - - 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) - else: - url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('ProviderShareSubscriptionList', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(models.DataShareError, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_by_share.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions'} + reinstate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions/{providerShareSubscriptionId}/reinstate'} # type: ignore def _revoke_initial( self, @@ -201,11 +125,12 @@ def _revoke_initial( ): # type: (...) -> "models.ProviderShareSubscription" cls = kwargs.pop('cls', None) # type: ClsType["models.ProviderShareSubscription"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" # Construct URL - url = self._revoke_initial.metadata['url'] + url = self._revoke_initial.metadata['url'] # type: ignore 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'), @@ -231,7 +156,7 @@ def _revoke_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -241,10 +166,10 @@ def _revoke_initial( deserialized = self._deserialize('ProviderShareSubscription', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - _revoke_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions/{providerShareSubscriptionId}/revoke'} + _revoke_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions/{providerShareSubscriptionId}/revoke'} # type: ignore def begin_revoke( self, @@ -254,7 +179,7 @@ def begin_revoke( provider_share_subscription_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ProviderShareSubscription" + # type: (...) -> LROPoller """Revoke share subscription in a provider share. Revoke share subscription in a provider share. @@ -271,13 +196,17 @@ def begin_revoke( :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod - :return: An instance of LROPoller that returns ProviderShareSubscription + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either ProviderShareSubscription or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~data_share_management_client.models.ProviderShareSubscription] - :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.ProviderShareSubscription"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._revoke_initial( resource_group_name=resource_group_name, account_name=account_name, @@ -287,6 +216,9 @@ def begin_revoke( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): deserialized = self._deserialize('ProviderShareSubscription', pipeline_response) @@ -294,17 +226,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) - if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_revoke.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions/{providerShareSubscriptionId}/revoke'} + begin_revoke.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions/{providerShareSubscriptionId}/revoke'} # type: ignore - def reinstate( + def get_by_share( self, resource_group_name, # type: str account_name, # type: str @@ -313,9 +241,9 @@ def reinstate( **kwargs # type: Any ): # type: (...) -> "models.ProviderShareSubscription" - """Reinstate share subscription in a provider share. + """Get share subscription in a provider share. - Reinstate 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 @@ -326,16 +254,17 @@ def reinstate( :param provider_share_subscription_id: To locate shareSubscription. :type provider_share_subscription_id: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: ProviderShareSubscription or the result of cls(response) + :return: ProviderShareSubscription, or the result of cls(response) :rtype: ~data_share_management_client.models.ProviderShareSubscription :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ProviderShareSubscription"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" # Construct URL - url = self.reinstate.metadata['url'] + url = self.get_by_share.metadata['url'] # type: ignore 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'), @@ -354,19 +283,103 @@ def reinstate( header_parameters['Accept'] = 'application/json' # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ProviderShareSubscription', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - reinstate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions/{providerShareSubscriptionId}/reinstate'} + get_by_share.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions/{providerShareSubscriptionId}'} # type: ignore + + def list_by_share( + self, + resource_group_name, # type: str + account_name, # type: str + share_name, # type: str + skip_token=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.ProviderShareSubscriptionList"] + """List share subscriptions in a provider share. + + List of available share subscriptions to 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProviderShareSubscriptionList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_share_management_client.models.ProviderShareSubscriptionList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ProviderShareSubscriptionList"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_share.metadata['url'] # type: ignore + 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 = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", 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 = {} # type: Dict[str, Any] + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProviderShareSubscriptionList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_share.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions'} # type: ignore diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_share_operations.py b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_share_operations.py index a891d44142..a522f7bf98 100644 --- a/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_share_operations.py +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_share_operations.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import datetime -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import TYPE_CHECKING import warnings from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -14,11 +14,17 @@ from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class ShareOperations(object): """ShareOperations operations. @@ -42,6 +48,228 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + def list_synchronization_detail( + self, + resource_group_name, # type: str + account_name, # type: str + share_name, # type: str + skip_token=None, # type: Optional[str] + filter=None, # type: Optional[str] + orderby=None, # type: Optional[str] + consumer_email=None, # type: Optional[str] + consumer_name=None, # type: Optional[str] + consumer_tenant_name=None, # type: Optional[str] + duration_ms=None, # type: Optional[int] + end_time=None, # type: Optional[datetime.datetime] + message=None, # type: Optional[str] + start_time=None, # type: Optional[datetime.datetime] + status=None, # type: Optional[str] + synchronization_id=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.SynchronizationDetailsList"] + """List synchronization details. + + List data set level details for a share 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_name: The name of the share. + :type share_name: str + :param skip_token: Continuation token. + :type skip_token: str + :param filter: Filters the results using OData syntax. + :type filter: str + :param orderby: Sorts the results using OData syntax. + :type orderby: str + :param consumer_email: Email of the user who created the synchronization. + :type consumer_email: str + :param consumer_name: Name of the user who created the synchronization. + :type consumer_name: str + :param consumer_tenant_name: Tenant name of the consumer who created the synchronization. + :type consumer_tenant_name: str + :param duration_ms: synchronization duration. + :type duration_ms: int + :param end_time: End time of synchronization. + :type end_time: ~datetime.datetime + :param message: message of synchronization. + :type message: str + :param start_time: start time of synchronization. + :type start_time: ~datetime.datetime + :param status: Raw Status. + :type status: str + :param synchronization_id: Synchronization id. + :type synchronization_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SynchronizationDetailsList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_share_management_client.models.SynchronizationDetailsList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SynchronizationDetailsList"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + _share_synchronization = models.ShareSynchronization(consumer_email=consumer_email, consumer_name=consumer_name, consumer_tenant_name=consumer_tenant_name, duration_ms=duration_ms, end_time=end_time, message=message, start_time=start_time, status=status, synchronization_id=synchronization_id) + api_version = "2019-11-01" + content_type = "application/json" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_synchronization_detail.metadata['url'] # type: ignore + 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 = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if orderby is not None: + query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') + + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_share_synchronization, 'ShareSynchronization') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SynchronizationDetailsList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_synchronization_detail.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/listSynchronizationDetails'} # type: ignore + + def list_synchronization( + self, + resource_group_name, # type: str + account_name, # type: str + share_name, # type: str + skip_token=None, # type: Optional[str] + filter=None, # type: Optional[str] + orderby=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.ShareSynchronizationList"] + """List synchronizations of a share. + + List Synchronizations 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 filter: Filters the results using OData syntax. + :type filter: str + :param orderby: Sorts the results using OData syntax. + :type orderby: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ShareSynchronizationList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_share_management_client.models.ShareSynchronizationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSynchronizationList"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_synchronization.metadata['url'] # type: ignore + 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 = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if orderby is not None: + query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') + + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ShareSynchronizationList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_synchronization.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/listSynchronizations'} # type: ignore + def get( self, resource_group_name, # type: str @@ -61,16 +289,17 @@ def get( :param share_name: The name of the share to retrieve. :type share_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: Share or the result of cls(response) + :return: Share, or the result of cls(response) :rtype: ~data_share_management_client.models.Share :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Share"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore 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'), @@ -95,15 +324,15 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Share', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}'} # type: ignore def create( self, @@ -133,19 +362,20 @@ def create( :param terms: Share terms. :type terms: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: Share or the result of cls(response) - :rtype: ~data_share_management_client.models.Share or ~data_share_management_client.models.Share + :return: Share, or the result of cls(response) + :rtype: ~data_share_management_client.models.Share :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Share"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _share = models.Share(description=description, share_kind=share_kind, terms=terms) api_version = "2019-11-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.create.metadata['url'] + url = self.create.metadata['url'] # type: ignore 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'), @@ -175,7 +405,7 @@ def create( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -185,10 +415,10 @@ def create( deserialized = self._deserialize('Share', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}'} + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}'} # type: ignore def _delete_initial( self, @@ -199,11 +429,12 @@ def _delete_initial( ): # type: (...) -> "models.OperationResponse" cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResponse"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" # Construct URL - url = self._delete_initial.metadata['url'] + url = self._delete_initial.metadata['url'] # type: ignore 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'), @@ -228,17 +459,17 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: deserialized = self._deserialize('OperationResponse', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}'} + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}'} # type: ignore def begin_delete( self, @@ -247,7 +478,7 @@ def begin_delete( share_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationResponse" + # type: (...) -> LROPoller """Delete a share. Deletes a share. @@ -262,13 +493,17 @@ def begin_delete( :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod - :return: An instance of LROPoller that returns OperationResponse + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either OperationResponse or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~data_share_management_client.models.OperationResponse] - :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._delete_initial( resource_group_name=resource_group_name, account_name=account_name, @@ -277,6 +512,9 @@ def begin_delete( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): deserialized = self._deserialize('OperationResponse', pipeline_response) @@ -284,24 +522,22 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) - if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}'} + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}'} # type: ignore def list_by_account( self, resource_group_name, # type: str account_name, # type: str skip_token=None, # type: Optional[str] + filter=None, # type: Optional[str] + orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ShareList" + # type: (...) -> Iterable["models.ShareList"] """List shares in an account. List of available shares under an account. @@ -312,34 +548,43 @@ def list_by_account( :type account_name: str :param skip_token: Continuation Token. :type skip_token: str + :param filter: Filters the results using OData syntax. + :type filter: str + :param orderby: Sorts the results using OData syntax. + :type orderby: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShareList or the result of cls(response) - :rtype: ~data_share_management_client.models.ShareList + :return: An iterator like instance of either ShareList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_share_management_client.models.ShareList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ShareList"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_account.metadata['url'] + url = self.list_by_account.metadata['url'] # type: ignore 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 = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if orderby is not None: + query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -364,211 +609,11 @@ def get_next(next_link=None): if response.status_code not in [200]: error = self._deserialize(models.DataShareError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_by_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares'} - - def list_synchronization( - self, - resource_group_name, # type: str - account_name, # type: str - share_name, # type: str - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "models.ShareSynchronizationList" - """List synchronizations of a share. - - List Synchronizations 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShareSynchronizationList or the result of cls(response) - :rtype: ~data_share_management_client.models.ShareSynchronizationList - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSynchronizationList"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2019-11-01" - - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_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'), - 'shareName': self._serialize.url("share_name", share_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - else: - url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('ShareSynchronizationList', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(models.DataShareError, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_synchronization.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/listSynchronizations'} - - def list_synchronization_detail( - self, - resource_group_name, # type: str - account_name, # type: str - share_name, # type: str - skip_token=None, # type: Optional[str] - consumer_email=None, # type: Optional[str] - consumer_name=None, # type: Optional[str] - consumer_tenant_name=None, # type: Optional[str] - duration_ms=None, # type: Optional[int] - end_time=None, # type: Optional[datetime.datetime] - message=None, # type: Optional[str] - start_time=None, # type: Optional[datetime.datetime] - status=None, # type: Optional[str] - synchronization_id=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "models.SynchronizationDetailsList" - """List synchronization details. - - List data set level details for a share 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_name: The name of the share. - :type share_name: str - :param skip_token: Continuation token. - :type skip_token: str - :param consumer_email: Email of the user who created the synchronization. - :type consumer_email: str - :param consumer_name: Name of the user who created the synchronization. - :type consumer_name: str - :param consumer_tenant_name: Tenant name of the consumer who created the synchronization. - :type consumer_tenant_name: str - :param duration_ms: synchronization duration. - :type duration_ms: int - :param end_time: End time of synchronization. - :type end_time: ~datetime.datetime - :param message: message of synchronization. - :type message: str - :param start_time: start time of synchronization. - :type start_time: ~datetime.datetime - :param status: Raw Status. - :type status: str - :param synchronization_id: Synchronization id. - :type synchronization_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SynchronizationDetailsList or the result of cls(response) - :rtype: ~data_share_management_client.models.SynchronizationDetailsList - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SynchronizationDetailsList"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - _share_synchronization = models.ShareSynchronization(consumer_email=consumer_email, consumer_name=consumer_name, consumer_tenant_name=consumer_tenant_name, duration_ms=duration_ms, end_time=end_time, message=message, start_time=start_time, status=status, synchronization_id=synchronization_id) - api_version = "2019-11-01" - content_type = "application/json" - - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_synchronization_detail.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) - else: - url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' - - # Construct and send request - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_share_synchronization, 'ShareSynchronization') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('SynchronizationDetailsList', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(models.DataShareError, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged( get_next, extract_data ) - list_synchronization_detail.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/listSynchronizationDetails'} + list_by_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares'} # type: ignore diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_share_subscription_operations.py b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_share_subscription_operations.py index 59e710c1c5..3bec808d48 100644 --- a/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_share_subscription_operations.py +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_share_subscription_operations.py @@ -5,7 +5,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import TYPE_CHECKING import warnings from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -13,11 +13,17 @@ from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class ShareSubscriptionOperations(object): """ShareSubscriptionOperations operations. @@ -41,107 +47,25 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config - def get( - self, - resource_group_name, # type: str - account_name, # type: str - share_subscription_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "models.ShareSubscription" - """Get a shareSubscription in an account. - - Get 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShareSubscription or the result of cls(response) - :rtype: ~data_share_management_client.models.ShareSubscription - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSubscription"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2019-11-01" - - # 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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('ShareSubscription', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}'} - - def create( + def _cancel_synchronization_initial( self, resource_group_name, # type: str account_name, # type: str share_subscription_name, # type: str - invitation_id, # type: str - source_share_location, # type: str + synchronization_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ShareSubscription" - """Create a shareSubscription in an account. - - Create 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 source_share_location: Source share location. - :type source_share_location: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShareSubscription or the result of cls(response) - :rtype: ~data_share_management_client.models.ShareSubscription or ~data_share_management_client.models.ShareSubscription - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSubscription"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + # type: (...) -> "models.ShareSubscriptionSynchronization" + cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSubscriptionSynchronization"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) - _share_subscription = models.ShareSubscription(invitation_id=invitation_id, source_share_location=source_share_location) + _share_subscription_synchronization = models.ShareSubscriptionSynchronization(synchronization_id=synchronization_id) api_version = "2019-11-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.create.metadata['url'] + url = self._cancel_synchronization_initial.metadata['url'] # type: ignore 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'), @@ -161,92 +85,43 @@ def create( # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_share_subscription, 'ShareSubscription') + body_content = self._serialize.body(_share_subscription_synchronization, 'ShareSubscriptionSynchronization') body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('ShareSubscription', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ShareSubscription', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}'} - - def _delete_initial( - self, - resource_group_name, # type: str - account_name, # type: str - share_subscription_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "models.OperationResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResponse"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2019-11-01" - - # Construct URL - url = self._delete_initial.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 = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + deserialized = self._deserialize('ShareSubscriptionSynchronization', pipeline_response) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationResponse', pipeline_response) + if response.status_code == 202: + deserialized = self._deserialize('ShareSubscriptionSynchronization', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}'} + _cancel_synchronization_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/cancelSynchronization'} # type: ignore - def begin_delete( + def begin_cancel_synchronization( self, resource_group_name, # type: str account_name, # type: str share_subscription_name, # type: str + synchronization_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationResponse" - """Delete a shareSubscription in an account. + # type: (...) -> LROPoller + """Request to cancel a synchronization. - Delete shareSubscription in an account. + Request cancellation of a data share snapshot. :param resource_group_name: The resource group name. :type resource_group_name: str @@ -254,98 +129,109 @@ def begin_delete( :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 :keyword callable cls: A custom type or function that will be passed the direct response :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod - :return: An instance of LROPoller that returns OperationResponse - :rtype: ~azure.core.polling.LROPoller[~data_share_management_client.models.OperationResponse] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either ShareSubscriptionSynchronization or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~data_share_management_client.models.ShareSubscriptionSynchronization] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResponse"] - raw_result = self._delete_initial( + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSubscriptionSynchronization"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + 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, cls=lambda x,y,z: x, **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): - deserialized = self._deserialize('OperationResponse', pipeline_response) + deserialized = self._deserialize('ShareSubscriptionSynchronization', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) - if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}'} + begin_cancel_synchronization.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/cancelSynchronization'} # type: ignore - def list_by_account( + def list_source_share_synchronization_setting( self, resource_group_name, # type: str account_name, # type: str + share_subscription_name, # type: str skip_token=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ShareSubscriptionList" - """List share subscriptions in an account. + # type: (...) -> Iterable["models.SourceShareSynchronizationSettingList"] + """Get synchronization settings set on a share. - List of available share subscriptions under an account. + Get source share synchronization settings for 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 skip_token: Continuation Token. + :param share_subscription_name: The name of the shareSubscription. + :type share_subscription_name: str + :param skip_token: Continuation token. :type skip_token: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShareSubscriptionList or the result of cls(response) - :rtype: ~data_share_management_client.models.ShareSubscriptionList + :return: An iterator like instance of either SourceShareSynchronizationSettingList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_share_management_client.models.SourceShareSynchronizationSettingList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSubscriptionList"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + cls = kwargs.pop('cls', None) # type: ClsType["models.SourceShareSynchronizationSettingList"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_account.metadata['url'] + url = self.list_source_share_synchronization_setting.metadata['url'] # type: ignore 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 = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.post(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): - deserialized = self._deserialize('ShareSubscriptionList', pipeline_response) + deserialized = self._deserialize('SourceShareSynchronizationSettingList', pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -360,49 +246,61 @@ def get_next(next_link=None): if response.status_code not in [200]: error = self._deserialize(models.DataShareError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged( get_next, extract_data ) - list_by_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions'} + list_source_share_synchronization_setting.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/listSourceShareSynchronizationSettings'} # type: ignore - def list_source_share_synchronization_setting( + def list_synchronization_detail( self, resource_group_name, # type: str account_name, # type: str share_subscription_name, # type: str + synchronization_id, # type: str skip_token=None, # type: Optional[str] + filter=None, # type: Optional[str] + orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.SourceShareSynchronizationSettingList" - """Get synchronization settings set on a share. + # type: (...) -> Iterable["models.SynchronizationDetailsList"] + """List synchronization details. - Get source share synchronization settings for a shareSubscription. + List data set level details for a share subscription 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. + :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 filter: Filters the results using OData syntax. + :type filter: str + :param orderby: Sorts the results using OData syntax. + :type orderby: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: SourceShareSynchronizationSettingList or the result of cls(response) - :rtype: ~data_share_management_client.models.SourceShareSynchronizationSettingList + :return: An iterator like instance of either SynchronizationDetailsList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_share_management_client.models.SynchronizationDetailsList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SourceShareSynchronizationSettingList"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + cls = kwargs.pop('cls', None) # type: ClsType["models.SynchronizationDetailsList"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + _share_subscription_synchronization = models.ShareSubscriptionSynchronization(synchronization_id=synchronization_id) api_version = "2019-11-01" + content_type = "application/json" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_source_share_synchronization_setting.metadata['url'] + url = self.list_synchronization_detail.metadata['url'] # type: ignore 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'), @@ -410,25 +308,34 @@ def prepare_request(next_link=None): 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if orderby is not None: + query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_share_subscription_synchronization, 'ShareSubscriptionSynchronization') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + return request def extract_data(pipeline_response): - deserialized = self._deserialize('SourceShareSynchronizationSettingList', pipeline_response) + deserialized = self._deserialize('SynchronizationDetailsList', pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -443,14 +350,14 @@ def get_next(next_link=None): if response.status_code not in [200]: error = self._deserialize(models.DataShareError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged( get_next, extract_data ) - list_source_share_synchronization_setting.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/listSourceShareSynchronizationSettings'} + list_synchronization_detail.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/listSynchronizationDetails'} # type: ignore def list_synchronization( self, @@ -458,9 +365,11 @@ def list_synchronization( account_name, # type: str share_subscription_name, # type: str skip_token=None, # type: Optional[str] + filter=None, # type: Optional[str] + orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ShareSubscriptionSynchronizationList" + # type: (...) -> Iterable["models.ShareSubscriptionSynchronizationList"] """List synchronizations of a share subscription. List Synchronizations in a share subscription. @@ -473,19 +382,24 @@ def list_synchronization( :type share_subscription_name: str :param skip_token: Continuation token. :type skip_token: str + :param filter: Filters the results using OData syntax. + :type filter: str + :param orderby: Sorts the results using OData syntax. + :type orderby: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: ShareSubscriptionSynchronizationList or the result of cls(response) - :rtype: ~data_share_management_client.models.ShareSubscriptionSynchronizationList + :return: An iterator like instance of either ShareSubscriptionSynchronizationList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_share_management_client.models.ShareSubscriptionSynchronizationList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSubscriptionSynchronizationList"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_synchronization.metadata['url'] + url = self.list_synchronization.metadata['url'] # type: ignore 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'), @@ -493,15 +407,19 @@ def prepare_request(next_link=None): 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if orderby is not None: + query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -526,126 +444,34 @@ def get_next(next_link=None): if response.status_code not in [200]: error = self._deserialize(models.DataShareError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged( get_next, extract_data ) - list_synchronization.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/listSynchronizations'} + list_synchronization.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/listSynchronizations'} # type: ignore - def list_synchronization_detail( + def _synchronize_initial( self, resource_group_name, # type: str account_name, # type: str share_subscription_name, # type: str - synchronization_id, # type: str - skip_token=None, # type: Optional[str] + synchronization_mode=None, # type: Optional[Union[str, "models.SynchronizationMode"]] **kwargs # type: Any ): - # type: (...) -> "models.SynchronizationDetailsList" - """List synchronization details. - - List data set level details for a share subscription synchronization. + # type: (...) -> "models.ShareSubscriptionSynchronization" + cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSubscriptionSynchronization"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) - :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SynchronizationDetailsList or the result of cls(response) - :rtype: ~data_share_management_client.models.SynchronizationDetailsList - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SynchronizationDetailsList"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - _share_subscription_synchronization = models.ShareSubscriptionSynchronization(synchronization_id=synchronization_id) + _synchronize = models.Synchronize(synchronization_mode=synchronization_mode) api_version = "2019-11-01" - content_type = "application/json" - - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_synchronization_detail.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) - else: - url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' - - # Construct and send request - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_share_subscription_synchronization, 'ShareSubscriptionSynchronization') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('SynchronizationDetailsList', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(models.DataShareError, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_synchronization_detail.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/listSynchronizationDetails'} - - def _synchronize_initial( - self, - resource_group_name, # type: str - account_name, # type: str - share_subscription_name, # type: str - synchronization_mode=None, # type: Optional[Union[str, "models.SynchronizationMode"]] - **kwargs # type: Any - ): - # type: (...) -> "models.ShareSubscriptionSynchronization" - cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSubscriptionSynchronization"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - - _synchronize = models.Synchronize(synchronization_mode=synchronization_mode) - api_version = "2019-11-01" - content_type = kwargs.pop("content_type", "application/json") + content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._synchronize_initial.metadata['url'] + url = self._synchronize_initial.metadata['url'] # type: ignore 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'), @@ -675,7 +501,7 @@ def _synchronize_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -685,10 +511,10 @@ def _synchronize_initial( deserialized = self._deserialize('ShareSubscriptionSynchronization', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - _synchronize_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/Synchronize'} + _synchronize_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/Synchronize'} # type: ignore def begin_synchronize( self, @@ -698,7 +524,7 @@ def begin_synchronize( synchronization_mode=None, # type: Optional[Union[str, "models.SynchronizationMode"]] **kwargs # type: Any ): - # type: (...) -> "models.ShareSubscriptionSynchronization" + # type: (...) -> LROPoller """Initiate a copy. Initiate an asynchronous data share job. @@ -716,13 +542,17 @@ def begin_synchronize( :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod - :return: An instance of LROPoller that returns ShareSubscriptionSynchronization + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either ShareSubscriptionSynchronization or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~data_share_management_client.models.ShareSubscriptionSynchronization] - :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSubscriptionSynchronization"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._synchronize_initial( resource_group_name=resource_group_name, account_name=account_name, @@ -732,6 +562,9 @@ def begin_synchronize( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): deserialized = self._deserialize('ShareSubscriptionSynchronization', pipeline_response) @@ -739,34 +572,115 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) - if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_synchronize.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/Synchronize'} + begin_synchronize.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/Synchronize'} # type: ignore - def _cancel_synchronization_initial( + def get( self, resource_group_name, # type: str account_name, # type: str share_subscription_name, # type: str - synchronization_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ShareSubscriptionSynchronization" - cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSubscriptionSynchronization"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + # type: (...) -> "models.ShareSubscription" + """Get a shareSubscription in an account. - _share_subscription_synchronization = models.ShareSubscriptionSynchronization(synchronization_id=synchronization_id) + Get 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ShareSubscription, or the result of cls(response) + :rtype: ~data_share_management_client.models.ShareSubscription + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSubscription"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + 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 = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ShareSubscription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}'} # type: ignore + + def create( + self, + resource_group_name, # type: str + account_name, # type: str + share_subscription_name, # type: str + invitation_id, # type: str + source_share_location, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ShareSubscription" + """Create a shareSubscription in an account. + + Create 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 source_share_location: Source share location. + :type source_share_location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ShareSubscription, or the result of cls(response) + :rtype: ~data_share_management_client.models.ShareSubscription + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSubscription"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + _share_subscription = models.ShareSubscription(invitation_id=invitation_id, source_share_location=source_share_location) api_version = "2019-11-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._cancel_synchronization_initial.metadata['url'] + url = self.create.metadata['url'] # type: ignore 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'), @@ -786,43 +700,93 @@ def _cancel_synchronization_initial( # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_share_subscription_synchronization, 'ShareSubscriptionSynchronization') + body_content = self._serialize.body(_share_subscription, 'ShareSubscription') body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('ShareSubscriptionSynchronization', pipeline_response) + deserialized = self._deserialize('ShareSubscription', pipeline_response) - if response.status_code == 202: - deserialized = self._deserialize('ShareSubscriptionSynchronization', pipeline_response) + if response.status_code == 201: + deserialized = self._deserialize('ShareSubscription', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - _cancel_synchronization_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/cancelSynchronization'} + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}'} # type: ignore - def begin_cancel_synchronization( + def _delete_initial( self, resource_group_name, # type: str account_name, # type: str share_subscription_name, # type: str - synchronization_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ShareSubscriptionSynchronization" - """Request to cancel a synchronization. + # type: (...) -> "models.OperationResponse" + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResponse"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01" - Request cancellation of a data share snapshot. + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + 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 = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + account_name, # type: str + share_subscription_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller + """Delete a shareSubscription in an account. + + Delete shareSubscription in an account. :param resource_group_name: The resource group name. :type resource_group_name: str @@ -830,41 +794,131 @@ def begin_cancel_synchronization( :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 :keyword callable cls: A custom type or function that will be passed the direct response :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod - :return: An instance of LROPoller that returns ShareSubscriptionSynchronization - :rtype: ~azure.core.polling.LROPoller[~data_share_management_client.models.ShareSubscriptionSynchronization] - + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either OperationResponse or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~data_share_management_client.models.OperationResponse] :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSubscriptionSynchronization"] - raw_result = self._cancel_synchronization_initial( + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + raw_result = self._delete_initial( resource_group_name=resource_group_name, account_name=account_name, share_subscription_name=share_subscription_name, - synchronization_id=synchronization_id, cls=lambda x,y,z: x, **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): - deserialized = self._deserialize('ShareSubscriptionSynchronization', pipeline_response) + deserialized = self._deserialize('OperationResponse', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) - if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_cancel_synchronization.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/cancelSynchronization'} + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}'} # type: ignore + + def list_by_account( + self, + resource_group_name, # type: str + account_name, # type: str + skip_token=None, # type: Optional[str] + filter=None, # type: Optional[str] + orderby=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.ShareSubscriptionList"] + """List share subscriptions in an account. + + List of available share subscriptions under 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 filter: Filters the results using OData syntax. + :type filter: str + :param orderby: Sorts the results using OData syntax. + :type orderby: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ShareSubscriptionList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_share_management_client.models.ShareSubscriptionList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSubscriptionList"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_account.metadata['url'] # type: ignore + 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 = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if orderby is not None: + query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') + + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ShareSubscriptionList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions'} # type: ignore diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_synchronization_setting_operations.py b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_synchronization_setting_operations.py index 4b59370d08..699af05c14 100644 --- a/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_synchronization_setting_operations.py +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_synchronization_setting_operations.py @@ -5,7 +5,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import TYPE_CHECKING import warnings from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -13,11 +13,17 @@ from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class SynchronizationSettingOperations(object): """SynchronizationSettingOperations operations. @@ -63,16 +69,17 @@ def get( :param synchronization_setting_name: The name of the synchronizationSetting. :type synchronization_setting_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: SynchronizationSetting or the result of cls(response) + :return: SynchronizationSetting, or the result of cls(response) :rtype: ~data_share_management_client.models.SynchronizationSetting :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SynchronizationSetting"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore 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'), @@ -98,15 +105,15 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('SynchronizationSetting', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/synchronizationSettings/{synchronizationSettingName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/synchronizationSettings/{synchronizationSettingName}'} # type: ignore def create( self, @@ -133,17 +140,18 @@ def create( :param synchronization_setting: The new synchronization setting information. :type synchronization_setting: ~data_share_management_client.models.SynchronizationSetting :keyword callable cls: A custom type or function that will be passed the direct response - :return: SynchronizationSetting or the result of cls(response) - :rtype: ~data_share_management_client.models.SynchronizationSetting or ~data_share_management_client.models.SynchronizationSetting + :return: SynchronizationSetting, or the result of cls(response) + :rtype: ~data_share_management_client.models.SynchronizationSetting :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SynchronizationSetting"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.create.metadata['url'] + url = self.create.metadata['url'] # type: ignore 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'), @@ -174,7 +182,7 @@ def create( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -184,10 +192,10 @@ def create( deserialized = self._deserialize('SynchronizationSetting', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/synchronizationSettings/{synchronizationSettingName}'} + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/synchronizationSettings/{synchronizationSettingName}'} # type: ignore def _delete_initial( self, @@ -199,11 +207,12 @@ def _delete_initial( ): # type: (...) -> "models.OperationResponse" cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResponse"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" # Construct URL - url = self._delete_initial.metadata['url'] + url = self._delete_initial.metadata['url'] # type: ignore 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'), @@ -229,17 +238,17 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: deserialized = self._deserialize('OperationResponse', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/synchronizationSettings/{synchronizationSettingName}'} + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/synchronizationSettings/{synchronizationSettingName}'} # type: ignore def begin_delete( self, @@ -249,7 +258,7 @@ def begin_delete( synchronization_setting_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationResponse" + # type: (...) -> LROPoller """Delete a synchronizationSetting in a share. Delete synchronizationSetting in a share. @@ -266,13 +275,17 @@ def begin_delete( :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod - :return: An instance of LROPoller that returns OperationResponse + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either OperationResponse or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~data_share_management_client.models.OperationResponse] - :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._delete_initial( resource_group_name=resource_group_name, account_name=account_name, @@ -282,6 +295,9 @@ def begin_delete( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): deserialized = self._deserialize('OperationResponse', pipeline_response) @@ -289,15 +305,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) - if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/synchronizationSettings/{synchronizationSettingName}'} + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/synchronizationSettings/{synchronizationSettingName}'} # type: ignore def list_by_share( self, @@ -307,7 +319,7 @@ def list_by_share( skip_token=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.SynchronizationSettingList" + # type: (...) -> Iterable["models.SynchronizationSettingList"] """List synchronizationSettings in a share. List synchronizationSettings in a share. @@ -321,18 +333,19 @@ def list_by_share( :param skip_token: continuation token. :type skip_token: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: SynchronizationSettingList or the result of cls(response) - :rtype: ~data_share_management_client.models.SynchronizationSettingList + :return: An iterator like instance of either SynchronizationSettingList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_share_management_client.models.SynchronizationSettingList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SynchronizationSettingList"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_share.metadata['url'] + url = self.list_by_share.metadata['url'] # type: ignore 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'), @@ -340,15 +353,15 @@ def prepare_request(next_link=None): 'shareName': self._serialize.url("share_name", share_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -373,11 +386,11 @@ def get_next(next_link=None): if response.status_code not in [200]: error = self._deserialize(models.DataShareError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged( get_next, extract_data ) - list_by_share.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/synchronizationSettings'} + list_by_share.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/synchronizationSettings'} # type: ignore diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_trigger_operations.py b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_trigger_operations.py index 1bea3c38c3..46ddc44ddd 100644 --- a/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_trigger_operations.py +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_trigger_operations.py @@ -5,7 +5,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import TYPE_CHECKING import warnings from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -13,11 +13,17 @@ from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class TriggerOperations(object): """TriggerOperations operations. @@ -63,16 +69,17 @@ def get( :param trigger_name: The name of the trigger. :type trigger_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: Trigger or the result of cls(response) + :return: Trigger, or the result of cls(response) :rtype: ~data_share_management_client.models.Trigger :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Trigger"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore 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'), @@ -98,15 +105,15 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Trigger', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers/{triggerName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers/{triggerName}'} # type: ignore def _create_initial( self, @@ -119,12 +126,13 @@ def _create_initial( ): # type: (...) -> "models.Trigger" cls = kwargs.pop('cls', None) # type: ClsType["models.Trigger"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self._create_initial.metadata['url'] + url = self._create_initial.metadata['url'] # type: ignore 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'), @@ -155,7 +163,7 @@ def _create_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -165,10 +173,10 @@ def _create_initial( deserialized = self._deserialize('Trigger', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers/{triggerName}'} + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers/{triggerName}'} # type: ignore def begin_create( self, @@ -179,7 +187,7 @@ def begin_create( trigger, # type: "models.Trigger" **kwargs # type: Any ): - # type: (...) -> "models.Trigger" + # type: (...) -> LROPoller """Create a Trigger. This method creates a trigger for a share subscription. @@ -199,13 +207,17 @@ def begin_create( :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod - :return: An instance of LROPoller that returns Trigger + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Trigger or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~data_share_management_client.models.Trigger] - :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Trigger"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._create_initial( resource_group_name=resource_group_name, account_name=account_name, @@ -216,6 +228,9 @@ def begin_create( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): deserialized = self._deserialize('Trigger', pipeline_response) @@ -223,15 +238,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) - if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers/{triggerName}'} + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers/{triggerName}'} # type: ignore def _delete_initial( self, @@ -243,11 +254,12 @@ def _delete_initial( ): # type: (...) -> "models.OperationResponse" cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResponse"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" # Construct URL - url = self._delete_initial.metadata['url'] + url = self._delete_initial.metadata['url'] # type: ignore 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'), @@ -273,17 +285,17 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.DataShareError, response) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: deserialized = self._deserialize('OperationResponse', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers/{triggerName}'} + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers/{triggerName}'} # type: ignore def begin_delete( self, @@ -293,7 +305,7 @@ def begin_delete( trigger_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationResponse" + # type: (...) -> LROPoller """Delete a Trigger in a shareSubscription. Delete Trigger in a shareSubscription. @@ -310,13 +322,17 @@ def begin_delete( :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod - :return: An instance of LROPoller that returns OperationResponse + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either OperationResponse or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~data_share_management_client.models.OperationResponse] - :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) raw_result = self._delete_initial( resource_group_name=resource_group_name, account_name=account_name, @@ -326,6 +342,9 @@ def begin_delete( **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): deserialized = self._deserialize('OperationResponse', pipeline_response) @@ -333,15 +352,11 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.get( - 'polling_interval', - self._config.polling_interval - ) - if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers/{triggerName}'} + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers/{triggerName}'} # type: ignore def list_by_share_subscription( self, @@ -351,7 +366,7 @@ def list_by_share_subscription( skip_token=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.TriggerList" + # type: (...) -> Iterable["models.TriggerList"] """List Triggers in a share subscription. List Triggers in a share subscription. @@ -365,18 +380,19 @@ def list_by_share_subscription( :param skip_token: Continuation token. :type skip_token: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: TriggerList or the result of cls(response) - :rtype: ~data_share_management_client.models.TriggerList + :return: An iterator like instance of either TriggerList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~data_share_management_client.models.TriggerList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.TriggerList"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_share_subscription.metadata['url'] + url = self.list_by_share_subscription.metadata['url'] # type: ignore 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'), @@ -384,15 +400,15 @@ def prepare_request(next_link=None): 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -417,11 +433,11 @@ def get_next(next_link=None): if response.status_code not in [200]: error = self._deserialize(models.DataShareError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged( get_next, extract_data ) - list_by_share_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers'} + list_by_share_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers'} # type: ignore diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/py.typed b/src/datashare/azext_datashare/vendored_sdks/datashare/py.typed new file mode 100644 index 0000000000..e5aff4f83a --- /dev/null +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/src/datashare/report.md b/src/datashare/report.md index 652f8051a9..2f657ac472 100644 --- a/src/datashare/report.md +++ b/src/datashare/report.md @@ -6,478 +6,517 @@ create a datashare account. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--account_name**|string|The name of the share account.|account_name|account_name| -|**--identity**|object|Identity of resource|identity|identity| -|**--location**|string|Location of the azure resource.|location|location| -|**--tags**|dictionary|Tags on the azure resource.|tags|tags| +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--account-name**|string|The name of the share account.|account_name| +|**--location**|string|Location of the azure resource.|location| +|**--tags**|dictionary|Tags on the azure resource.|tags| ### datashare account delete delete a datashare account. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--account_name**|string|The name of the share account.|account_name|account_name| +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--account-name**|string|The name of the share account.|account_name| ### datashare account list list a datashare account. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--skip_token**|string|Continuation token|skip_token|skip_token| +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--skip-token**|string|Continuation token|skip_token| ### datashare account show show a datashare account. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--account_name**|string|The name of the share account.|account_name|account_name| +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--account-name**|string|The name of the share account.|account_name| ### datashare account update update a datashare account. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--account_name**|string|The name of the share account.|account_name|account_name| -|**--tags**|dictionary|Tags on the azure resource.|tags|tags| -### datashare consumer-invitation list +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--account-name**|string|The name of the share account.|account_name| +|**--tags**|dictionary|Tags on the azure resource.|tags| +### datashare consumer-invitation list-invitation -list a datashare consumer-invitation. +list-invitation a datashare consumer-invitation. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--skip_token**|string|Continuation token|skip_token|skip_token| +|**--skip-token**|string|The continuation token|skip_token| ### datashare consumer-invitation reject-invitation reject-invitation a datashare consumer-invitation. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--location**|string|Location of the invitation|location|location| -|**--invitation_id**|string|Unique id of the invitation.|invitation_id|properties_invitation_id| +|**--location**|string|Location of the invitation|location| +|**--invitation-id**|string|Unique id of the invitation.|invitation_id| ### datashare consumer-invitation show show a datashare consumer-invitation. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--location**|string|Location of the invitation|location|location| -|**--invitation_id**|string|An invitation id|invitation_id|invitation_id| +|**--location**|string|Location of the invitation|location| +|**--invitation-id**|string|An invitation id|invitation_id| ### datashare consumer-source-data-set list list a datashare consumer-source-data-set. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--account_name**|string|The name of the share account.|account_name|account_name| -|**--share_subscription_name**|string|The name of the shareSubscription.|share_subscription_name|share_subscription_name| -|**--skip_token**|string|Continuation token|skip_token|skip_token| +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--account-name**|string|The name of the share account.|account_name| +|**--share-subscription-name**|string|The name of the shareSubscription.|share_subscription_name| +|**--skip-token**|string|Continuation token|skip_token| ### datashare data-set create create a datashare data-set. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--account_name**|string|The name of the share account.|account_name|account_name| -|**--share_name**|string|The name of the share.|share_name|share_name| -|**--data_set_name**|string|The name of the dataSet.|data_set_name|data_set_name| -|**--kind**|choice|Kind of data set.|kind|kind| +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--account-name**|string|The name of the share account.|account_name| +|**--share-name**|string|The name of the share to add the data set to.|share_name| +|**--data-set-name**|string|The name of the dataSet.|data_set_name| +|**--a-d-l-s-gen1-file-data-set**|object|An ADLS Gen 1 file data set.|a_d_l_s_gen1_file_data_set| +|**--a-d-l-s-gen1-folder-data-set**|object|An ADLS Gen 1 folder data set.|a_d_l_s_gen1_folder_data_set| +|**--a-d-l-s-gen2-file-data-set**|object|An ADLS Gen 2 file data set.|a_d_l_s_gen2_file_data_set| +|**--a-d-l-s-gen2-file-system-data-set**|object|An ADLS Gen 2 file system data set.|a_d_l_s_gen2_file_system_data_set| +|**--a-d-l-s-gen2-folder-data-set**|object|An ADLS Gen 2 folder data set.|a_d_l_s_gen2_folder_data_set| +|**--blob-container-data-set**|object|An Azure storage blob container data set.|blob_container_data_set| +|**--blob-data-set**|object|An Azure storage blob data set.|blob_data_set| +|**--blob-folder-data-set**|object|An Azure storage blob folder data set.|blob_folder_data_set| +|**--kusto-cluster-data-set**|object|A kusto cluster data set.|kusto_cluster_data_set| +|**--kusto-database-data-set**|object|A kusto database data set.|kusto_database_data_set| +|**--sql-d-b-table-data-set**|object|A SQL DB table data set.|sql_d_b_table_data_set| +|**--sql-d-w-table-data-set**|object|A SQL DW table data set.|sql_d_w_table_data_set| ### datashare data-set delete delete a datashare data-set. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--account_name**|string|The name of the share account.|account_name|account_name| -|**--share_name**|string|The name of the share.|share_name|share_name| -|**--data_set_name**|string|The name of the dataSet.|data_set_name|data_set_name| +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--account-name**|string|The name of the share account.|account_name| +|**--share-name**|string|The name of the share.|share_name| +|**--data-set-name**|string|The name of the dataSet.|data_set_name| ### datashare data-set list list a datashare data-set. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--account_name**|string|The name of the share account.|account_name|account_name| -|**--share_name**|string|The name of the share.|share_name|share_name| -|**--skip_token**|string|Continuation token|skip_token|skip_token| +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--account-name**|string|The name of the share account.|account_name| +|**--share-name**|string|The name of the share.|share_name| +|**--skip-token**|string|continuation token|skip_token| +|**--filter**|string|Filters the results using OData syntax.|filter| +|**--orderby**|string|Sorts the results using OData syntax.|orderby| ### datashare data-set show show a datashare data-set. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--account_name**|string|The name of the share account.|account_name|account_name| -|**--share_name**|string|The name of the share.|share_name|share_name| -|**--data_set_name**|string|The name of the dataSet.|data_set_name|data_set_name| +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--account-name**|string|The name of the share account.|account_name| +|**--share-name**|string|The name of the share.|share_name| +|**--data-set-name**|string|The name of the dataSet.|data_set_name| ### datashare data-set-mapping create create a datashare data-set-mapping. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--account_name**|string|The name of the share account.|account_name|account_name| -|**--share_subscription_name**|string|The name of the shareSubscription.|share_subscription_name|share_subscription_name| -|**--data_set_mapping_name**|string|The name of the dataSetMapping.|data_set_mapping_name|data_set_mapping_name| -|**--kind**|choice|Kind of data set.|kind|kind| +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--account-name**|string|The name of the share account.|account_name| +|**--share-subscription-name**|string|The name of the share subscription which will hold the data set sink.|share_subscription_name| +|**--data-set-mapping-name**|string|The name of the data set mapping to be created.|data_set_mapping_name| +|**--a-d-l-s-gen2-file-data-set-mapping**|object|An ADLS Gen2 file data set mapping.|a_d_l_s_gen2_file_data_set_mapping| +|**--a-d-l-s-gen2-file-system-data-set-mapping**|object|An ADLS Gen2 file system data set mapping.|a_d_l_s_gen2_file_system_data_set_mapping| +|**--a-d-l-s-gen2-folder-data-set-mapping**|object|An ADLS Gen2 folder data set mapping.|a_d_l_s_gen2_folder_data_set_mapping| +|**--blob-container-data-set-mapping**|object|A Blob container data set mapping.|blob_container_data_set_mapping| +|**--blob-data-set-mapping**|object|A Blob data set mapping.|blob_data_set_mapping| +|**--blob-folder-data-set-mapping**|object|A Blob folder data set mapping.|blob_folder_data_set_mapping| +|**--kusto-cluster-data-set-mapping**|object|A Kusto cluster data set mapping|kusto_cluster_data_set_mapping| +|**--kusto-database-data-set-mapping**|object|A Kusto database data set mapping|kusto_database_data_set_mapping| +|**--sql-d-b-table-data-set-mapping**|object|A SQL DB Table data set mapping.|sql_d_b_table_data_set_mapping| +|**--sql-d-w-table-data-set-mapping**|object|A SQL DW Table data set mapping.|sql_d_w_table_data_set_mapping| ### datashare data-set-mapping delete delete a datashare data-set-mapping. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--account_name**|string|The name of the share account.|account_name|account_name| -|**--share_subscription_name**|string|The name of the shareSubscription.|share_subscription_name|share_subscription_name| -|**--data_set_mapping_name**|string|The name of the dataSetMapping.|data_set_mapping_name|data_set_mapping_name| +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--account-name**|string|The name of the share account.|account_name| +|**--share-subscription-name**|string|The name of the shareSubscription.|share_subscription_name| +|**--data-set-mapping-name**|string|The name of the dataSetMapping.|data_set_mapping_name| ### datashare data-set-mapping list list a datashare data-set-mapping. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--account_name**|string|The name of the share account.|account_name|account_name| -|**--share_subscription_name**|string|The name of the shareSubscription.|share_subscription_name|share_subscription_name| -|**--skip_token**|string|Continuation token|skip_token|skip_token| +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--account-name**|string|The name of the share account.|account_name| +|**--share-subscription-name**|string|The name of the share subscription.|share_subscription_name| +|**--skip-token**|string|Continuation token|skip_token| +|**--filter**|string|Filters the results using OData syntax.|filter| +|**--orderby**|string|Sorts the results using OData syntax.|orderby| ### datashare data-set-mapping show show a datashare data-set-mapping. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--account_name**|string|The name of the share account.|account_name|account_name| -|**--share_subscription_name**|string|The name of the shareSubscription.|share_subscription_name|share_subscription_name| -|**--data_set_mapping_name**|string|The name of the dataSetMapping.|data_set_mapping_name|data_set_mapping_name| +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--account-name**|string|The name of the share account.|account_name| +|**--share-subscription-name**|string|The name of the shareSubscription.|share_subscription_name| +|**--data-set-mapping-name**|string|The name of the dataSetMapping.|data_set_mapping_name| ### datashare invitation create create a datashare invitation. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--account_name**|string|The name of the share account.|account_name|account_name| -|**--share_name**|string|The name of the share.|share_name|share_name| -|**--invitation_name**|string|The name of the invitation.|invitation_name|invitation_name| -|**--target_active_directory_id**|string|The target Azure AD Id. Can't be combined with email.|target_active_directory_id|properties_target_active_directory_id| -|**--target_email**|string|The email the invitation is directed to.|target_email|properties_target_email| -|**--target_object_id**|string|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.|target_object_id|properties_target_object_id| +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--account-name**|string|The name of the share account.|account_name| +|**--share-name**|string|The name of the share to send the invitation for.|share_name| +|**--invitation-name**|string|The name of the invitation.|invitation_name| +|**--target-active-directory-id**|string|The target Azure AD Id. Can't be combined with email.|target_active_directory_id| +|**--target-email**|string|The email the invitation is directed to.|target_email| +|**--target-object-id**|string|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.|target_object_id| ### datashare invitation delete delete a datashare invitation. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--account_name**|string|The name of the share account.|account_name|account_name| -|**--share_name**|string|The name of the share.|share_name|share_name| -|**--invitation_name**|string|The name of the invitation.|invitation_name|invitation_name| +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--account-name**|string|The name of the share account.|account_name| +|**--share-name**|string|The name of the share.|share_name| +|**--invitation-name**|string|The name of the invitation.|invitation_name| ### datashare invitation list list a datashare invitation. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--account_name**|string|The name of the share account.|account_name|account_name| -|**--share_name**|string|The name of the share.|share_name|share_name| -|**--skip_token**|string|Continuation token|skip_token|skip_token| +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--account-name**|string|The name of the share account.|account_name| +|**--share-name**|string|The name of the share.|share_name| +|**--skip-token**|string|The continuation token|skip_token| +|**--filter**|string|Filters the results using OData syntax.|filter| +|**--orderby**|string|Sorts the results using OData syntax.|orderby| ### datashare invitation show show a datashare invitation. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--account_name**|string|The name of the share account.|account_name|account_name| -|**--share_name**|string|The name of the share.|share_name|share_name| -|**--invitation_name**|string|The name of the invitation.|invitation_name|invitation_name| +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--account-name**|string|The name of the share account.|account_name| +|**--share-name**|string|The name of the share.|share_name| +|**--invitation-name**|string|The name of the invitation.|invitation_name| +### datashare provider-share-subscription get-by-share + +get-by-share a datashare provider-share-subscription. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--account-name**|string|The name of the share account.|account_name| +|**--share-name**|string|The name of the share.|share_name| +|**--provider-share-subscription-id**|string|To locate shareSubscription|provider_share_subscription_id| ### datashare provider-share-subscription list list a datashare provider-share-subscription. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--account_name**|string|The name of the share account.|account_name|account_name| -|**--share_name**|string|The name of the share.|share_name|share_name| -|**--skip_token**|string|Continuation token|skip_token|skip_token| +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--account-name**|string|The name of the share account.|account_name| +|**--share-name**|string|The name of the share.|share_name| +|**--skip-token**|string|Continuation Token|skip_token| ### datashare provider-share-subscription reinstate reinstate a datashare provider-share-subscription. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--account_name**|string|The name of the share account.|account_name|account_name| -|**--share_name**|string|The name of the share.|share_name|share_name| -|**--provider_share_subscription_id**|string|To locate shareSubscription|provider_share_subscription_id|provider_share_subscription_id| +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--account-name**|string|The name of the share account.|account_name| +|**--share-name**|string|The name of the share.|share_name| +|**--provider-share-subscription-id**|string|To locate shareSubscription|provider_share_subscription_id| ### datashare provider-share-subscription revoke revoke a datashare provider-share-subscription. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--account_name**|string|The name of the share account.|account_name|account_name| -|**--share_name**|string|The name of the share.|share_name|share_name| -|**--provider_share_subscription_id**|string|To locate shareSubscription|provider_share_subscription_id|provider_share_subscription_id| -### datashare provider-share-subscription show - -show a datashare provider-share-subscription. - -|Option|Type|Description|Path (SDK)|Path (swagger)| -|------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--account_name**|string|The name of the share account.|account_name|account_name| -|**--share_name**|string|The name of the share.|share_name|share_name| -|**--provider_share_subscription_id**|string|To locate shareSubscription|provider_share_subscription_id|provider_share_subscription_id| +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--account-name**|string|The name of the share account.|account_name| +|**--share-name**|string|The name of the share.|share_name| +|**--provider-share-subscription-id**|string|To locate shareSubscription|provider_share_subscription_id| ### datashare share create create a datashare share. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--account_name**|string|The name of the share account.|account_name|account_name| -|**--share_name**|string|The name of the share.|share_name|share_name| -|**--description**|string|Share description.|description|properties_description| -|**--share_kind**|choice|Share kind.|share_kind|properties_share_kind| -|**--terms**|string|Share terms.|terms|properties_terms| +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--account-name**|string|The name of the share account.|account_name| +|**--share-name**|string|The name of the share.|share_name| +|**--description**|string|Share description.|description| +|**--share-kind**|choice|Share kind.|share_kind| +|**--terms**|string|Share terms.|terms| ### datashare share delete delete a datashare share. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--account_name**|string|The name of the share account.|account_name|account_name| -|**--share_name**|string|The name of the share.|share_name|share_name| +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--account-name**|string|The name of the share account.|account_name| +|**--share-name**|string|The name of the share.|share_name| ### datashare share list list a datashare share. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--account_name**|string|The name of the share account.|account_name|account_name| -|**--skip_token**|string|Continuation token|skip_token|skip_token| +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--account-name**|string|The name of the share account.|account_name| +|**--skip-token**|string|Continuation Token|skip_token| +|**--filter**|string|Filters the results using OData syntax.|filter| +|**--orderby**|string|Sorts the results using OData syntax.|orderby| ### datashare share list-synchronization list-synchronization a datashare share. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--account_name**|string|The name of the share account.|account_name|account_name| -|**--share_name**|string|The name of the share.|share_name|share_name| -|**--skip_token**|string|Continuation token|skip_token|skip_token| +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--account-name**|string|The name of the share account.|account_name| +|**--share-name**|string|The name of the share.|share_name| +|**--skip-token**|string|Continuation token|skip_token| +|**--filter**|string|Filters the results using OData syntax.|filter| +|**--orderby**|string|Sorts the results using OData syntax.|orderby| ### datashare share list-synchronization-detail list-synchronization-detail a datashare share. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--account_name**|string|The name of the share account.|account_name|account_name| -|**--share_name**|string|The name of the share.|share_name|share_name| -|**--skip_token**|string|Continuation token|skip_token|skip_token| -|**--consumer_email**|string|Email of the user who created the synchronization|consumer_email|consumer_email| -|**--consumer_name**|string|Name of the user who created the synchronization|consumer_name|consumer_name| -|**--consumer_tenant_name**|string|Tenant name of the consumer who created the synchronization|consumer_tenant_name|consumer_tenant_name| -|**--duration_ms**|integer|synchronization duration|duration_ms|duration_ms| -|**--end_time**|date-time|End time of synchronization|end_time|end_time| -|**--message**|string|message of synchronization|message|message| -|**--start_time**|date-time|start time of synchronization|start_time|start_time| -|**--status**|string|Raw Status|status|status| -|**--synchronization_id**|string|Synchronization id|synchronization_id|synchronization_id| +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--account-name**|string|The name of the share account.|account_name| +|**--share-name**|string|The name of the share.|share_name| +|**--skip-token**|string|Continuation token|skip_token| +|**--filter**|string|Filters the results using OData syntax.|filter| +|**--orderby**|string|Sorts the results using OData syntax.|orderby| +|**--consumer-email**|string|Email of the user who created the synchronization|consumer_email| +|**--consumer-name**|string|Name of the user who created the synchronization|consumer_name| +|**--consumer-tenant-name**|string|Tenant name of the consumer who created the synchronization|consumer_tenant_name| +|**--duration-ms**|integer|synchronization duration|duration_ms| +|**--end-time**|date-time|End time of synchronization|end_time| +|**--message**|string|message of synchronization|message| +|**--start-time**|date-time|start time of synchronization|start_time| +|**--status**|string|Raw Status|status| +|**--synchronization-id**|string|Synchronization id|synchronization_id| ### datashare share show show a datashare share. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--account_name**|string|The name of the share account.|account_name|account_name| -|**--share_name**|string|The name of the share.|share_name|share_name| +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--account-name**|string|The name of the share account.|account_name| +|**--share-name**|string|The name of the share to retrieve.|share_name| ### datashare share-subscription cancel-synchronization cancel-synchronization a datashare share-subscription. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--account_name**|string|The name of the share account.|account_name|account_name| -|**--share_subscription_name**|string|The name of the shareSubscription.|share_subscription_name|share_subscription_name| -|**--synchronization_id**|string|Synchronization id|synchronization_id|synchronization_id| +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--account-name**|string|The name of the share account.|account_name| +|**--share-subscription-name**|string|The name of the shareSubscription.|share_subscription_name| +|**--synchronization-id**|string|Synchronization id|synchronization_id| ### datashare share-subscription create create a datashare share-subscription. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--account_name**|string|The name of the share account.|account_name|account_name| -|**--share_subscription_name**|string|The name of the shareSubscription.|share_subscription_name|share_subscription_name| -|**--invitation_id**|string|The invitation id.|invitation_id|properties_invitation_id| -|**--source_share_location**|string|Source share location.|source_share_location|properties_source_share_location| +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--account-name**|string|The name of the share account.|account_name| +|**--share-subscription-name**|string|The name of the shareSubscription.|share_subscription_name| +|**--invitation-id**|string|The invitation id.|invitation_id| +|**--source-share-location**|string|Source share location.|source_share_location| ### datashare share-subscription delete delete a datashare share-subscription. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--account_name**|string|The name of the share account.|account_name|account_name| -|**--share_subscription_name**|string|The name of the shareSubscription.|share_subscription_name|share_subscription_name| +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--account-name**|string|The name of the share account.|account_name| +|**--share-subscription-name**|string|The name of the shareSubscription.|share_subscription_name| ### datashare share-subscription list list a datashare share-subscription. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--account_name**|string|The name of the share account.|account_name|account_name| -|**--skip_token**|string|Continuation token|skip_token|skip_token| +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--account-name**|string|The name of the share account.|account_name| +|**--skip-token**|string|Continuation Token|skip_token| +|**--filter**|string|Filters the results using OData syntax.|filter| +|**--orderby**|string|Sorts the results using OData syntax.|orderby| ### datashare share-subscription list-source-share-synchronization-setting list-source-share-synchronization-setting a datashare share-subscription. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--account_name**|string|The name of the share account.|account_name|account_name| -|**--share_subscription_name**|string|The name of the shareSubscription.|share_subscription_name|share_subscription_name| -|**--skip_token**|string|Continuation token|skip_token|skip_token| +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--account-name**|string|The name of the share account.|account_name| +|**--share-subscription-name**|string|The name of the shareSubscription.|share_subscription_name| +|**--skip-token**|string|Continuation token|skip_token| ### datashare share-subscription list-synchronization list-synchronization a datashare share-subscription. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--account_name**|string|The name of the share account.|account_name|account_name| -|**--share_subscription_name**|string|The name of the shareSubscription.|share_subscription_name|share_subscription_name| -|**--skip_token**|string|Continuation token|skip_token|skip_token| +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--account-name**|string|The name of the share account.|account_name| +|**--share-subscription-name**|string|The name of the share subscription.|share_subscription_name| +|**--skip-token**|string|Continuation token|skip_token| +|**--filter**|string|Filters the results using OData syntax.|filter| +|**--orderby**|string|Sorts the results using OData syntax.|orderby| ### datashare share-subscription list-synchronization-detail list-synchronization-detail a datashare share-subscription. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--account_name**|string|The name of the share account.|account_name|account_name| -|**--share_subscription_name**|string|The name of the shareSubscription.|share_subscription_name|share_subscription_name| -|**--synchronization_id**|string|Synchronization id|synchronization_id|synchronization_id| -|**--skip_token**|string|Continuation token|skip_token|skip_token| +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--account-name**|string|The name of the share account.|account_name| +|**--share-subscription-name**|string|The name of the share subscription.|share_subscription_name| +|**--synchronization-id**|string|Synchronization id|synchronization_id| +|**--skip-token**|string|Continuation token|skip_token| +|**--filter**|string|Filters the results using OData syntax.|filter| +|**--orderby**|string|Sorts the results using OData syntax.|orderby| ### datashare share-subscription show show a datashare share-subscription. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--account_name**|string|The name of the share account.|account_name|account_name| -|**--share_subscription_name**|string|The name of the shareSubscription.|share_subscription_name|share_subscription_name| +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--account-name**|string|The name of the share account.|account_name| +|**--share-subscription-name**|string|The name of the shareSubscription.|share_subscription_name| ### datashare share-subscription synchronize synchronize a datashare share-subscription. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--account_name**|string|The name of the share account.|account_name|account_name| -|**--share_subscription_name**|string|The name of the shareSubscription.|share_subscription_name|share_subscription_name| -|**--synchronization_mode**|choice|Synchronization mode|synchronization_mode|synchronization_mode| +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--account-name**|string|The name of the share account.|account_name| +|**--share-subscription-name**|string|The name of share subscription|share_subscription_name| +|**--synchronization-mode**|choice|Mode of synchronization used in triggers and snapshot sync. Incremental by default|synchronization_mode| ### datashare synchronization-setting create create a datashare synchronization-setting. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--account_name**|string|The name of the share account.|account_name|account_name| -|**--share_name**|string|The name of the share.|share_name|share_name| -|**--synchronization_setting_name**|string|The name of the synchronizationSetting.|synchronization_setting_name|synchronization_setting_name| -|**--kind**|choice|Kind of data set.|kind|kind| +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--account-name**|string|The name of the share account.|account_name| +|**--share-name**|string|The name of the share to add the synchronization setting to.|share_name| +|**--synchronization-setting-name**|string|The name of the synchronizationSetting.|synchronization_setting_name| +|**--scheduled-synchronization-setting**|object|A type of synchronization setting based on schedule|scheduled_synchronization_setting| ### datashare synchronization-setting delete delete a datashare synchronization-setting. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--account_name**|string|The name of the share account.|account_name|account_name| -|**--share_name**|string|The name of the share.|share_name|share_name| -|**--synchronization_setting_name**|string|The name of the synchronizationSetting.|synchronization_setting_name|synchronization_setting_name| +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--account-name**|string|The name of the share account.|account_name| +|**--share-name**|string|The name of the share.|share_name| +|**--synchronization-setting-name**|string|The name of the synchronizationSetting .|synchronization_setting_name| ### datashare synchronization-setting list list a datashare synchronization-setting. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--account_name**|string|The name of the share account.|account_name|account_name| -|**--share_name**|string|The name of the share.|share_name|share_name| -|**--skip_token**|string|Continuation token|skip_token|skip_token| +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--account-name**|string|The name of the share account.|account_name| +|**--share-name**|string|The name of the share.|share_name| +|**--skip-token**|string|continuation token|skip_token| ### datashare synchronization-setting show show a datashare synchronization-setting. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--account_name**|string|The name of the share account.|account_name|account_name| -|**--share_name**|string|The name of the share.|share_name|share_name| -|**--synchronization_setting_name**|string|The name of the synchronizationSetting.|synchronization_setting_name|synchronization_setting_name| +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--account-name**|string|The name of the share account.|account_name| +|**--share-name**|string|The name of the share.|share_name| +|**--synchronization-setting-name**|string|The name of the synchronizationSetting.|synchronization_setting_name| ### datashare trigger create create a datashare trigger. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--account_name**|string|The name of the share account.|account_name|account_name| -|**--share_subscription_name**|string|The name of the shareSubscription.|share_subscription_name|share_subscription_name| -|**--trigger_name**|string|The name of the trigger.|trigger_name|trigger_name| -|**--kind**|choice|Kind of data set.|kind|kind| +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--account-name**|string|The name of the share account.|account_name| +|**--share-subscription-name**|string|The name of the share subscription which will hold the data set sink.|share_subscription_name| +|**--trigger-name**|string|The name of the trigger.|trigger_name| +|**--scheduled-trigger**|object|A type of trigger based on schedule|scheduled_trigger| ### datashare trigger delete delete a datashare trigger. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--account_name**|string|The name of the share account.|account_name|account_name| -|**--share_subscription_name**|string|The name of the shareSubscription.|share_subscription_name|share_subscription_name| -|**--trigger_name**|string|The name of the trigger.|trigger_name|trigger_name| +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--account-name**|string|The name of the share account.|account_name| +|**--share-subscription-name**|string|The name of the shareSubscription.|share_subscription_name| +|**--trigger-name**|string|The name of the trigger.|trigger_name| ### datashare trigger list list a datashare trigger. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--account_name**|string|The name of the share account.|account_name|account_name| -|**--share_subscription_name**|string|The name of the shareSubscription.|share_subscription_name|share_subscription_name| -|**--skip_token**|string|Continuation token|skip_token|skip_token| +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--account-name**|string|The name of the share account.|account_name| +|**--share-subscription-name**|string|The name of the share subscription.|share_subscription_name| +|**--skip-token**|string|Continuation token|skip_token| ### datashare trigger show show a datashare trigger. |Option|Type|Description|Path (SDK)|Path (swagger)| |------|----|-----------|----------|--------------| -|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| -|**--account_name**|string|The name of the share account.|account_name|account_name| -|**--share_subscription_name**|string|The name of the shareSubscription.|share_subscription_name|share_subscription_name| -|**--trigger_name**|string|The name of the trigger.|trigger_name|trigger_name| \ No newline at end of file +|**--resource-group-name**|string|The resource group name.|resource_group_name| +|**--account-name**|string|The name of the share account.|account_name| +|**--share-subscription-name**|string|The name of the shareSubscription.|share_subscription_name| +|**--trigger-name**|string|The name of the trigger.|trigger_name| \ No newline at end of file diff --git a/src/datashare/setup.cfg b/src/datashare/setup.cfg index e69de29bb2..2fdd96e5d3 100644 --- a/src/datashare/setup.cfg +++ b/src/datashare/setup.cfg @@ -0,0 +1 @@ +#setup.cfg \ No newline at end of file diff --git a/src/datashare/setup.py b/src/datashare/setup.py index 172005632a..2c6281f3ad 100644 --- a/src/datashare/setup.py +++ b/src/datashare/setup.py @@ -8,15 +8,13 @@ from codecs import open from setuptools import setup, find_packages -try: - from azure_bdist_wheel import cmdclass -except ImportError: - from distutils import log as logger - logger.warn("Wheel is not available, disabling bdist_wheel hook") -# TODO: Confirm this is the right version number you want and it matches your # HISTORY.rst entry. VERSION = '0.1.0' +try: + from .manual.version import VERSION +except ImportError: + pass # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers @@ -32,8 +30,11 @@ 'License :: OSI Approved :: MIT License', ] -# TODO: Add any additional SDK dependencies here DEPENDENCIES = [] +try: + from .manual.dependency import DEPENDENCIES +except ImportError: + pass with open('README.md', 'r', encoding='utf-8') as f: README = f.read() @@ -44,11 +45,9 @@ name='datashare', version=VERSION, description='Microsoft Azure Command-Line Tools DataShareManagementClient Extension', - # TODO: Update author and email, if applicable author='Microsoft Corporation', author_email='azpycli@microsoft.com', - # TODO: consider pointing directly to your source code instead of the generic repo - url='https://github.com/Azure/azure-cli-extensions', + url='https://github.com/Azure/azure-cli-extensions/tree/master/src/datashare', long_description=README + '\n\n' + HISTORY, license='MIT', classifiers=CLASSIFIERS,