From c711aaba5c3309636a00efcb0df3aac951fe703d Mon Sep 17 00:00:00 2001 From: songlu <37168047+PARADISSEEKR@users.noreply.github.com> Date: Thu, 9 Sep 2021 10:15:19 +0800 Subject: [PATCH] [Purview] Purview GA Azure CLI request (#3814) * purview --- .github/CODEOWNERS | 2 + src/purview/HISTORY.rst | 8 + src/purview/README.md | 58 + src/purview/azext_purview/__init__.py | 52 + src/purview/azext_purview/_help.py | 20 + src/purview/azext_purview/action.py | 20 + src/purview/azext_purview/azext_metadata.json | 4 + src/purview/azext_purview/custom.py | 20 + .../azext_purview/generated/__init__.py | 12 + .../generated/_client_factory.py | 24 + src/purview/azext_purview/generated/_help.py | 151 ++ .../azext_purview/generated/_params.py | 97 ++ .../azext_purview/generated/_validators.py | 9 + src/purview/azext_purview/generated/action.py | 51 + .../azext_purview/generated/commands.py | 51 + src/purview/azext_purview/generated/custom.py | 157 ++ src/purview/azext_purview/manual/__init__.py | 12 + src/purview/azext_purview/manual/_help.py | 143 ++ src/purview/azext_purview/manual/_params.py | 52 + src/purview/azext_purview/manual/custom.py | 90 + src/purview/azext_purview/tests/__init__.py | 116 ++ .../azext_purview/tests/latest/__init__.py | 12 + .../recordings/test_purview_account.yaml | 934 +++++++++++ .../test_purview_default_account.yaml | 752 +++++++++ .../tests/latest/test_purview_scenario.py | 99 ++ .../azext_purview/vendored_sdks/__init__.py | 12 + .../vendored_sdks/purview/__init__.py | 19 + .../vendored_sdks/purview/_configuration.py | 71 + .../purview/_purview_management_client.py | 90 + .../vendored_sdks/purview/_version.py | 9 + .../vendored_sdks/purview/aio/__init__.py | 10 + .../purview/aio/_configuration.py | 67 + .../purview/aio/_purview_management_client.py | 84 + .../purview/aio/operations/__init__.py | 21 + .../aio/operations/_accounts_operations.py | 818 +++++++++ .../_default_accounts_operations.py | 222 +++ .../purview/aio/operations/_operations.py | 107 ++ ...private_endpoint_connections_operations.py | 447 +++++ .../_private_link_resources_operations.py | 184 +++ .../vendored_sdks/purview/models/__init__.py | 145 ++ .../vendored_sdks/purview/models/_models.py | 1365 +++++++++++++++ .../purview/models/_models_py3.py | 1472 +++++++++++++++++ .../_purview_management_client_enums.py | 103 ++ .../purview/operations/__init__.py | 21 + .../operations/_accounts_operations.py | 834 ++++++++++ .../_default_accounts_operations.py | 229 +++ .../purview/operations/_operations.py | 112 ++ ...private_endpoint_connections_operations.py | 457 +++++ .../_private_link_resources_operations.py | 190 +++ .../vendored_sdks/purview/py.typed | 1 + .../vendored_sdks/purview/setup.py | 37 + src/purview/report.md | 189 +++ src/purview/setup.cfg | 1 + src/purview/setup.py | 58 + src/service_name.json | 5 + 55 files changed, 10326 insertions(+) create mode 100644 src/purview/HISTORY.rst create mode 100644 src/purview/README.md create mode 100644 src/purview/azext_purview/__init__.py create mode 100644 src/purview/azext_purview/_help.py create mode 100644 src/purview/azext_purview/action.py create mode 100644 src/purview/azext_purview/azext_metadata.json create mode 100644 src/purview/azext_purview/custom.py create mode 100644 src/purview/azext_purview/generated/__init__.py create mode 100644 src/purview/azext_purview/generated/_client_factory.py create mode 100644 src/purview/azext_purview/generated/_help.py create mode 100644 src/purview/azext_purview/generated/_params.py create mode 100644 src/purview/azext_purview/generated/_validators.py create mode 100644 src/purview/azext_purview/generated/action.py create mode 100644 src/purview/azext_purview/generated/commands.py create mode 100644 src/purview/azext_purview/generated/custom.py create mode 100644 src/purview/azext_purview/manual/__init__.py create mode 100644 src/purview/azext_purview/manual/_help.py create mode 100644 src/purview/azext_purview/manual/_params.py create mode 100644 src/purview/azext_purview/manual/custom.py create mode 100644 src/purview/azext_purview/tests/__init__.py create mode 100644 src/purview/azext_purview/tests/latest/__init__.py create mode 100644 src/purview/azext_purview/tests/latest/recordings/test_purview_account.yaml create mode 100644 src/purview/azext_purview/tests/latest/recordings/test_purview_default_account.yaml create mode 100644 src/purview/azext_purview/tests/latest/test_purview_scenario.py create mode 100644 src/purview/azext_purview/vendored_sdks/__init__.py create mode 100644 src/purview/azext_purview/vendored_sdks/purview/__init__.py create mode 100644 src/purview/azext_purview/vendored_sdks/purview/_configuration.py create mode 100644 src/purview/azext_purview/vendored_sdks/purview/_purview_management_client.py create mode 100644 src/purview/azext_purview/vendored_sdks/purview/_version.py create mode 100644 src/purview/azext_purview/vendored_sdks/purview/aio/__init__.py create mode 100644 src/purview/azext_purview/vendored_sdks/purview/aio/_configuration.py create mode 100644 src/purview/azext_purview/vendored_sdks/purview/aio/_purview_management_client.py create mode 100644 src/purview/azext_purview/vendored_sdks/purview/aio/operations/__init__.py create mode 100644 src/purview/azext_purview/vendored_sdks/purview/aio/operations/_accounts_operations.py create mode 100644 src/purview/azext_purview/vendored_sdks/purview/aio/operations/_default_accounts_operations.py create mode 100644 src/purview/azext_purview/vendored_sdks/purview/aio/operations/_operations.py create mode 100644 src/purview/azext_purview/vendored_sdks/purview/aio/operations/_private_endpoint_connections_operations.py create mode 100644 src/purview/azext_purview/vendored_sdks/purview/aio/operations/_private_link_resources_operations.py create mode 100644 src/purview/azext_purview/vendored_sdks/purview/models/__init__.py create mode 100644 src/purview/azext_purview/vendored_sdks/purview/models/_models.py create mode 100644 src/purview/azext_purview/vendored_sdks/purview/models/_models_py3.py create mode 100644 src/purview/azext_purview/vendored_sdks/purview/models/_purview_management_client_enums.py create mode 100644 src/purview/azext_purview/vendored_sdks/purview/operations/__init__.py create mode 100644 src/purview/azext_purview/vendored_sdks/purview/operations/_accounts_operations.py create mode 100644 src/purview/azext_purview/vendored_sdks/purview/operations/_default_accounts_operations.py create mode 100644 src/purview/azext_purview/vendored_sdks/purview/operations/_operations.py create mode 100644 src/purview/azext_purview/vendored_sdks/purview/operations/_private_endpoint_connections_operations.py create mode 100644 src/purview/azext_purview/vendored_sdks/purview/operations/_private_link_resources_operations.py create mode 100644 src/purview/azext_purview/vendored_sdks/purview/py.typed create mode 100644 src/purview/azext_purview/vendored_sdks/purview/setup.py create mode 100644 src/purview/report.md create mode 100644 src/purview/setup.cfg create mode 100644 src/purview/setup.py diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 7642db5b941..56c4e000173 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -203,3 +203,5 @@ /src/dataprotection/ @sambitratha /src/authV2/ @mkarmark + +/src/purview/ @kairu-ms @jsntcy diff --git a/src/purview/HISTORY.rst b/src/purview/HISTORY.rst new file mode 100644 index 00000000000..1c139576ba0 --- /dev/null +++ b/src/purview/HISTORY.rst @@ -0,0 +1,8 @@ +.. :changelog: + +Release History +=============== + +0.1.0 +++++++ +* Initial release. diff --git a/src/purview/README.md b/src/purview/README.md new file mode 100644 index 00000000000..990934011a2 --- /dev/null +++ b/src/purview/README.md @@ -0,0 +1,58 @@ +# Azure CLI purview Extension # +This is the extension for purview + +### How to use ### +Install this extension using the below CLI command +``` +az extension add --name purview +``` + +### Included Features ### +#### purview account #### +##### Create ##### +``` +az purview account create --location "WestUS2" --managed-group-name "custom-rgname" \ + --name "account1" --resource-group "SampleResourceGroup" + +az purview account wait --created --name "{myAccount}" --resource-group "{rg}" +``` +##### Show ##### +``` +az purview account show --name "account1" --resource-group "SampleResourceGroup" +``` +##### List ##### +``` +az purview account list --resource-group "SampleResourceGroup" +``` +##### Update ##### +``` +az purview account update --name "account1" --tags newTag="New tag value." --resource-group "SampleResourceGroup" +``` +##### Add-root-collection-admin ##### +``` +az purview account add-root-collection-admin --name "account1" --object-id "7e8de0e7-2bfc-4e1f-9659-2a5785e4356f" \ + --resource-group "SampleResourceGroup" +``` +##### List-key ##### +``` +az purview account list-key --name "account1" --resource-group "SampleResourceGroup" +``` +##### Delete ##### +``` +az purview account delete --name "account1" --resource-group "SampleResourceGroup" +``` +#### purview default-account #### +##### Show ##### +``` +az purview default-account show --subscription-id "12345678-1234-1234-12345678abc" \ + --scope-tenant-id "12345678-1234-1234-12345678abc" +``` +##### Remove ##### +``` +az purview default-account remove --scope-tenant-id "12345678-1234-1234-12345678abc" --scope-type "Tenant" +``` +##### Set ##### +``` +az purview default-account set --account-name "myDefaultAccount" --resource-group "rg-1" \ + --scope-tenant-id "12345678-1234-1234-12345678abc" --scope-type "Tenant" +``` \ No newline at end of file diff --git a/src/purview/azext_purview/__init__.py b/src/purview/azext_purview/__init__.py new file mode 100644 index 00000000000..1e255bb10fc --- /dev/null +++ b/src/purview/azext_purview/__init__.py @@ -0,0 +1,52 @@ +# -------------------------------------------------------------------------- +# 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=unused-import + +import azext_purview._help +from azure.cli.core import AzCommandsLoader + + +class PurviewManagementClientCommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + from azext_purview.generated._client_factory import cf_purview_cl + purview_custom = CliCommandType( + operations_tmpl='azext_purview.custom#{}', + client_factory=cf_purview_cl) + super().__init__(cli_ctx=cli_ctx, custom_command_type=purview_custom) + + def load_command_table(self, args): + from azext_purview.generated.commands import load_command_table + load_command_table(self, args) + try: + from azext_purview.manual.commands import load_command_table as load_command_table_manual + load_command_table_manual(self, args) + except ImportError as e: + if e.name.endswith('manual.commands'): + pass + else: + raise e + return self.command_table + + def load_arguments(self, command): + from azext_purview.generated._params import load_arguments + load_arguments(self, command) + try: + from azext_purview.manual._params import load_arguments as load_arguments_manual + load_arguments_manual(self, command) + except ImportError as e: + if e.name.endswith('manual._params'): + pass + else: + raise e + + +COMMAND_LOADER_CLS = PurviewManagementClientCommandsLoader diff --git a/src/purview/azext_purview/_help.py b/src/purview/azext_purview/_help.py new file mode 100644 index 00000000000..9b93f87a6e9 --- /dev/null +++ b/src/purview/azext_purview/_help.py @@ -0,0 +1,20 @@ +# -------------------------------------------------------------------------- +# 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 +# pylint: disable=unused-import +from .generated._help import helps # pylint: disable=reimported +try: + from .manual._help import helps # pylint: disable=reimported +except ImportError as e: + if e.name.endswith('manual._help'): + pass + else: + raise e diff --git a/src/purview/azext_purview/action.py b/src/purview/azext_purview/action.py new file mode 100644 index 00000000000..9b3d0a8a78c --- /dev/null +++ b/src/purview/azext_purview/action.py @@ -0,0 +1,20 @@ +# -------------------------------------------------------------------------- +# 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.action import * # noqa: F403 +try: + from .manual.action import * # noqa: F403 +except ImportError as e: + if e.name.endswith('manual.action'): + pass + else: + raise e diff --git a/src/purview/azext_purview/azext_metadata.json b/src/purview/azext_purview/azext_metadata.json new file mode 100644 index 00000000000..cf7b8927a07 --- /dev/null +++ b/src/purview/azext_purview/azext_metadata.json @@ -0,0 +1,4 @@ +{ + "azext.isPreview": true, + "azext.minCliCoreVersion": "2.15.0" +} diff --git a/src/purview/azext_purview/custom.py b/src/purview/azext_purview/custom.py new file mode 100644 index 00000000000..885447229d6 --- /dev/null +++ b/src/purview/azext_purview/custom.py @@ -0,0 +1,20 @@ +# -------------------------------------------------------------------------- +# 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 as e: + if e.name.endswith('manual.custom'): + pass + else: + raise e diff --git a/src/purview/azext_purview/generated/__init__.py b/src/purview/azext_purview/generated/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/purview/azext_purview/generated/__init__.py @@ -0,0 +1,12 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/purview/azext_purview/generated/_client_factory.py b/src/purview/azext_purview/generated/_client_factory.py new file mode 100644 index 00000000000..1053c022a1c --- /dev/null +++ b/src/purview/azext_purview/generated/_client_factory.py @@ -0,0 +1,24 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- + + +def cf_purview_cl(cli_ctx, *_): + from azure.cli.core.commands.client_factory import get_mgmt_service_client + from azext_purview.vendored_sdks.purview import PurviewManagementClient + return get_mgmt_service_client(cli_ctx, + PurviewManagementClient) + + +def cf_account(cli_ctx, *_): + return cf_purview_cl(cli_ctx).accounts + + +def cf_default_account(cli_ctx, *_): + return cf_purview_cl(cli_ctx).default_accounts diff --git a/src/purview/azext_purview/generated/_help.py b/src/purview/azext_purview/generated/_help.py new file mode 100644 index 00000000000..fb8eac16fa1 --- /dev/null +++ b/src/purview/azext_purview/generated/_help.py @@ -0,0 +1,151 @@ +# -------------------------------------------------------------------------- +# 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['purview'] = ''' + type: group + short-summary: Manage Purview +''' + +helps['purview account'] = """ + type: group + short-summary: Manage account with purview +""" + +helps['purview account list'] = """ + type: command + short-summary: "List accounts in ResourceGroup And List accounts in Subscription." + examples: + - name: Accounts_ListByResourceGroup + text: |- + az purview account list --resource-group "SampleResourceGroup" + - name: Accounts_ListBySubscription + text: |- + az purview account list +""" + +helps['purview account show'] = """ + type: command + short-summary: "Get an account." + examples: + - name: Accounts_Get + text: |- + az purview account show --name "account1" --resource-group "SampleResourceGroup" +""" + +helps['purview account create'] = """ + type: command + short-summary: "Create an account." + parameters: + - name: --sku + short-summary: "Gets or sets the Sku." + long-summary: | + Usage: --sku capacity=XX name=XX + + capacity: Gets or sets the sku capacity. Possible values include: 4, 16 + name: Gets or sets the sku name. + examples: + - name: Accounts_CreateOrUpdate + text: |- + az purview account create --location "West US 2" --managed-resource-group-name "custom-rgname" --sku \ +name="Standard" capacity=4 --name "account1" --resource-group "SampleResourceGroup" +""" + +helps['purview account update'] = """ + type: command + short-summary: "Updates an account." + examples: + - name: Accounts_Update + text: |- + az purview account update --name "account1" --tags newTag="New tag value." --resource-group \ +"SampleResourceGroup" +""" + +helps['purview account delete'] = """ + type: command + short-summary: "Deletes an account resource." + examples: + - name: Accounts_Delete + text: |- + az purview account delete --name "account1" --resource-group "SampleResourceGroup" +""" + +helps['purview account add-root-collection-admin'] = """ + type: command + short-summary: "Add the administrator for root collection associated with this account." + examples: + - name: Accounts_AddRootCollectionAdmin + text: |- + az purview account add-root-collection-admin --name "account1" --object-id \ +"7e8de0e7-2bfc-4e1f-9659-2a5785e4356f" --resource-group "SampleResourceGroup" +""" + +helps['purview account list-key'] = """ + type: command + short-summary: "List the authorization keys associated with this account." + examples: + - name: Accounts_ListKeys + text: |- + az purview account list-key --name "account1" --resource-group "SampleResourceGroup" +""" + +helps['purview account wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the purview account is met. + examples: + - name: Pause executing next line of CLI script until the purview account is successfully created. + text: |- + az purview account wait --name "account1" --resource-group "SampleResourceGroup" --created + - name: Pause executing next line of CLI script until the purview account is successfully updated. + text: |- + az purview account wait --name "account1" --resource-group "SampleResourceGroup" --updated + - name: Pause executing next line of CLI script until the purview account is successfully deleted. + text: |- + az purview account wait --name "account1" --resource-group "SampleResourceGroup" --deleted +""" + +helps['purview default-account'] = """ + type: group + short-summary: Manage default account with purview +""" + +helps['purview default-account show'] = """ + type: command + short-summary: "Get the default account for the scope." + examples: + - name: DefaultAccounts_Get + text: |- + az purview default-account show --scope "12345678-1234-1234-12345678abc" --scope-tenant-id \ +"12345678-1234-1234-12345678abc" --scope-type "Tenant" +""" + +helps['purview default-account remove'] = """ + type: command + short-summary: "Removes the default account from the scope." + examples: + - name: DefaultAccounts_Remove + text: |- + az purview default-account remove --scope "12345678-1234-1234-12345678abc" --scope-tenant-id \ +"12345678-1234-1234-12345678abc" --scope-type "Tenant" +""" + +helps['purview default-account set'] = """ + type: command + short-summary: "Sets the default account for the scope." + examples: + - name: DefaultAccounts_Set + text: |- + az purview default-account set --account-name "myDefaultAccount" --resource-group "rg-1" --scope \ +"12345678-1234-1234-12345678abc" --scope-tenant-id "12345678-1234-1234-12345678abc" --scope-type "Tenant" \ +--subscription-id "12345678-1234-1234-12345678aaa" +""" diff --git a/src/purview/azext_purview/generated/_params.py b/src/purview/azext_purview/generated/_params.py new file mode 100644 index 00000000000..b3a6d19091f --- /dev/null +++ b/src/purview/azext_purview/generated/_params.py @@ -0,0 +1,97 @@ +# -------------------------------------------------------------------------- +# 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_purview.action import AddSku + + +def load_arguments(self, _): + + with self.argument_context('purview account list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('skip_token', type=str, help='The skip token.') + + with self.argument_context('purview account show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', options_list=['--name', '-n', '--account-name'], type=str, help='The name of the ' + 'account.', id_part='name') + + with self.argument_context('purview account create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', options_list=['--name', '-n', '--account-name'], type=str, help='The name of the ' + 'account.') + c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, + validator=get_default_location_from_resource_group) + c.argument('tags', tags_type) + c.argument('sku', action=AddSku, nargs='+', help='Gets or sets the Sku.') + c.argument('managed_resource_group_name', type=str, help='Gets or sets the managed resource group name') + c.argument('public_network_access', arg_type=get_enum_type(['NotSpecified', 'Enabled', 'Disabled']), + help='Gets or sets the public network access.') + + with self.argument_context('purview account update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', options_list=['--name', '-n', '--account-name'], type=str, help='The name of the ' + 'account.', id_part='name') + c.argument('tags', tags_type) + c.argument('managed_resource_group_name', type=str, help='Gets or sets the managed resource group name') + c.argument('public_network_access', arg_type=get_enum_type(['NotSpecified', 'Enabled', 'Disabled']), + help='Gets or sets the public network access.') + + with self.argument_context('purview account delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', options_list=['--name', '-n', '--account-name'], type=str, help='The name of the ' + 'account.', id_part='name') + + with self.argument_context('purview account add-root-collection-admin') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', options_list=['--name', '-n', '--account-name'], type=str, help='The name of the ' + 'account.', id_part='name') + c.argument('object_id', type=str, help='Gets or sets the object identifier of the admin.') + + with self.argument_context('purview account list-key') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', options_list=['--name', '-n', '--account-name'], type=str, help='The name of the ' + 'account.') + + with self.argument_context('purview account wait') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', options_list=['--name', '-n', '--account-name'], type=str, help='The name of the ' + 'account.', id_part='name') + + with self.argument_context('purview default-account show') as c: + c.argument('scope_tenant_id', help='The tenant ID.') + c.argument('scope_type', arg_type=get_enum_type(['Tenant', 'Subscription']), help='The scope for the default ' + 'account.') + c.argument('scope', type=str, help='The Id of the scope object, for example if the scope is "Subscription" ' + 'then it is the ID of that subscription.') + + with self.argument_context('purview default-account remove') as c: + c.argument('scope_tenant_id', help='The tenant ID.') + c.argument('scope_type', arg_type=get_enum_type(['Tenant', 'Subscription']), help='The scope for the default ' + 'account.') + c.argument('scope', type=str, help='The Id of the scope object, for example if the scope is "Subscription" ' + 'then it is the ID of that subscription.') + + with self.argument_context('purview default-account set') as c: + c.argument('account_name', type=str, help='The name of the account that is set as the default.') + c.argument('resource_group_name', resource_group_name_type) + c.argument('scope', type=str, help='The scope object ID. For example, sub ID or tenant ID.') + c.argument('scope_tenant_id', type=str, help='The scope tenant in which the default account is set.') + c.argument('scope_type', arg_type=get_enum_type(['Tenant', 'Subscription']), help='The scope where the default ' + 'account is set.') + c.argument('subscription_id', type=str, help='The subscription ID of the account that is set as the default.') diff --git a/src/purview/azext_purview/generated/_validators.py b/src/purview/azext_purview/generated/_validators.py new file mode 100644 index 00000000000..b33a44c1ebf --- /dev/null +++ b/src/purview/azext_purview/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/purview/azext_purview/generated/action.py b/src/purview/azext_purview/generated/action.py new file mode 100644 index 00000000000..571d0f92b47 --- /dev/null +++ b/src/purview/azext_purview/generated/action.py @@ -0,0 +1,51 @@ +# -------------------------------------------------------------------------- +# 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 + +# pylint: disable=no-self-use + + +import argparse +from collections import defaultdict +from knack.util import CLIError + + +class AddSku(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.sku = action + + def get_action(self, values, option_string): + 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 == 'capacity': + d['capacity'] = v[0] + + elif kl == 'name': + d['name'] = v[0] + + else: + raise CLIError( + 'Unsupported Key {} is provided for parameter sku. All possible keys are: capacity, name'.format(k) + ) + + return d diff --git a/src/purview/azext_purview/generated/commands.py b/src/purview/azext_purview/generated/commands.py new file mode 100644 index 00000000000..6d97c0e2862 --- /dev/null +++ b/src/purview/azext_purview/generated/commands.py @@ -0,0 +1,51 @@ +# -------------------------------------------------------------------------- +# 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-statements +# pylint: disable=too-many-locals +# pylint: disable=bad-continuation +# pylint: disable=line-too-long + +from azure.cli.core.commands import CliCommandType +from azext_purview.generated._client_factory import cf_account, cf_default_account + + +purview_account = CliCommandType( + operations_tmpl='azext_purview.vendored_sdks.purview.operations._accounts_operations#AccountsOperations.{}', + client_factory=cf_account, +) + + +purview_default_account = CliCommandType( + operations_tmpl=( + 'azext_purview.vendored_sdks.purview.operations._default_accounts_operations#DefaultAccountsOperations.{}' + ), + client_factory=cf_default_account, +) + + +def load_command_table(self, _): + + with self.command_group('purview account', purview_account, client_factory=cf_account) as g: + g.custom_command('list', 'purview_account_list') + g.custom_show_command('show', 'purview_account_show') + g.custom_command('create', 'purview_account_create', supports_no_wait=True) + g.custom_command('update', 'purview_account_update', supports_no_wait=True) + g.custom_command('delete', 'purview_account_delete', supports_no_wait=True, confirmation=True) + g.custom_command('add-root-collection-admin', 'purview_account_add_root_collection_admin') + g.custom_command('list-key', 'purview_account_list_key') + g.custom_wait_command('wait', 'purview_account_show') + + with self.command_group('purview default-account', purview_default_account, client_factory=cf_default_account) as g: + g.custom_show_command('show', 'purview_default_account_show') + g.custom_command('remove', 'purview_default_account_remove') + g.custom_command('set', 'purview_default_account_set') + + with self.command_group('purview', is_preview=True): + pass diff --git a/src/purview/azext_purview/generated/custom.py b/src/purview/azext_purview/generated/custom.py new file mode 100644 index 00000000000..9ea3f541dca --- /dev/null +++ b/src/purview/azext_purview/generated/custom.py @@ -0,0 +1,157 @@ +# -------------------------------------------------------------------------- +# 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 azure.cli.core.util import sdk_no_wait + + +def purview_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 purview_account_show(client, + resource_group_name, + account_name): + return client.get(resource_group_name=resource_group_name, + account_name=account_name) + + +def purview_account_create(client, + resource_group_name, + account_name, + location=None, + tags=None, + sku=None, + managed_resource_group_name=None, + public_network_access=None, + no_wait=False): + account = {} + if location is not None: + account['location'] = location + if tags is not None: + account['tags'] = tags + account['identity'] = {} + account['identity']['type'] = "SystemAssigned" + if len(account['identity']) == 0: + del account['identity'] + if sku is not None: + account['sku'] = sku + if managed_resource_group_name is not None: + account['managed_resource_group_name'] = managed_resource_group_name + if public_network_access is not None: + account['public_network_access'] = public_network_access + else: + account['public_network_access'] = "Enabled" + return sdk_no_wait(no_wait, + client.begin_create_or_update, + resource_group_name=resource_group_name, + account_name=account_name, + account=account) + + +def purview_account_update(client, + resource_group_name, + account_name, + tags=None, + managed_resource_group_name=None, + public_network_access=None, + no_wait=False): + account_update_parameters = {} + if tags is not None: + account_update_parameters['tags'] = tags + account_update_parameters['properties'] = {} + if managed_resource_group_name is not None: + account_update_parameters['properties']['managed_resource_group_name'] = managed_resource_group_name + if public_network_access is not None: + account_update_parameters['properties']['public_network_access'] = public_network_access + else: + account_update_parameters['properties']['public_network_access'] = "Enabled" + if len(account_update_parameters['properties']) == 0: + del account_update_parameters['properties'] + return sdk_no_wait(no_wait, + client.begin_update, + resource_group_name=resource_group_name, + account_name=account_name, + account_update_parameters=account_update_parameters) + + +def purview_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 purview_account_add_root_collection_admin(client, + resource_group_name, + account_name, + object_id=None): + collection_admin_update = {} + if object_id is not None: + collection_admin_update['object_id'] = object_id + return client.add_root_collection_admin(resource_group_name=resource_group_name, + account_name=account_name, + collection_admin_update=collection_admin_update) + + +def purview_account_list_key(client, + resource_group_name, + account_name): + return client.list_keys(resource_group_name=resource_group_name, + account_name=account_name) + + +def purview_default_account_show(client, + scope_tenant_id, + scope_type, + scope=None): + return client.get(scope_tenant_id=scope_tenant_id, + scope_type=scope_type, + scope=scope) + + +def purview_default_account_remove(client, + scope_tenant_id, + scope_type, + scope=None): + return client.remove(scope_tenant_id=scope_tenant_id, + scope_type=scope_type, + scope=scope) + + +def purview_default_account_set(client, + account_name=None, + resource_group_name=None, + scope=None, + scope_tenant_id=None, + scope_type=None, + subscription_id=None): + default_account_payload = {} + if account_name is not None: + default_account_payload['account_name'] = account_name + if resource_group_name is not None: + default_account_payload['resource_group_name'] = resource_group_name + if scope is not None: + default_account_payload['scope'] = scope + if scope_tenant_id is not None: + default_account_payload['scope_tenant_id'] = scope_tenant_id + if scope_type is not None: + default_account_payload['scope_type'] = scope_type + if subscription_id is not None: + default_account_payload['subscription_id'] = subscription_id + return client.set(default_account_payload=default_account_payload) diff --git a/src/purview/azext_purview/manual/__init__.py b/src/purview/azext_purview/manual/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/purview/azext_purview/manual/__init__.py @@ -0,0 +1,12 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/purview/azext_purview/manual/_help.py b/src/purview/azext_purview/manual/_help.py new file mode 100644 index 00000000000..0508662c698 --- /dev/null +++ b/src/purview/azext_purview/manual/_help.py @@ -0,0 +1,143 @@ +# -------------------------------------------------------------------------- +# 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['purview'] = ''' + type: group + short-summary: Manage Purview +''' + +helps['purview account'] = """ + type: group + short-summary: Manage account with purview +""" + +helps['purview account list'] = """ + type: command + short-summary: "List accounts in ResourceGroup And List accounts in Subscription." + examples: + - name: Accounts_ListByResourceGroup + text: |- + az purview account list --resource-group "SampleResourceGroup" + - name: Accounts_ListBySubscription + text: |- + az purview account list +""" + +helps['purview account show'] = """ + type: command + short-summary: "Get an account." + examples: + - name: Accounts_Get + text: |- + az purview account show --name "account1" --resource-group "SampleResourceGroup" +""" + +helps['purview account create'] = """ + type: command + short-summary: "Create an account." + examples: + - name: Accounts_CreateOrUpdate + text: |- + az purview account create --location "WestUS2" --managed-group-name "custom-rgname" \ + --name "account1" --resource-group "SampleResourceGroup" +""" + +helps['purview account update'] = """ + type: command + short-summary: "Updates an account." + examples: + - name: Accounts_Update + text: |- + az purview account update --name "account1" --tags newTag="New tag value." --resource-group \ +"SampleResourceGroup" +""" + +helps['purview account delete'] = """ + type: command + short-summary: "Deletes an account resource." + examples: + - name: Accounts_Delete + text: |- + az purview account delete --name "account1" --resource-group "SampleResourceGroup" +""" + +helps['purview account add-root-collection-admin'] = """ + type: command + short-summary: "Add the administrator for root collection associated with this account." + examples: + - name: Accounts_AddRootCollectionAdmin + text: |- + az purview account add-root-collection-admin --name "account1" --object-id \ +"7e8de0e7-2bfc-4e1f-9659-2a5785e4356f" --resource-group "SampleResourceGroup" +""" + +helps['purview account list-key'] = """ + type: command + short-summary: "List the authorization keys associated with this account." + examples: + - name: Accounts_ListKeys + text: |- + az purview account list-key --name "account1" --resource-group "SampleResourceGroup" +""" + +helps['purview account wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the purview account is met. + examples: + - name: Pause executing next line of CLI script until the purview account is successfully created. + text: |- + az purview account wait --name "account1" --resource-group "SampleResourceGroup" --created + - name: Pause executing next line of CLI script until the purview account is successfully updated. + text: |- + az purview account wait --name "account1" --resource-group "SampleResourceGroup" --updated + - name: Pause executing next line of CLI script until the purview account is successfully deleted. + text: |- + az purview account wait --name "account1" --resource-group "SampleResourceGroup" --deleted +""" + +helps['purview default-account'] = """ + type: group + short-summary: Manage default account with purview +""" + +helps['purview default-account show'] = """ + type: command + short-summary: "Get the default account for the scope." + examples: + - name: DefaultAccounts_Get + text: |- + az purview default-account show --scope "12345678-1234-1234-12345678abc" --scope-tenant-id \ +"12345678-1234-1234-12345678abc" --scope-type "Tenant" +""" + +helps['purview default-account remove'] = """ + type: command + short-summary: "Removes the default account from the scope." + examples: + - name: DefaultAccounts_Remove + text: |- + az purview default-account remove --scope "12345678-1234-1234-12345678abc" --scope-tenant-id \ +"12345678-1234-1234-12345678abc" --scope-type "Tenant" +""" + +helps['purview default-account set'] = """ + type: command + short-summary: "Sets the default account for the scope." + examples: + - name: DefaultAccounts_Set + text: |- + az purview default-account set --account-name "myDefaultAccount" --resource-group "rg-1" --scope \ +"12345678-1234-1234-12345678abc" --scope-tenant-id "12345678-1234-1234-12345678abc" --scope-type "Tenant" \ +--subscription-id "12345678-1234-1234-12345678aaa" +""" diff --git a/src/purview/azext_purview/manual/_params.py b/src/purview/azext_purview/manual/_params.py new file mode 100644 index 00000000000..01fa6fff82e --- /dev/null +++ b/src/purview/azext_purview/manual/_params.py @@ -0,0 +1,52 @@ +# -------------------------------------------------------------------------- +# 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 + + +def load_arguments(self, _): + + with self.argument_context('purview account create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', options_list=['--name', '-n', '--account-name'], type=str, help='The name of the ' + 'account.') + c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, + validator=get_default_location_from_resource_group) + c.argument('tags', tags_type) + c.argument('managed_group_name', type=str, help='Gets or sets the managed resource group name') + c.argument('public_network_access', arg_type=get_enum_type(['NotSpecified', 'Enabled', 'Disabled']), + help='Gets or sets the public network access.') + + with self.argument_context('purview account update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', options_list=['--name', '-n', '--account-name'], type=str, help='The name of the ' + 'account.', id_part='name') + c.argument('tags', tags_type) + c.argument('managed_group_name', type=str, help='Gets or sets the managed resource group name') + c.argument('public_network_access', arg_type=get_enum_type(['NotSpecified', 'Enabled', 'Disabled']), + help='Gets or sets the public network access.') + + with self.argument_context('purview default-account set') as c: + c.argument('account_name', options_list=['--name', '-n', '--account-name'], type=str, + help='The name of the account that is set as the default.') + c.argument('resource_group_name', resource_group_name_type) + c.argument('scope', type=str, help='The scope object ID. For example, sub ID or tenant ID.') + c.argument('scope_tenant_id', type=str, help='The scope tenant in which the default account is set.') + c.argument('scope_type', arg_type=get_enum_type(['Tenant', 'Subscription']), help='The scope where the default ' + 'account is set.') + c.argument('subscription_id', type=str, help='The subscription ID of the account that is set as the default.') diff --git a/src/purview/azext_purview/manual/custom.py b/src/purview/azext_purview/manual/custom.py new file mode 100644 index 00000000000..9bd798c4b6a --- /dev/null +++ b/src/purview/azext_purview/manual/custom.py @@ -0,0 +1,90 @@ +# -------------------------------------------------------------------------- +# 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=unused-argument + + +from azure.cli.core.util import sdk_no_wait + + +def purview_account_create(client, + resource_group_name, + account_name, + location=None, + tags=None, + managed_group_name=None, + public_network_access=None, + no_wait=False): + account = {} + if location is not None: + account['location'] = location + if tags is not None: + account['tags'] = tags + account['identity'] = {} + account['identity']['type'] = "SystemAssigned" + if len(account['identity']) == 0: + del account['identity'] + account['sku'] = {'name': 'Standard'} + if managed_group_name is not None: + account['managed_resource_group_name'] = managed_group_name + if public_network_access is not None: + account['public_network_access'] = public_network_access + else: + account['public_network_access'] = "Enabled" + return sdk_no_wait(no_wait, + client.begin_create_or_update, + resource_group_name=resource_group_name, + account_name=account_name, + account=account) + + +def purview_account_update(client, + resource_group_name, + account_name, + tags=None, + managed_group_name=None, + public_network_access=None, + no_wait=False): + account_update_parameters = {} + if tags is not None: + account_update_parameters['tags'] = tags + account_update_parameters['properties'] = {} + if managed_group_name is not None: + account_update_parameters['properties']['managed_resource_group_name'] = managed_group_name + if public_network_access is not None: + account_update_parameters['properties']['public_network_access'] = public_network_access + if len(account_update_parameters['properties']) == 0: + del account_update_parameters['properties'] + return sdk_no_wait(no_wait, + client.begin_update, + resource_group_name=resource_group_name, + account_name=account_name, + account_update_parameters=account_update_parameters) + + +def purview_default_account_set(client, + subscription_id, + scope_tenant_id, + account_name=None, + resource_group_name=None, + scope=None, + scope_type=None): + default_account_payload = {} + if account_name is not None: + default_account_payload['account_name'] = account_name + if resource_group_name is not None: + default_account_payload['resource_group_name'] = resource_group_name + if scope is not None: + default_account_payload['scope'] = scope + default_account_payload['scope_tenant_id'] = scope_tenant_id + if scope_type is not None: + default_account_payload['scope_type'] = scope_type + default_account_payload['subscription_id'] = subscription_id + return client.set(default_account_payload=default_account_payload) diff --git a/src/purview/azext_purview/tests/__init__.py b/src/purview/azext_purview/tests/__init__.py new file mode 100644 index 00000000000..70488e93851 --- /dev/null +++ b/src/purview/azext_purview/tests/__init__.py @@ -0,0 +1,116 @@ +# 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 logging +import os +import sys +import traceback +import datetime as dt + +from azure.core.exceptions import AzureError +from azure.cli.testsdk.exceptions import CliTestError, CliExecutionError, JMESPathCheckAssertionError + + +logger = logging.getLogger('azure.cli.testsdk') +logger.addHandler(logging.StreamHandler()) +__path__ = __import__('pkgutil').extend_path(__path__, __name__) +exceptions = [] +test_map = dict() +SUCCESSED = "successed" +FAILED = "failed" + + +def try_manual(func): + def import_manual_function(origin_func): + from importlib import import_module + decorated_path = inspect.getfile(origin_func).lower() + module_path = __path__[0].lower() + 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) + logger.info("Found manual override for %s(...)", func.__name__) + except (ImportError, AttributeError): + pass + return func_to_call + + def wrapper(*args, **kwargs): + func_to_call = get_func_to_call() + logger.info("running %s()...", func.__name__) + try: + test_map[func.__name__] = dict() + test_map[func.__name__]["result"] = SUCCESSED + test_map[func.__name__]["error_message"] = "" + test_map[func.__name__]["error_stack"] = "" + test_map[func.__name__]["error_normalized"] = "" + test_map[func.__name__]["start_dt"] = dt.datetime.utcnow() + ret = func_to_call(*args, **kwargs) + except (AssertionError, AzureError, CliTestError, CliExecutionError, SystemExit, + JMESPathCheckAssertionError) as e: + use_exception_cache = os.getenv("TEST_EXCEPTION_CACHE") + if use_exception_cache is None or use_exception_cache.lower() != "true": + raise + test_map[func.__name__]["end_dt"] = dt.datetime.utcnow() + test_map[func.__name__]["result"] = FAILED + test_map[func.__name__]["error_message"] = str(e).replace("\r\n", " ").replace("\n", " ")[:500] + test_map[func.__name__]["error_stack"] = traceback.format_exc().replace( + "\r\n", " ").replace("\n", " ")[:500] + logger.info("--------------------------------------") + logger.info("step exception: %s", e) + logger.error("--------------------------------------") + logger.error("step exception in %s: %s", func.__name__, e) + logger.info(traceback.format_exc()) + exceptions.append((func.__name__, sys.exc_info())) + else: + test_map[func.__name__]["end_dt"] = dt.datetime.utcnow() + return ret + + if inspect.isclass(func): + return get_func_to_call() + return wrapper + + +def calc_coverage(filename): + filename = filename.split(".")[0] + coverage_name = filename + "_coverage.md" + with open(coverage_name, "w") as f: + f.write("|Scenario|Result|ErrorMessage|ErrorStack|ErrorNormalized|StartDt|EndDt|\n") + total = len(test_map) + covered = 0 + for k, v in test_map.items(): + if not k.startswith("step_"): + total -= 1 + continue + if v["result"] == SUCCESSED: + covered += 1 + f.write("|{step_name}|{result}|{error_message}|{error_stack}|{error_normalized}|{start_dt}|" + "{end_dt}|\n".format(step_name=k, **v)) + f.write("Coverage: {}/{}\n".format(covered, total)) + print("Create coverage\n", file=sys.stderr) + + +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/purview/azext_purview/tests/latest/__init__.py b/src/purview/azext_purview/tests/latest/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/purview/azext_purview/tests/latest/__init__.py @@ -0,0 +1,12 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/purview/azext_purview/tests/latest/recordings/test_purview_account.yaml b/src/purview/azext_purview/tests/latest/recordings/test_purview_account.yaml new file mode 100644 index 00000000000..afd08b51230 --- /dev/null +++ b/src/purview/azext_purview/tests/latest/recordings/test_purview_account.yaml @@ -0,0 +1,934 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - purview account create + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.27.2 azsdk-python-azure-mgmt-resource/19.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_purview000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001","name":"cli_test_purview000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2","tags":{"product":"azurecli","cause":"automation","date":"2021-09-01T01:56:26Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '429' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 01 Sep 2021 01:56:30 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"identity": {"type": "SystemAssigned"}, "location": "eastus2", "sku": + {"name": "Standard"}, "properties": {"publicNetworkAccess": "Enabled"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - purview account create + Connection: + - keep-alive + Content-Length: + - '142' + Content-Type: + - application/json + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.27.2 azsdk-python-mgmt-purview/1.0.1 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002?api-version=2021-07-01 + response: + body: + string: '{"sku":{"name":"Standard","capacity":1},"properties":{"cloudConnectors":{"awsExternalId":"430b8651-91ec-4fe6-b3c7-32f166a25dd5"},"friendlyName":"pv-000002","createdBy":"v-jingszhang@microsoft.com","createdByObjectId":"d44a2991-98c6-47c3-b59b-2b30d72cfcc2","createdAt":"2021-09-01T01:56:35.6127252Z","endpoints":{"catalog":"https://pv-000002.catalog.purview.azure.com","scan":"https://pv-000002.scan.purview.azure.com","guardian":"https://pv-000002.guardian.purview.azure.com"},"provisioningState":"Creating","privateEndpointConnections":[],"publicNetworkAccess":"Enabled","managedResourceGroupName":"managed-rg-xfmcttu"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002","name":"pv-000002","type":"Microsoft.Purview/accounts","location":"eastus2","identity":{"type":"SystemAssigned","principalId":"f5f02cd3-5a48-42cb-9108-123674440fc8","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-09-01T01:56:35.6127252Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-09-01T01:56:35.6127252Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '1284' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 01 Sep 2021 01:56:43 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002?api-version=2021-07-01 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-account-status: + - Creating + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - purview account create + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.27.2 azsdk-python-mgmt-purview/1.0.1 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002?api-version=2021-07-01 + response: + body: + string: '{"sku":{"name":"Standard","capacity":1},"properties":{"cloudConnectors":{"awsExternalId":"430b8651-91ec-4fe6-b3c7-32f166a25dd5"},"friendlyName":"pv-000002","createdBy":"v-jingszhang@microsoft.com","createdByObjectId":"d44a2991-98c6-47c3-b59b-2b30d72cfcc2","createdAt":"2021-09-01T01:56:35.6127252Z","endpoints":{"catalog":"https://pv-000002.catalog.purview.azure.com","scan":"https://pv-000002.scan.purview.azure.com","guardian":"https://pv-000002.guardian.purview.azure.com"},"provisioningState":"Creating","privateEndpointConnections":[],"managedResources":{"resourceGroup":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-xfmcttu","storageAccount":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-xfmcttu/providers/Microsoft.Storage/storageAccounts/scaneastus2tpibmxp"},"publicNetworkAccess":"Enabled","managedResourceGroupName":"managed-rg-xfmcttu"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002","name":"pv-000002","type":"Microsoft.Purview/accounts","location":"eastus2","identity":{"type":"SystemAssigned","principalId":"f5f02cd3-5a48-42cb-9108-123674440fc8","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-09-01T01:56:35.6127252Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-09-01T01:56:35.6127252Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '1577' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 01 Sep 2021 01:57:13 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-account-status: + - Creating + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - purview account wait + Connection: + - keep-alive + ParameterSetName: + - --created -g -n + User-Agent: + - AZURECLI/2.27.2 azsdk-python-mgmt-purview/1.0.1 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002?api-version=2021-07-01 + response: + body: + string: '{"sku":{"name":"Standard","capacity":1},"properties":{"cloudConnectors":{"awsExternalId":"430b8651-91ec-4fe6-b3c7-32f166a25dd5"},"friendlyName":"pv-000002","createdBy":"v-jingszhang@microsoft.com","createdByObjectId":"d44a2991-98c6-47c3-b59b-2b30d72cfcc2","createdAt":"2021-09-01T01:56:35.6127252Z","endpoints":{"catalog":"https://pv-000002.catalog.purview.azure.com","scan":"https://pv-000002.scan.purview.azure.com","guardian":"https://pv-000002.guardian.purview.azure.com"},"provisioningState":"Creating","privateEndpointConnections":[],"managedResources":{"resourceGroup":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-xfmcttu","storageAccount":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-xfmcttu/providers/Microsoft.Storage/storageAccounts/scaneastus2tpibmxp"},"publicNetworkAccess":"Enabled","managedResourceGroupName":"managed-rg-xfmcttu"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002","name":"pv-000002","type":"Microsoft.Purview/accounts","location":"eastus2","identity":{"type":"SystemAssigned","principalId":"f5f02cd3-5a48-42cb-9108-123674440fc8","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-09-01T01:56:35.6127252Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-09-01T01:56:35.6127252Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '1577' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 01 Sep 2021 01:57:15 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-account-status: + - Creating + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - purview account wait + Connection: + - keep-alive + ParameterSetName: + - --created -g -n + User-Agent: + - AZURECLI/2.27.2 azsdk-python-mgmt-purview/1.0.1 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002?api-version=2021-07-01 + response: + body: + string: '{"sku":{"name":"Standard","capacity":1},"properties":{"cloudConnectors":{"awsExternalId":"430b8651-91ec-4fe6-b3c7-32f166a25dd5"},"friendlyName":"pv-000002","createdBy":"v-jingszhang@microsoft.com","createdByObjectId":"d44a2991-98c6-47c3-b59b-2b30d72cfcc2","createdAt":"2021-09-01T01:56:35.6127252Z","endpoints":{"catalog":"https://pv-000002.catalog.purview.azure.com","scan":"https://pv-000002.scan.purview.azure.com","guardian":"https://pv-000002.guardian.purview.azure.com"},"provisioningState":"Creating","privateEndpointConnections":[],"managedResources":{"resourceGroup":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-xfmcttu","storageAccount":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-xfmcttu/providers/Microsoft.Storage/storageAccounts/scaneastus2tpibmxp"},"publicNetworkAccess":"Enabled","managedResourceGroupName":"managed-rg-xfmcttu"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002","name":"pv-000002","type":"Microsoft.Purview/accounts","location":"eastus2","identity":{"type":"SystemAssigned","principalId":"f5f02cd3-5a48-42cb-9108-123674440fc8","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-09-01T01:56:35.6127252Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-09-01T01:56:35.6127252Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '1577' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 01 Sep 2021 01:57:45 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-account-status: + - Creating + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - purview account wait + Connection: + - keep-alive + ParameterSetName: + - --created -g -n + User-Agent: + - AZURECLI/2.27.2 azsdk-python-mgmt-purview/1.0.1 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002?api-version=2021-07-01 + response: + body: + string: '{"sku":{"name":"Standard","capacity":1},"properties":{"cloudConnectors":{"awsExternalId":"430b8651-91ec-4fe6-b3c7-32f166a25dd5"},"friendlyName":"pv-000002","createdBy":"v-jingszhang@microsoft.com","createdByObjectId":"d44a2991-98c6-47c3-b59b-2b30d72cfcc2","createdAt":"2021-09-01T01:56:35.6127252Z","endpoints":{"catalog":"https://pv-000002.catalog.purview.azure.com","scan":"https://pv-000002.scan.purview.azure.com","guardian":"https://pv-000002.guardian.purview.azure.com"},"provisioningState":"Creating","privateEndpointConnections":[],"managedResources":{"resourceGroup":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-xfmcttu","storageAccount":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-xfmcttu/providers/Microsoft.Storage/storageAccounts/scaneastus2tpibmxp"},"publicNetworkAccess":"Enabled","managedResourceGroupName":"managed-rg-xfmcttu"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002","name":"pv-000002","type":"Microsoft.Purview/accounts","location":"eastus2","identity":{"type":"SystemAssigned","principalId":"f5f02cd3-5a48-42cb-9108-123674440fc8","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-09-01T01:56:35.6127252Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-09-01T01:56:35.6127252Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '1577' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 01 Sep 2021 01:58:16 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-account-status: + - Creating + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - purview account wait + Connection: + - keep-alive + ParameterSetName: + - --created -g -n + User-Agent: + - AZURECLI/2.27.2 azsdk-python-mgmt-purview/1.0.1 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002?api-version=2021-07-01 + response: + body: + string: '{"sku":{"name":"Standard","capacity":1},"properties":{"cloudConnectors":{"awsExternalId":"430b8651-91ec-4fe6-b3c7-32f166a25dd5"},"friendlyName":"pv-000002","createdBy":"v-jingszhang@microsoft.com","createdByObjectId":"d44a2991-98c6-47c3-b59b-2b30d72cfcc2","createdAt":"2021-09-01T01:56:35.6127252Z","endpoints":{"catalog":"https://pv-000002.catalog.purview.azure.com","scan":"https://pv-000002.scan.purview.azure.com","guardian":"https://pv-000002.guardian.purview.azure.com"},"provisioningState":"Creating","privateEndpointConnections":[],"managedResources":{"resourceGroup":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-xfmcttu","storageAccount":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-xfmcttu/providers/Microsoft.Storage/storageAccounts/scaneastus2tpibmxp","eventHubNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-xfmcttu/providers/Microsoft.EventHub/namespaces/Atlas-e963c890-630e-423a-a350-46e38bdd66b2"},"publicNetworkAccess":"Enabled","managedResourceGroupName":"managed-rg-xfmcttu"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002","name":"pv-000002","type":"Microsoft.Purview/accounts","location":"eastus2","identity":{"type":"SystemAssigned","principalId":"f5f02cd3-5a48-42cb-9108-123674440fc8","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-09-01T01:56:35.6127252Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-09-01T01:56:35.6127252Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '1768' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 01 Sep 2021 01:58:46 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-account-status: + - Creating + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - purview account wait + Connection: + - keep-alive + ParameterSetName: + - --created -g -n + User-Agent: + - AZURECLI/2.27.2 azsdk-python-mgmt-purview/1.0.1 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002?api-version=2021-07-01 + response: + body: + string: '{"sku":{"name":"Standard","capacity":1},"properties":{"cloudConnectors":{"awsExternalId":"430b8651-91ec-4fe6-b3c7-32f166a25dd5"},"friendlyName":"pv-000002","createdBy":"v-jingszhang@microsoft.com","createdByObjectId":"d44a2991-98c6-47c3-b59b-2b30d72cfcc2","createdAt":"2021-09-01T01:56:35.6127252Z","endpoints":{"catalog":"https://pv-000002.catalog.purview.azure.com","scan":"https://pv-000002.scan.purview.azure.com","guardian":"https://pv-000002.guardian.purview.azure.com"},"provisioningState":"Creating","privateEndpointConnections":[],"managedResources":{"resourceGroup":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-xfmcttu","storageAccount":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-xfmcttu/providers/Microsoft.Storage/storageAccounts/scaneastus2tpibmxp","eventHubNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-xfmcttu/providers/Microsoft.EventHub/namespaces/Atlas-e963c890-630e-423a-a350-46e38bdd66b2"},"publicNetworkAccess":"Enabled","managedResourceGroupName":"managed-rg-xfmcttu"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002","name":"pv-000002","type":"Microsoft.Purview/accounts","location":"eastus2","identity":{"type":"SystemAssigned","principalId":"f5f02cd3-5a48-42cb-9108-123674440fc8","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-09-01T01:56:35.6127252Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-09-01T01:56:35.6127252Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '1768' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 01 Sep 2021 01:59:16 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-account-status: + - Creating + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - purview account wait + Connection: + - keep-alive + ParameterSetName: + - --created -g -n + User-Agent: + - AZURECLI/2.27.2 azsdk-python-mgmt-purview/1.0.1 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002?api-version=2021-07-01 + response: + body: + string: '{"sku":{"name":"Standard","capacity":1},"properties":{"cloudConnectors":{"awsExternalId":"430b8651-91ec-4fe6-b3c7-32f166a25dd5"},"friendlyName":"pv-000002","createdBy":"v-jingszhang@microsoft.com","createdByObjectId":"d44a2991-98c6-47c3-b59b-2b30d72cfcc2","createdAt":"2021-09-01T01:56:35.6127252Z","endpoints":{"catalog":"https://pv-000002.catalog.purview.azure.com","scan":"https://pv-000002.scan.purview.azure.com","guardian":"https://pv-000002.guardian.purview.azure.com"},"provisioningState":"Succeeded","privateEndpointConnections":[],"managedResources":{"resourceGroup":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-xfmcttu","storageAccount":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-xfmcttu/providers/Microsoft.Storage/storageAccounts/scaneastus2tpibmxp","eventHubNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-xfmcttu/providers/Microsoft.EventHub/namespaces/Atlas-e963c890-630e-423a-a350-46e38bdd66b2"},"publicNetworkAccess":"Enabled","managedResourceGroupName":"managed-rg-xfmcttu"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002","name":"pv-000002","type":"Microsoft.Purview/accounts","location":"eastus2","identity":{"type":"SystemAssigned","principalId":"f5f02cd3-5a48-42cb-9108-123674440fc8","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-09-01T01:56:35.6127252Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-09-01T01:56:35.6127252Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '1769' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 01 Sep 2021 01:59:47 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-account-status: + - Succeeded + status: + code: 200 + message: OK +- request: + body: '{"properties": {"publicNetworkAccess": "Enabled"}, "tags": {"tag": "test"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - purview account update + Connection: + - keep-alive + Content-Length: + - '75' + Content-Type: + - application/json + ParameterSetName: + - -n -g --tags + User-Agent: + - AZURECLI/2.27.2 azsdk-python-mgmt-purview/1.0.1 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002?api-version=2021-07-01 + response: + body: + string: '{"sku":{"name":"Standard","capacity":1},"properties":{"cloudConnectors":{"awsExternalId":"430b8651-91ec-4fe6-b3c7-32f166a25dd5"},"friendlyName":"pv-000002","createdBy":"v-jingszhang@microsoft.com","createdByObjectId":"d44a2991-98c6-47c3-b59b-2b30d72cfcc2","createdAt":"2021-09-01T01:56:35.6127252Z","endpoints":{"catalog":"https://pv-000002.catalog.purview.azure.com","scan":"https://pv-000002.scan.purview.azure.com","guardian":"https://pv-000002.guardian.purview.azure.com"},"provisioningState":"Creating","privateEndpointConnections":[],"managedResources":{"resourceGroup":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-xfmcttu","storageAccount":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-xfmcttu/providers/Microsoft.Storage/storageAccounts/scaneastus2tpibmxp","eventHubNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-xfmcttu/providers/Microsoft.EventHub/namespaces/Atlas-e963c890-630e-423a-a350-46e38bdd66b2"},"publicNetworkAccess":"Enabled","managedResourceGroupName":"managed-rg-xfmcttu"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002","name":"pv-000002","type":"Microsoft.Purview/accounts","location":"eastus2","identity":{"type":"SystemAssigned","principalId":"f5f02cd3-5a48-42cb-9108-123674440fc8","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"tags":{"tag":"test"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-09-01T01:56:35.6127252Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-09-01T01:56:35.6127252Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '1790' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 01 Sep 2021 01:59:50 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002/operationResults/19458a95-b461-4ca1-8245-be4761b10265?api-version=2021-07-01 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - purview account update + Connection: + - keep-alive + ParameterSetName: + - -n -g --tags + User-Agent: + - AZURECLI/2.27.2 azsdk-python-mgmt-purview/1.0.1 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002/operationResults/19458a95-b461-4ca1-8245-be4761b10265?api-version=2021-07-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Wed, 01 Sep 2021 02:00:21 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002/operationResults/19458a95-b461-4ca1-8245-be4761b10265?api-version=2021-07-01 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - purview account update + Connection: + - keep-alive + ParameterSetName: + - -n -g --tags + User-Agent: + - AZURECLI/2.27.2 azsdk-python-mgmt-purview/1.0.1 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002/operationResults/19458a95-b461-4ca1-8245-be4761b10265?api-version=2021-07-01 + response: + body: + string: '{"sku":{"name":"Standard","capacity":1},"properties":{"cloudConnectors":{"awsExternalId":"430b8651-91ec-4fe6-b3c7-32f166a25dd5"},"friendlyName":"pv-000002","createdBy":"v-jingszhang@microsoft.com","createdByObjectId":"d44a2991-98c6-47c3-b59b-2b30d72cfcc2","createdAt":"2021-09-01T01:56:35.6127252Z","endpoints":{"catalog":"https://pv-000002.catalog.purview.azure.com","scan":"https://pv-000002.scan.purview.azure.com","guardian":"https://pv-000002.guardian.purview.azure.com"},"provisioningState":"Succeeded","privateEndpointConnections":[],"managedResources":{"resourceGroup":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-xfmcttu","storageAccount":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-xfmcttu/providers/Microsoft.Storage/storageAccounts/scaneastus2tpibmxp","eventHubNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-xfmcttu/providers/Microsoft.EventHub/namespaces/Atlas-e963c890-630e-423a-a350-46e38bdd66b2"},"publicNetworkAccess":"Enabled","managedResourceGroupName":"managed-rg-xfmcttu"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002","name":"pv-000002","type":"Microsoft.Purview/accounts","location":"eastus2","identity":{"type":"SystemAssigned","principalId":"f5f02cd3-5a48-42cb-9108-123674440fc8","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"tags":{"tag":"test"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-09-01T01:56:35.6127252Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-09-01T01:56:35.6127252Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '1791' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 01 Sep 2021 02:00:52 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"objectId": "d44a2991-98c6-47c3-b59b-2b30d72cfcc2"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - purview account add-root-collection-admin + Connection: + - keep-alive + Content-Length: + - '52' + Content-Type: + - application/json + ParameterSetName: + - -n -g --object-id + User-Agent: + - AZURECLI/2.27.2 azsdk-python-mgmt-purview/1.0.1 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002/addRootCollectionAdmin?api-version=2021-07-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Wed, 01 Sep 2021 02:00:54 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - purview account list-key + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.27.2 azsdk-python-mgmt-purview/1.0.1 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002/listkeys?api-version=2021-07-01 + response: + body: + string: '{"atlasKafkaPrimaryEndpoint":"Endpoint1","atlasKafkaSecondaryEndpoint":"Endpoint2"}' + headers: + cache-control: + - no-cache + content-length: + - '437' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 01 Sep 2021 02:00:55 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - purview account show + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.27.2 azsdk-python-mgmt-purview/1.0.1 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002?api-version=2021-07-01 + response: + body: + string: '{"sku":{"name":"Standard","capacity":1},"properties":{"cloudConnectors":{"awsExternalId":"430b8651-91ec-4fe6-b3c7-32f166a25dd5"},"friendlyName":"pv-000002","createdBy":"v-jingszhang@microsoft.com","createdByObjectId":"d44a2991-98c6-47c3-b59b-2b30d72cfcc2","createdAt":"2021-09-01T01:56:35.6127252Z","endpoints":{"catalog":"https://pv-000002.catalog.purview.azure.com","scan":"https://pv-000002.scan.purview.azure.com","guardian":"https://pv-000002.guardian.purview.azure.com"},"provisioningState":"Succeeded","privateEndpointConnections":[],"managedResources":{"resourceGroup":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-xfmcttu","storageAccount":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-xfmcttu/providers/Microsoft.Storage/storageAccounts/scaneastus2tpibmxp","eventHubNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-xfmcttu/providers/Microsoft.EventHub/namespaces/Atlas-e963c890-630e-423a-a350-46e38bdd66b2"},"publicNetworkAccess":"Enabled","managedResourceGroupName":"managed-rg-xfmcttu"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002","name":"pv-000002","type":"Microsoft.Purview/accounts","location":"eastus2","identity":{"type":"SystemAssigned","principalId":"f5f02cd3-5a48-42cb-9108-123674440fc8","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"tags":{"tag":"test"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-09-01T01:56:35.6127252Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-09-01T01:56:35.6127252Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '1791' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 01 Sep 2021 02:00:57 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-account-status: + - Succeeded + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - purview account list + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.27.2 azsdk-python-mgmt-purview/1.0.1 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Purview/accounts?api-version=2021-07-01 + response: + body: + string: '{"value":[{"sku":{"name":"Standard","capacity":4},"properties":{"cloudConnectors":{"awsExternalId":"5c37e31f-6ff8-4ef8-8b4d-60c49b0f90f6"},"friendlyName":"fypvac","createdBy":"fey@microsoft.com","createdByObjectId":"0a592c45-613e-4f1b-9023-7c4414fd53bf","createdAt":"2021-08-04T08:34:28.6789756Z","endpoints":{"catalog":"https://fypvac.catalog.purview.azure.com","scan":"https://fypvac.scan.purview.azure.com","guardian":"https://fypvac.guardian.purview.azure.com"},"provisioningState":"Succeeded","privateEndpointConnections":[],"managedResources":{"resourceGroup":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-fypvac","storageAccount":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-fypvac/providers/Microsoft.Storage/storageAccounts/scaneastusdsmvroz","eventHubNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-fypvac/providers/Microsoft.EventHub/namespaces/Atlas-b709b982-e5b5-436f-b0e6-eca43c5eb8bf"},"publicNetworkAccess":"Enabled","managedResourceGroupName":"managed-rg-fypvac"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/fypurview/providers/Microsoft.Purview/accounts/fypvac","name":"fypvac","type":"Microsoft.Purview/accounts","location":"eastus","identity":{"type":"SystemAssigned","principalId":"167df1e1-a087-43aa-8a7f-c17a4bbd4d36","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"tags":{},"systemData":{"createdBy":"fey@microsoft.com","createdByType":"User","createdAt":"2021-08-04T08:34:28.6789756Z","lastModifiedBy":"fey@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-04T08:34:28.6789756Z"}},{"sku":{"name":"Standard","capacity":1},"properties":{"cloudConnectors":{"awsExternalId":"01b0ba4b-766b-4ab4-85bb-32a385341fa5"},"friendlyName":"purview-msyyc","createdBy":"yuchaoyan@microsoft.com","createdByObjectId":"3bd37d68-b234-4fcd-bc83-0fedb27ccf5c","createdAt":"2021-08-23T01:56:06.1122189Z","endpoints":{"catalog":"https://purview-msyyc.catalog.purview.azure.com","scan":"https://purview-msyyc.scan.purview.azure.com","guardian":"https://purview-msyyc.guardian.purview.azure.com"},"provisioningState":"Succeeded","privateEndpointConnections":[],"managedResources":{"resourceGroup":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-purview-msyyc","storageAccount":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-purview-msyyc/providers/Microsoft.Storage/storageAccounts/scaneastusxncccyt","eventHubNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-purview-msyyc/providers/Microsoft.EventHub/namespaces/Atlas-b5a1c899-6e5f-48e5-9806-495efcadbb7c"},"publicNetworkAccess":"Enabled","managedResourceGroupName":"managed-rg-purview-msyyc"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/python-sdk-test/providers/Microsoft.Purview/accounts/purview-msyyc","name":"purview-msyyc","type":"Microsoft.Purview/accounts","location":"eastus","identity":{"type":"SystemAssigned","principalId":"c5c7034d-fd51-48ea-afdd-bb1aac5813e6","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"tags":{},"systemData":{"createdBy":"yuchaoyan@microsoft.com","createdByType":"User","createdAt":"2021-08-23T01:56:06.1122189Z","lastModifiedBy":"yuchaoyan@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-23T01:56:06.1122189Z"}},{"sku":{"name":"Standard","capacity":1},"properties":{"cloudConnectors":{"awsExternalId":"756d66d6-1f5b-41fb-9a20-1c1ff5c7a244"},"friendlyName":"fypv2","createdBy":"fey@microsoft.com","createdByObjectId":"0a592c45-613e-4f1b-9023-7c4414fd53bf","createdAt":"2021-08-23T12:52:06.4658298Z","endpoints":{"catalog":"https://fypv2.catalog.purview.azure.com","scan":"https://fypv2.scan.purview.azure.com","guardian":"https://fypv2.guardian.purview.azure.com"},"provisioningState":"Succeeded","privateEndpointConnections":[],"managedResources":{"resourceGroup":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-fypv2","storageAccount":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-fypv2/providers/Microsoft.Storage/storageAccounts/scaneastusmrapryg","eventHubNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-fypv2/providers/Microsoft.EventHub/namespaces/Atlas-7d2f2c13-2871-4bc1-ba85-f160fb696f73"},"publicNetworkAccess":"Enabled","managedResourceGroupName":"managed-rg-fypv2"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/fypurview/providers/Microsoft.Purview/accounts/fypv2","name":"fypv2","type":"Microsoft.Purview/accounts","location":"eastus","identity":{"type":"SystemAssigned","principalId":"25679808-9d08-40b1-a0c7-8521af2b4f64","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"tags":{},"systemData":{"createdBy":"fey@microsoft.com","createdByType":"User","createdAt":"2021-08-23T12:52:06.4658298Z","lastModifiedBy":"fey@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-23T12:52:06.4658298Z"}},{"sku":{"name":"Standard","capacity":1},"properties":{"cloudConnectors":{"awsExternalId":"60a5ae36-8189-41bb-bbe4-ed007efe5da9"},"friendlyName":"pv1","createdBy":"v-jingszhang@microsoft.com","createdByObjectId":"d44a2991-98c6-47c3-b59b-2b30d72cfcc2","createdAt":"2021-09-01T01:45:25.0960996Z","endpoints":{"catalog":"https://pv1.catalog.purview.azure.com","scan":"https://pv1.scan.purview.azure.com","guardian":"https://pv1.guardian.purview.azure.com"},"provisioningState":"Succeeded","privateEndpointConnections":[],"managedResources":{"resourceGroup":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-irbnhkb","storageAccount":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-irbnhkb/providers/Microsoft.Storage/storageAccounts/scaneastus2knczett","eventHubNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-irbnhkb/providers/Microsoft.EventHub/namespaces/Atlas-f997d002-8abe-496c-805c-7bb436c41d90"},"publicNetworkAccess":"Enabled","managedResourceGroupName":"managed-rg-irbnhkb"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/pvtest/providers/Microsoft.Purview/accounts/pv1","name":"pv1","type":"Microsoft.Purview/accounts","location":"eastus2","identity":{"type":"SystemAssigned","principalId":"e2312091-2065-4e48-a7db-59dde8689af8","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-09-01T01:45:25.0960996Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-09-01T01:45:25.0960996Z"}},{"sku":{"name":"Standard","capacity":1},"properties":{"cloudConnectors":{"awsExternalId":"430b8651-91ec-4fe6-b3c7-32f166a25dd5"},"friendlyName":"pv-000002","createdBy":"v-jingszhang@microsoft.com","createdByObjectId":"d44a2991-98c6-47c3-b59b-2b30d72cfcc2","createdAt":"2021-09-01T01:56:35.6127252Z","endpoints":{"catalog":"https://pv-000002.catalog.purview.azure.com","scan":"https://pv-000002.scan.purview.azure.com","guardian":"https://pv-000002.guardian.purview.azure.com"},"provisioningState":"Succeeded","privateEndpointConnections":[],"managedResources":{"resourceGroup":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-xfmcttu","storageAccount":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-xfmcttu/providers/Microsoft.Storage/storageAccounts/scaneastus2tpibmxp","eventHubNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-xfmcttu/providers/Microsoft.EventHub/namespaces/Atlas-e963c890-630e-423a-a350-46e38bdd66b2"},"publicNetworkAccess":"Enabled","managedResourceGroupName":"managed-rg-xfmcttu"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002","name":"pv-000002","type":"Microsoft.Purview/accounts","location":"eastus2","identity":{"type":"SystemAssigned","principalId":"f5f02cd3-5a48-42cb-9108-123674440fc8","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"tags":{"tag":"test"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-09-01T01:56:35.6127252Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-09-01T01:56:35.6127252Z"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '8517' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 01 Sep 2021 02:00:59 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-original-request-ids: + - '' + - '' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - purview account delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g -n --y + User-Agent: + - AZURECLI/2.27.2 azsdk-python-mgmt-purview/1.0.1 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002?api-version=2021-07-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Wed, 01 Sep 2021 02:01:01 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Purview/locations/eastus2/operationResults/9ad8bcf1-8a75-4b06-8048-e0d7922517c1?api-version=2021-07-01 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - purview account delete + Connection: + - keep-alive + ParameterSetName: + - -g -n --y + User-Agent: + - AZURECLI/2.27.2 azsdk-python-mgmt-purview/1.0.1 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Purview/locations/eastus2/operationResults/9ad8bcf1-8a75-4b06-8048-e0d7922517c1?api-version=2021-07-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Wed, 01 Sep 2021 02:01:31 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Purview/locations/eastus2/operationResults/9ad8bcf1-8a75-4b06-8048-e0d7922517c1?api-version=2021-07-01 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - purview account delete + Connection: + - keep-alive + ParameterSetName: + - -g -n --y + User-Agent: + - AZURECLI/2.27.2 azsdk-python-mgmt-purview/1.0.1 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Purview/locations/eastus2/operationResults/9ad8bcf1-8a75-4b06-8048-e0d7922517c1?api-version=2021-07-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Wed, 01 Sep 2021 02:02:02 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Purview/locations/eastus2/operationResults/9ad8bcf1-8a75-4b06-8048-e0d7922517c1?api-version=2021-07-01 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - purview account delete + Connection: + - keep-alive + ParameterSetName: + - -g -n --y + User-Agent: + - AZURECLI/2.27.2 azsdk-python-mgmt-purview/1.0.1 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Purview/locations/eastus2/operationResults/9ad8bcf1-8a75-4b06-8048-e0d7922517c1?api-version=2021-07-01 + response: + body: + string: '{"startTime":"2021-09-01T02:01:01.5212485Z","endTime":"2021-09-01T02:01:05.4715989Z","status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '106' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 01 Sep 2021 02:02:32 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/purview/azext_purview/tests/latest/recordings/test_purview_default_account.yaml b/src/purview/azext_purview/tests/latest/recordings/test_purview_default_account.yaml new file mode 100644 index 00000000000..e663f8b868f --- /dev/null +++ b/src/purview/azext_purview/tests/latest/recordings/test_purview_default_account.yaml @@ -0,0 +1,752 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - purview account create + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.27.2 azsdk-python-azure-mgmt-resource/19.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_purview000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001","name":"cli_test_purview000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2","tags":{"product":"azurecli","cause":"automation","date":"2021-09-01T02:24:48Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '429' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 01 Sep 2021 02:24:54 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"identity": {"type": "SystemAssigned"}, "location": "eastus2", "sku": + {"name": "Standard"}, "properties": {"publicNetworkAccess": "Enabled"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - purview account create + Connection: + - keep-alive + Content-Length: + - '142' + Content-Type: + - application/json + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.27.2 azsdk-python-mgmt-purview/1.0.1 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002?api-version=2021-07-01 + response: + body: + string: '{"sku":{"name":"Standard","capacity":1},"properties":{"cloudConnectors":{"awsExternalId":"67a1c6e3-db22-4182-883f-d23a6b848d29"},"friendlyName":"pv-000002","createdBy":"v-jingszhang@microsoft.com","createdByObjectId":"d44a2991-98c6-47c3-b59b-2b30d72cfcc2","createdAt":"2021-09-01T02:25:00.1871857Z","endpoints":{"catalog":"https://pv-000002.catalog.purview.azure.com","scan":"https://pv-000002.scan.purview.azure.com","guardian":"https://pv-000002.guardian.purview.azure.com"},"provisioningState":"Creating","privateEndpointConnections":[],"publicNetworkAccess":"Enabled","managedResourceGroupName":"managed-rg-rigvekd"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002","name":"pv-000002","type":"Microsoft.Purview/accounts","location":"eastus2","identity":{"type":"SystemAssigned","principalId":"1db70e98-8ce0-493a-89c4-e43ec6d375dd","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-09-01T02:25:00.1871857Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-09-01T02:25:00.1871857Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '1284' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 01 Sep 2021 02:25:06 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002?api-version=2021-07-01 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-account-status: + - Creating + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - purview account create + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.27.2 azsdk-python-mgmt-purview/1.0.1 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002?api-version=2021-07-01 + response: + body: + string: '{"sku":{"name":"Standard","capacity":1},"properties":{"cloudConnectors":{"awsExternalId":"67a1c6e3-db22-4182-883f-d23a6b848d29"},"friendlyName":"pv-000002","createdBy":"v-jingszhang@microsoft.com","createdByObjectId":"d44a2991-98c6-47c3-b59b-2b30d72cfcc2","createdAt":"2021-09-01T02:25:00.1871857Z","endpoints":{"catalog":"https://pv-000002.catalog.purview.azure.com","scan":"https://pv-000002.scan.purview.azure.com","guardian":"https://pv-000002.guardian.purview.azure.com"},"provisioningState":"Creating","privateEndpointConnections":[],"managedResources":{"resourceGroup":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-rigvekd"},"publicNetworkAccess":"Enabled","managedResourceGroupName":"managed-rg-rigvekd"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002","name":"pv-000002","type":"Microsoft.Purview/accounts","location":"eastus2","identity":{"type":"SystemAssigned","principalId":"1db70e98-8ce0-493a-89c4-e43ec6d375dd","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-09-01T02:25:00.1871857Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-09-01T02:25:00.1871857Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '1409' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 01 Sep 2021 02:25:36 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-account-status: + - Creating + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - purview account wait + Connection: + - keep-alive + ParameterSetName: + - --created -g -n + User-Agent: + - AZURECLI/2.27.2 azsdk-python-mgmt-purview/1.0.1 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002?api-version=2021-07-01 + response: + body: + string: '{"sku":{"name":"Standard","capacity":1},"properties":{"cloudConnectors":{"awsExternalId":"67a1c6e3-db22-4182-883f-d23a6b848d29"},"friendlyName":"pv-000002","createdBy":"v-jingszhang@microsoft.com","createdByObjectId":"d44a2991-98c6-47c3-b59b-2b30d72cfcc2","createdAt":"2021-09-01T02:25:00.1871857Z","endpoints":{"catalog":"https://pv-000002.catalog.purview.azure.com","scan":"https://pv-000002.scan.purview.azure.com","guardian":"https://pv-000002.guardian.purview.azure.com"},"provisioningState":"Creating","privateEndpointConnections":[],"managedResources":{"resourceGroup":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-rigvekd","storageAccount":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-rigvekd/providers/Microsoft.Storage/storageAccounts/scaneastus2luqqqdx"},"publicNetworkAccess":"Enabled","managedResourceGroupName":"managed-rg-rigvekd"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002","name":"pv-000002","type":"Microsoft.Purview/accounts","location":"eastus2","identity":{"type":"SystemAssigned","principalId":"1db70e98-8ce0-493a-89c4-e43ec6d375dd","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-09-01T02:25:00.1871857Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-09-01T02:25:00.1871857Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '1577' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 01 Sep 2021 02:25:38 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-account-status: + - Creating + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - purview account wait + Connection: + - keep-alive + ParameterSetName: + - --created -g -n + User-Agent: + - AZURECLI/2.27.2 azsdk-python-mgmt-purview/1.0.1 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002?api-version=2021-07-01 + response: + body: + string: '{"sku":{"name":"Standard","capacity":1},"properties":{"cloudConnectors":{"awsExternalId":"67a1c6e3-db22-4182-883f-d23a6b848d29"},"friendlyName":"pv-000002","createdBy":"v-jingszhang@microsoft.com","createdByObjectId":"d44a2991-98c6-47c3-b59b-2b30d72cfcc2","createdAt":"2021-09-01T02:25:00.1871857Z","endpoints":{"catalog":"https://pv-000002.catalog.purview.azure.com","scan":"https://pv-000002.scan.purview.azure.com","guardian":"https://pv-000002.guardian.purview.azure.com"},"provisioningState":"Creating","privateEndpointConnections":[],"managedResources":{"resourceGroup":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-rigvekd","storageAccount":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-rigvekd/providers/Microsoft.Storage/storageAccounts/scaneastus2luqqqdx"},"publicNetworkAccess":"Enabled","managedResourceGroupName":"managed-rg-rigvekd"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002","name":"pv-000002","type":"Microsoft.Purview/accounts","location":"eastus2","identity":{"type":"SystemAssigned","principalId":"1db70e98-8ce0-493a-89c4-e43ec6d375dd","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-09-01T02:25:00.1871857Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-09-01T02:25:00.1871857Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '1577' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 01 Sep 2021 02:26:08 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-account-status: + - Creating + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - purview account wait + Connection: + - keep-alive + ParameterSetName: + - --created -g -n + User-Agent: + - AZURECLI/2.27.2 azsdk-python-mgmt-purview/1.0.1 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002?api-version=2021-07-01 + response: + body: + string: '{"sku":{"name":"Standard","capacity":1},"properties":{"cloudConnectors":{"awsExternalId":"67a1c6e3-db22-4182-883f-d23a6b848d29"},"friendlyName":"pv-000002","createdBy":"v-jingszhang@microsoft.com","createdByObjectId":"d44a2991-98c6-47c3-b59b-2b30d72cfcc2","createdAt":"2021-09-01T02:25:00.1871857Z","endpoints":{"catalog":"https://pv-000002.catalog.purview.azure.com","scan":"https://pv-000002.scan.purview.azure.com","guardian":"https://pv-000002.guardian.purview.azure.com"},"provisioningState":"Creating","privateEndpointConnections":[],"managedResources":{"resourceGroup":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-rigvekd","storageAccount":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-rigvekd/providers/Microsoft.Storage/storageAccounts/scaneastus2luqqqdx"},"publicNetworkAccess":"Enabled","managedResourceGroupName":"managed-rg-rigvekd"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002","name":"pv-000002","type":"Microsoft.Purview/accounts","location":"eastus2","identity":{"type":"SystemAssigned","principalId":"1db70e98-8ce0-493a-89c4-e43ec6d375dd","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-09-01T02:25:00.1871857Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-09-01T02:25:00.1871857Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '1577' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 01 Sep 2021 02:26:38 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-account-status: + - Creating + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - purview account wait + Connection: + - keep-alive + ParameterSetName: + - --created -g -n + User-Agent: + - AZURECLI/2.27.2 azsdk-python-mgmt-purview/1.0.1 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002?api-version=2021-07-01 + response: + body: + string: '{"sku":{"name":"Standard","capacity":1},"properties":{"cloudConnectors":{"awsExternalId":"67a1c6e3-db22-4182-883f-d23a6b848d29"},"friendlyName":"pv-000002","createdBy":"v-jingszhang@microsoft.com","createdByObjectId":"d44a2991-98c6-47c3-b59b-2b30d72cfcc2","createdAt":"2021-09-01T02:25:00.1871857Z","endpoints":{"catalog":"https://pv-000002.catalog.purview.azure.com","scan":"https://pv-000002.scan.purview.azure.com","guardian":"https://pv-000002.guardian.purview.azure.com"},"provisioningState":"Creating","privateEndpointConnections":[],"managedResources":{"resourceGroup":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-rigvekd","storageAccount":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-rigvekd/providers/Microsoft.Storage/storageAccounts/scaneastus2luqqqdx","eventHubNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-rigvekd/providers/Microsoft.EventHub/namespaces/Atlas-874497ee-d63a-4a7b-8fa2-65d2337bc96d"},"publicNetworkAccess":"Enabled","managedResourceGroupName":"managed-rg-rigvekd"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002","name":"pv-000002","type":"Microsoft.Purview/accounts","location":"eastus2","identity":{"type":"SystemAssigned","principalId":"1db70e98-8ce0-493a-89c4-e43ec6d375dd","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-09-01T02:25:00.1871857Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-09-01T02:25:00.1871857Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '1768' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 01 Sep 2021 02:27:08 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-account-status: + - Creating + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - purview account wait + Connection: + - keep-alive + ParameterSetName: + - --created -g -n + User-Agent: + - AZURECLI/2.27.2 azsdk-python-mgmt-purview/1.0.1 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002?api-version=2021-07-01 + response: + body: + string: '{"sku":{"name":"Standard","capacity":1},"properties":{"cloudConnectors":{"awsExternalId":"67a1c6e3-db22-4182-883f-d23a6b848d29"},"friendlyName":"pv-000002","createdBy":"v-jingszhang@microsoft.com","createdByObjectId":"d44a2991-98c6-47c3-b59b-2b30d72cfcc2","createdAt":"2021-09-01T02:25:00.1871857Z","endpoints":{"catalog":"https://pv-000002.catalog.purview.azure.com","scan":"https://pv-000002.scan.purview.azure.com","guardian":"https://pv-000002.guardian.purview.azure.com"},"provisioningState":"Creating","privateEndpointConnections":[],"managedResources":{"resourceGroup":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-rigvekd","storageAccount":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-rigvekd/providers/Microsoft.Storage/storageAccounts/scaneastus2luqqqdx","eventHubNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-rigvekd/providers/Microsoft.EventHub/namespaces/Atlas-874497ee-d63a-4a7b-8fa2-65d2337bc96d"},"publicNetworkAccess":"Enabled","managedResourceGroupName":"managed-rg-rigvekd"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002","name":"pv-000002","type":"Microsoft.Purview/accounts","location":"eastus2","identity":{"type":"SystemAssigned","principalId":"1db70e98-8ce0-493a-89c4-e43ec6d375dd","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-09-01T02:25:00.1871857Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-09-01T02:25:00.1871857Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '1768' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 01 Sep 2021 02:27:39 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-account-status: + - Creating + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - purview account wait + Connection: + - keep-alive + ParameterSetName: + - --created -g -n + User-Agent: + - AZURECLI/2.27.2 azsdk-python-mgmt-purview/1.0.1 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002?api-version=2021-07-01 + response: + body: + string: '{"sku":{"name":"Standard","capacity":1},"properties":{"cloudConnectors":{"awsExternalId":"67a1c6e3-db22-4182-883f-d23a6b848d29"},"friendlyName":"pv-000002","createdBy":"v-jingszhang@microsoft.com","createdByObjectId":"d44a2991-98c6-47c3-b59b-2b30d72cfcc2","createdAt":"2021-09-01T02:25:00.1871857Z","endpoints":{"catalog":"https://pv-000002.catalog.purview.azure.com","scan":"https://pv-000002.scan.purview.azure.com","guardian":"https://pv-000002.guardian.purview.azure.com"},"provisioningState":"Succeeded","privateEndpointConnections":[],"managedResources":{"resourceGroup":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-rigvekd","storageAccount":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-rigvekd/providers/Microsoft.Storage/storageAccounts/scaneastus2luqqqdx","eventHubNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/managed-rg-rigvekd/providers/Microsoft.EventHub/namespaces/Atlas-874497ee-d63a-4a7b-8fa2-65d2337bc96d"},"publicNetworkAccess":"Enabled","managedResourceGroupName":"managed-rg-rigvekd"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002","name":"pv-000002","type":"Microsoft.Purview/accounts","location":"eastus2","identity":{"type":"SystemAssigned","principalId":"1db70e98-8ce0-493a-89c4-e43ec6d375dd","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-09-01T02:25:00.1871857Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-09-01T02:25:00.1871857Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '1769' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 01 Sep 2021 02:28:10 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-account-status: + - Succeeded + status: + code: 200 + message: OK +- request: + body: '{"accountName": "pv-000002", "resourceGroupName": "cli_test_purview000001", + "scopeTenantId": "54826b22-38d6-4fb2-bad9-b7b93a3e9c5a", "subscriptionId": "0b1f6471-1bf0-4dda-aec3-cb9272f09590"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - purview default-account set + Connection: + - keep-alive + Content-Length: + - '244' + Content-Type: + - application/json + ParameterSetName: + - -n -g --subscription-id --scope-tenant-id + User-Agent: + - AZURECLI/2.27.2 azsdk-python-mgmt-purview/1.0.1 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://management.azure.com/providers/Microsoft.Purview/setDefaultAccount?api-version=2021-07-01 + response: + body: + string: '{"scopeTenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","scopeType":"Tenant","scope":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","accountName":"pv-000002","resourceGroupName":"cli_test_purview000001","subscriptionId":"0b1f6471-1bf0-4dda-aec3-cb9272f09590"}' + headers: + cache-control: + - no-cache + content-length: + - '305' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 01 Sep 2021 02:28:12 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-tenant-writes: + - '1198' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - purview default-account show + Connection: + - keep-alive + ParameterSetName: + - --scope-tenant-id --scope-type + User-Agent: + - AZURECLI/2.27.2 azsdk-python-mgmt-purview/1.0.1 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.Purview/getDefaultAccount?scopeTenantId=54826b22-38d6-4fb2-bad9-b7b93a3e9c5a&scopeType=Tenant&api-version=2021-07-01 + response: + body: + string: '{"scopeTenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","scopeType":"Tenant","scope":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","accountName":"pv-000002","resourceGroupName":"cli_test_purview000001","subscriptionId":"0b1f6471-1bf0-4dda-aec3-cb9272f09590"}' + headers: + cache-control: + - no-cache + content-length: + - '305' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 01 Sep 2021 02:28:14 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - purview default-account remove + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --scope-tenant-id --scope-type + User-Agent: + - AZURECLI/2.27.2 azsdk-python-mgmt-purview/1.0.1 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://management.azure.com/providers/Microsoft.Purview/removeDefaultAccount?scopeTenantId=54826b22-38d6-4fb2-bad9-b7b93a3e9c5a&scopeType=Tenant&api-version=2021-07-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Wed, 01 Sep 2021 02:28:15 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-tenant-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - purview account delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g -n --y + User-Agent: + - AZURECLI/2.27.2 azsdk-python-mgmt-purview/1.0.1 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_purview000001/providers/Microsoft.Purview/accounts/pv-000002?api-version=2021-07-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Wed, 01 Sep 2021 02:28:17 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Purview/locations/eastus2/operationResults/b4482f0b-ab01-4c19-bd97-d277fb9df2fc?api-version=2021-07-01 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - purview account delete + Connection: + - keep-alive + ParameterSetName: + - -g -n --y + User-Agent: + - AZURECLI/2.27.2 azsdk-python-mgmt-purview/1.0.1 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Purview/locations/eastus2/operationResults/b4482f0b-ab01-4c19-bd97-d277fb9df2fc?api-version=2021-07-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Wed, 01 Sep 2021 02:28:47 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Purview/locations/eastus2/operationResults/b4482f0b-ab01-4c19-bd97-d277fb9df2fc?api-version=2021-07-01 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - purview account delete + Connection: + - keep-alive + ParameterSetName: + - -g -n --y + User-Agent: + - AZURECLI/2.27.2 azsdk-python-mgmt-purview/1.0.1 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Purview/locations/eastus2/operationResults/b4482f0b-ab01-4c19-bd97-d277fb9df2fc?api-version=2021-07-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Wed, 01 Sep 2021 02:29:18 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Purview/locations/eastus2/operationResults/b4482f0b-ab01-4c19-bd97-d277fb9df2fc?api-version=2021-07-01 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - purview account delete + Connection: + - keep-alive + ParameterSetName: + - -g -n --y + User-Agent: + - AZURECLI/2.27.2 azsdk-python-mgmt-purview/1.0.1 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Purview/locations/eastus2/operationResults/b4482f0b-ab01-4c19-bd97-d277fb9df2fc?api-version=2021-07-01 + response: + body: + string: '{"startTime":"2021-09-01T02:28:17.670977Z","endTime":"2021-09-01T02:28:17.8510084Z","status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '105' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 01 Sep 2021 02:29:48 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/purview/azext_purview/tests/latest/test_purview_scenario.py b/src/purview/azext_purview/tests/latest/test_purview_scenario.py new file mode 100644 index 00000000000..9762413f563 --- /dev/null +++ b/src/purview/azext_purview/tests/latest/test_purview_scenario.py @@ -0,0 +1,99 @@ +# -------------------------------------------------------------------------- +# 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 azure.cli.testsdk import ScenarioTest +from azure.cli.testsdk import ResourceGroupPreparer, VirtualNetworkPreparer + + +class TestPurviewScenario(ScenarioTest): + + @ResourceGroupPreparer(name_prefix='cli_test_purview', location='eastus2') + def test_purview_account(self, resource_group): + self.kwargs.update({ + 'purview': self.create_random_name('pv-', 10) + }) + + purview_account = self.cmd('purview account create -n {purview} -g {rg}',checks=[ + self.check('friendlyName', '{purview}'), + self.check("contains(id, 'resourceGroups/{rg}/providers/Microsoft.Purview/accounts/{purview}')", True), + self.check('name', '{purview}'), + self.check('tags', None), + self.check('location', 'eastus2'), + self.check('resourceGroup', '{rg}'), + self.check('provisioningState', 'Creating') + ]).get_output_in_json() + + self.cmd('purview account wait --created -g {rg} -n {purview}') + self.cmd('purview account update -n {purview} -g {rg} --tags tag=test', checks=[ + self.check('friendlyName', '{purview}'), + self.check("contains(id, 'resourceGroups/{rg}/providers/Microsoft.Purview/accounts/{purview}')", True), + self.check('name', '{purview}'), + self.check('tags', {'tag':'test'}) + ]) + + self.kwargs.update({ + 'purview_id': purview_account['createdByObjectId'] + }) + + self.cmd('purview account add-root-collection-admin -n {purview} -g {rg} --object-id {purview_id}') + self.cmd('purview account list-key -n {purview} -g {rg}', checks=[ + self.check("length(@)", 2), + ]) + + self.cmd('purview account show -n {purview} -g {rg}', checks=[ + self.check('createdByObjectId', purview_account['createdByObjectId']), + self.check('friendlyName', '{purview}'), + self.check("contains(id, 'resourceGroups/{rg}/providers/Microsoft.Purview/accounts/{purview}')", True), + self.check('name', '{purview}') + ]) + self.cmd('purview account list', checks=[ + self.check('type(@)', 'array') + ]) + self.cmd('purview account delete -g {rg} -n {purview} --y') + + + @ResourceGroupPreparer(name_prefix='cli_test_purview', location='eastus2') + def test_purview_default_account(self, resource_group): + self.kwargs.update({ + 'purview': self.create_random_name('pv-', 10) + }) + + purview_account = self.cmd('purview account create -n {purview} -g {rg}', checks=[ + self.check('friendlyName', '{purview}'), + self.check("contains(id, 'resourceGroups/{rg}/providers/Microsoft.Purview/accounts/{purview}')", True), + self.check('name', '{purview}'), + self.check('tags', None), + self.check('location', 'eastus2'), + self.check('resourceGroup', '{rg}'), + self.check('provisioningState', 'Creating') + ]).get_output_in_json() + self.cmd('purview account wait --created -g {rg} -n {purview}') + self.kwargs.update({ + 'tenant_id': purview_account['identity']['tenantId'] + }) + + self.cmd('purview default-account set -n {purview} -g {rg} ' + '--subscription-id 0b1f6471-1bf0-4dda-aec3-cb9272f09590 --scope-tenant-id {tenant_id}', checks=[ + self.check('accountName', '{purview}'), + self.check('resourceGroupName', '{rg}'), + self.check('scopeTenantId', purview_account['identity']['tenantId']), + self.check('scopeType', 'Tenant') + ]) + + self.cmd('purview default-account show --scope-tenant-id {tenant_id} --scope-type Tenant',checks=[ + self.check('accountName', '{purview}'), + self.check('resourceGroupName', '{rg}'), + self.check('scopeTenantId', purview_account['identity']['tenantId']), + self.check('scopeType', 'Tenant') + ]) + + self.cmd('purview default-account remove --scope-tenant-id {tenant_id} --scope-type Tenant') + self.cmd('purview account delete -g {rg} -n {purview} --y') diff --git a/src/purview/azext_purview/vendored_sdks/__init__.py b/src/purview/azext_purview/vendored_sdks/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/purview/azext_purview/vendored_sdks/__init__.py @@ -0,0 +1,12 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/purview/azext_purview/vendored_sdks/purview/__init__.py b/src/purview/azext_purview/vendored_sdks/purview/__init__.py new file mode 100644 index 00000000000..37b1aa4a9b3 --- /dev/null +++ b/src/purview/azext_purview/vendored_sdks/purview/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._purview_management_client import PurviewManagementClient +from ._version import VERSION + +__version__ = VERSION +__all__ = ['PurviewManagementClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/src/purview/azext_purview/vendored_sdks/purview/_configuration.py b/src/purview/azext_purview/vendored_sdks/purview/_configuration.py new file mode 100644 index 00000000000..19097948256 --- /dev/null +++ b/src/purview/azext_purview/vendored_sdks/purview/_configuration.py @@ -0,0 +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. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +from ._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + + +class PurviewManagementClientConfiguration(Configuration): + """Configuration for PurviewManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The subscription identifier. + :type subscription_id: str + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(PurviewManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2021-07-01" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-purview/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/purview/azext_purview/vendored_sdks/purview/_purview_management_client.py b/src/purview/azext_purview/vendored_sdks/purview/_purview_management_client.py new file mode 100644 index 00000000000..dcc2fe3f68c --- /dev/null +++ b/src/purview/azext_purview/vendored_sdks/purview/_purview_management_client.py @@ -0,0 +1,90 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +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 PurviewManagementClientConfiguration +from .operations import AccountsOperations +from .operations import DefaultAccountsOperations +from .operations import Operations +from .operations import PrivateEndpointConnectionsOperations +from .operations import PrivateLinkResourcesOperations +from . import models + + +class PurviewManagementClient(object): + """Creates a Microsoft.Purview management client. + + :ivar accounts: AccountsOperations operations + :vartype accounts: azure.mgmt.purview.operations.AccountsOperations + :ivar default_accounts: DefaultAccountsOperations operations + :vartype default_accounts: azure.mgmt.purview.operations.DefaultAccountsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.purview.operations.Operations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: azure.mgmt.purview.operations.PrivateEndpointConnectionsOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: azure.mgmt.purview.operations.PrivateLinkResourcesOperations + :param credential: Credential needed for the client to connect to Azure. + :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__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = PurviewManagementClientConfiguration(credential, subscription_id, **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) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.accounts = AccountsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.default_accounts = DefaultAccountsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> PurviewManagementClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/src/purview/azext_purview/vendored_sdks/purview/_version.py b/src/purview/azext_purview/vendored_sdks/purview/_version.py new file mode 100644 index 00000000000..961c76eb77c --- /dev/null +++ b/src/purview/azext_purview/vendored_sdks/purview/_version.py @@ -0,0 +1,9 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +VERSION = "1.0.1" diff --git a/src/purview/azext_purview/vendored_sdks/purview/aio/__init__.py b/src/purview/azext_purview/vendored_sdks/purview/aio/__init__.py new file mode 100644 index 00000000000..9dad4e521c3 --- /dev/null +++ b/src/purview/azext_purview/vendored_sdks/purview/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._purview_management_client import PurviewManagementClient +__all__ = ['PurviewManagementClient'] diff --git a/src/purview/azext_purview/vendored_sdks/purview/aio/_configuration.py b/src/purview/azext_purview/vendored_sdks/purview/aio/_configuration.py new file mode 100644 index 00000000000..0fe146e261e --- /dev/null +++ b/src/purview/azext_purview/vendored_sdks/purview/aio/_configuration.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +from .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class PurviewManagementClientConfiguration(Configuration): + """Configuration for PurviewManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The subscription identifier. + :type subscription_id: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(PurviewManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2021-07-01" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-purview/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/purview/azext_purview/vendored_sdks/purview/aio/_purview_management_client.py b/src/purview/azext_purview/vendored_sdks/purview/aio/_purview_management_client.py new file mode 100644 index 00000000000..f0ce2081104 --- /dev/null +++ b/src/purview/azext_purview/vendored_sdks/purview/aio/_purview_management_client.py @@ -0,0 +1,84 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +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 import PurviewManagementClientConfiguration +from .operations import AccountsOperations +from .operations import DefaultAccountsOperations +from .operations import Operations +from .operations import PrivateEndpointConnectionsOperations +from .operations import PrivateLinkResourcesOperations +from .. import models + + +class PurviewManagementClient(object): + """Creates a Microsoft.Purview management client. + + :ivar accounts: AccountsOperations operations + :vartype accounts: azure.mgmt.purview.aio.operations.AccountsOperations + :ivar default_accounts: DefaultAccountsOperations operations + :vartype default_accounts: azure.mgmt.purview.aio.operations.DefaultAccountsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.purview.aio.operations.Operations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: azure.mgmt.purview.aio.operations.PrivateEndpointConnectionsOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: azure.mgmt.purview.aio.operations.PrivateLinkResourcesOperations + :param credential: Credential needed for the client to connect to Azure. + :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: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = PurviewManagementClientConfiguration(credential, subscription_id, **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) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.accounts = AccountsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.default_accounts = DefaultAccountsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "PurviewManagementClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/src/purview/azext_purview/vendored_sdks/purview/aio/operations/__init__.py b/src/purview/azext_purview/vendored_sdks/purview/aio/operations/__init__.py new file mode 100644 index 00000000000..8a9b4793901 --- /dev/null +++ b/src/purview/azext_purview/vendored_sdks/purview/aio/operations/__init__.py @@ -0,0 +1,21 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._accounts_operations import AccountsOperations +from ._default_accounts_operations import DefaultAccountsOperations +from ._operations import Operations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations + +__all__ = [ + 'AccountsOperations', + 'DefaultAccountsOperations', + 'Operations', + 'PrivateEndpointConnectionsOperations', + 'PrivateLinkResourcesOperations', +] diff --git a/src/purview/azext_purview/vendored_sdks/purview/aio/operations/_accounts_operations.py b/src/purview/azext_purview/vendored_sdks/purview/aio/operations/_accounts_operations.py new file mode 100644 index 00000000000..4bc7174d27f --- /dev/null +++ b/src/purview/azext_purview/vendored_sdks/purview/aio/operations/_accounts_operations.py @@ -0,0 +1,818 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from 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 ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AccountsOperations: + """AccountsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.purview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_resource_group( + self, + resource_group_name: str, + skip_token: Optional[str] = None, + **kwargs + ) -> AsyncIterable["models.AccountList"]: + """Gets the accounts resources by resource group. + + List accounts in ResourceGroup. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param skip_token: The skip 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[~azure.mgmt.purview.models.AccountList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AccountList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct 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') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + 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.ErrorResponseModel, 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_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts'} # type: ignore + + def list_by_subscription( + self, + skip_token: Optional[str] = None, + **kwargs + ) -> AsyncIterable["models.AccountList"]: + """Gets the accounts resources by subscription. + + List accounts in Subscription. + + :param skip_token: The skip 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[~azure.mgmt.purview.models.AccountList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AccountList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + 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') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + 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.ErrorResponseModel, 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.Purview/accounts'} # type: ignore + + async def get( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> "models.Account": + """Gets the account resource. + + Get an account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the 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) + :rtype: ~azure.mgmt.purview.models.Account + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Account"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # 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'), + } + 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'] = self._serialize.header("accept", accept, 'str') + + 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.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Account', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + account_name: str, + account: "models.Account", + **kwargs + ) -> "models.Account": + cls = kwargs.pop('cls', None) # type: ClsType["models.Account"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_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'), + } + 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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(account, 'Account') + body_content_kwargs['content'] = body_content + 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, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Account', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Account', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + account_name: str, + account: "models.Account", + **kwargs + ) -> AsyncLROPoller["models.Account"]: + """Create or update an account resource. + + Creates or updates an account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the account. + :type account_name: str + :param account: The account. + :type account: ~azure.mgmt.purview.models.Account + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :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 + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Account or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.purview.models.Account] + :raises ~azure.core.exceptions.HttpResponseError: + """ + 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 + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + account_name=account_name, + account=account, + 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('Account', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # 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'), + } + 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'] = self._serialize.header("accept", accept, 'str') + + 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.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the account resource. + + Deletes an account resource. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the account. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :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 + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + 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 + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + account_name=account_name, + cls=lambda x,y,z: x, + **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, {}) + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + account_name: str, + account_update_parameters: "models.AccountUpdateParameters", + **kwargs + ) -> "models.Account": + cls = kwargs.pop('cls', None) # type: ClsType["models.Account"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_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'), + } + 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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(account_update_parameters, 'AccountUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Account', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Account', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + account_name: str, + account_update_parameters: "models.AccountUpdateParameters", + **kwargs + ) -> AsyncLROPoller["models.Account"]: + """Patches the account resource. + + Updates an account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the account. + :type account_name: str + :param account_update_parameters: The account update parameters. + :type account_update_parameters: ~azure.mgmt.purview.models.AccountUpdateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :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 + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Account or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.purview.models.Account] + :raises ~azure.core.exceptions.HttpResponseError: + """ + 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 + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + account_name=account_name, + account_update_parameters=account_update_parameters, + 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('Account', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}'} # type: ignore + + async def list_keys( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> "models.AccessKeys": + """Lists the keys asynchronous. + + List the authorization keys associated with this account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the account. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccessKeys, or the result of cls(response) + :rtype: ~azure.mgmt.purview.models.AccessKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.list_keys.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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + 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.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AccessKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/listkeys'} # type: ignore + + async def add_root_collection_admin( + self, + resource_group_name: str, + account_name: str, + collection_admin_update: "models.CollectionAdminUpdate", + **kwargs + ) -> None: + """Add the administrator for root collection. + + Add the administrator for root collection associated with this account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the account. + :type account_name: str + :param collection_admin_update: The collection admin update payload. + :type collection_admin_update: ~azure.mgmt.purview.models.CollectionAdminUpdate + :keyword callable cls: A custom type or function that will be passed the direct 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 = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.add_root_collection_admin.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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(collection_admin_update, 'CollectionAdminUpdate') + 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.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + add_root_collection_admin.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/addRootCollectionAdmin'} # type: ignore + + async def check_name_availability( + self, + check_name_availability_request: "models.CheckNameAvailabilityRequest", + **kwargs + ) -> "models.CheckNameAvailabilityResult": + """Checks the account name availability. + + Checks if account name is available. + + :param check_name_availability_request: The check name availability request. + :type check_name_availability_request: ~azure.mgmt.purview.models.CheckNameAvailabilityRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CheckNameAvailabilityResult, or the result of cls(response) + :rtype: ~azure.mgmt.purview.models.CheckNameAvailabilityResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.check_name_availability.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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(check_name_availability_request, 'CheckNameAvailabilityRequest') + 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.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CheckNameAvailabilityResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Purview/checkNameAvailability'} # type: ignore diff --git a/src/purview/azext_purview/vendored_sdks/purview/aio/operations/_default_accounts_operations.py b/src/purview/azext_purview/vendored_sdks/purview/aio/operations/_default_accounts_operations.py new file mode 100644 index 00000000000..d377a943840 --- /dev/null +++ b/src/purview/azext_purview/vendored_sdks/purview/aio/operations/_default_accounts_operations.py @@ -0,0 +1,222 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, 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 + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DefaultAccountsOperations: + """DefaultAccountsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.purview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + scope_tenant_id: str, + scope_type: Union[str, "models.ScopeType"], + scope: Optional[str] = None, + **kwargs + ) -> "models.DefaultAccountPayload": + """Gets the default account information set for the scope. + + Get the default account for the scope. + + :param scope_tenant_id: The tenant ID. + :type scope_tenant_id: str + :param scope_type: The scope for the default account. + :type scope_type: str or ~azure.mgmt.purview.models.ScopeType + :param scope: The Id of the scope object, for example if the scope is "Subscription" then it is + the ID of that subscription. + :type scope: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DefaultAccountPayload, or the result of cls(response) + :rtype: ~azure.mgmt.purview.models.DefaultAccountPayload + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DefaultAccountPayload"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['scopeTenantId'] = self._serialize.query("scope_tenant_id", scope_tenant_id, 'str') + query_parameters['scopeType'] = self._serialize.query("scope_type", scope_type, 'str') + if scope is not None: + query_parameters['scope'] = self._serialize.query("scope", scope, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + 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.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DefaultAccountPayload', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Purview/getDefaultAccount'} # type: ignore + + async def set( + self, + default_account_payload: "models.DefaultAccountPayload", + **kwargs + ) -> "models.DefaultAccountPayload": + """Sets the default account for the scope. + + Sets the default account for the scope. + + :param default_account_payload: The payload containing the default account information and the + scope. + :type default_account_payload: ~azure.mgmt.purview.models.DefaultAccountPayload + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DefaultAccountPayload, or the result of cls(response) + :rtype: ~azure.mgmt.purview.models.DefaultAccountPayload + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DefaultAccountPayload"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.set.metadata['url'] # type: ignore + + # 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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(default_account_payload, 'DefaultAccountPayload') + 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.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DefaultAccountPayload', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + set.metadata = {'url': '/providers/Microsoft.Purview/setDefaultAccount'} # type: ignore + + async def remove( + self, + scope_tenant_id: str, + scope_type: Union[str, "models.ScopeType"], + scope: Optional[str] = None, + **kwargs + ) -> None: + """Removes the default account from the scope. + + Removes the default account from the scope. + + :param scope_tenant_id: The tenant ID. + :type scope_tenant_id: str + :param scope_type: The scope for the default account. + :type scope_type: str or ~azure.mgmt.purview.models.ScopeType + :param scope: The Id of the scope object, for example if the scope is "Subscription" then it is + the ID of that subscription. + :type scope: str + :keyword callable cls: A custom type or function that will be passed the direct 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 = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.remove.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['scopeTenantId'] = self._serialize.query("scope_tenant_id", scope_tenant_id, 'str') + query_parameters['scopeType'] = self._serialize.query("scope_type", scope_type, 'str') + if scope is not None: + query_parameters['scope'] = self._serialize.query("scope", scope, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + 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, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + remove.metadata = {'url': '/providers/Microsoft.Purview/removeDefaultAccount'} # type: ignore diff --git a/src/purview/azext_purview/vendored_sdks/purview/aio/operations/_operations.py b/src/purview/azext_purview/vendored_sdks/purview/aio/operations/_operations.py new file mode 100644 index 00000000000..f6f673f07a2 --- /dev/null +++ b/src/purview/azext_purview/vendored_sdks/purview/aio/operations/_operations.py @@ -0,0 +1,107 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, 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 + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.purview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.OperationList"]: + """Lists the available operations. + + List of available operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.purview.models.OperationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct 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') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('OperationList', 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.ErrorResponseModel, 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.metadata = {'url': '/providers/Microsoft.Purview/operations'} # type: ignore diff --git a/src/purview/azext_purview/vendored_sdks/purview/aio/operations/_private_endpoint_connections_operations.py b/src/purview/azext_purview/vendored_sdks/purview/aio/operations/_private_endpoint_connections_operations.py new file mode 100644 index 00000000000..3903231b783 --- /dev/null +++ b/src/purview/azext_purview/vendored_sdks/purview/aio/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,447 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from 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 ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PrivateEndpointConnectionsOperations: + """PrivateEndpointConnectionsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.purview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_account( + self, + resource_group_name: str, + account_name: str, + skip_token: Optional[str] = None, + **kwargs + ) -> AsyncIterable["models.PrivateEndpointConnectionList"]: + """Gets private endpoint connections. + + Get private endpoint connections for account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the account. + :type account_name: str + :param skip_token: The skip 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 PrivateEndpointConnectionList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.purview.models.PrivateEndpointConnectionList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + 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') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PrivateEndpointConnectionList', 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.ErrorResponseModel, 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.Purview/accounts/{accountName}/privateEndpointConnections'} # type: ignore + + async def get( + self, + resource_group_name: str, + account_name: str, + private_endpoint_connection_name: str, + **kwargs + ) -> "models.PrivateEndpointConnection": + """Gets private endpoint connection information. + + Get a private endpoint connection. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the account. + :type account_name: str + :param private_endpoint_connection_name: Name of the private endpoint connection. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.purview.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # 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'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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'] = self._serialize.header("accept", accept, 'str') + + 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.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + account_name: str, + private_endpoint_connection_name: str, + request: "models.PrivateEndpointConnection", + **kwargs + ) -> "models.PrivateEndpointConnection": + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_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'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'PrivateEndpointConnection') + body_content_kwargs['content'] = body_content + 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, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + account_name: str, + private_endpoint_connection_name: str, + request: "models.PrivateEndpointConnection", + **kwargs + ) -> AsyncLROPoller["models.PrivateEndpointConnection"]: + """Approves/Rejects private endpoint connection request. + + Create or update a private endpoint connection. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the account. + :type account_name: str + :param private_endpoint_connection_name: Name of the private endpoint connection. + :type private_endpoint_connection_name: str + :param request: The request. + :type request: ~azure.mgmt.purview.models.PrivateEndpointConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :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 + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.purview.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + account_name=account_name, + private_endpoint_connection_name=private_endpoint_connection_name, + request=request, + 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('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + account_name: str, + private_endpoint_connection_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # 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'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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'] = self._serialize.header("accept", accept, 'str') + + 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.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + account_name: str, + private_endpoint_connection_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes private endpoint connection. + + Delete a private endpoint connection. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the account. + :type account_name: str + :param private_endpoint_connection_name: Name of the private endpoint connection. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :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 + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + 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 + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + account_name=account_name, + private_endpoint_connection_name=private_endpoint_connection_name, + cls=lambda x,y,z: x, + **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, {}) + + 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'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/src/purview/azext_purview/vendored_sdks/purview/aio/operations/_private_link_resources_operations.py b/src/purview/azext_purview/vendored_sdks/purview/aio/operations/_private_link_resources_operations.py new file mode 100644 index 00000000000..b2cb09d510c --- /dev/null +++ b/src/purview/azext_purview/vendored_sdks/purview/aio/operations/_private_link_resources_operations.py @@ -0,0 +1,184 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, 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 + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PrivateLinkResourcesOperations: + """PrivateLinkResourcesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.purview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_account( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> AsyncIterable["models.PrivateLinkResourceList"]: + """Gets a list of privately linkable resources for an account. + + Gets a list of privately linkable resources for an account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the account. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateLinkResourceList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.purview.models.PrivateLinkResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkResourceList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + 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') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PrivateLinkResourceList', 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.ErrorResponseModel, 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.Purview/accounts/{accountName}/privateLinkResources'} # type: ignore + + async def get_by_group_id( + self, + resource_group_name: str, + account_name: str, + group_id: str, + **kwargs + ) -> "models.PrivateLinkResource": + """Gets a privately linkable resources for an account with given group identifier. + + Gets a privately linkable resources for an account with given group identifier. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the account. + :type account_name: str + :param group_id: The group identifier. + :type group_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResource, or the result of cls(response) + :rtype: ~azure.mgmt.purview.models.PrivateLinkResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.get_by_group_id.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'), + 'groupId': self._serialize.url("group_id", group_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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + 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.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateLinkResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_by_group_id.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/privateLinkResources/{groupId}'} # type: ignore diff --git a/src/purview/azext_purview/vendored_sdks/purview/models/__init__.py b/src/purview/azext_purview/vendored_sdks/purview/models/__init__.py new file mode 100644 index 00000000000..e958a3eaf6e --- /dev/null +++ b/src/purview/azext_purview/vendored_sdks/purview/models/__init__.py @@ -0,0 +1,145 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import AccessKeys + from ._models_py3 import Account + from ._models_py3 import AccountEndpoints + from ._models_py3 import AccountList + from ._models_py3 import AccountProperties + from ._models_py3 import AccountPropertiesEndpoints + from ._models_py3 import AccountPropertiesManagedResources + from ._models_py3 import AccountSku + from ._models_py3 import AccountUpdateParameters + from ._models_py3 import CheckNameAvailabilityRequest + from ._models_py3 import CheckNameAvailabilityResult + from ._models_py3 import CloudConnectors + from ._models_py3 import CollectionAdminUpdate + from ._models_py3 import DefaultAccountPayload + from ._models_py3 import DimensionProperties + from ._models_py3 import ErrorModel + from ._models_py3 import ErrorResponseModel + from ._models_py3 import ErrorResponseModelError + from ._models_py3 import Identity + from ._models_py3 import ManagedResources + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import OperationList + from ._models_py3 import OperationMetaLogSpecification + from ._models_py3 import OperationMetaMetricSpecification + from ._models_py3 import OperationMetaServiceSpecification + from ._models_py3 import PrivateEndpoint + from ._models_py3 import PrivateEndpointConnection + from ._models_py3 import PrivateEndpointConnectionList + from ._models_py3 import PrivateLinkResource + from ._models_py3 import PrivateLinkResourceList + from ._models_py3 import PrivateLinkResourceProperties + from ._models_py3 import PrivateLinkServiceConnectionState + from ._models_py3 import ProxyResource + from ._models_py3 import SystemData + from ._models_py3 import TrackedResource + from ._models_py3 import TrackedResourceSystemData +except (SyntaxError, ImportError): + from ._models import AccessKeys # type: ignore + from ._models import Account # type: ignore + from ._models import AccountEndpoints # type: ignore + from ._models import AccountList # type: ignore + from ._models import AccountProperties # type: ignore + from ._models import AccountPropertiesEndpoints # type: ignore + from ._models import AccountPropertiesManagedResources # type: ignore + from ._models import AccountSku # type: ignore + from ._models import AccountUpdateParameters # type: ignore + from ._models import CheckNameAvailabilityRequest # type: ignore + from ._models import CheckNameAvailabilityResult # type: ignore + from ._models import CloudConnectors # type: ignore + from ._models import CollectionAdminUpdate # type: ignore + from ._models import DefaultAccountPayload # type: ignore + from ._models import DimensionProperties # type: ignore + from ._models import ErrorModel # type: ignore + from ._models import ErrorResponseModel # type: ignore + from ._models import ErrorResponseModelError # type: ignore + from ._models import Identity # type: ignore + from ._models import ManagedResources # type: ignore + from ._models import Operation # type: ignore + from ._models import OperationDisplay # type: ignore + from ._models import OperationList # type: ignore + from ._models import OperationMetaLogSpecification # type: ignore + from ._models import OperationMetaMetricSpecification # type: ignore + from ._models import OperationMetaServiceSpecification # type: ignore + from ._models import PrivateEndpoint # type: ignore + from ._models import PrivateEndpointConnection # type: ignore + from ._models import PrivateEndpointConnectionList # type: ignore + from ._models import PrivateLinkResource # type: ignore + from ._models import PrivateLinkResourceList # type: ignore + from ._models import PrivateLinkResourceProperties # type: ignore + from ._models import PrivateLinkServiceConnectionState # type: ignore + from ._models import ProxyResource # type: ignore + from ._models import SystemData # type: ignore + from ._models import TrackedResource # type: ignore + from ._models import TrackedResourceSystemData # type: ignore + +from ._purview_management_client_enums import ( + CreatedByType, + LastModifiedByType, + Name, + ProvisioningState, + PublicNetworkAccess, + Reason, + ScopeType, + Status, + Type, +) + +__all__ = [ + 'AccessKeys', + 'Account', + 'AccountEndpoints', + 'AccountList', + 'AccountProperties', + 'AccountPropertiesEndpoints', + 'AccountPropertiesManagedResources', + 'AccountSku', + 'AccountUpdateParameters', + 'CheckNameAvailabilityRequest', + 'CheckNameAvailabilityResult', + 'CloudConnectors', + 'CollectionAdminUpdate', + 'DefaultAccountPayload', + 'DimensionProperties', + 'ErrorModel', + 'ErrorResponseModel', + 'ErrorResponseModelError', + 'Identity', + 'ManagedResources', + 'Operation', + 'OperationDisplay', + 'OperationList', + 'OperationMetaLogSpecification', + 'OperationMetaMetricSpecification', + 'OperationMetaServiceSpecification', + 'PrivateEndpoint', + 'PrivateEndpointConnection', + 'PrivateEndpointConnectionList', + 'PrivateLinkResource', + 'PrivateLinkResourceList', + 'PrivateLinkResourceProperties', + 'PrivateLinkServiceConnectionState', + 'ProxyResource', + 'SystemData', + 'TrackedResource', + 'TrackedResourceSystemData', + 'CreatedByType', + 'LastModifiedByType', + 'Name', + 'ProvisioningState', + 'PublicNetworkAccess', + 'Reason', + 'ScopeType', + 'Status', + 'Type', +] diff --git a/src/purview/azext_purview/vendored_sdks/purview/models/_models.py b/src/purview/azext_purview/vendored_sdks/purview/models/_models.py new file mode 100644 index 00000000000..060b060ab89 --- /dev/null +++ b/src/purview/azext_purview/vendored_sdks/purview/models/_models.py @@ -0,0 +1,1365 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class AccessKeys(msrest.serialization.Model): + """The Account access keys. + + :param atlas_kafka_primary_endpoint: Gets or sets the primary connection string. + :type atlas_kafka_primary_endpoint: str + :param atlas_kafka_secondary_endpoint: Gets or sets the secondary connection string. + :type atlas_kafka_secondary_endpoint: str + """ + + _attribute_map = { + 'atlas_kafka_primary_endpoint': {'key': 'atlasKafkaPrimaryEndpoint', 'type': 'str'}, + 'atlas_kafka_secondary_endpoint': {'key': 'atlasKafkaSecondaryEndpoint', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AccessKeys, self).__init__(**kwargs) + self.atlas_kafka_primary_endpoint = kwargs.get('atlas_kafka_primary_endpoint', None) + self.atlas_kafka_secondary_endpoint = kwargs.get('atlas_kafka_secondary_endpoint', None) + + +class TrackedResource(msrest.serialization.Model): + """Azure ARM Tracked Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Gets or sets the identifier. + :vartype id: str + :param identity: Identity Info on the tracked resource. + :type identity: ~azure.mgmt.purview.models.Identity + :param location: Gets or sets the location. + :type location: str + :ivar name: Gets or sets the name. + :vartype name: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.purview.models.SystemData + :param tags: A set of tags. Tags on the azure resource. + :type tags: dict[str, str] + :ivar type: Gets or sets the type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'system_data': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TrackedResource, self).__init__(**kwargs) + self.id = None + self.identity = kwargs.get('identity', None) + self.location = kwargs.get('location', None) + self.name = None + self.system_data = None + self.tags = kwargs.get('tags', None) + self.type = None + + +class Account(TrackedResource): + """Account resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Gets or sets the identifier. + :vartype id: str + :param identity: Identity Info on the tracked resource. + :type identity: ~azure.mgmt.purview.models.Identity + :param location: Gets or sets the location. + :type location: str + :ivar name: Gets or sets the name. + :vartype name: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.purview.models.SystemData + :param tags: A set of tags. Tags on the azure resource. + :type tags: dict[str, str] + :ivar type: Gets or sets the type. + :vartype type: str + :param sku: Gets or sets the Sku. + :type sku: ~azure.mgmt.purview.models.AccountSku + :param cloud_connectors: Cloud connectors. + External cloud identifier used as part of scanning configuration. + :type cloud_connectors: ~azure.mgmt.purview.models.CloudConnectors + :ivar created_at: Gets the time at which the entity was created. + :vartype created_at: ~datetime.datetime + :ivar created_by: Gets the creator of the entity. + :vartype created_by: str + :ivar created_by_object_id: Gets the creators of the entity's object id. + :vartype created_by_object_id: str + :ivar endpoints: The URIs that are the public endpoints of the account. + :vartype endpoints: ~azure.mgmt.purview.models.AccountEndpoints + :ivar friendly_name: Gets or sets the friendly name. + :vartype friendly_name: str + :param managed_resource_group_name: Gets or sets the managed resource group name. + :type managed_resource_group_name: str + :ivar managed_resources: Gets the resource identifiers of the managed resources. + :vartype managed_resources: ~azure.mgmt.purview.models.ManagedResources + :ivar private_endpoint_connections: Gets the private endpoint connections information. + :vartype private_endpoint_connections: + list[~azure.mgmt.purview.models.PrivateEndpointConnection] + :ivar provisioning_state: Gets or sets the state of the provisioning. Possible values include: + "Unknown", "Creating", "Moving", "Deleting", "SoftDeleting", "SoftDeleted", "Failed", + "Succeeded", "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.purview.models.ProvisioningState + :param public_network_access: Gets or sets the public network access. Possible values include: + "NotSpecified", "Enabled", "Disabled". Default value: "Enabled". + :type public_network_access: str or ~azure.mgmt.purview.models.PublicNetworkAccess + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'system_data': {'readonly': True}, + 'type': {'readonly': True}, + 'created_at': {'readonly': True}, + 'created_by': {'readonly': True}, + 'created_by_object_id': {'readonly': True}, + 'endpoints': {'readonly': True}, + 'friendly_name': {'readonly': True}, + 'managed_resources': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'type': {'key': 'type', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'AccountSku'}, + 'cloud_connectors': {'key': 'properties.cloudConnectors', 'type': 'CloudConnectors'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'str'}, + 'created_by_object_id': {'key': 'properties.createdByObjectId', 'type': 'str'}, + 'endpoints': {'key': 'properties.endpoints', 'type': 'AccountEndpoints'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'managed_resource_group_name': {'key': 'properties.managedResourceGroupName', 'type': 'str'}, + 'managed_resources': {'key': 'properties.managedResources', 'type': 'ManagedResources'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Account, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.cloud_connectors = kwargs.get('cloud_connectors', None) + self.created_at = None + self.created_by = None + self.created_by_object_id = None + self.endpoints = None + self.friendly_name = None + self.managed_resource_group_name = kwargs.get('managed_resource_group_name', None) + self.managed_resources = None + self.private_endpoint_connections = None + self.provisioning_state = None + self.public_network_access = kwargs.get('public_network_access', "Enabled") + + +class AccountEndpoints(msrest.serialization.Model): + """The account endpoints. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar catalog: Gets the catalog endpoint. + :vartype catalog: str + :ivar guardian: Gets the guardian endpoint. + :vartype guardian: str + :ivar scan: Gets the scan endpoint. + :vartype scan: str + """ + + _validation = { + 'catalog': {'readonly': True}, + 'guardian': {'readonly': True}, + 'scan': {'readonly': True}, + } + + _attribute_map = { + 'catalog': {'key': 'catalog', 'type': 'str'}, + 'guardian': {'key': 'guardian', 'type': 'str'}, + 'scan': {'key': 'scan', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AccountEndpoints, self).__init__(**kwargs) + self.catalog = None + self.guardian = None + self.scan = None + + +class AccountList(msrest.serialization.Model): + """Paged list of account resources. + + All required parameters must be populated in order to send to Azure. + + :param count: Total item count. + :type count: long + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type results. + :type value: list[~azure.mgmt.purview.models.Account] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'long'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[Account]'}, + } + + def __init__( + self, + **kwargs + ): + super(AccountList, self).__init__(**kwargs) + self.count = kwargs.get('count', None) + self.next_link = kwargs.get('next_link', None) + self.value = kwargs['value'] + + +class AccountProperties(msrest.serialization.Model): + """The account properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param cloud_connectors: Cloud connectors. + External cloud identifier used as part of scanning configuration. + :type cloud_connectors: ~azure.mgmt.purview.models.CloudConnectors + :ivar created_at: Gets the time at which the entity was created. + :vartype created_at: ~datetime.datetime + :ivar created_by: Gets the creator of the entity. + :vartype created_by: str + :ivar created_by_object_id: Gets the creators of the entity's object id. + :vartype created_by_object_id: str + :ivar endpoints: The URIs that are the public endpoints of the account. + :vartype endpoints: ~azure.mgmt.purview.models.AccountEndpoints + :ivar friendly_name: Gets or sets the friendly name. + :vartype friendly_name: str + :param managed_resource_group_name: Gets or sets the managed resource group name. + :type managed_resource_group_name: str + :ivar managed_resources: Gets the resource identifiers of the managed resources. + :vartype managed_resources: ~azure.mgmt.purview.models.ManagedResources + :ivar private_endpoint_connections: Gets the private endpoint connections information. + :vartype private_endpoint_connections: + list[~azure.mgmt.purview.models.PrivateEndpointConnection] + :ivar provisioning_state: Gets or sets the state of the provisioning. Possible values include: + "Unknown", "Creating", "Moving", "Deleting", "SoftDeleting", "SoftDeleted", "Failed", + "Succeeded", "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.purview.models.ProvisioningState + :param public_network_access: Gets or sets the public network access. Possible values include: + "NotSpecified", "Enabled", "Disabled". Default value: "Enabled". + :type public_network_access: str or ~azure.mgmt.purview.models.PublicNetworkAccess + """ + + _validation = { + 'created_at': {'readonly': True}, + 'created_by': {'readonly': True}, + 'created_by_object_id': {'readonly': True}, + 'endpoints': {'readonly': True}, + 'friendly_name': {'readonly': True}, + 'managed_resources': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'cloud_connectors': {'key': 'cloudConnectors', 'type': 'CloudConnectors'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_object_id': {'key': 'createdByObjectId', 'type': 'str'}, + 'endpoints': {'key': 'endpoints', 'type': 'AccountEndpoints'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'managed_resource_group_name': {'key': 'managedResourceGroupName', 'type': 'str'}, + 'managed_resources': {'key': 'managedResources', 'type': 'ManagedResources'}, + 'private_endpoint_connections': {'key': 'privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AccountProperties, self).__init__(**kwargs) + self.cloud_connectors = kwargs.get('cloud_connectors', None) + self.created_at = None + self.created_by = None + self.created_by_object_id = None + self.endpoints = None + self.friendly_name = None + self.managed_resource_group_name = kwargs.get('managed_resource_group_name', None) + self.managed_resources = None + self.private_endpoint_connections = None + self.provisioning_state = None + self.public_network_access = kwargs.get('public_network_access', "Enabled") + + +class AccountPropertiesEndpoints(AccountEndpoints): + """The URIs that are the public endpoints of the account. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar catalog: Gets the catalog endpoint. + :vartype catalog: str + :ivar guardian: Gets the guardian endpoint. + :vartype guardian: str + :ivar scan: Gets the scan endpoint. + :vartype scan: str + """ + + _validation = { + 'catalog': {'readonly': True}, + 'guardian': {'readonly': True}, + 'scan': {'readonly': True}, + } + + _attribute_map = { + 'catalog': {'key': 'catalog', 'type': 'str'}, + 'guardian': {'key': 'guardian', 'type': 'str'}, + 'scan': {'key': 'scan', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AccountPropertiesEndpoints, self).__init__(**kwargs) + + +class ManagedResources(msrest.serialization.Model): + """The managed resources in customer subscription. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar event_hub_namespace: Gets the managed event hub namespace resource identifier. + :vartype event_hub_namespace: str + :ivar resource_group: Gets the managed resource group resource identifier. This resource group + will host resource dependencies for the account. + :vartype resource_group: str + :ivar storage_account: Gets the managed storage account resource identifier. + :vartype storage_account: str + """ + + _validation = { + 'event_hub_namespace': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'storage_account': {'readonly': True}, + } + + _attribute_map = { + 'event_hub_namespace': {'key': 'eventHubNamespace', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + 'storage_account': {'key': 'storageAccount', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedResources, self).__init__(**kwargs) + self.event_hub_namespace = None + self.resource_group = None + self.storage_account = None + + +class AccountPropertiesManagedResources(ManagedResources): + """Gets the resource identifiers of the managed resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar event_hub_namespace: Gets the managed event hub namespace resource identifier. + :vartype event_hub_namespace: str + :ivar resource_group: Gets the managed resource group resource identifier. This resource group + will host resource dependencies for the account. + :vartype resource_group: str + :ivar storage_account: Gets the managed storage account resource identifier. + :vartype storage_account: str + """ + + _validation = { + 'event_hub_namespace': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'storage_account': {'readonly': True}, + } + + _attribute_map = { + 'event_hub_namespace': {'key': 'eventHubNamespace', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + 'storage_account': {'key': 'storageAccount', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AccountPropertiesManagedResources, self).__init__(**kwargs) + + +class AccountSku(msrest.serialization.Model): + """The Sku. + + :param capacity: Gets or sets the sku capacity. Possible values include: 4, 16. + :type capacity: int + :param name: Gets or sets the sku name. Possible values include: "Standard". + :type name: str or ~azure.mgmt.purview.models.Name + """ + + _attribute_map = { + 'capacity': {'key': 'capacity', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AccountSku, self).__init__(**kwargs) + self.capacity = kwargs.get('capacity', None) + self.name = kwargs.get('name', None) + + +class AccountUpdateParameters(msrest.serialization.Model): + """The account update properties. + + :param properties: The account properties. + :type properties: ~azure.mgmt.purview.models.AccountProperties + :param tags: A set of tags. Tags on the azure resource. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'AccountProperties'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(AccountUpdateParameters, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + self.tags = kwargs.get('tags', None) + + +class CheckNameAvailabilityRequest(msrest.serialization.Model): + """The request payload for CheckNameAvailability API. + + :param name: Resource name to verify for availability. + :type name: str + :param type: Fully qualified resource type which includes provider namespace. + :type type: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CheckNameAvailabilityRequest, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + + +class CheckNameAvailabilityResult(msrest.serialization.Model): + """The response payload for CheckNameAvailability API. + + :param message: Error message. + :type message: str + :param name_available: Indicates if name is valid and available. + :type name_available: bool + :param reason: The reason the name is not available. Possible values include: "Invalid", + "AlreadyExists". + :type reason: str or ~azure.mgmt.purview.models.Reason + """ + + _attribute_map = { + 'message': {'key': 'message', 'type': 'str'}, + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.message = kwargs.get('message', None) + self.name_available = kwargs.get('name_available', None) + self.reason = kwargs.get('reason', None) + + +class CloudConnectors(msrest.serialization.Model): + """CloudConnectors. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar aws_external_id: AWS external identifier. + Configured in AWS to allow use of the role arn used for scanning. + :vartype aws_external_id: str + """ + + _validation = { + 'aws_external_id': {'readonly': True}, + } + + _attribute_map = { + 'aws_external_id': {'key': 'awsExternalId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudConnectors, self).__init__(**kwargs) + self.aws_external_id = None + + +class CollectionAdminUpdate(msrest.serialization.Model): + """Collection administrator update. + + :param object_id: Gets or sets the object identifier of the admin. + :type object_id: str + """ + + _attribute_map = { + 'object_id': {'key': 'objectId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CollectionAdminUpdate, self).__init__(**kwargs) + self.object_id = kwargs.get('object_id', None) + + +class DefaultAccountPayload(msrest.serialization.Model): + """Payload to get and set the default account in the given scope. + + :param account_name: The name of the account that is set as the default. + :type account_name: str + :param resource_group_name: The resource group name of the account that is set as the default. + :type resource_group_name: str + :param scope: The scope object ID. For example, sub ID or tenant ID. + :type scope: str + :param scope_tenant_id: The scope tenant in which the default account is set. + :type scope_tenant_id: str + :param scope_type: The scope where the default account is set. Possible values include: + "Tenant", "Subscription". + :type scope_type: str or ~azure.mgmt.purview.models.ScopeType + :param subscription_id: The subscription ID of the account that is set as the default. + :type subscription_id: str + """ + + _attribute_map = { + 'account_name': {'key': 'accountName', 'type': 'str'}, + 'resource_group_name': {'key': 'resourceGroupName', 'type': 'str'}, + 'scope': {'key': 'scope', 'type': 'str'}, + 'scope_tenant_id': {'key': 'scopeTenantId', 'type': 'str'}, + 'scope_type': {'key': 'scopeType', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DefaultAccountPayload, self).__init__(**kwargs) + self.account_name = kwargs.get('account_name', None) + self.resource_group_name = kwargs.get('resource_group_name', None) + self.scope = kwargs.get('scope', None) + self.scope_tenant_id = kwargs.get('scope_tenant_id', None) + self.scope_type = kwargs.get('scope_type', None) + self.subscription_id = kwargs.get('subscription_id', None) + + +class DimensionProperties(msrest.serialization.Model): + """properties for dimension. + + :param display_name: localized display name of the dimension to customer. + :type display_name: str + :param name: dimension name. + :type name: str + :param to_be_exported_for_customer: flag indicating whether this dimension should be included + to the customer in Azure Monitor logs (aka Shoebox). + :type to_be_exported_for_customer: bool + """ + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'to_be_exported_for_customer': {'key': 'toBeExportedForCustomer', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(DimensionProperties, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.name = kwargs.get('name', None) + self.to_be_exported_for_customer = kwargs.get('to_be_exported_for_customer', None) + + +class ErrorModel(msrest.serialization.Model): + """Default error model. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Gets or sets the code. + :vartype code: str + :ivar details: Gets or sets the details. + :vartype details: list[~azure.mgmt.purview.models.ErrorModel] + :ivar message: Gets or sets the messages. + :vartype message: str + :ivar target: Gets or sets the target. + :vartype target: str + """ + + _validation = { + 'code': {'readonly': True}, + 'details': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorModel]'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorModel, self).__init__(**kwargs) + self.code = None + self.details = None + self.message = None + self.target = None + + +class ErrorResponseModel(msrest.serialization.Model): + """Default error response model. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error: Gets or sets the error. + :vartype error: ~azure.mgmt.purview.models.ErrorModel + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorModel'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponseModel, self).__init__(**kwargs) + self.error = None + + +class ErrorResponseModelError(ErrorModel): + """Gets or sets the error. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Gets or sets the code. + :vartype code: str + :ivar details: Gets or sets the details. + :vartype details: list[~azure.mgmt.purview.models.ErrorModel] + :ivar message: Gets or sets the messages. + :vartype message: str + :ivar target: Gets or sets the target. + :vartype target: str + """ + + _validation = { + 'code': {'readonly': True}, + 'details': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorModel]'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponseModelError, self).__init__(**kwargs) + + +class Identity(msrest.serialization.Model): + """The Managed Identity of the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: Service principal object Id. + :vartype principal_id: str + :ivar tenant_id: Tenant Id. + :vartype tenant_id: str + :param type: Identity Type. Possible values include: "SystemAssigned". + :type type: str or ~azure.mgmt.purview.models.Type + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = kwargs.get('type', None) + + +class Operation(msrest.serialization.Model): + """Operation resource. + + :param display: Properties on the operation. + :type display: ~azure.mgmt.purview.models.OperationDisplay + :param is_data_action: Whether operation is a data action. + :type is_data_action: bool + :param name: Operation name for display purposes. + :type name: str + :param origin: origin of the operation. + :type origin: str + :param service_specification: meta service specification. + :type service_specification: ~azure.mgmt.purview.models.OperationMetaServiceSpecification + """ + + _attribute_map = { + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationMetaServiceSpecification'}, + } + + def __init__( + self, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.display = kwargs.get('display', None) + self.is_data_action = kwargs.get('is_data_action', None) + self.name = kwargs.get('name', None) + self.origin = kwargs.get('origin', None) + self.service_specification = kwargs.get('service_specification', None) + + +class OperationDisplay(msrest.serialization.Model): + """The response model for get operation properties. + + :param description: Description of the operation for display purposes. + :type description: str + :param operation: Name of the operation for display purposes. + :type operation: str + :param provider: Name of the provider for display purposes. + :type provider: str + :param resource: Name of the resource type for display purposes. + :type resource: str + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.operation = kwargs.get('operation', None) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + + +class OperationList(msrest.serialization.Model): + """Paged list of operation resources. + + All required parameters must be populated in order to send to Azure. + + :param count: Total item count. + :type count: long + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type results. + :type value: list[~azure.mgmt.purview.models.Operation] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'long'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[Operation]'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationList, self).__init__(**kwargs) + self.count = kwargs.get('count', None) + self.next_link = kwargs.get('next_link', None) + self.value = kwargs['value'] + + +class OperationMetaLogSpecification(msrest.serialization.Model): + """log specifications for operation api. + + :param blob_duration: blob duration of the log. + :type blob_duration: str + :param display_name: localized name of the log category. + :type display_name: str + :param name: name of the log category. + :type name: str + """ + + _attribute_map = { + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationMetaLogSpecification, self).__init__(**kwargs) + self.blob_duration = kwargs.get('blob_duration', None) + self.display_name = kwargs.get('display_name', None) + self.name = kwargs.get('name', None) + + +class OperationMetaMetricSpecification(msrest.serialization.Model): + """metric specifications for the operation. + + :param aggregation_type: aggregation type of metric. + :type aggregation_type: str + :param dimensions: properties for dimension. + :type dimensions: list[~azure.mgmt.purview.models.DimensionProperties] + :param display_description: description of the metric. + :type display_description: str + :param display_name: localized name of the metric. + :type display_name: str + :param enable_regional_mdm_account: enable regional mdm account. + :type enable_regional_mdm_account: str + :param internal_metric_name: internal metric name. + :type internal_metric_name: str + :param name: name of the metric. + :type name: str + :param resource_id_dimension_name_override: dimension name use to replace resource id if + specified. + :type resource_id_dimension_name_override: str + :param source_mdm_namespace: Metric namespace. + Only set the namespace if different from the default value, + leaving it empty makes it use the value from the ARM manifest. + :type source_mdm_namespace: str + :param supported_aggregation_types: supported aggregation types. + :type supported_aggregation_types: list[str] + :param supported_time_grain_types: supported time grain types. + :type supported_time_grain_types: list[str] + :param unit: units for the metric. + :type unit: str + """ + + _attribute_map = { + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[DimensionProperties]'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'enable_regional_mdm_account': {'key': 'enableRegionalMdmAccount', 'type': 'str'}, + 'internal_metric_name': {'key': 'internalMetricName', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + 'source_mdm_namespace': {'key': 'sourceMdmNamespace', 'type': 'str'}, + 'supported_aggregation_types': {'key': 'supportedAggregationTypes', 'type': '[str]'}, + 'supported_time_grain_types': {'key': 'supportedTimeGrainTypes', 'type': '[str]'}, + 'unit': {'key': 'unit', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationMetaMetricSpecification, self).__init__(**kwargs) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.dimensions = kwargs.get('dimensions', None) + self.display_description = kwargs.get('display_description', None) + self.display_name = kwargs.get('display_name', None) + self.enable_regional_mdm_account = kwargs.get('enable_regional_mdm_account', None) + self.internal_metric_name = kwargs.get('internal_metric_name', None) + self.name = kwargs.get('name', None) + self.resource_id_dimension_name_override = kwargs.get('resource_id_dimension_name_override', None) + self.source_mdm_namespace = kwargs.get('source_mdm_namespace', None) + self.supported_aggregation_types = kwargs.get('supported_aggregation_types', None) + self.supported_time_grain_types = kwargs.get('supported_time_grain_types', None) + self.unit = kwargs.get('unit', None) + + +class OperationMetaServiceSpecification(msrest.serialization.Model): + """The operation meta service specification. + + :param log_specifications: log specifications for the operation. + :type log_specifications: list[~azure.mgmt.purview.models.OperationMetaLogSpecification] + :param metric_specifications: metric specifications for the operation. + :type metric_specifications: list[~azure.mgmt.purview.models.OperationMetaMetricSpecification] + """ + + _attribute_map = { + 'log_specifications': {'key': 'logSpecifications', 'type': '[OperationMetaLogSpecification]'}, + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[OperationMetaMetricSpecification]'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationMetaServiceSpecification, self).__init__(**kwargs) + self.log_specifications = kwargs.get('log_specifications', None) + self.metric_specifications = kwargs.get('metric_specifications', None) + + +class PrivateEndpoint(msrest.serialization.Model): + """A private endpoint class. + + :param id: The private endpoint identifier. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class ProxyResource(msrest.serialization.Model): + """Proxy Azure Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Gets or sets the identifier. + :vartype id: str + :ivar name: Gets or sets the name. + :vartype name: str + :ivar type: Gets or sets the type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProxyResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class PrivateEndpointConnection(ProxyResource): + """A private endpoint connection class. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Gets or sets the identifier. + :vartype id: str + :ivar name: Gets or sets the name. + :vartype name: str + :ivar type: Gets or sets the type. + :vartype type: str + :param private_endpoint: The private endpoint information. + :type private_endpoint: ~azure.mgmt.purview.models.PrivateEndpoint + :param private_link_service_connection_state: The private link service connection state. + :type private_link_service_connection_state: + ~azure.mgmt.purview.models.PrivateLinkServiceConnectionState + :ivar provisioning_state: The provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.private_endpoint = kwargs.get('private_endpoint', None) + self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + self.provisioning_state = None + + +class PrivateEndpointConnectionList(msrest.serialization.Model): + """Paged list of private endpoint connections. + + All required parameters must be populated in order to send to Azure. + + :param count: Total item count. + :type count: long + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type results. + :type value: list[~azure.mgmt.purview.models.PrivateEndpointConnection] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'long'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpointConnectionList, self).__init__(**kwargs) + self.count = kwargs.get('count', None) + self.next_link = kwargs.get('next_link', None) + self.value = kwargs['value'] + + +class PrivateLinkResource(msrest.serialization.Model): + """A privately linkable resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The private link resource identifier. + :vartype id: str + :ivar name: The private link resource name. + :vartype name: str + :ivar properties: The private link resource properties. + :vartype properties: ~azure.mgmt.purview.models.PrivateLinkResourceProperties + :ivar type: The private link resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'properties': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'PrivateLinkResourceProperties'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.properties = None + self.type = None + + +class PrivateLinkResourceList(msrest.serialization.Model): + """Paged list of private link resources. + + All required parameters must be populated in order to send to Azure. + + :param count: Total item count. + :type count: long + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type results. + :type value: list[~azure.mgmt.purview.models.PrivateLinkResource] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'long'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResourceList, self).__init__(**kwargs) + self.count = kwargs.get('count', None) + self.next_link = kwargs.get('next_link', None) + self.value = kwargs['value'] + + +class PrivateLinkResourceProperties(msrest.serialization.Model): + """A privately linkable resource properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar group_id: The private link resource group identifier. + :vartype group_id: str + :ivar required_members: This translates to how many Private IPs should be created for each + privately linkable resource. + :vartype required_members: list[str] + :ivar required_zone_names: The required zone names for private link resource. + :vartype required_zone_names: list[str] + """ + + _validation = { + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + 'required_zone_names': {'readonly': True}, + } + + _attribute_map = { + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'required_members': {'key': 'requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'requiredZoneNames', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResourceProperties, self).__init__(**kwargs) + self.group_id = None + self.required_members = None + self.required_zone_names = None + + +class PrivateLinkServiceConnectionState(msrest.serialization.Model): + """The private link service connection state. + + :param actions_required: The required actions. + :type actions_required: str + :param description: The description. + :type description: str + :param status: The status. Possible values include: "Unknown", "Pending", "Approved", + "Rejected", "Disconnected". + :type status: str or ~azure.mgmt.purview.models.Status + """ + + _attribute_map = { + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.actions_required = kwargs.get('actions_required', None) + self.description = kwargs.get('description', None) + self.status = kwargs.get('status', None) + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Possible values include: + "User", "Application", "ManagedIdentity", "Key". + :vartype created_by_type: str or ~azure.mgmt.purview.models.CreatedByType + :ivar last_modified_at: The timestamp of the last modification the resource (UTC). + :vartype last_modified_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :vartype last_modified_by_type: str or ~azure.mgmt.purview.models.LastModifiedByType + """ + + _validation = { + 'created_at': {'readonly': True}, + 'created_by': {'readonly': True}, + 'created_by_type': {'readonly': True}, + 'last_modified_at': {'readonly': True}, + 'last_modified_by': {'readonly': True}, + 'last_modified_by_type': {'readonly': True}, + } + + _attribute_map = { + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_at = None + self.created_by = None + self.created_by_type = None + self.last_modified_at = None + self.last_modified_by = None + self.last_modified_by_type = None + + +class TrackedResourceSystemData(SystemData): + """Metadata pertaining to creation and last modification of the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Possible values include: + "User", "Application", "ManagedIdentity", "Key". + :vartype created_by_type: str or ~azure.mgmt.purview.models.CreatedByType + :ivar last_modified_at: The timestamp of the last modification the resource (UTC). + :vartype last_modified_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :vartype last_modified_by_type: str or ~azure.mgmt.purview.models.LastModifiedByType + """ + + _validation = { + 'created_at': {'readonly': True}, + 'created_by': {'readonly': True}, + 'created_by_type': {'readonly': True}, + 'last_modified_at': {'readonly': True}, + 'last_modified_by': {'readonly': True}, + 'last_modified_by_type': {'readonly': True}, + } + + _attribute_map = { + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TrackedResourceSystemData, self).__init__(**kwargs) diff --git a/src/purview/azext_purview/vendored_sdks/purview/models/_models_py3.py b/src/purview/azext_purview/vendored_sdks/purview/models/_models_py3.py new file mode 100644 index 00000000000..5842762505b --- /dev/null +++ b/src/purview/azext_purview/vendored_sdks/purview/models/_models_py3.py @@ -0,0 +1,1472 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Dict, List, Optional, Union + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + +from ._purview_management_client_enums import * + + +class AccessKeys(msrest.serialization.Model): + """The Account access keys. + + :param atlas_kafka_primary_endpoint: Gets or sets the primary connection string. + :type atlas_kafka_primary_endpoint: str + :param atlas_kafka_secondary_endpoint: Gets or sets the secondary connection string. + :type atlas_kafka_secondary_endpoint: str + """ + + _attribute_map = { + 'atlas_kafka_primary_endpoint': {'key': 'atlasKafkaPrimaryEndpoint', 'type': 'str'}, + 'atlas_kafka_secondary_endpoint': {'key': 'atlasKafkaSecondaryEndpoint', 'type': 'str'}, + } + + def __init__( + self, + *, + atlas_kafka_primary_endpoint: Optional[str] = None, + atlas_kafka_secondary_endpoint: Optional[str] = None, + **kwargs + ): + super(AccessKeys, self).__init__(**kwargs) + self.atlas_kafka_primary_endpoint = atlas_kafka_primary_endpoint + self.atlas_kafka_secondary_endpoint = atlas_kafka_secondary_endpoint + + +class TrackedResource(msrest.serialization.Model): + """Azure ARM Tracked Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Gets or sets the identifier. + :vartype id: str + :param identity: Identity Info on the tracked resource. + :type identity: ~azure.mgmt.purview.models.Identity + :param location: Gets or sets the location. + :type location: str + :ivar name: Gets or sets the name. + :vartype name: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.purview.models.SystemData + :param tags: A set of tags. Tags on the azure resource. + :type tags: dict[str, str] + :ivar type: Gets or sets the type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'system_data': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + identity: Optional["Identity"] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(TrackedResource, self).__init__(**kwargs) + self.id = None + self.identity = identity + self.location = location + self.name = None + self.system_data = None + self.tags = tags + self.type = None + + +class Account(TrackedResource): + """Account resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Gets or sets the identifier. + :vartype id: str + :param identity: Identity Info on the tracked resource. + :type identity: ~azure.mgmt.purview.models.Identity + :param location: Gets or sets the location. + :type location: str + :ivar name: Gets or sets the name. + :vartype name: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.purview.models.SystemData + :param tags: A set of tags. Tags on the azure resource. + :type tags: dict[str, str] + :ivar type: Gets or sets the type. + :vartype type: str + :param sku: Gets or sets the Sku. + :type sku: ~azure.mgmt.purview.models.AccountSku + :param cloud_connectors: Cloud connectors. + External cloud identifier used as part of scanning configuration. + :type cloud_connectors: ~azure.mgmt.purview.models.CloudConnectors + :ivar created_at: Gets the time at which the entity was created. + :vartype created_at: ~datetime.datetime + :ivar created_by: Gets the creator of the entity. + :vartype created_by: str + :ivar created_by_object_id: Gets the creators of the entity's object id. + :vartype created_by_object_id: str + :ivar endpoints: The URIs that are the public endpoints of the account. + :vartype endpoints: ~azure.mgmt.purview.models.AccountEndpoints + :ivar friendly_name: Gets or sets the friendly name. + :vartype friendly_name: str + :param managed_resource_group_name: Gets or sets the managed resource group name. + :type managed_resource_group_name: str + :ivar managed_resources: Gets the resource identifiers of the managed resources. + :vartype managed_resources: ~azure.mgmt.purview.models.ManagedResources + :ivar private_endpoint_connections: Gets the private endpoint connections information. + :vartype private_endpoint_connections: + list[~azure.mgmt.purview.models.PrivateEndpointConnection] + :ivar provisioning_state: Gets or sets the state of the provisioning. Possible values include: + "Unknown", "Creating", "Moving", "Deleting", "SoftDeleting", "SoftDeleted", "Failed", + "Succeeded", "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.purview.models.ProvisioningState + :param public_network_access: Gets or sets the public network access. Possible values include: + "NotSpecified", "Enabled", "Disabled". Default value: "Enabled". + :type public_network_access: str or ~azure.mgmt.purview.models.PublicNetworkAccess + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'system_data': {'readonly': True}, + 'type': {'readonly': True}, + 'created_at': {'readonly': True}, + 'created_by': {'readonly': True}, + 'created_by_object_id': {'readonly': True}, + 'endpoints': {'readonly': True}, + 'friendly_name': {'readonly': True}, + 'managed_resources': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'type': {'key': 'type', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'AccountSku'}, + 'cloud_connectors': {'key': 'properties.cloudConnectors', 'type': 'CloudConnectors'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'str'}, + 'created_by_object_id': {'key': 'properties.createdByObjectId', 'type': 'str'}, + 'endpoints': {'key': 'properties.endpoints', 'type': 'AccountEndpoints'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'managed_resource_group_name': {'key': 'properties.managedResourceGroupName', 'type': 'str'}, + 'managed_resources': {'key': 'properties.managedResources', 'type': 'ManagedResources'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + } + + def __init__( + self, + *, + identity: Optional["Identity"] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + sku: Optional["AccountSku"] = None, + cloud_connectors: Optional["CloudConnectors"] = None, + managed_resource_group_name: Optional[str] = None, + public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = "Enabled", + **kwargs + ): + super(Account, self).__init__(identity=identity, location=location, tags=tags, **kwargs) + self.sku = sku + self.cloud_connectors = cloud_connectors + self.created_at = None + self.created_by = None + self.created_by_object_id = None + self.endpoints = None + self.friendly_name = None + self.managed_resource_group_name = managed_resource_group_name + self.managed_resources = None + self.private_endpoint_connections = None + self.provisioning_state = None + self.public_network_access = public_network_access + + +class AccountEndpoints(msrest.serialization.Model): + """The account endpoints. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar catalog: Gets the catalog endpoint. + :vartype catalog: str + :ivar guardian: Gets the guardian endpoint. + :vartype guardian: str + :ivar scan: Gets the scan endpoint. + :vartype scan: str + """ + + _validation = { + 'catalog': {'readonly': True}, + 'guardian': {'readonly': True}, + 'scan': {'readonly': True}, + } + + _attribute_map = { + 'catalog': {'key': 'catalog', 'type': 'str'}, + 'guardian': {'key': 'guardian', 'type': 'str'}, + 'scan': {'key': 'scan', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AccountEndpoints, self).__init__(**kwargs) + self.catalog = None + self.guardian = None + self.scan = None + + +class AccountList(msrest.serialization.Model): + """Paged list of account resources. + + All required parameters must be populated in order to send to Azure. + + :param count: Total item count. + :type count: long + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type results. + :type value: list[~azure.mgmt.purview.models.Account] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'long'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[Account]'}, + } + + def __init__( + self, + *, + value: List["Account"], + count: Optional[int] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(AccountList, self).__init__(**kwargs) + self.count = count + self.next_link = next_link + self.value = value + + +class AccountProperties(msrest.serialization.Model): + """The account properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param cloud_connectors: Cloud connectors. + External cloud identifier used as part of scanning configuration. + :type cloud_connectors: ~azure.mgmt.purview.models.CloudConnectors + :ivar created_at: Gets the time at which the entity was created. + :vartype created_at: ~datetime.datetime + :ivar created_by: Gets the creator of the entity. + :vartype created_by: str + :ivar created_by_object_id: Gets the creators of the entity's object id. + :vartype created_by_object_id: str + :ivar endpoints: The URIs that are the public endpoints of the account. + :vartype endpoints: ~azure.mgmt.purview.models.AccountEndpoints + :ivar friendly_name: Gets or sets the friendly name. + :vartype friendly_name: str + :param managed_resource_group_name: Gets or sets the managed resource group name. + :type managed_resource_group_name: str + :ivar managed_resources: Gets the resource identifiers of the managed resources. + :vartype managed_resources: ~azure.mgmt.purview.models.ManagedResources + :ivar private_endpoint_connections: Gets the private endpoint connections information. + :vartype private_endpoint_connections: + list[~azure.mgmt.purview.models.PrivateEndpointConnection] + :ivar provisioning_state: Gets or sets the state of the provisioning. Possible values include: + "Unknown", "Creating", "Moving", "Deleting", "SoftDeleting", "SoftDeleted", "Failed", + "Succeeded", "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.purview.models.ProvisioningState + :param public_network_access: Gets or sets the public network access. Possible values include: + "NotSpecified", "Enabled", "Disabled". Default value: "Enabled". + :type public_network_access: str or ~azure.mgmt.purview.models.PublicNetworkAccess + """ + + _validation = { + 'created_at': {'readonly': True}, + 'created_by': {'readonly': True}, + 'created_by_object_id': {'readonly': True}, + 'endpoints': {'readonly': True}, + 'friendly_name': {'readonly': True}, + 'managed_resources': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'cloud_connectors': {'key': 'cloudConnectors', 'type': 'CloudConnectors'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_object_id': {'key': 'createdByObjectId', 'type': 'str'}, + 'endpoints': {'key': 'endpoints', 'type': 'AccountEndpoints'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'managed_resource_group_name': {'key': 'managedResourceGroupName', 'type': 'str'}, + 'managed_resources': {'key': 'managedResources', 'type': 'ManagedResources'}, + 'private_endpoint_connections': {'key': 'privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, + } + + def __init__( + self, + *, + cloud_connectors: Optional["CloudConnectors"] = None, + managed_resource_group_name: Optional[str] = None, + public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = "Enabled", + **kwargs + ): + super(AccountProperties, self).__init__(**kwargs) + self.cloud_connectors = cloud_connectors + self.created_at = None + self.created_by = None + self.created_by_object_id = None + self.endpoints = None + self.friendly_name = None + self.managed_resource_group_name = managed_resource_group_name + self.managed_resources = None + self.private_endpoint_connections = None + self.provisioning_state = None + self.public_network_access = public_network_access + + +class AccountPropertiesEndpoints(AccountEndpoints): + """The URIs that are the public endpoints of the account. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar catalog: Gets the catalog endpoint. + :vartype catalog: str + :ivar guardian: Gets the guardian endpoint. + :vartype guardian: str + :ivar scan: Gets the scan endpoint. + :vartype scan: str + """ + + _validation = { + 'catalog': {'readonly': True}, + 'guardian': {'readonly': True}, + 'scan': {'readonly': True}, + } + + _attribute_map = { + 'catalog': {'key': 'catalog', 'type': 'str'}, + 'guardian': {'key': 'guardian', 'type': 'str'}, + 'scan': {'key': 'scan', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AccountPropertiesEndpoints, self).__init__(**kwargs) + + +class ManagedResources(msrest.serialization.Model): + """The managed resources in customer subscription. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar event_hub_namespace: Gets the managed event hub namespace resource identifier. + :vartype event_hub_namespace: str + :ivar resource_group: Gets the managed resource group resource identifier. This resource group + will host resource dependencies for the account. + :vartype resource_group: str + :ivar storage_account: Gets the managed storage account resource identifier. + :vartype storage_account: str + """ + + _validation = { + 'event_hub_namespace': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'storage_account': {'readonly': True}, + } + + _attribute_map = { + 'event_hub_namespace': {'key': 'eventHubNamespace', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + 'storage_account': {'key': 'storageAccount', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedResources, self).__init__(**kwargs) + self.event_hub_namespace = None + self.resource_group = None + self.storage_account = None + + +class AccountPropertiesManagedResources(ManagedResources): + """Gets the resource identifiers of the managed resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar event_hub_namespace: Gets the managed event hub namespace resource identifier. + :vartype event_hub_namespace: str + :ivar resource_group: Gets the managed resource group resource identifier. This resource group + will host resource dependencies for the account. + :vartype resource_group: str + :ivar storage_account: Gets the managed storage account resource identifier. + :vartype storage_account: str + """ + + _validation = { + 'event_hub_namespace': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'storage_account': {'readonly': True}, + } + + _attribute_map = { + 'event_hub_namespace': {'key': 'eventHubNamespace', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + 'storage_account': {'key': 'storageAccount', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AccountPropertiesManagedResources, self).__init__(**kwargs) + + +class AccountSku(msrest.serialization.Model): + """The Sku. + + :param capacity: Gets or sets the sku capacity. Possible values include: 4, 16. + :type capacity: int + :param name: Gets or sets the sku name. Possible values include: "Standard". + :type name: str or ~azure.mgmt.purview.models.Name + """ + + _attribute_map = { + 'capacity': {'key': 'capacity', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + capacity: Optional[int] = None, + name: Optional[Union[str, "Name"]] = None, + **kwargs + ): + super(AccountSku, self).__init__(**kwargs) + self.capacity = capacity + self.name = name + + +class AccountUpdateParameters(msrest.serialization.Model): + """The account update properties. + + :param properties: The account properties. + :type properties: ~azure.mgmt.purview.models.AccountProperties + :param tags: A set of tags. Tags on the azure resource. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'AccountProperties'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + properties: Optional["AccountProperties"] = None, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(AccountUpdateParameters, self).__init__(**kwargs) + self.properties = properties + self.tags = tags + + +class CheckNameAvailabilityRequest(msrest.serialization.Model): + """The request payload for CheckNameAvailability API. + + :param name: Resource name to verify for availability. + :type name: str + :param type: Fully qualified resource type which includes provider namespace. + :type type: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + type: Optional[str] = None, + **kwargs + ): + super(CheckNameAvailabilityRequest, self).__init__(**kwargs) + self.name = name + self.type = type + + +class CheckNameAvailabilityResult(msrest.serialization.Model): + """The response payload for CheckNameAvailability API. + + :param message: Error message. + :type message: str + :param name_available: Indicates if name is valid and available. + :type name_available: bool + :param reason: The reason the name is not available. Possible values include: "Invalid", + "AlreadyExists". + :type reason: str or ~azure.mgmt.purview.models.Reason + """ + + _attribute_map = { + 'message': {'key': 'message', 'type': 'str'}, + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + } + + def __init__( + self, + *, + message: Optional[str] = None, + name_available: Optional[bool] = None, + reason: Optional[Union[str, "Reason"]] = None, + **kwargs + ): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.message = message + self.name_available = name_available + self.reason = reason + + +class CloudConnectors(msrest.serialization.Model): + """CloudConnectors. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar aws_external_id: AWS external identifier. + Configured in AWS to allow use of the role arn used for scanning. + :vartype aws_external_id: str + """ + + _validation = { + 'aws_external_id': {'readonly': True}, + } + + _attribute_map = { + 'aws_external_id': {'key': 'awsExternalId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudConnectors, self).__init__(**kwargs) + self.aws_external_id = None + + +class CollectionAdminUpdate(msrest.serialization.Model): + """Collection administrator update. + + :param object_id: Gets or sets the object identifier of the admin. + :type object_id: str + """ + + _attribute_map = { + 'object_id': {'key': 'objectId', 'type': 'str'}, + } + + def __init__( + self, + *, + object_id: Optional[str] = None, + **kwargs + ): + super(CollectionAdminUpdate, self).__init__(**kwargs) + self.object_id = object_id + + +class DefaultAccountPayload(msrest.serialization.Model): + """Payload to get and set the default account in the given scope. + + :param account_name: The name of the account that is set as the default. + :type account_name: str + :param resource_group_name: The resource group name of the account that is set as the default. + :type resource_group_name: str + :param scope: The scope object ID. For example, sub ID or tenant ID. + :type scope: str + :param scope_tenant_id: The scope tenant in which the default account is set. + :type scope_tenant_id: str + :param scope_type: The scope where the default account is set. Possible values include: + "Tenant", "Subscription". + :type scope_type: str or ~azure.mgmt.purview.models.ScopeType + :param subscription_id: The subscription ID of the account that is set as the default. + :type subscription_id: str + """ + + _attribute_map = { + 'account_name': {'key': 'accountName', 'type': 'str'}, + 'resource_group_name': {'key': 'resourceGroupName', 'type': 'str'}, + 'scope': {'key': 'scope', 'type': 'str'}, + 'scope_tenant_id': {'key': 'scopeTenantId', 'type': 'str'}, + 'scope_type': {'key': 'scopeType', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + } + + def __init__( + self, + *, + account_name: Optional[str] = None, + resource_group_name: Optional[str] = None, + scope: Optional[str] = None, + scope_tenant_id: Optional[str] = None, + scope_type: Optional[Union[str, "ScopeType"]] = None, + subscription_id: Optional[str] = None, + **kwargs + ): + super(DefaultAccountPayload, self).__init__(**kwargs) + self.account_name = account_name + self.resource_group_name = resource_group_name + self.scope = scope + self.scope_tenant_id = scope_tenant_id + self.scope_type = scope_type + self.subscription_id = subscription_id + + +class DimensionProperties(msrest.serialization.Model): + """properties for dimension. + + :param display_name: localized display name of the dimension to customer. + :type display_name: str + :param name: dimension name. + :type name: str + :param to_be_exported_for_customer: flag indicating whether this dimension should be included + to the customer in Azure Monitor logs (aka Shoebox). + :type to_be_exported_for_customer: bool + """ + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'to_be_exported_for_customer': {'key': 'toBeExportedForCustomer', 'type': 'bool'}, + } + + def __init__( + self, + *, + display_name: Optional[str] = None, + name: Optional[str] = None, + to_be_exported_for_customer: Optional[bool] = None, + **kwargs + ): + super(DimensionProperties, self).__init__(**kwargs) + self.display_name = display_name + self.name = name + self.to_be_exported_for_customer = to_be_exported_for_customer + + +class ErrorModel(msrest.serialization.Model): + """Default error model. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Gets or sets the code. + :vartype code: str + :ivar details: Gets or sets the details. + :vartype details: list[~azure.mgmt.purview.models.ErrorModel] + :ivar message: Gets or sets the messages. + :vartype message: str + :ivar target: Gets or sets the target. + :vartype target: str + """ + + _validation = { + 'code': {'readonly': True}, + 'details': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorModel]'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorModel, self).__init__(**kwargs) + self.code = None + self.details = None + self.message = None + self.target = None + + +class ErrorResponseModel(msrest.serialization.Model): + """Default error response model. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error: Gets or sets the error. + :vartype error: ~azure.mgmt.purview.models.ErrorModel + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorModel'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponseModel, self).__init__(**kwargs) + self.error = None + + +class ErrorResponseModelError(ErrorModel): + """Gets or sets the error. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Gets or sets the code. + :vartype code: str + :ivar details: Gets or sets the details. + :vartype details: list[~azure.mgmt.purview.models.ErrorModel] + :ivar message: Gets or sets the messages. + :vartype message: str + :ivar target: Gets or sets the target. + :vartype target: str + """ + + _validation = { + 'code': {'readonly': True}, + 'details': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorModel]'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponseModelError, self).__init__(**kwargs) + + +class Identity(msrest.serialization.Model): + """The Managed Identity of the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: Service principal object Id. + :vartype principal_id: str + :ivar tenant_id: Tenant Id. + :vartype tenant_id: str + :param type: Identity Type. Possible values include: "SystemAssigned". + :type type: str or ~azure.mgmt.purview.models.Type + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "Type"]] = None, + **kwargs + ): + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + + +class Operation(msrest.serialization.Model): + """Operation resource. + + :param display: Properties on the operation. + :type display: ~azure.mgmt.purview.models.OperationDisplay + :param is_data_action: Whether operation is a data action. + :type is_data_action: bool + :param name: Operation name for display purposes. + :type name: str + :param origin: origin of the operation. + :type origin: str + :param service_specification: meta service specification. + :type service_specification: ~azure.mgmt.purview.models.OperationMetaServiceSpecification + """ + + _attribute_map = { + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationMetaServiceSpecification'}, + } + + def __init__( + self, + *, + display: Optional["OperationDisplay"] = None, + is_data_action: Optional[bool] = None, + name: Optional[str] = None, + origin: Optional[str] = None, + service_specification: Optional["OperationMetaServiceSpecification"] = None, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.display = display + self.is_data_action = is_data_action + self.name = name + self.origin = origin + self.service_specification = service_specification + + +class OperationDisplay(msrest.serialization.Model): + """The response model for get operation properties. + + :param description: Description of the operation for display purposes. + :type description: str + :param operation: Name of the operation for display purposes. + :type operation: str + :param provider: Name of the provider for display purposes. + :type provider: str + :param resource: Name of the resource type for display purposes. + :type resource: str + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + } + + def __init__( + self, + *, + description: Optional[str] = None, + operation: Optional[str] = None, + provider: Optional[str] = None, + resource: Optional[str] = None, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.description = description + self.operation = operation + self.provider = provider + self.resource = resource + + +class OperationList(msrest.serialization.Model): + """Paged list of operation resources. + + All required parameters must be populated in order to send to Azure. + + :param count: Total item count. + :type count: long + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type results. + :type value: list[~azure.mgmt.purview.models.Operation] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'long'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[Operation]'}, + } + + def __init__( + self, + *, + value: List["Operation"], + count: Optional[int] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(OperationList, self).__init__(**kwargs) + self.count = count + self.next_link = next_link + self.value = value + + +class OperationMetaLogSpecification(msrest.serialization.Model): + """log specifications for operation api. + + :param blob_duration: blob duration of the log. + :type blob_duration: str + :param display_name: localized name of the log category. + :type display_name: str + :param name: name of the log category. + :type name: str + """ + + _attribute_map = { + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + blob_duration: Optional[str] = None, + display_name: Optional[str] = None, + name: Optional[str] = None, + **kwargs + ): + super(OperationMetaLogSpecification, self).__init__(**kwargs) + self.blob_duration = blob_duration + self.display_name = display_name + self.name = name + + +class OperationMetaMetricSpecification(msrest.serialization.Model): + """metric specifications for the operation. + + :param aggregation_type: aggregation type of metric. + :type aggregation_type: str + :param dimensions: properties for dimension. + :type dimensions: list[~azure.mgmt.purview.models.DimensionProperties] + :param display_description: description of the metric. + :type display_description: str + :param display_name: localized name of the metric. + :type display_name: str + :param enable_regional_mdm_account: enable regional mdm account. + :type enable_regional_mdm_account: str + :param internal_metric_name: internal metric name. + :type internal_metric_name: str + :param name: name of the metric. + :type name: str + :param resource_id_dimension_name_override: dimension name use to replace resource id if + specified. + :type resource_id_dimension_name_override: str + :param source_mdm_namespace: Metric namespace. + Only set the namespace if different from the default value, + leaving it empty makes it use the value from the ARM manifest. + :type source_mdm_namespace: str + :param supported_aggregation_types: supported aggregation types. + :type supported_aggregation_types: list[str] + :param supported_time_grain_types: supported time grain types. + :type supported_time_grain_types: list[str] + :param unit: units for the metric. + :type unit: str + """ + + _attribute_map = { + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[DimensionProperties]'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'enable_regional_mdm_account': {'key': 'enableRegionalMdmAccount', 'type': 'str'}, + 'internal_metric_name': {'key': 'internalMetricName', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + 'source_mdm_namespace': {'key': 'sourceMdmNamespace', 'type': 'str'}, + 'supported_aggregation_types': {'key': 'supportedAggregationTypes', 'type': '[str]'}, + 'supported_time_grain_types': {'key': 'supportedTimeGrainTypes', 'type': '[str]'}, + 'unit': {'key': 'unit', 'type': 'str'}, + } + + def __init__( + self, + *, + aggregation_type: Optional[str] = None, + dimensions: Optional[List["DimensionProperties"]] = None, + display_description: Optional[str] = None, + display_name: Optional[str] = None, + enable_regional_mdm_account: Optional[str] = None, + internal_metric_name: Optional[str] = None, + name: Optional[str] = None, + resource_id_dimension_name_override: Optional[str] = None, + source_mdm_namespace: Optional[str] = None, + supported_aggregation_types: Optional[List[str]] = None, + supported_time_grain_types: Optional[List[str]] = None, + unit: Optional[str] = None, + **kwargs + ): + super(OperationMetaMetricSpecification, self).__init__(**kwargs) + self.aggregation_type = aggregation_type + self.dimensions = dimensions + self.display_description = display_description + self.display_name = display_name + self.enable_regional_mdm_account = enable_regional_mdm_account + self.internal_metric_name = internal_metric_name + self.name = name + self.resource_id_dimension_name_override = resource_id_dimension_name_override + self.source_mdm_namespace = source_mdm_namespace + self.supported_aggregation_types = supported_aggregation_types + self.supported_time_grain_types = supported_time_grain_types + self.unit = unit + + +class OperationMetaServiceSpecification(msrest.serialization.Model): + """The operation meta service specification. + + :param log_specifications: log specifications for the operation. + :type log_specifications: list[~azure.mgmt.purview.models.OperationMetaLogSpecification] + :param metric_specifications: metric specifications for the operation. + :type metric_specifications: list[~azure.mgmt.purview.models.OperationMetaMetricSpecification] + """ + + _attribute_map = { + 'log_specifications': {'key': 'logSpecifications', 'type': '[OperationMetaLogSpecification]'}, + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[OperationMetaMetricSpecification]'}, + } + + def __init__( + self, + *, + log_specifications: Optional[List["OperationMetaLogSpecification"]] = None, + metric_specifications: Optional[List["OperationMetaMetricSpecification"]] = None, + **kwargs + ): + super(OperationMetaServiceSpecification, self).__init__(**kwargs) + self.log_specifications = log_specifications + self.metric_specifications = metric_specifications + + +class PrivateEndpoint(msrest.serialization.Model): + """A private endpoint class. + + :param id: The private endpoint identifier. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = id + + +class ProxyResource(msrest.serialization.Model): + """Proxy Azure Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Gets or sets the identifier. + :vartype id: str + :ivar name: Gets or sets the name. + :vartype name: str + :ivar type: Gets or sets the type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProxyResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class PrivateEndpointConnection(ProxyResource): + """A private endpoint connection class. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Gets or sets the identifier. + :vartype id: str + :ivar name: Gets or sets the name. + :vartype name: str + :ivar type: Gets or sets the type. + :vartype type: str + :param private_endpoint: The private endpoint information. + :type private_endpoint: ~azure.mgmt.purview.models.PrivateEndpoint + :param private_link_service_connection_state: The private link service connection state. + :type private_link_service_connection_state: + ~azure.mgmt.purview.models.PrivateLinkServiceConnectionState + :ivar provisioning_state: The provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + private_endpoint: Optional["PrivateEndpoint"] = None, + private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, + **kwargs + ): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state + self.provisioning_state = None + + +class PrivateEndpointConnectionList(msrest.serialization.Model): + """Paged list of private endpoint connections. + + All required parameters must be populated in order to send to Azure. + + :param count: Total item count. + :type count: long + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type results. + :type value: list[~azure.mgmt.purview.models.PrivateEndpointConnection] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'long'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + } + + def __init__( + self, + *, + value: List["PrivateEndpointConnection"], + count: Optional[int] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(PrivateEndpointConnectionList, self).__init__(**kwargs) + self.count = count + self.next_link = next_link + self.value = value + + +class PrivateLinkResource(msrest.serialization.Model): + """A privately linkable resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The private link resource identifier. + :vartype id: str + :ivar name: The private link resource name. + :vartype name: str + :ivar properties: The private link resource properties. + :vartype properties: ~azure.mgmt.purview.models.PrivateLinkResourceProperties + :ivar type: The private link resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'properties': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'PrivateLinkResourceProperties'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.properties = None + self.type = None + + +class PrivateLinkResourceList(msrest.serialization.Model): + """Paged list of private link resources. + + All required parameters must be populated in order to send to Azure. + + :param count: Total item count. + :type count: long + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type results. + :type value: list[~azure.mgmt.purview.models.PrivateLinkResource] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'long'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + } + + def __init__( + self, + *, + value: List["PrivateLinkResource"], + count: Optional[int] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(PrivateLinkResourceList, self).__init__(**kwargs) + self.count = count + self.next_link = next_link + self.value = value + + +class PrivateLinkResourceProperties(msrest.serialization.Model): + """A privately linkable resource properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar group_id: The private link resource group identifier. + :vartype group_id: str + :ivar required_members: This translates to how many Private IPs should be created for each + privately linkable resource. + :vartype required_members: list[str] + :ivar required_zone_names: The required zone names for private link resource. + :vartype required_zone_names: list[str] + """ + + _validation = { + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + 'required_zone_names': {'readonly': True}, + } + + _attribute_map = { + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'required_members': {'key': 'requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'requiredZoneNames', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResourceProperties, self).__init__(**kwargs) + self.group_id = None + self.required_members = None + self.required_zone_names = None + + +class PrivateLinkServiceConnectionState(msrest.serialization.Model): + """The private link service connection state. + + :param actions_required: The required actions. + :type actions_required: str + :param description: The description. + :type description: str + :param status: The status. Possible values include: "Unknown", "Pending", "Approved", + "Rejected", "Disconnected". + :type status: str or ~azure.mgmt.purview.models.Status + """ + + _attribute_map = { + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + *, + actions_required: Optional[str] = None, + description: Optional[str] = None, + status: Optional[Union[str, "Status"]] = None, + **kwargs + ): + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.actions_required = actions_required + self.description = description + self.status = status + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Possible values include: + "User", "Application", "ManagedIdentity", "Key". + :vartype created_by_type: str or ~azure.mgmt.purview.models.CreatedByType + :ivar last_modified_at: The timestamp of the last modification the resource (UTC). + :vartype last_modified_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :vartype last_modified_by_type: str or ~azure.mgmt.purview.models.LastModifiedByType + """ + + _validation = { + 'created_at': {'readonly': True}, + 'created_by': {'readonly': True}, + 'created_by_type': {'readonly': True}, + 'last_modified_at': {'readonly': True}, + 'last_modified_by': {'readonly': True}, + 'last_modified_by_type': {'readonly': True}, + } + + _attribute_map = { + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_at = None + self.created_by = None + self.created_by_type = None + self.last_modified_at = None + self.last_modified_by = None + self.last_modified_by_type = None + + +class TrackedResourceSystemData(SystemData): + """Metadata pertaining to creation and last modification of the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Possible values include: + "User", "Application", "ManagedIdentity", "Key". + :vartype created_by_type: str or ~azure.mgmt.purview.models.CreatedByType + :ivar last_modified_at: The timestamp of the last modification the resource (UTC). + :vartype last_modified_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :vartype last_modified_by_type: str or ~azure.mgmt.purview.models.LastModifiedByType + """ + + _validation = { + 'created_at': {'readonly': True}, + 'created_by': {'readonly': True}, + 'created_by_type': {'readonly': True}, + 'last_modified_at': {'readonly': True}, + 'last_modified_by': {'readonly': True}, + 'last_modified_by_type': {'readonly': True}, + } + + _attribute_map = { + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TrackedResourceSystemData, self).__init__(**kwargs) diff --git a/src/purview/azext_purview/vendored_sdks/purview/models/_purview_management_client_enums.py b/src/purview/azext_purview/vendored_sdks/purview/models/_purview_management_client_enums.py new file mode 100644 index 00000000000..f017663e5f5 --- /dev/null +++ b/src/purview/azext_purview/vendored_sdks/purview/models/_purview_management_client_enums.py @@ -0,0 +1,103 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity that created the resource. + """ + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + +class LastModifiedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity that last modified the resource. + """ + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + +class Name(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Gets or sets the sku name. + """ + + STANDARD = "Standard" + +class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Gets or sets the state of the provisioning. + """ + + UNKNOWN = "Unknown" + CREATING = "Creating" + MOVING = "Moving" + DELETING = "Deleting" + SOFT_DELETING = "SoftDeleting" + SOFT_DELETED = "SoftDeleted" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + CANCELED = "Canceled" + +class PublicNetworkAccess(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Gets or sets the public network access. + """ + + NOT_SPECIFIED = "NotSpecified" + ENABLED = "Enabled" + DISABLED = "Disabled" + +class Reason(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The reason the name is not available. + """ + + INVALID = "Invalid" + ALREADY_EXISTS = "AlreadyExists" + +class ScopeType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The scope where the default account is set. + """ + + TENANT = "Tenant" + SUBSCRIPTION = "Subscription" + +class Status(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The status. + """ + + UNKNOWN = "Unknown" + PENDING = "Pending" + APPROVED = "Approved" + REJECTED = "Rejected" + DISCONNECTED = "Disconnected" + +class Type(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Identity Type + """ + + SYSTEM_ASSIGNED = "SystemAssigned" diff --git a/src/purview/azext_purview/vendored_sdks/purview/operations/__init__.py b/src/purview/azext_purview/vendored_sdks/purview/operations/__init__.py new file mode 100644 index 00000000000..8a9b4793901 --- /dev/null +++ b/src/purview/azext_purview/vendored_sdks/purview/operations/__init__.py @@ -0,0 +1,21 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._accounts_operations import AccountsOperations +from ._default_accounts_operations import DefaultAccountsOperations +from ._operations import Operations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations + +__all__ = [ + 'AccountsOperations', + 'DefaultAccountsOperations', + 'Operations', + 'PrivateEndpointConnectionsOperations', + 'PrivateLinkResourcesOperations', +] diff --git a/src/purview/azext_purview/vendored_sdks/purview/operations/_accounts_operations.py b/src/purview/azext_purview/vendored_sdks/purview/operations/_accounts_operations.py new file mode 100644 index 00000000000..961049a0cc1 --- /dev/null +++ b/src/purview/azext_purview/vendored_sdks/purview/operations/_accounts_operations.py @@ -0,0 +1,834 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, 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.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 + +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 AccountsOperations(object): + """AccountsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.purview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_resource_group( + self, + resource_group_name, # type: str + skip_token=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.AccountList"] + """Gets the accounts resources by resource group. + + List accounts in ResourceGroup. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param skip_token: The skip 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[~azure.mgmt.purview.models.AccountList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AccountList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct 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') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + 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.ErrorResponseModel, 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_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts'} # type: ignore + + def list_by_subscription( + self, + skip_token=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.AccountList"] + """Gets the accounts resources by subscription. + + List accounts in Subscription. + + :param skip_token: The skip 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[~azure.mgmt.purview.models.AccountList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AccountList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + 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') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + 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.ErrorResponseModel, 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.Purview/accounts'} # type: ignore + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.Account" + """Gets the account resource. + + Get an account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the 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) + :rtype: ~azure.mgmt.purview.models.Account + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Account"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # 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'), + } + 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'] = self._serialize.header("accept", accept, 'str') + + 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.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Account', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + account_name, # type: str + account, # type: "models.Account" + **kwargs # type: Any + ): + # type: (...) -> "models.Account" + cls = kwargs.pop('cls', None) # type: ClsType["models.Account"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_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'), + } + 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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(account, 'Account') + body_content_kwargs['content'] = body_content + 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, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Account', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Account', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + account_name, # type: str + account, # type: "models.Account" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.Account"] + """Create or update an account resource. + + Creates or updates an account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the account. + :type account_name: str + :param account: The account. + :type account: ~azure.mgmt.purview.models.Account + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :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 + :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[~azure.mgmt.purview.models.Account] + :raises ~azure.core.exceptions.HttpResponseError: + """ + 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 + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + account_name=account_name, + account=account, + 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('Account', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # 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'), + } + 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'] = self._serialize.header("accept", accept, 'str') + + 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.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the account resource. + + Deletes an account resource. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the account. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :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 + :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', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + account_name=account_name, + cls=lambda x,y,z: x, + **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, {}) + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + account_name, # type: str + account_update_parameters, # type: "models.AccountUpdateParameters" + **kwargs # type: Any + ): + # type: (...) -> "models.Account" + cls = kwargs.pop('cls', None) # type: ClsType["models.Account"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_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'), + } + 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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(account_update_parameters, 'AccountUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Account', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Account', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + account_name, # type: str + account_update_parameters, # type: "models.AccountUpdateParameters" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.Account"] + """Patches the account resource. + + Updates an account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the account. + :type account_name: str + :param account_update_parameters: The account update parameters. + :type account_update_parameters: ~azure.mgmt.purview.models.AccountUpdateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :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 + :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[~azure.mgmt.purview.models.Account] + :raises ~azure.core.exceptions.HttpResponseError: + """ + 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 + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + account_name=account_name, + account_update_parameters=account_update_parameters, + 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('Account', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}'} # type: ignore + + def list_keys( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AccessKeys" + """Lists the keys asynchronous. + + List the authorization keys associated with this account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the account. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccessKeys, or the result of cls(response) + :rtype: ~azure.mgmt.purview.models.AccessKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.list_keys.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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + 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.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AccessKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/listkeys'} # type: ignore + + def add_root_collection_admin( + self, + resource_group_name, # type: str + account_name, # type: str + collection_admin_update, # type: "models.CollectionAdminUpdate" + **kwargs # type: Any + ): + # type: (...) -> None + """Add the administrator for root collection. + + Add the administrator for root collection associated with this account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the account. + :type account_name: str + :param collection_admin_update: The collection admin update payload. + :type collection_admin_update: ~azure.mgmt.purview.models.CollectionAdminUpdate + :keyword callable cls: A custom type or function that will be passed the direct 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 = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.add_root_collection_admin.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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(collection_admin_update, 'CollectionAdminUpdate') + 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.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + add_root_collection_admin.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/addRootCollectionAdmin'} # type: ignore + + def check_name_availability( + self, + check_name_availability_request, # type: "models.CheckNameAvailabilityRequest" + **kwargs # type: Any + ): + # type: (...) -> "models.CheckNameAvailabilityResult" + """Checks the account name availability. + + Checks if account name is available. + + :param check_name_availability_request: The check name availability request. + :type check_name_availability_request: ~azure.mgmt.purview.models.CheckNameAvailabilityRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CheckNameAvailabilityResult, or the result of cls(response) + :rtype: ~azure.mgmt.purview.models.CheckNameAvailabilityResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.check_name_availability.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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(check_name_availability_request, 'CheckNameAvailabilityRequest') + 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.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CheckNameAvailabilityResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Purview/checkNameAvailability'} # type: ignore diff --git a/src/purview/azext_purview/vendored_sdks/purview/operations/_default_accounts_operations.py b/src/purview/azext_purview/vendored_sdks/purview/operations/_default_accounts_operations.py new file mode 100644 index 00000000000..131728a16d5 --- /dev/null +++ b/src/purview/azext_purview/vendored_sdks/purview/operations/_default_accounts_operations.py @@ -0,0 +1,229 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DefaultAccountsOperations(object): + """DefaultAccountsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.purview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + scope_tenant_id, # type: str + scope_type, # type: Union[str, "models.ScopeType"] + scope=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.DefaultAccountPayload" + """Gets the default account information set for the scope. + + Get the default account for the scope. + + :param scope_tenant_id: The tenant ID. + :type scope_tenant_id: str + :param scope_type: The scope for the default account. + :type scope_type: str or ~azure.mgmt.purview.models.ScopeType + :param scope: The Id of the scope object, for example if the scope is "Subscription" then it is + the ID of that subscription. + :type scope: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DefaultAccountPayload, or the result of cls(response) + :rtype: ~azure.mgmt.purview.models.DefaultAccountPayload + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DefaultAccountPayload"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['scopeTenantId'] = self._serialize.query("scope_tenant_id", scope_tenant_id, 'str') + query_parameters['scopeType'] = self._serialize.query("scope_type", scope_type, 'str') + if scope is not None: + query_parameters['scope'] = self._serialize.query("scope", scope, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + 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.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DefaultAccountPayload', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Purview/getDefaultAccount'} # type: ignore + + def set( + self, + default_account_payload, # type: "models.DefaultAccountPayload" + **kwargs # type: Any + ): + # type: (...) -> "models.DefaultAccountPayload" + """Sets the default account for the scope. + + Sets the default account for the scope. + + :param default_account_payload: The payload containing the default account information and the + scope. + :type default_account_payload: ~azure.mgmt.purview.models.DefaultAccountPayload + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DefaultAccountPayload, or the result of cls(response) + :rtype: ~azure.mgmt.purview.models.DefaultAccountPayload + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DefaultAccountPayload"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.set.metadata['url'] # type: ignore + + # 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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(default_account_payload, 'DefaultAccountPayload') + 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.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DefaultAccountPayload', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + set.metadata = {'url': '/providers/Microsoft.Purview/setDefaultAccount'} # type: ignore + + def remove( + self, + scope_tenant_id, # type: str + scope_type, # type: Union[str, "models.ScopeType"] + scope=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + """Removes the default account from the scope. + + Removes the default account from the scope. + + :param scope_tenant_id: The tenant ID. + :type scope_tenant_id: str + :param scope_type: The scope for the default account. + :type scope_type: str or ~azure.mgmt.purview.models.ScopeType + :param scope: The Id of the scope object, for example if the scope is "Subscription" then it is + the ID of that subscription. + :type scope: str + :keyword callable cls: A custom type or function that will be passed the direct 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 = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.remove.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['scopeTenantId'] = self._serialize.query("scope_tenant_id", scope_tenant_id, 'str') + query_parameters['scopeType'] = self._serialize.query("scope_type", scope_type, 'str') + if scope is not None: + query_parameters['scope'] = self._serialize.query("scope", scope, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + 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, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + remove.metadata = {'url': '/providers/Microsoft.Purview/removeDefaultAccount'} # type: ignore diff --git a/src/purview/azext_purview/vendored_sdks/purview/operations/_operations.py b/src/purview/azext_purview/vendored_sdks/purview/operations/_operations.py new file mode 100644 index 00000000000..6a61b0f964d --- /dev/null +++ b/src/purview/azext_purview/vendored_sdks/purview/operations/_operations.py @@ -0,0 +1,112 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, 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 + +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 Operations(object): + """Operations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.purview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.OperationList"] + """Lists the available operations. + + List of available operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.purview.models.OperationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct 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') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('OperationList', 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.ErrorResponseModel, 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.metadata = {'url': '/providers/Microsoft.Purview/operations'} # type: ignore diff --git a/src/purview/azext_purview/vendored_sdks/purview/operations/_private_endpoint_connections_operations.py b/src/purview/azext_purview/vendored_sdks/purview/operations/_private_endpoint_connections_operations.py new file mode 100644 index 00000000000..6c2165d07f7 --- /dev/null +++ b/src/purview/azext_purview/vendored_sdks/purview/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,457 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, 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.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 + +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 PrivateEndpointConnectionsOperations(object): + """PrivateEndpointConnectionsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.purview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_account( + self, + resource_group_name, # type: str + account_name, # type: str + skip_token=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.PrivateEndpointConnectionList"] + """Gets private endpoint connections. + + Get private endpoint connections for account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the account. + :type account_name: str + :param skip_token: The skip 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 PrivateEndpointConnectionList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.purview.models.PrivateEndpointConnectionList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + 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') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PrivateEndpointConnectionList', 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.ErrorResponseModel, 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.Purview/accounts/{accountName}/privateEndpointConnections'} # type: ignore + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.PrivateEndpointConnection" + """Gets private endpoint connection information. + + Get a private endpoint connection. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the account. + :type account_name: str + :param private_endpoint_connection_name: Name of the private endpoint connection. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.purview.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # 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'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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'] = self._serialize.header("accept", accept, 'str') + + 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.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + account_name, # type: str + private_endpoint_connection_name, # type: str + request, # type: "models.PrivateEndpointConnection" + **kwargs # type: Any + ): + # type: (...) -> "models.PrivateEndpointConnection" + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_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'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'PrivateEndpointConnection') + body_content_kwargs['content'] = body_content + 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, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + account_name, # type: str + private_endpoint_connection_name, # type: str + request, # type: "models.PrivateEndpointConnection" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.PrivateEndpointConnection"] + """Approves/Rejects private endpoint connection request. + + Create or update a private endpoint connection. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the account. + :type account_name: str + :param private_endpoint_connection_name: Name of the private endpoint connection. + :type private_endpoint_connection_name: str + :param request: The request. + :type request: ~azure.mgmt.purview.models.PrivateEndpointConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :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 + :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 PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.purview.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + account_name=account_name, + private_endpoint_connection_name=private_endpoint_connection_name, + request=request, + 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('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + account_name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # 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'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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'] = self._serialize.header("accept", accept, 'str') + + 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.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + account_name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes private endpoint connection. + + Delete a private endpoint connection. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the account. + :type account_name: str + :param private_endpoint_connection_name: Name of the private endpoint connection. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :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 + :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', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + account_name=account_name, + private_endpoint_connection_name=private_endpoint_connection_name, + cls=lambda x,y,z: x, + **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, {}) + + 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'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/src/purview/azext_purview/vendored_sdks/purview/operations/_private_link_resources_operations.py b/src/purview/azext_purview/vendored_sdks/purview/operations/_private_link_resources_operations.py new file mode 100644 index 00000000000..316f0921bb7 --- /dev/null +++ b/src/purview/azext_purview/vendored_sdks/purview/operations/_private_link_resources_operations.py @@ -0,0 +1,190 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, 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 + +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 PrivateLinkResourcesOperations(object): + """PrivateLinkResourcesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.purview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_account( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.PrivateLinkResourceList"] + """Gets a list of privately linkable resources for an account. + + Gets a list of privately linkable resources for an account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the account. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateLinkResourceList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.purview.models.PrivateLinkResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkResourceList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + 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') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PrivateLinkResourceList', 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.ErrorResponseModel, 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.Purview/accounts/{accountName}/privateLinkResources'} # type: ignore + + def get_by_group_id( + self, + resource_group_name, # type: str + account_name, # type: str + group_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.PrivateLinkResource" + """Gets a privately linkable resources for an account with given group identifier. + + Gets a privately linkable resources for an account with given group identifier. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the account. + :type account_name: str + :param group_id: The group identifier. + :type group_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResource, or the result of cls(response) + :rtype: ~azure.mgmt.purview.models.PrivateLinkResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.get_by_group_id.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'), + 'groupId': self._serialize.url("group_id", group_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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + 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.ErrorResponseModel, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateLinkResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_by_group_id.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName}/privateLinkResources/{groupId}'} # type: ignore diff --git a/src/purview/azext_purview/vendored_sdks/purview/py.typed b/src/purview/azext_purview/vendored_sdks/purview/py.typed new file mode 100644 index 00000000000..e5aff4f83af --- /dev/null +++ b/src/purview/azext_purview/vendored_sdks/purview/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/src/purview/azext_purview/vendored_sdks/purview/setup.py b/src/purview/azext_purview/vendored_sdks/purview/setup.py new file mode 100644 index 00000000000..bdb87bbedbf --- /dev/null +++ b/src/purview/azext_purview/vendored_sdks/purview/setup.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# coding: utf-8 + +from setuptools import setup, find_packages + +NAME = "azure-mgmt-purview" +VERSION = "1.0.1" + +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools + +REQUIRES = ["msrest>=0.6.18", "azure-core<2.0.0,>=1.8.2", "azure-mgmt-core<2.0.0,>=1.2.1"] + +setup( + name=NAME, + version=VERSION, + description="azure-mgmt-purview", + author_email="", + url="", + keywords=["Swagger", "PurviewManagementClient"], + install_requires=REQUIRES, + packages=find_packages(), + include_package_data=True, + long_description="""\ + Creates a Microsoft.Purview management client. + """ +) diff --git a/src/purview/report.md b/src/purview/report.md new file mode 100644 index 00000000000..19b4c79d99f --- /dev/null +++ b/src/purview/report.md @@ -0,0 +1,189 @@ +# Azure CLI Module Creation Report + +## EXTENSION +|CLI Extension|Command Groups| +|---------|------------| +|az purview|[groups](#CommandGroups) + +## GROUPS +### Command groups in `az purview` extension +|CLI Command Group|Group Swagger name|Commands| +|---------|------------|--------| +|az purview account|Accounts|[commands](#CommandsInAccounts)| +|az purview default-account|DefaultAccounts|[commands](#CommandsInDefaultAccounts)| + +## COMMANDS +### Commands in `az purview account` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az purview account list](#AccountsListByResourceGroup)|ListByResourceGroup|[Parameters](#ParametersAccountsListByResourceGroup)|[Example](#ExamplesAccountsListByResourceGroup)| +|[az purview account list](#AccountsListBySubscription)|ListBySubscription|[Parameters](#ParametersAccountsListBySubscription)|[Example](#ExamplesAccountsListBySubscription)| +|[az purview account show](#AccountsGet)|Get|[Parameters](#ParametersAccountsGet)|[Example](#ExamplesAccountsGet)| +|[az purview account create](#AccountsCreateOrUpdate#Create)|CreateOrUpdate#Create|[Parameters](#ParametersAccountsCreateOrUpdate#Create)|[Example](#ExamplesAccountsCreateOrUpdate#Create)| +|[az purview account update](#AccountsUpdate)|Update|[Parameters](#ParametersAccountsUpdate)|[Example](#ExamplesAccountsUpdate)| +|[az purview account delete](#AccountsDelete)|Delete|[Parameters](#ParametersAccountsDelete)|[Example](#ExamplesAccountsDelete)| +|[az purview account add-root-collection-admin](#AccountsAddRootCollectionAdmin)|AddRootCollectionAdmin|[Parameters](#ParametersAccountsAddRootCollectionAdmin)|[Example](#ExamplesAccountsAddRootCollectionAdmin)| +|[az purview account list-key](#AccountsListKeys)|ListKeys|[Parameters](#ParametersAccountsListKeys)|[Example](#ExamplesAccountsListKeys)| + +### Commands in `az purview default-account` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az purview default-account show](#DefaultAccountsGet)|Get|[Parameters](#ParametersDefaultAccountsGet)|[Example](#ExamplesDefaultAccountsGet)| +|[az purview default-account remove](#DefaultAccountsRemove)|Remove|[Parameters](#ParametersDefaultAccountsRemove)|[Example](#ExamplesDefaultAccountsRemove)| +|[az purview default-account set](#DefaultAccountsSet)|Set|[Parameters](#ParametersDefaultAccountsSet)|[Example](#ExamplesDefaultAccountsSet)| + + +## COMMAND DETAILS +### group `az purview account` +#### Command `az purview account list` + +##### Example +``` +az purview account list --resource-group "SampleResourceGroup" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| +|**--skip-token**|string|The skip token.|skip_token|$skipToken| + +#### Command `az purview account list` + +##### Example +``` +az purview account list +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--skip-token**|string|The skip token.|skip_token|$skipToken| + +#### Command `az purview account show` + +##### Example +``` +az purview account show --name "account1" --resource-group "SampleResourceGroup" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| +|**--account-name**|string|The name of the account.|account_name|accountName| + +#### Command `az purview account create` + +##### Example +``` +az purview account create --location "West US 2" --managed-resource-group-name "custom-rgname" --sku name="Standard" \ +capacity=4 --name "account1" --resource-group "SampleResourceGroup" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| +|**--account-name**|string|The name of the account.|account_name|accountName| +|**--location**|string|Gets or sets the location.|location|location| +|**--tags**|dictionary|Tags on the azure resource.|tags|tags| +|**--sku**|object|Gets or sets the Sku.|sku|sku| +|**--managed-resource-group-name**|string|Gets or sets the managed resource group name|managed_resource_group_name|managedResourceGroupName| +|**--public-network-access**|choice|Gets or sets the public network access.|public_network_access|publicNetworkAccess| + +#### Command `az purview account update` + +##### Example +``` +az purview account update --name "account1" --tags newTag="New tag value." --resource-group "SampleResourceGroup" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| +|**--account-name**|string|The name of the account.|account_name|accountName| +|**--tags**|dictionary|Tags on the azure resource.|tags|tags| +|**--managed-resource-group-name**|string|Gets or sets the managed resource group name|managed_resource_group_name|managedResourceGroupName| +|**--public-network-access**|choice|Gets or sets the public network access.|public_network_access|publicNetworkAccess| + +#### Command `az purview account delete` + +##### Example +``` +az purview account delete --name "account1" --resource-group "SampleResourceGroup" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| +|**--account-name**|string|The name of the account.|account_name|accountName| + +#### Command `az purview account add-root-collection-admin` + +##### Example +``` +az purview account add-root-collection-admin --name "account1" --object-id "7e8de0e7-2bfc-4e1f-9659-2a5785e4356f" \ +--resource-group "SampleResourceGroup" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| +|**--account-name**|string|The name of the account.|account_name|accountName| +|**--object-id**|string|Gets or sets the object identifier of the admin.|object_id|objectId| + +#### Command `az purview account list-key` + +##### Example +``` +az purview account list-key --name "account1" --resource-group "SampleResourceGroup" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The resource group name.|resource_group_name|resourceGroupName| +|**--account-name**|string|The name of the account.|account_name|accountName| + +### group `az purview default-account` +#### Command `az purview default-account show` + +##### Example +``` +az purview default-account show --scope "12345678-1234-1234-12345678abc" --scope-tenant-id \ +"12345678-1234-1234-12345678abc" --scope-type "Tenant" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--scope-tenant-id**|uuid|The tenant ID.|scope_tenant_id|scopeTenantId| +|**--scope-type**|choice|The scope for the default account.|scope_type|scopeType| +|**--scope**|string|The Id of the scope object, for example if the scope is "Subscription" then it is the ID of that subscription.|scope|scope| + +#### Command `az purview default-account remove` + +##### Example +``` +az purview default-account remove --scope "12345678-1234-1234-12345678abc" --scope-tenant-id \ +"12345678-1234-1234-12345678abc" --scope-type "Tenant" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--scope-tenant-id**|uuid|The tenant ID.|scope_tenant_id|scopeTenantId| +|**--scope-type**|choice|The scope for the default account.|scope_type|scopeType| +|**--scope**|string|The Id of the scope object, for example if the scope is "Subscription" then it is the ID of that subscription.|scope|scope| + +#### Command `az purview default-account set` + +##### Example +``` +az purview default-account set --account-name "myDefaultAccount" --resource-group "rg-1" --scope \ +"12345678-1234-1234-12345678abc" --scope-tenant-id "12345678-1234-1234-12345678abc" --scope-type "Tenant" \ +--subscription-id "12345678-1234-1234-12345678aaa" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--account-name**|string|The name of the account that is set as the default.|account_name|accountName| +|**--resource-group-name**|string|The resource group name of the account that is set as the default.|resource_group_name|resourceGroupName| +|**--scope**|string|The scope object ID. For example, sub ID or tenant ID.|scope|scope| +|**--scope-tenant-id**|string|The scope tenant in which the default account is set.|scope_tenant_id|scopeTenantId| +|**--scope-type**|choice|The scope where the default account is set.|scope_type|scopeType| +|**--subscription-id**|string|The subscription ID of the account that is set as the default.|subscription_id|subscriptionId| diff --git a/src/purview/setup.cfg b/src/purview/setup.cfg new file mode 100644 index 00000000000..2fdd96e5d39 --- /dev/null +++ b/src/purview/setup.cfg @@ -0,0 +1 @@ +#setup.cfg \ No newline at end of file diff --git a/src/purview/setup.py b/src/purview/setup.py new file mode 100644 index 00000000000..d89fc32f663 --- /dev/null +++ b/src/purview/setup.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python + +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +from codecs import open +from setuptools import setup, find_packages + +# HISTORY.rst entry. +VERSION = '0.1.0' +try: + from azext_purview.manual.version import VERSION +except ImportError: + pass + +# The full list of classifiers is available at +# https://pypi.python.org/pypi?%3Aaction=list_classifiers +CLASSIFIERS = [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'Intended Audience :: System Administrators', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'License :: OSI Approved :: MIT License', +] + +DEPENDENCIES = [] + +try: + from azext_purview.manual.dependency import DEPENDENCIES +except ImportError: + pass + +with open('README.md', 'r', encoding='utf-8') as f: + README = f.read() +with open('HISTORY.rst', 'r', encoding='utf-8') as f: + HISTORY = f.read() + +setup( + name='purview', + version=VERSION, + description='Microsoft Azure Command-Line Tools PurviewManagementClient Extension', + author='Microsoft Corporation', + author_email='azpycli@microsoft.com', + url='https://github.com/Azure/azure-cli-extensions/tree/master/src/purview', + long_description=README + '\n\n' + HISTORY, + license='MIT', + classifiers=CLASSIFIERS, + packages=find_packages(), + install_requires=DEPENDENCIES, + package_data={'azext_purview': ['azext_metadata.json']}, +) diff --git a/src/service_name.json b/src/service_name.json index b8a3bbf5e0b..84e98f4f131 100644 --- a/src/service_name.json +++ b/src/service_name.json @@ -493,6 +493,11 @@ "Command": "az devops", "AzureServiceName": "Azure Devops", "URL": "https://docs.microsoft.com/en-us/azure/devops/" + }, + { + "Command": "az purview", + "AzureServiceName": "Azure Purview", + "URL": "https://docs.microsoft.com/en-us/azure/purview/" } ]