From af58089e71dab926f65de0884f473c34e27cdcfe Mon Sep 17 00:00:00 2001 From: Ryan Lettieri Date: Wed, 28 Aug 2024 11:49:01 -0600 Subject: [PATCH 01/19] Initial push for dts CLI. Still has hardcoded stuff Signed-off-by: Ryan Lettieri --- .github/CODEOWNERS | 5 + src/durabletask/HISTORY.rst | 8 + src/durabletask/README.rst | 5 + src/durabletask/azext_durabletask/__init__.py | 32 + .../azext_durabletask/_client_factory.py | 15 + src/durabletask/azext_durabletask/_help.py | 95 + src/durabletask/azext_durabletask/_params.py | 23 + .../azext_durabletask/_validators.py | 20 + .../azext_durabletask/azext_metadata.json | 5 + src/durabletask/azext_durabletask/commands.py | 48 + src/durabletask/azext_durabletask/custom.py | 66 + .../azext_durabletask/tests/__init__.py | 5 + .../tests/latest/__init__.py | 5 + .../tests/latest/test_durabletask_scenario.py | 40 + .../vendored_sdks/__init__.py | 26 + .../vendored_sdks/_configuration.py | 65 + .../vendored_sdks/_durabletask_mgmt_client.py | 118 + .../azext_durabletask/vendored_sdks/_patch.py | 20 + .../vendored_sdks/_serialization.py | 2000 +++++ .../vendored_sdks/_version.py | 9 + .../vendored_sdks/aio/__init__.py | 23 + .../vendored_sdks/aio/_configuration.py | 65 + .../aio/_durabletask_mgmt_client.py | 120 + .../vendored_sdks/aio/_patch.py | 20 + .../vendored_sdks/aio/operations/__init__.py | 23 + .../aio/operations/_namespaces_operations.py | 793 ++ .../aio/operations/_operations.py | 130 + .../vendored_sdks/aio/operations/_patch.py | 20 + .../aio/operations/_task_hubs_operations.py | 548 ++ .../vendored_sdks/authoring/__init__.py | 19 + .../vendored_sdks/authoring/_configuration.py | 47 + .../authoring/_luis_authoring_client.py | 90 + .../authoring/models/__init__.py | 346 + .../models/_luis_authoring_client_enums.py | 25 + .../vendored_sdks/authoring/models/_models.py | 3333 ++++++++ .../authoring/models/_models_py3.py | 3333 ++++++++ .../authoring/operations/__init__.py | 32 + .../authoring/operations/_apps_operations.py | 1397 ++++ .../operations/_azure_accounts_operations.py | 296 + .../operations/_examples_operations.py | 304 + .../operations/_features_operations.py | 557 ++ .../authoring/operations/_model_operations.py | 7086 +++++++++++++++++ .../operations/_pattern_operations.py | 550 ++ .../operations/_settings_operations.py | 156 + .../authoring/operations/_train_operations.py | 158 + .../operations/_versions_operations.py | 705 ++ .../vendored_sdks/authoring/version.py | 13 + .../vendored_sdks/models/__init__.py | 63 + .../models/_durabletask_mgmt_client_enums.py | 54 + .../vendored_sdks/models/_models_py3.py | 730 ++ .../vendored_sdks/models/_patch.py | 20 + .../vendored_sdks/operations/__init__.py | 23 + .../operations/_namespaces_operations.py | 990 +++ .../vendored_sdks/operations/_operations.py | 152 + .../vendored_sdks/operations/_patch.py | 20 + .../operations/_task_hubs_operations.py | 717 ++ .../azext_durabletask/vendored_sdks/py.typed | 1 + .../vendored_sdks/version.py | 12 + src/durabletask/setup.cfg | 0 src/durabletask/setup.py | 58 + 60 files changed, 25639 insertions(+) create mode 100644 src/durabletask/HISTORY.rst create mode 100644 src/durabletask/README.rst create mode 100644 src/durabletask/azext_durabletask/__init__.py create mode 100644 src/durabletask/azext_durabletask/_client_factory.py create mode 100644 src/durabletask/azext_durabletask/_help.py create mode 100644 src/durabletask/azext_durabletask/_params.py create mode 100644 src/durabletask/azext_durabletask/_validators.py create mode 100644 src/durabletask/azext_durabletask/azext_metadata.json create mode 100644 src/durabletask/azext_durabletask/commands.py create mode 100644 src/durabletask/azext_durabletask/custom.py create mode 100644 src/durabletask/azext_durabletask/tests/__init__.py create mode 100644 src/durabletask/azext_durabletask/tests/latest/__init__.py create mode 100644 src/durabletask/azext_durabletask/tests/latest/test_durabletask_scenario.py create mode 100644 src/durabletask/azext_durabletask/vendored_sdks/__init__.py create mode 100644 src/durabletask/azext_durabletask/vendored_sdks/_configuration.py create mode 100644 src/durabletask/azext_durabletask/vendored_sdks/_durabletask_mgmt_client.py create mode 100644 src/durabletask/azext_durabletask/vendored_sdks/_patch.py create mode 100644 src/durabletask/azext_durabletask/vendored_sdks/_serialization.py create mode 100644 src/durabletask/azext_durabletask/vendored_sdks/_version.py create mode 100644 src/durabletask/azext_durabletask/vendored_sdks/aio/__init__.py create mode 100644 src/durabletask/azext_durabletask/vendored_sdks/aio/_configuration.py create mode 100644 src/durabletask/azext_durabletask/vendored_sdks/aio/_durabletask_mgmt_client.py create mode 100644 src/durabletask/azext_durabletask/vendored_sdks/aio/_patch.py create mode 100644 src/durabletask/azext_durabletask/vendored_sdks/aio/operations/__init__.py create mode 100644 src/durabletask/azext_durabletask/vendored_sdks/aio/operations/_namespaces_operations.py create mode 100644 src/durabletask/azext_durabletask/vendored_sdks/aio/operations/_operations.py create mode 100644 src/durabletask/azext_durabletask/vendored_sdks/aio/operations/_patch.py create mode 100644 src/durabletask/azext_durabletask/vendored_sdks/aio/operations/_task_hubs_operations.py create mode 100644 src/durabletask/azext_durabletask/vendored_sdks/authoring/__init__.py create mode 100644 src/durabletask/azext_durabletask/vendored_sdks/authoring/_configuration.py create mode 100644 src/durabletask/azext_durabletask/vendored_sdks/authoring/_luis_authoring_client.py create mode 100644 src/durabletask/azext_durabletask/vendored_sdks/authoring/models/__init__.py create mode 100644 src/durabletask/azext_durabletask/vendored_sdks/authoring/models/_luis_authoring_client_enums.py create mode 100644 src/durabletask/azext_durabletask/vendored_sdks/authoring/models/_models.py create mode 100644 src/durabletask/azext_durabletask/vendored_sdks/authoring/models/_models_py3.py create mode 100644 src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/__init__.py create mode 100644 src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_apps_operations.py create mode 100644 src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_azure_accounts_operations.py create mode 100644 src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_examples_operations.py create mode 100644 src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_features_operations.py create mode 100644 src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_model_operations.py create mode 100644 src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_pattern_operations.py create mode 100644 src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_settings_operations.py create mode 100644 src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_train_operations.py create mode 100644 src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_versions_operations.py create mode 100644 src/durabletask/azext_durabletask/vendored_sdks/authoring/version.py create mode 100644 src/durabletask/azext_durabletask/vendored_sdks/models/__init__.py create mode 100644 src/durabletask/azext_durabletask/vendored_sdks/models/_durabletask_mgmt_client_enums.py create mode 100644 src/durabletask/azext_durabletask/vendored_sdks/models/_models_py3.py create mode 100644 src/durabletask/azext_durabletask/vendored_sdks/models/_patch.py create mode 100644 src/durabletask/azext_durabletask/vendored_sdks/operations/__init__.py create mode 100644 src/durabletask/azext_durabletask/vendored_sdks/operations/_namespaces_operations.py create mode 100644 src/durabletask/azext_durabletask/vendored_sdks/operations/_operations.py create mode 100644 src/durabletask/azext_durabletask/vendored_sdks/operations/_patch.py create mode 100644 src/durabletask/azext_durabletask/vendored_sdks/operations/_task_hubs_operations.py create mode 100644 src/durabletask/azext_durabletask/vendored_sdks/py.typed create mode 100644 src/durabletask/azext_durabletask/vendored_sdks/version.py create mode 100644 src/durabletask/setup.cfg create mode 100644 src/durabletask/setup.py diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 0f183c9c346..7bdfa03163a 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -325,3 +325,8 @@ /src/mdp/ @ajaykn /src/azext_gallery-service-artifact/ @rohitbhoopalam +/src/azext_durable-task-service/ @RyanLettieri +/src/azext_durabletask/ @RyanLettieri +/src/azext_durabletask/ @RyanLettieri +/src/azext_durable-task-service/ @RyanLettieri +/src/azext_durabletask/ @RyanLettieri diff --git a/src/durabletask/HISTORY.rst b/src/durabletask/HISTORY.rst new file mode 100644 index 00000000000..8c34bccfff8 --- /dev/null +++ b/src/durabletask/HISTORY.rst @@ -0,0 +1,8 @@ +.. :changelog: + +Release History +=============== + +0.1.0 +++++++ +* Initial release. \ No newline at end of file diff --git a/src/durabletask/README.rst b/src/durabletask/README.rst new file mode 100644 index 00000000000..ab16c2c57aa --- /dev/null +++ b/src/durabletask/README.rst @@ -0,0 +1,5 @@ +Microsoft Azure CLI 'durabletask' Extension +========================================== + +This package is for the 'durabletask' extension. +i.e. 'az durabletask' \ No newline at end of file diff --git a/src/durabletask/azext_durabletask/__init__.py b/src/durabletask/azext_durabletask/__init__.py new file mode 100644 index 00000000000..5618c021d8b --- /dev/null +++ b/src/durabletask/azext_durabletask/__init__.py @@ -0,0 +1,32 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from azure.cli.core import AzCommandsLoader + +from azext_durabletask._help import helps # pylint: disable=unused-import + + +class DurabletaskCommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + from azext_durabletask._client_factory import cf_durabletask + durabletask_custom = CliCommandType( + operations_tmpl='azext_durabletask.custom#{}', + client_factory=cf_durabletask) + super(DurabletaskCommandsLoader, self).__init__(cli_ctx=cli_ctx, + custom_command_type=durabletask_custom) + + def load_command_table(self, args): + from azext_durabletask.commands import load_command_table + load_command_table(self, args) + return self.command_table + + def load_arguments(self, command): + from azext_durabletask._params import load_arguments + load_arguments(self, command) + + +COMMAND_LOADER_CLS = DurabletaskCommandsLoader diff --git a/src/durabletask/azext_durabletask/_client_factory.py b/src/durabletask/azext_durabletask/_client_factory.py new file mode 100644 index 00000000000..a4263ced8bd --- /dev/null +++ b/src/durabletask/azext_durabletask/_client_factory.py @@ -0,0 +1,15 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +def cf_durabletask(cli_ctx, aux_subscriptions=None, **_): + from azure.cli.core.commands.client_factory import get_mgmt_service_client + from azext_durabletask.vendored_sdks import DurabletaskMgmtClient + return get_mgmt_service_client(cli_ctx, DurabletaskMgmtClient) + +def cf_durabletask_namespaces(cli_ctx, aux_subscriptions=None, **_): + return cf_durabletask(cli_ctx).namespaces + +def cf_durabletask_taskhubs(cli_ctx, aux_subscriptions=None, **_): + return cf_durabletask(cli_ctx).task_hubs \ No newline at end of file diff --git a/src/durabletask/azext_durabletask/_help.py b/src/durabletask/azext_durabletask/_help.py new file mode 100644 index 00000000000..9cb3226f1bd --- /dev/null +++ b/src/durabletask/azext_durabletask/_help.py @@ -0,0 +1,95 @@ +# 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. +# -------------------------------------------------------------------------------------------- + +from knack.help_files import helps # pylint: disable=unused-import + + +helps['durabletask'] = """ + type: group + short-summary: Commands to manage Durabletasks. +""" + +helps['durabletask create'] = """ + type: command + short-summary: Create a Durabletask. +""" + +helps['durabletask list'] = """ + type: command + short-summary: List Durabletasks. +""" + +helps['durabletask delete'] = """ + type: command + short-summary: Delete a Durabletask. +""" + +helps['durabletask show'] = """ + type: command + short-summary: Show details of a Durabletask. +""" + +helps['durabletask update'] = """ + type: command + short-summary: Update a Durabletask. +""" + + +helps['durabletask namespace'] = """ + type: group + short-summary: Commands to manage Durabletask namespaces. +""" + +helps['durabletask-namespace create'] = """ + type: command + short-summary: Create a Durabletask namespace. +""" + +helps['durabletask-namespace list'] = """ + type: command + short-summary: List Durabletasks namespaces. +""" + +helps['durabletask-namespace show'] = """ + type: command + short-summary: Show details of a Durabletask namespace. +""" + +helps['durabletask-namespace delete'] = """ + type: command + short-summary: Delete a Durabletask namespace. +""" + +helps['durabletask-namespace update'] = """ + type: command + short-summary: Update a Durabletask namespace. +""" + + +helps['durabletask taskhub'] = """ + type: group + short-summary: Commands to manage Durabletask taskhubs. +""" + +helps['durabletask taskhub create'] = """ + type: command + short-summary: Create a Durabletask taskhub. +""" + +helps['durabletask taskhub list'] = """ + type: command + short-summary: List Durabletasks taskhubs. +""" + +helps['durabletask taskhub show'] = """ + type: command + short-summary: Show details of a Durabletask taskhub. +""" + +helps['durabletask taskhub update'] = """ + type: command + short-summary: Update a Durabletask taskhub. +""" \ No newline at end of file diff --git a/src/durabletask/azext_durabletask/_params.py b/src/durabletask/azext_durabletask/_params.py new file mode 100644 index 00000000000..f84c4ae314f --- /dev/null +++ b/src/durabletask/azext_durabletask/_params.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +# pylint: disable=line-too-long + +from knack.arguments import CLIArgumentType + + +def load_arguments(self, _): + + from azure.cli.core.commands.parameters import tags_type + from azure.cli.core.commands.validators import get_default_location_from_resource_group + + durabletask_name_type = CLIArgumentType(options_list='--durabletask-name-name', help='Name of the Durabletask.', id_part='name') + + with self.argument_context('durabletask') as c: + c.argument('tags', tags_type) + c.argument('location', validator=get_default_location_from_resource_group) + c.argument('durabletask_name', durabletask_name_type, options_list=['--name', '-n']) + + with self.argument_context('durabletask list') as c: + c.argument('durabletask_name', durabletask_name_type, id_part=None) diff --git a/src/durabletask/azext_durabletask/_validators.py b/src/durabletask/azext_durabletask/_validators.py new file mode 100644 index 00000000000..821630f5f34 --- /dev/null +++ b/src/durabletask/azext_durabletask/_validators.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. +# -------------------------------------------------------------------------------------------- + + +def example_name_or_id_validator(cmd, namespace): + # Example of a storage account name or ID validator. + # See: https://github.com/Azure/azure-cli/blob/dev/doc/authoring_command_modules/authoring_commands.md#supporting-name-or-id-parameters + from azure.cli.core.commands.client_factory import get_subscription_id + from msrestazure.tools import is_valid_resource_id, resource_id + if namespace.storage_account: + if not is_valid_resource_id(namespace.RESOURCE): + namespace.storage_account = resource_id( + subscription=get_subscription_id(cmd.cli_ctx), + resource_group=namespace.resource_group_name, + namespace='Microsoft.Storage', + type='storageAccounts', + name=namespace.storage_account + ) diff --git a/src/durabletask/azext_durabletask/azext_metadata.json b/src/durabletask/azext_durabletask/azext_metadata.json new file mode 100644 index 00000000000..9d187e1e307 --- /dev/null +++ b/src/durabletask/azext_durabletask/azext_metadata.json @@ -0,0 +1,5 @@ +{ + "azext.isPreview": true, + "azext.minCliCoreVersion": "2.0.67", + "azext.maxCliCoreVersion": "2.45.0" +} \ No newline at end of file diff --git a/src/durabletask/azext_durabletask/commands.py b/src/durabletask/azext_durabletask/commands.py new file mode 100644 index 00000000000..8e709376db1 --- /dev/null +++ b/src/durabletask/azext_durabletask/commands.py @@ -0,0 +1,48 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# pylint: disable=line-too-long +from azure.cli.core.commands import CliCommandType +from azext_durabletask._client_factory import cf_durabletask, cf_durabletask_namespaces, cf_durabletask_taskhubs + + +def load_command_table(self, _): + + durabletask_sdk = CliCommandType( + operations_tmpl='azext_durabletask.vendored_sdks.operations#DurabletaskOperations.{}', + client_factory=cf_durabletask) + + durabletask_namespace_sdk = CliCommandType( + operations_tmpl='azext_durabletask.vendored_sdks.operations#NamespacesOperations.{}', + client_factory=cf_durabletask_namespaces) + + durabletask_taskhub_sdk = CliCommandType( + operations_tmpl='azext_durabletask.vendored_sdks.operations#TaskHubsOperations.{}', + client_factory=cf_durabletask_taskhubs) + + with self.command_group('durabletask', durabletask_sdk, client_factory=cf_durabletask) as g: + g.custom_command('create', 'create_durabletask') + # g.command('delete', 'delete') + g.custom_command('list', 'list_durabletask') + # g.show_command('show', 'get') + g.generic_update_command('update', setter_name='update', custom_func_name='update_durabletask') + + + with self.command_group('durabletask namespace', durabletask_namespace_sdk, client_factory=cf_durabletask_namespaces) as g: + g.custom_command('create', 'create_namespace') + g.custom_command('list', 'list_namespace') + # g.delete_command('delete', 'delete_namespace') + g.generic_update_command('update', setter_name='update', custom_func_name='update_namespace') + + + with self.command_group('durabletask taskhub', durabletask_sdk, client_factory=cf_durabletask_taskhubs) as g: + g.custom_command('create', 'create_taskhub') + g.custom_command('list', 'list_taskhub') + # g.show_command('show', 'show_taskhub') + g.generic_update_command('update', setter_name='update', custom_func_name='update_taskhub') + + with self.command_group('durabletask', is_preview=True): + pass + diff --git a/src/durabletask/azext_durabletask/custom.py b/src/durabletask/azext_durabletask/custom.py new file mode 100644 index 00000000000..2358c0b4286 --- /dev/null +++ b/src/durabletask/azext_durabletask/custom.py @@ -0,0 +1,66 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from knack.util import CLIError +from azext_durabletask._client_factory import cf_durabletask, cf_durabletask_namespaces, cf_durabletask_taskhubs +from azext_durabletask.vendored_sdks.models import Namespace, TrackedResource + +def create_durabletask(cmd, client, resource_group_name, durabletask_name, location=None, tags=None): + client = cf_durabletask(cmd.cli_ctx, None) + raise CLIError('TODO: Implement `durabletask create`') + + +def list_durabletask(cmd, client, resource_group_name=None): + client = cf_durabletask(cmd.cli_ctx, None) + return client.namespaces.list_by_subscription() + # raise CLIError('TODO: Implement `durabletask list`') + + +def update_durabletask(cmd, instance, tags=None): + client = cf_durabletask(cmd.cli_ctx, None) + with cmd.update_context(instance) as c: + c.set_param('tags', tags) + return instance + + +# Namespace Operations +def create_namespace(cmd, client, resource_group_name, durabletask_name, location=None, tags=None): + namespace = TrackedResource(location='eastus') + client = cf_durabletask_namespaces(cmd.cli_ctx, None) + return client.begin_create_or_update(resource_group_name, "test-namespace-api", resource=Namespace(location="eastus")) + raise CLIError('TODO: Implement `durabletask namespace create`') + +def list_namespace(cmd, client, resource_group_name=None): + client = cf_durabletask_namespaces(cmd.cli_ctx, None) + return client.list_by_resource_group(resource_group_name="test-rp-rg-eastus") + raise CLIError('TODO: Implement `durabletask namespace list`') + +def show_namespace(cmd, client, resource_group_name=None): + raise CLIError('TODO: Implement `durabletask namespace show`') + +def delete_namespace(cmd, client, resource_group_name=None): + raise CLIError('TODO: Implement `durabletask namespace delete`') + +def update_namespace(cmd, instance, tags=None): + with cmd.update_context(instance) as c: + c.set_param('tags', tags) + return instance + + +# Taskhub Operations +def create_taskhub(cmd, client, resource_group_name, durabletask_name, location=None, tags=None): + raise CLIError('TODO: Implement `durabletask taskhub create`') + + +def list_taskhub(cmd, client, resource_group_name=None): + raise CLIError('TODO: Implement `durabletask taskhub list`') + +def show_taskhub(cmd, client, resource_group_name=None): + raise CLIError('TODO: Implement `durabletask taskhub show`') + +def update_taskhub(cmd, instance, tags=None): + with cmd.update_context(instance) as c: + c.set_param('tags', tags) + return instance \ No newline at end of file diff --git a/src/durabletask/azext_durabletask/tests/__init__.py b/src/durabletask/azext_durabletask/tests/__init__.py new file mode 100644 index 00000000000..2dcf9bb68b3 --- /dev/null +++ b/src/durabletask/azext_durabletask/tests/__init__.py @@ -0,0 +1,5 @@ +# ----------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# ----------------------------------------------------------------------------- \ No newline at end of file diff --git a/src/durabletask/azext_durabletask/tests/latest/__init__.py b/src/durabletask/azext_durabletask/tests/latest/__init__.py new file mode 100644 index 00000000000..2dcf9bb68b3 --- /dev/null +++ b/src/durabletask/azext_durabletask/tests/latest/__init__.py @@ -0,0 +1,5 @@ +# ----------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# ----------------------------------------------------------------------------- \ No newline at end of file diff --git a/src/durabletask/azext_durabletask/tests/latest/test_durabletask_scenario.py b/src/durabletask/azext_durabletask/tests/latest/test_durabletask_scenario.py new file mode 100644 index 00000000000..b9e7b5a09d6 --- /dev/null +++ b/src/durabletask/azext_durabletask/tests/latest/test_durabletask_scenario.py @@ -0,0 +1,40 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import os +import unittest + +from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer) + + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +class DurabletaskScenarioTest(ScenarioTest): + + @ResourceGroupPreparer(name_prefix='cli_test_durabletask') + def test_durabletask(self, resource_group): + + self.kwargs.update({ + 'name': 'test1' + }) + + self.cmd('durabletask create -g {rg} -n {name} --tags foo=doo', checks=[ + self.check('tags.foo', 'doo'), + self.check('name', '{name}') + ]) + self.cmd('durabletask update -g {rg} -n {name} --tags foo=boo', checks=[ + self.check('tags.foo', 'boo') + ]) + count = len(self.cmd('durabletask list').get_output_in_json()) + self.cmd('durabletask show - {rg} -n {name}', checks=[ + self.check('name', '{name}'), + self.check('resourceGroup', '{rg}'), + self.check('tags.foo', 'boo') + ]) + self.cmd('durabletask delete -g {rg} -n {name}') + final_count = len(self.cmd('durabletask list').get_output_in_json()) + self.assertTrue(final_count, count - 1) \ No newline at end of file diff --git a/src/durabletask/azext_durabletask/vendored_sdks/__init__.py b/src/durabletask/azext_durabletask/vendored_sdks/__init__.py new file mode 100644 index 00000000000..72e3f428ab7 --- /dev/null +++ b/src/durabletask/azext_durabletask/vendored_sdks/__init__.py @@ -0,0 +1,26 @@ +# 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 ._durabletask_mgmt_client import DurabletaskMgmtClient +from ._version import VERSION + +__version__ = VERSION + +try: + from ._patch import __all__ as _patch_all + from ._patch import * # pylint: disable=unused-wildcard-import +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "DurabletaskMgmtClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) + +_patch_sdk() diff --git a/src/durabletask/azext_durabletask/vendored_sdks/_configuration.py b/src/durabletask/azext_durabletask/vendored_sdks/_configuration.py new file mode 100644 index 00000000000..30cc72d5a01 --- /dev/null +++ b/src/durabletask/azext_durabletask/vendored_sdks/_configuration.py @@ -0,0 +1,65 @@ +# 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.pipeline import policies +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy + +from ._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential + + +class DurabletaskMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long + """Configuration for DurabletaskMgmtClient. + + 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. Required. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. + :type subscription_id: str + :keyword api_version: Api Version. Default value is "2024-02-01-preview". Note that overriding + this default value may result in unsupported behavior. + :paramtype api_version: str + """ + + def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: + api_version: str = kwargs.pop("api_version", "2024-02-01-preview") + + 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.") + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = api_version + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "mgmt-durabletask/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) + 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.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") + if self.credential and not self.authentication_policy: + self.authentication_policy = ARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/src/durabletask/azext_durabletask/vendored_sdks/_durabletask_mgmt_client.py b/src/durabletask/azext_durabletask/vendored_sdks/_durabletask_mgmt_client.py new file mode 100644 index 00000000000..e74190dc32d --- /dev/null +++ b/src/durabletask/azext_durabletask/vendored_sdks/_durabletask_mgmt_client.py @@ -0,0 +1,118 @@ +# 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 copy import deepcopy +from typing import Any, TYPE_CHECKING +from typing_extensions import Self + +from azure.core.pipeline import policies +from azure.core.rest import HttpRequest, HttpResponse +from azure.mgmt.core import ARMPipelineClient +from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy + +from . import models as _models +from ._configuration import DurabletaskMgmtClientConfiguration +from ._serialization import Deserializer, Serializer +from .operations import NamespacesOperations, Operations, TaskHubsOperations + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential + + +class DurabletaskMgmtClient: # pylint: disable=client-accepts-api-version-keyword + """DurabletaskMgmtClient. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.durabletask.operations.Operations + :ivar namespaces: NamespacesOperations operations + :vartype namespaces: azure.mgmt.durabletask.operations.NamespacesOperations + :ivar task_hubs: TaskHubsOperations operations + :vartype task_hubs: azure.mgmt.durabletask.operations.TaskHubsOperations + :param credential: Credential needed for the client to connect to Azure. Required. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. + :type subscription_id: str + :param base_url: Service URL. Default value is "https://management.azure.com". + :type base_url: str + :keyword api_version: Api Version. Default value is "2024-02-01-preview". Note that overriding + this default value may result in unsupported behavior. + :paramtype api_version: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + """ + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = DurabletaskMgmtClientConfiguration( + credential=credential, subscription_id=subscription_id, **kwargs + ) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + ARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + # policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) + + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + self._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.namespaces = NamespacesOperations(self._client, self._config, self._serialize, self._deserialize) + self.task_hubs = TaskHubsOperations(self._client, self._config, self._serialize, self._deserialize) + + def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.HttpResponse + """ + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore + + def close(self) -> None: + self._client.close() + + def __enter__(self) -> Self: + self._client.__enter__() + return self + + def __exit__(self, *exc_details: Any) -> None: + self._client.__exit__(*exc_details) diff --git a/src/durabletask/azext_durabletask/vendored_sdks/_patch.py b/src/durabletask/azext_durabletask/vendored_sdks/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/src/durabletask/azext_durabletask/vendored_sdks/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/src/durabletask/azext_durabletask/vendored_sdks/_serialization.py b/src/durabletask/azext_durabletask/vendored_sdks/_serialization.py new file mode 100644 index 00000000000..8139854b97b --- /dev/null +++ b/src/durabletask/azext_durabletask/vendored_sdks/_serialization.py @@ -0,0 +1,2000 @@ +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# pylint: skip-file +# pyright: reportUnnecessaryTypeIgnoreComment=false + +from base64 import b64decode, b64encode +import calendar +import datetime +import decimal +import email +from enum import Enum +import json +import logging +import re +import sys +import codecs +from typing import ( + Dict, + Any, + cast, + Optional, + Union, + AnyStr, + IO, + Mapping, + Callable, + TypeVar, + MutableMapping, + Type, + List, + Mapping, +) + +try: + from urllib import quote # type: ignore +except ImportError: + from urllib.parse import quote +import xml.etree.ElementTree as ET + +import isodate # type: ignore + +from azure.core.exceptions import DeserializationError, SerializationError +from azure.core.serialization import NULL as CoreNull + +_BOM = codecs.BOM_UTF8.decode(encoding="utf-8") + +ModelType = TypeVar("ModelType", bound="Model") +JSON = MutableMapping[str, Any] + + +class RawDeserializer: + + # Accept "text" because we're open minded people... + JSON_REGEXP = re.compile(r"^(application|text)/([a-z+.]+\+)?json$") + + # Name used in context + CONTEXT_NAME = "deserialized_data" + + @classmethod + def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: Optional[str] = None) -> Any: + """Decode data according to content-type. + + Accept a stream of data as well, but will be load at once in memory for now. + + If no content-type, will return the string version (not bytes, not stream) + + :param data: Input, could be bytes or stream (will be decoded with UTF8) or text + :type data: str or bytes or IO + :param str content_type: The content type. + """ + if hasattr(data, "read"): + # Assume a stream + data = cast(IO, data).read() + + if isinstance(data, bytes): + data_as_str = data.decode(encoding="utf-8-sig") + else: + # Explain to mypy the correct type. + data_as_str = cast(str, data) + + # Remove Byte Order Mark if present in string + data_as_str = data_as_str.lstrip(_BOM) + + if content_type is None: + return data + + if cls.JSON_REGEXP.match(content_type): + try: + return json.loads(data_as_str) + except ValueError as err: + raise DeserializationError("JSON is invalid: {}".format(err), err) + elif "xml" in (content_type or []): + try: + + try: + if isinstance(data, unicode): # type: ignore + # If I'm Python 2.7 and unicode XML will scream if I try a "fromstring" on unicode string + data_as_str = data_as_str.encode(encoding="utf-8") # type: ignore + except NameError: + pass + + return ET.fromstring(data_as_str) # nosec + except ET.ParseError as err: + # It might be because the server has an issue, and returned JSON with + # content-type XML.... + # So let's try a JSON load, and if it's still broken + # let's flow the initial exception + def _json_attemp(data): + try: + return True, json.loads(data) + except ValueError: + return False, None # Don't care about this one + + success, json_result = _json_attemp(data) + if success: + return json_result + # If i'm here, it's not JSON, it's not XML, let's scream + # and raise the last context in this block (the XML exception) + # The function hack is because Py2.7 messes up with exception + # context otherwise. + _LOGGER.critical("Wasn't XML not JSON, failing") + raise DeserializationError("XML is invalid") from err + elif content_type.startswith("text/"): + return data_as_str + raise DeserializationError("Cannot deserialize content-type: {}".format(content_type)) + + @classmethod + def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], headers: Mapping) -> Any: + """Deserialize from HTTP response. + + Use bytes and headers to NOT use any requests/aiohttp or whatever + specific implementation. + Headers will tested for "content-type" + """ + # Try to use content-type from headers if available + content_type = None + if "content-type" in headers: + content_type = headers["content-type"].split(";")[0].strip().lower() + # Ouch, this server did not declare what it sent... + # Let's guess it's JSON... + # Also, since Autorest was considering that an empty body was a valid JSON, + # need that test as well.... + else: + content_type = "application/json" + + if body_bytes: + return cls.deserialize_from_text(body_bytes, content_type) + return None + + +_LOGGER = logging.getLogger(__name__) + +try: + _long_type = long # type: ignore +except NameError: + _long_type = int + + +class UTC(datetime.tzinfo): + """Time Zone info for handling UTC""" + + def utcoffset(self, dt): + """UTF offset for UTC is 0.""" + return datetime.timedelta(0) + + def tzname(self, dt): + """Timestamp representation.""" + return "Z" + + def dst(self, dt): + """No daylight saving for UTC.""" + return datetime.timedelta(hours=1) + + +try: + from datetime import timezone as _FixedOffset # type: ignore +except ImportError: # Python 2.7 + + class _FixedOffset(datetime.tzinfo): # type: ignore + """Fixed offset in minutes east from UTC. + Copy/pasted from Python doc + :param datetime.timedelta offset: offset in timedelta format + """ + + def __init__(self, offset): + self.__offset = offset + + def utcoffset(self, dt): + return self.__offset + + def tzname(self, dt): + return str(self.__offset.total_seconds() / 3600) + + def __repr__(self): + return "".format(self.tzname(None)) + + def dst(self, dt): + return datetime.timedelta(0) + + def __getinitargs__(self): + return (self.__offset,) + + +try: + from datetime import timezone + + TZ_UTC = timezone.utc +except ImportError: + TZ_UTC = UTC() # type: ignore + +_FLATTEN = re.compile(r"(? None: + self.additional_properties: Optional[Dict[str, Any]] = {} + for k in kwargs: + if k not in self._attribute_map: + _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) + elif k in self._validation and self._validation[k].get("readonly", False): + _LOGGER.warning("Readonly attribute %s will be ignored in class %s", k, self.__class__) + else: + setattr(self, k, kwargs[k]) + + def __eq__(self, other: Any) -> bool: + """Compare objects by comparing all attributes.""" + if isinstance(other, self.__class__): + return self.__dict__ == other.__dict__ + return False + + def __ne__(self, other: Any) -> bool: + """Compare objects by comparing all attributes.""" + return not self.__eq__(other) + + def __str__(self) -> str: + return str(self.__dict__) + + @classmethod + def enable_additional_properties_sending(cls) -> None: + cls._attribute_map["additional_properties"] = {"key": "", "type": "{object}"} + + @classmethod + def is_xml_model(cls) -> bool: + try: + cls._xml_map # type: ignore + except AttributeError: + return False + return True + + @classmethod + def _create_xml_node(cls): + """Create XML node.""" + try: + xml_map = cls._xml_map # type: ignore + except AttributeError: + xml_map = {} + + return _create_xml_node(xml_map.get("name", cls.__name__), xml_map.get("prefix", None), xml_map.get("ns", None)) + + def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: + """Return the JSON that would be sent to server from this model. + + This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`. + + If you want XML serialization, you can pass the kwargs is_xml=True. + + :param bool keep_readonly: If you want to serialize the readonly attributes + :returns: A dict JSON compatible object + :rtype: dict + """ + serializer = Serializer(self._infer_class_models()) + return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) # type: ignore + + def as_dict( + self, + keep_readonly: bool = True, + key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, + **kwargs: Any + ) -> JSON: + """Return a dict that can be serialized using json.dump. + + Advanced usage might optionally use a callback as parameter: + + .. code::python + + def my_key_transformer(key, attr_desc, value): + return key + + Key is the attribute name used in Python. Attr_desc + is a dict of metadata. Currently contains 'type' with the + msrest type and 'key' with the RestAPI encoded key. + Value is the current value in this object. + + The string returned will be used to serialize the key. + If the return type is a list, this is considered hierarchical + result dict. + + See the three examples in this file: + + - attribute_transformer + - full_restapi_key_transformer + - last_restapi_key_transformer + + If you want XML serialization, you can pass the kwargs is_xml=True. + + :param function key_transformer: A key transformer function. + :returns: A dict JSON compatible object + :rtype: dict + """ + serializer = Serializer(self._infer_class_models()) + return serializer._serialize(self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs) # type: ignore + + @classmethod + def _infer_class_models(cls): + try: + str_models = cls.__module__.rsplit(".", 1)[0] + models = sys.modules[str_models] + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + if cls.__name__ not in client_models: + raise ValueError("Not Autorest generated code") + except Exception: + # Assume it's not Autorest generated (tests?). Add ourselves as dependencies. + client_models = {cls.__name__: cls} + return client_models + + @classmethod + def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType: + """Parse a str using the RestAPI syntax and return a model. + + :param str data: A str using RestAPI structure. JSON by default. + :param str content_type: JSON by default, set application/xml if XML. + :returns: An instance of this model + :raises: DeserializationError if something went wrong + """ + deserializer = Deserializer(cls._infer_class_models()) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore + + @classmethod + def from_dict( + cls: Type[ModelType], + data: Any, + key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + content_type: Optional[str] = None, + ) -> ModelType: + """Parse a dict using given key extractor return a model. + + By default consider key + extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor + and last_rest_key_case_insensitive_extractor) + + :param dict data: A dict using RestAPI structure + :param str content_type: JSON by default, set application/xml if XML. + :returns: An instance of this model + :raises: DeserializationError if something went wrong + """ + deserializer = Deserializer(cls._infer_class_models()) + deserializer.key_extractors = ( # type: ignore + [ # type: ignore + attribute_key_case_insensitive_extractor, + rest_key_case_insensitive_extractor, + last_rest_key_case_insensitive_extractor, + ] + if key_extractors is None + else key_extractors + ) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore + + @classmethod + def _flatten_subtype(cls, key, objects): + if "_subtype_map" not in cls.__dict__: + return {} + result = dict(cls._subtype_map[key]) + for valuetype in cls._subtype_map[key].values(): + result.update(objects[valuetype]._flatten_subtype(key, objects)) + return result + + @classmethod + def _classify(cls, response, objects): + """Check the class _subtype_map for any child classes. + We want to ignore any inherited _subtype_maps. + Remove the polymorphic key from the initial data. + """ + for subtype_key in cls.__dict__.get("_subtype_map", {}).keys(): + subtype_value = None + + if not isinstance(response, ET.Element): + rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1] + subtype_value = response.pop(rest_api_response_key, None) or response.pop(subtype_key, None) + else: + subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response) + if subtype_value: + # Try to match base class. Can be class name only + # (bug to fix in Autorest to support x-ms-discriminator-name) + if cls.__name__ == subtype_value: + return cls + flatten_mapping_type = cls._flatten_subtype(subtype_key, objects) + try: + return objects[flatten_mapping_type[subtype_value]] # type: ignore + except KeyError: + _LOGGER.warning( + "Subtype value %s has no mapping, use base class %s.", + subtype_value, + cls.__name__, + ) + break + else: + _LOGGER.warning("Discriminator %s is absent or null, use base class %s.", subtype_key, cls.__name__) + break + return cls + + @classmethod + def _get_rest_key_parts(cls, attr_key): + """Get the RestAPI key of this attr, split it and decode part + :param str attr_key: Attribute key must be in attribute_map. + :returns: A list of RestAPI part + :rtype: list + """ + rest_split_key = _FLATTEN.split(cls._attribute_map[attr_key]["key"]) + return [_decode_attribute_map_key(key_part) for key_part in rest_split_key] + + +def _decode_attribute_map_key(key): + """This decode a key in an _attribute_map to the actual key we want to look at + inside the received data. + + :param str key: A key string from the generated code + """ + return key.replace("\\.", ".") + + +class Serializer(object): + """Request object model serializer.""" + + basic_types = {str: "str", int: "int", bool: "bool", float: "float"} + + _xml_basic_types_serializers = {"bool": lambda x: str(x).lower()} + days = {0: "Mon", 1: "Tue", 2: "Wed", 3: "Thu", 4: "Fri", 5: "Sat", 6: "Sun"} + months = { + 1: "Jan", + 2: "Feb", + 3: "Mar", + 4: "Apr", + 5: "May", + 6: "Jun", + 7: "Jul", + 8: "Aug", + 9: "Sep", + 10: "Oct", + 11: "Nov", + 12: "Dec", + } + validation = { + "min_length": lambda x, y: len(x) < y, + "max_length": lambda x, y: len(x) > y, + "minimum": lambda x, y: x < y, + "maximum": lambda x, y: x > y, + "minimum_ex": lambda x, y: x <= y, + "maximum_ex": lambda x, y: x >= y, + "min_items": lambda x, y: len(x) < y, + "max_items": lambda x, y: len(x) > y, + "pattern": lambda x, y: not re.match(y, x, re.UNICODE), + "unique": lambda x, y: len(x) != len(set(x)), + "multiple": lambda x, y: x % y != 0, + } + + def __init__(self, classes: Optional[Mapping[str, type]] = None): + self.serialize_type = { + "iso-8601": Serializer.serialize_iso, + "rfc-1123": Serializer.serialize_rfc, + "unix-time": Serializer.serialize_unix, + "duration": Serializer.serialize_duration, + "date": Serializer.serialize_date, + "time": Serializer.serialize_time, + "decimal": Serializer.serialize_decimal, + "long": Serializer.serialize_long, + "bytearray": Serializer.serialize_bytearray, + "base64": Serializer.serialize_base64, + "object": self.serialize_object, + "[]": self.serialize_iter, + "{}": self.serialize_dict, + } + self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.key_transformer = full_restapi_key_transformer + self.client_side_validation = True + + def _serialize(self, target_obj, data_type=None, **kwargs): + """Serialize data into a string according to type. + + :param target_obj: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str, dict + :raises: SerializationError if serialization fails. + """ + key_transformer = kwargs.get("key_transformer", self.key_transformer) + keep_readonly = kwargs.get("keep_readonly", False) + if target_obj is None: + return None + + attr_name = None + class_name = target_obj.__class__.__name__ + + if data_type: + return self.serialize_data(target_obj, data_type, **kwargs) + + if not hasattr(target_obj, "_attribute_map"): + data_type = type(target_obj).__name__ + if data_type in self.basic_types.values(): + return self.serialize_data(target_obj, data_type, **kwargs) + + # Force "is_xml" kwargs if we detect a XML model + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + is_xml_model_serialization = kwargs.setdefault("is_xml", target_obj.is_xml_model()) + + serialized = {} + if is_xml_model_serialization: + serialized = target_obj._create_xml_node() + try: + attributes = target_obj._attribute_map + for attr, attr_desc in attributes.items(): + attr_name = attr + if not keep_readonly and target_obj._validation.get(attr_name, {}).get("readonly", False): + continue + + if attr_name == "additional_properties" and attr_desc["key"] == "": + if target_obj.additional_properties is not None: + serialized.update(target_obj.additional_properties) + continue + try: + + orig_attr = getattr(target_obj, attr) + if is_xml_model_serialization: + pass # Don't provide "transformer" for XML for now. Keep "orig_attr" + else: # JSON + keys, orig_attr = key_transformer(attr, attr_desc.copy(), orig_attr) + keys = keys if isinstance(keys, list) else [keys] + + kwargs["serialization_ctxt"] = attr_desc + new_attr = self.serialize_data(orig_attr, attr_desc["type"], **kwargs) + + if is_xml_model_serialization: + xml_desc = attr_desc.get("xml", {}) + xml_name = xml_desc.get("name", attr_desc["key"]) + xml_prefix = xml_desc.get("prefix", None) + xml_ns = xml_desc.get("ns", None) + if xml_desc.get("attr", False): + if xml_ns: + ET.register_namespace(xml_prefix, xml_ns) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + serialized.set(xml_name, new_attr) # type: ignore + continue + if xml_desc.get("text", False): + serialized.text = new_attr # type: ignore + continue + if isinstance(new_attr, list): + serialized.extend(new_attr) # type: ignore + elif isinstance(new_attr, ET.Element): + # If the down XML has no XML/Name, we MUST replace the tag with the local tag. But keeping the namespaces. + if "name" not in getattr(orig_attr, "_xml_map", {}): + splitted_tag = new_attr.tag.split("}") + if len(splitted_tag) == 2: # Namespace + new_attr.tag = "}".join([splitted_tag[0], xml_name]) + else: + new_attr.tag = xml_name + serialized.append(new_attr) # type: ignore + else: # That's a basic type + # Integrate namespace if necessary + local_node = _create_xml_node(xml_name, xml_prefix, xml_ns) + local_node.text = str(new_attr) + serialized.append(local_node) # type: ignore + else: # JSON + for k in reversed(keys): # type: ignore + new_attr = {k: new_attr} + + _new_attr = new_attr + _serialized = serialized + for k in keys: # type: ignore + if k not in _serialized: + _serialized.update(_new_attr) # type: ignore + _new_attr = _new_attr[k] # type: ignore + _serialized = _serialized[k] + except ValueError as err: + if isinstance(err, SerializationError): + raise + + except (AttributeError, KeyError, TypeError) as err: + msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) + raise SerializationError(msg) from err + else: + return serialized + + def body(self, data, data_type, **kwargs): + """Serialize data intended for a request body. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: dict + :raises: SerializationError if serialization fails. + :raises: ValueError if data is None + """ + + # Just in case this is a dict + internal_data_type_str = data_type.strip("[]{}") + internal_data_type = self.dependencies.get(internal_data_type_str, None) + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + if internal_data_type and issubclass(internal_data_type, Model): + is_xml_model_serialization = kwargs.setdefault("is_xml", internal_data_type.is_xml_model()) + else: + is_xml_model_serialization = False + if internal_data_type and not isinstance(internal_data_type, Enum): + try: + deserializer = Deserializer(self.dependencies) + # Since it's on serialization, it's almost sure that format is not JSON REST + # We're not able to deal with additional properties for now. + deserializer.additional_properties_detection = False + if is_xml_model_serialization: + deserializer.key_extractors = [ # type: ignore + attribute_key_case_insensitive_extractor, + ] + else: + deserializer.key_extractors = [ + rest_key_case_insensitive_extractor, + attribute_key_case_insensitive_extractor, + last_rest_key_case_insensitive_extractor, + ] + data = deserializer._deserialize(data_type, data) + except DeserializationError as err: + raise SerializationError("Unable to build a model: " + str(err)) from err + + return self._serialize(data, data_type, **kwargs) + + def url(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL path. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :raises: TypeError if serialization fails. + :raises: ValueError if data is None + """ + try: + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + + if kwargs.get("skip_quote") is True: + output = str(output) + output = output.replace("{", quote("{")).replace("}", quote("}")) + else: + output = quote(str(output), safe="") + except SerializationError: + raise TypeError("{} must be type {}.".format(name, data_type)) + else: + return output + + def query(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL query. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :keyword bool skip_quote: Whether to skip quote the serialized result. + Defaults to False. + :rtype: str, list + :raises: TypeError if serialization fails. + :raises: ValueError if data is None + """ + try: + # Treat the list aside, since we don't want to encode the div separator + if data_type.startswith("["): + internal_data_type = data_type[1:-1] + do_quote = not kwargs.get("skip_quote", False) + return self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs) + + # Not a list, regular serialization + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + if kwargs.get("skip_quote") is True: + output = str(output) + else: + output = quote(str(output), safe="") + except SerializationError: + raise TypeError("{} must be type {}.".format(name, data_type)) + else: + return str(output) + + def header(self, name, data, data_type, **kwargs): + """Serialize data intended for a request header. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :raises: TypeError if serialization fails. + :raises: ValueError if data is None + """ + try: + if data_type in ["[str]"]: + data = ["" if d is None else d for d in data] + + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + except SerializationError: + raise TypeError("{} must be type {}.".format(name, data_type)) + else: + return str(output) + + def serialize_data(self, data, data_type, **kwargs): + """Serialize generic data according to supplied data type. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :param bool required: Whether it's essential that the data not be + empty or None + :raises: AttributeError if required data is None. + :raises: ValueError if data is None + :raises: SerializationError if serialization fails. + """ + if data is None: + raise ValueError("No value for given attribute") + + try: + if data is CoreNull: + return None + if data_type in self.basic_types.values(): + return self.serialize_basic(data, data_type, **kwargs) + + elif data_type in self.serialize_type: + return self.serialize_type[data_type](data, **kwargs) + + # If dependencies is empty, try with current data class + # It has to be a subclass of Enum anyway + enum_type = self.dependencies.get(data_type, data.__class__) + if issubclass(enum_type, Enum): + return Serializer.serialize_enum(data, enum_obj=enum_type) + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.serialize_type: + return self.serialize_type[iter_type](data, data_type[1:-1], **kwargs) + + except (ValueError, TypeError) as err: + msg = "Unable to serialize value: {!r} as type: {!r}." + raise SerializationError(msg.format(data, data_type)) from err + else: + return self._serialize(data, **kwargs) + + @classmethod + def _get_custom_serializers(cls, data_type, **kwargs): + custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type) + if custom_serializer: + return custom_serializer + if kwargs.get("is_xml", False): + return cls._xml_basic_types_serializers.get(data_type) + + @classmethod + def serialize_basic(cls, data, data_type, **kwargs): + """Serialize basic builting data type. + Serializes objects to str, int, float or bool. + + Possible kwargs: + - basic_types_serializers dict[str, callable] : If set, use the callable as serializer + - is_xml bool : If set, use xml_basic_types_serializers + + :param data: Object to be serialized. + :param str data_type: Type of object in the iterable. + """ + custom_serializer = cls._get_custom_serializers(data_type, **kwargs) + if custom_serializer: + return custom_serializer(data) + if data_type == "str": + return cls.serialize_unicode(data) + return eval(data_type)(data) # nosec + + @classmethod + def serialize_unicode(cls, data): + """Special handling for serializing unicode strings in Py2. + Encode to UTF-8 if unicode, otherwise handle as a str. + + :param data: Object to be serialized. + :rtype: str + """ + try: # If I received an enum, return its value + return data.value + except AttributeError: + pass + + try: + if isinstance(data, unicode): # type: ignore + # Don't change it, JSON and XML ElementTree are totally able + # to serialize correctly u'' strings + return data + except NameError: + return str(data) + else: + return str(data) + + def serialize_iter(self, data, iter_type, div=None, **kwargs): + """Serialize iterable. + + Supported kwargs: + - serialization_ctxt dict : The current entry of _attribute_map, or same format. + serialization_ctxt['type'] should be same as data_type. + - is_xml bool : If set, serialize as XML + + :param list attr: Object to be serialized. + :param str iter_type: Type of object in the iterable. + :param bool required: Whether the objects in the iterable must + not be None or empty. + :param str div: If set, this str will be used to combine the elements + in the iterable into a combined string. Default is 'None'. + :keyword bool do_quote: Whether to quote the serialized result of each iterable element. + Defaults to False. + :rtype: list, str + """ + if isinstance(data, str): + raise SerializationError("Refuse str type as a valid iter type.") + + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + is_xml = kwargs.get("is_xml", False) + + serialized = [] + for d in data: + try: + serialized.append(self.serialize_data(d, iter_type, **kwargs)) + except ValueError as err: + if isinstance(err, SerializationError): + raise + serialized.append(None) + + if kwargs.get("do_quote", False): + serialized = ["" if s is None else quote(str(s), safe="") for s in serialized] + + if div: + serialized = ["" if s is None else str(s) for s in serialized] + serialized = div.join(serialized) + + if "xml" in serialization_ctxt or is_xml: + # XML serialization is more complicated + xml_desc = serialization_ctxt.get("xml", {}) + xml_name = xml_desc.get("name") + if not xml_name: + xml_name = serialization_ctxt["key"] + + # Create a wrap node if necessary (use the fact that Element and list have "append") + is_wrapped = xml_desc.get("wrapped", False) + node_name = xml_desc.get("itemsName", xml_name) + if is_wrapped: + final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + else: + final_result = [] + # All list elements to "local_node" + for el in serialized: + if isinstance(el, ET.Element): + el_node = el + else: + el_node = _create_xml_node(node_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + if el is not None: # Otherwise it writes "None" :-p + el_node.text = str(el) + final_result.append(el_node) + return final_result + return serialized + + def serialize_dict(self, attr, dict_type, **kwargs): + """Serialize a dictionary of objects. + + :param dict attr: Object to be serialized. + :param str dict_type: Type of object in the dictionary. + :param bool required: Whether the objects in the dictionary must + not be None or empty. + :rtype: dict + """ + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) + except ValueError as err: + if isinstance(err, SerializationError): + raise + serialized[self.serialize_unicode(key)] = None + + if "xml" in serialization_ctxt: + # XML serialization is more complicated + xml_desc = serialization_ctxt["xml"] + xml_name = xml_desc["name"] + + final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + for key, value in serialized.items(): + ET.SubElement(final_result, key).text = value + return final_result + + return serialized + + def serialize_object(self, attr, **kwargs): + """Serialize a generic object. + This will be handled as a dictionary. If object passed in is not + a basic type (str, int, float, dict, list) it will simply be + cast to str. + + :param dict attr: Object to be serialized. + :rtype: dict or str + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + return attr + obj_type = type(attr) + if obj_type in self.basic_types: + return self.serialize_basic(attr, self.basic_types[obj_type], **kwargs) + if obj_type is _long_type: + return self.serialize_long(attr) + if obj_type is str: + return self.serialize_unicode(attr) + if obj_type is datetime.datetime: + return self.serialize_iso(attr) + if obj_type is datetime.date: + return self.serialize_date(attr) + if obj_type is datetime.time: + return self.serialize_time(attr) + if obj_type is datetime.timedelta: + return self.serialize_duration(attr) + if obj_type is decimal.Decimal: + return self.serialize_decimal(attr) + + # If it's a model or I know this dependency, serialize as a Model + elif obj_type in self.dependencies.values() or isinstance(attr, Model): + return self._serialize(attr) + + if obj_type == dict: + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_object(value, **kwargs) + except ValueError: + serialized[self.serialize_unicode(key)] = None + return serialized + + if obj_type == list: + serialized = [] + for obj in attr: + try: + serialized.append(self.serialize_object(obj, **kwargs)) + except ValueError: + pass + return serialized + return str(attr) + + @staticmethod + def serialize_enum(attr, enum_obj=None): + try: + result = attr.value + except AttributeError: + result = attr + try: + enum_obj(result) # type: ignore + return result + except ValueError: + for enum_value in enum_obj: # type: ignore + if enum_value.value.lower() == str(attr).lower(): + return enum_value.value + error = "{!r} is not valid value for enum {!r}" + raise SerializationError(error.format(attr, enum_obj)) + + @staticmethod + def serialize_bytearray(attr, **kwargs): + """Serialize bytearray into base-64 string. + + :param attr: Object to be serialized. + :rtype: str + """ + return b64encode(attr).decode() + + @staticmethod + def serialize_base64(attr, **kwargs): + """Serialize str into base-64 string. + + :param attr: Object to be serialized. + :rtype: str + """ + encoded = b64encode(attr).decode("ascii") + return encoded.strip("=").replace("+", "-").replace("/", "_") + + @staticmethod + def serialize_decimal(attr, **kwargs): + """Serialize Decimal object to float. + + :param attr: Object to be serialized. + :rtype: float + """ + return float(attr) + + @staticmethod + def serialize_long(attr, **kwargs): + """Serialize long (Py2) or int (Py3). + + :param attr: Object to be serialized. + :rtype: int/long + """ + return _long_type(attr) + + @staticmethod + def serialize_date(attr, **kwargs): + """Serialize Date object into ISO-8601 formatted string. + + :param Date attr: Object to be serialized. + :rtype: str + """ + if isinstance(attr, str): + attr = isodate.parse_date(attr) + t = "{:04}-{:02}-{:02}".format(attr.year, attr.month, attr.day) + return t + + @staticmethod + def serialize_time(attr, **kwargs): + """Serialize Time object into ISO-8601 formatted string. + + :param datetime.time attr: Object to be serialized. + :rtype: str + """ + if isinstance(attr, str): + attr = isodate.parse_time(attr) + t = "{:02}:{:02}:{:02}".format(attr.hour, attr.minute, attr.second) + if attr.microsecond: + t += ".{:02}".format(attr.microsecond) + return t + + @staticmethod + def serialize_duration(attr, **kwargs): + """Serialize TimeDelta object into ISO-8601 formatted string. + + :param TimeDelta attr: Object to be serialized. + :rtype: str + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + return isodate.duration_isoformat(attr) + + @staticmethod + def serialize_rfc(attr, **kwargs): + """Serialize Datetime object into RFC-1123 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises: TypeError if format invalid. + """ + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + except AttributeError: + raise TypeError("RFC1123 object must be valid Datetime object.") + + return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format( + Serializer.days[utc.tm_wday], + utc.tm_mday, + Serializer.months[utc.tm_mon], + utc.tm_year, + utc.tm_hour, + utc.tm_min, + utc.tm_sec, + ) + + @staticmethod + def serialize_iso(attr, **kwargs): + """Serialize Datetime object into ISO-8601 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises: SerializationError if format invalid. + """ + if isinstance(attr, str): + attr = isodate.parse_datetime(attr) + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + if utc.tm_year > 9999 or utc.tm_year < 1: + raise OverflowError("Hit max or min date") + + microseconds = str(attr.microsecond).rjust(6, "0").rstrip("0").ljust(3, "0") + if microseconds: + microseconds = "." + microseconds + date = "{:04}-{:02}-{:02}T{:02}:{:02}:{:02}".format( + utc.tm_year, utc.tm_mon, utc.tm_mday, utc.tm_hour, utc.tm_min, utc.tm_sec + ) + return date + microseconds + "Z" + except (ValueError, OverflowError) as err: + msg = "Unable to serialize datetime object." + raise SerializationError(msg) from err + except AttributeError as err: + msg = "ISO-8601 object must be valid Datetime object." + raise TypeError(msg) from err + + @staticmethod + def serialize_unix(attr, **kwargs): + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param Datetime attr: Object to be serialized. + :rtype: int + :raises: SerializationError if format invalid + """ + if isinstance(attr, int): + return attr + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + return int(calendar.timegm(attr.utctimetuple())) + except AttributeError: + raise TypeError("Unix time object must be valid Datetime object.") + + +def rest_key_extractor(attr, attr_desc, data): + key = attr_desc["key"] + working_data = data + + while "." in key: + # Need the cast, as for some reasons "split" is typed as list[str | Any] + dict_keys = cast(List[str], _FLATTEN.split(key)) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = working_data.get(working_key, data) + if working_data is None: + # If at any point while following flatten JSON path see None, it means + # that all properties under are None as well + return None + key = ".".join(dict_keys[1:]) + + return working_data.get(key) + + +def rest_key_case_insensitive_extractor(attr, attr_desc, data): + key = attr_desc["key"] + working_data = data + + while "." in key: + dict_keys = _FLATTEN.split(key) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = attribute_key_case_insensitive_extractor(working_key, None, working_data) + if working_data is None: + # If at any point while following flatten JSON path see None, it means + # that all properties under are None as well + return None + key = ".".join(dict_keys[1:]) + + if working_data: + return attribute_key_case_insensitive_extractor(key, None, working_data) + + +def last_rest_key_extractor(attr, attr_desc, data): + """Extract the attribute in "data" based on the last part of the JSON path key.""" + key = attr_desc["key"] + dict_keys = _FLATTEN.split(key) + return attribute_key_extractor(dict_keys[-1], None, data) + + +def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): + """Extract the attribute in "data" based on the last part of the JSON path key. + + This is the case insensitive version of "last_rest_key_extractor" + """ + key = attr_desc["key"] + dict_keys = _FLATTEN.split(key) + return attribute_key_case_insensitive_extractor(dict_keys[-1], None, data) + + +def attribute_key_extractor(attr, _, data): + return data.get(attr) + + +def attribute_key_case_insensitive_extractor(attr, _, data): + found_key = None + lower_attr = attr.lower() + for key in data: + if lower_attr == key.lower(): + found_key = key + break + + return data.get(found_key) + + +def _extract_name_from_internal_type(internal_type): + """Given an internal type XML description, extract correct XML name with namespace. + + :param dict internal_type: An model type + :rtype: tuple + :returns: A tuple XML name + namespace dict + """ + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + xml_name = internal_type_xml_map.get("name", internal_type.__name__) + xml_ns = internal_type_xml_map.get("ns", None) + if xml_ns: + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + return xml_name + + +def xml_key_extractor(attr, attr_desc, data): + if isinstance(data, dict): + return None + + # Test if this model is XML ready first + if not isinstance(data, ET.Element): + return None + + xml_desc = attr_desc.get("xml", {}) + xml_name = xml_desc.get("name", attr_desc["key"]) + + # Look for a children + is_iter_type = attr_desc["type"].startswith("[") + is_wrapped = xml_desc.get("wrapped", False) + internal_type = attr_desc.get("internalType", None) + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + + # Integrate namespace if necessary + xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None)) + if xml_ns: + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + + # If it's an attribute, that's simple + if xml_desc.get("attr", False): + return data.get(xml_name) + + # If it's x-ms-text, that's simple too + if xml_desc.get("text", False): + return data.text + + # Scenario where I take the local name: + # - Wrapped node + # - Internal type is an enum (considered basic types) + # - Internal type has no XML/Name node + if is_wrapped or (internal_type and (issubclass(internal_type, Enum) or "name" not in internal_type_xml_map)): + children = data.findall(xml_name) + # If internal type has a local name and it's not a list, I use that name + elif not is_iter_type and internal_type and "name" in internal_type_xml_map: + xml_name = _extract_name_from_internal_type(internal_type) + children = data.findall(xml_name) + # That's an array + else: + if internal_type: # Complex type, ignore itemsName and use the complex type name + items_name = _extract_name_from_internal_type(internal_type) + else: + items_name = xml_desc.get("itemsName", xml_name) + children = data.findall(items_name) + + if len(children) == 0: + if is_iter_type: + if is_wrapped: + return None # is_wrapped no node, we want None + else: + return [] # not wrapped, assume empty list + return None # Assume it's not there, maybe an optional node. + + # If is_iter_type and not wrapped, return all found children + if is_iter_type: + if not is_wrapped: + return children + else: # Iter and wrapped, should have found one node only (the wrap one) + if len(children) != 1: + raise DeserializationError( + "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( + xml_name + ) + ) + return list(children[0]) # Might be empty list and that's ok. + + # Here it's not a itertype, we should have found one element only or empty + if len(children) > 1: + raise DeserializationError("Find several XML '{}' where it was not expected".format(xml_name)) + return children[0] + + +class Deserializer(object): + """Response object model deserializer. + + :param dict classes: Class type dictionary for deserializing complex types. + :ivar list key_extractors: Ordered list of extractors to be used by this deserializer. + """ + + basic_types = {str: "str", int: "int", bool: "bool", float: "float"} + + valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") + + def __init__(self, classes: Optional[Mapping[str, type]] = None): + self.deserialize_type = { + "iso-8601": Deserializer.deserialize_iso, + "rfc-1123": Deserializer.deserialize_rfc, + "unix-time": Deserializer.deserialize_unix, + "duration": Deserializer.deserialize_duration, + "date": Deserializer.deserialize_date, + "time": Deserializer.deserialize_time, + "decimal": Deserializer.deserialize_decimal, + "long": Deserializer.deserialize_long, + "bytearray": Deserializer.deserialize_bytearray, + "base64": Deserializer.deserialize_base64, + "object": self.deserialize_object, + "[]": self.deserialize_iter, + "{}": self.deserialize_dict, + } + self.deserialize_expected_types = { + "duration": (isodate.Duration, datetime.timedelta), + "iso-8601": (datetime.datetime), + } + self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.key_extractors = [rest_key_extractor, xml_key_extractor] + # Additional properties only works if the "rest_key_extractor" is used to + # extract the keys. Making it to work whatever the key extractor is too much + # complicated, with no real scenario for now. + # So adding a flag to disable additional properties detection. This flag should be + # used if your expect the deserialization to NOT come from a JSON REST syntax. + # Otherwise, result are unexpected + self.additional_properties_detection = True + + def __call__(self, target_obj, response_data, content_type=None): + """Call the deserializer to process a REST response. + + :param str target_obj: Target data type to deserialize to. + :param requests.Response response_data: REST response object. + :param str content_type: Swagger "produces" if available. + :raises: DeserializationError if deserialization fails. + :return: Deserialized object. + """ + data = self._unpack_content(response_data, content_type) + return self._deserialize(target_obj, data) + + def _deserialize(self, target_obj, data): + """Call the deserializer on a model. + + Data needs to be already deserialized as JSON or XML ElementTree + + :param str target_obj: Target data type to deserialize to. + :param object data: Object to deserialize. + :raises: DeserializationError if deserialization fails. + :return: Deserialized object. + """ + # This is already a model, go recursive just in case + if hasattr(data, "_attribute_map"): + constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")] + try: + for attr, mapconfig in data._attribute_map.items(): + if attr in constants: + continue + value = getattr(data, attr) + if value is None: + continue + local_type = mapconfig["type"] + internal_data_type = local_type.strip("[]{}") + if internal_data_type not in self.dependencies or isinstance(internal_data_type, Enum): + continue + setattr(data, attr, self._deserialize(local_type, value)) + return data + except AttributeError: + return + + response, class_name = self._classify_target(target_obj, data) + + if isinstance(response, str): + return self.deserialize_data(data, response) + elif isinstance(response, type) and issubclass(response, Enum): + return self.deserialize_enum(data, response) + + if data is None or data is CoreNull: + return data + try: + attributes = response._attribute_map # type: ignore + d_attrs = {} + for attr, attr_desc in attributes.items(): + # Check empty string. If it's not empty, someone has a real "additionalProperties"... + if attr == "additional_properties" and attr_desc["key"] == "": + continue + raw_value = None + # Enhance attr_desc with some dynamic data + attr_desc = attr_desc.copy() # Do a copy, do not change the real one + internal_data_type = attr_desc["type"].strip("[]{}") + if internal_data_type in self.dependencies: + attr_desc["internalType"] = self.dependencies[internal_data_type] + + for key_extractor in self.key_extractors: + found_value = key_extractor(attr, attr_desc, data) + if found_value is not None: + if raw_value is not None and raw_value != found_value: + msg = ( + "Ignoring extracted value '%s' from %s for key '%s'" + " (duplicate extraction, follow extractors order)" + ) + _LOGGER.warning(msg, found_value, key_extractor, attr) + continue + raw_value = found_value + + value = self.deserialize_data(raw_value, attr_desc["type"]) + d_attrs[attr] = value + except (AttributeError, TypeError, KeyError) as err: + msg = "Unable to deserialize to object: " + class_name # type: ignore + raise DeserializationError(msg) from err + else: + additional_properties = self._build_additional_properties(attributes, data) + return self._instantiate_model(response, d_attrs, additional_properties) + + def _build_additional_properties(self, attribute_map, data): + if not self.additional_properties_detection: + return None + if "additional_properties" in attribute_map and attribute_map.get("additional_properties", {}).get("key") != "": + # Check empty string. If it's not empty, someone has a real "additionalProperties" + return None + if isinstance(data, ET.Element): + data = {el.tag: el.text for el in data} + + known_keys = { + _decode_attribute_map_key(_FLATTEN.split(desc["key"])[0]) + for desc in attribute_map.values() + if desc["key"] != "" + } + present_keys = set(data.keys()) + missing_keys = present_keys - known_keys + return {key: data[key] for key in missing_keys} + + def _classify_target(self, target, data): + """Check to see whether the deserialization target object can + be classified into a subclass. + Once classification has been determined, initialize object. + + :param str target: The target object type to deserialize to. + :param str/dict data: The response data to deserialize. + """ + if target is None: + return None, None + + if isinstance(target, str): + try: + target = self.dependencies[target] + except KeyError: + return target, target + + try: + target = target._classify(data, self.dependencies) # type: ignore + except AttributeError: + pass # Target is not a Model, no classify + return target, target.__class__.__name__ # type: ignore + + def failsafe_deserialize(self, target_obj, data, content_type=None): + """Ignores any errors encountered in deserialization, + and falls back to not deserializing the object. Recommended + for use in error deserialization, as we want to return the + HttpResponseError to users, and not have them deal with + a deserialization error. + + :param str target_obj: The target object type to deserialize to. + :param str/dict data: The response data to deserialize. + :param str content_type: Swagger "produces" if available. + """ + try: + return self(target_obj, data, content_type=content_type) + except: + _LOGGER.debug( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + @staticmethod + def _unpack_content(raw_data, content_type=None): + """Extract the correct structure for deserialization. + + If raw_data is a PipelineResponse, try to extract the result of RawDeserializer. + if we can't, raise. Your Pipeline should have a RawDeserializer. + + If not a pipeline response and raw_data is bytes or string, use content-type + to decode it. If no content-type, try JSON. + + If raw_data is something else, bypass all logic and return it directly. + + :param raw_data: Data to be processed. + :param content_type: How to parse if raw_data is a string/bytes. + :raises JSONDecodeError: If JSON is requested and parsing is impossible. + :raises UnicodeDecodeError: If bytes is not UTF8 + """ + # Assume this is enough to detect a Pipeline Response without importing it + context = getattr(raw_data, "context", {}) + if context: + if RawDeserializer.CONTEXT_NAME in context: + return context[RawDeserializer.CONTEXT_NAME] + raise ValueError("This pipeline didn't have the RawDeserializer policy; can't deserialize") + + # Assume this is enough to recognize universal_http.ClientResponse without importing it + if hasattr(raw_data, "body"): + return RawDeserializer.deserialize_from_http_generics(raw_data.text(), raw_data.headers) + + # Assume this enough to recognize requests.Response without importing it. + if hasattr(raw_data, "_content_consumed"): + return RawDeserializer.deserialize_from_http_generics(raw_data.text, raw_data.headers) + + if isinstance(raw_data, (str, bytes)) or hasattr(raw_data, "read"): + return RawDeserializer.deserialize_from_text(raw_data, content_type) # type: ignore + return raw_data + + def _instantiate_model(self, response, attrs, additional_properties=None): + """Instantiate a response model passing in deserialized args. + + :param response: The response model class. + :param d_attrs: The deserialized response attributes. + """ + if callable(response): + subtype = getattr(response, "_subtype_map", {}) + try: + readonly = [k for k, v in response._validation.items() if v.get("readonly")] + const = [k for k, v in response._validation.items() if v.get("constant")] + kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} + response_obj = response(**kwargs) + for attr in readonly: + setattr(response_obj, attr, attrs.get(attr)) + if additional_properties: + response_obj.additional_properties = additional_properties + return response_obj + except TypeError as err: + msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore + raise DeserializationError(msg + str(err)) + else: + try: + for attr, value in attrs.items(): + setattr(response, attr, value) + return response + except Exception as exp: + msg = "Unable to populate response model. " + msg += "Type: {}, Error: {}".format(type(response), exp) + raise DeserializationError(msg) + + def deserialize_data(self, data, data_type): + """Process data for deserialization according to data type. + + :param str data: The response string to be deserialized. + :param str data_type: The type to deserialize to. + :raises: DeserializationError if deserialization fails. + :return: Deserialized object. + """ + if data is None: + return data + + try: + if not data_type: + return data + if data_type in self.basic_types.values(): + return self.deserialize_basic(data, data_type) + if data_type in self.deserialize_type: + if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())): + return data + + is_a_text_parsing_type = lambda x: x not in ["object", "[]", r"{}"] + if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text: + return None + data_val = self.deserialize_type[data_type](data) + return data_val + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.deserialize_type: + return self.deserialize_type[iter_type](data, data_type[1:-1]) + + obj_type = self.dependencies[data_type] + if issubclass(obj_type, Enum): + if isinstance(data, ET.Element): + data = data.text + return self.deserialize_enum(data, obj_type) + + except (ValueError, TypeError, AttributeError) as err: + msg = "Unable to deserialize response data." + msg += " Data: {}, {}".format(data, data_type) + raise DeserializationError(msg) from err + else: + return self._deserialize(obj_type, data) + + def deserialize_iter(self, attr, iter_type): + """Deserialize an iterable. + + :param list attr: Iterable to be deserialized. + :param str iter_type: The type of object in the iterable. + :rtype: list + """ + if attr is None: + return None + if isinstance(attr, ET.Element): # If I receive an element here, get the children + attr = list(attr) + if not isinstance(attr, (list, set)): + raise DeserializationError("Cannot deserialize as [{}] an object of type {}".format(iter_type, type(attr))) + return [self.deserialize_data(a, iter_type) for a in attr] + + def deserialize_dict(self, attr, dict_type): + """Deserialize a dictionary. + + :param dict/list attr: Dictionary to be deserialized. Also accepts + a list of key, value pairs. + :param str dict_type: The object type of the items in the dictionary. + :rtype: dict + """ + if isinstance(attr, list): + return {x["key"]: self.deserialize_data(x["value"], dict_type) for x in attr} + + if isinstance(attr, ET.Element): + # Transform value into {"Key": "value"} + attr = {el.tag: el.text for el in attr} + return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()} + + def deserialize_object(self, attr, **kwargs): + """Deserialize a generic object. + This will be handled as a dictionary. + + :param dict attr: Dictionary to be deserialized. + :rtype: dict + :raises: TypeError if non-builtin datatype encountered. + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + # Do no recurse on XML, just return the tree as-is + return attr + if isinstance(attr, str): + return self.deserialize_basic(attr, "str") + obj_type = type(attr) + if obj_type in self.basic_types: + return self.deserialize_basic(attr, self.basic_types[obj_type]) + if obj_type is _long_type: + return self.deserialize_long(attr) + + if obj_type == dict: + deserialized = {} + for key, value in attr.items(): + try: + deserialized[key] = self.deserialize_object(value, **kwargs) + except ValueError: + deserialized[key] = None + return deserialized + + if obj_type == list: + deserialized = [] + for obj in attr: + try: + deserialized.append(self.deserialize_object(obj, **kwargs)) + except ValueError: + pass + return deserialized + + else: + error = "Cannot deserialize generic object with type: " + raise TypeError(error + str(obj_type)) + + def deserialize_basic(self, attr, data_type): + """Deserialize basic builtin data type from string. + Will attempt to convert to str, int, float and bool. + This function will also accept '1', '0', 'true' and 'false' as + valid bool values. + + :param str attr: response string to be deserialized. + :param str data_type: deserialization data type. + :rtype: str, int, float or bool + :raises: TypeError if string format is not valid. + """ + # If we're here, data is supposed to be a basic type. + # If it's still an XML node, take the text + if isinstance(attr, ET.Element): + attr = attr.text + if not attr: + if data_type == "str": + # None or '', node is empty string. + return "" + else: + # None or '', node with a strong type is None. + # Don't try to model "empty bool" or "empty int" + return None + + if data_type == "bool": + if attr in [True, False, 1, 0]: + return bool(attr) + elif isinstance(attr, str): + if attr.lower() in ["true", "1"]: + return True + elif attr.lower() in ["false", "0"]: + return False + raise TypeError("Invalid boolean value: {}".format(attr)) + + if data_type == "str": + return self.deserialize_unicode(attr) + return eval(data_type)(attr) # nosec + + @staticmethod + def deserialize_unicode(data): + """Preserve unicode objects in Python 2, otherwise return data + as a string. + + :param str data: response string to be deserialized. + :rtype: str or unicode + """ + # We might be here because we have an enum modeled as string, + # and we try to deserialize a partial dict with enum inside + if isinstance(data, Enum): + return data + + # Consider this is real string + try: + if isinstance(data, unicode): # type: ignore + return data + except NameError: + return str(data) + else: + return str(data) + + @staticmethod + def deserialize_enum(data, enum_obj): + """Deserialize string into enum object. + + If the string is not a valid enum value it will be returned as-is + and a warning will be logged. + + :param str data: Response string to be deserialized. If this value is + None or invalid it will be returned as-is. + :param Enum enum_obj: Enum object to deserialize to. + :rtype: Enum + """ + if isinstance(data, enum_obj) or data is None: + return data + if isinstance(data, Enum): + data = data.value + if isinstance(data, int): + # Workaround. We might consider remove it in the future. + try: + return list(enum_obj.__members__.values())[data] + except IndexError: + error = "{!r} is not a valid index for enum {!r}" + raise DeserializationError(error.format(data, enum_obj)) + try: + return enum_obj(str(data)) + except ValueError: + for enum_value in enum_obj: + if enum_value.value.lower() == str(data).lower(): + return enum_value + # We don't fail anymore for unknown value, we deserialize as a string + _LOGGER.warning("Deserializer is not able to find %s as valid enum in %s", data, enum_obj) + return Deserializer.deserialize_unicode(data) + + @staticmethod + def deserialize_bytearray(attr): + """Deserialize string into bytearray. + + :param str attr: response string to be deserialized. + :rtype: bytearray + :raises: TypeError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return bytearray(b64decode(attr)) # type: ignore + + @staticmethod + def deserialize_base64(attr): + """Deserialize base64 encoded string into string. + + :param str attr: response string to be deserialized. + :rtype: bytearray + :raises: TypeError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore + encoded = attr.replace("-", "+").replace("_", "/") + return b64decode(encoded) + + @staticmethod + def deserialize_decimal(attr): + """Deserialize string into Decimal object. + + :param str attr: response string to be deserialized. + :rtype: Decimal + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + return decimal.Decimal(str(attr)) # type: ignore + except decimal.DecimalException as err: + msg = "Invalid decimal {}".format(attr) + raise DeserializationError(msg) from err + + @staticmethod + def deserialize_long(attr): + """Deserialize string into long (Py2) or int (Py3). + + :param str attr: response string to be deserialized. + :rtype: long or int + :raises: ValueError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return _long_type(attr) # type: ignore + + @staticmethod + def deserialize_duration(attr): + """Deserialize ISO-8601 formatted string into TimeDelta object. + + :param str attr: response string to be deserialized. + :rtype: TimeDelta + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = isodate.parse_duration(attr) + except (ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize duration object." + raise DeserializationError(msg) from err + else: + return duration + + @staticmethod + def deserialize_date(attr): + """Deserialize ISO-8601 formatted string into Date object. + + :param str attr: response string to be deserialized. + :rtype: Date + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. + return isodate.parse_date(attr, defaultmonth=0, defaultday=0) + + @staticmethod + def deserialize_time(attr): + """Deserialize ISO-8601 formatted string into time object. + + :param str attr: response string to be deserialized. + :rtype: datetime.time + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + return isodate.parse_time(attr) + + @staticmethod + def deserialize_rfc(attr): + """Deserialize RFC-1123 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: Datetime + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + parsed_date = email.utils.parsedate_tz(attr) # type: ignore + date_obj = datetime.datetime( + *parsed_date[:6], tzinfo=_FixedOffset(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) + ) + if not date_obj.tzinfo: + date_obj = date_obj.astimezone(tz=TZ_UTC) + except ValueError as err: + msg = "Cannot deserialize to rfc datetime object." + raise DeserializationError(msg) from err + else: + return date_obj + + @staticmethod + def deserialize_iso(attr): + """Deserialize ISO-8601 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: Datetime + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + attr = attr.upper() # type: ignore + match = Deserializer.valid_date.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + check_decimal = attr.split(".") + if len(check_decimal) > 1: + decimal_str = "" + for digit in check_decimal[1]: + if digit.isdigit(): + decimal_str += digit + else: + break + if len(decimal_str) > 6: + attr = attr.replace(decimal_str, decimal_str[0:6]) + + date_obj = isodate.parse_datetime(attr) + test_utc = date_obj.utctimetuple() + if test_utc.tm_year > 9999 or test_utc.tm_year < 1: + raise OverflowError("Hit max or min date") + except (ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize datetime object." + raise DeserializationError(msg) from err + else: + return date_obj + + @staticmethod + def deserialize_unix(attr): + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param int attr: Object to be serialized. + :rtype: Datetime + :raises: DeserializationError if format invalid + """ + if isinstance(attr, ET.Element): + attr = int(attr.text) # type: ignore + try: + attr = int(attr) + date_obj = datetime.datetime.fromtimestamp(attr, TZ_UTC) + except ValueError as err: + msg = "Cannot deserialize to unix datetime object." + raise DeserializationError(msg) from err + else: + return date_obj diff --git a/src/durabletask/azext_durabletask/vendored_sdks/_version.py b/src/durabletask/azext_durabletask/vendored_sdks/_version.py new file mode 100644 index 00000000000..c47f66669f1 --- /dev/null +++ b/src/durabletask/azext_durabletask/vendored_sdks/_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.0" diff --git a/src/durabletask/azext_durabletask/vendored_sdks/aio/__init__.py b/src/durabletask/azext_durabletask/vendored_sdks/aio/__init__.py new file mode 100644 index 00000000000..d21c978735c --- /dev/null +++ b/src/durabletask/azext_durabletask/vendored_sdks/aio/__init__.py @@ -0,0 +1,23 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._durabletask_mgmt_client import DurabletaskMgmtClient + +try: + from ._patch import __all__ as _patch_all + from ._patch import * # pylint: disable=unused-wildcard-import +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "DurabletaskMgmtClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) + +_patch_sdk() diff --git a/src/durabletask/azext_durabletask/vendored_sdks/aio/_configuration.py b/src/durabletask/azext_durabletask/vendored_sdks/aio/_configuration.py new file mode 100644 index 00000000000..3fdd7959cc8 --- /dev/null +++ b/src/durabletask/azext_durabletask/vendored_sdks/aio/_configuration.py @@ -0,0 +1,65 @@ +# 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.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy + +from .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class DurabletaskMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long + """Configuration for DurabletaskMgmtClient. + + 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. Required. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. + :type subscription_id: str + :keyword api_version: Api Version. Default value is "2024-02-01-preview". Note that overriding + this default value may result in unsupported behavior. + :paramtype api_version: str + """ + + def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: + api_version: str = kwargs.pop("api_version", "2024-02-01-preview") + + 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.") + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = api_version + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "mgmt-durabletask/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) + 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.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") + if self.credential and not self.authentication_policy: + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/src/durabletask/azext_durabletask/vendored_sdks/aio/_durabletask_mgmt_client.py b/src/durabletask/azext_durabletask/vendored_sdks/aio/_durabletask_mgmt_client.py new file mode 100644 index 00000000000..b44e3286b20 --- /dev/null +++ b/src/durabletask/azext_durabletask/vendored_sdks/aio/_durabletask_mgmt_client.py @@ -0,0 +1,120 @@ +# 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 copy import deepcopy +from typing import Any, Awaitable, TYPE_CHECKING +from typing_extensions import Self + +from azure.core.pipeline import policies +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.mgmt.core import AsyncARMPipelineClient +from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy + +from .. import models as _models +from .._serialization import Deserializer, Serializer +from ._configuration import DurabletaskMgmtClientConfiguration +from .operations import NamespacesOperations, Operations, TaskHubsOperations + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class DurabletaskMgmtClient: # pylint: disable=client-accepts-api-version-keyword + """DurabletaskMgmtClient. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.durabletask.aio.operations.Operations + :ivar namespaces: NamespacesOperations operations + :vartype namespaces: azure.mgmt.durabletask.aio.operations.NamespacesOperations + :ivar task_hubs: TaskHubsOperations operations + :vartype task_hubs: azure.mgmt.durabletask.aio.operations.TaskHubsOperations + :param credential: Credential needed for the client to connect to Azure. Required. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. + :type subscription_id: str + :param base_url: Service URL. Default value is "https://management.azure.com". + :type base_url: str + :keyword api_version: Api Version. Default value is "2024-02-01-preview". Note that overriding + this default value may result in unsupported behavior. + :paramtype api_version: str + :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: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = DurabletaskMgmtClientConfiguration( + credential=credential, subscription_id=subscription_id, **kwargs + ) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + AsyncARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) + + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + self._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.namespaces = NamespacesOperations(self._client, self._config, self._serialize, self._deserialize) + self.task_hubs = TaskHubsOperations(self._client, self._config, self._serialize, self._deserialize) + + def _send_request( + self, request: HttpRequest, *, stream: bool = False, **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.AsyncHttpResponse + """ + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> Self: + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details: Any) -> None: + await self._client.__aexit__(*exc_details) diff --git a/src/durabletask/azext_durabletask/vendored_sdks/aio/_patch.py b/src/durabletask/azext_durabletask/vendored_sdks/aio/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/src/durabletask/azext_durabletask/vendored_sdks/aio/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/src/durabletask/azext_durabletask/vendored_sdks/aio/operations/__init__.py b/src/durabletask/azext_durabletask/vendored_sdks/aio/operations/__init__.py new file mode 100644 index 00000000000..03a0d30262e --- /dev/null +++ b/src/durabletask/azext_durabletask/vendored_sdks/aio/operations/__init__.py @@ -0,0 +1,23 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._namespaces_operations import NamespacesOperations +from ._task_hubs_operations import TaskHubsOperations + +from ._patch import __all__ as _patch_all +from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "Operations", + "NamespacesOperations", + "TaskHubsOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/src/durabletask/azext_durabletask/vendored_sdks/aio/operations/_namespaces_operations.py b/src/durabletask/azext_durabletask/vendored_sdks/aio/operations/_namespaces_operations.py new file mode 100644 index 00000000000..d2975e0238e --- /dev/null +++ b/src/durabletask/azext_durabletask/vendored_sdks/aio/operations/_namespaces_operations.py @@ -0,0 +1,793 @@ +# pylint: disable=too-many-lines,too-many-statements +# 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 io import IOBase +import sys +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ...operations._namespaces_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_by_resource_group_request, + build_list_by_subscription_request, + build_update_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class NamespacesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.durabletask.aio.DurabletaskMgmtClient`'s + :attr:`namespaces` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Namespace"]: + """List Namespace resources by subscription ID. + + :return: An iterator like instance of either Namespace or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.durabletask.models.Namespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.NamespaceListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NamespaceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.Namespace"]: + """List Namespace resources by resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of either Namespace or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.durabletask.models.Namespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.NamespaceListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NamespaceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get(self, resource_group_name: str, namespace_name: str, **kwargs: Any) -> _models.Namespace: + """Get a Namespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the service. Required. + :type namespace_name: str + :return: Namespace or the result of cls(response) + :rtype: ~azure.mgmt.durabletask.models.Namespace + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.Namespace] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Namespace", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + namespace_name: str, + resource: Union[_models.Namespace, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _json = self._serialize.body(resource, "Namespace") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + namespace_name: str, + resource: _models.Namespace, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Namespace]: + """Create a Namespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the service. Required. + :type namespace_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.durabletask.models.Namespace + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either Namespace or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.Namespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + namespace_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Namespace]: + """Create a Namespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the service. Required. + :type namespace_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either Namespace or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.Namespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + namespace_name: str, + resource: Union[_models.Namespace, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.Namespace]: + """Create a Namespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the service. Required. + :type namespace_name: str + :param resource: Resource create parameters. Is either a Namespace type or a IO[bytes] type. + Required. + :type resource: ~azure.mgmt.durabletask.models.Namespace or IO[bytes] + :return: An instance of AsyncLROPoller that returns either Namespace or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.Namespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Namespace] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + resource=resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("Namespace", pipeline_response.http_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Namespace].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Namespace]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + namespace_name: str, + properties: Union[_models.NamespaceUpdate, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _json = self._serialize.body(properties, "NamespaceUpdate") + + _request = build_update_request( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + namespace_name: str, + properties: _models.NamespaceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Namespace]: + """Update a Namespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the service. Required. + :type namespace_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.durabletask.models.NamespaceUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either Namespace or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.Namespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + namespace_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Namespace]: + """Update a Namespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the service. Required. + :type namespace_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either Namespace or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.Namespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + namespace_name: str, + properties: Union[_models.NamespaceUpdate, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.Namespace]: + """Update a Namespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the service. Required. + :type namespace_name: str + :param properties: The resource properties to be updated. Is either a NamespaceUpdate type or a + IO[bytes] type. Required. + :type properties: ~azure.mgmt.durabletask.models.NamespaceUpdate or IO[bytes] + :return: An instance of AsyncLROPoller that returns either Namespace or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.Namespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Namespace] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + properties=properties, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("Namespace", pipeline_response.http_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Namespace].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Namespace]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, namespace_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete(self, resource_group_name: str, namespace_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Delete a Namespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the service. Required. + :type namespace_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/durabletask/azext_durabletask/vendored_sdks/aio/operations/_operations.py b/src/durabletask/azext_durabletask/vendored_sdks/aio/operations/_operations.py new file mode 100644 index 00000000000..f3fe8f9288f --- /dev/null +++ b/src/durabletask/azext_durabletask/vendored_sdks/aio/operations/_operations.py @@ -0,0 +1,130 @@ +# pylint: disable=too-many-lines,too-many-statements +# 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 sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ...operations._operations import build_list_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class Operations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.durabletask.aio.DurabletaskMgmtClient`'s + :attr:`operations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: + """List the operations for the provider. + + :return: An iterator like instance of either Operation or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.durabletask.models.Operation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("OperationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) diff --git a/src/durabletask/azext_durabletask/vendored_sdks/aio/operations/_patch.py b/src/durabletask/azext_durabletask/vendored_sdks/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/src/durabletask/azext_durabletask/vendored_sdks/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/src/durabletask/azext_durabletask/vendored_sdks/aio/operations/_task_hubs_operations.py b/src/durabletask/azext_durabletask/vendored_sdks/aio/operations/_task_hubs_operations.py new file mode 100644 index 00000000000..d49184ec12a --- /dev/null +++ b/src/durabletask/azext_durabletask/vendored_sdks/aio/operations/_task_hubs_operations.py @@ -0,0 +1,548 @@ +# pylint: disable=too-many-lines,too-many-statements +# 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 io import IOBase +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ...operations._task_hubs_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_by_namespace_request, + build_update_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class TaskHubsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.durabletask.aio.DurabletaskMgmtClient`'s + :attr:`task_hubs` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_namespace( + self, resource_group_name: str, namespace_name: str, **kwargs: Any + ) -> AsyncIterable["_models.TaskHub"]: + """List Task Hubs. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the service. Required. + :type namespace_name: str + :return: An iterator like instance of either TaskHub or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.durabletask.models.TaskHub] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.TaskHubListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_namespace_request( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("TaskHubListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get( + self, resource_group_name: str, namespace_name: str, task_hub_name: str, **kwargs: Any + ) -> _models.TaskHub: + """Get a Task Hub. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the service. Required. + :type namespace_name: str + :param task_hub_name: Task Hub name. Required. + :type task_hub_name: str + :return: TaskHub or the result of cls(response) + :rtype: ~azure.mgmt.durabletask.models.TaskHub + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.TaskHub] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + task_hub_name=task_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("TaskHub", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + namespace_name: str, + task_hub_name: str, + resource: _models.TaskHub, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.TaskHub: + """Create or update a Task Hub. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the service. Required. + :type namespace_name: str + :param task_hub_name: Task Hub name. Required. + :type task_hub_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.durabletask.models.TaskHub + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TaskHub or the result of cls(response) + :rtype: ~azure.mgmt.durabletask.models.TaskHub + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + namespace_name: str, + task_hub_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.TaskHub: + """Create or update a Task Hub. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the service. Required. + :type namespace_name: str + :param task_hub_name: Task Hub name. Required. + :type task_hub_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: TaskHub or the result of cls(response) + :rtype: ~azure.mgmt.durabletask.models.TaskHub + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + namespace_name: str, + task_hub_name: str, + resource: Union[_models.TaskHub, IO[bytes]], + **kwargs: Any + ) -> _models.TaskHub: + """Create or update a Task Hub. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the service. Required. + :type namespace_name: str + :param task_hub_name: Task Hub name. Required. + :type task_hub_name: str + :param resource: Resource create parameters. Is either a TaskHub type or a IO[bytes] type. + Required. + :type resource: ~azure.mgmt.durabletask.models.TaskHub or IO[bytes] + :return: TaskHub or the result of cls(response) + :rtype: ~azure.mgmt.durabletask.models.TaskHub + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TaskHub] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _json = self._serialize.body(resource, "TaskHub") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + task_hub_name=task_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("TaskHub", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def update( + self, + resource_group_name: str, + namespace_name: str, + task_hub_name: str, + properties: _models.TaskHubUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.TaskHub: + """Update a Task Hub. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the service. Required. + :type namespace_name: str + :param task_hub_name: Task Hub name. Required. + :type task_hub_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.durabletask.models.TaskHubUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TaskHub or the result of cls(response) + :rtype: ~azure.mgmt.durabletask.models.TaskHub + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + namespace_name: str, + task_hub_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.TaskHub: + """Update a Task Hub. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the service. Required. + :type namespace_name: str + :param task_hub_name: Task Hub name. Required. + :type task_hub_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: TaskHub or the result of cls(response) + :rtype: ~azure.mgmt.durabletask.models.TaskHub + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + namespace_name: str, + task_hub_name: str, + properties: Union[_models.TaskHubUpdate, IO[bytes]], + **kwargs: Any + ) -> _models.TaskHub: + """Update a Task Hub. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the service. Required. + :type namespace_name: str + :param task_hub_name: Task Hub name. Required. + :type task_hub_name: str + :param properties: The resource properties to be updated. Is either a TaskHubUpdate type or a + IO[bytes] type. Required. + :type properties: ~azure.mgmt.durabletask.models.TaskHubUpdate or IO[bytes] + :return: TaskHub or the result of cls(response) + :rtype: ~azure.mgmt.durabletask.models.TaskHub + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TaskHub] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _json = self._serialize.body(properties, "TaskHubUpdate") + + _request = build_update_request( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + task_hub_name=task_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("TaskHub", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, namespace_name: str, task_hub_name: str, **kwargs: Any + ) -> None: + """Delete a Task Hub. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the service. Required. + :type namespace_name: str + :param task_hub_name: Task Hub name. Required. + :type task_hub_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + task_hub_name=task_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/src/durabletask/azext_durabletask/vendored_sdks/authoring/__init__.py b/src/durabletask/azext_durabletask/vendored_sdks/authoring/__init__.py new file mode 100644 index 00000000000..49718dcd228 --- /dev/null +++ b/src/durabletask/azext_durabletask/vendored_sdks/authoring/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from ._configuration import LUISAuthoringClientConfiguration +from ._luis_authoring_client import LUISAuthoringClient +__all__ = ['LUISAuthoringClient', 'LUISAuthoringClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/src/durabletask/azext_durabletask/vendored_sdks/authoring/_configuration.py b/src/durabletask/azext_durabletask/vendored_sdks/authoring/_configuration.py new file mode 100644 index 00000000000..1a32e73d6cb --- /dev/null +++ b/src/durabletask/azext_durabletask/vendored_sdks/authoring/_configuration.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest import Configuration + +from .version import VERSION + + +class LUISAuthoringClientConfiguration(Configuration): + """Configuration for LUISAuthoringClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param endpoint: Supported Cognitive Services endpoints (protocol and + hostname, for example: https://westus.api.cognitive.microsoft.com). + :type endpoint: str + :param credentials: Subscription credentials which uniquely identify + client subscription. + :type credentials: None + """ + + def __init__( + self, endpoint, credentials): + + if endpoint is None: + raise ValueError("Parameter 'endpoint' must not be None.") + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + base_url = '{Endpoint}/luis/authoring/v3.0-preview' + + super(LUISAuthoringClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-cognitiveservices-language-luis/{}'.format(VERSION)) + + self.endpoint = endpoint + self.credentials = credentials diff --git a/src/durabletask/azext_durabletask/vendored_sdks/authoring/_luis_authoring_client.py b/src/durabletask/azext_durabletask/vendored_sdks/authoring/_luis_authoring_client.py new file mode 100644 index 00000000000..185b9453df6 --- /dev/null +++ b/src/durabletask/azext_durabletask/vendored_sdks/authoring/_luis_authoring_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 msrest.service_client import SDKClient +from msrest import Serializer, Deserializer + +from ._configuration import LUISAuthoringClientConfiguration +from msrest.exceptions import HttpOperationError +from .operations import FeaturesOperations +from .operations import ExamplesOperations +from .operations import ModelOperations +from .operations import AppsOperations +from .operations import VersionsOperations +from .operations import TrainOperations +from .operations import PatternOperations +from .operations import SettingsOperations +from .operations import AzureAccountsOperations +from . import models + + +class LUISAuthoringClient(SDKClient): + """LUISAuthoringClient + + :ivar config: Configuration for client. + :vartype config: LUISAuthoringClientConfiguration + + :ivar features: Features operations + :vartype features: azure.cognitiveservices.language.luis.authoring.operations.FeaturesOperations + :ivar examples: Examples operations + :vartype examples: azure.cognitiveservices.language.luis.authoring.operations.ExamplesOperations + :ivar model: Model operations + :vartype model: azure.cognitiveservices.language.luis.authoring.operations.ModelOperations + :ivar apps: Apps operations + :vartype apps: azure.cognitiveservices.language.luis.authoring.operations.AppsOperations + :ivar versions: Versions operations + :vartype versions: azure.cognitiveservices.language.luis.authoring.operations.VersionsOperations + :ivar train: Train operations + :vartype train: azure.cognitiveservices.language.luis.authoring.operations.TrainOperations + :ivar pattern: Pattern operations + :vartype pattern: azure.cognitiveservices.language.luis.authoring.operations.PatternOperations + :ivar settings: Settings operations + :vartype settings: azure.cognitiveservices.language.luis.authoring.operations.SettingsOperations + :ivar azure_accounts: AzureAccounts operations + :vartype azure_accounts: azure.cognitiveservices.language.luis.authoring.operations.AzureAccountsOperations + + :param endpoint: Supported Cognitive Services endpoints (protocol and + hostname, for example: https://westus.api.cognitive.microsoft.com). + :type endpoint: str + :param credentials: Subscription credentials which uniquely identify + client subscription. + :type credentials: None + """ + + def __init__( + self, endpoint, credentials): + + self.config = LUISAuthoringClientConfiguration(endpoint, credentials) + super(LUISAuthoringClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '3.0-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.features = FeaturesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.examples = ExamplesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.model = ModelOperations( + self._client, self.config, self._serialize, self._deserialize) + self.apps = AppsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.versions = VersionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.train = TrainOperations( + self._client, self.config, self._serialize, self._deserialize) + self.pattern = PatternOperations( + self._client, self.config, self._serialize, self._deserialize) + self.settings = SettingsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.azure_accounts = AzureAccountsOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/src/durabletask/azext_durabletask/vendored_sdks/authoring/models/__init__.py b/src/durabletask/azext_durabletask/vendored_sdks/authoring/models/__init__.py new file mode 100644 index 00000000000..4fb287da083 --- /dev/null +++ b/src/durabletask/azext_durabletask/vendored_sdks/authoring/models/__init__.py @@ -0,0 +1,346 @@ +# 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 ApplicationCreateObject + from ._models_py3 import ApplicationInfoResponse + from ._models_py3 import ApplicationPublishObject + from ._models_py3 import ApplicationSettings + from ._models_py3 import ApplicationSettingUpdateObject + from ._models_py3 import ApplicationUpdateObject + from ._models_py3 import AppVersionSettingObject + from ._models_py3 import AvailableCulture + from ._models_py3 import AvailablePrebuiltEntityModel + from ._models_py3 import AzureAccountInfoObject + from ._models_py3 import BatchLabelExample + from ._models_py3 import ChildEntity + from ._models_py3 import ChildEntityModelCreateObject + from ._models_py3 import ClosedList + from ._models_py3 import ClosedListEntityExtractor + from ._models_py3 import ClosedListModelCreateObject + from ._models_py3 import ClosedListModelPatchObject + from ._models_py3 import ClosedListModelUpdateObject + from ._models_py3 import CollaboratorsArray + from ._models_py3 import CompositeChildModelCreateObject + from ._models_py3 import CompositeEntityExtractor + from ._models_py3 import CompositeEntityModel + from ._models_py3 import CustomPrebuiltModel + from ._models_py3 import EndpointInfo + from ._models_py3 import EnqueueTrainingResponse + from ._models_py3 import EntitiesSuggestionExample + from ._models_py3 import EntityExtractor + from ._models_py3 import EntityLabel + from ._models_py3 import EntityLabelObject + from ._models_py3 import EntityModelCreateObject + from ._models_py3 import EntityModelInfo + from ._models_py3 import EntityModelUpdateObject + from ._models_py3 import EntityPrediction + from ._models_py3 import EntityRole + from ._models_py3 import EntityRoleCreateObject + from ._models_py3 import EntityRoleUpdateObject + from ._models_py3 import ErrorResponse, ErrorResponseException + from ._models_py3 import ExampleLabelObject + from ._models_py3 import ExplicitListItem + from ._models_py3 import ExplicitListItemCreateObject + from ._models_py3 import ExplicitListItemUpdateObject + from ._models_py3 import FeatureInfoObject + from ._models_py3 import FeaturesResponseObject + from ._models_py3 import HierarchicalChildEntity + from ._models_py3 import HierarchicalChildModelUpdateObject + from ._models_py3 import HierarchicalEntityExtractor + from ._models_py3 import HierarchicalModel + from ._models_py3 import HierarchicalModelV2 + from ._models_py3 import IntentClassifier + from ._models_py3 import IntentPrediction + from ._models_py3 import IntentsSuggestionExample + from ._models_py3 import JsonChild + from ._models_py3 import JSONEntity + from ._models_py3 import JSONModelFeature + from ._models_py3 import JsonModelFeatureInformation + from ._models_py3 import JSONRegexFeature + from ._models_py3 import JSONUtterance + from ._models_py3 import LabeledUtterance + from ._models_py3 import LabelExampleResponse + from ._models_py3 import LabelTextObject + from ._models_py3 import LuisApp + from ._models_py3 import LuisAppV2 + from ._models_py3 import ModelCreateObject + from ._models_py3 import ModelFeatureInformation + from ._models_py3 import ModelInfo + from ._models_py3 import ModelInfoResponse + from ._models_py3 import ModelTrainingDetails + from ._models_py3 import ModelTrainingInfo + from ._models_py3 import ModelUpdateObject + from ._models_py3 import NDepthEntityExtractor + from ._models_py3 import OperationError + from ._models_py3 import OperationStatus + from ._models_py3 import PatternAny + from ._models_py3 import PatternAnyEntityExtractor + from ._models_py3 import PatternAnyModelCreateObject + from ._models_py3 import PatternAnyModelUpdateObject + from ._models_py3 import PatternFeatureInfo + from ._models_py3 import PatternRule + from ._models_py3 import PatternRuleCreateObject + from ._models_py3 import PatternRuleInfo + from ._models_py3 import PatternRuleUpdateObject + from ._models_py3 import PersonalAssistantsResponse + from ._models_py3 import PhraselistCreateObject + from ._models_py3 import PhraseListFeatureInfo + from ._models_py3 import PhraselistUpdateObject + from ._models_py3 import PrebuiltDomain + from ._models_py3 import PrebuiltDomainCreateBaseObject + from ._models_py3 import PrebuiltDomainCreateObject + from ._models_py3 import PrebuiltDomainItem + from ._models_py3 import PrebuiltDomainModelCreateObject + from ._models_py3 import PrebuiltDomainObject + from ._models_py3 import PrebuiltEntity + from ._models_py3 import PrebuiltEntityExtractor + from ._models_py3 import ProductionOrStagingEndpointInfo + from ._models_py3 import PublishSettings + from ._models_py3 import PublishSettingUpdateObject + from ._models_py3 import RegexEntity + from ._models_py3 import RegexEntityExtractor + from ._models_py3 import RegexModelCreateObject + from ._models_py3 import RegexModelUpdateObject + from ._models_py3 import SubClosedList + from ._models_py3 import SubClosedListResponse + from ._models_py3 import TaskUpdateObject + from ._models_py3 import UserAccessList + from ._models_py3 import UserCollaborator + from ._models_py3 import VersionInfo + from ._models_py3 import WordListBaseUpdateObject + from ._models_py3 import WordListObject +except (SyntaxError, ImportError): + from ._models import ApplicationCreateObject + from ._models import ApplicationInfoResponse + from ._models import ApplicationPublishObject + from ._models import ApplicationSettings + from ._models import ApplicationSettingUpdateObject + from ._models import ApplicationUpdateObject + from ._models import AppVersionSettingObject + from ._models import AvailableCulture + from ._models import AvailablePrebuiltEntityModel + from ._models import AzureAccountInfoObject + from ._models import BatchLabelExample + from ._models import ChildEntity + from ._models import ChildEntityModelCreateObject + from ._models import ClosedList + from ._models import ClosedListEntityExtractor + from ._models import ClosedListModelCreateObject + from ._models import ClosedListModelPatchObject + from ._models import ClosedListModelUpdateObject + from ._models import CollaboratorsArray + from ._models import CompositeChildModelCreateObject + from ._models import CompositeEntityExtractor + from ._models import CompositeEntityModel + from ._models import CustomPrebuiltModel + from ._models import EndpointInfo + from ._models import EnqueueTrainingResponse + from ._models import EntitiesSuggestionExample + from ._models import EntityExtractor + from ._models import EntityLabel + from ._models import EntityLabelObject + from ._models import EntityModelCreateObject + from ._models import EntityModelInfo + from ._models import EntityModelUpdateObject + from ._models import EntityPrediction + from ._models import EntityRole + from ._models import EntityRoleCreateObject + from ._models import EntityRoleUpdateObject + from ._models import ErrorResponse, ErrorResponseException + from ._models import ExampleLabelObject + from ._models import ExplicitListItem + from ._models import ExplicitListItemCreateObject + from ._models import ExplicitListItemUpdateObject + from ._models import FeatureInfoObject + from ._models import FeaturesResponseObject + from ._models import HierarchicalChildEntity + from ._models import HierarchicalChildModelUpdateObject + from ._models import HierarchicalEntityExtractor + from ._models import HierarchicalModel + from ._models import HierarchicalModelV2 + from ._models import IntentClassifier + from ._models import IntentPrediction + from ._models import IntentsSuggestionExample + from ._models import JsonChild + from ._models import JSONEntity + from ._models import JSONModelFeature + from ._models import JsonModelFeatureInformation + from ._models import JSONRegexFeature + from ._models import JSONUtterance + from ._models import LabeledUtterance + from ._models import LabelExampleResponse + from ._models import LabelTextObject + from ._models import LuisApp + from ._models import LuisAppV2 + from ._models import ModelCreateObject + from ._models import ModelFeatureInformation + from ._models import ModelInfo + from ._models import ModelInfoResponse + from ._models import ModelTrainingDetails + from ._models import ModelTrainingInfo + from ._models import ModelUpdateObject + from ._models import NDepthEntityExtractor + from ._models import OperationError + from ._models import OperationStatus + from ._models import PatternAny + from ._models import PatternAnyEntityExtractor + from ._models import PatternAnyModelCreateObject + from ._models import PatternAnyModelUpdateObject + from ._models import PatternFeatureInfo + from ._models import PatternRule + from ._models import PatternRuleCreateObject + from ._models import PatternRuleInfo + from ._models import PatternRuleUpdateObject + from ._models import PersonalAssistantsResponse + from ._models import PhraselistCreateObject + from ._models import PhraseListFeatureInfo + from ._models import PhraselistUpdateObject + from ._models import PrebuiltDomain + from ._models import PrebuiltDomainCreateBaseObject + from ._models import PrebuiltDomainCreateObject + from ._models import PrebuiltDomainItem + from ._models import PrebuiltDomainModelCreateObject + from ._models import PrebuiltDomainObject + from ._models import PrebuiltEntity + from ._models import PrebuiltEntityExtractor + from ._models import ProductionOrStagingEndpointInfo + from ._models import PublishSettings + from ._models import PublishSettingUpdateObject + from ._models import RegexEntity + from ._models import RegexEntityExtractor + from ._models import RegexModelCreateObject + from ._models import RegexModelUpdateObject + from ._models import SubClosedList + from ._models import SubClosedListResponse + from ._models import TaskUpdateObject + from ._models import UserAccessList + from ._models import UserCollaborator + from ._models import VersionInfo + from ._models import WordListBaseUpdateObject + from ._models import WordListObject +from ._luis_authoring_client_enums import ( + OperationStatusType, + TrainingStatus, +) + +__all__ = [ + 'ApplicationCreateObject', + 'ApplicationInfoResponse', + 'ApplicationPublishObject', + 'ApplicationSettings', + 'ApplicationSettingUpdateObject', + 'ApplicationUpdateObject', + 'AppVersionSettingObject', + 'AvailableCulture', + 'AvailablePrebuiltEntityModel', + 'AzureAccountInfoObject', + 'BatchLabelExample', + 'ChildEntity', + 'ChildEntityModelCreateObject', + 'ClosedList', + 'ClosedListEntityExtractor', + 'ClosedListModelCreateObject', + 'ClosedListModelPatchObject', + 'ClosedListModelUpdateObject', + 'CollaboratorsArray', + 'CompositeChildModelCreateObject', + 'CompositeEntityExtractor', + 'CompositeEntityModel', + 'CustomPrebuiltModel', + 'EndpointInfo', + 'EnqueueTrainingResponse', + 'EntitiesSuggestionExample', + 'EntityExtractor', + 'EntityLabel', + 'EntityLabelObject', + 'EntityModelCreateObject', + 'EntityModelInfo', + 'EntityModelUpdateObject', + 'EntityPrediction', + 'EntityRole', + 'EntityRoleCreateObject', + 'EntityRoleUpdateObject', + 'ErrorResponse', 'ErrorResponseException', + 'ExampleLabelObject', + 'ExplicitListItem', + 'ExplicitListItemCreateObject', + 'ExplicitListItemUpdateObject', + 'FeatureInfoObject', + 'FeaturesResponseObject', + 'HierarchicalChildEntity', + 'HierarchicalChildModelUpdateObject', + 'HierarchicalEntityExtractor', + 'HierarchicalModel', + 'HierarchicalModelV2', + 'IntentClassifier', + 'IntentPrediction', + 'IntentsSuggestionExample', + 'JsonChild', + 'JSONEntity', + 'JSONModelFeature', + 'JsonModelFeatureInformation', + 'JSONRegexFeature', + 'JSONUtterance', + 'LabeledUtterance', + 'LabelExampleResponse', + 'LabelTextObject', + 'LuisApp', + 'LuisAppV2', + 'ModelCreateObject', + 'ModelFeatureInformation', + 'ModelInfo', + 'ModelInfoResponse', + 'ModelTrainingDetails', + 'ModelTrainingInfo', + 'ModelUpdateObject', + 'NDepthEntityExtractor', + 'OperationError', + 'OperationStatus', + 'PatternAny', + 'PatternAnyEntityExtractor', + 'PatternAnyModelCreateObject', + 'PatternAnyModelUpdateObject', + 'PatternFeatureInfo', + 'PatternRule', + 'PatternRuleCreateObject', + 'PatternRuleInfo', + 'PatternRuleUpdateObject', + 'PersonalAssistantsResponse', + 'PhraselistCreateObject', + 'PhraseListFeatureInfo', + 'PhraselistUpdateObject', + 'PrebuiltDomain', + 'PrebuiltDomainCreateBaseObject', + 'PrebuiltDomainCreateObject', + 'PrebuiltDomainItem', + 'PrebuiltDomainModelCreateObject', + 'PrebuiltDomainObject', + 'PrebuiltEntity', + 'PrebuiltEntityExtractor', + 'ProductionOrStagingEndpointInfo', + 'PublishSettings', + 'PublishSettingUpdateObject', + 'RegexEntity', + 'RegexEntityExtractor', + 'RegexModelCreateObject', + 'RegexModelUpdateObject', + 'SubClosedList', + 'SubClosedListResponse', + 'TaskUpdateObject', + 'UserAccessList', + 'UserCollaborator', + 'VersionInfo', + 'WordListBaseUpdateObject', + 'WordListObject', + 'TrainingStatus', + 'OperationStatusType', +] diff --git a/src/durabletask/azext_durabletask/vendored_sdks/authoring/models/_luis_authoring_client_enums.py b/src/durabletask/azext_durabletask/vendored_sdks/authoring/models/_luis_authoring_client_enums.py new file mode 100644 index 00000000000..f85ad6da8c8 --- /dev/null +++ b/src/durabletask/azext_durabletask/vendored_sdks/authoring/models/_luis_authoring_client_enums.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class TrainingStatus(str, Enum): + + needs_training = "NeedsTraining" + in_progress = "InProgress" + trained = "Trained" + + +class OperationStatusType(str, Enum): + + failed = "Failed" + success = "Success" diff --git a/src/durabletask/azext_durabletask/vendored_sdks/authoring/models/_models.py b/src/durabletask/azext_durabletask/vendored_sdks/authoring/models/_models.py new file mode 100644 index 00000000000..2f626bf3131 --- /dev/null +++ b/src/durabletask/azext_durabletask/vendored_sdks/authoring/models/_models.py @@ -0,0 +1,3333 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class ApplicationCreateObject(Model): + """Properties for creating a new LUIS Application. + + All required parameters must be populated in order to send to Azure. + + :param culture: Required. The culture for the new application. It is the + language that your app understands and speaks. E.g.: "en-us". Note: the + culture cannot be changed after the app is created. + :type culture: str + :param domain: The domain for the new application. Optional. E.g.: Comics. + :type domain: str + :param description: Description of the new application. Optional. + :type description: str + :param initial_version_id: The initial version ID. Optional. Default value + is: "0.1" + :type initial_version_id: str + :param usage_scenario: Defines the scenario for the new application. + Optional. E.g.: IoT. + :type usage_scenario: str + :param name: Required. The name for the new application. + :type name: str + """ + + _validation = { + 'culture': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'culture': {'key': 'culture', 'type': 'str'}, + 'domain': {'key': 'domain', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'initial_version_id': {'key': 'initialVersionId', 'type': 'str'}, + 'usage_scenario': {'key': 'usageScenario', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationCreateObject, self).__init__(**kwargs) + self.culture = kwargs.get('culture', None) + self.domain = kwargs.get('domain', None) + self.description = kwargs.get('description', None) + self.initial_version_id = kwargs.get('initial_version_id', None) + self.usage_scenario = kwargs.get('usage_scenario', None) + self.name = kwargs.get('name', None) + + +class ApplicationInfoResponse(Model): + """Response containing the Application Info. + + :param id: The ID (GUID) of the application. + :type id: str + :param name: The name of the application. + :type name: str + :param description: The description of the application. + :type description: str + :param culture: The culture of the application. For example, "en-us". + :type culture: str + :param usage_scenario: Defines the scenario for the new application. + Optional. For example, IoT. + :type usage_scenario: str + :param domain: The domain for the new application. Optional. For example, + Comics. + :type domain: str + :param versions_count: Amount of model versions within the application. + :type versions_count: int + :param created_date_time: The version's creation timestamp. + :type created_date_time: str + :param endpoints: The Runtime endpoint URL for this model version. + :type endpoints: object + :param endpoint_hits_count: Number of calls made to this endpoint. + :type endpoint_hits_count: int + :param active_version: The version ID currently marked as active. + :type active_version: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'culture': {'key': 'culture', 'type': 'str'}, + 'usage_scenario': {'key': 'usageScenario', 'type': 'str'}, + 'domain': {'key': 'domain', 'type': 'str'}, + 'versions_count': {'key': 'versionsCount', 'type': 'int'}, + 'created_date_time': {'key': 'createdDateTime', 'type': 'str'}, + 'endpoints': {'key': 'endpoints', 'type': 'object'}, + 'endpoint_hits_count': {'key': 'endpointHitsCount', 'type': 'int'}, + 'active_version': {'key': 'activeVersion', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationInfoResponse, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.description = kwargs.get('description', None) + self.culture = kwargs.get('culture', None) + self.usage_scenario = kwargs.get('usage_scenario', None) + self.domain = kwargs.get('domain', None) + self.versions_count = kwargs.get('versions_count', None) + self.created_date_time = kwargs.get('created_date_time', None) + self.endpoints = kwargs.get('endpoints', None) + self.endpoint_hits_count = kwargs.get('endpoint_hits_count', None) + self.active_version = kwargs.get('active_version', None) + + +class ApplicationPublishObject(Model): + """Object model for publishing a specific application version. + + :param version_id: The version ID to publish. + :type version_id: str + :param is_staging: Indicates if the staging slot should be used, instead + of the Production one. Default value: False . + :type is_staging: bool + """ + + _attribute_map = { + 'version_id': {'key': 'versionId', 'type': 'str'}, + 'is_staging': {'key': 'isStaging', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ApplicationPublishObject, self).__init__(**kwargs) + self.version_id = kwargs.get('version_id', None) + self.is_staging = kwargs.get('is_staging', False) + + +class ApplicationSettings(Model): + """The application settings. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The application ID. + :type id: str + :param is_public: Required. Setting your application as public allows + other people to use your application's endpoint using their own keys for + billing purposes. + :type is_public: bool + """ + + _validation = { + 'id': {'required': True}, + 'is_public': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'is_public': {'key': 'public', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ApplicationSettings, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.is_public = kwargs.get('is_public', None) + + +class ApplicationSettingUpdateObject(Model): + """Object model for updating an application's settings. + + :param is_public: Setting your application as public allows other people + to use your application's endpoint using their own keys. + :type is_public: bool + """ + + _attribute_map = { + 'is_public': {'key': 'public', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ApplicationSettingUpdateObject, self).__init__(**kwargs) + self.is_public = kwargs.get('is_public', None) + + +class ApplicationUpdateObject(Model): + """Object model for updating the name or description of an application. + + :param name: The application's new name. + :type name: str + :param description: The application's new description. + :type description: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationUpdateObject, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.description = kwargs.get('description', None) + + +class AppVersionSettingObject(Model): + """Object model of an application version setting. + + :param name: The application version setting name. + :type name: str + :param value: The application version setting value. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AppVersionSettingObject, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + + +class AvailableCulture(Model): + """Available culture for using in a new application. + + :param name: The language name. + :type name: str + :param code: The ISO value for the language. + :type code: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'code': {'key': 'code', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AvailableCulture, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.code = kwargs.get('code', None) + + +class AvailablePrebuiltEntityModel(Model): + """Available Prebuilt entity model for using in an application. + + :param name: The entity name. + :type name: str + :param description: The entity description and usage information. + :type description: str + :param examples: Usage examples. + :type examples: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'examples': {'key': 'examples', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AvailablePrebuiltEntityModel, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.description = kwargs.get('description', None) + self.examples = kwargs.get('examples', None) + + +class AzureAccountInfoObject(Model): + """Defines the Azure account information object. + + All required parameters must be populated in order to send to Azure. + + :param azure_subscription_id: Required. The id for the Azure subscription. + :type azure_subscription_id: str + :param resource_group: Required. The Azure resource group name. + :type resource_group: str + :param account_name: Required. The Azure account name. + :type account_name: str + """ + + _validation = { + 'azure_subscription_id': {'required': True}, + 'resource_group': {'required': True}, + 'account_name': {'required': True}, + } + + _attribute_map = { + 'azure_subscription_id': {'key': 'azureSubscriptionId', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + 'account_name': {'key': 'accountName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureAccountInfoObject, self).__init__(**kwargs) + self.azure_subscription_id = kwargs.get('azure_subscription_id', None) + self.resource_group = kwargs.get('resource_group', None) + self.account_name = kwargs.get('account_name', None) + + +class BatchLabelExample(Model): + """Response when adding a batch of labeled example utterances. + + :param value: + :type value: + ~azure.cognitiveservices.language.luis.authoring.models.LabelExampleResponse + :param has_error: + :type has_error: bool + :param error: + :type error: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'LabelExampleResponse'}, + 'has_error': {'key': 'hasError', 'type': 'bool'}, + 'error': {'key': 'error', 'type': 'OperationStatus'}, + } + + def __init__(self, **kwargs): + super(BatchLabelExample, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.has_error = kwargs.get('has_error', None) + self.error = kwargs.get('error', None) + + +class ChildEntity(Model): + """The base child entity type. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID (GUID) belonging to a child entity. + :type id: str + :param name: The name of a child entity. + :type name: str + :param instance_of: Instance of Model. + :type instance_of: str + :param type_id: The type ID of the Entity Model. + :type type_id: int + :param readable_type: Possible values include: 'Entity Extractor', 'Child + Entity Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child + Entity Extractor', 'Composite Entity Extractor', 'List Entity Extractor', + 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity + Extractor', 'Closed List Entity Extractor', 'Regex Entity Extractor' + :type readable_type: str or + ~azure.cognitiveservices.language.luis.authoring.models.enum + :param children: List of children + :type children: + list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntity] + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'instance_of': {'key': 'instanceOf', 'type': 'str'}, + 'type_id': {'key': 'typeId', 'type': 'int'}, + 'readable_type': {'key': 'readableType', 'type': 'str'}, + 'children': {'key': 'children', 'type': '[ChildEntity]'}, + } + + def __init__(self, **kwargs): + super(ChildEntity, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.instance_of = kwargs.get('instance_of', None) + self.type_id = kwargs.get('type_id', None) + self.readable_type = kwargs.get('readable_type', None) + self.children = kwargs.get('children', None) + + +class ChildEntityModelCreateObject(Model): + """A child entity extractor create object. + + :param children: Child entities. + :type children: + list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntityModelCreateObject] + :param name: Entity name. + :type name: str + :param instance_of: The instance of model name + :type instance_of: str + """ + + _attribute_map = { + 'children': {'key': 'children', 'type': '[ChildEntityModelCreateObject]'}, + 'name': {'key': 'name', 'type': 'str'}, + 'instance_of': {'key': 'instanceOf', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ChildEntityModelCreateObject, self).__init__(**kwargs) + self.children = kwargs.get('children', None) + self.name = kwargs.get('name', None) + self.instance_of = kwargs.get('instance_of', None) + + +class ClosedList(Model): + """Exported Model - A list entity. + + :param name: Name of the list entity. + :type name: str + :param sub_lists: Sublists for the list entity. + :type sub_lists: + list[~azure.cognitiveservices.language.luis.authoring.models.SubClosedList] + :param roles: + :type roles: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'sub_lists': {'key': 'subLists', 'type': '[SubClosedList]'}, + 'roles': {'key': 'roles', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ClosedList, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.sub_lists = kwargs.get('sub_lists', None) + self.roles = kwargs.get('roles', None) + + +class ClosedListEntityExtractor(Model): + """List Entity Extractor. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID of the Entity Model. + :type id: str + :param name: Name of the Entity Model. + :type name: str + :param type_id: The type ID of the Entity Model. + :type type_id: int + :param readable_type: Required. Possible values include: 'Entity + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' + :type readable_type: str or + ~azure.cognitiveservices.language.luis.authoring.models.enum + :param roles: + :type roles: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] + :param sub_lists: List of sublists. + :type sub_lists: + list[~azure.cognitiveservices.language.luis.authoring.models.SubClosedListResponse] + """ + + _validation = { + 'id': {'required': True}, + 'readable_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type_id': {'key': 'typeId', 'type': 'int'}, + 'readable_type': {'key': 'readableType', 'type': 'str'}, + 'roles': {'key': 'roles', 'type': '[EntityRole]'}, + 'sub_lists': {'key': 'subLists', 'type': '[SubClosedListResponse]'}, + } + + def __init__(self, **kwargs): + super(ClosedListEntityExtractor, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.type_id = kwargs.get('type_id', None) + self.readable_type = kwargs.get('readable_type', None) + self.roles = kwargs.get('roles', None) + self.sub_lists = kwargs.get('sub_lists', None) + + +class ClosedListModelCreateObject(Model): + """Object model for creating a list entity. + + :param sub_lists: Sublists for the feature. + :type sub_lists: + list[~azure.cognitiveservices.language.luis.authoring.models.WordListObject] + :param name: Name of the list entity. + :type name: str + """ + + _attribute_map = { + 'sub_lists': {'key': 'subLists', 'type': '[WordListObject]'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ClosedListModelCreateObject, self).__init__(**kwargs) + self.sub_lists = kwargs.get('sub_lists', None) + self.name = kwargs.get('name', None) + + +class ClosedListModelPatchObject(Model): + """Object model for adding a batch of sublists to an existing list entity. + + :param sub_lists: Sublists to add. + :type sub_lists: + list[~azure.cognitiveservices.language.luis.authoring.models.WordListObject] + """ + + _attribute_map = { + 'sub_lists': {'key': 'subLists', 'type': '[WordListObject]'}, + } + + def __init__(self, **kwargs): + super(ClosedListModelPatchObject, self).__init__(**kwargs) + self.sub_lists = kwargs.get('sub_lists', None) + + +class ClosedListModelUpdateObject(Model): + """Object model for updating a list entity. + + :param sub_lists: The new sublists for the feature. + :type sub_lists: + list[~azure.cognitiveservices.language.luis.authoring.models.WordListObject] + :param name: The new name of the list entity. + :type name: str + """ + + _attribute_map = { + 'sub_lists': {'key': 'subLists', 'type': '[WordListObject]'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ClosedListModelUpdateObject, self).__init__(**kwargs) + self.sub_lists = kwargs.get('sub_lists', None) + self.name = kwargs.get('name', None) + + +class CollaboratorsArray(Model): + """CollaboratorsArray. + + :param emails: The email address of the users. + :type emails: list[str] + """ + + _attribute_map = { + 'emails': {'key': 'emails', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(CollaboratorsArray, self).__init__(**kwargs) + self.emails = kwargs.get('emails', None) + + +class CompositeChildModelCreateObject(Model): + """CompositeChildModelCreateObject. + + :param name: + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CompositeChildModelCreateObject, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class CompositeEntityExtractor(Model): + """A Composite Entity Extractor. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID of the Entity Model. + :type id: str + :param name: Name of the Entity Model. + :type name: str + :param type_id: The type ID of the Entity Model. + :type type_id: int + :param readable_type: Required. Possible values include: 'Entity + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' + :type readable_type: str or + ~azure.cognitiveservices.language.luis.authoring.models.enum + :param roles: + :type roles: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] + :param children: List of child entities. + :type children: + list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntity] + """ + + _validation = { + 'id': {'required': True}, + 'readable_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type_id': {'key': 'typeId', 'type': 'int'}, + 'readable_type': {'key': 'readableType', 'type': 'str'}, + 'roles': {'key': 'roles', 'type': '[EntityRole]'}, + 'children': {'key': 'children', 'type': '[ChildEntity]'}, + } + + def __init__(self, **kwargs): + super(CompositeEntityExtractor, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.type_id = kwargs.get('type_id', None) + self.readable_type = kwargs.get('readable_type', None) + self.roles = kwargs.get('roles', None) + self.children = kwargs.get('children', None) + + +class CompositeEntityModel(Model): + """A composite entity extractor. + + :param children: Child entities. + :type children: list[str] + :param name: Entity name. + :type name: str + """ + + _attribute_map = { + 'children': {'key': 'children', 'type': '[str]'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CompositeEntityModel, self).__init__(**kwargs) + self.children = kwargs.get('children', None) + self.name = kwargs.get('name', None) + + +class CustomPrebuiltModel(Model): + """A Custom Prebuilt model. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID of the Entity Model. + :type id: str + :param name: Name of the Entity Model. + :type name: str + :param type_id: The type ID of the Entity Model. + :type type_id: int + :param readable_type: Required. Possible values include: 'Entity + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' + :type readable_type: str or + ~azure.cognitiveservices.language.luis.authoring.models.enum + :param custom_prebuilt_domain_name: The domain name. + :type custom_prebuilt_domain_name: str + :param custom_prebuilt_model_name: The intent name or entity name. + :type custom_prebuilt_model_name: str + :param roles: + :type roles: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] + """ + + _validation = { + 'id': {'required': True}, + 'readable_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type_id': {'key': 'typeId', 'type': 'int'}, + 'readable_type': {'key': 'readableType', 'type': 'str'}, + 'custom_prebuilt_domain_name': {'key': 'customPrebuiltDomainName', 'type': 'str'}, + 'custom_prebuilt_model_name': {'key': 'customPrebuiltModelName', 'type': 'str'}, + 'roles': {'key': 'roles', 'type': '[EntityRole]'}, + } + + def __init__(self, **kwargs): + super(CustomPrebuiltModel, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.type_id = kwargs.get('type_id', None) + self.readable_type = kwargs.get('readable_type', None) + self.custom_prebuilt_domain_name = kwargs.get('custom_prebuilt_domain_name', None) + self.custom_prebuilt_model_name = kwargs.get('custom_prebuilt_model_name', None) + self.roles = kwargs.get('roles', None) + + +class EndpointInfo(Model): + """The base class "ProductionOrStagingEndpointInfo" inherits from. + + :param version_id: The version ID to publish. + :type version_id: str + :param is_staging: Indicates if the staging slot should be used, instead + of the Production one. + :type is_staging: bool + :param endpoint_url: The Runtime endpoint URL for this model version. + :type endpoint_url: str + :param region: The target region that the application is published to. + :type region: str + :param assigned_endpoint_key: The endpoint key. + :type assigned_endpoint_key: str + :param endpoint_region: The endpoint's region. + :type endpoint_region: str + :param failed_regions: Regions where publishing failed. + :type failed_regions: str + :param published_date_time: Timestamp when was last published. + :type published_date_time: str + """ + + _attribute_map = { + 'version_id': {'key': 'versionId', 'type': 'str'}, + 'is_staging': {'key': 'isStaging', 'type': 'bool'}, + 'endpoint_url': {'key': 'endpointUrl', 'type': 'str'}, + 'region': {'key': 'region', 'type': 'str'}, + 'assigned_endpoint_key': {'key': 'assignedEndpointKey', 'type': 'str'}, + 'endpoint_region': {'key': 'endpointRegion', 'type': 'str'}, + 'failed_regions': {'key': 'failedRegions', 'type': 'str'}, + 'published_date_time': {'key': 'publishedDateTime', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EndpointInfo, self).__init__(**kwargs) + self.version_id = kwargs.get('version_id', None) + self.is_staging = kwargs.get('is_staging', None) + self.endpoint_url = kwargs.get('endpoint_url', None) + self.region = kwargs.get('region', None) + self.assigned_endpoint_key = kwargs.get('assigned_endpoint_key', None) + self.endpoint_region = kwargs.get('endpoint_region', None) + self.failed_regions = kwargs.get('failed_regions', None) + self.published_date_time = kwargs.get('published_date_time', None) + + +class EnqueueTrainingResponse(Model): + """Response model when requesting to train the model. + + :param status_id: The train request status ID. + :type status_id: int + :param status: Possible values include: 'Queued', 'InProgress', + 'UpToDate', 'Fail', 'Success' + :type status: str or + ~azure.cognitiveservices.language.luis.authoring.models.enum + """ + + _attribute_map = { + 'status_id': {'key': 'statusId', 'type': 'int'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EnqueueTrainingResponse, self).__init__(**kwargs) + self.status_id = kwargs.get('status_id', None) + self.status = kwargs.get('status', None) + + +class EntitiesSuggestionExample(Model): + """Predicted/suggested entity. + + :param text: The utterance. For example, "What's the weather like in + seattle?" + :type text: str + :param tokenized_text: The utterance tokenized. + :type tokenized_text: list[str] + :param intent_predictions: Predicted/suggested intents. + :type intent_predictions: + list[~azure.cognitiveservices.language.luis.authoring.models.IntentPrediction] + :param entity_predictions: Predicted/suggested entities. + :type entity_predictions: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityPrediction] + """ + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'}, + 'tokenized_text': {'key': 'tokenizedText', 'type': '[str]'}, + 'intent_predictions': {'key': 'intentPredictions', 'type': '[IntentPrediction]'}, + 'entity_predictions': {'key': 'entityPredictions', 'type': '[EntityPrediction]'}, + } + + def __init__(self, **kwargs): + super(EntitiesSuggestionExample, self).__init__(**kwargs) + self.text = kwargs.get('text', None) + self.tokenized_text = kwargs.get('tokenized_text', None) + self.intent_predictions = kwargs.get('intent_predictions', None) + self.entity_predictions = kwargs.get('entity_predictions', None) + + +class EntityExtractor(Model): + """Entity Extractor. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID of the Entity Model. + :type id: str + :param name: Name of the Entity Model. + :type name: str + :param type_id: The type ID of the Entity Model. + :type type_id: int + :param readable_type: Required. Possible values include: 'Entity + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' + :type readable_type: str or + ~azure.cognitiveservices.language.luis.authoring.models.enum + :param roles: + :type roles: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] + :param custom_prebuilt_domain_name: The domain name. + :type custom_prebuilt_domain_name: str + :param custom_prebuilt_model_name: The intent name or entity name. + :type custom_prebuilt_model_name: str + """ + + _validation = { + 'id': {'required': True}, + 'readable_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type_id': {'key': 'typeId', 'type': 'int'}, + 'readable_type': {'key': 'readableType', 'type': 'str'}, + 'roles': {'key': 'roles', 'type': '[EntityRole]'}, + 'custom_prebuilt_domain_name': {'key': 'customPrebuiltDomainName', 'type': 'str'}, + 'custom_prebuilt_model_name': {'key': 'customPrebuiltModelName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EntityExtractor, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.type_id = kwargs.get('type_id', None) + self.readable_type = kwargs.get('readable_type', None) + self.roles = kwargs.get('roles', None) + self.custom_prebuilt_domain_name = kwargs.get('custom_prebuilt_domain_name', None) + self.custom_prebuilt_model_name = kwargs.get('custom_prebuilt_model_name', None) + + +class EntityLabel(Model): + """Defines the entity type and position of the extracted entity within the + example. + + All required parameters must be populated in order to send to Azure. + + :param entity_name: Required. The entity type. + :type entity_name: str + :param start_token_index: Required. The index within the utterance where + the extracted entity starts. + :type start_token_index: int + :param end_token_index: Required. The index within the utterance where the + extracted entity ends. + :type end_token_index: int + :param role: The role of the predicted entity. + :type role: str + :param role_id: The role id for the predicted entity. + :type role_id: str + :param children: + :type children: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityLabel] + """ + + _validation = { + 'entity_name': {'required': True}, + 'start_token_index': {'required': True}, + 'end_token_index': {'required': True}, + } + + _attribute_map = { + 'entity_name': {'key': 'entityName', 'type': 'str'}, + 'start_token_index': {'key': 'startTokenIndex', 'type': 'int'}, + 'end_token_index': {'key': 'endTokenIndex', 'type': 'int'}, + 'role': {'key': 'role', 'type': 'str'}, + 'role_id': {'key': 'roleId', 'type': 'str'}, + 'children': {'key': 'children', 'type': '[EntityLabel]'}, + } + + def __init__(self, **kwargs): + super(EntityLabel, self).__init__(**kwargs) + self.entity_name = kwargs.get('entity_name', None) + self.start_token_index = kwargs.get('start_token_index', None) + self.end_token_index = kwargs.get('end_token_index', None) + self.role = kwargs.get('role', None) + self.role_id = kwargs.get('role_id', None) + self.children = kwargs.get('children', None) + + +class EntityLabelObject(Model): + """Defines the entity type and position of the extracted entity within the + example. + + All required parameters must be populated in order to send to Azure. + + :param entity_name: Required. The entity type. + :type entity_name: str + :param start_char_index: Required. The index within the utterance where + the extracted entity starts. + :type start_char_index: int + :param end_char_index: Required. The index within the utterance where the + extracted entity ends. + :type end_char_index: int + :param role: The role the entity plays in the utterance. + :type role: str + :param children: The identified entities within the example utterance. + :type children: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityLabelObject] + """ + + _validation = { + 'entity_name': {'required': True}, + 'start_char_index': {'required': True}, + 'end_char_index': {'required': True}, + } + + _attribute_map = { + 'entity_name': {'key': 'entityName', 'type': 'str'}, + 'start_char_index': {'key': 'startCharIndex', 'type': 'int'}, + 'end_char_index': {'key': 'endCharIndex', 'type': 'int'}, + 'role': {'key': 'role', 'type': 'str'}, + 'children': {'key': 'children', 'type': '[EntityLabelObject]'}, + } + + def __init__(self, **kwargs): + super(EntityLabelObject, self).__init__(**kwargs) + self.entity_name = kwargs.get('entity_name', None) + self.start_char_index = kwargs.get('start_char_index', None) + self.end_char_index = kwargs.get('end_char_index', None) + self.role = kwargs.get('role', None) + self.children = kwargs.get('children', None) + + +class EntityModelCreateObject(Model): + """An entity extractor create object. + + :param children: Child entities. + :type children: + list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntityModelCreateObject] + :param name: Entity name. + :type name: str + """ + + _attribute_map = { + 'children': {'key': 'children', 'type': '[ChildEntityModelCreateObject]'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EntityModelCreateObject, self).__init__(**kwargs) + self.children = kwargs.get('children', None) + self.name = kwargs.get('name', None) + + +class ModelInfo(Model): + """Base type used in entity types. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID of the Entity Model. + :type id: str + :param name: Name of the Entity Model. + :type name: str + :param type_id: The type ID of the Entity Model. + :type type_id: int + :param readable_type: Required. Possible values include: 'Entity + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' + :type readable_type: str or + ~azure.cognitiveservices.language.luis.authoring.models.enum + """ + + _validation = { + 'id': {'required': True}, + 'readable_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type_id': {'key': 'typeId', 'type': 'int'}, + 'readable_type': {'key': 'readableType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ModelInfo, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.type_id = kwargs.get('type_id', None) + self.readable_type = kwargs.get('readable_type', None) + + +class EntityModelInfo(ModelInfo): + """An Entity Extractor model info. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID of the Entity Model. + :type id: str + :param name: Name of the Entity Model. + :type name: str + :param type_id: The type ID of the Entity Model. + :type type_id: int + :param readable_type: Required. Possible values include: 'Entity + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' + :type readable_type: str or + ~azure.cognitiveservices.language.luis.authoring.models.enum + :param roles: + :type roles: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] + """ + + _validation = { + 'id': {'required': True}, + 'readable_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type_id': {'key': 'typeId', 'type': 'int'}, + 'readable_type': {'key': 'readableType', 'type': 'str'}, + 'roles': {'key': 'roles', 'type': '[EntityRole]'}, + } + + def __init__(self, **kwargs): + super(EntityModelInfo, self).__init__(**kwargs) + self.roles = kwargs.get('roles', None) + + +class EntityModelUpdateObject(Model): + """An entity extractor update object. + + :param name: Entity name. + :type name: str + :param instance_of: The instance of model name + :type instance_of: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'instance_of': {'key': 'instanceOf', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EntityModelUpdateObject, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.instance_of = kwargs.get('instance_of', None) + + +class EntityPrediction(Model): + """A suggested entity. + + All required parameters must be populated in order to send to Azure. + + :param entity_name: Required. The entity's name + :type entity_name: str + :param start_token_index: Required. The index within the utterance where + the extracted entity starts. + :type start_token_index: int + :param end_token_index: Required. The index within the utterance where the + extracted entity ends. + :type end_token_index: int + :param phrase: Required. The actual token(s) that comprise the entity. + :type phrase: str + :param children: + :type children: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityPrediction] + """ + + _validation = { + 'entity_name': {'required': True}, + 'start_token_index': {'required': True}, + 'end_token_index': {'required': True}, + 'phrase': {'required': True}, + } + + _attribute_map = { + 'entity_name': {'key': 'entityName', 'type': 'str'}, + 'start_token_index': {'key': 'startTokenIndex', 'type': 'int'}, + 'end_token_index': {'key': 'endTokenIndex', 'type': 'int'}, + 'phrase': {'key': 'phrase', 'type': 'str'}, + 'children': {'key': 'children', 'type': '[EntityPrediction]'}, + } + + def __init__(self, **kwargs): + super(EntityPrediction, self).__init__(**kwargs) + self.entity_name = kwargs.get('entity_name', None) + self.start_token_index = kwargs.get('start_token_index', None) + self.end_token_index = kwargs.get('end_token_index', None) + self.phrase = kwargs.get('phrase', None) + self.children = kwargs.get('children', None) + + +class EntityRole(Model): + """Entity extractor role. + + :param id: The entity role ID. + :type id: str + :param name: The entity role name. + :type name: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EntityRole, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + + +class EntityRoleCreateObject(Model): + """Object model for creating an entity role. + + :param name: The entity role name. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EntityRoleCreateObject, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class EntityRoleUpdateObject(Model): + """Object model for updating an entity role. + + :param name: The entity role name. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EntityRoleUpdateObject, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class ErrorResponse(Model): + """Error response when invoking an operation on the API. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :param error_type: + :type error_type: str + """ + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'error_type': {'key': 'errorType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.additional_properties = kwargs.get('additional_properties', None) + self.error_type = kwargs.get('error_type', None) + + +class ErrorResponseException(HttpOperationError): + """Server responded with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class ExampleLabelObject(Model): + """A labeled example utterance. + + :param text: The example utterance. + :type text: str + :param entity_labels: The identified entities within the example + utterance. + :type entity_labels: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityLabelObject] + :param intent_name: The identified intent representing the example + utterance. + :type intent_name: str + """ + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'}, + 'entity_labels': {'key': 'entityLabels', 'type': '[EntityLabelObject]'}, + 'intent_name': {'key': 'intentName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ExampleLabelObject, self).__init__(**kwargs) + self.text = kwargs.get('text', None) + self.entity_labels = kwargs.get('entity_labels', None) + self.intent_name = kwargs.get('intent_name', None) + + +class ExplicitListItem(Model): + """Explicit (exception) list item. + + :param id: The explicit list item ID. + :type id: long + :param explicit_list_item: The explicit list item value. + :type explicit_list_item: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'long'}, + 'explicit_list_item': {'key': 'explicitListItem', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ExplicitListItem, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.explicit_list_item = kwargs.get('explicit_list_item', None) + + +class ExplicitListItemCreateObject(Model): + """Object model for creating an explicit (exception) list item. + + :param explicit_list_item: The explicit list item. + :type explicit_list_item: str + """ + + _attribute_map = { + 'explicit_list_item': {'key': 'explicitListItem', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ExplicitListItemCreateObject, self).__init__(**kwargs) + self.explicit_list_item = kwargs.get('explicit_list_item', None) + + +class ExplicitListItemUpdateObject(Model): + """Model object for updating an explicit (exception) list item. + + :param explicit_list_item: The explicit list item. + :type explicit_list_item: str + """ + + _attribute_map = { + 'explicit_list_item': {'key': 'explicitListItem', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ExplicitListItemUpdateObject, self).__init__(**kwargs) + self.explicit_list_item = kwargs.get('explicit_list_item', None) + + +class FeatureInfoObject(Model): + """The base class Features-related response objects inherit from. + + :param id: A six-digit ID used for Features. + :type id: int + :param name: The name of the Feature. + :type name: str + :param is_active: Indicates if the feature is enabled. + :type is_active: bool + :param enabled_for_all_models: Indicates if the feature is enabled for all + models in the application. + :type enabled_for_all_models: bool + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'is_active': {'key': 'isActive', 'type': 'bool'}, + 'enabled_for_all_models': {'key': 'enabledForAllModels', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(FeatureInfoObject, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.is_active = kwargs.get('is_active', None) + self.enabled_for_all_models = kwargs.get('enabled_for_all_models', None) + + +class FeaturesResponseObject(Model): + """Model Features, including Patterns and Phraselists. + + :param phraselist_features: + :type phraselist_features: + list[~azure.cognitiveservices.language.luis.authoring.models.PhraseListFeatureInfo] + :param pattern_features: + :type pattern_features: + list[~azure.cognitiveservices.language.luis.authoring.models.PatternFeatureInfo] + """ + + _attribute_map = { + 'phraselist_features': {'key': 'phraselistFeatures', 'type': '[PhraseListFeatureInfo]'}, + 'pattern_features': {'key': 'patternFeatures', 'type': '[PatternFeatureInfo]'}, + } + + def __init__(self, **kwargs): + super(FeaturesResponseObject, self).__init__(**kwargs) + self.phraselist_features = kwargs.get('phraselist_features', None) + self.pattern_features = kwargs.get('pattern_features', None) + + +class HierarchicalChildEntity(ChildEntity): + """A Hierarchical Child Entity. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID (GUID) belonging to a child entity. + :type id: str + :param name: The name of a child entity. + :type name: str + :param instance_of: Instance of Model. + :type instance_of: str + :param type_id: The type ID of the Entity Model. + :type type_id: int + :param readable_type: Possible values include: 'Entity Extractor', 'Child + Entity Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child + Entity Extractor', 'Composite Entity Extractor', 'List Entity Extractor', + 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity + Extractor', 'Closed List Entity Extractor', 'Regex Entity Extractor' + :type readable_type: str or + ~azure.cognitiveservices.language.luis.authoring.models.enum + :param children: List of children + :type children: + list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntity] + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'instance_of': {'key': 'instanceOf', 'type': 'str'}, + 'type_id': {'key': 'typeId', 'type': 'int'}, + 'readable_type': {'key': 'readableType', 'type': 'str'}, + 'children': {'key': 'children', 'type': '[ChildEntity]'}, + } + + def __init__(self, **kwargs): + super(HierarchicalChildEntity, self).__init__(**kwargs) + + +class HierarchicalChildModelUpdateObject(Model): + """HierarchicalChildModelUpdateObject. + + :param name: + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(HierarchicalChildModelUpdateObject, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class HierarchicalEntityExtractor(Model): + """Hierarchical Entity Extractor. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID of the Entity Model. + :type id: str + :param name: Name of the Entity Model. + :type name: str + :param type_id: The type ID of the Entity Model. + :type type_id: int + :param readable_type: Required. Possible values include: 'Entity + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' + :type readable_type: str or + ~azure.cognitiveservices.language.luis.authoring.models.enum + :param roles: + :type roles: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] + :param children: List of child entities. + :type children: + list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntity] + """ + + _validation = { + 'id': {'required': True}, + 'readable_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type_id': {'key': 'typeId', 'type': 'int'}, + 'readable_type': {'key': 'readableType', 'type': 'str'}, + 'roles': {'key': 'roles', 'type': '[EntityRole]'}, + 'children': {'key': 'children', 'type': '[ChildEntity]'}, + } + + def __init__(self, **kwargs): + super(HierarchicalEntityExtractor, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.type_id = kwargs.get('type_id', None) + self.readable_type = kwargs.get('readable_type', None) + self.roles = kwargs.get('roles', None) + self.children = kwargs.get('children', None) + + +class HierarchicalModel(Model): + """HierarchicalModel. + + :param name: + :type name: str + :param children: + :type children: + list[~azure.cognitiveservices.language.luis.authoring.models.JsonChild] + :param features: + :type features: + list[~azure.cognitiveservices.language.luis.authoring.models.JsonModelFeatureInformation] + :param roles: + :type roles: list[str] + :param inherits: + :type inherits: + ~azure.cognitiveservices.language.luis.authoring.models.PrebuiltDomainObject + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'children': {'key': 'children', 'type': '[JsonChild]'}, + 'features': {'key': 'features', 'type': '[JsonModelFeatureInformation]'}, + 'roles': {'key': 'roles', 'type': '[str]'}, + 'inherits': {'key': 'inherits', 'type': 'PrebuiltDomainObject'}, + } + + def __init__(self, **kwargs): + super(HierarchicalModel, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.children = kwargs.get('children', None) + self.features = kwargs.get('features', None) + self.roles = kwargs.get('roles', None) + self.inherits = kwargs.get('inherits', None) + + +class HierarchicalModelV2(Model): + """HierarchicalModelV2. + + :param name: + :type name: str + :param children: + :type children: list[str] + :param inherits: + :type inherits: + ~azure.cognitiveservices.language.luis.authoring.models.PrebuiltDomainObject + :param roles: + :type roles: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'children': {'key': 'children', 'type': '[str]'}, + 'inherits': {'key': 'inherits', 'type': 'PrebuiltDomainObject'}, + 'roles': {'key': 'roles', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(HierarchicalModelV2, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.children = kwargs.get('children', None) + self.inherits = kwargs.get('inherits', None) + self.roles = kwargs.get('roles', None) + + +class IntentClassifier(ModelInfo): + """Intent Classifier. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID of the Entity Model. + :type id: str + :param name: Name of the Entity Model. + :type name: str + :param type_id: The type ID of the Entity Model. + :type type_id: int + :param readable_type: Required. Possible values include: 'Entity + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' + :type readable_type: str or + ~azure.cognitiveservices.language.luis.authoring.models.enum + :param custom_prebuilt_domain_name: The domain name. + :type custom_prebuilt_domain_name: str + :param custom_prebuilt_model_name: The intent name or entity name. + :type custom_prebuilt_model_name: str + """ + + _validation = { + 'id': {'required': True}, + 'readable_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type_id': {'key': 'typeId', 'type': 'int'}, + 'readable_type': {'key': 'readableType', 'type': 'str'}, + 'custom_prebuilt_domain_name': {'key': 'customPrebuiltDomainName', 'type': 'str'}, + 'custom_prebuilt_model_name': {'key': 'customPrebuiltModelName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IntentClassifier, self).__init__(**kwargs) + self.custom_prebuilt_domain_name = kwargs.get('custom_prebuilt_domain_name', None) + self.custom_prebuilt_model_name = kwargs.get('custom_prebuilt_model_name', None) + + +class IntentPrediction(Model): + """A suggested intent. + + :param name: The intent's name + :type name: str + :param score: The intent's score, based on the prediction model. + :type score: float + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'score': {'key': 'score', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(IntentPrediction, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.score = kwargs.get('score', None) + + +class IntentsSuggestionExample(Model): + """Predicted/suggested intent. + + :param text: The utterance. For example, "What's the weather like in + seattle?" + :type text: str + :param tokenized_text: The tokenized utterance. + :type tokenized_text: list[str] + :param intent_predictions: Predicted/suggested intents. + :type intent_predictions: + list[~azure.cognitiveservices.language.luis.authoring.models.IntentPrediction] + :param entity_predictions: Predicted/suggested entities. + :type entity_predictions: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityPrediction] + """ + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'}, + 'tokenized_text': {'key': 'tokenizedText', 'type': '[str]'}, + 'intent_predictions': {'key': 'intentPredictions', 'type': '[IntentPrediction]'}, + 'entity_predictions': {'key': 'entityPredictions', 'type': '[EntityPrediction]'}, + } + + def __init__(self, **kwargs): + super(IntentsSuggestionExample, self).__init__(**kwargs) + self.text = kwargs.get('text', None) + self.tokenized_text = kwargs.get('tokenized_text', None) + self.intent_predictions = kwargs.get('intent_predictions', None) + self.entity_predictions = kwargs.get('entity_predictions', None) + + +class JsonChild(Model): + """JsonChild. + + :param name: + :type name: str + :param instance_of: + :type instance_of: str + :param children: + :type children: + list[~azure.cognitiveservices.language.luis.authoring.models.JsonChild] + :param features: + :type features: + list[~azure.cognitiveservices.language.luis.authoring.models.JsonModelFeatureInformation] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'instance_of': {'key': 'instanceOf', 'type': 'str'}, + 'children': {'key': 'children', 'type': '[JsonChild]'}, + 'features': {'key': 'features', 'type': '[JsonModelFeatureInformation]'}, + } + + def __init__(self, **kwargs): + super(JsonChild, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.instance_of = kwargs.get('instance_of', None) + self.children = kwargs.get('children', None) + self.features = kwargs.get('features', None) + + +class JSONEntity(Model): + """Exported Model - Extracted Entity from utterance. + + All required parameters must be populated in order to send to Azure. + + :param start_pos: Required. The index within the utterance where the + extracted entity starts. + :type start_pos: int + :param end_pos: Required. The index within the utterance where the + extracted entity ends. + :type end_pos: int + :param entity: Required. The entity name. + :type entity: str + :param role: The role the entity plays in the utterance. + :type role: str + :param children: + :type children: + list[~azure.cognitiveservices.language.luis.authoring.models.JSONEntity] + """ + + _validation = { + 'start_pos': {'required': True}, + 'end_pos': {'required': True}, + 'entity': {'required': True}, + } + + _attribute_map = { + 'start_pos': {'key': 'startPos', 'type': 'int'}, + 'end_pos': {'key': 'endPos', 'type': 'int'}, + 'entity': {'key': 'entity', 'type': 'str'}, + 'role': {'key': 'role', 'type': 'str'}, + 'children': {'key': 'children', 'type': '[JSONEntity]'}, + } + + def __init__(self, **kwargs): + super(JSONEntity, self).__init__(**kwargs) + self.start_pos = kwargs.get('start_pos', None) + self.end_pos = kwargs.get('end_pos', None) + self.entity = kwargs.get('entity', None) + self.role = kwargs.get('role', None) + self.children = kwargs.get('children', None) + + +class JSONModelFeature(Model): + """Exported Model - Phraselist Model Feature. + + :param activated: Indicates if the feature is enabled. + :type activated: bool + :param name: The Phraselist name. + :type name: str + :param words: List of comma-separated phrases that represent the + Phraselist. + :type words: str + :param mode: An interchangeable phrase list feature serves as a list of + synonyms for training. A non-exchangeable phrase list serves as separate + features for training. So, if your non-interchangeable phrase list + contains 5 phrases, they will be mapped to 5 separate features. You can + think of the non-interchangeable phrase list as an additional bag of words + to add to LUIS existing vocabulary features. It is used as a lexicon + lookup feature where its value is 1 if the lexicon contains a given word + or 0 if it doesn’t. Default value is true. + :type mode: bool + :param enabled_for_all_models: Indicates if the Phraselist is enabled for + all models in the application. Default value: True . + :type enabled_for_all_models: bool + """ + + _attribute_map = { + 'activated': {'key': 'activated', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'words': {'key': 'words', 'type': 'str'}, + 'mode': {'key': 'mode', 'type': 'bool'}, + 'enabled_for_all_models': {'key': 'enabledForAllModels', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(JSONModelFeature, self).__init__(**kwargs) + self.activated = kwargs.get('activated', None) + self.name = kwargs.get('name', None) + self.words = kwargs.get('words', None) + self.mode = kwargs.get('mode', None) + self.enabled_for_all_models = kwargs.get('enabled_for_all_models', True) + + +class JsonModelFeatureInformation(Model): + """An object containing the model feature information either the model name or + feature name. + + :param model_name: The name of the model used. + :type model_name: str + :param feature_name: The name of the feature used. + :type feature_name: str + """ + + _attribute_map = { + 'model_name': {'key': 'modelName', 'type': 'str'}, + 'feature_name': {'key': 'featureName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(JsonModelFeatureInformation, self).__init__(**kwargs) + self.model_name = kwargs.get('model_name', None) + self.feature_name = kwargs.get('feature_name', None) + + +class JSONRegexFeature(Model): + """Exported Model - A Pattern feature. + + :param pattern: The Regular Expression to match. + :type pattern: str + :param activated: Indicates if the Pattern feature is enabled. + :type activated: bool + :param name: Name of the feature. + :type name: str + """ + + _attribute_map = { + 'pattern': {'key': 'pattern', 'type': 'str'}, + 'activated': {'key': 'activated', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(JSONRegexFeature, self).__init__(**kwargs) + self.pattern = kwargs.get('pattern', None) + self.activated = kwargs.get('activated', None) + self.name = kwargs.get('name', None) + + +class JSONUtterance(Model): + """Exported Model - Utterance that was used to train the model. + + :param text: The utterance. + :type text: str + :param intent: The matched intent. + :type intent: str + :param entities: The matched entities. + :type entities: + list[~azure.cognitiveservices.language.luis.authoring.models.JSONEntity] + """ + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'}, + 'intent': {'key': 'intent', 'type': 'str'}, + 'entities': {'key': 'entities', 'type': '[JSONEntity]'}, + } + + def __init__(self, **kwargs): + super(JSONUtterance, self).__init__(**kwargs) + self.text = kwargs.get('text', None) + self.intent = kwargs.get('intent', None) + self.entities = kwargs.get('entities', None) + + +class LabeledUtterance(Model): + """A prediction and label pair of an example. + + :param id: ID of Labeled Utterance. + :type id: int + :param text: The utterance. For example, "What's the weather like in + seattle?" + :type text: str + :param tokenized_text: The utterance tokenized. + :type tokenized_text: list[str] + :param intent_label: The intent matching the example. + :type intent_label: str + :param entity_labels: The entities matching the example. + :type entity_labels: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityLabel] + :param intent_predictions: List of suggested intents. + :type intent_predictions: + list[~azure.cognitiveservices.language.luis.authoring.models.IntentPrediction] + :param entity_predictions: List of suggested entities. + :type entity_predictions: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityPrediction] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'text': {'key': 'text', 'type': 'str'}, + 'tokenized_text': {'key': 'tokenizedText', 'type': '[str]'}, + 'intent_label': {'key': 'intentLabel', 'type': 'str'}, + 'entity_labels': {'key': 'entityLabels', 'type': '[EntityLabel]'}, + 'intent_predictions': {'key': 'intentPredictions', 'type': '[IntentPrediction]'}, + 'entity_predictions': {'key': 'entityPredictions', 'type': '[EntityPrediction]'}, + } + + def __init__(self, **kwargs): + super(LabeledUtterance, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.text = kwargs.get('text', None) + self.tokenized_text = kwargs.get('tokenized_text', None) + self.intent_label = kwargs.get('intent_label', None) + self.entity_labels = kwargs.get('entity_labels', None) + self.intent_predictions = kwargs.get('intent_predictions', None) + self.entity_predictions = kwargs.get('entity_predictions', None) + + +class LabelExampleResponse(Model): + """Response when adding a labeled example utterance. + + :param utterance_text: The example utterance. + :type utterance_text: str + :param example_id: The newly created sample ID. + :type example_id: int + """ + + _attribute_map = { + 'utterance_text': {'key': 'UtteranceText', 'type': 'str'}, + 'example_id': {'key': 'ExampleId', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(LabelExampleResponse, self).__init__(**kwargs) + self.utterance_text = kwargs.get('utterance_text', None) + self.example_id = kwargs.get('example_id', None) + + +class LabelTextObject(Model): + """An object containing the example utterance's text. + + :param id: The ID of the Label. + :type id: int + :param text: The text of the label. + :type text: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'text': {'key': 'text', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LabelTextObject, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.text = kwargs.get('text', None) + + +class LuisApp(Model): + """Exported Model - An exported LUIS Application. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :param name: The name of the application. + :type name: str + :param version_id: The version ID of the application that was exported. + :type version_id: str + :param desc: The description of the application. + :type desc: str + :param culture: The culture of the application. E.g.: en-us. + :type culture: str + :param intents: List of intents. + :type intents: + list[~azure.cognitiveservices.language.luis.authoring.models.HierarchicalModel] + :param entities: List of entities. + :type entities: + list[~azure.cognitiveservices.language.luis.authoring.models.HierarchicalModel] + :param closed_lists: List of list entities. + :type closed_lists: + list[~azure.cognitiveservices.language.luis.authoring.models.ClosedList] + :param composites: List of composite entities. + :type composites: + list[~azure.cognitiveservices.language.luis.authoring.models.HierarchicalModel] + :param hierarchicals: List of hierarchical entities. + :type hierarchicals: + list[~azure.cognitiveservices.language.luis.authoring.models.HierarchicalModel] + :param pattern_any_entities: List of Pattern.Any entities. + :type pattern_any_entities: + list[~azure.cognitiveservices.language.luis.authoring.models.PatternAny] + :param regex_entities: List of regular expression entities. + :type regex_entities: + list[~azure.cognitiveservices.language.luis.authoring.models.RegexEntity] + :param prebuilt_entities: List of prebuilt entities. + :type prebuilt_entities: + list[~azure.cognitiveservices.language.luis.authoring.models.PrebuiltEntity] + :param regex_features: List of pattern features. + :type regex_features: + list[~azure.cognitiveservices.language.luis.authoring.models.JSONRegexFeature] + :param phraselists: List of model features. + :type phraselists: + list[~azure.cognitiveservices.language.luis.authoring.models.JSONModelFeature] + :param patterns: List of patterns. + :type patterns: + list[~azure.cognitiveservices.language.luis.authoring.models.PatternRule] + :param utterances: List of example utterances. + :type utterances: + list[~azure.cognitiveservices.language.luis.authoring.models.JSONUtterance] + """ + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'name': {'key': 'name', 'type': 'str'}, + 'version_id': {'key': 'versionId', 'type': 'str'}, + 'desc': {'key': 'desc', 'type': 'str'}, + 'culture': {'key': 'culture', 'type': 'str'}, + 'intents': {'key': 'intents', 'type': '[HierarchicalModel]'}, + 'entities': {'key': 'entities', 'type': '[HierarchicalModel]'}, + 'closed_lists': {'key': 'closedLists', 'type': '[ClosedList]'}, + 'composites': {'key': 'composites', 'type': '[HierarchicalModel]'}, + 'hierarchicals': {'key': 'hierarchicals', 'type': '[HierarchicalModel]'}, + 'pattern_any_entities': {'key': 'patternAnyEntities', 'type': '[PatternAny]'}, + 'regex_entities': {'key': 'regex_entities', 'type': '[RegexEntity]'}, + 'prebuilt_entities': {'key': 'prebuiltEntities', 'type': '[PrebuiltEntity]'}, + 'regex_features': {'key': 'regex_features', 'type': '[JSONRegexFeature]'}, + 'phraselists': {'key': 'phraselists', 'type': '[JSONModelFeature]'}, + 'patterns': {'key': 'patterns', 'type': '[PatternRule]'}, + 'utterances': {'key': 'utterances', 'type': '[JSONUtterance]'}, + } + + def __init__(self, **kwargs): + super(LuisApp, self).__init__(**kwargs) + self.additional_properties = kwargs.get('additional_properties', None) + self.name = kwargs.get('name', None) + self.version_id = kwargs.get('version_id', None) + self.desc = kwargs.get('desc', None) + self.culture = kwargs.get('culture', None) + self.intents = kwargs.get('intents', None) + self.entities = kwargs.get('entities', None) + self.closed_lists = kwargs.get('closed_lists', None) + self.composites = kwargs.get('composites', None) + self.hierarchicals = kwargs.get('hierarchicals', None) + self.pattern_any_entities = kwargs.get('pattern_any_entities', None) + self.regex_entities = kwargs.get('regex_entities', None) + self.prebuilt_entities = kwargs.get('prebuilt_entities', None) + self.regex_features = kwargs.get('regex_features', None) + self.phraselists = kwargs.get('phraselists', None) + self.patterns = kwargs.get('patterns', None) + self.utterances = kwargs.get('utterances', None) + + +class LuisAppV2(Model): + """Exported Model - An exported LUIS Application. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :param luis_schema_version: Luis schema deserialization version. + :type luis_schema_version: str + :param name: The name of the application. + :type name: str + :param version_id: The version ID of the application that was exported. + :type version_id: str + :param desc: The description of the application. + :type desc: str + :param culture: The culture of the application. E.g.: en-us. + :type culture: str + :param intents: List of intents. + :type intents: + list[~azure.cognitiveservices.language.luis.authoring.models.HierarchicalModelV2] + :param entities: List of entities. + :type entities: + list[~azure.cognitiveservices.language.luis.authoring.models.HierarchicalModelV2] + :param closed_lists: List of list entities. + :type closed_lists: + list[~azure.cognitiveservices.language.luis.authoring.models.ClosedList] + :param composites: List of composite entities. + :type composites: + list[~azure.cognitiveservices.language.luis.authoring.models.HierarchicalModelV2] + :param pattern_any_entities: List of Pattern.Any entities. + :type pattern_any_entities: + list[~azure.cognitiveservices.language.luis.authoring.models.PatternAny] + :param regex_entities: List of regular expression entities. + :type regex_entities: + list[~azure.cognitiveservices.language.luis.authoring.models.RegexEntity] + :param prebuilt_entities: List of prebuilt entities. + :type prebuilt_entities: + list[~azure.cognitiveservices.language.luis.authoring.models.PrebuiltEntity] + :param regex_features: List of pattern features. + :type regex_features: + list[~azure.cognitiveservices.language.luis.authoring.models.JSONRegexFeature] + :param model_features: List of model features. + :type model_features: + list[~azure.cognitiveservices.language.luis.authoring.models.JSONModelFeature] + :param patterns: List of patterns. + :type patterns: + list[~azure.cognitiveservices.language.luis.authoring.models.PatternRule] + :param utterances: List of example utterances. + :type utterances: + list[~azure.cognitiveservices.language.luis.authoring.models.JSONUtterance] + """ + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'luis_schema_version': {'key': 'luis_schema_version', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'version_id': {'key': 'versionId', 'type': 'str'}, + 'desc': {'key': 'desc', 'type': 'str'}, + 'culture': {'key': 'culture', 'type': 'str'}, + 'intents': {'key': 'intents', 'type': '[HierarchicalModelV2]'}, + 'entities': {'key': 'entities', 'type': '[HierarchicalModelV2]'}, + 'closed_lists': {'key': 'closedLists', 'type': '[ClosedList]'}, + 'composites': {'key': 'composites', 'type': '[HierarchicalModelV2]'}, + 'pattern_any_entities': {'key': 'patternAnyEntities', 'type': '[PatternAny]'}, + 'regex_entities': {'key': 'regex_entities', 'type': '[RegexEntity]'}, + 'prebuilt_entities': {'key': 'prebuiltEntities', 'type': '[PrebuiltEntity]'}, + 'regex_features': {'key': 'regex_features', 'type': '[JSONRegexFeature]'}, + 'model_features': {'key': 'model_features', 'type': '[JSONModelFeature]'}, + 'patterns': {'key': 'patterns', 'type': '[PatternRule]'}, + 'utterances': {'key': 'utterances', 'type': '[JSONUtterance]'}, + } + + def __init__(self, **kwargs): + super(LuisAppV2, self).__init__(**kwargs) + self.additional_properties = kwargs.get('additional_properties', None) + self.luis_schema_version = kwargs.get('luis_schema_version', None) + self.name = kwargs.get('name', None) + self.version_id = kwargs.get('version_id', None) + self.desc = kwargs.get('desc', None) + self.culture = kwargs.get('culture', None) + self.intents = kwargs.get('intents', None) + self.entities = kwargs.get('entities', None) + self.closed_lists = kwargs.get('closed_lists', None) + self.composites = kwargs.get('composites', None) + self.pattern_any_entities = kwargs.get('pattern_any_entities', None) + self.regex_entities = kwargs.get('regex_entities', None) + self.prebuilt_entities = kwargs.get('prebuilt_entities', None) + self.regex_features = kwargs.get('regex_features', None) + self.model_features = kwargs.get('model_features', None) + self.patterns = kwargs.get('patterns', None) + self.utterances = kwargs.get('utterances', None) + + +class ModelCreateObject(Model): + """Object model for creating a new entity extractor. + + :param name: Name of the new entity extractor. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ModelCreateObject, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class ModelFeatureInformation(Model): + """An object containing the model feature information either the model name or + feature name. + + :param model_name: The name of the model used. + :type model_name: str + :param feature_name: The name of the feature used. + :type feature_name: str + :param is_required: + :type is_required: bool + """ + + _attribute_map = { + 'model_name': {'key': 'modelName', 'type': 'str'}, + 'feature_name': {'key': 'featureName', 'type': 'str'}, + 'is_required': {'key': 'isRequired', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ModelFeatureInformation, self).__init__(**kwargs) + self.model_name = kwargs.get('model_name', None) + self.feature_name = kwargs.get('feature_name', None) + self.is_required = kwargs.get('is_required', None) + + +class ModelInfoResponse(Model): + """An application model info. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID of the Entity Model. + :type id: str + :param name: Name of the Entity Model. + :type name: str + :param type_id: The type ID of the Entity Model. + :type type_id: int + :param readable_type: Required. Possible values include: 'Entity + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' + :type readable_type: str or + ~azure.cognitiveservices.language.luis.authoring.models.enum + :param roles: + :type roles: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] + :param children: List of child entities. + :type children: + list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntity] + :param sub_lists: List of sublists. + :type sub_lists: + list[~azure.cognitiveservices.language.luis.authoring.models.SubClosedListResponse] + :param custom_prebuilt_domain_name: The domain name. + :type custom_prebuilt_domain_name: str + :param custom_prebuilt_model_name: The intent name or entity name. + :type custom_prebuilt_model_name: str + :param regex_pattern: The Regular Expression entity pattern. + :type regex_pattern: str + :param explicit_list: + :type explicit_list: + list[~azure.cognitiveservices.language.luis.authoring.models.ExplicitListItem] + """ + + _validation = { + 'id': {'required': True}, + 'readable_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type_id': {'key': 'typeId', 'type': 'int'}, + 'readable_type': {'key': 'readableType', 'type': 'str'}, + 'roles': {'key': 'roles', 'type': '[EntityRole]'}, + 'children': {'key': 'children', 'type': '[ChildEntity]'}, + 'sub_lists': {'key': 'subLists', 'type': '[SubClosedListResponse]'}, + 'custom_prebuilt_domain_name': {'key': 'customPrebuiltDomainName', 'type': 'str'}, + 'custom_prebuilt_model_name': {'key': 'customPrebuiltModelName', 'type': 'str'}, + 'regex_pattern': {'key': 'regexPattern', 'type': 'str'}, + 'explicit_list': {'key': 'explicitList', 'type': '[ExplicitListItem]'}, + } + + def __init__(self, **kwargs): + super(ModelInfoResponse, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.type_id = kwargs.get('type_id', None) + self.readable_type = kwargs.get('readable_type', None) + self.roles = kwargs.get('roles', None) + self.children = kwargs.get('children', None) + self.sub_lists = kwargs.get('sub_lists', None) + self.custom_prebuilt_domain_name = kwargs.get('custom_prebuilt_domain_name', None) + self.custom_prebuilt_model_name = kwargs.get('custom_prebuilt_model_name', None) + self.regex_pattern = kwargs.get('regex_pattern', None) + self.explicit_list = kwargs.get('explicit_list', None) + + +class ModelTrainingDetails(Model): + """Model Training Details. + + :param status_id: The train request status ID. + :type status_id: int + :param status: Possible values include: 'Queued', 'InProgress', + 'UpToDate', 'Fail', 'Success' + :type status: str or + ~azure.cognitiveservices.language.luis.authoring.models.enum + :param example_count: The count of examples used to train the model. + :type example_count: int + :param training_date_time: When the model was trained. + :type training_date_time: datetime + :param failure_reason: Reason for the training failure. + :type failure_reason: str + """ + + _attribute_map = { + 'status_id': {'key': 'statusId', 'type': 'int'}, + 'status': {'key': 'status', 'type': 'str'}, + 'example_count': {'key': 'exampleCount', 'type': 'int'}, + 'training_date_time': {'key': 'trainingDateTime', 'type': 'iso-8601'}, + 'failure_reason': {'key': 'failureReason', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ModelTrainingDetails, self).__init__(**kwargs) + self.status_id = kwargs.get('status_id', None) + self.status = kwargs.get('status', None) + self.example_count = kwargs.get('example_count', None) + self.training_date_time = kwargs.get('training_date_time', None) + self.failure_reason = kwargs.get('failure_reason', None) + + +class ModelTrainingInfo(Model): + """Model Training Info. + + :param model_id: The ID (GUID) of the model. + :type model_id: str + :param details: + :type details: + ~azure.cognitiveservices.language.luis.authoring.models.ModelTrainingDetails + """ + + _attribute_map = { + 'model_id': {'key': 'modelId', 'type': 'str'}, + 'details': {'key': 'details', 'type': 'ModelTrainingDetails'}, + } + + def __init__(self, **kwargs): + super(ModelTrainingInfo, self).__init__(**kwargs) + self.model_id = kwargs.get('model_id', None) + self.details = kwargs.get('details', None) + + +class ModelUpdateObject(Model): + """Object model for updating an intent classifier. + + :param name: The entity's new name. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ModelUpdateObject, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class NDepthEntityExtractor(Model): + """N-Depth Entity Extractor. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID of the Entity Model. + :type id: str + :param name: Name of the Entity Model. + :type name: str + :param type_id: The type ID of the Entity Model. + :type type_id: int + :param readable_type: Required. Possible values include: 'Entity + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' + :type readable_type: str or + ~azure.cognitiveservices.language.luis.authoring.models.enum + :param roles: + :type roles: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] + :param custom_prebuilt_domain_name: The domain name. + :type custom_prebuilt_domain_name: str + :param custom_prebuilt_model_name: The intent name or entity name. + :type custom_prebuilt_model_name: str + :param children: + :type children: + list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntity] + """ + + _validation = { + 'id': {'required': True}, + 'readable_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type_id': {'key': 'typeId', 'type': 'int'}, + 'readable_type': {'key': 'readableType', 'type': 'str'}, + 'roles': {'key': 'roles', 'type': '[EntityRole]'}, + 'custom_prebuilt_domain_name': {'key': 'customPrebuiltDomainName', 'type': 'str'}, + 'custom_prebuilt_model_name': {'key': 'customPrebuiltModelName', 'type': 'str'}, + 'children': {'key': 'children', 'type': '[ChildEntity]'}, + } + + def __init__(self, **kwargs): + super(NDepthEntityExtractor, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.type_id = kwargs.get('type_id', None) + self.readable_type = kwargs.get('readable_type', None) + self.roles = kwargs.get('roles', None) + self.custom_prebuilt_domain_name = kwargs.get('custom_prebuilt_domain_name', None) + self.custom_prebuilt_model_name = kwargs.get('custom_prebuilt_model_name', None) + self.children = kwargs.get('children', None) + + +class OperationError(Model): + """Operation error details when invoking an operation on the API. + + :param code: + :type code: str + :param message: + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class OperationStatus(Model): + """Response of an Operation status. + + :param code: Status Code. Possible values include: 'Failed', 'FAILED', + 'Success' + :type code: str or + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatusType + :param message: Status details. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationStatus, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class PatternAny(Model): + """Pattern.Any Entity Extractor. + + :param name: + :type name: str + :param explicit_list: + :type explicit_list: list[str] + :param roles: + :type roles: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'explicit_list': {'key': 'explicitList', 'type': '[str]'}, + 'roles': {'key': 'roles', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(PatternAny, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.explicit_list = kwargs.get('explicit_list', None) + self.roles = kwargs.get('roles', None) + + +class PatternAnyEntityExtractor(Model): + """Pattern.Any Entity Extractor. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID of the Entity Model. + :type id: str + :param name: Name of the Entity Model. + :type name: str + :param type_id: The type ID of the Entity Model. + :type type_id: int + :param readable_type: Required. Possible values include: 'Entity + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' + :type readable_type: str or + ~azure.cognitiveservices.language.luis.authoring.models.enum + :param roles: + :type roles: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] + :param explicit_list: + :type explicit_list: + list[~azure.cognitiveservices.language.luis.authoring.models.ExplicitListItem] + """ + + _validation = { + 'id': {'required': True}, + 'readable_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type_id': {'key': 'typeId', 'type': 'int'}, + 'readable_type': {'key': 'readableType', 'type': 'str'}, + 'roles': {'key': 'roles', 'type': '[EntityRole]'}, + 'explicit_list': {'key': 'explicitList', 'type': '[ExplicitListItem]'}, + } + + def __init__(self, **kwargs): + super(PatternAnyEntityExtractor, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.type_id = kwargs.get('type_id', None) + self.readable_type = kwargs.get('readable_type', None) + self.roles = kwargs.get('roles', None) + self.explicit_list = kwargs.get('explicit_list', None) + + +class PatternAnyModelCreateObject(Model): + """Model object for creating a Pattern.Any entity model. + + :param name: The model name. + :type name: str + :param explicit_list: The Pattern.Any explicit list. + :type explicit_list: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'explicit_list': {'key': 'explicitList', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(PatternAnyModelCreateObject, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.explicit_list = kwargs.get('explicit_list', None) + + +class PatternAnyModelUpdateObject(Model): + """Model object for updating a Pattern.Any entity model. + + :param name: The model name. + :type name: str + :param explicit_list: The Pattern.Any explicit list. + :type explicit_list: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'explicit_list': {'key': 'explicitList', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(PatternAnyModelUpdateObject, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.explicit_list = kwargs.get('explicit_list', None) + + +class PatternFeatureInfo(FeatureInfoObject): + """Pattern feature. + + :param id: A six-digit ID used for Features. + :type id: int + :param name: The name of the Feature. + :type name: str + :param is_active: Indicates if the feature is enabled. + :type is_active: bool + :param enabled_for_all_models: Indicates if the feature is enabled for all + models in the application. + :type enabled_for_all_models: bool + :param pattern: The Regular Expression to match. + :type pattern: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'is_active': {'key': 'isActive', 'type': 'bool'}, + 'enabled_for_all_models': {'key': 'enabledForAllModels', 'type': 'bool'}, + 'pattern': {'key': 'pattern', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PatternFeatureInfo, self).__init__(**kwargs) + self.pattern = kwargs.get('pattern', None) + + +class PatternRule(Model): + """Pattern. + + :param pattern: The pattern text. + :type pattern: str + :param intent: The intent's name where the pattern belongs to. + :type intent: str + """ + + _attribute_map = { + 'pattern': {'key': 'pattern', 'type': 'str'}, + 'intent': {'key': 'intent', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PatternRule, self).__init__(**kwargs) + self.pattern = kwargs.get('pattern', None) + self.intent = kwargs.get('intent', None) + + +class PatternRuleCreateObject(Model): + """Object model for creating a pattern. + + :param pattern: The pattern text. + :type pattern: str + :param intent: The intent's name which the pattern belongs to. + :type intent: str + """ + + _attribute_map = { + 'pattern': {'key': 'pattern', 'type': 'str'}, + 'intent': {'key': 'intent', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PatternRuleCreateObject, self).__init__(**kwargs) + self.pattern = kwargs.get('pattern', None) + self.intent = kwargs.get('intent', None) + + +class PatternRuleInfo(Model): + """Pattern rule. + + :param id: The pattern ID. + :type id: str + :param pattern: The pattern text. + :type pattern: str + :param intent: The intent's name where the pattern belongs to. + :type intent: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'pattern': {'key': 'pattern', 'type': 'str'}, + 'intent': {'key': 'intent', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PatternRuleInfo, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.pattern = kwargs.get('pattern', None) + self.intent = kwargs.get('intent', None) + + +class PatternRuleUpdateObject(Model): + """Object model for updating a pattern. + + :param id: The pattern ID. + :type id: str + :param pattern: The pattern text. + :type pattern: str + :param intent: The intent's name which the pattern belongs to. + :type intent: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'pattern': {'key': 'pattern', 'type': 'str'}, + 'intent': {'key': 'intent', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PatternRuleUpdateObject, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.pattern = kwargs.get('pattern', None) + self.intent = kwargs.get('intent', None) + + +class PersonalAssistantsResponse(Model): + """Response containing user's endpoint keys and the endpoint URLs of the + prebuilt Cortana applications. + + :param endpoint_keys: + :type endpoint_keys: list[str] + :param endpoint_urls: + :type endpoint_urls: dict[str, str] + """ + + _attribute_map = { + 'endpoint_keys': {'key': 'endpointKeys', 'type': '[str]'}, + 'endpoint_urls': {'key': 'endpointUrls', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(PersonalAssistantsResponse, self).__init__(**kwargs) + self.endpoint_keys = kwargs.get('endpoint_keys', None) + self.endpoint_urls = kwargs.get('endpoint_urls', None) + + +class PhraselistCreateObject(Model): + """Object model for creating a phraselist model. + + :param phrases: List of comma-separated phrases that represent the + Phraselist. + :type phrases: str + :param name: The Phraselist name. + :type name: str + :param is_exchangeable: An interchangeable phrase list feature serves as a + list of synonyms for training. A non-exchangeable phrase list serves as + separate features for training. So, if your non-interchangeable phrase + list contains 5 phrases, they will be mapped to 5 separate features. You + can think of the non-interchangeable phrase list as an additional bag of + words to add to LUIS existing vocabulary features. It is used as a lexicon + lookup feature where its value is 1 if the lexicon contains a given word + or 0 if it doesn’t. Default value is true. Default value: True . + :type is_exchangeable: bool + :param enabled_for_all_models: Indicates if the Phraselist is enabled for + all models in the application. Default value: True . + :type enabled_for_all_models: bool + """ + + _attribute_map = { + 'phrases': {'key': 'phrases', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'is_exchangeable': {'key': 'isExchangeable', 'type': 'bool'}, + 'enabled_for_all_models': {'key': 'enabledForAllModels', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(PhraselistCreateObject, self).__init__(**kwargs) + self.phrases = kwargs.get('phrases', None) + self.name = kwargs.get('name', None) + self.is_exchangeable = kwargs.get('is_exchangeable', True) + self.enabled_for_all_models = kwargs.get('enabled_for_all_models', True) + + +class PhraseListFeatureInfo(FeatureInfoObject): + """Phraselist Feature. + + :param id: A six-digit ID used for Features. + :type id: int + :param name: The name of the Feature. + :type name: str + :param is_active: Indicates if the feature is enabled. + :type is_active: bool + :param enabled_for_all_models: Indicates if the feature is enabled for all + models in the application. + :type enabled_for_all_models: bool + :param phrases: A list of comma-separated values. + :type phrases: str + :param is_exchangeable: An exchangeable phrase list feature are serves as + single feature to the LUIS underlying training algorithm. It is used as a + lexicon lookup feature where its value is 1 if the lexicon contains a + given word or 0 if it doesn’t. Think of an exchangeable as a synonyms + list. A non-exchangeable phrase list feature has all the phrases in the + list serve as separate features to the underlying training algorithm. So, + if you your phrase list feature contains 5 phrases, they will be mapped to + 5 separate features. You can think of the non-exchangeable phrase list + feature as an additional bag of words that you are willing to add to LUIS + existing vocabulary features. Think of a non-exchangeable as set of + different words. Default value is true. + :type is_exchangeable: bool + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'is_active': {'key': 'isActive', 'type': 'bool'}, + 'enabled_for_all_models': {'key': 'enabledForAllModels', 'type': 'bool'}, + 'phrases': {'key': 'phrases', 'type': 'str'}, + 'is_exchangeable': {'key': 'isExchangeable', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(PhraseListFeatureInfo, self).__init__(**kwargs) + self.phrases = kwargs.get('phrases', None) + self.is_exchangeable = kwargs.get('is_exchangeable', None) + + +class PhraselistUpdateObject(Model): + """Object model for updating a Phraselist. + + :param phrases: List of comma-separated phrases that represent the + Phraselist. + :type phrases: str + :param name: The Phraselist name. + :type name: str + :param is_active: Indicates if the Phraselist is enabled. Default value: + True . + :type is_active: bool + :param is_exchangeable: An exchangeable phrase list feature are serves as + single feature to the LUIS underlying training algorithm. It is used as a + lexicon lookup feature where its value is 1 if the lexicon contains a + given word or 0 if it doesn’t. Think of an exchangeable as a synonyms + list. A non-exchangeable phrase list feature has all the phrases in the + list serve as separate features to the underlying training algorithm. So, + if you your phrase list feature contains 5 phrases, they will be mapped to + 5 separate features. You can think of the non-exchangeable phrase list + feature as an additional bag of words that you are willing to add to LUIS + existing vocabulary features. Think of a non-exchangeable as set of + different words. Default value is true. Default value: True . + :type is_exchangeable: bool + :param enabled_for_all_models: Indicates if the Phraselist is enabled for + all models in the application. Default value: True . + :type enabled_for_all_models: bool + """ + + _attribute_map = { + 'phrases': {'key': 'phrases', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'is_active': {'key': 'isActive', 'type': 'bool'}, + 'is_exchangeable': {'key': 'isExchangeable', 'type': 'bool'}, + 'enabled_for_all_models': {'key': 'enabledForAllModels', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(PhraselistUpdateObject, self).__init__(**kwargs) + self.phrases = kwargs.get('phrases', None) + self.name = kwargs.get('name', None) + self.is_active = kwargs.get('is_active', True) + self.is_exchangeable = kwargs.get('is_exchangeable', True) + self.enabled_for_all_models = kwargs.get('enabled_for_all_models', True) + + +class PrebuiltDomain(Model): + """Prebuilt Domain. + + :param name: + :type name: str + :param culture: + :type culture: str + :param description: + :type description: str + :param examples: + :type examples: str + :param intents: + :type intents: + list[~azure.cognitiveservices.language.luis.authoring.models.PrebuiltDomainItem] + :param entities: + :type entities: + list[~azure.cognitiveservices.language.luis.authoring.models.PrebuiltDomainItem] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'culture': {'key': 'culture', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'examples': {'key': 'examples', 'type': 'str'}, + 'intents': {'key': 'intents', 'type': '[PrebuiltDomainItem]'}, + 'entities': {'key': 'entities', 'type': '[PrebuiltDomainItem]'}, + } + + def __init__(self, **kwargs): + super(PrebuiltDomain, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.culture = kwargs.get('culture', None) + self.description = kwargs.get('description', None) + self.examples = kwargs.get('examples', None) + self.intents = kwargs.get('intents', None) + self.entities = kwargs.get('entities', None) + + +class PrebuiltDomainCreateBaseObject(Model): + """A model object containing the name of the custom prebuilt entity and the + name of the domain to which this model belongs. + + :param domain_name: The domain name. + :type domain_name: str + """ + + _attribute_map = { + 'domain_name': {'key': 'domainName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrebuiltDomainCreateBaseObject, self).__init__(**kwargs) + self.domain_name = kwargs.get('domain_name', None) + + +class PrebuiltDomainCreateObject(Model): + """A prebuilt domain create object containing the name and culture of the + domain. + + :param domain_name: The domain name. + :type domain_name: str + :param culture: The culture of the new domain. + :type culture: str + """ + + _attribute_map = { + 'domain_name': {'key': 'domainName', 'type': 'str'}, + 'culture': {'key': 'culture', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrebuiltDomainCreateObject, self).__init__(**kwargs) + self.domain_name = kwargs.get('domain_name', None) + self.culture = kwargs.get('culture', None) + + +class PrebuiltDomainItem(Model): + """PrebuiltDomainItem. + + :param name: + :type name: str + :param description: + :type description: str + :param examples: + :type examples: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'examples': {'key': 'examples', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrebuiltDomainItem, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.description = kwargs.get('description', None) + self.examples = kwargs.get('examples', None) + + +class PrebuiltDomainModelCreateObject(Model): + """A model object containing the name of the custom prebuilt intent or entity + and the name of the domain to which this model belongs. + + :param domain_name: The domain name. + :type domain_name: str + :param model_name: The intent name or entity name. + :type model_name: str + """ + + _attribute_map = { + 'domain_name': {'key': 'domainName', 'type': 'str'}, + 'model_name': {'key': 'modelName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrebuiltDomainModelCreateObject, self).__init__(**kwargs) + self.domain_name = kwargs.get('domain_name', None) + self.model_name = kwargs.get('model_name', None) + + +class PrebuiltDomainObject(Model): + """PrebuiltDomainObject. + + :param domain_name: + :type domain_name: str + :param model_name: + :type model_name: str + """ + + _attribute_map = { + 'domain_name': {'key': 'domain_name', 'type': 'str'}, + 'model_name': {'key': 'model_name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrebuiltDomainObject, self).__init__(**kwargs) + self.domain_name = kwargs.get('domain_name', None) + self.model_name = kwargs.get('model_name', None) + + +class PrebuiltEntity(Model): + """Prebuilt Entity Extractor. + + :param name: + :type name: str + :param roles: + :type roles: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'roles': {'key': 'roles', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(PrebuiltEntity, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.roles = kwargs.get('roles', None) + + +class PrebuiltEntityExtractor(Model): + """Prebuilt Entity Extractor. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID of the Entity Model. + :type id: str + :param name: Name of the Entity Model. + :type name: str + :param type_id: The type ID of the Entity Model. + :type type_id: int + :param readable_type: Required. Possible values include: 'Entity + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' + :type readable_type: str or + ~azure.cognitiveservices.language.luis.authoring.models.enum + :param roles: + :type roles: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] + """ + + _validation = { + 'id': {'required': True}, + 'readable_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type_id': {'key': 'typeId', 'type': 'int'}, + 'readable_type': {'key': 'readableType', 'type': 'str'}, + 'roles': {'key': 'roles', 'type': '[EntityRole]'}, + } + + def __init__(self, **kwargs): + super(PrebuiltEntityExtractor, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.type_id = kwargs.get('type_id', None) + self.readable_type = kwargs.get('readable_type', None) + self.roles = kwargs.get('roles', None) + + +class ProductionOrStagingEndpointInfo(EndpointInfo): + """ProductionOrStagingEndpointInfo. + + :param version_id: The version ID to publish. + :type version_id: str + :param is_staging: Indicates if the staging slot should be used, instead + of the Production one. + :type is_staging: bool + :param endpoint_url: The Runtime endpoint URL for this model version. + :type endpoint_url: str + :param region: The target region that the application is published to. + :type region: str + :param assigned_endpoint_key: The endpoint key. + :type assigned_endpoint_key: str + :param endpoint_region: The endpoint's region. + :type endpoint_region: str + :param failed_regions: Regions where publishing failed. + :type failed_regions: str + :param published_date_time: Timestamp when was last published. + :type published_date_time: str + """ + + _attribute_map = { + 'version_id': {'key': 'versionId', 'type': 'str'}, + 'is_staging': {'key': 'isStaging', 'type': 'bool'}, + 'endpoint_url': {'key': 'endpointUrl', 'type': 'str'}, + 'region': {'key': 'region', 'type': 'str'}, + 'assigned_endpoint_key': {'key': 'assignedEndpointKey', 'type': 'str'}, + 'endpoint_region': {'key': 'endpointRegion', 'type': 'str'}, + 'failed_regions': {'key': 'failedRegions', 'type': 'str'}, + 'published_date_time': {'key': 'publishedDateTime', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ProductionOrStagingEndpointInfo, self).__init__(**kwargs) + + +class PublishSettings(Model): + """The application publish settings. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The application ID. + :type id: str + :param is_sentiment_analysis_enabled: Required. Setting sentiment analysis + as true returns the sentiment of the input utterance along with the + response + :type is_sentiment_analysis_enabled: bool + :param is_speech_enabled: Required. Enables speech priming in your app + :type is_speech_enabled: bool + :param is_spell_checker_enabled: Required. Enables spell checking of the + utterance. + :type is_spell_checker_enabled: bool + """ + + _validation = { + 'id': {'required': True}, + 'is_sentiment_analysis_enabled': {'required': True}, + 'is_speech_enabled': {'required': True}, + 'is_spell_checker_enabled': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'is_sentiment_analysis_enabled': {'key': 'sentimentAnalysis', 'type': 'bool'}, + 'is_speech_enabled': {'key': 'speech', 'type': 'bool'}, + 'is_spell_checker_enabled': {'key': 'spellChecker', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(PublishSettings, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.is_sentiment_analysis_enabled = kwargs.get('is_sentiment_analysis_enabled', None) + self.is_speech_enabled = kwargs.get('is_speech_enabled', None) + self.is_spell_checker_enabled = kwargs.get('is_spell_checker_enabled', None) + + +class PublishSettingUpdateObject(Model): + """Object model for updating an application's publish settings. + + :param sentiment_analysis: Setting sentiment analysis as true returns the + Sentiment of the input utterance along with the response + :type sentiment_analysis: bool + :param speech: Setting speech as public enables speech priming in your app + :type speech: bool + :param spell_checker: Setting spell checker as public enables spell + checking the input utterance. + :type spell_checker: bool + """ + + _attribute_map = { + 'sentiment_analysis': {'key': 'sentimentAnalysis', 'type': 'bool'}, + 'speech': {'key': 'speech', 'type': 'bool'}, + 'spell_checker': {'key': 'spellChecker', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(PublishSettingUpdateObject, self).__init__(**kwargs) + self.sentiment_analysis = kwargs.get('sentiment_analysis', None) + self.speech = kwargs.get('speech', None) + self.spell_checker = kwargs.get('spell_checker', None) + + +class RegexEntity(Model): + """Regular Expression Entity Extractor. + + :param name: + :type name: str + :param regex_pattern: + :type regex_pattern: str + :param roles: + :type roles: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'regex_pattern': {'key': 'regexPattern', 'type': 'str'}, + 'roles': {'key': 'roles', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(RegexEntity, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.regex_pattern = kwargs.get('regex_pattern', None) + self.roles = kwargs.get('roles', None) + + +class RegexEntityExtractor(Model): + """Regular Expression Entity Extractor. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID of the Entity Model. + :type id: str + :param name: Name of the Entity Model. + :type name: str + :param type_id: The type ID of the Entity Model. + :type type_id: int + :param readable_type: Required. Possible values include: 'Entity + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' + :type readable_type: str or + ~azure.cognitiveservices.language.luis.authoring.models.enum + :param roles: + :type roles: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] + :param regex_pattern: The Regular Expression entity pattern. + :type regex_pattern: str + """ + + _validation = { + 'id': {'required': True}, + 'readable_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type_id': {'key': 'typeId', 'type': 'int'}, + 'readable_type': {'key': 'readableType', 'type': 'str'}, + 'roles': {'key': 'roles', 'type': '[EntityRole]'}, + 'regex_pattern': {'key': 'regexPattern', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RegexEntityExtractor, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.type_id = kwargs.get('type_id', None) + self.readable_type = kwargs.get('readable_type', None) + self.roles = kwargs.get('roles', None) + self.regex_pattern = kwargs.get('regex_pattern', None) + + +class RegexModelCreateObject(Model): + """Model object for creating a regular expression entity model. + + :param regex_pattern: The regular expression entity pattern. + :type regex_pattern: str + :param name: The model name. + :type name: str + """ + + _attribute_map = { + 'regex_pattern': {'key': 'regexPattern', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RegexModelCreateObject, self).__init__(**kwargs) + self.regex_pattern = kwargs.get('regex_pattern', None) + self.name = kwargs.get('name', None) + + +class RegexModelUpdateObject(Model): + """Model object for updating a regular expression entity model. + + :param regex_pattern: The regular expression entity pattern. + :type regex_pattern: str + :param name: The model name. + :type name: str + """ + + _attribute_map = { + 'regex_pattern': {'key': 'regexPattern', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RegexModelUpdateObject, self).__init__(**kwargs) + self.regex_pattern = kwargs.get('regex_pattern', None) + self.name = kwargs.get('name', None) + + +class SubClosedList(Model): + """Sublist of items for a list entity. + + :param canonical_form: The standard form that the list represents. + :type canonical_form: str + :param list: List of synonym words. + :type list: list[str] + """ + + _attribute_map = { + 'canonical_form': {'key': 'canonicalForm', 'type': 'str'}, + 'list': {'key': 'list', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(SubClosedList, self).__init__(**kwargs) + self.canonical_form = kwargs.get('canonical_form', None) + self.list = kwargs.get('list', None) + + +class SubClosedListResponse(SubClosedList): + """Sublist of items for a list entity. + + :param canonical_form: The standard form that the list represents. + :type canonical_form: str + :param list: List of synonym words. + :type list: list[str] + :param id: The sublist ID + :type id: int + """ + + _attribute_map = { + 'canonical_form': {'key': 'canonicalForm', 'type': 'str'}, + 'list': {'key': 'list', 'type': '[str]'}, + 'id': {'key': 'id', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(SubClosedListResponse, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class TaskUpdateObject(Model): + """Object model for cloning an application's version. + + :param version: The new version for the cloned model. + :type version: str + """ + + _attribute_map = { + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TaskUpdateObject, self).__init__(**kwargs) + self.version = kwargs.get('version', None) + + +class UserAccessList(Model): + """List of user permissions. + + :param owner: The email address of owner of the application. + :type owner: str + :param emails: + :type emails: list[str] + """ + + _attribute_map = { + 'owner': {'key': 'owner', 'type': 'str'}, + 'emails': {'key': 'emails', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(UserAccessList, self).__init__(**kwargs) + self.owner = kwargs.get('owner', None) + self.emails = kwargs.get('emails', None) + + +class UserCollaborator(Model): + """UserCollaborator. + + :param email: The email address of the user. + :type email: str + """ + + _attribute_map = { + 'email': {'key': 'email', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UserCollaborator, self).__init__(**kwargs) + self.email = kwargs.get('email', None) + + +class VersionInfo(Model): + """Object model of an application version. + + All required parameters must be populated in order to send to Azure. + + :param version: Required. The version ID. E.g.: "0.1" + :type version: str + :param created_date_time: The version's creation timestamp. + :type created_date_time: datetime + :param last_modified_date_time: Timestamp of the last update. + :type last_modified_date_time: datetime + :param last_trained_date_time: Timestamp of the last time the model was + trained. + :type last_trained_date_time: datetime + :param last_published_date_time: Timestamp when was last published. + :type last_published_date_time: datetime + :param endpoint_url: The Runtime endpoint URL for this model version. + :type endpoint_url: str + :param assigned_endpoint_key: The endpoint key. + :type assigned_endpoint_key: dict[str, str] + :param external_api_keys: External keys. + :type external_api_keys: object + :param intents_count: Number of intents in this model. + :type intents_count: int + :param entities_count: Number of entities in this model. + :type entities_count: int + :param endpoint_hits_count: Number of calls made to this endpoint. + :type endpoint_hits_count: int + :param training_status: Required. The current training status. Possible + values include: 'NeedsTraining', 'InProgress', 'Trained' + :type training_status: str or + ~azure.cognitiveservices.language.luis.authoring.models.TrainingStatus + """ + + _validation = { + 'version': {'required': True}, + 'training_status': {'required': True}, + } + + _attribute_map = { + 'version': {'key': 'version', 'type': 'str'}, + 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, + 'last_modified_date_time': {'key': 'lastModifiedDateTime', 'type': 'iso-8601'}, + 'last_trained_date_time': {'key': 'lastTrainedDateTime', 'type': 'iso-8601'}, + 'last_published_date_time': {'key': 'lastPublishedDateTime', 'type': 'iso-8601'}, + 'endpoint_url': {'key': 'endpointUrl', 'type': 'str'}, + 'assigned_endpoint_key': {'key': 'assignedEndpointKey', 'type': '{str}'}, + 'external_api_keys': {'key': 'externalApiKeys', 'type': 'object'}, + 'intents_count': {'key': 'intentsCount', 'type': 'int'}, + 'entities_count': {'key': 'entitiesCount', 'type': 'int'}, + 'endpoint_hits_count': {'key': 'endpointHitsCount', 'type': 'int'}, + 'training_status': {'key': 'trainingStatus', 'type': 'TrainingStatus'}, + } + + def __init__(self, **kwargs): + super(VersionInfo, self).__init__(**kwargs) + self.version = kwargs.get('version', None) + self.created_date_time = kwargs.get('created_date_time', None) + self.last_modified_date_time = kwargs.get('last_modified_date_time', None) + self.last_trained_date_time = kwargs.get('last_trained_date_time', None) + self.last_published_date_time = kwargs.get('last_published_date_time', None) + self.endpoint_url = kwargs.get('endpoint_url', None) + self.assigned_endpoint_key = kwargs.get('assigned_endpoint_key', None) + self.external_api_keys = kwargs.get('external_api_keys', None) + self.intents_count = kwargs.get('intents_count', None) + self.entities_count = kwargs.get('entities_count', None) + self.endpoint_hits_count = kwargs.get('endpoint_hits_count', None) + self.training_status = kwargs.get('training_status', None) + + +class WordListBaseUpdateObject(Model): + """Object model for updating one of the list entity's sublists. + + :param canonical_form: The standard form that the list represents. + :type canonical_form: str + :param list: List of synonym words. + :type list: list[str] + """ + + _attribute_map = { + 'canonical_form': {'key': 'canonicalForm', 'type': 'str'}, + 'list': {'key': 'list', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(WordListBaseUpdateObject, self).__init__(**kwargs) + self.canonical_form = kwargs.get('canonical_form', None) + self.list = kwargs.get('list', None) + + +class WordListObject(Model): + """Sublist of items for a list entity. + + :param canonical_form: The standard form that the list represents. + :type canonical_form: str + :param list: List of synonym words. + :type list: list[str] + """ + + _attribute_map = { + 'canonical_form': {'key': 'canonicalForm', 'type': 'str'}, + 'list': {'key': 'list', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(WordListObject, self).__init__(**kwargs) + self.canonical_form = kwargs.get('canonical_form', None) + self.list = kwargs.get('list', None) diff --git a/src/durabletask/azext_durabletask/vendored_sdks/authoring/models/_models_py3.py b/src/durabletask/azext_durabletask/vendored_sdks/authoring/models/_models_py3.py new file mode 100644 index 00000000000..98cf9a88e87 --- /dev/null +++ b/src/durabletask/azext_durabletask/vendored_sdks/authoring/models/_models_py3.py @@ -0,0 +1,3333 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class ApplicationCreateObject(Model): + """Properties for creating a new LUIS Application. + + All required parameters must be populated in order to send to Azure. + + :param culture: Required. The culture for the new application. It is the + language that your app understands and speaks. E.g.: "en-us". Note: the + culture cannot be changed after the app is created. + :type culture: str + :param domain: The domain for the new application. Optional. E.g.: Comics. + :type domain: str + :param description: Description of the new application. Optional. + :type description: str + :param initial_version_id: The initial version ID. Optional. Default value + is: "0.1" + :type initial_version_id: str + :param usage_scenario: Defines the scenario for the new application. + Optional. E.g.: IoT. + :type usage_scenario: str + :param name: Required. The name for the new application. + :type name: str + """ + + _validation = { + 'culture': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'culture': {'key': 'culture', 'type': 'str'}, + 'domain': {'key': 'domain', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'initial_version_id': {'key': 'initialVersionId', 'type': 'str'}, + 'usage_scenario': {'key': 'usageScenario', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, culture: str, name: str, domain: str=None, description: str=None, initial_version_id: str=None, usage_scenario: str=None, **kwargs) -> None: + super(ApplicationCreateObject, self).__init__(**kwargs) + self.culture = culture + self.domain = domain + self.description = description + self.initial_version_id = initial_version_id + self.usage_scenario = usage_scenario + self.name = name + + +class ApplicationInfoResponse(Model): + """Response containing the Application Info. + + :param id: The ID (GUID) of the application. + :type id: str + :param name: The name of the application. + :type name: str + :param description: The description of the application. + :type description: str + :param culture: The culture of the application. For example, "en-us". + :type culture: str + :param usage_scenario: Defines the scenario for the new application. + Optional. For example, IoT. + :type usage_scenario: str + :param domain: The domain for the new application. Optional. For example, + Comics. + :type domain: str + :param versions_count: Amount of model versions within the application. + :type versions_count: int + :param created_date_time: The version's creation timestamp. + :type created_date_time: str + :param endpoints: The Runtime endpoint URL for this model version. + :type endpoints: object + :param endpoint_hits_count: Number of calls made to this endpoint. + :type endpoint_hits_count: int + :param active_version: The version ID currently marked as active. + :type active_version: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'culture': {'key': 'culture', 'type': 'str'}, + 'usage_scenario': {'key': 'usageScenario', 'type': 'str'}, + 'domain': {'key': 'domain', 'type': 'str'}, + 'versions_count': {'key': 'versionsCount', 'type': 'int'}, + 'created_date_time': {'key': 'createdDateTime', 'type': 'str'}, + 'endpoints': {'key': 'endpoints', 'type': 'object'}, + 'endpoint_hits_count': {'key': 'endpointHitsCount', 'type': 'int'}, + 'active_version': {'key': 'activeVersion', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, name: str=None, description: str=None, culture: str=None, usage_scenario: str=None, domain: str=None, versions_count: int=None, created_date_time: str=None, endpoints=None, endpoint_hits_count: int=None, active_version: str=None, **kwargs) -> None: + super(ApplicationInfoResponse, self).__init__(**kwargs) + self.id = id + self.name = name + self.description = description + self.culture = culture + self.usage_scenario = usage_scenario + self.domain = domain + self.versions_count = versions_count + self.created_date_time = created_date_time + self.endpoints = endpoints + self.endpoint_hits_count = endpoint_hits_count + self.active_version = active_version + + +class ApplicationPublishObject(Model): + """Object model for publishing a specific application version. + + :param version_id: The version ID to publish. + :type version_id: str + :param is_staging: Indicates if the staging slot should be used, instead + of the Production one. Default value: False . + :type is_staging: bool + """ + + _attribute_map = { + 'version_id': {'key': 'versionId', 'type': 'str'}, + 'is_staging': {'key': 'isStaging', 'type': 'bool'}, + } + + def __init__(self, *, version_id: str=None, is_staging: bool=False, **kwargs) -> None: + super(ApplicationPublishObject, self).__init__(**kwargs) + self.version_id = version_id + self.is_staging = is_staging + + +class ApplicationSettings(Model): + """The application settings. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The application ID. + :type id: str + :param is_public: Required. Setting your application as public allows + other people to use your application's endpoint using their own keys for + billing purposes. + :type is_public: bool + """ + + _validation = { + 'id': {'required': True}, + 'is_public': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'is_public': {'key': 'public', 'type': 'bool'}, + } + + def __init__(self, *, id: str, is_public: bool, **kwargs) -> None: + super(ApplicationSettings, self).__init__(**kwargs) + self.id = id + self.is_public = is_public + + +class ApplicationSettingUpdateObject(Model): + """Object model for updating an application's settings. + + :param is_public: Setting your application as public allows other people + to use your application's endpoint using their own keys. + :type is_public: bool + """ + + _attribute_map = { + 'is_public': {'key': 'public', 'type': 'bool'}, + } + + def __init__(self, *, is_public: bool=None, **kwargs) -> None: + super(ApplicationSettingUpdateObject, self).__init__(**kwargs) + self.is_public = is_public + + +class ApplicationUpdateObject(Model): + """Object model for updating the name or description of an application. + + :param name: The application's new name. + :type name: str + :param description: The application's new description. + :type description: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, description: str=None, **kwargs) -> None: + super(ApplicationUpdateObject, self).__init__(**kwargs) + self.name = name + self.description = description + + +class AppVersionSettingObject(Model): + """Object model of an application version setting. + + :param name: The application version setting name. + :type name: str + :param value: The application version setting value. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, value: str=None, **kwargs) -> None: + super(AppVersionSettingObject, self).__init__(**kwargs) + self.name = name + self.value = value + + +class AvailableCulture(Model): + """Available culture for using in a new application. + + :param name: The language name. + :type name: str + :param code: The ISO value for the language. + :type code: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'code': {'key': 'code', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, code: str=None, **kwargs) -> None: + super(AvailableCulture, self).__init__(**kwargs) + self.name = name + self.code = code + + +class AvailablePrebuiltEntityModel(Model): + """Available Prebuilt entity model for using in an application. + + :param name: The entity name. + :type name: str + :param description: The entity description and usage information. + :type description: str + :param examples: Usage examples. + :type examples: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'examples': {'key': 'examples', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, description: str=None, examples: str=None, **kwargs) -> None: + super(AvailablePrebuiltEntityModel, self).__init__(**kwargs) + self.name = name + self.description = description + self.examples = examples + + +class AzureAccountInfoObject(Model): + """Defines the Azure account information object. + + All required parameters must be populated in order to send to Azure. + + :param azure_subscription_id: Required. The id for the Azure subscription. + :type azure_subscription_id: str + :param resource_group: Required. The Azure resource group name. + :type resource_group: str + :param account_name: Required. The Azure account name. + :type account_name: str + """ + + _validation = { + 'azure_subscription_id': {'required': True}, + 'resource_group': {'required': True}, + 'account_name': {'required': True}, + } + + _attribute_map = { + 'azure_subscription_id': {'key': 'azureSubscriptionId', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + 'account_name': {'key': 'accountName', 'type': 'str'}, + } + + def __init__(self, *, azure_subscription_id: str, resource_group: str, account_name: str, **kwargs) -> None: + super(AzureAccountInfoObject, self).__init__(**kwargs) + self.azure_subscription_id = azure_subscription_id + self.resource_group = resource_group + self.account_name = account_name + + +class BatchLabelExample(Model): + """Response when adding a batch of labeled example utterances. + + :param value: + :type value: + ~azure.cognitiveservices.language.luis.authoring.models.LabelExampleResponse + :param has_error: + :type has_error: bool + :param error: + :type error: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'LabelExampleResponse'}, + 'has_error': {'key': 'hasError', 'type': 'bool'}, + 'error': {'key': 'error', 'type': 'OperationStatus'}, + } + + def __init__(self, *, value=None, has_error: bool=None, error=None, **kwargs) -> None: + super(BatchLabelExample, self).__init__(**kwargs) + self.value = value + self.has_error = has_error + self.error = error + + +class ChildEntity(Model): + """The base child entity type. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID (GUID) belonging to a child entity. + :type id: str + :param name: The name of a child entity. + :type name: str + :param instance_of: Instance of Model. + :type instance_of: str + :param type_id: The type ID of the Entity Model. + :type type_id: int + :param readable_type: Possible values include: 'Entity Extractor', 'Child + Entity Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child + Entity Extractor', 'Composite Entity Extractor', 'List Entity Extractor', + 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity + Extractor', 'Closed List Entity Extractor', 'Regex Entity Extractor' + :type readable_type: str or + ~azure.cognitiveservices.language.luis.authoring.models.enum + :param children: List of children + :type children: + list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntity] + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'instance_of': {'key': 'instanceOf', 'type': 'str'}, + 'type_id': {'key': 'typeId', 'type': 'int'}, + 'readable_type': {'key': 'readableType', 'type': 'str'}, + 'children': {'key': 'children', 'type': '[ChildEntity]'}, + } + + def __init__(self, *, id: str, name: str=None, instance_of: str=None, type_id: int=None, readable_type=None, children=None, **kwargs) -> None: + super(ChildEntity, self).__init__(**kwargs) + self.id = id + self.name = name + self.instance_of = instance_of + self.type_id = type_id + self.readable_type = readable_type + self.children = children + + +class ChildEntityModelCreateObject(Model): + """A child entity extractor create object. + + :param children: Child entities. + :type children: + list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntityModelCreateObject] + :param name: Entity name. + :type name: str + :param instance_of: The instance of model name + :type instance_of: str + """ + + _attribute_map = { + 'children': {'key': 'children', 'type': '[ChildEntityModelCreateObject]'}, + 'name': {'key': 'name', 'type': 'str'}, + 'instance_of': {'key': 'instanceOf', 'type': 'str'}, + } + + def __init__(self, *, children=None, name: str=None, instance_of: str=None, **kwargs) -> None: + super(ChildEntityModelCreateObject, self).__init__(**kwargs) + self.children = children + self.name = name + self.instance_of = instance_of + + +class ClosedList(Model): + """Exported Model - A list entity. + + :param name: Name of the list entity. + :type name: str + :param sub_lists: Sublists for the list entity. + :type sub_lists: + list[~azure.cognitiveservices.language.luis.authoring.models.SubClosedList] + :param roles: + :type roles: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'sub_lists': {'key': 'subLists', 'type': '[SubClosedList]'}, + 'roles': {'key': 'roles', 'type': '[str]'}, + } + + def __init__(self, *, name: str=None, sub_lists=None, roles=None, **kwargs) -> None: + super(ClosedList, self).__init__(**kwargs) + self.name = name + self.sub_lists = sub_lists + self.roles = roles + + +class ClosedListEntityExtractor(Model): + """List Entity Extractor. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID of the Entity Model. + :type id: str + :param name: Name of the Entity Model. + :type name: str + :param type_id: The type ID of the Entity Model. + :type type_id: int + :param readable_type: Required. Possible values include: 'Entity + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' + :type readable_type: str or + ~azure.cognitiveservices.language.luis.authoring.models.enum + :param roles: + :type roles: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] + :param sub_lists: List of sublists. + :type sub_lists: + list[~azure.cognitiveservices.language.luis.authoring.models.SubClosedListResponse] + """ + + _validation = { + 'id': {'required': True}, + 'readable_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type_id': {'key': 'typeId', 'type': 'int'}, + 'readable_type': {'key': 'readableType', 'type': 'str'}, + 'roles': {'key': 'roles', 'type': '[EntityRole]'}, + 'sub_lists': {'key': 'subLists', 'type': '[SubClosedListResponse]'}, + } + + def __init__(self, *, id: str, readable_type, name: str=None, type_id: int=None, roles=None, sub_lists=None, **kwargs) -> None: + super(ClosedListEntityExtractor, self).__init__(**kwargs) + self.id = id + self.name = name + self.type_id = type_id + self.readable_type = readable_type + self.roles = roles + self.sub_lists = sub_lists + + +class ClosedListModelCreateObject(Model): + """Object model for creating a list entity. + + :param sub_lists: Sublists for the feature. + :type sub_lists: + list[~azure.cognitiveservices.language.luis.authoring.models.WordListObject] + :param name: Name of the list entity. + :type name: str + """ + + _attribute_map = { + 'sub_lists': {'key': 'subLists', 'type': '[WordListObject]'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, sub_lists=None, name: str=None, **kwargs) -> None: + super(ClosedListModelCreateObject, self).__init__(**kwargs) + self.sub_lists = sub_lists + self.name = name + + +class ClosedListModelPatchObject(Model): + """Object model for adding a batch of sublists to an existing list entity. + + :param sub_lists: Sublists to add. + :type sub_lists: + list[~azure.cognitiveservices.language.luis.authoring.models.WordListObject] + """ + + _attribute_map = { + 'sub_lists': {'key': 'subLists', 'type': '[WordListObject]'}, + } + + def __init__(self, *, sub_lists=None, **kwargs) -> None: + super(ClosedListModelPatchObject, self).__init__(**kwargs) + self.sub_lists = sub_lists + + +class ClosedListModelUpdateObject(Model): + """Object model for updating a list entity. + + :param sub_lists: The new sublists for the feature. + :type sub_lists: + list[~azure.cognitiveservices.language.luis.authoring.models.WordListObject] + :param name: The new name of the list entity. + :type name: str + """ + + _attribute_map = { + 'sub_lists': {'key': 'subLists', 'type': '[WordListObject]'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, sub_lists=None, name: str=None, **kwargs) -> None: + super(ClosedListModelUpdateObject, self).__init__(**kwargs) + self.sub_lists = sub_lists + self.name = name + + +class CollaboratorsArray(Model): + """CollaboratorsArray. + + :param emails: The email address of the users. + :type emails: list[str] + """ + + _attribute_map = { + 'emails': {'key': 'emails', 'type': '[str]'}, + } + + def __init__(self, *, emails=None, **kwargs) -> None: + super(CollaboratorsArray, self).__init__(**kwargs) + self.emails = emails + + +class CompositeChildModelCreateObject(Model): + """CompositeChildModelCreateObject. + + :param name: + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, **kwargs) -> None: + super(CompositeChildModelCreateObject, self).__init__(**kwargs) + self.name = name + + +class CompositeEntityExtractor(Model): + """A Composite Entity Extractor. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID of the Entity Model. + :type id: str + :param name: Name of the Entity Model. + :type name: str + :param type_id: The type ID of the Entity Model. + :type type_id: int + :param readable_type: Required. Possible values include: 'Entity + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' + :type readable_type: str or + ~azure.cognitiveservices.language.luis.authoring.models.enum + :param roles: + :type roles: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] + :param children: List of child entities. + :type children: + list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntity] + """ + + _validation = { + 'id': {'required': True}, + 'readable_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type_id': {'key': 'typeId', 'type': 'int'}, + 'readable_type': {'key': 'readableType', 'type': 'str'}, + 'roles': {'key': 'roles', 'type': '[EntityRole]'}, + 'children': {'key': 'children', 'type': '[ChildEntity]'}, + } + + def __init__(self, *, id: str, readable_type, name: str=None, type_id: int=None, roles=None, children=None, **kwargs) -> None: + super(CompositeEntityExtractor, self).__init__(**kwargs) + self.id = id + self.name = name + self.type_id = type_id + self.readable_type = readable_type + self.roles = roles + self.children = children + + +class CompositeEntityModel(Model): + """A composite entity extractor. + + :param children: Child entities. + :type children: list[str] + :param name: Entity name. + :type name: str + """ + + _attribute_map = { + 'children': {'key': 'children', 'type': '[str]'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, children=None, name: str=None, **kwargs) -> None: + super(CompositeEntityModel, self).__init__(**kwargs) + self.children = children + self.name = name + + +class CustomPrebuiltModel(Model): + """A Custom Prebuilt model. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID of the Entity Model. + :type id: str + :param name: Name of the Entity Model. + :type name: str + :param type_id: The type ID of the Entity Model. + :type type_id: int + :param readable_type: Required. Possible values include: 'Entity + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' + :type readable_type: str or + ~azure.cognitiveservices.language.luis.authoring.models.enum + :param custom_prebuilt_domain_name: The domain name. + :type custom_prebuilt_domain_name: str + :param custom_prebuilt_model_name: The intent name or entity name. + :type custom_prebuilt_model_name: str + :param roles: + :type roles: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] + """ + + _validation = { + 'id': {'required': True}, + 'readable_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type_id': {'key': 'typeId', 'type': 'int'}, + 'readable_type': {'key': 'readableType', 'type': 'str'}, + 'custom_prebuilt_domain_name': {'key': 'customPrebuiltDomainName', 'type': 'str'}, + 'custom_prebuilt_model_name': {'key': 'customPrebuiltModelName', 'type': 'str'}, + 'roles': {'key': 'roles', 'type': '[EntityRole]'}, + } + + def __init__(self, *, id: str, readable_type, name: str=None, type_id: int=None, custom_prebuilt_domain_name: str=None, custom_prebuilt_model_name: str=None, roles=None, **kwargs) -> None: + super(CustomPrebuiltModel, self).__init__(**kwargs) + self.id = id + self.name = name + self.type_id = type_id + self.readable_type = readable_type + self.custom_prebuilt_domain_name = custom_prebuilt_domain_name + self.custom_prebuilt_model_name = custom_prebuilt_model_name + self.roles = roles + + +class EndpointInfo(Model): + """The base class "ProductionOrStagingEndpointInfo" inherits from. + + :param version_id: The version ID to publish. + :type version_id: str + :param is_staging: Indicates if the staging slot should be used, instead + of the Production one. + :type is_staging: bool + :param endpoint_url: The Runtime endpoint URL for this model version. + :type endpoint_url: str + :param region: The target region that the application is published to. + :type region: str + :param assigned_endpoint_key: The endpoint key. + :type assigned_endpoint_key: str + :param endpoint_region: The endpoint's region. + :type endpoint_region: str + :param failed_regions: Regions where publishing failed. + :type failed_regions: str + :param published_date_time: Timestamp when was last published. + :type published_date_time: str + """ + + _attribute_map = { + 'version_id': {'key': 'versionId', 'type': 'str'}, + 'is_staging': {'key': 'isStaging', 'type': 'bool'}, + 'endpoint_url': {'key': 'endpointUrl', 'type': 'str'}, + 'region': {'key': 'region', 'type': 'str'}, + 'assigned_endpoint_key': {'key': 'assignedEndpointKey', 'type': 'str'}, + 'endpoint_region': {'key': 'endpointRegion', 'type': 'str'}, + 'failed_regions': {'key': 'failedRegions', 'type': 'str'}, + 'published_date_time': {'key': 'publishedDateTime', 'type': 'str'}, + } + + def __init__(self, *, version_id: str=None, is_staging: bool=None, endpoint_url: str=None, region: str=None, assigned_endpoint_key: str=None, endpoint_region: str=None, failed_regions: str=None, published_date_time: str=None, **kwargs) -> None: + super(EndpointInfo, self).__init__(**kwargs) + self.version_id = version_id + self.is_staging = is_staging + self.endpoint_url = endpoint_url + self.region = region + self.assigned_endpoint_key = assigned_endpoint_key + self.endpoint_region = endpoint_region + self.failed_regions = failed_regions + self.published_date_time = published_date_time + + +class EnqueueTrainingResponse(Model): + """Response model when requesting to train the model. + + :param status_id: The train request status ID. + :type status_id: int + :param status: Possible values include: 'Queued', 'InProgress', + 'UpToDate', 'Fail', 'Success' + :type status: str or + ~azure.cognitiveservices.language.luis.authoring.models.enum + """ + + _attribute_map = { + 'status_id': {'key': 'statusId', 'type': 'int'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, *, status_id: int=None, status=None, **kwargs) -> None: + super(EnqueueTrainingResponse, self).__init__(**kwargs) + self.status_id = status_id + self.status = status + + +class EntitiesSuggestionExample(Model): + """Predicted/suggested entity. + + :param text: The utterance. For example, "What's the weather like in + seattle?" + :type text: str + :param tokenized_text: The utterance tokenized. + :type tokenized_text: list[str] + :param intent_predictions: Predicted/suggested intents. + :type intent_predictions: + list[~azure.cognitiveservices.language.luis.authoring.models.IntentPrediction] + :param entity_predictions: Predicted/suggested entities. + :type entity_predictions: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityPrediction] + """ + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'}, + 'tokenized_text': {'key': 'tokenizedText', 'type': '[str]'}, + 'intent_predictions': {'key': 'intentPredictions', 'type': '[IntentPrediction]'}, + 'entity_predictions': {'key': 'entityPredictions', 'type': '[EntityPrediction]'}, + } + + def __init__(self, *, text: str=None, tokenized_text=None, intent_predictions=None, entity_predictions=None, **kwargs) -> None: + super(EntitiesSuggestionExample, self).__init__(**kwargs) + self.text = text + self.tokenized_text = tokenized_text + self.intent_predictions = intent_predictions + self.entity_predictions = entity_predictions + + +class EntityExtractor(Model): + """Entity Extractor. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID of the Entity Model. + :type id: str + :param name: Name of the Entity Model. + :type name: str + :param type_id: The type ID of the Entity Model. + :type type_id: int + :param readable_type: Required. Possible values include: 'Entity + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' + :type readable_type: str or + ~azure.cognitiveservices.language.luis.authoring.models.enum + :param roles: + :type roles: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] + :param custom_prebuilt_domain_name: The domain name. + :type custom_prebuilt_domain_name: str + :param custom_prebuilt_model_name: The intent name or entity name. + :type custom_prebuilt_model_name: str + """ + + _validation = { + 'id': {'required': True}, + 'readable_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type_id': {'key': 'typeId', 'type': 'int'}, + 'readable_type': {'key': 'readableType', 'type': 'str'}, + 'roles': {'key': 'roles', 'type': '[EntityRole]'}, + 'custom_prebuilt_domain_name': {'key': 'customPrebuiltDomainName', 'type': 'str'}, + 'custom_prebuilt_model_name': {'key': 'customPrebuiltModelName', 'type': 'str'}, + } + + def __init__(self, *, id: str, readable_type, name: str=None, type_id: int=None, roles=None, custom_prebuilt_domain_name: str=None, custom_prebuilt_model_name: str=None, **kwargs) -> None: + super(EntityExtractor, self).__init__(**kwargs) + self.id = id + self.name = name + self.type_id = type_id + self.readable_type = readable_type + self.roles = roles + self.custom_prebuilt_domain_name = custom_prebuilt_domain_name + self.custom_prebuilt_model_name = custom_prebuilt_model_name + + +class EntityLabel(Model): + """Defines the entity type and position of the extracted entity within the + example. + + All required parameters must be populated in order to send to Azure. + + :param entity_name: Required. The entity type. + :type entity_name: str + :param start_token_index: Required. The index within the utterance where + the extracted entity starts. + :type start_token_index: int + :param end_token_index: Required. The index within the utterance where the + extracted entity ends. + :type end_token_index: int + :param role: The role of the predicted entity. + :type role: str + :param role_id: The role id for the predicted entity. + :type role_id: str + :param children: + :type children: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityLabel] + """ + + _validation = { + 'entity_name': {'required': True}, + 'start_token_index': {'required': True}, + 'end_token_index': {'required': True}, + } + + _attribute_map = { + 'entity_name': {'key': 'entityName', 'type': 'str'}, + 'start_token_index': {'key': 'startTokenIndex', 'type': 'int'}, + 'end_token_index': {'key': 'endTokenIndex', 'type': 'int'}, + 'role': {'key': 'role', 'type': 'str'}, + 'role_id': {'key': 'roleId', 'type': 'str'}, + 'children': {'key': 'children', 'type': '[EntityLabel]'}, + } + + def __init__(self, *, entity_name: str, start_token_index: int, end_token_index: int, role: str=None, role_id: str=None, children=None, **kwargs) -> None: + super(EntityLabel, self).__init__(**kwargs) + self.entity_name = entity_name + self.start_token_index = start_token_index + self.end_token_index = end_token_index + self.role = role + self.role_id = role_id + self.children = children + + +class EntityLabelObject(Model): + """Defines the entity type and position of the extracted entity within the + example. + + All required parameters must be populated in order to send to Azure. + + :param entity_name: Required. The entity type. + :type entity_name: str + :param start_char_index: Required. The index within the utterance where + the extracted entity starts. + :type start_char_index: int + :param end_char_index: Required. The index within the utterance where the + extracted entity ends. + :type end_char_index: int + :param role: The role the entity plays in the utterance. + :type role: str + :param children: The identified entities within the example utterance. + :type children: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityLabelObject] + """ + + _validation = { + 'entity_name': {'required': True}, + 'start_char_index': {'required': True}, + 'end_char_index': {'required': True}, + } + + _attribute_map = { + 'entity_name': {'key': 'entityName', 'type': 'str'}, + 'start_char_index': {'key': 'startCharIndex', 'type': 'int'}, + 'end_char_index': {'key': 'endCharIndex', 'type': 'int'}, + 'role': {'key': 'role', 'type': 'str'}, + 'children': {'key': 'children', 'type': '[EntityLabelObject]'}, + } + + def __init__(self, *, entity_name: str, start_char_index: int, end_char_index: int, role: str=None, children=None, **kwargs) -> None: + super(EntityLabelObject, self).__init__(**kwargs) + self.entity_name = entity_name + self.start_char_index = start_char_index + self.end_char_index = end_char_index + self.role = role + self.children = children + + +class EntityModelCreateObject(Model): + """An entity extractor create object. + + :param children: Child entities. + :type children: + list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntityModelCreateObject] + :param name: Entity name. + :type name: str + """ + + _attribute_map = { + 'children': {'key': 'children', 'type': '[ChildEntityModelCreateObject]'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, children=None, name: str=None, **kwargs) -> None: + super(EntityModelCreateObject, self).__init__(**kwargs) + self.children = children + self.name = name + + +class ModelInfo(Model): + """Base type used in entity types. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID of the Entity Model. + :type id: str + :param name: Name of the Entity Model. + :type name: str + :param type_id: The type ID of the Entity Model. + :type type_id: int + :param readable_type: Required. Possible values include: 'Entity + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' + :type readable_type: str or + ~azure.cognitiveservices.language.luis.authoring.models.enum + """ + + _validation = { + 'id': {'required': True}, + 'readable_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type_id': {'key': 'typeId', 'type': 'int'}, + 'readable_type': {'key': 'readableType', 'type': 'str'}, + } + + def __init__(self, *, id: str, readable_type, name: str=None, type_id: int=None, **kwargs) -> None: + super(ModelInfo, self).__init__(**kwargs) + self.id = id + self.name = name + self.type_id = type_id + self.readable_type = readable_type + + +class EntityModelInfo(ModelInfo): + """An Entity Extractor model info. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID of the Entity Model. + :type id: str + :param name: Name of the Entity Model. + :type name: str + :param type_id: The type ID of the Entity Model. + :type type_id: int + :param readable_type: Required. Possible values include: 'Entity + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' + :type readable_type: str or + ~azure.cognitiveservices.language.luis.authoring.models.enum + :param roles: + :type roles: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] + """ + + _validation = { + 'id': {'required': True}, + 'readable_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type_id': {'key': 'typeId', 'type': 'int'}, + 'readable_type': {'key': 'readableType', 'type': 'str'}, + 'roles': {'key': 'roles', 'type': '[EntityRole]'}, + } + + def __init__(self, *, id: str, readable_type, name: str=None, type_id: int=None, roles=None, **kwargs) -> None: + super(EntityModelInfo, self).__init__(id=id, name=name, type_id=type_id, readable_type=readable_type, **kwargs) + self.roles = roles + + +class EntityModelUpdateObject(Model): + """An entity extractor update object. + + :param name: Entity name. + :type name: str + :param instance_of: The instance of model name + :type instance_of: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'instance_of': {'key': 'instanceOf', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, instance_of: str=None, **kwargs) -> None: + super(EntityModelUpdateObject, self).__init__(**kwargs) + self.name = name + self.instance_of = instance_of + + +class EntityPrediction(Model): + """A suggested entity. + + All required parameters must be populated in order to send to Azure. + + :param entity_name: Required. The entity's name + :type entity_name: str + :param start_token_index: Required. The index within the utterance where + the extracted entity starts. + :type start_token_index: int + :param end_token_index: Required. The index within the utterance where the + extracted entity ends. + :type end_token_index: int + :param phrase: Required. The actual token(s) that comprise the entity. + :type phrase: str + :param children: + :type children: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityPrediction] + """ + + _validation = { + 'entity_name': {'required': True}, + 'start_token_index': {'required': True}, + 'end_token_index': {'required': True}, + 'phrase': {'required': True}, + } + + _attribute_map = { + 'entity_name': {'key': 'entityName', 'type': 'str'}, + 'start_token_index': {'key': 'startTokenIndex', 'type': 'int'}, + 'end_token_index': {'key': 'endTokenIndex', 'type': 'int'}, + 'phrase': {'key': 'phrase', 'type': 'str'}, + 'children': {'key': 'children', 'type': '[EntityPrediction]'}, + } + + def __init__(self, *, entity_name: str, start_token_index: int, end_token_index: int, phrase: str, children=None, **kwargs) -> None: + super(EntityPrediction, self).__init__(**kwargs) + self.entity_name = entity_name + self.start_token_index = start_token_index + self.end_token_index = end_token_index + self.phrase = phrase + self.children = children + + +class EntityRole(Model): + """Entity extractor role. + + :param id: The entity role ID. + :type id: str + :param name: The entity role name. + :type name: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, name: str=None, **kwargs) -> None: + super(EntityRole, self).__init__(**kwargs) + self.id = id + self.name = name + + +class EntityRoleCreateObject(Model): + """Object model for creating an entity role. + + :param name: The entity role name. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, **kwargs) -> None: + super(EntityRoleCreateObject, self).__init__(**kwargs) + self.name = name + + +class EntityRoleUpdateObject(Model): + """Object model for updating an entity role. + + :param name: The entity role name. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, **kwargs) -> None: + super(EntityRoleUpdateObject, self).__init__(**kwargs) + self.name = name + + +class ErrorResponse(Model): + """Error response when invoking an operation on the API. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :param error_type: + :type error_type: str + """ + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'error_type': {'key': 'errorType', 'type': 'str'}, + } + + def __init__(self, *, additional_properties=None, error_type: str=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.additional_properties = additional_properties + self.error_type = error_type + + +class ErrorResponseException(HttpOperationError): + """Server responded with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class ExampleLabelObject(Model): + """A labeled example utterance. + + :param text: The example utterance. + :type text: str + :param entity_labels: The identified entities within the example + utterance. + :type entity_labels: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityLabelObject] + :param intent_name: The identified intent representing the example + utterance. + :type intent_name: str + """ + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'}, + 'entity_labels': {'key': 'entityLabels', 'type': '[EntityLabelObject]'}, + 'intent_name': {'key': 'intentName', 'type': 'str'}, + } + + def __init__(self, *, text: str=None, entity_labels=None, intent_name: str=None, **kwargs) -> None: + super(ExampleLabelObject, self).__init__(**kwargs) + self.text = text + self.entity_labels = entity_labels + self.intent_name = intent_name + + +class ExplicitListItem(Model): + """Explicit (exception) list item. + + :param id: The explicit list item ID. + :type id: long + :param explicit_list_item: The explicit list item value. + :type explicit_list_item: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'long'}, + 'explicit_list_item': {'key': 'explicitListItem', 'type': 'str'}, + } + + def __init__(self, *, id: int=None, explicit_list_item: str=None, **kwargs) -> None: + super(ExplicitListItem, self).__init__(**kwargs) + self.id = id + self.explicit_list_item = explicit_list_item + + +class ExplicitListItemCreateObject(Model): + """Object model for creating an explicit (exception) list item. + + :param explicit_list_item: The explicit list item. + :type explicit_list_item: str + """ + + _attribute_map = { + 'explicit_list_item': {'key': 'explicitListItem', 'type': 'str'}, + } + + def __init__(self, *, explicit_list_item: str=None, **kwargs) -> None: + super(ExplicitListItemCreateObject, self).__init__(**kwargs) + self.explicit_list_item = explicit_list_item + + +class ExplicitListItemUpdateObject(Model): + """Model object for updating an explicit (exception) list item. + + :param explicit_list_item: The explicit list item. + :type explicit_list_item: str + """ + + _attribute_map = { + 'explicit_list_item': {'key': 'explicitListItem', 'type': 'str'}, + } + + def __init__(self, *, explicit_list_item: str=None, **kwargs) -> None: + super(ExplicitListItemUpdateObject, self).__init__(**kwargs) + self.explicit_list_item = explicit_list_item + + +class FeatureInfoObject(Model): + """The base class Features-related response objects inherit from. + + :param id: A six-digit ID used for Features. + :type id: int + :param name: The name of the Feature. + :type name: str + :param is_active: Indicates if the feature is enabled. + :type is_active: bool + :param enabled_for_all_models: Indicates if the feature is enabled for all + models in the application. + :type enabled_for_all_models: bool + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'is_active': {'key': 'isActive', 'type': 'bool'}, + 'enabled_for_all_models': {'key': 'enabledForAllModels', 'type': 'bool'}, + } + + def __init__(self, *, id: int=None, name: str=None, is_active: bool=None, enabled_for_all_models: bool=None, **kwargs) -> None: + super(FeatureInfoObject, self).__init__(**kwargs) + self.id = id + self.name = name + self.is_active = is_active + self.enabled_for_all_models = enabled_for_all_models + + +class FeaturesResponseObject(Model): + """Model Features, including Patterns and Phraselists. + + :param phraselist_features: + :type phraselist_features: + list[~azure.cognitiveservices.language.luis.authoring.models.PhraseListFeatureInfo] + :param pattern_features: + :type pattern_features: + list[~azure.cognitiveservices.language.luis.authoring.models.PatternFeatureInfo] + """ + + _attribute_map = { + 'phraselist_features': {'key': 'phraselistFeatures', 'type': '[PhraseListFeatureInfo]'}, + 'pattern_features': {'key': 'patternFeatures', 'type': '[PatternFeatureInfo]'}, + } + + def __init__(self, *, phraselist_features=None, pattern_features=None, **kwargs) -> None: + super(FeaturesResponseObject, self).__init__(**kwargs) + self.phraselist_features = phraselist_features + self.pattern_features = pattern_features + + +class HierarchicalChildEntity(ChildEntity): + """A Hierarchical Child Entity. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID (GUID) belonging to a child entity. + :type id: str + :param name: The name of a child entity. + :type name: str + :param instance_of: Instance of Model. + :type instance_of: str + :param type_id: The type ID of the Entity Model. + :type type_id: int + :param readable_type: Possible values include: 'Entity Extractor', 'Child + Entity Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child + Entity Extractor', 'Composite Entity Extractor', 'List Entity Extractor', + 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity + Extractor', 'Closed List Entity Extractor', 'Regex Entity Extractor' + :type readable_type: str or + ~azure.cognitiveservices.language.luis.authoring.models.enum + :param children: List of children + :type children: + list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntity] + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'instance_of': {'key': 'instanceOf', 'type': 'str'}, + 'type_id': {'key': 'typeId', 'type': 'int'}, + 'readable_type': {'key': 'readableType', 'type': 'str'}, + 'children': {'key': 'children', 'type': '[ChildEntity]'}, + } + + def __init__(self, *, id: str, name: str=None, instance_of: str=None, type_id: int=None, readable_type=None, children=None, **kwargs) -> None: + super(HierarchicalChildEntity, self).__init__(id=id, name=name, instance_of=instance_of, type_id=type_id, readable_type=readable_type, children=children, **kwargs) + + +class HierarchicalChildModelUpdateObject(Model): + """HierarchicalChildModelUpdateObject. + + :param name: + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, **kwargs) -> None: + super(HierarchicalChildModelUpdateObject, self).__init__(**kwargs) + self.name = name + + +class HierarchicalEntityExtractor(Model): + """Hierarchical Entity Extractor. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID of the Entity Model. + :type id: str + :param name: Name of the Entity Model. + :type name: str + :param type_id: The type ID of the Entity Model. + :type type_id: int + :param readable_type: Required. Possible values include: 'Entity + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' + :type readable_type: str or + ~azure.cognitiveservices.language.luis.authoring.models.enum + :param roles: + :type roles: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] + :param children: List of child entities. + :type children: + list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntity] + """ + + _validation = { + 'id': {'required': True}, + 'readable_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type_id': {'key': 'typeId', 'type': 'int'}, + 'readable_type': {'key': 'readableType', 'type': 'str'}, + 'roles': {'key': 'roles', 'type': '[EntityRole]'}, + 'children': {'key': 'children', 'type': '[ChildEntity]'}, + } + + def __init__(self, *, id: str, readable_type, name: str=None, type_id: int=None, roles=None, children=None, **kwargs) -> None: + super(HierarchicalEntityExtractor, self).__init__(**kwargs) + self.id = id + self.name = name + self.type_id = type_id + self.readable_type = readable_type + self.roles = roles + self.children = children + + +class HierarchicalModel(Model): + """HierarchicalModel. + + :param name: + :type name: str + :param children: + :type children: + list[~azure.cognitiveservices.language.luis.authoring.models.JsonChild] + :param features: + :type features: + list[~azure.cognitiveservices.language.luis.authoring.models.JsonModelFeatureInformation] + :param roles: + :type roles: list[str] + :param inherits: + :type inherits: + ~azure.cognitiveservices.language.luis.authoring.models.PrebuiltDomainObject + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'children': {'key': 'children', 'type': '[JsonChild]'}, + 'features': {'key': 'features', 'type': '[JsonModelFeatureInformation]'}, + 'roles': {'key': 'roles', 'type': '[str]'}, + 'inherits': {'key': 'inherits', 'type': 'PrebuiltDomainObject'}, + } + + def __init__(self, *, name: str=None, children=None, features=None, roles=None, inherits=None, **kwargs) -> None: + super(HierarchicalModel, self).__init__(**kwargs) + self.name = name + self.children = children + self.features = features + self.roles = roles + self.inherits = inherits + + +class HierarchicalModelV2(Model): + """HierarchicalModelV2. + + :param name: + :type name: str + :param children: + :type children: list[str] + :param inherits: + :type inherits: + ~azure.cognitiveservices.language.luis.authoring.models.PrebuiltDomainObject + :param roles: + :type roles: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'children': {'key': 'children', 'type': '[str]'}, + 'inherits': {'key': 'inherits', 'type': 'PrebuiltDomainObject'}, + 'roles': {'key': 'roles', 'type': '[str]'}, + } + + def __init__(self, *, name: str=None, children=None, inherits=None, roles=None, **kwargs) -> None: + super(HierarchicalModelV2, self).__init__(**kwargs) + self.name = name + self.children = children + self.inherits = inherits + self.roles = roles + + +class IntentClassifier(ModelInfo): + """Intent Classifier. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID of the Entity Model. + :type id: str + :param name: Name of the Entity Model. + :type name: str + :param type_id: The type ID of the Entity Model. + :type type_id: int + :param readable_type: Required. Possible values include: 'Entity + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' + :type readable_type: str or + ~azure.cognitiveservices.language.luis.authoring.models.enum + :param custom_prebuilt_domain_name: The domain name. + :type custom_prebuilt_domain_name: str + :param custom_prebuilt_model_name: The intent name or entity name. + :type custom_prebuilt_model_name: str + """ + + _validation = { + 'id': {'required': True}, + 'readable_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type_id': {'key': 'typeId', 'type': 'int'}, + 'readable_type': {'key': 'readableType', 'type': 'str'}, + 'custom_prebuilt_domain_name': {'key': 'customPrebuiltDomainName', 'type': 'str'}, + 'custom_prebuilt_model_name': {'key': 'customPrebuiltModelName', 'type': 'str'}, + } + + def __init__(self, *, id: str, readable_type, name: str=None, type_id: int=None, custom_prebuilt_domain_name: str=None, custom_prebuilt_model_name: str=None, **kwargs) -> None: + super(IntentClassifier, self).__init__(id=id, name=name, type_id=type_id, readable_type=readable_type, **kwargs) + self.custom_prebuilt_domain_name = custom_prebuilt_domain_name + self.custom_prebuilt_model_name = custom_prebuilt_model_name + + +class IntentPrediction(Model): + """A suggested intent. + + :param name: The intent's name + :type name: str + :param score: The intent's score, based on the prediction model. + :type score: float + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'score': {'key': 'score', 'type': 'float'}, + } + + def __init__(self, *, name: str=None, score: float=None, **kwargs) -> None: + super(IntentPrediction, self).__init__(**kwargs) + self.name = name + self.score = score + + +class IntentsSuggestionExample(Model): + """Predicted/suggested intent. + + :param text: The utterance. For example, "What's the weather like in + seattle?" + :type text: str + :param tokenized_text: The tokenized utterance. + :type tokenized_text: list[str] + :param intent_predictions: Predicted/suggested intents. + :type intent_predictions: + list[~azure.cognitiveservices.language.luis.authoring.models.IntentPrediction] + :param entity_predictions: Predicted/suggested entities. + :type entity_predictions: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityPrediction] + """ + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'}, + 'tokenized_text': {'key': 'tokenizedText', 'type': '[str]'}, + 'intent_predictions': {'key': 'intentPredictions', 'type': '[IntentPrediction]'}, + 'entity_predictions': {'key': 'entityPredictions', 'type': '[EntityPrediction]'}, + } + + def __init__(self, *, text: str=None, tokenized_text=None, intent_predictions=None, entity_predictions=None, **kwargs) -> None: + super(IntentsSuggestionExample, self).__init__(**kwargs) + self.text = text + self.tokenized_text = tokenized_text + self.intent_predictions = intent_predictions + self.entity_predictions = entity_predictions + + +class JsonChild(Model): + """JsonChild. + + :param name: + :type name: str + :param instance_of: + :type instance_of: str + :param children: + :type children: + list[~azure.cognitiveservices.language.luis.authoring.models.JsonChild] + :param features: + :type features: + list[~azure.cognitiveservices.language.luis.authoring.models.JsonModelFeatureInformation] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'instance_of': {'key': 'instanceOf', 'type': 'str'}, + 'children': {'key': 'children', 'type': '[JsonChild]'}, + 'features': {'key': 'features', 'type': '[JsonModelFeatureInformation]'}, + } + + def __init__(self, *, name: str=None, instance_of: str=None, children=None, features=None, **kwargs) -> None: + super(JsonChild, self).__init__(**kwargs) + self.name = name + self.instance_of = instance_of + self.children = children + self.features = features + + +class JSONEntity(Model): + """Exported Model - Extracted Entity from utterance. + + All required parameters must be populated in order to send to Azure. + + :param start_pos: Required. The index within the utterance where the + extracted entity starts. + :type start_pos: int + :param end_pos: Required. The index within the utterance where the + extracted entity ends. + :type end_pos: int + :param entity: Required. The entity name. + :type entity: str + :param role: The role the entity plays in the utterance. + :type role: str + :param children: + :type children: + list[~azure.cognitiveservices.language.luis.authoring.models.JSONEntity] + """ + + _validation = { + 'start_pos': {'required': True}, + 'end_pos': {'required': True}, + 'entity': {'required': True}, + } + + _attribute_map = { + 'start_pos': {'key': 'startPos', 'type': 'int'}, + 'end_pos': {'key': 'endPos', 'type': 'int'}, + 'entity': {'key': 'entity', 'type': 'str'}, + 'role': {'key': 'role', 'type': 'str'}, + 'children': {'key': 'children', 'type': '[JSONEntity]'}, + } + + def __init__(self, *, start_pos: int, end_pos: int, entity: str, role: str=None, children=None, **kwargs) -> None: + super(JSONEntity, self).__init__(**kwargs) + self.start_pos = start_pos + self.end_pos = end_pos + self.entity = entity + self.role = role + self.children = children + + +class JSONModelFeature(Model): + """Exported Model - Phraselist Model Feature. + + :param activated: Indicates if the feature is enabled. + :type activated: bool + :param name: The Phraselist name. + :type name: str + :param words: List of comma-separated phrases that represent the + Phraselist. + :type words: str + :param mode: An interchangeable phrase list feature serves as a list of + synonyms for training. A non-exchangeable phrase list serves as separate + features for training. So, if your non-interchangeable phrase list + contains 5 phrases, they will be mapped to 5 separate features. You can + think of the non-interchangeable phrase list as an additional bag of words + to add to LUIS existing vocabulary features. It is used as a lexicon + lookup feature where its value is 1 if the lexicon contains a given word + or 0 if it doesn’t. Default value is true. + :type mode: bool + :param enabled_for_all_models: Indicates if the Phraselist is enabled for + all models in the application. Default value: True . + :type enabled_for_all_models: bool + """ + + _attribute_map = { + 'activated': {'key': 'activated', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'words': {'key': 'words', 'type': 'str'}, + 'mode': {'key': 'mode', 'type': 'bool'}, + 'enabled_for_all_models': {'key': 'enabledForAllModels', 'type': 'bool'}, + } + + def __init__(self, *, activated: bool=None, name: str=None, words: str=None, mode: bool=None, enabled_for_all_models: bool=True, **kwargs) -> None: + super(JSONModelFeature, self).__init__(**kwargs) + self.activated = activated + self.name = name + self.words = words + self.mode = mode + self.enabled_for_all_models = enabled_for_all_models + + +class JsonModelFeatureInformation(Model): + """An object containing the model feature information either the model name or + feature name. + + :param model_name: The name of the model used. + :type model_name: str + :param feature_name: The name of the feature used. + :type feature_name: str + """ + + _attribute_map = { + 'model_name': {'key': 'modelName', 'type': 'str'}, + 'feature_name': {'key': 'featureName', 'type': 'str'}, + } + + def __init__(self, *, model_name: str=None, feature_name: str=None, **kwargs) -> None: + super(JsonModelFeatureInformation, self).__init__(**kwargs) + self.model_name = model_name + self.feature_name = feature_name + + +class JSONRegexFeature(Model): + """Exported Model - A Pattern feature. + + :param pattern: The Regular Expression to match. + :type pattern: str + :param activated: Indicates if the Pattern feature is enabled. + :type activated: bool + :param name: Name of the feature. + :type name: str + """ + + _attribute_map = { + 'pattern': {'key': 'pattern', 'type': 'str'}, + 'activated': {'key': 'activated', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, pattern: str=None, activated: bool=None, name: str=None, **kwargs) -> None: + super(JSONRegexFeature, self).__init__(**kwargs) + self.pattern = pattern + self.activated = activated + self.name = name + + +class JSONUtterance(Model): + """Exported Model - Utterance that was used to train the model. + + :param text: The utterance. + :type text: str + :param intent: The matched intent. + :type intent: str + :param entities: The matched entities. + :type entities: + list[~azure.cognitiveservices.language.luis.authoring.models.JSONEntity] + """ + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'}, + 'intent': {'key': 'intent', 'type': 'str'}, + 'entities': {'key': 'entities', 'type': '[JSONEntity]'}, + } + + def __init__(self, *, text: str=None, intent: str=None, entities=None, **kwargs) -> None: + super(JSONUtterance, self).__init__(**kwargs) + self.text = text + self.intent = intent + self.entities = entities + + +class LabeledUtterance(Model): + """A prediction and label pair of an example. + + :param id: ID of Labeled Utterance. + :type id: int + :param text: The utterance. For example, "What's the weather like in + seattle?" + :type text: str + :param tokenized_text: The utterance tokenized. + :type tokenized_text: list[str] + :param intent_label: The intent matching the example. + :type intent_label: str + :param entity_labels: The entities matching the example. + :type entity_labels: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityLabel] + :param intent_predictions: List of suggested intents. + :type intent_predictions: + list[~azure.cognitiveservices.language.luis.authoring.models.IntentPrediction] + :param entity_predictions: List of suggested entities. + :type entity_predictions: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityPrediction] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'text': {'key': 'text', 'type': 'str'}, + 'tokenized_text': {'key': 'tokenizedText', 'type': '[str]'}, + 'intent_label': {'key': 'intentLabel', 'type': 'str'}, + 'entity_labels': {'key': 'entityLabels', 'type': '[EntityLabel]'}, + 'intent_predictions': {'key': 'intentPredictions', 'type': '[IntentPrediction]'}, + 'entity_predictions': {'key': 'entityPredictions', 'type': '[EntityPrediction]'}, + } + + def __init__(self, *, id: int=None, text: str=None, tokenized_text=None, intent_label: str=None, entity_labels=None, intent_predictions=None, entity_predictions=None, **kwargs) -> None: + super(LabeledUtterance, self).__init__(**kwargs) + self.id = id + self.text = text + self.tokenized_text = tokenized_text + self.intent_label = intent_label + self.entity_labels = entity_labels + self.intent_predictions = intent_predictions + self.entity_predictions = entity_predictions + + +class LabelExampleResponse(Model): + """Response when adding a labeled example utterance. + + :param utterance_text: The example utterance. + :type utterance_text: str + :param example_id: The newly created sample ID. + :type example_id: int + """ + + _attribute_map = { + 'utterance_text': {'key': 'UtteranceText', 'type': 'str'}, + 'example_id': {'key': 'ExampleId', 'type': 'int'}, + } + + def __init__(self, *, utterance_text: str=None, example_id: int=None, **kwargs) -> None: + super(LabelExampleResponse, self).__init__(**kwargs) + self.utterance_text = utterance_text + self.example_id = example_id + + +class LabelTextObject(Model): + """An object containing the example utterance's text. + + :param id: The ID of the Label. + :type id: int + :param text: The text of the label. + :type text: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'text': {'key': 'text', 'type': 'str'}, + } + + def __init__(self, *, id: int=None, text: str=None, **kwargs) -> None: + super(LabelTextObject, self).__init__(**kwargs) + self.id = id + self.text = text + + +class LuisApp(Model): + """Exported Model - An exported LUIS Application. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :param name: The name of the application. + :type name: str + :param version_id: The version ID of the application that was exported. + :type version_id: str + :param desc: The description of the application. + :type desc: str + :param culture: The culture of the application. E.g.: en-us. + :type culture: str + :param intents: List of intents. + :type intents: + list[~azure.cognitiveservices.language.luis.authoring.models.HierarchicalModel] + :param entities: List of entities. + :type entities: + list[~azure.cognitiveservices.language.luis.authoring.models.HierarchicalModel] + :param closed_lists: List of list entities. + :type closed_lists: + list[~azure.cognitiveservices.language.luis.authoring.models.ClosedList] + :param composites: List of composite entities. + :type composites: + list[~azure.cognitiveservices.language.luis.authoring.models.HierarchicalModel] + :param hierarchicals: List of hierarchical entities. + :type hierarchicals: + list[~azure.cognitiveservices.language.luis.authoring.models.HierarchicalModel] + :param pattern_any_entities: List of Pattern.Any entities. + :type pattern_any_entities: + list[~azure.cognitiveservices.language.luis.authoring.models.PatternAny] + :param regex_entities: List of regular expression entities. + :type regex_entities: + list[~azure.cognitiveservices.language.luis.authoring.models.RegexEntity] + :param prebuilt_entities: List of prebuilt entities. + :type prebuilt_entities: + list[~azure.cognitiveservices.language.luis.authoring.models.PrebuiltEntity] + :param regex_features: List of pattern features. + :type regex_features: + list[~azure.cognitiveservices.language.luis.authoring.models.JSONRegexFeature] + :param phraselists: List of model features. + :type phraselists: + list[~azure.cognitiveservices.language.luis.authoring.models.JSONModelFeature] + :param patterns: List of patterns. + :type patterns: + list[~azure.cognitiveservices.language.luis.authoring.models.PatternRule] + :param utterances: List of example utterances. + :type utterances: + list[~azure.cognitiveservices.language.luis.authoring.models.JSONUtterance] + """ + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'name': {'key': 'name', 'type': 'str'}, + 'version_id': {'key': 'versionId', 'type': 'str'}, + 'desc': {'key': 'desc', 'type': 'str'}, + 'culture': {'key': 'culture', 'type': 'str'}, + 'intents': {'key': 'intents', 'type': '[HierarchicalModel]'}, + 'entities': {'key': 'entities', 'type': '[HierarchicalModel]'}, + 'closed_lists': {'key': 'closedLists', 'type': '[ClosedList]'}, + 'composites': {'key': 'composites', 'type': '[HierarchicalModel]'}, + 'hierarchicals': {'key': 'hierarchicals', 'type': '[HierarchicalModel]'}, + 'pattern_any_entities': {'key': 'patternAnyEntities', 'type': '[PatternAny]'}, + 'regex_entities': {'key': 'regex_entities', 'type': '[RegexEntity]'}, + 'prebuilt_entities': {'key': 'prebuiltEntities', 'type': '[PrebuiltEntity]'}, + 'regex_features': {'key': 'regex_features', 'type': '[JSONRegexFeature]'}, + 'phraselists': {'key': 'phraselists', 'type': '[JSONModelFeature]'}, + 'patterns': {'key': 'patterns', 'type': '[PatternRule]'}, + 'utterances': {'key': 'utterances', 'type': '[JSONUtterance]'}, + } + + def __init__(self, *, additional_properties=None, name: str=None, version_id: str=None, desc: str=None, culture: str=None, intents=None, entities=None, closed_lists=None, composites=None, hierarchicals=None, pattern_any_entities=None, regex_entities=None, prebuilt_entities=None, regex_features=None, phraselists=None, patterns=None, utterances=None, **kwargs) -> None: + super(LuisApp, self).__init__(**kwargs) + self.additional_properties = additional_properties + self.name = name + self.version_id = version_id + self.desc = desc + self.culture = culture + self.intents = intents + self.entities = entities + self.closed_lists = closed_lists + self.composites = composites + self.hierarchicals = hierarchicals + self.pattern_any_entities = pattern_any_entities + self.regex_entities = regex_entities + self.prebuilt_entities = prebuilt_entities + self.regex_features = regex_features + self.phraselists = phraselists + self.patterns = patterns + self.utterances = utterances + + +class LuisAppV2(Model): + """Exported Model - An exported LUIS Application. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :param luis_schema_version: Luis schema deserialization version. + :type luis_schema_version: str + :param name: The name of the application. + :type name: str + :param version_id: The version ID of the application that was exported. + :type version_id: str + :param desc: The description of the application. + :type desc: str + :param culture: The culture of the application. E.g.: en-us. + :type culture: str + :param intents: List of intents. + :type intents: + list[~azure.cognitiveservices.language.luis.authoring.models.HierarchicalModelV2] + :param entities: List of entities. + :type entities: + list[~azure.cognitiveservices.language.luis.authoring.models.HierarchicalModelV2] + :param closed_lists: List of list entities. + :type closed_lists: + list[~azure.cognitiveservices.language.luis.authoring.models.ClosedList] + :param composites: List of composite entities. + :type composites: + list[~azure.cognitiveservices.language.luis.authoring.models.HierarchicalModelV2] + :param pattern_any_entities: List of Pattern.Any entities. + :type pattern_any_entities: + list[~azure.cognitiveservices.language.luis.authoring.models.PatternAny] + :param regex_entities: List of regular expression entities. + :type regex_entities: + list[~azure.cognitiveservices.language.luis.authoring.models.RegexEntity] + :param prebuilt_entities: List of prebuilt entities. + :type prebuilt_entities: + list[~azure.cognitiveservices.language.luis.authoring.models.PrebuiltEntity] + :param regex_features: List of pattern features. + :type regex_features: + list[~azure.cognitiveservices.language.luis.authoring.models.JSONRegexFeature] + :param model_features: List of model features. + :type model_features: + list[~azure.cognitiveservices.language.luis.authoring.models.JSONModelFeature] + :param patterns: List of patterns. + :type patterns: + list[~azure.cognitiveservices.language.luis.authoring.models.PatternRule] + :param utterances: List of example utterances. + :type utterances: + list[~azure.cognitiveservices.language.luis.authoring.models.JSONUtterance] + """ + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'luis_schema_version': {'key': 'luis_schema_version', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'version_id': {'key': 'versionId', 'type': 'str'}, + 'desc': {'key': 'desc', 'type': 'str'}, + 'culture': {'key': 'culture', 'type': 'str'}, + 'intents': {'key': 'intents', 'type': '[HierarchicalModelV2]'}, + 'entities': {'key': 'entities', 'type': '[HierarchicalModelV2]'}, + 'closed_lists': {'key': 'closedLists', 'type': '[ClosedList]'}, + 'composites': {'key': 'composites', 'type': '[HierarchicalModelV2]'}, + 'pattern_any_entities': {'key': 'patternAnyEntities', 'type': '[PatternAny]'}, + 'regex_entities': {'key': 'regex_entities', 'type': '[RegexEntity]'}, + 'prebuilt_entities': {'key': 'prebuiltEntities', 'type': '[PrebuiltEntity]'}, + 'regex_features': {'key': 'regex_features', 'type': '[JSONRegexFeature]'}, + 'model_features': {'key': 'model_features', 'type': '[JSONModelFeature]'}, + 'patterns': {'key': 'patterns', 'type': '[PatternRule]'}, + 'utterances': {'key': 'utterances', 'type': '[JSONUtterance]'}, + } + + def __init__(self, *, additional_properties=None, luis_schema_version: str=None, name: str=None, version_id: str=None, desc: str=None, culture: str=None, intents=None, entities=None, closed_lists=None, composites=None, pattern_any_entities=None, regex_entities=None, prebuilt_entities=None, regex_features=None, model_features=None, patterns=None, utterances=None, **kwargs) -> None: + super(LuisAppV2, self).__init__(**kwargs) + self.additional_properties = additional_properties + self.luis_schema_version = luis_schema_version + self.name = name + self.version_id = version_id + self.desc = desc + self.culture = culture + self.intents = intents + self.entities = entities + self.closed_lists = closed_lists + self.composites = composites + self.pattern_any_entities = pattern_any_entities + self.regex_entities = regex_entities + self.prebuilt_entities = prebuilt_entities + self.regex_features = regex_features + self.model_features = model_features + self.patterns = patterns + self.utterances = utterances + + +class ModelCreateObject(Model): + """Object model for creating a new entity extractor. + + :param name: Name of the new entity extractor. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, **kwargs) -> None: + super(ModelCreateObject, self).__init__(**kwargs) + self.name = name + + +class ModelFeatureInformation(Model): + """An object containing the model feature information either the model name or + feature name. + + :param model_name: The name of the model used. + :type model_name: str + :param feature_name: The name of the feature used. + :type feature_name: str + :param is_required: + :type is_required: bool + """ + + _attribute_map = { + 'model_name': {'key': 'modelName', 'type': 'str'}, + 'feature_name': {'key': 'featureName', 'type': 'str'}, + 'is_required': {'key': 'isRequired', 'type': 'bool'}, + } + + def __init__(self, *, model_name: str=None, feature_name: str=None, is_required: bool=None, **kwargs) -> None: + super(ModelFeatureInformation, self).__init__(**kwargs) + self.model_name = model_name + self.feature_name = feature_name + self.is_required = is_required + + +class ModelInfoResponse(Model): + """An application model info. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID of the Entity Model. + :type id: str + :param name: Name of the Entity Model. + :type name: str + :param type_id: The type ID of the Entity Model. + :type type_id: int + :param readable_type: Required. Possible values include: 'Entity + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' + :type readable_type: str or + ~azure.cognitiveservices.language.luis.authoring.models.enum + :param roles: + :type roles: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] + :param children: List of child entities. + :type children: + list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntity] + :param sub_lists: List of sublists. + :type sub_lists: + list[~azure.cognitiveservices.language.luis.authoring.models.SubClosedListResponse] + :param custom_prebuilt_domain_name: The domain name. + :type custom_prebuilt_domain_name: str + :param custom_prebuilt_model_name: The intent name or entity name. + :type custom_prebuilt_model_name: str + :param regex_pattern: The Regular Expression entity pattern. + :type regex_pattern: str + :param explicit_list: + :type explicit_list: + list[~azure.cognitiveservices.language.luis.authoring.models.ExplicitListItem] + """ + + _validation = { + 'id': {'required': True}, + 'readable_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type_id': {'key': 'typeId', 'type': 'int'}, + 'readable_type': {'key': 'readableType', 'type': 'str'}, + 'roles': {'key': 'roles', 'type': '[EntityRole]'}, + 'children': {'key': 'children', 'type': '[ChildEntity]'}, + 'sub_lists': {'key': 'subLists', 'type': '[SubClosedListResponse]'}, + 'custom_prebuilt_domain_name': {'key': 'customPrebuiltDomainName', 'type': 'str'}, + 'custom_prebuilt_model_name': {'key': 'customPrebuiltModelName', 'type': 'str'}, + 'regex_pattern': {'key': 'regexPattern', 'type': 'str'}, + 'explicit_list': {'key': 'explicitList', 'type': '[ExplicitListItem]'}, + } + + def __init__(self, *, id: str, readable_type, name: str=None, type_id: int=None, roles=None, children=None, sub_lists=None, custom_prebuilt_domain_name: str=None, custom_prebuilt_model_name: str=None, regex_pattern: str=None, explicit_list=None, **kwargs) -> None: + super(ModelInfoResponse, self).__init__(**kwargs) + self.id = id + self.name = name + self.type_id = type_id + self.readable_type = readable_type + self.roles = roles + self.children = children + self.sub_lists = sub_lists + self.custom_prebuilt_domain_name = custom_prebuilt_domain_name + self.custom_prebuilt_model_name = custom_prebuilt_model_name + self.regex_pattern = regex_pattern + self.explicit_list = explicit_list + + +class ModelTrainingDetails(Model): + """Model Training Details. + + :param status_id: The train request status ID. + :type status_id: int + :param status: Possible values include: 'Queued', 'InProgress', + 'UpToDate', 'Fail', 'Success' + :type status: str or + ~azure.cognitiveservices.language.luis.authoring.models.enum + :param example_count: The count of examples used to train the model. + :type example_count: int + :param training_date_time: When the model was trained. + :type training_date_time: datetime + :param failure_reason: Reason for the training failure. + :type failure_reason: str + """ + + _attribute_map = { + 'status_id': {'key': 'statusId', 'type': 'int'}, + 'status': {'key': 'status', 'type': 'str'}, + 'example_count': {'key': 'exampleCount', 'type': 'int'}, + 'training_date_time': {'key': 'trainingDateTime', 'type': 'iso-8601'}, + 'failure_reason': {'key': 'failureReason', 'type': 'str'}, + } + + def __init__(self, *, status_id: int=None, status=None, example_count: int=None, training_date_time=None, failure_reason: str=None, **kwargs) -> None: + super(ModelTrainingDetails, self).__init__(**kwargs) + self.status_id = status_id + self.status = status + self.example_count = example_count + self.training_date_time = training_date_time + self.failure_reason = failure_reason + + +class ModelTrainingInfo(Model): + """Model Training Info. + + :param model_id: The ID (GUID) of the model. + :type model_id: str + :param details: + :type details: + ~azure.cognitiveservices.language.luis.authoring.models.ModelTrainingDetails + """ + + _attribute_map = { + 'model_id': {'key': 'modelId', 'type': 'str'}, + 'details': {'key': 'details', 'type': 'ModelTrainingDetails'}, + } + + def __init__(self, *, model_id: str=None, details=None, **kwargs) -> None: + super(ModelTrainingInfo, self).__init__(**kwargs) + self.model_id = model_id + self.details = details + + +class ModelUpdateObject(Model): + """Object model for updating an intent classifier. + + :param name: The entity's new name. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, **kwargs) -> None: + super(ModelUpdateObject, self).__init__(**kwargs) + self.name = name + + +class NDepthEntityExtractor(Model): + """N-Depth Entity Extractor. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID of the Entity Model. + :type id: str + :param name: Name of the Entity Model. + :type name: str + :param type_id: The type ID of the Entity Model. + :type type_id: int + :param readable_type: Required. Possible values include: 'Entity + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' + :type readable_type: str or + ~azure.cognitiveservices.language.luis.authoring.models.enum + :param roles: + :type roles: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] + :param custom_prebuilt_domain_name: The domain name. + :type custom_prebuilt_domain_name: str + :param custom_prebuilt_model_name: The intent name or entity name. + :type custom_prebuilt_model_name: str + :param children: + :type children: + list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntity] + """ + + _validation = { + 'id': {'required': True}, + 'readable_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type_id': {'key': 'typeId', 'type': 'int'}, + 'readable_type': {'key': 'readableType', 'type': 'str'}, + 'roles': {'key': 'roles', 'type': '[EntityRole]'}, + 'custom_prebuilt_domain_name': {'key': 'customPrebuiltDomainName', 'type': 'str'}, + 'custom_prebuilt_model_name': {'key': 'customPrebuiltModelName', 'type': 'str'}, + 'children': {'key': 'children', 'type': '[ChildEntity]'}, + } + + def __init__(self, *, id: str, readable_type, name: str=None, type_id: int=None, roles=None, custom_prebuilt_domain_name: str=None, custom_prebuilt_model_name: str=None, children=None, **kwargs) -> None: + super(NDepthEntityExtractor, self).__init__(**kwargs) + self.id = id + self.name = name + self.type_id = type_id + self.readable_type = readable_type + self.roles = roles + self.custom_prebuilt_domain_name = custom_prebuilt_domain_name + self.custom_prebuilt_model_name = custom_prebuilt_model_name + self.children = children + + +class OperationError(Model): + """Operation error details when invoking an operation on the API. + + :param code: + :type code: str + :param message: + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None: + super(OperationError, self).__init__(**kwargs) + self.code = code + self.message = message + + +class OperationStatus(Model): + """Response of an Operation status. + + :param code: Status Code. Possible values include: 'Failed', 'FAILED', + 'Success' + :type code: str or + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatusType + :param message: Status details. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code=None, message: str=None, **kwargs) -> None: + super(OperationStatus, self).__init__(**kwargs) + self.code = code + self.message = message + + +class PatternAny(Model): + """Pattern.Any Entity Extractor. + + :param name: + :type name: str + :param explicit_list: + :type explicit_list: list[str] + :param roles: + :type roles: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'explicit_list': {'key': 'explicitList', 'type': '[str]'}, + 'roles': {'key': 'roles', 'type': '[str]'}, + } + + def __init__(self, *, name: str=None, explicit_list=None, roles=None, **kwargs) -> None: + super(PatternAny, self).__init__(**kwargs) + self.name = name + self.explicit_list = explicit_list + self.roles = roles + + +class PatternAnyEntityExtractor(Model): + """Pattern.Any Entity Extractor. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID of the Entity Model. + :type id: str + :param name: Name of the Entity Model. + :type name: str + :param type_id: The type ID of the Entity Model. + :type type_id: int + :param readable_type: Required. Possible values include: 'Entity + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' + :type readable_type: str or + ~azure.cognitiveservices.language.luis.authoring.models.enum + :param roles: + :type roles: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] + :param explicit_list: + :type explicit_list: + list[~azure.cognitiveservices.language.luis.authoring.models.ExplicitListItem] + """ + + _validation = { + 'id': {'required': True}, + 'readable_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type_id': {'key': 'typeId', 'type': 'int'}, + 'readable_type': {'key': 'readableType', 'type': 'str'}, + 'roles': {'key': 'roles', 'type': '[EntityRole]'}, + 'explicit_list': {'key': 'explicitList', 'type': '[ExplicitListItem]'}, + } + + def __init__(self, *, id: str, readable_type, name: str=None, type_id: int=None, roles=None, explicit_list=None, **kwargs) -> None: + super(PatternAnyEntityExtractor, self).__init__(**kwargs) + self.id = id + self.name = name + self.type_id = type_id + self.readable_type = readable_type + self.roles = roles + self.explicit_list = explicit_list + + +class PatternAnyModelCreateObject(Model): + """Model object for creating a Pattern.Any entity model. + + :param name: The model name. + :type name: str + :param explicit_list: The Pattern.Any explicit list. + :type explicit_list: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'explicit_list': {'key': 'explicitList', 'type': '[str]'}, + } + + def __init__(self, *, name: str=None, explicit_list=None, **kwargs) -> None: + super(PatternAnyModelCreateObject, self).__init__(**kwargs) + self.name = name + self.explicit_list = explicit_list + + +class PatternAnyModelUpdateObject(Model): + """Model object for updating a Pattern.Any entity model. + + :param name: The model name. + :type name: str + :param explicit_list: The Pattern.Any explicit list. + :type explicit_list: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'explicit_list': {'key': 'explicitList', 'type': '[str]'}, + } + + def __init__(self, *, name: str=None, explicit_list=None, **kwargs) -> None: + super(PatternAnyModelUpdateObject, self).__init__(**kwargs) + self.name = name + self.explicit_list = explicit_list + + +class PatternFeatureInfo(FeatureInfoObject): + """Pattern feature. + + :param id: A six-digit ID used for Features. + :type id: int + :param name: The name of the Feature. + :type name: str + :param is_active: Indicates if the feature is enabled. + :type is_active: bool + :param enabled_for_all_models: Indicates if the feature is enabled for all + models in the application. + :type enabled_for_all_models: bool + :param pattern: The Regular Expression to match. + :type pattern: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'is_active': {'key': 'isActive', 'type': 'bool'}, + 'enabled_for_all_models': {'key': 'enabledForAllModels', 'type': 'bool'}, + 'pattern': {'key': 'pattern', 'type': 'str'}, + } + + def __init__(self, *, id: int=None, name: str=None, is_active: bool=None, enabled_for_all_models: bool=None, pattern: str=None, **kwargs) -> None: + super(PatternFeatureInfo, self).__init__(id=id, name=name, is_active=is_active, enabled_for_all_models=enabled_for_all_models, **kwargs) + self.pattern = pattern + + +class PatternRule(Model): + """Pattern. + + :param pattern: The pattern text. + :type pattern: str + :param intent: The intent's name where the pattern belongs to. + :type intent: str + """ + + _attribute_map = { + 'pattern': {'key': 'pattern', 'type': 'str'}, + 'intent': {'key': 'intent', 'type': 'str'}, + } + + def __init__(self, *, pattern: str=None, intent: str=None, **kwargs) -> None: + super(PatternRule, self).__init__(**kwargs) + self.pattern = pattern + self.intent = intent + + +class PatternRuleCreateObject(Model): + """Object model for creating a pattern. + + :param pattern: The pattern text. + :type pattern: str + :param intent: The intent's name which the pattern belongs to. + :type intent: str + """ + + _attribute_map = { + 'pattern': {'key': 'pattern', 'type': 'str'}, + 'intent': {'key': 'intent', 'type': 'str'}, + } + + def __init__(self, *, pattern: str=None, intent: str=None, **kwargs) -> None: + super(PatternRuleCreateObject, self).__init__(**kwargs) + self.pattern = pattern + self.intent = intent + + +class PatternRuleInfo(Model): + """Pattern rule. + + :param id: The pattern ID. + :type id: str + :param pattern: The pattern text. + :type pattern: str + :param intent: The intent's name where the pattern belongs to. + :type intent: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'pattern': {'key': 'pattern', 'type': 'str'}, + 'intent': {'key': 'intent', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, pattern: str=None, intent: str=None, **kwargs) -> None: + super(PatternRuleInfo, self).__init__(**kwargs) + self.id = id + self.pattern = pattern + self.intent = intent + + +class PatternRuleUpdateObject(Model): + """Object model for updating a pattern. + + :param id: The pattern ID. + :type id: str + :param pattern: The pattern text. + :type pattern: str + :param intent: The intent's name which the pattern belongs to. + :type intent: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'pattern': {'key': 'pattern', 'type': 'str'}, + 'intent': {'key': 'intent', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, pattern: str=None, intent: str=None, **kwargs) -> None: + super(PatternRuleUpdateObject, self).__init__(**kwargs) + self.id = id + self.pattern = pattern + self.intent = intent + + +class PersonalAssistantsResponse(Model): + """Response containing user's endpoint keys and the endpoint URLs of the + prebuilt Cortana applications. + + :param endpoint_keys: + :type endpoint_keys: list[str] + :param endpoint_urls: + :type endpoint_urls: dict[str, str] + """ + + _attribute_map = { + 'endpoint_keys': {'key': 'endpointKeys', 'type': '[str]'}, + 'endpoint_urls': {'key': 'endpointUrls', 'type': '{str}'}, + } + + def __init__(self, *, endpoint_keys=None, endpoint_urls=None, **kwargs) -> None: + super(PersonalAssistantsResponse, self).__init__(**kwargs) + self.endpoint_keys = endpoint_keys + self.endpoint_urls = endpoint_urls + + +class PhraselistCreateObject(Model): + """Object model for creating a phraselist model. + + :param phrases: List of comma-separated phrases that represent the + Phraselist. + :type phrases: str + :param name: The Phraselist name. + :type name: str + :param is_exchangeable: An interchangeable phrase list feature serves as a + list of synonyms for training. A non-exchangeable phrase list serves as + separate features for training. So, if your non-interchangeable phrase + list contains 5 phrases, they will be mapped to 5 separate features. You + can think of the non-interchangeable phrase list as an additional bag of + words to add to LUIS existing vocabulary features. It is used as a lexicon + lookup feature where its value is 1 if the lexicon contains a given word + or 0 if it doesn’t. Default value is true. Default value: True . + :type is_exchangeable: bool + :param enabled_for_all_models: Indicates if the Phraselist is enabled for + all models in the application. Default value: True . + :type enabled_for_all_models: bool + """ + + _attribute_map = { + 'phrases': {'key': 'phrases', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'is_exchangeable': {'key': 'isExchangeable', 'type': 'bool'}, + 'enabled_for_all_models': {'key': 'enabledForAllModels', 'type': 'bool'}, + } + + def __init__(self, *, phrases: str=None, name: str=None, is_exchangeable: bool=True, enabled_for_all_models: bool=True, **kwargs) -> None: + super(PhraselistCreateObject, self).__init__(**kwargs) + self.phrases = phrases + self.name = name + self.is_exchangeable = is_exchangeable + self.enabled_for_all_models = enabled_for_all_models + + +class PhraseListFeatureInfo(FeatureInfoObject): + """Phraselist Feature. + + :param id: A six-digit ID used for Features. + :type id: int + :param name: The name of the Feature. + :type name: str + :param is_active: Indicates if the feature is enabled. + :type is_active: bool + :param enabled_for_all_models: Indicates if the feature is enabled for all + models in the application. + :type enabled_for_all_models: bool + :param phrases: A list of comma-separated values. + :type phrases: str + :param is_exchangeable: An exchangeable phrase list feature are serves as + single feature to the LUIS underlying training algorithm. It is used as a + lexicon lookup feature where its value is 1 if the lexicon contains a + given word or 0 if it doesn’t. Think of an exchangeable as a synonyms + list. A non-exchangeable phrase list feature has all the phrases in the + list serve as separate features to the underlying training algorithm. So, + if you your phrase list feature contains 5 phrases, they will be mapped to + 5 separate features. You can think of the non-exchangeable phrase list + feature as an additional bag of words that you are willing to add to LUIS + existing vocabulary features. Think of a non-exchangeable as set of + different words. Default value is true. + :type is_exchangeable: bool + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'is_active': {'key': 'isActive', 'type': 'bool'}, + 'enabled_for_all_models': {'key': 'enabledForAllModels', 'type': 'bool'}, + 'phrases': {'key': 'phrases', 'type': 'str'}, + 'is_exchangeable': {'key': 'isExchangeable', 'type': 'bool'}, + } + + def __init__(self, *, id: int=None, name: str=None, is_active: bool=None, enabled_for_all_models: bool=None, phrases: str=None, is_exchangeable: bool=None, **kwargs) -> None: + super(PhraseListFeatureInfo, self).__init__(id=id, name=name, is_active=is_active, enabled_for_all_models=enabled_for_all_models, **kwargs) + self.phrases = phrases + self.is_exchangeable = is_exchangeable + + +class PhraselistUpdateObject(Model): + """Object model for updating a Phraselist. + + :param phrases: List of comma-separated phrases that represent the + Phraselist. + :type phrases: str + :param name: The Phraselist name. + :type name: str + :param is_active: Indicates if the Phraselist is enabled. Default value: + True . + :type is_active: bool + :param is_exchangeable: An exchangeable phrase list feature are serves as + single feature to the LUIS underlying training algorithm. It is used as a + lexicon lookup feature where its value is 1 if the lexicon contains a + given word or 0 if it doesn’t. Think of an exchangeable as a synonyms + list. A non-exchangeable phrase list feature has all the phrases in the + list serve as separate features to the underlying training algorithm. So, + if you your phrase list feature contains 5 phrases, they will be mapped to + 5 separate features. You can think of the non-exchangeable phrase list + feature as an additional bag of words that you are willing to add to LUIS + existing vocabulary features. Think of a non-exchangeable as set of + different words. Default value is true. Default value: True . + :type is_exchangeable: bool + :param enabled_for_all_models: Indicates if the Phraselist is enabled for + all models in the application. Default value: True . + :type enabled_for_all_models: bool + """ + + _attribute_map = { + 'phrases': {'key': 'phrases', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'is_active': {'key': 'isActive', 'type': 'bool'}, + 'is_exchangeable': {'key': 'isExchangeable', 'type': 'bool'}, + 'enabled_for_all_models': {'key': 'enabledForAllModels', 'type': 'bool'}, + } + + def __init__(self, *, phrases: str=None, name: str=None, is_active: bool=True, is_exchangeable: bool=True, enabled_for_all_models: bool=True, **kwargs) -> None: + super(PhraselistUpdateObject, self).__init__(**kwargs) + self.phrases = phrases + self.name = name + self.is_active = is_active + self.is_exchangeable = is_exchangeable + self.enabled_for_all_models = enabled_for_all_models + + +class PrebuiltDomain(Model): + """Prebuilt Domain. + + :param name: + :type name: str + :param culture: + :type culture: str + :param description: + :type description: str + :param examples: + :type examples: str + :param intents: + :type intents: + list[~azure.cognitiveservices.language.luis.authoring.models.PrebuiltDomainItem] + :param entities: + :type entities: + list[~azure.cognitiveservices.language.luis.authoring.models.PrebuiltDomainItem] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'culture': {'key': 'culture', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'examples': {'key': 'examples', 'type': 'str'}, + 'intents': {'key': 'intents', 'type': '[PrebuiltDomainItem]'}, + 'entities': {'key': 'entities', 'type': '[PrebuiltDomainItem]'}, + } + + def __init__(self, *, name: str=None, culture: str=None, description: str=None, examples: str=None, intents=None, entities=None, **kwargs) -> None: + super(PrebuiltDomain, self).__init__(**kwargs) + self.name = name + self.culture = culture + self.description = description + self.examples = examples + self.intents = intents + self.entities = entities + + +class PrebuiltDomainCreateBaseObject(Model): + """A model object containing the name of the custom prebuilt entity and the + name of the domain to which this model belongs. + + :param domain_name: The domain name. + :type domain_name: str + """ + + _attribute_map = { + 'domain_name': {'key': 'domainName', 'type': 'str'}, + } + + def __init__(self, *, domain_name: str=None, **kwargs) -> None: + super(PrebuiltDomainCreateBaseObject, self).__init__(**kwargs) + self.domain_name = domain_name + + +class PrebuiltDomainCreateObject(Model): + """A prebuilt domain create object containing the name and culture of the + domain. + + :param domain_name: The domain name. + :type domain_name: str + :param culture: The culture of the new domain. + :type culture: str + """ + + _attribute_map = { + 'domain_name': {'key': 'domainName', 'type': 'str'}, + 'culture': {'key': 'culture', 'type': 'str'}, + } + + def __init__(self, *, domain_name: str=None, culture: str=None, **kwargs) -> None: + super(PrebuiltDomainCreateObject, self).__init__(**kwargs) + self.domain_name = domain_name + self.culture = culture + + +class PrebuiltDomainItem(Model): + """PrebuiltDomainItem. + + :param name: + :type name: str + :param description: + :type description: str + :param examples: + :type examples: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'examples': {'key': 'examples', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, description: str=None, examples: str=None, **kwargs) -> None: + super(PrebuiltDomainItem, self).__init__(**kwargs) + self.name = name + self.description = description + self.examples = examples + + +class PrebuiltDomainModelCreateObject(Model): + """A model object containing the name of the custom prebuilt intent or entity + and the name of the domain to which this model belongs. + + :param domain_name: The domain name. + :type domain_name: str + :param model_name: The intent name or entity name. + :type model_name: str + """ + + _attribute_map = { + 'domain_name': {'key': 'domainName', 'type': 'str'}, + 'model_name': {'key': 'modelName', 'type': 'str'}, + } + + def __init__(self, *, domain_name: str=None, model_name: str=None, **kwargs) -> None: + super(PrebuiltDomainModelCreateObject, self).__init__(**kwargs) + self.domain_name = domain_name + self.model_name = model_name + + +class PrebuiltDomainObject(Model): + """PrebuiltDomainObject. + + :param domain_name: + :type domain_name: str + :param model_name: + :type model_name: str + """ + + _attribute_map = { + 'domain_name': {'key': 'domain_name', 'type': 'str'}, + 'model_name': {'key': 'model_name', 'type': 'str'}, + } + + def __init__(self, *, domain_name: str=None, model_name: str=None, **kwargs) -> None: + super(PrebuiltDomainObject, self).__init__(**kwargs) + self.domain_name = domain_name + self.model_name = model_name + + +class PrebuiltEntity(Model): + """Prebuilt Entity Extractor. + + :param name: + :type name: str + :param roles: + :type roles: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'roles': {'key': 'roles', 'type': '[str]'}, + } + + def __init__(self, *, name: str=None, roles=None, **kwargs) -> None: + super(PrebuiltEntity, self).__init__(**kwargs) + self.name = name + self.roles = roles + + +class PrebuiltEntityExtractor(Model): + """Prebuilt Entity Extractor. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID of the Entity Model. + :type id: str + :param name: Name of the Entity Model. + :type name: str + :param type_id: The type ID of the Entity Model. + :type type_id: int + :param readable_type: Required. Possible values include: 'Entity + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' + :type readable_type: str or + ~azure.cognitiveservices.language.luis.authoring.models.enum + :param roles: + :type roles: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] + """ + + _validation = { + 'id': {'required': True}, + 'readable_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type_id': {'key': 'typeId', 'type': 'int'}, + 'readable_type': {'key': 'readableType', 'type': 'str'}, + 'roles': {'key': 'roles', 'type': '[EntityRole]'}, + } + + def __init__(self, *, id: str, readable_type, name: str=None, type_id: int=None, roles=None, **kwargs) -> None: + super(PrebuiltEntityExtractor, self).__init__(**kwargs) + self.id = id + self.name = name + self.type_id = type_id + self.readable_type = readable_type + self.roles = roles + + +class ProductionOrStagingEndpointInfo(EndpointInfo): + """ProductionOrStagingEndpointInfo. + + :param version_id: The version ID to publish. + :type version_id: str + :param is_staging: Indicates if the staging slot should be used, instead + of the Production one. + :type is_staging: bool + :param endpoint_url: The Runtime endpoint URL for this model version. + :type endpoint_url: str + :param region: The target region that the application is published to. + :type region: str + :param assigned_endpoint_key: The endpoint key. + :type assigned_endpoint_key: str + :param endpoint_region: The endpoint's region. + :type endpoint_region: str + :param failed_regions: Regions where publishing failed. + :type failed_regions: str + :param published_date_time: Timestamp when was last published. + :type published_date_time: str + """ + + _attribute_map = { + 'version_id': {'key': 'versionId', 'type': 'str'}, + 'is_staging': {'key': 'isStaging', 'type': 'bool'}, + 'endpoint_url': {'key': 'endpointUrl', 'type': 'str'}, + 'region': {'key': 'region', 'type': 'str'}, + 'assigned_endpoint_key': {'key': 'assignedEndpointKey', 'type': 'str'}, + 'endpoint_region': {'key': 'endpointRegion', 'type': 'str'}, + 'failed_regions': {'key': 'failedRegions', 'type': 'str'}, + 'published_date_time': {'key': 'publishedDateTime', 'type': 'str'}, + } + + def __init__(self, *, version_id: str=None, is_staging: bool=None, endpoint_url: str=None, region: str=None, assigned_endpoint_key: str=None, endpoint_region: str=None, failed_regions: str=None, published_date_time: str=None, **kwargs) -> None: + super(ProductionOrStagingEndpointInfo, self).__init__(version_id=version_id, is_staging=is_staging, endpoint_url=endpoint_url, region=region, assigned_endpoint_key=assigned_endpoint_key, endpoint_region=endpoint_region, failed_regions=failed_regions, published_date_time=published_date_time, **kwargs) + + +class PublishSettings(Model): + """The application publish settings. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The application ID. + :type id: str + :param is_sentiment_analysis_enabled: Required. Setting sentiment analysis + as true returns the sentiment of the input utterance along with the + response + :type is_sentiment_analysis_enabled: bool + :param is_speech_enabled: Required. Enables speech priming in your app + :type is_speech_enabled: bool + :param is_spell_checker_enabled: Required. Enables spell checking of the + utterance. + :type is_spell_checker_enabled: bool + """ + + _validation = { + 'id': {'required': True}, + 'is_sentiment_analysis_enabled': {'required': True}, + 'is_speech_enabled': {'required': True}, + 'is_spell_checker_enabled': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'is_sentiment_analysis_enabled': {'key': 'sentimentAnalysis', 'type': 'bool'}, + 'is_speech_enabled': {'key': 'speech', 'type': 'bool'}, + 'is_spell_checker_enabled': {'key': 'spellChecker', 'type': 'bool'}, + } + + def __init__(self, *, id: str, is_sentiment_analysis_enabled: bool, is_speech_enabled: bool, is_spell_checker_enabled: bool, **kwargs) -> None: + super(PublishSettings, self).__init__(**kwargs) + self.id = id + self.is_sentiment_analysis_enabled = is_sentiment_analysis_enabled + self.is_speech_enabled = is_speech_enabled + self.is_spell_checker_enabled = is_spell_checker_enabled + + +class PublishSettingUpdateObject(Model): + """Object model for updating an application's publish settings. + + :param sentiment_analysis: Setting sentiment analysis as true returns the + Sentiment of the input utterance along with the response + :type sentiment_analysis: bool + :param speech: Setting speech as public enables speech priming in your app + :type speech: bool + :param spell_checker: Setting spell checker as public enables spell + checking the input utterance. + :type spell_checker: bool + """ + + _attribute_map = { + 'sentiment_analysis': {'key': 'sentimentAnalysis', 'type': 'bool'}, + 'speech': {'key': 'speech', 'type': 'bool'}, + 'spell_checker': {'key': 'spellChecker', 'type': 'bool'}, + } + + def __init__(self, *, sentiment_analysis: bool=None, speech: bool=None, spell_checker: bool=None, **kwargs) -> None: + super(PublishSettingUpdateObject, self).__init__(**kwargs) + self.sentiment_analysis = sentiment_analysis + self.speech = speech + self.spell_checker = spell_checker + + +class RegexEntity(Model): + """Regular Expression Entity Extractor. + + :param name: + :type name: str + :param regex_pattern: + :type regex_pattern: str + :param roles: + :type roles: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'regex_pattern': {'key': 'regexPattern', 'type': 'str'}, + 'roles': {'key': 'roles', 'type': '[str]'}, + } + + def __init__(self, *, name: str=None, regex_pattern: str=None, roles=None, **kwargs) -> None: + super(RegexEntity, self).__init__(**kwargs) + self.name = name + self.regex_pattern = regex_pattern + self.roles = roles + + +class RegexEntityExtractor(Model): + """Regular Expression Entity Extractor. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID of the Entity Model. + :type id: str + :param name: Name of the Entity Model. + :type name: str + :param type_id: The type ID of the Entity Model. + :type type_id: int + :param readable_type: Required. Possible values include: 'Entity + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' + :type readable_type: str or + ~azure.cognitiveservices.language.luis.authoring.models.enum + :param roles: + :type roles: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] + :param regex_pattern: The Regular Expression entity pattern. + :type regex_pattern: str + """ + + _validation = { + 'id': {'required': True}, + 'readable_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type_id': {'key': 'typeId', 'type': 'int'}, + 'readable_type': {'key': 'readableType', 'type': 'str'}, + 'roles': {'key': 'roles', 'type': '[EntityRole]'}, + 'regex_pattern': {'key': 'regexPattern', 'type': 'str'}, + } + + def __init__(self, *, id: str, readable_type, name: str=None, type_id: int=None, roles=None, regex_pattern: str=None, **kwargs) -> None: + super(RegexEntityExtractor, self).__init__(**kwargs) + self.id = id + self.name = name + self.type_id = type_id + self.readable_type = readable_type + self.roles = roles + self.regex_pattern = regex_pattern + + +class RegexModelCreateObject(Model): + """Model object for creating a regular expression entity model. + + :param regex_pattern: The regular expression entity pattern. + :type regex_pattern: str + :param name: The model name. + :type name: str + """ + + _attribute_map = { + 'regex_pattern': {'key': 'regexPattern', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, regex_pattern: str=None, name: str=None, **kwargs) -> None: + super(RegexModelCreateObject, self).__init__(**kwargs) + self.regex_pattern = regex_pattern + self.name = name + + +class RegexModelUpdateObject(Model): + """Model object for updating a regular expression entity model. + + :param regex_pattern: The regular expression entity pattern. + :type regex_pattern: str + :param name: The model name. + :type name: str + """ + + _attribute_map = { + 'regex_pattern': {'key': 'regexPattern', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, regex_pattern: str=None, name: str=None, **kwargs) -> None: + super(RegexModelUpdateObject, self).__init__(**kwargs) + self.regex_pattern = regex_pattern + self.name = name + + +class SubClosedList(Model): + """Sublist of items for a list entity. + + :param canonical_form: The standard form that the list represents. + :type canonical_form: str + :param list: List of synonym words. + :type list: list[str] + """ + + _attribute_map = { + 'canonical_form': {'key': 'canonicalForm', 'type': 'str'}, + 'list': {'key': 'list', 'type': '[str]'}, + } + + def __init__(self, *, canonical_form: str=None, list=None, **kwargs) -> None: + super(SubClosedList, self).__init__(**kwargs) + self.canonical_form = canonical_form + self.list = list + + +class SubClosedListResponse(SubClosedList): + """Sublist of items for a list entity. + + :param canonical_form: The standard form that the list represents. + :type canonical_form: str + :param list: List of synonym words. + :type list: list[str] + :param id: The sublist ID + :type id: int + """ + + _attribute_map = { + 'canonical_form': {'key': 'canonicalForm', 'type': 'str'}, + 'list': {'key': 'list', 'type': '[str]'}, + 'id': {'key': 'id', 'type': 'int'}, + } + + def __init__(self, *, canonical_form: str=None, list=None, id: int=None, **kwargs) -> None: + super(SubClosedListResponse, self).__init__(canonical_form=canonical_form, list=list, **kwargs) + self.id = id + + +class TaskUpdateObject(Model): + """Object model for cloning an application's version. + + :param version: The new version for the cloned model. + :type version: str + """ + + _attribute_map = { + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, *, version: str=None, **kwargs) -> None: + super(TaskUpdateObject, self).__init__(**kwargs) + self.version = version + + +class UserAccessList(Model): + """List of user permissions. + + :param owner: The email address of owner of the application. + :type owner: str + :param emails: + :type emails: list[str] + """ + + _attribute_map = { + 'owner': {'key': 'owner', 'type': 'str'}, + 'emails': {'key': 'emails', 'type': '[str]'}, + } + + def __init__(self, *, owner: str=None, emails=None, **kwargs) -> None: + super(UserAccessList, self).__init__(**kwargs) + self.owner = owner + self.emails = emails + + +class UserCollaborator(Model): + """UserCollaborator. + + :param email: The email address of the user. + :type email: str + """ + + _attribute_map = { + 'email': {'key': 'email', 'type': 'str'}, + } + + def __init__(self, *, email: str=None, **kwargs) -> None: + super(UserCollaborator, self).__init__(**kwargs) + self.email = email + + +class VersionInfo(Model): + """Object model of an application version. + + All required parameters must be populated in order to send to Azure. + + :param version: Required. The version ID. E.g.: "0.1" + :type version: str + :param created_date_time: The version's creation timestamp. + :type created_date_time: datetime + :param last_modified_date_time: Timestamp of the last update. + :type last_modified_date_time: datetime + :param last_trained_date_time: Timestamp of the last time the model was + trained. + :type last_trained_date_time: datetime + :param last_published_date_time: Timestamp when was last published. + :type last_published_date_time: datetime + :param endpoint_url: The Runtime endpoint URL for this model version. + :type endpoint_url: str + :param assigned_endpoint_key: The endpoint key. + :type assigned_endpoint_key: dict[str, str] + :param external_api_keys: External keys. + :type external_api_keys: object + :param intents_count: Number of intents in this model. + :type intents_count: int + :param entities_count: Number of entities in this model. + :type entities_count: int + :param endpoint_hits_count: Number of calls made to this endpoint. + :type endpoint_hits_count: int + :param training_status: Required. The current training status. Possible + values include: 'NeedsTraining', 'InProgress', 'Trained' + :type training_status: str or + ~azure.cognitiveservices.language.luis.authoring.models.TrainingStatus + """ + + _validation = { + 'version': {'required': True}, + 'training_status': {'required': True}, + } + + _attribute_map = { + 'version': {'key': 'version', 'type': 'str'}, + 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, + 'last_modified_date_time': {'key': 'lastModifiedDateTime', 'type': 'iso-8601'}, + 'last_trained_date_time': {'key': 'lastTrainedDateTime', 'type': 'iso-8601'}, + 'last_published_date_time': {'key': 'lastPublishedDateTime', 'type': 'iso-8601'}, + 'endpoint_url': {'key': 'endpointUrl', 'type': 'str'}, + 'assigned_endpoint_key': {'key': 'assignedEndpointKey', 'type': '{str}'}, + 'external_api_keys': {'key': 'externalApiKeys', 'type': 'object'}, + 'intents_count': {'key': 'intentsCount', 'type': 'int'}, + 'entities_count': {'key': 'entitiesCount', 'type': 'int'}, + 'endpoint_hits_count': {'key': 'endpointHitsCount', 'type': 'int'}, + 'training_status': {'key': 'trainingStatus', 'type': 'TrainingStatus'}, + } + + def __init__(self, *, version: str, training_status, created_date_time=None, last_modified_date_time=None, last_trained_date_time=None, last_published_date_time=None, endpoint_url: str=None, assigned_endpoint_key=None, external_api_keys=None, intents_count: int=None, entities_count: int=None, endpoint_hits_count: int=None, **kwargs) -> None: + super(VersionInfo, self).__init__(**kwargs) + self.version = version + self.created_date_time = created_date_time + self.last_modified_date_time = last_modified_date_time + self.last_trained_date_time = last_trained_date_time + self.last_published_date_time = last_published_date_time + self.endpoint_url = endpoint_url + self.assigned_endpoint_key = assigned_endpoint_key + self.external_api_keys = external_api_keys + self.intents_count = intents_count + self.entities_count = entities_count + self.endpoint_hits_count = endpoint_hits_count + self.training_status = training_status + + +class WordListBaseUpdateObject(Model): + """Object model for updating one of the list entity's sublists. + + :param canonical_form: The standard form that the list represents. + :type canonical_form: str + :param list: List of synonym words. + :type list: list[str] + """ + + _attribute_map = { + 'canonical_form': {'key': 'canonicalForm', 'type': 'str'}, + 'list': {'key': 'list', 'type': '[str]'}, + } + + def __init__(self, *, canonical_form: str=None, list=None, **kwargs) -> None: + super(WordListBaseUpdateObject, self).__init__(**kwargs) + self.canonical_form = canonical_form + self.list = list + + +class WordListObject(Model): + """Sublist of items for a list entity. + + :param canonical_form: The standard form that the list represents. + :type canonical_form: str + :param list: List of synonym words. + :type list: list[str] + """ + + _attribute_map = { + 'canonical_form': {'key': 'canonicalForm', 'type': 'str'}, + 'list': {'key': 'list', 'type': '[str]'}, + } + + def __init__(self, *, canonical_form: str=None, list=None, **kwargs) -> None: + super(WordListObject, self).__init__(**kwargs) + self.canonical_form = canonical_form + self.list = list diff --git a/src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/__init__.py b/src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/__init__.py new file mode 100644 index 00000000000..0d53c240e24 --- /dev/null +++ b/src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/__init__.py @@ -0,0 +1,32 @@ +# 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 ._features_operations import FeaturesOperations +from ._examples_operations import ExamplesOperations +from ._model_operations import ModelOperations +from ._apps_operations import AppsOperations +from ._versions_operations import VersionsOperations +from ._train_operations import TrainOperations +from ._pattern_operations import PatternOperations +from ._settings_operations import SettingsOperations +from ._azure_accounts_operations import AzureAccountsOperations + +__all__ = [ + 'FeaturesOperations', + 'ExamplesOperations', + 'ModelOperations', + 'AppsOperations', + 'VersionsOperations', + 'TrainOperations', + 'PatternOperations', + 'SettingsOperations', + 'AzureAccountsOperations', +] diff --git a/src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_apps_operations.py b/src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_apps_operations.py new file mode 100644 index 00000000000..3fae6767912 --- /dev/null +++ b/src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_apps_operations.py @@ -0,0 +1,1397 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.pipeline import ClientRawResponse +from msrest.exceptions import HttpOperationError + +from .. import models + + +class AppsOperations(object): + """AppsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + + self.config = config + + def add( + self, application_create_object, custom_headers=None, raw=False, **operation_config): + """Creates a new LUIS app. + + :param application_create_object: An application containing Name, + Description (optional), Culture, Usage Scenario (optional), Domain + (optional) and initial version ID (optional) of the application. + Default value for the version ID is "0.1". Note: the culture cannot be + changed after the app is created. + :type application_create_object: + ~azure.cognitiveservices.language.luis.authoring.models.ApplicationCreateObject + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.add.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(application_create_object, 'ApplicationCreateObject') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + add.metadata = {'url': '/apps/'} + + def list( + self, skip=0, take=100, custom_headers=None, raw=False, **operation_config): + """Lists all of the user's applications. + + :param skip: The number of entries to skip. Default value is 0. + :type skip: int + :param take: The number of entries to return. Maximum page size is + 500. Default is 100. + :type take: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.ApplicationInfoResponse] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if skip is not None: + query_parameters['skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + if take is not None: + query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[ApplicationInfoResponse]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/apps/'} + + def import_method( + self, luis_app, app_name=None, custom_headers=None, raw=False, **operation_config): + """Imports an application to LUIS, the application's structure is included + in the request body. + + :param luis_app: A LUIS application structure. + :type luis_app: + ~azure.cognitiveservices.language.luis.authoring.models.LuisApp + :param app_name: The application name to create. If not specified, the + application name will be read from the imported object. If the + application name already exists, an error is returned. + :type app_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.import_method.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if app_name is not None: + query_parameters['appName'] = self._serialize.query("app_name", app_name, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(luis_app, 'LuisApp') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + import_method.metadata = {'url': '/apps/import'} + + def list_cortana_endpoints( + self, custom_headers=None, raw=False, **operation_config): + """Gets the endpoint URLs for the prebuilt Cortana applications. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PersonalAssistantsResponse or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.PersonalAssistantsResponse + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_cortana_endpoints.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PersonalAssistantsResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_cortana_endpoints.metadata = {'url': '/apps/assistants'} + + def list_domains( + self, custom_headers=None, raw=False, **operation_config): + """Gets the available application domains. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: list[str] or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_domains.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[str]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_domains.metadata = {'url': '/apps/domains'} + + def list_usage_scenarios( + self, custom_headers=None, raw=False, **operation_config): + """Gets the application available usage scenarios. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: list[str] or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_usage_scenarios.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[str]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_usage_scenarios.metadata = {'url': '/apps/usagescenarios'} + + def list_supported_cultures( + self, custom_headers=None, raw=False, **operation_config): + """Gets a list of supported cultures. Cultures are equivalent to the + written language and locale. For example,"en-us" represents the U.S. + variation of English. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.AvailableCulture] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_supported_cultures.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[AvailableCulture]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_supported_cultures.metadata = {'url': '/apps/cultures'} + + def download_query_logs( + self, app_id, custom_headers=None, raw=False, callback=None, **operation_config): + """Gets the logs of the past month's endpoint queries for the application. + + :param app_id: The application ID. + :type app_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param callback: When specified, will be called with each chunk of + data that is streamed. The callback should take two arguments, the + bytes of the current chunk of data and the response object. If the + data is uploading, response will be None. + :type callback: Callable[Bytes, response=None] + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: Generator or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`HttpOperationError` + """ + # Construct URL + url = self.download_query_logs.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/octet-stream' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=True, **operation_config) + + if response.status_code not in [200]: + raise HttpOperationError(self._deserialize, response) + + deserialized = self._client.stream_download(response, callback) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + download_query_logs.metadata = {'url': '/apps/{appId}/querylogs'} + + def get( + self, app_id, custom_headers=None, raw=False, **operation_config): + """Gets the application info. + + :param app_id: The application ID. + :type app_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ApplicationInfoResponse or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.ApplicationInfoResponse + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ApplicationInfoResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/apps/{appId}'} + + def update( + self, app_id, name=None, description=None, custom_headers=None, raw=False, **operation_config): + """Updates the name or description of the application. + + :param app_id: The application ID. + :type app_id: str + :param name: The application's new name. + :type name: str + :param description: The application's new description. + :type description: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + application_update_object = models.ApplicationUpdateObject(name=name, description=description) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(application_update_object, 'ApplicationUpdateObject') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/apps/{appId}'} + + def delete( + self, app_id, force=False, custom_headers=None, raw=False, **operation_config): + """Deletes an application. + + :param app_id: The application ID. + :type app_id: str + :param force: A flag to indicate whether to force an operation. + :type force: bool + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if force is not None: + query_parameters['force'] = self._serialize.query("force", force, 'bool') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete.metadata = {'url': '/apps/{appId}'} + + def publish( + self, app_id, version_id=None, is_staging=False, custom_headers=None, raw=False, **operation_config): + """Publishes a specific version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID to publish. + :type version_id: str + :param is_staging: Indicates if the staging slot should be used, + instead of the Production one. + :type is_staging: bool + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ProductionOrStagingEndpointInfo or ClientRawResponse if + raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.ProductionOrStagingEndpointInfo + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + application_publish_object = models.ApplicationPublishObject(version_id=version_id, is_staging=is_staging) + + # Construct URL + url = self.publish.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(application_publish_object, 'ApplicationPublishObject') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201, 207]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('ProductionOrStagingEndpointInfo', response) + if response.status_code == 207: + deserialized = self._deserialize('ProductionOrStagingEndpointInfo', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + publish.metadata = {'url': '/apps/{appId}/publish'} + + def get_settings( + self, app_id, custom_headers=None, raw=False, **operation_config): + """Get the application settings including 'UseAllTrainingData'. + + :param app_id: The application ID. + :type app_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ApplicationSettings or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.ApplicationSettings + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_settings.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ApplicationSettings', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_settings.metadata = {'url': '/apps/{appId}/settings'} + + def update_settings( + self, app_id, is_public=None, custom_headers=None, raw=False, **operation_config): + """Updates the application settings including 'UseAllTrainingData'. + + :param app_id: The application ID. + :type app_id: str + :param is_public: Setting your application as public allows other + people to use your application's endpoint using their own keys. + :type is_public: bool + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + application_setting_update_object = models.ApplicationSettingUpdateObject(is_public=is_public) + + # Construct URL + url = self.update_settings.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(application_setting_update_object, 'ApplicationSettingUpdateObject') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_settings.metadata = {'url': '/apps/{appId}/settings'} + + def get_publish_settings( + self, app_id, custom_headers=None, raw=False, **operation_config): + """Get the application publish settings including 'UseAllTrainingData'. + + :param app_id: The application ID. + :type app_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PublishSettings or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.PublishSettings + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_publish_settings.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PublishSettings', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_publish_settings.metadata = {'url': '/apps/{appId}/publishsettings'} + + def update_publish_settings( + self, app_id, publish_setting_update_object, custom_headers=None, raw=False, **operation_config): + """Updates the application publish settings including + 'UseAllTrainingData'. + + :param app_id: The application ID. + :type app_id: str + :param publish_setting_update_object: An object containing the new + publish application settings. + :type publish_setting_update_object: + ~azure.cognitiveservices.language.luis.authoring.models.PublishSettingUpdateObject + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update_publish_settings.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(publish_setting_update_object, 'PublishSettingUpdateObject') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_publish_settings.metadata = {'url': '/apps/{appId}/publishsettings'} + + def list_endpoints( + self, app_id, custom_headers=None, raw=False, **operation_config): + """Returns the available endpoint deployment regions and URLs. + + :param app_id: The application ID. + :type app_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: dict or ClientRawResponse if raw=true + :rtype: dict[str, str] or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_endpoints.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('{str}', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_endpoints.metadata = {'url': '/apps/{appId}/endpoints'} + + def list_available_custom_prebuilt_domains( + self, custom_headers=None, raw=False, **operation_config): + """Gets all the available custom prebuilt domains for all cultures. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.PrebuiltDomain] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_available_custom_prebuilt_domains.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[PrebuiltDomain]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_available_custom_prebuilt_domains.metadata = {'url': '/apps/customprebuiltdomains'} + + def add_custom_prebuilt_domain( + self, domain_name=None, culture=None, custom_headers=None, raw=False, **operation_config): + """Adds a prebuilt domain along with its intent and entity models as a new + application. + + :param domain_name: The domain name. + :type domain_name: str + :param culture: The culture of the new domain. + :type culture: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + prebuilt_domain_create_object = models.PrebuiltDomainCreateObject(domain_name=domain_name, culture=culture) + + # Construct URL + url = self.add_custom_prebuilt_domain.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(prebuilt_domain_create_object, 'PrebuiltDomainCreateObject') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + add_custom_prebuilt_domain.metadata = {'url': '/apps/customprebuiltdomains'} + + def list_available_custom_prebuilt_domains_for_culture( + self, culture, custom_headers=None, raw=False, **operation_config): + """Gets all the available prebuilt domains for a specific culture. + + :param culture: Culture. + :type culture: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.PrebuiltDomain] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_available_custom_prebuilt_domains_for_culture.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'culture': self._serialize.url("culture", culture, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[PrebuiltDomain]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_available_custom_prebuilt_domains_for_culture.metadata = {'url': '/apps/customprebuiltdomains/{culture}'} + + def package_published_application_as_gzip( + self, app_id, slot_name, custom_headers=None, raw=False, callback=None, **operation_config): + """package - Gets published LUIS application package in binary stream GZip + format. + + Packages a published LUIS application as a GZip file to be used in the + LUIS container. + + :param app_id: The application ID. + :type app_id: str + :param slot_name: The publishing slot name. + :type slot_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param callback: When specified, will be called with each chunk of + data that is streamed. The callback should take two arguments, the + bytes of the current chunk of data and the response object. If the + data is uploading, response will be None. + :type callback: Callable[Bytes, response=None] + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: Generator or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.package_published_application_as_gzip.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'slotName': self._serialize.url("slot_name", slot_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=True, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = self._client.stream_download(response, callback) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + package_published_application_as_gzip.metadata = {'url': '/package/{appId}/slot/{slotName}/gzip'} + + def package_trained_application_as_gzip( + self, app_id, version_id, custom_headers=None, raw=False, callback=None, **operation_config): + """package - Gets trained LUIS application package in binary stream GZip + format. + + Packages trained LUIS application as GZip file to be used in the LUIS + container. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param callback: When specified, will be called with each chunk of + data that is streamed. The callback should take two arguments, the + bytes of the current chunk of data and the response object. If the + data is uploading, response will be None. + :type callback: Callable[Bytes, response=None] + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: Generator or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.package_trained_application_as_gzip.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=True, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = self._client.stream_download(response, callback) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + package_trained_application_as_gzip.metadata = {'url': '/package/{appId}/versions/{versionId}/gzip'} + + def import_v2_app( + self, luis_app_v2, app_name=None, custom_headers=None, raw=False, **operation_config): + """Imports an application to LUIS, the application's structure is included + in the request body. + + :param luis_app_v2: A LUIS application structure. + :type luis_app_v2: + ~azure.cognitiveservices.language.luis.authoring.models.LuisAppV2 + :param app_name: The application name to create. If not specified, the + application name will be read from the imported object. If the + application name already exists, an error is returned. + :type app_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.import_v2_app.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if app_name is not None: + query_parameters['appName'] = self._serialize.query("app_name", app_name, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(luis_app_v2, 'LuisAppV2') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + import_v2_app.metadata = {'url': '/apps/import'} + + def import_lu_format( + self, luis_app_lu, app_name=None, custom_headers=None, raw=False, **operation_config): + """Imports an application to LUIS, the application's structure is included + in the request body. + + :param luis_app_lu: A LUIS application structure. + :type luis_app_lu: str + :param app_name: The application name to create. If not specified, the + application name will be read from the imported object. If the + application name already exists, an error is returned. + :type app_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.import_lu_format.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if app_name is not None: + query_parameters['appName'] = self._serialize.query("app_name", app_name, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'text/plain' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(luis_app_lu, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + import_lu_format.metadata = {'url': '/apps/import'} diff --git a/src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_azure_accounts_operations.py b/src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_azure_accounts_operations.py new file mode 100644 index 00000000000..462f857f162 --- /dev/null +++ b/src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_azure_accounts_operations.py @@ -0,0 +1,296 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class AzureAccountsOperations(object): + """AzureAccountsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + + self.config = config + + def assign_to_app( + self, app_id, arm_token=None, azure_account_info_object=None, custom_headers=None, raw=False, **operation_config): + """apps - Assign a LUIS Azure account to an application. + + Assigns an Azure account to the application. + + :param app_id: The application ID. + :type app_id: str + :param arm_token: The custom arm token header to use; containing the + user's ARM token used to validate azure accounts information. + :type arm_token: str + :param azure_account_info_object: The Azure account information + object. + :type azure_account_info_object: + ~azure.cognitiveservices.language.luis.authoring.models.AzureAccountInfoObject + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.assign_to_app.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + if arm_token is not None: + header_parameters['ArmToken'] = self._serialize.header("arm_token", arm_token, 'str') + + # Construct body + if azure_account_info_object is not None: + body_content = self._serialize.body(azure_account_info_object, 'AzureAccountInfoObject') + else: + body_content = None + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + assign_to_app.metadata = {'url': '/apps/{appId}/azureaccounts'} + + def get_assigned( + self, app_id, arm_token=None, custom_headers=None, raw=False, **operation_config): + """apps - Get LUIS Azure accounts assigned to the application. + + Gets the LUIS Azure accounts assigned to the application for the user + using his ARM token. + + :param app_id: The application ID. + :type app_id: str + :param arm_token: The custom arm token header to use; containing the + user's ARM token used to validate azure accounts information. + :type arm_token: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.AzureAccountInfoObject] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_assigned.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + if arm_token is not None: + header_parameters['ArmToken'] = self._serialize.header("arm_token", arm_token, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[AzureAccountInfoObject]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_assigned.metadata = {'url': '/apps/{appId}/azureaccounts'} + + def remove_from_app( + self, app_id, arm_token=None, azure_account_info_object=None, custom_headers=None, raw=False, **operation_config): + """apps - Removes an assigned LUIS Azure account from an application. + + Removes assigned Azure account from the application. + + :param app_id: The application ID. + :type app_id: str + :param arm_token: The custom arm token header to use; containing the + user's ARM token used to validate azure accounts information. + :type arm_token: str + :param azure_account_info_object: The Azure account information + object. + :type azure_account_info_object: + ~azure.cognitiveservices.language.luis.authoring.models.AzureAccountInfoObject + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.remove_from_app.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + if arm_token is not None: + header_parameters['ArmToken'] = self._serialize.header("arm_token", arm_token, 'str') + + # Construct body + if azure_account_info_object is not None: + body_content = self._serialize.body(azure_account_info_object, 'AzureAccountInfoObject') + else: + body_content = None + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + remove_from_app.metadata = {'url': '/apps/{appId}/azureaccounts'} + + def list_user_luis_accounts( + self, arm_token=None, custom_headers=None, raw=False, **operation_config): + """user - Get LUIS Azure accounts. + + Gets the LUIS Azure accounts for the user using his ARM token. + + :param arm_token: The custom arm token header to use; containing the + user's ARM token used to validate azure accounts information. + :type arm_token: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.AzureAccountInfoObject] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_user_luis_accounts.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + if arm_token is not None: + header_parameters['ArmToken'] = self._serialize.header("arm_token", arm_token, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[AzureAccountInfoObject]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_user_luis_accounts.metadata = {'url': '/azureaccounts'} diff --git a/src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_examples_operations.py b/src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_examples_operations.py new file mode 100644 index 00000000000..a25af3a6395 --- /dev/null +++ b/src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_examples_operations.py @@ -0,0 +1,304 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ExamplesOperations(object): + """ExamplesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + + self.config = config + + def add( + self, app_id, version_id, example_label_object, enable_nested_children=False, custom_headers=None, raw=False, **operation_config): + """Adds a labeled example utterance in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param example_label_object: A labeled example utterance with the + expected intent and entities. + :type example_label_object: + ~azure.cognitiveservices.language.luis.authoring.models.ExampleLabelObject + :param enable_nested_children: Toggles nested/flat format + :type enable_nested_children: bool + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: LabelExampleResponse or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.LabelExampleResponse + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.add.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if enable_nested_children is not None: + query_parameters['enableNestedChildren'] = self._serialize.query("enable_nested_children", enable_nested_children, 'bool') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(example_label_object, 'ExampleLabelObject') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('LabelExampleResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + add.metadata = {'url': '/apps/{appId}/versions/{versionId}/example'} + + def batch( + self, app_id, version_id, example_label_object_array, enable_nested_children=False, custom_headers=None, raw=False, **operation_config): + """Adds a batch of labeled example utterances to a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param example_label_object_array: Array of example utterances. + :type example_label_object_array: + list[~azure.cognitiveservices.language.luis.authoring.models.ExampleLabelObject] + :param enable_nested_children: Toggles nested/flat format + :type enable_nested_children: bool + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.BatchLabelExample] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.batch.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if enable_nested_children is not None: + query_parameters['enableNestedChildren'] = self._serialize.query("enable_nested_children", enable_nested_children, 'bool') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(example_label_object_array, '[ExampleLabelObject]') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201, 207]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('[BatchLabelExample]', response) + if response.status_code == 207: + deserialized = self._deserialize('[BatchLabelExample]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + batch.metadata = {'url': '/apps/{appId}/versions/{versionId}/examples'} + + def list( + self, app_id, version_id, skip=0, take=100, enable_nested_children=False, custom_headers=None, raw=False, **operation_config): + """Returns example utterances to be reviewed from a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param skip: The number of entries to skip. Default value is 0. + :type skip: int + :param take: The number of entries to return. Maximum page size is + 500. Default is 100. + :type take: int + :param enable_nested_children: Toggles nested/flat format + :type enable_nested_children: bool + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.LabeledUtterance] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if skip is not None: + query_parameters['skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + if take is not None: + query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0) + if enable_nested_children is not None: + query_parameters['enableNestedChildren'] = self._serialize.query("enable_nested_children", enable_nested_children, 'bool') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[LabeledUtterance]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/apps/{appId}/versions/{versionId}/examples'} + + def delete( + self, app_id, version_id, example_id, custom_headers=None, raw=False, **operation_config): + """Deletes the labeled example utterances with the specified ID from a + version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param example_id: The example ID. + :type example_id: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'exampleId': self._serialize.url("example_id", example_id, 'int') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete.metadata = {'url': '/apps/{appId}/versions/{versionId}/examples/{exampleId}'} diff --git a/src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_features_operations.py b/src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_features_operations.py new file mode 100644 index 00000000000..1843ed6e9d0 --- /dev/null +++ b/src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_features_operations.py @@ -0,0 +1,557 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class FeaturesOperations(object): + """FeaturesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + + self.config = config + + def add_phrase_list( + self, app_id, version_id, phraselist_create_object, custom_headers=None, raw=False, **operation_config): + """Creates a new phraselist feature in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param phraselist_create_object: A Phraselist object containing Name, + comma-separated Phrases and the isExchangeable boolean. Default value + for isExchangeable is true. + :type phraselist_create_object: + ~azure.cognitiveservices.language.luis.authoring.models.PhraselistCreateObject + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: int or ClientRawResponse if raw=true + :rtype: int or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.add_phrase_list.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(phraselist_create_object, 'PhraselistCreateObject') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('int', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + add_phrase_list.metadata = {'url': '/apps/{appId}/versions/{versionId}/phraselists'} + + def list_phrase_lists( + self, app_id, version_id, skip=0, take=100, custom_headers=None, raw=False, **operation_config): + """Gets all the phraselist features in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param skip: The number of entries to skip. Default value is 0. + :type skip: int + :param take: The number of entries to return. Maximum page size is + 500. Default is 100. + :type take: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.PhraseListFeatureInfo] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_phrase_lists.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if skip is not None: + query_parameters['skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + if take is not None: + query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[PhraseListFeatureInfo]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_phrase_lists.metadata = {'url': '/apps/{appId}/versions/{versionId}/phraselists'} + + def list( + self, app_id, version_id, skip=0, take=100, custom_headers=None, raw=False, **operation_config): + """Gets all the extraction phraselist and pattern features in a version of + the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param skip: The number of entries to skip. Default value is 0. + :type skip: int + :param take: The number of entries to return. Maximum page size is + 500. Default is 100. + :type take: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: FeaturesResponseObject or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.FeaturesResponseObject + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if skip is not None: + query_parameters['skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + if take is not None: + query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('FeaturesResponseObject', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/apps/{appId}/versions/{versionId}/features'} + + def get_phrase_list( + self, app_id, version_id, phraselist_id, custom_headers=None, raw=False, **operation_config): + """Gets phraselist feature info in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param phraselist_id: The ID of the feature to be retrieved. + :type phraselist_id: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PhraseListFeatureInfo or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.PhraseListFeatureInfo + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_phrase_list.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'phraselistId': self._serialize.url("phraselist_id", phraselist_id, 'int') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PhraseListFeatureInfo', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_phrase_list.metadata = {'url': '/apps/{appId}/versions/{versionId}/phraselists/{phraselistId}'} + + def update_phrase_list( + self, app_id, version_id, phraselist_id, phraselist_update_object=None, custom_headers=None, raw=False, **operation_config): + """Updates the phrases, the state and the name of the phraselist feature + in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param phraselist_id: The ID of the feature to be updated. + :type phraselist_id: int + :param phraselist_update_object: The new values for: - Just a boolean + called IsActive, in which case the status of the feature will be + changed. - Name, Pattern, Mode, and a boolean called IsActive to + update the feature. + :type phraselist_update_object: + ~azure.cognitiveservices.language.luis.authoring.models.PhraselistUpdateObject + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update_phrase_list.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'phraselistId': self._serialize.url("phraselist_id", phraselist_id, 'int') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + if phraselist_update_object is not None: + body_content = self._serialize.body(phraselist_update_object, 'PhraselistUpdateObject') + else: + body_content = None + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_phrase_list.metadata = {'url': '/apps/{appId}/versions/{versionId}/phraselists/{phraselistId}'} + + def delete_phrase_list( + self, app_id, version_id, phraselist_id, custom_headers=None, raw=False, **operation_config): + """Deletes a phraselist feature from a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param phraselist_id: The ID of the feature to be deleted. + :type phraselist_id: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete_phrase_list.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'phraselistId': self._serialize.url("phraselist_id", phraselist_id, 'int') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete_phrase_list.metadata = {'url': '/apps/{appId}/versions/{versionId}/phraselists/{phraselistId}'} + + def add_intent_feature( + self, app_id, version_id, intent_id, feature_relation_create_object, custom_headers=None, raw=False, **operation_config): + """Adds a new feature relation to be used by the intent in a version of + the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param intent_id: The intent classifier ID. + :type intent_id: str + :param feature_relation_create_object: A Feature relation information + object. + :type feature_relation_create_object: + ~azure.cognitiveservices.language.luis.authoring.models.ModelFeatureInformation + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.add_intent_feature.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'intentId': self._serialize.url("intent_id", intent_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(feature_relation_create_object, 'ModelFeatureInformation') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + add_intent_feature.metadata = {'url': '/apps/{appId}/versions/{versionId}/intents/{intentId}/features'} + + def add_entity_feature( + self, app_id, version_id, entity_id, feature_relation_create_object, custom_headers=None, raw=False, **operation_config): + """Adds a new feature relation to be used by the entity in a version of + the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: The entity extractor ID. + :type entity_id: str + :param feature_relation_create_object: A Feature relation information + object. + :type feature_relation_create_object: + ~azure.cognitiveservices.language.luis.authoring.models.ModelFeatureInformation + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.add_entity_feature.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(feature_relation_create_object, 'ModelFeatureInformation') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + add_entity_feature.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities/{entityId}/features'} diff --git a/src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_model_operations.py b/src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_model_operations.py new file mode 100644 index 00000000000..3cb9ff0f420 --- /dev/null +++ b/src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_model_operations.py @@ -0,0 +1,7086 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ModelOperations(object): + """ModelOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + + self.config = config + + def add_intent( + self, app_id, version_id, name=None, custom_headers=None, raw=False, **operation_config): + """Adds an intent to a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param name: Name of the new entity extractor. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + intent_create_object = models.ModelCreateObject(name=name) + + # Construct URL + url = self.add_intent.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(intent_create_object, 'ModelCreateObject') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + add_intent.metadata = {'url': '/apps/{appId}/versions/{versionId}/intents'} + + def list_intents( + self, app_id, version_id, skip=0, take=100, custom_headers=None, raw=False, **operation_config): + """Gets information about the intent models in a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param skip: The number of entries to skip. Default value is 0. + :type skip: int + :param take: The number of entries to return. Maximum page size is + 500. Default is 100. + :type take: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.IntentClassifier] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_intents.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if skip is not None: + query_parameters['skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + if take is not None: + query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[IntentClassifier]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_intents.metadata = {'url': '/apps/{appId}/versions/{versionId}/intents'} + + def add_entity( + self, app_id, version_id, children=None, name=None, custom_headers=None, raw=False, **operation_config): + """Adds an entity extractor to a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param children: Child entities. + :type children: + list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntityModelCreateObject] + :param name: Entity name. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + entity_model_create_object = models.EntityModelCreateObject(children=children, name=name) + + # Construct URL + url = self.add_entity.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(entity_model_create_object, 'EntityModelCreateObject') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + add_entity.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities'} + + def list_entities( + self, app_id, version_id, skip=0, take=100, custom_headers=None, raw=False, **operation_config): + """Gets information about all the simple entity models in a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param skip: The number of entries to skip. Default value is 0. + :type skip: int + :param take: The number of entries to return. Maximum page size is + 500. Default is 100. + :type take: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.NDepthEntityExtractor] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_entities.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if skip is not None: + query_parameters['skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + if take is not None: + query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[NDepthEntityExtractor]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_entities.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities'} + + def list_hierarchical_entities( + self, app_id, version_id, skip=0, take=100, custom_headers=None, raw=False, **operation_config): + """Gets information about all the hierarchical entity models in a version + of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param skip: The number of entries to skip. Default value is 0. + :type skip: int + :param take: The number of entries to return. Maximum page size is + 500. Default is 100. + :type take: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.HierarchicalEntityExtractor] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_hierarchical_entities.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if skip is not None: + query_parameters['skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + if take is not None: + query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[HierarchicalEntityExtractor]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_hierarchical_entities.metadata = {'url': '/apps/{appId}/versions/{versionId}/hierarchicalentities'} + + def list_composite_entities( + self, app_id, version_id, skip=0, take=100, custom_headers=None, raw=False, **operation_config): + """Gets information about all the composite entity models in a version of + the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param skip: The number of entries to skip. Default value is 0. + :type skip: int + :param take: The number of entries to return. Maximum page size is + 500. Default is 100. + :type take: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.CompositeEntityExtractor] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_composite_entities.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if skip is not None: + query_parameters['skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + if take is not None: + query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[CompositeEntityExtractor]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_composite_entities.metadata = {'url': '/apps/{appId}/versions/{versionId}/compositeentities'} + + def list_closed_lists( + self, app_id, version_id, skip=0, take=100, custom_headers=None, raw=False, **operation_config): + """Gets information about all the list entity models in a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param skip: The number of entries to skip. Default value is 0. + :type skip: int + :param take: The number of entries to return. Maximum page size is + 500. Default is 100. + :type take: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.ClosedListEntityExtractor] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_closed_lists.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if skip is not None: + query_parameters['skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + if take is not None: + query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[ClosedListEntityExtractor]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_closed_lists.metadata = {'url': '/apps/{appId}/versions/{versionId}/closedlists'} + + def add_closed_list( + self, app_id, version_id, sub_lists=None, name=None, custom_headers=None, raw=False, **operation_config): + """Adds a list entity model to a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param sub_lists: Sublists for the feature. + :type sub_lists: + list[~azure.cognitiveservices.language.luis.authoring.models.WordListObject] + :param name: Name of the list entity. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + closed_list_model_create_object = models.ClosedListModelCreateObject(sub_lists=sub_lists, name=name) + + # Construct URL + url = self.add_closed_list.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(closed_list_model_create_object, 'ClosedListModelCreateObject') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + add_closed_list.metadata = {'url': '/apps/{appId}/versions/{versionId}/closedlists'} + + def add_prebuilt( + self, app_id, version_id, prebuilt_extractor_names, custom_headers=None, raw=False, **operation_config): + """Adds a list of prebuilt entities to a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param prebuilt_extractor_names: An array of prebuilt entity extractor + names. + :type prebuilt_extractor_names: list[str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.PrebuiltEntityExtractor] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.add_prebuilt.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(prebuilt_extractor_names, '[str]') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('[PrebuiltEntityExtractor]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + add_prebuilt.metadata = {'url': '/apps/{appId}/versions/{versionId}/prebuilts'} + + def list_prebuilts( + self, app_id, version_id, skip=0, take=100, custom_headers=None, raw=False, **operation_config): + """Gets information about all the prebuilt entities in a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param skip: The number of entries to skip. Default value is 0. + :type skip: int + :param take: The number of entries to return. Maximum page size is + 500. Default is 100. + :type take: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.PrebuiltEntityExtractor] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_prebuilts.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if skip is not None: + query_parameters['skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + if take is not None: + query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[PrebuiltEntityExtractor]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_prebuilts.metadata = {'url': '/apps/{appId}/versions/{versionId}/prebuilts'} + + def list_prebuilt_entities( + self, app_id, version_id, custom_headers=None, raw=False, **operation_config): + """Gets all the available prebuilt entities in a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.AvailablePrebuiltEntityModel] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_prebuilt_entities.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[AvailablePrebuiltEntityModel]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_prebuilt_entities.metadata = {'url': '/apps/{appId}/versions/{versionId}/listprebuilts'} + + def list_models( + self, app_id, version_id, skip=0, take=100, custom_headers=None, raw=False, **operation_config): + """Gets information about all the intent and entity models in a version of + the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param skip: The number of entries to skip. Default value is 0. + :type skip: int + :param take: The number of entries to return. Maximum page size is + 500. Default is 100. + :type take: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.ModelInfoResponse] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_models.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if skip is not None: + query_parameters['skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + if take is not None: + query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[ModelInfoResponse]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_models.metadata = {'url': '/apps/{appId}/versions/{versionId}/models'} + + def examples_method( + self, app_id, version_id, model_id, skip=0, take=100, custom_headers=None, raw=False, **operation_config): + """Gets the example utterances for the given intent or entity model in a + version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param model_id: The ID (GUID) of the model. + :type model_id: str + :param skip: The number of entries to skip. Default value is 0. + :type skip: int + :param take: The number of entries to return. Maximum page size is + 500. Default is 100. + :type take: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.LabelTextObject] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.examples_method.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'modelId': self._serialize.url("model_id", model_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if skip is not None: + query_parameters['skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + if take is not None: + query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[LabelTextObject]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + examples_method.metadata = {'url': '/apps/{appId}/versions/{versionId}/models/{modelId}/examples'} + + def get_intent( + self, app_id, version_id, intent_id, custom_headers=None, raw=False, **operation_config): + """Gets information about the intent model in a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param intent_id: The intent classifier ID. + :type intent_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: IntentClassifier or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.IntentClassifier + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_intent.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'intentId': self._serialize.url("intent_id", intent_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('IntentClassifier', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_intent.metadata = {'url': '/apps/{appId}/versions/{versionId}/intents/{intentId}'} + + def update_intent( + self, app_id, version_id, intent_id, name=None, custom_headers=None, raw=False, **operation_config): + """Updates the name of an intent in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param intent_id: The intent classifier ID. + :type intent_id: str + :param name: The entity's new name. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + model_update_object = models.ModelUpdateObject(name=name) + + # Construct URL + url = self.update_intent.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'intentId': self._serialize.url("intent_id", intent_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(model_update_object, 'ModelUpdateObject') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_intent.metadata = {'url': '/apps/{appId}/versions/{versionId}/intents/{intentId}'} + + def delete_intent( + self, app_id, version_id, intent_id, delete_utterances=False, custom_headers=None, raw=False, **operation_config): + """Deletes an intent from a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param intent_id: The intent classifier ID. + :type intent_id: str + :param delete_utterances: If true, deletes the intent's example + utterances. If false, moves the example utterances to the None intent. + The default value is false. + :type delete_utterances: bool + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete_intent.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'intentId': self._serialize.url("intent_id", intent_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if delete_utterances is not None: + query_parameters['deleteUtterances'] = self._serialize.query("delete_utterances", delete_utterances, 'bool') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete_intent.metadata = {'url': '/apps/{appId}/versions/{versionId}/intents/{intentId}'} + + def get_entity( + self, app_id, version_id, entity_id, custom_headers=None, raw=False, **operation_config): + """Gets information about an entity model in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: The entity extractor ID. + :type entity_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: NDepthEntityExtractor or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.NDepthEntityExtractor + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_entity.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('NDepthEntityExtractor', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_entity.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities/{entityId}'} + + def delete_entity( + self, app_id, version_id, entity_id, custom_headers=None, raw=False, **operation_config): + """Deletes an entity or a child from a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: The entity extractor or the child entity extractor + ID. + :type entity_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete_entity.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete_entity.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities/{entityId}'} + + def update_entity_child( + self, app_id, version_id, entity_id, name=None, instance_of=None, custom_headers=None, raw=False, **operation_config): + """Updates the name of an entity extractor or the name and instanceOf + model of a child entity extractor. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: The entity extractor or the child entity extractor + ID. + :type entity_id: str + :param name: Entity name. + :type name: str + :param instance_of: The instance of model name + :type instance_of: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + entity_model_update_object = models.EntityModelUpdateObject(name=name, instance_of=instance_of) + + # Construct URL + url = self.update_entity_child.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(entity_model_update_object, 'EntityModelUpdateObject') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_entity_child.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities/{entityId}'} + + def get_intent_features( + self, app_id, version_id, intent_id, custom_headers=None, raw=False, **operation_config): + """Gets the information of the features used by the intent in a version of + the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param intent_id: The intent classifier ID. + :type intent_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.ModelFeatureInformation] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_intent_features.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'intentId': self._serialize.url("intent_id", intent_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[ModelFeatureInformation]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_intent_features.metadata = {'url': '/apps/{appId}/versions/{versionId}/intents/{intentId}/features'} + + def replace_intent_features( + self, app_id, version_id, intent_id, feature_relations_update_object, custom_headers=None, raw=False, **operation_config): + """Updates the information of the features used by the intent in a version + of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param intent_id: The intent classifier ID. + :type intent_id: str + :param feature_relations_update_object: A list of feature information + objects containing the new feature relations. + :type feature_relations_update_object: + list[~azure.cognitiveservices.language.luis.authoring.models.ModelFeatureInformation] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.replace_intent_features.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'intentId': self._serialize.url("intent_id", intent_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(feature_relations_update_object, '[ModelFeatureInformation]') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + replace_intent_features.metadata = {'url': '/apps/{appId}/versions/{versionId}/intents/{intentId}/features'} + + def delete_intent_feature( + self, app_id, version_id, intent_id, feature_relation_delete_object, custom_headers=None, raw=False, **operation_config): + """Deletes a relation from the feature relations used by the intent in a + version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param intent_id: The intent classifier ID. + :type intent_id: str + :param feature_relation_delete_object: A feature information object + containing the feature relation to delete. + :type feature_relation_delete_object: + ~azure.cognitiveservices.language.luis.authoring.models.ModelFeatureInformation + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete_intent_feature.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'intentId': self._serialize.url("intent_id", intent_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(feature_relation_delete_object, 'ModelFeatureInformation') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete_intent_feature.metadata = {'url': '/apps/{appId}/versions/{versionId}/intents/{intentId}/features'} + + def get_entity_features( + self, app_id, version_id, entity_id, custom_headers=None, raw=False, **operation_config): + """Gets the information of the features used by the entity in a version of + the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: The entity extractor ID. + :type entity_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.ModelFeatureInformation] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_entity_features.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[ModelFeatureInformation]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_entity_features.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities/{entityId}/features'} + + def replace_entity_features( + self, app_id, version_id, entity_id, feature_relations_update_object, custom_headers=None, raw=False, **operation_config): + """Updates the information of the features used by the entity in a version + of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: The entity extractor ID. + :type entity_id: str + :param feature_relations_update_object: A list of feature information + objects containing the new feature relations. + :type feature_relations_update_object: + list[~azure.cognitiveservices.language.luis.authoring.models.ModelFeatureInformation] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.replace_entity_features.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(feature_relations_update_object, '[ModelFeatureInformation]') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + replace_entity_features.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities/{entityId}/features'} + + def delete_entity_feature( + self, app_id, version_id, entity_id, feature_relation_delete_object, custom_headers=None, raw=False, **operation_config): + """Deletes a relation from the feature relations used by the entity in a + version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: The entity extractor ID. + :type entity_id: str + :param feature_relation_delete_object: A feature information object + containing the feature relation to delete. + :type feature_relation_delete_object: + ~azure.cognitiveservices.language.luis.authoring.models.ModelFeatureInformation + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete_entity_feature.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(feature_relation_delete_object, 'ModelFeatureInformation') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete_entity_feature.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities/{entityId}/features'} + + def get_hierarchical_entity( + self, app_id, version_id, h_entity_id, custom_headers=None, raw=False, **operation_config): + """Gets information about a hierarchical entity in a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param h_entity_id: The hierarchical entity extractor ID. + :type h_entity_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: HierarchicalEntityExtractor or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.HierarchicalEntityExtractor + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_hierarchical_entity.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'hEntityId': self._serialize.url("h_entity_id", h_entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('HierarchicalEntityExtractor', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_hierarchical_entity.metadata = {'url': '/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}'} + + def update_hierarchical_entity( + self, app_id, version_id, h_entity_id, name=None, custom_headers=None, raw=False, **operation_config): + """Updates the name of a hierarchical entity model in a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param h_entity_id: The hierarchical entity extractor ID. + :type h_entity_id: str + :param name: The entity's new name. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + model_update_object = models.ModelUpdateObject(name=name) + + # Construct URL + url = self.update_hierarchical_entity.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'hEntityId': self._serialize.url("h_entity_id", h_entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(model_update_object, 'ModelUpdateObject') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_hierarchical_entity.metadata = {'url': '/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}'} + + def delete_hierarchical_entity( + self, app_id, version_id, h_entity_id, custom_headers=None, raw=False, **operation_config): + """Deletes a hierarchical entity from a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param h_entity_id: The hierarchical entity extractor ID. + :type h_entity_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete_hierarchical_entity.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'hEntityId': self._serialize.url("h_entity_id", h_entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete_hierarchical_entity.metadata = {'url': '/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}'} + + def get_composite_entity( + self, app_id, version_id, c_entity_id, custom_headers=None, raw=False, **operation_config): + """Gets information about a composite entity in a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param c_entity_id: The composite entity extractor ID. + :type c_entity_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CompositeEntityExtractor or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.CompositeEntityExtractor + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_composite_entity.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'cEntityId': self._serialize.url("c_entity_id", c_entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CompositeEntityExtractor', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_composite_entity.metadata = {'url': '/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}'} + + def update_composite_entity( + self, app_id, version_id, c_entity_id, children=None, name=None, custom_headers=None, raw=False, **operation_config): + """Updates a composite entity in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param c_entity_id: The composite entity extractor ID. + :type c_entity_id: str + :param children: Child entities. + :type children: list[str] + :param name: Entity name. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + composite_model_update_object = models.CompositeEntityModel(children=children, name=name) + + # Construct URL + url = self.update_composite_entity.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'cEntityId': self._serialize.url("c_entity_id", c_entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(composite_model_update_object, 'CompositeEntityModel') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_composite_entity.metadata = {'url': '/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}'} + + def delete_composite_entity( + self, app_id, version_id, c_entity_id, custom_headers=None, raw=False, **operation_config): + """Deletes a composite entity from a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param c_entity_id: The composite entity extractor ID. + :type c_entity_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete_composite_entity.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'cEntityId': self._serialize.url("c_entity_id", c_entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete_composite_entity.metadata = {'url': '/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}'} + + def get_closed_list( + self, app_id, version_id, cl_entity_id, custom_headers=None, raw=False, **operation_config): + """Gets information about a list entity in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param cl_entity_id: The list model ID. + :type cl_entity_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ClosedListEntityExtractor or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.ClosedListEntityExtractor + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_closed_list.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'clEntityId': self._serialize.url("cl_entity_id", cl_entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ClosedListEntityExtractor', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_closed_list.metadata = {'url': '/apps/{appId}/versions/{versionId}/closedlists/{clEntityId}'} + + def update_closed_list( + self, app_id, version_id, cl_entity_id, sub_lists=None, name=None, custom_headers=None, raw=False, **operation_config): + """Updates the list entity in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param cl_entity_id: The list model ID. + :type cl_entity_id: str + :param sub_lists: The new sublists for the feature. + :type sub_lists: + list[~azure.cognitiveservices.language.luis.authoring.models.WordListObject] + :param name: The new name of the list entity. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + closed_list_model_update_object = models.ClosedListModelUpdateObject(sub_lists=sub_lists, name=name) + + # Construct URL + url = self.update_closed_list.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'clEntityId': self._serialize.url("cl_entity_id", cl_entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(closed_list_model_update_object, 'ClosedListModelUpdateObject') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_closed_list.metadata = {'url': '/apps/{appId}/versions/{versionId}/closedlists/{clEntityId}'} + + def patch_closed_list( + self, app_id, version_id, cl_entity_id, sub_lists=None, custom_headers=None, raw=False, **operation_config): + """Adds a batch of sublists to an existing list entity in a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param cl_entity_id: The list entity model ID. + :type cl_entity_id: str + :param sub_lists: Sublists to add. + :type sub_lists: + list[~azure.cognitiveservices.language.luis.authoring.models.WordListObject] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + closed_list_model_patch_object = models.ClosedListModelPatchObject(sub_lists=sub_lists) + + # Construct URL + url = self.patch_closed_list.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'clEntityId': self._serialize.url("cl_entity_id", cl_entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(closed_list_model_patch_object, 'ClosedListModelPatchObject') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + patch_closed_list.metadata = {'url': '/apps/{appId}/versions/{versionId}/closedlists/{clEntityId}'} + + def delete_closed_list( + self, app_id, version_id, cl_entity_id, custom_headers=None, raw=False, **operation_config): + """Deletes a list entity model from a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param cl_entity_id: The list entity model ID. + :type cl_entity_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete_closed_list.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'clEntityId': self._serialize.url("cl_entity_id", cl_entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete_closed_list.metadata = {'url': '/apps/{appId}/versions/{versionId}/closedlists/{clEntityId}'} + + def get_prebuilt( + self, app_id, version_id, prebuilt_id, custom_headers=None, raw=False, **operation_config): + """Gets information about a prebuilt entity model in a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param prebuilt_id: The prebuilt entity extractor ID. + :type prebuilt_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PrebuiltEntityExtractor or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.PrebuiltEntityExtractor + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_prebuilt.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'prebuiltId': self._serialize.url("prebuilt_id", prebuilt_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrebuiltEntityExtractor', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_prebuilt.metadata = {'url': '/apps/{appId}/versions/{versionId}/prebuilts/{prebuiltId}'} + + def delete_prebuilt( + self, app_id, version_id, prebuilt_id, custom_headers=None, raw=False, **operation_config): + """Deletes a prebuilt entity extractor from a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param prebuilt_id: The prebuilt entity extractor ID. + :type prebuilt_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete_prebuilt.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'prebuiltId': self._serialize.url("prebuilt_id", prebuilt_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete_prebuilt.metadata = {'url': '/apps/{appId}/versions/{versionId}/prebuilts/{prebuiltId}'} + + def delete_sub_list( + self, app_id, version_id, cl_entity_id, sub_list_id, custom_headers=None, raw=False, **operation_config): + """Deletes a sublist of a specific list entity model from a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param cl_entity_id: The list entity extractor ID. + :type cl_entity_id: str + :param sub_list_id: The sublist ID. + :type sub_list_id: long + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete_sub_list.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'clEntityId': self._serialize.url("cl_entity_id", cl_entity_id, 'str'), + 'subListId': self._serialize.url("sub_list_id", sub_list_id, 'long') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete_sub_list.metadata = {'url': '/apps/{appId}/versions/{versionId}/closedlists/{clEntityId}/sublists/{subListId}'} + + def update_sub_list( + self, app_id, version_id, cl_entity_id, sub_list_id, canonical_form=None, list=None, custom_headers=None, raw=False, **operation_config): + """Updates one of the list entity's sublists in a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param cl_entity_id: The list entity extractor ID. + :type cl_entity_id: str + :param sub_list_id: The sublist ID. + :type sub_list_id: long + :param canonical_form: The standard form that the list represents. + :type canonical_form: str + :param list: List of synonym words. + :type list: list[str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + word_list_base_update_object = models.WordListBaseUpdateObject(canonical_form=canonical_form, list=list) + + # Construct URL + url = self.update_sub_list.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'clEntityId': self._serialize.url("cl_entity_id", cl_entity_id, 'str'), + 'subListId': self._serialize.url("sub_list_id", sub_list_id, 'long') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(word_list_base_update_object, 'WordListBaseUpdateObject') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_sub_list.metadata = {'url': '/apps/{appId}/versions/{versionId}/closedlists/{clEntityId}/sublists/{subListId}'} + + def list_intent_suggestions( + self, app_id, version_id, intent_id, take=100, enable_nested_children=False, custom_headers=None, raw=False, **operation_config): + """Suggests example utterances that would improve the accuracy of the + intent model in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param intent_id: The intent classifier ID. + :type intent_id: str + :param take: The number of entries to return. Maximum page size is + 500. Default is 100. + :type take: int + :param enable_nested_children: Toggles nested/flat format + :type enable_nested_children: bool + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.IntentsSuggestionExample] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_intent_suggestions.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'intentId': self._serialize.url("intent_id", intent_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if take is not None: + query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0) + if enable_nested_children is not None: + query_parameters['enableNestedChildren'] = self._serialize.query("enable_nested_children", enable_nested_children, 'bool') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[IntentsSuggestionExample]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_intent_suggestions.metadata = {'url': '/apps/{appId}/versions/{versionId}/intents/{intentId}/suggest'} + + def list_entity_suggestions( + self, app_id, version_id, entity_id, take=100, enable_nested_children=False, custom_headers=None, raw=False, **operation_config): + """Get suggested example utterances that would improve the accuracy of the + entity model in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: The target entity extractor model to enhance. + :type entity_id: str + :param take: The number of entries to return. Maximum page size is + 500. Default is 100. + :type take: int + :param enable_nested_children: Toggles nested/flat format + :type enable_nested_children: bool + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.EntitiesSuggestionExample] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_entity_suggestions.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if take is not None: + query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0) + if enable_nested_children is not None: + query_parameters['enableNestedChildren'] = self._serialize.query("enable_nested_children", enable_nested_children, 'bool') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[EntitiesSuggestionExample]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_entity_suggestions.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities/{entityId}/suggest'} + + def add_sub_list( + self, app_id, version_id, cl_entity_id, canonical_form=None, list=None, custom_headers=None, raw=False, **operation_config): + """Adds a sublist to an existing list entity in a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param cl_entity_id: The list entity extractor ID. + :type cl_entity_id: str + :param canonical_form: The standard form that the list represents. + :type canonical_form: str + :param list: List of synonym words. + :type list: list[str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: long or ClientRawResponse if raw=true + :rtype: long or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + word_list_create_object = models.WordListObject(canonical_form=canonical_form, list=list) + + # Construct URL + url = self.add_sub_list.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'clEntityId': self._serialize.url("cl_entity_id", cl_entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(word_list_create_object, 'WordListObject') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('long', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + add_sub_list.metadata = {'url': '/apps/{appId}/versions/{versionId}/closedlists/{clEntityId}/sublists'} + + def add_custom_prebuilt_domain( + self, app_id, version_id, domain_name=None, custom_headers=None, raw=False, **operation_config): + """Adds a customizable prebuilt domain along with all of its intent and + entity models in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param domain_name: The domain name. + :type domain_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: list[str] or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + prebuilt_domain_object = models.PrebuiltDomainCreateBaseObject(domain_name=domain_name) + + # Construct URL + url = self.add_custom_prebuilt_domain.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(prebuilt_domain_object, 'PrebuiltDomainCreateBaseObject') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('[str]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + add_custom_prebuilt_domain.metadata = {'url': '/apps/{appId}/versions/{versionId}/customprebuiltdomains'} + + def add_custom_prebuilt_intent( + self, app_id, version_id, domain_name=None, model_name=None, custom_headers=None, raw=False, **operation_config): + """Adds a customizable prebuilt intent model to a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param domain_name: The domain name. + :type domain_name: str + :param model_name: The intent name or entity name. + :type model_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + prebuilt_domain_model_create_object = models.PrebuiltDomainModelCreateObject(domain_name=domain_name, model_name=model_name) + + # Construct URL + url = self.add_custom_prebuilt_intent.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(prebuilt_domain_model_create_object, 'PrebuiltDomainModelCreateObject') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + add_custom_prebuilt_intent.metadata = {'url': '/apps/{appId}/versions/{versionId}/customprebuiltintents'} + + def list_custom_prebuilt_intents( + self, app_id, version_id, custom_headers=None, raw=False, **operation_config): + """Gets information about customizable prebuilt intents added to a version + of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.IntentClassifier] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_custom_prebuilt_intents.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[IntentClassifier]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_custom_prebuilt_intents.metadata = {'url': '/apps/{appId}/versions/{versionId}/customprebuiltintents'} + + def add_custom_prebuilt_entity( + self, app_id, version_id, domain_name=None, model_name=None, custom_headers=None, raw=False, **operation_config): + """Adds a prebuilt entity model to a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param domain_name: The domain name. + :type domain_name: str + :param model_name: The intent name or entity name. + :type model_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + prebuilt_domain_model_create_object = models.PrebuiltDomainModelCreateObject(domain_name=domain_name, model_name=model_name) + + # Construct URL + url = self.add_custom_prebuilt_entity.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(prebuilt_domain_model_create_object, 'PrebuiltDomainModelCreateObject') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + add_custom_prebuilt_entity.metadata = {'url': '/apps/{appId}/versions/{versionId}/customprebuiltentities'} + + def list_custom_prebuilt_entities( + self, app_id, version_id, custom_headers=None, raw=False, **operation_config): + """Gets all prebuilt entities used in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityExtractor] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_custom_prebuilt_entities.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[EntityExtractor]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_custom_prebuilt_entities.metadata = {'url': '/apps/{appId}/versions/{versionId}/customprebuiltentities'} + + def list_custom_prebuilt_models( + self, app_id, version_id, custom_headers=None, raw=False, **operation_config): + """Gets all prebuilt intent and entity model information used in a version + of this application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.CustomPrebuiltModel] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_custom_prebuilt_models.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[CustomPrebuiltModel]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_custom_prebuilt_models.metadata = {'url': '/apps/{appId}/versions/{versionId}/customprebuiltmodels'} + + def delete_custom_prebuilt_domain( + self, app_id, version_id, domain_name, custom_headers=None, raw=False, **operation_config): + """Deletes a prebuilt domain's models in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param domain_name: Domain name. + :type domain_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete_custom_prebuilt_domain.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete_custom_prebuilt_domain.metadata = {'url': '/apps/{appId}/versions/{versionId}/customprebuiltdomains/{domainName}'} + + def add_entity_child( + self, app_id, version_id, entity_id, child_entity_model_create_object, custom_headers=None, raw=False, **operation_config): + """Creates a single child in an existing entity model hierarchy in a + version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: The entity extractor ID. + :type entity_id: str + :param child_entity_model_create_object: A model object containing the + name of the new child model and its children. + :type child_entity_model_create_object: + ~azure.cognitiveservices.language.luis.authoring.models.ChildEntityModelCreateObject + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.add_entity_child.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(child_entity_model_create_object, 'ChildEntityModelCreateObject') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + add_entity_child.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities/{entityId}/children'} + + def get_hierarchical_entity_child( + self, app_id, version_id, h_entity_id, h_child_id, custom_headers=None, raw=False, **operation_config): + """Gets information about the child's model contained in an hierarchical + entity child model in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param h_entity_id: The hierarchical entity extractor ID. + :type h_entity_id: str + :param h_child_id: The hierarchical entity extractor child ID. + :type h_child_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: HierarchicalChildEntity or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.HierarchicalChildEntity + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_hierarchical_entity_child.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'hEntityId': self._serialize.url("h_entity_id", h_entity_id, 'str'), + 'hChildId': self._serialize.url("h_child_id", h_child_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('HierarchicalChildEntity', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_hierarchical_entity_child.metadata = {'url': '/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/children/{hChildId}'} + + def update_hierarchical_entity_child( + self, app_id, version_id, h_entity_id, h_child_id, name=None, custom_headers=None, raw=False, **operation_config): + """Renames a single child in an existing hierarchical entity model in a + version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param h_entity_id: The hierarchical entity extractor ID. + :type h_entity_id: str + :param h_child_id: The hierarchical entity extractor child ID. + :type h_child_id: str + :param name: + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + hierarchical_child_model_update_object = models.HierarchicalChildModelUpdateObject(name=name) + + # Construct URL + url = self.update_hierarchical_entity_child.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'hEntityId': self._serialize.url("h_entity_id", h_entity_id, 'str'), + 'hChildId': self._serialize.url("h_child_id", h_child_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(hierarchical_child_model_update_object, 'HierarchicalChildModelUpdateObject') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_hierarchical_entity_child.metadata = {'url': '/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/children/{hChildId}'} + + def delete_hierarchical_entity_child( + self, app_id, version_id, h_entity_id, h_child_id, custom_headers=None, raw=False, **operation_config): + """Deletes a hierarchical entity extractor child in a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param h_entity_id: The hierarchical entity extractor ID. + :type h_entity_id: str + :param h_child_id: The hierarchical entity extractor child ID. + :type h_child_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete_hierarchical_entity_child.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'hEntityId': self._serialize.url("h_entity_id", h_entity_id, 'str'), + 'hChildId': self._serialize.url("h_child_id", h_child_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete_hierarchical_entity_child.metadata = {'url': '/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/children/{hChildId}'} + + def add_composite_entity_child( + self, app_id, version_id, c_entity_id, name=None, custom_headers=None, raw=False, **operation_config): + """Creates a single child in an existing composite entity model in a + version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param c_entity_id: The composite entity extractor ID. + :type c_entity_id: str + :param name: + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + composite_child_model_create_object = models.CompositeChildModelCreateObject(name=name) + + # Construct URL + url = self.add_composite_entity_child.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'cEntityId': self._serialize.url("c_entity_id", c_entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(composite_child_model_create_object, 'CompositeChildModelCreateObject') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + add_composite_entity_child.metadata = {'url': '/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/children'} + + def delete_composite_entity_child( + self, app_id, version_id, c_entity_id, c_child_id, custom_headers=None, raw=False, **operation_config): + """Deletes a composite entity extractor child from a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param c_entity_id: The composite entity extractor ID. + :type c_entity_id: str + :param c_child_id: The hierarchical entity extractor child ID. + :type c_child_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete_composite_entity_child.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'cEntityId': self._serialize.url("c_entity_id", c_entity_id, 'str'), + 'cChildId': self._serialize.url("c_child_id", c_child_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete_composite_entity_child.metadata = {'url': '/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/children/{cChildId}'} + + def list_regex_entity_infos( + self, app_id, version_id, skip=0, take=100, custom_headers=None, raw=False, **operation_config): + """Gets information about the regular expression entity models in a + version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param skip: The number of entries to skip. Default value is 0. + :type skip: int + :param take: The number of entries to return. Maximum page size is + 500. Default is 100. + :type take: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.RegexEntityExtractor] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_regex_entity_infos.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if skip is not None: + query_parameters['skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + if take is not None: + query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[RegexEntityExtractor]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_regex_entity_infos.metadata = {'url': '/apps/{appId}/versions/{versionId}/regexentities'} + + def create_regex_entity_model( + self, app_id, version_id, regex_pattern=None, name=None, custom_headers=None, raw=False, **operation_config): + """Adds a regular expression entity model to a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param regex_pattern: The regular expression entity pattern. + :type regex_pattern: str + :param name: The model name. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + regex_entity_extractor_create_obj = models.RegexModelCreateObject(regex_pattern=regex_pattern, name=name) + + # Construct URL + url = self.create_regex_entity_model.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(regex_entity_extractor_create_obj, 'RegexModelCreateObject') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_regex_entity_model.metadata = {'url': '/apps/{appId}/versions/{versionId}/regexentities'} + + def list_pattern_any_entity_infos( + self, app_id, version_id, skip=0, take=100, custom_headers=None, raw=False, **operation_config): + """Get information about the Pattern.Any entity models in a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param skip: The number of entries to skip. Default value is 0. + :type skip: int + :param take: The number of entries to return. Maximum page size is + 500. Default is 100. + :type take: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.PatternAnyEntityExtractor] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_pattern_any_entity_infos.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if skip is not None: + query_parameters['skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + if take is not None: + query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[PatternAnyEntityExtractor]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_pattern_any_entity_infos.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities'} + + def create_pattern_any_entity_model( + self, app_id, version_id, name=None, explicit_list=None, custom_headers=None, raw=False, **operation_config): + """Adds a pattern.any entity extractor to a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param name: The model name. + :type name: str + :param explicit_list: The Pattern.Any explicit list. + :type explicit_list: list[str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + extractor_create_object = models.PatternAnyModelCreateObject(name=name, explicit_list=explicit_list) + + # Construct URL + url = self.create_pattern_any_entity_model.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(extractor_create_object, 'PatternAnyModelCreateObject') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_pattern_any_entity_model.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities'} + + def list_entity_roles( + self, app_id, version_id, entity_id, custom_headers=None, raw=False, **operation_config): + """Get all roles for an entity in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: entity Id + :type entity_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_entity_roles.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[EntityRole]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_entity_roles.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities/{entityId}/roles'} + + def create_entity_role( + self, app_id, version_id, entity_id, name=None, custom_headers=None, raw=False, **operation_config): + """Create an entity role in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: The entity model ID. + :type entity_id: str + :param name: The entity role name. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + entity_role_create_object = models.EntityRoleCreateObject(name=name) + + # Construct URL + url = self.create_entity_role.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(entity_role_create_object, 'EntityRoleCreateObject') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities/{entityId}/roles'} + + def list_prebuilt_entity_roles( + self, app_id, version_id, entity_id, custom_headers=None, raw=False, **operation_config): + """Get a prebuilt entity's roles in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: entity Id + :type entity_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_prebuilt_entity_roles.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[EntityRole]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_prebuilt_entity_roles.metadata = {'url': '/apps/{appId}/versions/{versionId}/prebuilts/{entityId}/roles'} + + def create_prebuilt_entity_role( + self, app_id, version_id, entity_id, name=None, custom_headers=None, raw=False, **operation_config): + """Create a role for a prebuilt entity in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: The entity model ID. + :type entity_id: str + :param name: The entity role name. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + entity_role_create_object = models.EntityRoleCreateObject(name=name) + + # Construct URL + url = self.create_prebuilt_entity_role.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(entity_role_create_object, 'EntityRoleCreateObject') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_prebuilt_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/prebuilts/{entityId}/roles'} + + def list_closed_list_entity_roles( + self, app_id, version_id, entity_id, custom_headers=None, raw=False, **operation_config): + """Get all roles for a list entity in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: entity Id + :type entity_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_closed_list_entity_roles.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[EntityRole]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_closed_list_entity_roles.metadata = {'url': '/apps/{appId}/versions/{versionId}/closedlists/{entityId}/roles'} + + def create_closed_list_entity_role( + self, app_id, version_id, entity_id, name=None, custom_headers=None, raw=False, **operation_config): + """Create a role for a list entity in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: The entity model ID. + :type entity_id: str + :param name: The entity role name. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + entity_role_create_object = models.EntityRoleCreateObject(name=name) + + # Construct URL + url = self.create_closed_list_entity_role.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(entity_role_create_object, 'EntityRoleCreateObject') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_closed_list_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/closedlists/{entityId}/roles'} + + def list_regex_entity_roles( + self, app_id, version_id, entity_id, custom_headers=None, raw=False, **operation_config): + """Get all roles for a regular expression entity in a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: entity Id + :type entity_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_regex_entity_roles.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[EntityRole]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_regex_entity_roles.metadata = {'url': '/apps/{appId}/versions/{versionId}/regexentities/{entityId}/roles'} + + def create_regex_entity_role( + self, app_id, version_id, entity_id, name=None, custom_headers=None, raw=False, **operation_config): + """Create a role for an regular expression entity in a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: The entity model ID. + :type entity_id: str + :param name: The entity role name. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + entity_role_create_object = models.EntityRoleCreateObject(name=name) + + # Construct URL + url = self.create_regex_entity_role.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(entity_role_create_object, 'EntityRoleCreateObject') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_regex_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/regexentities/{entityId}/roles'} + + def list_composite_entity_roles( + self, app_id, version_id, c_entity_id, custom_headers=None, raw=False, **operation_config): + """Get all roles for a composite entity in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param c_entity_id: The composite entity extractor ID. + :type c_entity_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_composite_entity_roles.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'cEntityId': self._serialize.url("c_entity_id", c_entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[EntityRole]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_composite_entity_roles.metadata = {'url': '/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/roles'} + + def create_composite_entity_role( + self, app_id, version_id, c_entity_id, name=None, custom_headers=None, raw=False, **operation_config): + """Create a role for a composite entity in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param c_entity_id: The composite entity extractor ID. + :type c_entity_id: str + :param name: The entity role name. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + entity_role_create_object = models.EntityRoleCreateObject(name=name) + + # Construct URL + url = self.create_composite_entity_role.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'cEntityId': self._serialize.url("c_entity_id", c_entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(entity_role_create_object, 'EntityRoleCreateObject') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_composite_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/roles'} + + def list_pattern_any_entity_roles( + self, app_id, version_id, entity_id, custom_headers=None, raw=False, **operation_config): + """Get all roles for a Pattern.any entity in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: entity Id + :type entity_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_pattern_any_entity_roles.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[EntityRole]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_pattern_any_entity_roles.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/roles'} + + def create_pattern_any_entity_role( + self, app_id, version_id, entity_id, name=None, custom_headers=None, raw=False, **operation_config): + """Create a role for an Pattern.any entity in a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: The entity model ID. + :type entity_id: str + :param name: The entity role name. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + entity_role_create_object = models.EntityRoleCreateObject(name=name) + + # Construct URL + url = self.create_pattern_any_entity_role.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(entity_role_create_object, 'EntityRoleCreateObject') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_pattern_any_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/roles'} + + def list_hierarchical_entity_roles( + self, app_id, version_id, h_entity_id, custom_headers=None, raw=False, **operation_config): + """Get all roles for a hierarchical entity in a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param h_entity_id: The hierarchical entity extractor ID. + :type h_entity_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_hierarchical_entity_roles.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'hEntityId': self._serialize.url("h_entity_id", h_entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[EntityRole]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_hierarchical_entity_roles.metadata = {'url': '/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/roles'} + + def create_hierarchical_entity_role( + self, app_id, version_id, h_entity_id, name=None, custom_headers=None, raw=False, **operation_config): + """Create a role for an hierarchical entity in a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param h_entity_id: The hierarchical entity extractor ID. + :type h_entity_id: str + :param name: The entity role name. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + entity_role_create_object = models.EntityRoleCreateObject(name=name) + + # Construct URL + url = self.create_hierarchical_entity_role.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'hEntityId': self._serialize.url("h_entity_id", h_entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(entity_role_create_object, 'EntityRoleCreateObject') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_hierarchical_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/roles'} + + def list_custom_prebuilt_entity_roles( + self, app_id, version_id, entity_id, custom_headers=None, raw=False, **operation_config): + """Get all roles for a prebuilt entity in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: entity Id + :type entity_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_custom_prebuilt_entity_roles.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[EntityRole]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_custom_prebuilt_entity_roles.metadata = {'url': '/apps/{appId}/versions/{versionId}/customprebuiltentities/{entityId}/roles'} + + def create_custom_prebuilt_entity_role( + self, app_id, version_id, entity_id, name=None, custom_headers=None, raw=False, **operation_config): + """Create a role for a prebuilt entity in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: The entity model ID. + :type entity_id: str + :param name: The entity role name. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + entity_role_create_object = models.EntityRoleCreateObject(name=name) + + # Construct URL + url = self.create_custom_prebuilt_entity_role.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(entity_role_create_object, 'EntityRoleCreateObject') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_custom_prebuilt_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/customprebuiltentities/{entityId}/roles'} + + def get_explicit_list( + self, app_id, version_id, entity_id, custom_headers=None, raw=False, **operation_config): + """Get the explicit (exception) list of the pattern.any entity in a + version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: The Pattern.Any entity id. + :type entity_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.ExplicitListItem] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_explicit_list.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[ExplicitListItem]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_explicit_list.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/explicitlist'} + + def add_explicit_list_item( + self, app_id, version_id, entity_id, explicit_list_item=None, custom_headers=None, raw=False, **operation_config): + """Add a new exception to the explicit list for the Pattern.Any entity in + a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: The Pattern.Any entity extractor ID. + :type entity_id: str + :param explicit_list_item: The explicit list item. + :type explicit_list_item: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: int or ClientRawResponse if raw=true + :rtype: int or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + item = models.ExplicitListItemCreateObject(explicit_list_item=explicit_list_item) + + # Construct URL + url = self.add_explicit_list_item.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(item, 'ExplicitListItemCreateObject') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('int', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + add_explicit_list_item.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/explicitlist'} + + def get_regex_entity_entity_info( + self, app_id, version_id, regex_entity_id, custom_headers=None, raw=False, **operation_config): + """Gets information about a regular expression entity in a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param regex_entity_id: The regular expression entity model ID. + :type regex_entity_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: RegexEntityExtractor or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.RegexEntityExtractor + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_regex_entity_entity_info.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'regexEntityId': self._serialize.url("regex_entity_id", regex_entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('RegexEntityExtractor', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_regex_entity_entity_info.metadata = {'url': '/apps/{appId}/versions/{versionId}/regexentities/{regexEntityId}'} + + def update_regex_entity_model( + self, app_id, version_id, regex_entity_id, regex_pattern=None, name=None, custom_headers=None, raw=False, **operation_config): + """Updates the regular expression entity in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param regex_entity_id: The regular expression entity extractor ID. + :type regex_entity_id: str + :param regex_pattern: The regular expression entity pattern. + :type regex_pattern: str + :param name: The model name. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + regex_entity_update_object = models.RegexModelUpdateObject(regex_pattern=regex_pattern, name=name) + + # Construct URL + url = self.update_regex_entity_model.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'regexEntityId': self._serialize.url("regex_entity_id", regex_entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(regex_entity_update_object, 'RegexModelUpdateObject') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_regex_entity_model.metadata = {'url': '/apps/{appId}/versions/{versionId}/regexentities/{regexEntityId}'} + + def delete_regex_entity_model( + self, app_id, version_id, regex_entity_id, custom_headers=None, raw=False, **operation_config): + """Deletes a regular expression entity from a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param regex_entity_id: The regular expression entity extractor ID. + :type regex_entity_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete_regex_entity_model.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'regexEntityId': self._serialize.url("regex_entity_id", regex_entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete_regex_entity_model.metadata = {'url': '/apps/{appId}/versions/{versionId}/regexentities/{regexEntityId}'} + + def get_pattern_any_entity_info( + self, app_id, version_id, entity_id, custom_headers=None, raw=False, **operation_config): + """Gets information about the Pattern.Any model in a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: The entity extractor ID. + :type entity_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PatternAnyEntityExtractor or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.PatternAnyEntityExtractor + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_pattern_any_entity_info.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PatternAnyEntityExtractor', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_pattern_any_entity_info.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}'} + + def update_pattern_any_entity_model( + self, app_id, version_id, entity_id, name=None, explicit_list=None, custom_headers=None, raw=False, **operation_config): + """Updates the name and explicit (exception) list of a Pattern.Any entity + model in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: The Pattern.Any entity extractor ID. + :type entity_id: str + :param name: The model name. + :type name: str + :param explicit_list: The Pattern.Any explicit list. + :type explicit_list: list[str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + pattern_any_update_object = models.PatternAnyModelUpdateObject(name=name, explicit_list=explicit_list) + + # Construct URL + url = self.update_pattern_any_entity_model.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(pattern_any_update_object, 'PatternAnyModelUpdateObject') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_pattern_any_entity_model.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}'} + + def delete_pattern_any_entity_model( + self, app_id, version_id, entity_id, custom_headers=None, raw=False, **operation_config): + """Deletes a Pattern.Any entity extractor from a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: The Pattern.Any entity extractor ID. + :type entity_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete_pattern_any_entity_model.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete_pattern_any_entity_model.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}'} + + def get_entity_role( + self, app_id, version_id, entity_id, role_id, custom_headers=None, raw=False, **operation_config): + """Get one role for a given entity in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: entity ID. + :type entity_id: str + :param role_id: entity role ID. + :type role_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: EntityRole or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.EntityRole or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_entity_role.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str'), + 'roleId': self._serialize.url("role_id", role_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EntityRole', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities/{entityId}/roles/{roleId}'} + + def update_entity_role( + self, app_id, version_id, entity_id, role_id, name=None, custom_headers=None, raw=False, **operation_config): + """Update a role for a given entity in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: The entity ID. + :type entity_id: str + :param role_id: The entity role ID. + :type role_id: str + :param name: The entity role name. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + entity_role_update_object = models.EntityRoleUpdateObject(name=name) + + # Construct URL + url = self.update_entity_role.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str'), + 'roleId': self._serialize.url("role_id", role_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(entity_role_update_object, 'EntityRoleUpdateObject') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities/{entityId}/roles/{roleId}'} + + def delete_entity_role( + self, app_id, version_id, entity_id, role_id, custom_headers=None, raw=False, **operation_config): + """Delete an entity role in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: The entity ID. + :type entity_id: str + :param role_id: The entity role Id. + :type role_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete_entity_role.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str'), + 'roleId': self._serialize.url("role_id", role_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities/{entityId}/roles/{roleId}'} + + def get_prebuilt_entity_role( + self, app_id, version_id, entity_id, role_id, custom_headers=None, raw=False, **operation_config): + """Get one role for a given prebuilt entity in a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: entity ID. + :type entity_id: str + :param role_id: entity role ID. + :type role_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: EntityRole or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.EntityRole or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_prebuilt_entity_role.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str'), + 'roleId': self._serialize.url("role_id", role_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EntityRole', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_prebuilt_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/prebuilts/{entityId}/roles/{roleId}'} + + def update_prebuilt_entity_role( + self, app_id, version_id, entity_id, role_id, name=None, custom_headers=None, raw=False, **operation_config): + """Update a role for a given prebuilt entity in a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: The entity ID. + :type entity_id: str + :param role_id: The entity role ID. + :type role_id: str + :param name: The entity role name. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + entity_role_update_object = models.EntityRoleUpdateObject(name=name) + + # Construct URL + url = self.update_prebuilt_entity_role.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str'), + 'roleId': self._serialize.url("role_id", role_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(entity_role_update_object, 'EntityRoleUpdateObject') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_prebuilt_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/prebuilts/{entityId}/roles/{roleId}'} + + def delete_prebuilt_entity_role( + self, app_id, version_id, entity_id, role_id, custom_headers=None, raw=False, **operation_config): + """Delete a role in a prebuilt entity in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: The entity ID. + :type entity_id: str + :param role_id: The entity role Id. + :type role_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete_prebuilt_entity_role.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str'), + 'roleId': self._serialize.url("role_id", role_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete_prebuilt_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/prebuilts/{entityId}/roles/{roleId}'} + + def get_closed_list_entity_role( + self, app_id, version_id, entity_id, role_id, custom_headers=None, raw=False, **operation_config): + """Get one role for a given list entity in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: entity ID. + :type entity_id: str + :param role_id: entity role ID. + :type role_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: EntityRole or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.EntityRole or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_closed_list_entity_role.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str'), + 'roleId': self._serialize.url("role_id", role_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EntityRole', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_closed_list_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/closedlists/{entityId}/roles/{roleId}'} + + def update_closed_list_entity_role( + self, app_id, version_id, entity_id, role_id, name=None, custom_headers=None, raw=False, **operation_config): + """Update a role for a given list entity in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: The entity ID. + :type entity_id: str + :param role_id: The entity role ID. + :type role_id: str + :param name: The entity role name. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + entity_role_update_object = models.EntityRoleUpdateObject(name=name) + + # Construct URL + url = self.update_closed_list_entity_role.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str'), + 'roleId': self._serialize.url("role_id", role_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(entity_role_update_object, 'EntityRoleUpdateObject') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_closed_list_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/closedlists/{entityId}/roles/{roleId}'} + + def delete_closed_list_entity_role( + self, app_id, version_id, entity_id, role_id, custom_headers=None, raw=False, **operation_config): + """Delete a role for a given list entity in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: The entity ID. + :type entity_id: str + :param role_id: The entity role Id. + :type role_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete_closed_list_entity_role.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str'), + 'roleId': self._serialize.url("role_id", role_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete_closed_list_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/closedlists/{entityId}/roles/{roleId}'} + + def get_regex_entity_role( + self, app_id, version_id, entity_id, role_id, custom_headers=None, raw=False, **operation_config): + """Get one role for a given regular expression entity in a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: entity ID. + :type entity_id: str + :param role_id: entity role ID. + :type role_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: EntityRole or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.EntityRole or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_regex_entity_role.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str'), + 'roleId': self._serialize.url("role_id", role_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EntityRole', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_regex_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/regexentities/{entityId}/roles/{roleId}'} + + def update_regex_entity_role( + self, app_id, version_id, entity_id, role_id, name=None, custom_headers=None, raw=False, **operation_config): + """Update a role for a given regular expression entity in a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: The entity ID. + :type entity_id: str + :param role_id: The entity role ID. + :type role_id: str + :param name: The entity role name. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + entity_role_update_object = models.EntityRoleUpdateObject(name=name) + + # Construct URL + url = self.update_regex_entity_role.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str'), + 'roleId': self._serialize.url("role_id", role_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(entity_role_update_object, 'EntityRoleUpdateObject') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_regex_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/regexentities/{entityId}/roles/{roleId}'} + + def delete_regex_entity_role( + self, app_id, version_id, entity_id, role_id, custom_headers=None, raw=False, **operation_config): + """Delete a role for a given regular expression in a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: The entity ID. + :type entity_id: str + :param role_id: The entity role Id. + :type role_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete_regex_entity_role.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str'), + 'roleId': self._serialize.url("role_id", role_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete_regex_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/regexentities/{entityId}/roles/{roleId}'} + + def get_composite_entity_role( + self, app_id, version_id, c_entity_id, role_id, custom_headers=None, raw=False, **operation_config): + """Get one role for a given composite entity in a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param c_entity_id: The composite entity extractor ID. + :type c_entity_id: str + :param role_id: entity role ID. + :type role_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: EntityRole or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.EntityRole or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_composite_entity_role.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'cEntityId': self._serialize.url("c_entity_id", c_entity_id, 'str'), + 'roleId': self._serialize.url("role_id", role_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EntityRole', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_composite_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/roles/{roleId}'} + + def update_composite_entity_role( + self, app_id, version_id, c_entity_id, role_id, name=None, custom_headers=None, raw=False, **operation_config): + """Update a role for a given composite entity in a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param c_entity_id: The composite entity extractor ID. + :type c_entity_id: str + :param role_id: The entity role ID. + :type role_id: str + :param name: The entity role name. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + entity_role_update_object = models.EntityRoleUpdateObject(name=name) + + # Construct URL + url = self.update_composite_entity_role.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'cEntityId': self._serialize.url("c_entity_id", c_entity_id, 'str'), + 'roleId': self._serialize.url("role_id", role_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(entity_role_update_object, 'EntityRoleUpdateObject') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_composite_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/roles/{roleId}'} + + def delete_composite_entity_role( + self, app_id, version_id, c_entity_id, role_id, custom_headers=None, raw=False, **operation_config): + """Delete a role for a given composite entity in a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param c_entity_id: The composite entity extractor ID. + :type c_entity_id: str + :param role_id: The entity role Id. + :type role_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete_composite_entity_role.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'cEntityId': self._serialize.url("c_entity_id", c_entity_id, 'str'), + 'roleId': self._serialize.url("role_id", role_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete_composite_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/roles/{roleId}'} + + def get_pattern_any_entity_role( + self, app_id, version_id, entity_id, role_id, custom_headers=None, raw=False, **operation_config): + """Get one role for a given Pattern.any entity in a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: entity ID. + :type entity_id: str + :param role_id: entity role ID. + :type role_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: EntityRole or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.EntityRole or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_pattern_any_entity_role.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str'), + 'roleId': self._serialize.url("role_id", role_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EntityRole', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_pattern_any_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/roles/{roleId}'} + + def update_pattern_any_entity_role( + self, app_id, version_id, entity_id, role_id, name=None, custom_headers=None, raw=False, **operation_config): + """Update a role for a given Pattern.any entity in a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: The entity ID. + :type entity_id: str + :param role_id: The entity role ID. + :type role_id: str + :param name: The entity role name. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + entity_role_update_object = models.EntityRoleUpdateObject(name=name) + + # Construct URL + url = self.update_pattern_any_entity_role.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str'), + 'roleId': self._serialize.url("role_id", role_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(entity_role_update_object, 'EntityRoleUpdateObject') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_pattern_any_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/roles/{roleId}'} + + def delete_pattern_any_entity_role( + self, app_id, version_id, entity_id, role_id, custom_headers=None, raw=False, **operation_config): + """Delete a role for a given Pattern.any entity in a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: The entity ID. + :type entity_id: str + :param role_id: The entity role Id. + :type role_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete_pattern_any_entity_role.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str'), + 'roleId': self._serialize.url("role_id", role_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete_pattern_any_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/roles/{roleId}'} + + def get_hierarchical_entity_role( + self, app_id, version_id, h_entity_id, role_id, custom_headers=None, raw=False, **operation_config): + """Get one role for a given hierarchical entity in a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param h_entity_id: The hierarchical entity extractor ID. + :type h_entity_id: str + :param role_id: entity role ID. + :type role_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: EntityRole or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.EntityRole or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_hierarchical_entity_role.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'hEntityId': self._serialize.url("h_entity_id", h_entity_id, 'str'), + 'roleId': self._serialize.url("role_id", role_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EntityRole', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_hierarchical_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/roles/{roleId}'} + + def update_hierarchical_entity_role( + self, app_id, version_id, h_entity_id, role_id, name=None, custom_headers=None, raw=False, **operation_config): + """Update a role for a given hierarchical entity in a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param h_entity_id: The hierarchical entity extractor ID. + :type h_entity_id: str + :param role_id: The entity role ID. + :type role_id: str + :param name: The entity role name. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + entity_role_update_object = models.EntityRoleUpdateObject(name=name) + + # Construct URL + url = self.update_hierarchical_entity_role.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'hEntityId': self._serialize.url("h_entity_id", h_entity_id, 'str'), + 'roleId': self._serialize.url("role_id", role_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(entity_role_update_object, 'EntityRoleUpdateObject') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_hierarchical_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/roles/{roleId}'} + + def delete_hierarchical_entity_role( + self, app_id, version_id, h_entity_id, role_id, custom_headers=None, raw=False, **operation_config): + """Delete a role for a given hierarchical role in a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param h_entity_id: The hierarchical entity extractor ID. + :type h_entity_id: str + :param role_id: The entity role Id. + :type role_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete_hierarchical_entity_role.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'hEntityId': self._serialize.url("h_entity_id", h_entity_id, 'str'), + 'roleId': self._serialize.url("role_id", role_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete_hierarchical_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/roles/{roleId}'} + + def get_custom_entity_role( + self, app_id, version_id, entity_id, role_id, custom_headers=None, raw=False, **operation_config): + """Get one role for a given prebuilt entity in a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: entity ID. + :type entity_id: str + :param role_id: entity role ID. + :type role_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: EntityRole or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.EntityRole or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_custom_entity_role.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str'), + 'roleId': self._serialize.url("role_id", role_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EntityRole', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_custom_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/customprebuiltentities/{entityId}/roles/{roleId}'} + + def update_custom_prebuilt_entity_role( + self, app_id, version_id, entity_id, role_id, name=None, custom_headers=None, raw=False, **operation_config): + """Update a role for a given prebuilt entity in a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: The entity ID. + :type entity_id: str + :param role_id: The entity role ID. + :type role_id: str + :param name: The entity role name. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + entity_role_update_object = models.EntityRoleUpdateObject(name=name) + + # Construct URL + url = self.update_custom_prebuilt_entity_role.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str'), + 'roleId': self._serialize.url("role_id", role_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(entity_role_update_object, 'EntityRoleUpdateObject') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_custom_prebuilt_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/customprebuiltentities/{entityId}/roles/{roleId}'} + + def delete_custom_entity_role( + self, app_id, version_id, entity_id, role_id, custom_headers=None, raw=False, **operation_config): + """Delete a role for a given prebuilt entity in a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: The entity ID. + :type entity_id: str + :param role_id: The entity role Id. + :type role_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete_custom_entity_role.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str'), + 'roleId': self._serialize.url("role_id", role_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete_custom_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/customprebuiltentities/{entityId}/roles/{roleId}'} + + def get_explicit_list_item( + self, app_id, version_id, entity_id, item_id, custom_headers=None, raw=False, **operation_config): + """Get the explicit (exception) list of the pattern.any entity in a + version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: The Pattern.Any entity Id. + :type entity_id: str + :param item_id: The explicit list item Id. + :type item_id: long + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ExplicitListItem or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.ExplicitListItem + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_explicit_list_item.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str'), + 'itemId': self._serialize.url("item_id", item_id, 'long') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ExplicitListItem', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_explicit_list_item.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/explicitlist/{itemId}'} + + def update_explicit_list_item( + self, app_id, version_id, entity_id, item_id, explicit_list_item=None, custom_headers=None, raw=False, **operation_config): + """Updates an explicit (exception) list item for a Pattern.Any entity in a + version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: The Pattern.Any entity extractor ID. + :type entity_id: str + :param item_id: The explicit list item ID. + :type item_id: long + :param explicit_list_item: The explicit list item. + :type explicit_list_item: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + item = models.ExplicitListItemUpdateObject(explicit_list_item=explicit_list_item) + + # Construct URL + url = self.update_explicit_list_item.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str'), + 'itemId': self._serialize.url("item_id", item_id, 'long') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(item, 'ExplicitListItemUpdateObject') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_explicit_list_item.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/explicitlist/{itemId}'} + + def delete_explicit_list_item( + self, app_id, version_id, entity_id, item_id, custom_headers=None, raw=False, **operation_config): + """Delete an item from the explicit (exception) list for a Pattern.any + entity in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param entity_id: The pattern.any entity id. + :type entity_id: str + :param item_id: The explicit list item which will be deleted. + :type item_id: long + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete_explicit_list_item.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'entityId': self._serialize.url("entity_id", entity_id, 'str'), + 'itemId': self._serialize.url("item_id", item_id, 'long') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete_explicit_list_item.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/explicitlist/{itemId}'} diff --git a/src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_pattern_operations.py b/src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_pattern_operations.py new file mode 100644 index 00000000000..17c40c26654 --- /dev/null +++ b/src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_pattern_operations.py @@ -0,0 +1,550 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class PatternOperations(object): + """PatternOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + + self.config = config + + def add_pattern( + self, app_id, version_id, pattern=None, intent=None, custom_headers=None, raw=False, **operation_config): + """Adds a pattern to a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param pattern: The pattern text. + :type pattern: str + :param intent: The intent's name which the pattern belongs to. + :type intent: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PatternRuleInfo or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.PatternRuleInfo + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + pattern1 = models.PatternRuleCreateObject(pattern=pattern, intent=intent) + + # Construct URL + url = self.add_pattern.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(pattern1, 'PatternRuleCreateObject') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('PatternRuleInfo', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + add_pattern.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternrule'} + + def list_patterns( + self, app_id, version_id, skip=0, take=100, custom_headers=None, raw=False, **operation_config): + """Gets patterns in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param skip: The number of entries to skip. Default value is 0. + :type skip: int + :param take: The number of entries to return. Maximum page size is + 500. Default is 100. + :type take: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.PatternRuleInfo] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_patterns.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if skip is not None: + query_parameters['skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + if take is not None: + query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[PatternRuleInfo]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_patterns.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternrules'} + + def update_patterns( + self, app_id, version_id, patterns, custom_headers=None, raw=False, **operation_config): + """Updates patterns in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param patterns: An array represents the patterns. + :type patterns: + list[~azure.cognitiveservices.language.luis.authoring.models.PatternRuleUpdateObject] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.PatternRuleInfo] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update_patterns.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(patterns, '[PatternRuleUpdateObject]') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[PatternRuleInfo]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_patterns.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternrules'} + + def batch_add_patterns( + self, app_id, version_id, patterns, custom_headers=None, raw=False, **operation_config): + """Adds a batch of patterns in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param patterns: A JSON array containing patterns. + :type patterns: + list[~azure.cognitiveservices.language.luis.authoring.models.PatternRuleCreateObject] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.PatternRuleInfo] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.batch_add_patterns.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(patterns, '[PatternRuleCreateObject]') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('[PatternRuleInfo]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + batch_add_patterns.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternrules'} + + def delete_patterns( + self, app_id, version_id, pattern_ids, custom_headers=None, raw=False, **operation_config): + """Deletes a list of patterns in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param pattern_ids: The patterns IDs. + :type pattern_ids: list[str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete_patterns.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(pattern_ids, '[str]') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete_patterns.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternrules'} + + def update_pattern( + self, app_id, version_id, pattern_id, pattern, custom_headers=None, raw=False, **operation_config): + """Updates a pattern in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param pattern_id: The pattern ID. + :type pattern_id: str + :param pattern: An object representing a pattern. + :type pattern: + ~azure.cognitiveservices.language.luis.authoring.models.PatternRuleUpdateObject + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PatternRuleInfo or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.PatternRuleInfo + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update_pattern.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'patternId': self._serialize.url("pattern_id", pattern_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(pattern, 'PatternRuleUpdateObject') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PatternRuleInfo', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_pattern.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternrules/{patternId}'} + + def delete_pattern( + self, app_id, version_id, pattern_id, custom_headers=None, raw=False, **operation_config): + """Deletes the pattern with the specified ID from a version of the + application.. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param pattern_id: The pattern ID. + :type pattern_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete_pattern.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'patternId': self._serialize.url("pattern_id", pattern_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete_pattern.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternrules/{patternId}'} + + def list_intent_patterns( + self, app_id, version_id, intent_id, skip=0, take=100, custom_headers=None, raw=False, **operation_config): + """Returns patterns for the specific intent in a version of the + application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param intent_id: The intent classifier ID. + :type intent_id: str + :param skip: The number of entries to skip. Default value is 0. + :type skip: int + :param take: The number of entries to return. Maximum page size is + 500. Default is 100. + :type take: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.PatternRuleInfo] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_intent_patterns.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'intentId': self._serialize.url("intent_id", intent_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if skip is not None: + query_parameters['skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + if take is not None: + query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[PatternRuleInfo]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_intent_patterns.metadata = {'url': '/apps/{appId}/versions/{versionId}/intents/{intentId}/patternrules'} diff --git a/src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_settings_operations.py b/src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_settings_operations.py new file mode 100644 index 00000000000..1a34c6b298c --- /dev/null +++ b/src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_settings_operations.py @@ -0,0 +1,156 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class SettingsOperations(object): + """SettingsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + + self.config = config + + def list( + self, app_id, version_id, custom_headers=None, raw=False, **operation_config): + """Gets the settings in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.AppVersionSettingObject] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[AppVersionSettingObject]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/apps/{appId}/versions/{versionId}/settings'} + + def update( + self, app_id, version_id, list_of_app_version_setting_object, custom_headers=None, raw=False, **operation_config): + """Updates the settings in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param list_of_app_version_setting_object: A list of the updated + application version settings. + :type list_of_app_version_setting_object: + list[~azure.cognitiveservices.language.luis.authoring.models.AppVersionSettingObject] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(list_of_app_version_setting_object, '[AppVersionSettingObject]') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/apps/{appId}/versions/{versionId}/settings'} diff --git a/src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_train_operations.py b/src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_train_operations.py new file mode 100644 index 00000000000..c48ed5feb31 --- /dev/null +++ b/src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_train_operations.py @@ -0,0 +1,158 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class TrainOperations(object): + """TrainOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + + self.config = config + + def train_version( + self, app_id, version_id, custom_headers=None, raw=False, **operation_config): + """Sends a training request for a version of a specified LUIS app. This + POST request initiates a request asynchronously. To determine whether + the training request is successful, submit a GET request to get + training status. Note: The application version is not fully trained + unless all the models (intents and entities) are trained successfully + or are up to date. To verify training success, get the training status + at least once after training is complete. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: EnqueueTrainingResponse or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.EnqueueTrainingResponse + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.train_version.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 202: + deserialized = self._deserialize('EnqueueTrainingResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + train_version.metadata = {'url': '/apps/{appId}/versions/{versionId}/train'} + + def get_status( + self, app_id, version_id, custom_headers=None, raw=False, **operation_config): + """Gets the training status of all models (intents and entities) for the + specified LUIS app. You must call the train API to train the LUIS app + before you call this API to get training status. "appID" specifies the + LUIS app ID. "versionId" specifies the version number of the LUIS app. + For example, "0.1". + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.ModelTrainingInfo] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_status.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[ModelTrainingInfo]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_status.metadata = {'url': '/apps/{appId}/versions/{versionId}/train'} diff --git a/src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_versions_operations.py b/src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_versions_operations.py new file mode 100644 index 00000000000..2feedf52ab7 --- /dev/null +++ b/src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_versions_operations.py @@ -0,0 +1,705 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.pipeline import ClientRawResponse +from msrest.exceptions import HttpOperationError + +from .. import models + + +class VersionsOperations(object): + """VersionsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar format: Lu format extension. Constant value: "lu". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + + self.config = config + self.format = "lu" + + def clone( + self, app_id, version_id, version=None, custom_headers=None, raw=False, **operation_config): + """Creates a new version from the selected version. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param version: The new version for the cloned model. + :type version: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + version_clone_object = models.TaskUpdateObject(version=version) + + # Construct URL + url = self.clone.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(version_clone_object, 'TaskUpdateObject') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + clone.metadata = {'url': '/apps/{appId}/versions/{versionId}/clone'} + + def list( + self, app_id, skip=0, take=100, custom_headers=None, raw=False, **operation_config): + """Gets a list of versions for this application ID. + + :param app_id: The application ID. + :type app_id: str + :param skip: The number of entries to skip. Default value is 0. + :type skip: int + :param take: The number of entries to return. Maximum page size is + 500. Default is 100. + :type take: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.VersionInfo] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if skip is not None: + query_parameters['skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + if take is not None: + query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[VersionInfo]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/apps/{appId}/versions'} + + def get( + self, app_id, version_id, custom_headers=None, raw=False, **operation_config): + """Gets the version information such as date created, last modified date, + endpoint URL, count of intents and entities, training and publishing + status. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: VersionInfo or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.VersionInfo or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VersionInfo', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/apps/{appId}/versions/{versionId}/'} + + def update( + self, app_id, version_id, version=None, custom_headers=None, raw=False, **operation_config): + """Updates the name or description of the application version. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param version: The new version for the cloned model. + :type version: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + version_update_object = models.TaskUpdateObject(version=version) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(version_update_object, 'TaskUpdateObject') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/apps/{appId}/versions/{versionId}/'} + + def delete( + self, app_id, version_id, custom_headers=None, raw=False, **operation_config): + """Deletes an application version. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete.metadata = {'url': '/apps/{appId}/versions/{versionId}/'} + + def export( + self, app_id, version_id, custom_headers=None, raw=False, **operation_config): + """Exports a LUIS application to JSON format. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: LuisApp or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.LuisApp or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.export.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('LuisApp', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + export.metadata = {'url': '/apps/{appId}/versions/{versionId}/export'} + + def import_method( + self, app_id, luis_app, version_id=None, custom_headers=None, raw=False, **operation_config): + """Imports a new version into a LUIS application. + + :param app_id: The application ID. + :type app_id: str + :param luis_app: A LUIS application structure. + :type luis_app: + ~azure.cognitiveservices.language.luis.authoring.models.LuisApp + :param version_id: The new versionId to import. If not specified, the + versionId will be read from the imported object. + :type version_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.import_method.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if version_id is not None: + query_parameters['versionId'] = self._serialize.query("version_id", version_id, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(luis_app, 'LuisApp') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + import_method.metadata = {'url': '/apps/{appId}/versions/import'} + + def delete_unlabelled_utterance( + self, app_id, version_id, utterance, custom_headers=None, raw=False, **operation_config): + """Deleted an unlabelled utterance in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param utterance: The utterance text to delete. + :type utterance: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete_unlabelled_utterance.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(utterance, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete_unlabelled_utterance.metadata = {'url': '/apps/{appId}/versions/{versionId}/suggest'} + + def import_v2_app( + self, app_id, luis_app_v2, version_id=None, custom_headers=None, raw=False, **operation_config): + """Imports a new version into a LUIS application. + + :param app_id: The application ID. + :type app_id: str + :param luis_app_v2: A LUIS application structure. + :type luis_app_v2: + ~azure.cognitiveservices.language.luis.authoring.models.LuisAppV2 + :param version_id: The new versionId to import. If not specified, the + versionId will be read from the imported object. + :type version_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.import_v2_app.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if version_id is not None: + query_parameters['versionId'] = self._serialize.query("version_id", version_id, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(luis_app_v2, 'LuisAppV2') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + import_v2_app.metadata = {'url': '/apps/{appId}/versions/import'} + + def import_lu_format( + self, app_id, luis_app_lu, version_id=None, custom_headers=None, raw=False, **operation_config): + """Imports a new version into a LUIS application. + + :param app_id: The application ID. + :type app_id: str + :param luis_app_lu: An LU representing the LUIS application structure. + :type luis_app_lu: str + :param version_id: The new versionId to import. If not specified, the + versionId will be read from the imported object. + :type version_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.import_lu_format.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if version_id is not None: + query_parameters['versionId'] = self._serialize.query("version_id", version_id, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'text/plain' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(luis_app_lu, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + import_lu_format.metadata = {'url': '/apps/{appId}/versions/import'} + + def export_lu_format( + self, app_id, version_id, custom_headers=None, raw=False, callback=None, **operation_config): + """Exports a LUIS application to text format. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param callback: When specified, will be called with each chunk of + data that is streamed. The callback should take two arguments, the + bytes of the current chunk of data and the response object. If the + data is uploading, response will be None. + :type callback: Callable[Bytes, response=None] + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: Generator or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`HttpOperationError` + """ + # Construct URL + url = self.export_lu_format.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['format'] = self._serialize.query("self.format", self.format, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/octet-stream' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=True, **operation_config) + + if response.status_code not in [200]: + raise HttpOperationError(self._deserialize, response) + + deserialized = self._client.stream_download(response, callback) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + export_lu_format.metadata = {'url': '/apps/{appId}/versions/{versionId}/export'} diff --git a/src/durabletask/azext_durabletask/vendored_sdks/authoring/version.py b/src/durabletask/azext_durabletask/vendored_sdks/authoring/version.py new file mode 100644 index 00000000000..63f83465c87 --- /dev/null +++ b/src/durabletask/azext_durabletask/vendored_sdks/authoring/version.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +VERSION = "2.0" + diff --git a/src/durabletask/azext_durabletask/vendored_sdks/models/__init__.py b/src/durabletask/azext_durabletask/vendored_sdks/models/__init__.py new file mode 100644 index 00000000000..b907474da4c --- /dev/null +++ b/src/durabletask/azext_durabletask/vendored_sdks/models/__init__.py @@ -0,0 +1,63 @@ +# 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 ._models_py3 import ErrorAdditionalInfo +from ._models_py3 import ErrorDetail +from ._models_py3 import ErrorResponse +from ._models_py3 import Namespace +from ._models_py3 import NamespaceListResult +from ._models_py3 import NamespaceProperties +from ._models_py3 import NamespacePropertiesUpdate +from ._models_py3 import NamespaceUpdate +from ._models_py3 import Operation +from ._models_py3 import OperationDisplay +from ._models_py3 import OperationListResult +from ._models_py3 import ProxyResource +from ._models_py3 import Resource +from ._models_py3 import SystemData +from ._models_py3 import TaskHub +from ._models_py3 import TaskHubListResult +from ._models_py3 import TaskHubProperties +from ._models_py3 import TaskHubUpdate +from ._models_py3 import TrackedResource + +from ._durabletask_mgmt_client_enums import ActionType +from ._durabletask_mgmt_client_enums import CreatedByType +from ._durabletask_mgmt_client_enums import Origin +from ._durabletask_mgmt_client_enums import ProvisioningState +from ._patch import __all__ as _patch_all +from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "ErrorAdditionalInfo", + "ErrorDetail", + "ErrorResponse", + "Namespace", + "NamespaceListResult", + "NamespaceProperties", + "NamespacePropertiesUpdate", + "NamespaceUpdate", + "Operation", + "OperationDisplay", + "OperationListResult", + "ProxyResource", + "Resource", + "SystemData", + "TaskHub", + "TaskHubListResult", + "TaskHubProperties", + "TaskHubUpdate", + "TrackedResource", + "ActionType", + "CreatedByType", + "Origin", + "ProvisioningState", +] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/src/durabletask/azext_durabletask/vendored_sdks/models/_durabletask_mgmt_client_enums.py b/src/durabletask/azext_durabletask/vendored_sdks/models/_durabletask_mgmt_client_enums.py new file mode 100644 index 00000000000..3e1734239fa --- /dev/null +++ b/src/durabletask/azext_durabletask/vendored_sdks/models/_durabletask_mgmt_client_enums.py @@ -0,0 +1,54 @@ +# 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 +from azure.core import CaseInsensitiveEnumMeta + + +class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.""" + + INTERNAL = "Internal" + + +class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of identity that created the resource.""" + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + + +class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit + logs UX. Default value is "user,system". + """ + + USER = "user" + SYSTEM = "system" + USER_SYSTEM = "user,system" + + +class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The status of the current operation.""" + + SUCCEEDED = "Succeeded" + """Resource has been created.""" + FAILED = "Failed" + """Resource creation failed.""" + CANCELED = "Canceled" + """Resource creation was canceled.""" + PROVISIONING = "Provisioning" + """The resource is being provisioned""" + UPDATING = "Updating" + """The resource is updating""" + DELETING = "Deleting" + """The resource is being deleted""" + ACCEPTED = "Accepted" + """The resource create request has been accepted""" diff --git a/src/durabletask/azext_durabletask/vendored_sdks/models/_models_py3.py b/src/durabletask/azext_durabletask/vendored_sdks/models/_models_py3.py new file mode 100644 index 00000000000..3ed2783efd9 --- /dev/null +++ b/src/durabletask/azext_durabletask/vendored_sdks/models/_models_py3.py @@ -0,0 +1,730 @@ +# coding=utf-8 +# pylint: disable=too-many-lines +# -------------------------------------------------------------------------- +# 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 datetime +from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union + +from .. import _serialization + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models + + +class ErrorAdditionalInfo(_serialization.Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: JSON + """ + + _validation = { + "type": {"readonly": True}, + "info": {"readonly": True}, + } + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "info": {"key": "info", "type": "object"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetail(_serialization.Model): + """The error detail. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.durabletask.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.mgmt.durabletask.models.ErrorAdditionalInfo] + """ + + _validation = { + "code": {"readonly": True}, + "message": {"readonly": True}, + "target": {"readonly": True}, + "details": {"readonly": True}, + "additional_info": {"readonly": True}, + } + + _attribute_map = { + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[ErrorDetail]"}, + "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ErrorResponse(_serialization.Model): + """Common error response for all Azure Resource Manager APIs to return error details for failed + operations. (This also follows the OData error response format.). + + :ivar error: The error object. + :vartype error: ~azure.mgmt.durabletask.models.ErrorDetail + """ + + _attribute_map = { + "error": {"key": "error", "type": "ErrorDetail"}, + } + + def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: Any) -> None: + """ + :keyword error: The error object. + :paramtype error: ~azure.mgmt.durabletask.models.ErrorDetail + """ + super().__init__(**kwargs) + self.error = error + + +class Resource(_serialization.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.durabletask.models.SystemData + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.system_data = None + + +class TrackedResource(Resource): + """The resource model definition for an Azure Resource Manager tracked top level resource which + has 'tags' and a 'location'. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.durabletask.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + } + + def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword location: The geo-location where the resource lives. Required. + :paramtype location: str + """ + super().__init__(**kwargs) + self.tags = tags + self.location = location + + +class Namespace(TrackedResource): + """A DurableTaskService resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.durabletask.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.durabletask.models.NamespaceProperties + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "properties": {"key": "properties", "type": "NamespaceProperties"}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + properties: Optional["_models.NamespaceProperties"] = None, + **kwargs: Any + ) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword location: The geo-location where the resource lives. Required. + :paramtype location: str + :keyword properties: The resource-specific properties for this resource. + :paramtype properties: ~azure.mgmt.durabletask.models.NamespaceProperties + """ + super().__init__(tags=tags, location=location, **kwargs) + self.properties = properties + + +class NamespaceListResult(_serialization.Model): + """The response of a Namespace list operation. + + All required parameters must be populated in order to send to server. + + :ivar value: The Namespace items on this page. Required. + :vartype value: list[~azure.mgmt.durabletask.models.Namespace] + :ivar next_link: The link to the next page of items. + :vartype next_link: str + """ + + _validation = { + "value": {"required": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[Namespace]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: List["_models.Namespace"], next_link: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword value: The Namespace items on this page. Required. + :paramtype value: list[~azure.mgmt.durabletask.models.Namespace] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class NamespaceProperties(_serialization.Model): + """Details of the Namespace. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded", + "Failed", "Canceled", "Provisioning", "Updating", "Deleting", and "Accepted". + :vartype provisioning_state: str or ~azure.mgmt.durabletask.models.ProvisioningState + :ivar url: URL of the durable task service. + :vartype url: str + :ivar dashboard_url: URL of the durable task service dashboard. + :vartype dashboard_url: str + :ivar ip_allowlist: IP allow list for durable task service. Values can be Pv4, IPv6 or CIDR. + :vartype ip_allowlist: list[str] + """ + + _validation = { + "provisioning_state": {"readonly": True}, + "url": {"readonly": True}, + "dashboard_url": {"readonly": True}, + } + + _attribute_map = { + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "url": {"key": "url", "type": "str"}, + "dashboard_url": {"key": "dashboardUrl", "type": "str"}, + "ip_allowlist": {"key": "ipAllowlist", "type": "[str]"}, + } + + def __init__(self, *, ip_allowlist: Optional[List[str]] = None, **kwargs: Any) -> None: + """ + :keyword ip_allowlist: IP allow list for durable task service. Values can be Pv4, IPv6 or CIDR. + :paramtype ip_allowlist: list[str] + """ + super().__init__(**kwargs) + self.provisioning_state = None + self.url = None + self.dashboard_url = None + self.ip_allowlist = ip_allowlist + + +class NamespacePropertiesUpdate(_serialization.Model): + """The template for adding optional properties. + + :ivar ip_allowlist: IP allow list for durable task service. Values can be Pv4, IPv6 or CIDR. + :vartype ip_allowlist: list[str] + """ + + _attribute_map = { + "ip_allowlist": {"key": "ipAllowlist", "type": "[str]"}, + } + + def __init__(self, *, ip_allowlist: Optional[List[str]] = None, **kwargs: Any) -> None: + """ + :keyword ip_allowlist: IP allow list for durable task service. Values can be Pv4, IPv6 or CIDR. + :paramtype ip_allowlist: list[str] + """ + super().__init__(**kwargs) + self.ip_allowlist = ip_allowlist + + +class NamespaceUpdate(_serialization.Model): + """Update namespace. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: RP-specific properties. + :vartype properties: ~azure.mgmt.durabletask.models.NamespaceProperties + """ + + _attribute_map = { + "tags": {"key": "tags", "type": "{str}"}, + "properties": {"key": "properties", "type": "NamespaceProperties"}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + properties: Optional["_models.NamespaceProperties"] = None, + **kwargs: Any + ) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword properties: RP-specific properties. + :paramtype properties: ~azure.mgmt.durabletask.models.NamespaceProperties + """ + super().__init__(**kwargs) + self.tags = tags + self.properties = properties + + +class Operation(_serialization.Model): + """Details of a REST API operation, returned from the Resource Provider Operations API. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + :vartype name: str + :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for + data-plane operations and "false" for ARM/control-plane operations. + :vartype is_data_action: bool + :ivar display: Localized display information for this particular operation. + :vartype display: ~azure.mgmt.durabletask.models.OperationDisplay + :ivar origin: The intended executor of the operation; as in Resource Based Access Control + (RBAC) and audit logs UX. Default value is "user,system". Known values are: "user", "system", + and "user,system". + :vartype origin: str or ~azure.mgmt.durabletask.models.Origin + :ivar action_type: Enum. Indicates the action type. "Internal" refers to actions that are for + internal only APIs. "Internal" + :vartype action_type: str or ~azure.mgmt.durabletask.models.ActionType + """ + + _validation = { + "name": {"readonly": True}, + "is_data_action": {"readonly": True}, + "origin": {"readonly": True}, + "action_type": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "is_data_action": {"key": "isDataAction", "type": "bool"}, + "display": {"key": "display", "type": "OperationDisplay"}, + "origin": {"key": "origin", "type": "str"}, + "action_type": {"key": "actionType", "type": "str"}, + } + + def __init__(self, *, display: Optional["_models.OperationDisplay"] = None, **kwargs: Any) -> None: + """ + :keyword display: Localized display information for this particular operation. + :paramtype display: ~azure.mgmt.durabletask.models.OperationDisplay + """ + super().__init__(**kwargs) + self.name = None + self.is_data_action = None + self.display = display + self.origin = None + self.action_type = None + + +class OperationDisplay(_serialization.Model): + """Localized display information for this particular operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft + Monitoring Insights" or "Microsoft Compute". + :vartype provider: str + :ivar resource: The localized friendly name of the resource type related to this operation. + E.g. "Virtual Machines" or "Job Schedule Collections". + :vartype resource: str + :ivar operation: The concise, localized friendly name for the operation; suitable for + dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + :vartype operation: str + :ivar description: The short, localized friendly description of the operation; suitable for + tool tips and detailed views. + :vartype description: str + """ + + _validation = { + "provider": {"readonly": True}, + "resource": {"readonly": True}, + "operation": {"readonly": True}, + "description": {"readonly": True}, + } + + _attribute_map = { + "provider": {"key": "provider", "type": "str"}, + "resource": {"key": "resource", "type": "str"}, + "operation": {"key": "operation", "type": "str"}, + "description": {"key": "description", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + self.description = None + + +class OperationListResult(_serialization.Model): + """A list of REST API operations supported by an Azure Resource Provider. It contains an URL link + to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of operations supported by the resource provider. + :vartype value: list[~azure.mgmt.durabletask.models.Operation] + :ivar next_link: URL to get the next set of operation list results (if there are any). + :vartype next_link: str + """ + + _validation = { + "value": {"readonly": True}, + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[Operation]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.value = None + self.next_link = None + + +class ProxyResource(Resource): + """The resource model definition for a Azure Resource Manager proxy resource. It will not have + tags and a location. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.durabletask.models.SystemData + """ + + +class SystemData(_serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :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. Known values are: + "User", "Application", "ManagedIdentity", and "Key". + :vartype created_by_type: str or ~azure.mgmt.durabletask.models.CreatedByType + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_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. Known values + are: "User", "Application", "ManagedIdentity", and "Key". + :vartype last_modified_by_type: str or ~azure.mgmt.durabletask.models.CreatedByType + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + "created_by": {"key": "createdBy", "type": "str"}, + "created_by_type": {"key": "createdByType", "type": "str"}, + "created_at": {"key": "createdAt", "type": "iso-8601"}, + "last_modified_by": {"key": "lastModifiedBy", "type": "str"}, + "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"}, + "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, + } + + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs: Any + ) -> None: + """ + :keyword created_by: The identity that created the resource. + :paramtype created_by: str + :keyword created_by_type: The type of identity that created the resource. Known values are: + "User", "Application", "ManagedIdentity", and "Key". + :paramtype created_by_type: str or ~azure.mgmt.durabletask.models.CreatedByType + :keyword created_at: The timestamp of resource creation (UTC). + :paramtype created_at: ~datetime.datetime + :keyword last_modified_by: The identity that last modified the resource. + :paramtype last_modified_by: str + :keyword last_modified_by_type: The type of identity that last modified the resource. Known + values are: "User", "Application", "ManagedIdentity", and "Key". + :paramtype last_modified_by_type: str or ~azure.mgmt.durabletask.models.CreatedByType + :keyword last_modified_at: The timestamp of resource last modification (UTC). + :paramtype last_modified_at: ~datetime.datetime + """ + super().__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + +class TaskHub(ProxyResource): + """An Task Hub resource belonging to the namespace. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.durabletask.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.durabletask.models.TaskHubProperties + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "TaskHubProperties"}, + "tags": {"key": "tags", "type": "{str}"}, + } + + def __init__( + self, + *, + properties: Optional["_models.TaskHubProperties"] = None, + tags: Optional[Dict[str, str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword properties: The resource-specific properties for this resource. + :paramtype properties: ~azure.mgmt.durabletask.models.TaskHubProperties + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + """ + super().__init__(**kwargs) + self.properties = properties + self.tags = tags + + +class TaskHubListResult(_serialization.Model): + """The response of a TaskHub list operation. + + All required parameters must be populated in order to send to server. + + :ivar value: The TaskHub items on this page. Required. + :vartype value: list[~azure.mgmt.durabletask.models.TaskHub] + :ivar next_link: The link to the next page of items. + :vartype next_link: str + """ + + _validation = { + "value": {"required": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[TaskHub]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: List["_models.TaskHub"], next_link: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword value: The TaskHub items on this page. Required. + :paramtype value: list[~azure.mgmt.durabletask.models.TaskHub] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class TaskHubProperties(_serialization.Model): + """The properties of Task Hub. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded", + "Failed", "Canceled", "Provisioning", "Updating", "Deleting", and "Accepted". + :vartype provisioning_state: str or ~azure.mgmt.durabletask.models.ProvisioningState + """ + + _validation = { + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "provisioning_state": {"key": "provisioningState", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.provisioning_state = None + + +class TaskHubUpdate(_serialization.Model): + """Update Task Hub. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + _attribute_map = { + "tags": {"key": "tags", "type": "{str}"}, + } + + def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + """ + super().__init__(**kwargs) + self.tags = tags diff --git a/src/durabletask/azext_durabletask/vendored_sdks/models/_patch.py b/src/durabletask/azext_durabletask/vendored_sdks/models/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/src/durabletask/azext_durabletask/vendored_sdks/models/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/src/durabletask/azext_durabletask/vendored_sdks/operations/__init__.py b/src/durabletask/azext_durabletask/vendored_sdks/operations/__init__.py new file mode 100644 index 00000000000..03a0d30262e --- /dev/null +++ b/src/durabletask/azext_durabletask/vendored_sdks/operations/__init__.py @@ -0,0 +1,23 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._namespaces_operations import NamespacesOperations +from ._task_hubs_operations import TaskHubsOperations + +from ._patch import __all__ as _patch_all +from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "Operations", + "NamespacesOperations", + "TaskHubsOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/src/durabletask/azext_durabletask/vendored_sdks/operations/_namespaces_operations.py b/src/durabletask/azext_durabletask/vendored_sdks/operations/_namespaces_operations.py new file mode 100644 index 00000000000..389abaac9a1 --- /dev/null +++ b/src/durabletask/azext_durabletask/vendored_sdks/operations/_namespaces_operations.py @@ -0,0 +1,990 @@ +# pylint: disable=too-many-lines,too-many-statements +# 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 io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from .._serialization import Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.DurableTask/namespaces") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_by_resource_group_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/namespaces", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_request( + resource_group_name: str, namespace_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/namespaces/{namespaceName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", pattern=r"^[a-zA-Z0-9-]{3,64}$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_or_update_request( + resource_group_name: str, namespace_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/namespaces/{namespaceName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", pattern=r"^[a-zA-Z0-9-]{3,64}$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_update_request( + resource_group_name: str, namespace_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/namespaces/{namespaceName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", pattern=r"^[a-zA-Z0-9-]{3,64}$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_request( + resource_group_name: str, namespace_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/namespaces/{namespaceName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", pattern=r"^[a-zA-Z0-9-]{3,64}$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +class NamespacesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.durabletask.DurabletaskMgmtClient`'s + :attr:`namespaces` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.Namespace"]: + """List Namespace resources by subscription ID. + + :return: An iterator like instance of either Namespace or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.durabletask.models.Namespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.NamespaceListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + + print("RRL REQUEST") + #print(_request) + #_request.url = "https://eastus.management.azure.com/subscriptions/a0d0be64-6f56-451c-a392-2ec805aedfcb/providers/Microsoft.DurableTask/namespaces?api-version=2024-02-01-preview" + print(_request) + # _request.url = "https://northcentralus.management.azure.com/subscriptions/f103df57-5fdd-4f9b-984b-b479bcc8a682/providers/Microsoft.DurableTask/namespaces?api-version=2024-02-01-preview" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("NamespaceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + print("RRL REQUEST") + print(_request) + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + print("RRL response:") + print(response) + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Namespace"]: + """List Namespace resources by resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of either Namespace or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.durabletask.models.Namespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.NamespaceListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("NamespaceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get(self, resource_group_name: str, namespace_name: str, **kwargs: Any) -> _models.Namespace: + """Get a Namespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the service. Required. + :type namespace_name: str + :return: Namespace or the result of cls(response) + :rtype: ~azure.mgmt.durabletask.models.Namespace + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.Namespace] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Namespace", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + namespace_name: str, + resource: Union[_models.Namespace, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(resource, (IOBase, bytes)): + print("RRL isinstance") + _content = resource + else: + _json = self._serialize.body(resource, "Namespace") + print("RRL _json") + # _json = '{"type": "Microsoft.DurableTask/namespaces","location": "northcentralus", "properties": {"ipAllowlist": [ "0.0.0.0/0" ] }}' + print(_json) + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + print("RRL response") + print(response) + + print("RRL _request") + print(_request) + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + namespace_name: str, + resource: _models.Namespace, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Namespace]: + """Create a Namespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the service. Required. + :type namespace_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.durabletask.models.Namespace + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either Namespace or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.Namespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + namespace_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Namespace]: + """Create a Namespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the service. Required. + :type namespace_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either Namespace or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.Namespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + namespace_name: str, + resource: Union[_models.Namespace, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.Namespace]: + """Create a Namespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the service. Required. + :type namespace_name: str + :param resource: Resource create parameters. Is either a Namespace type or a IO[bytes] type. + Required. + :type resource: ~azure.mgmt.durabletask.models.Namespace or IO[bytes] + :return: An instance of LROPoller that returns either Namespace or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.Namespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Namespace] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + resource=resource, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("Namespace", pipeline_response.http_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Namespace].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Namespace]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + namespace_name: str, + properties: Union[_models.NamespaceUpdate, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _json = self._serialize.body(properties, "NamespaceUpdate") + + _request = build_update_request( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + namespace_name: str, + properties: _models.NamespaceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Namespace]: + """Update a Namespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the service. Required. + :type namespace_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.durabletask.models.NamespaceUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either Namespace or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.Namespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + namespace_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Namespace]: + """Update a Namespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the service. Required. + :type namespace_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either Namespace or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.Namespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + namespace_name: str, + properties: Union[_models.NamespaceUpdate, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.Namespace]: + """Update a Namespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the service. Required. + :type namespace_name: str + :param properties: The resource properties to be updated. Is either a NamespaceUpdate type or a + IO[bytes] type. Required. + :type properties: ~azure.mgmt.durabletask.models.NamespaceUpdate or IO[bytes] + :return: An instance of LROPoller that returns either Namespace or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.Namespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Namespace] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + properties=properties, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("Namespace", pipeline_response.http_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Namespace].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Namespace]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial(self, resource_group_name: str, namespace_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, namespace_name: str, **kwargs: Any) -> LROPoller[None]: + """Delete a Namespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the service. Required. + :type namespace_name: str + :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: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/durabletask/azext_durabletask/vendored_sdks/operations/_operations.py b/src/durabletask/azext_durabletask/vendored_sdks/operations/_operations.py new file mode 100644 index 00000000000..ec72d57216b --- /dev/null +++ b/src/durabletask/azext_durabletask/vendored_sdks/operations/_operations.py @@ -0,0 +1,152 @@ +# pylint: disable=too-many-lines,too-many-statements +# 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 sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from .._serialization import Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/providers/Microsoft.DurableTask/operations") + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class Operations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.durabletask.DurabletaskMgmtClient`'s + :attr:`operations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: + """List the operations for the provider. + + :return: An iterator like instance of either Operation or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.durabletask.models.Operation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("OperationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) diff --git a/src/durabletask/azext_durabletask/vendored_sdks/operations/_patch.py b/src/durabletask/azext_durabletask/vendored_sdks/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/src/durabletask/azext_durabletask/vendored_sdks/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/src/durabletask/azext_durabletask/vendored_sdks/operations/_task_hubs_operations.py b/src/durabletask/azext_durabletask/vendored_sdks/operations/_task_hubs_operations.py new file mode 100644 index 00000000000..4c2de7d0bbb --- /dev/null +++ b/src/durabletask/azext_durabletask/vendored_sdks/operations/_task_hubs_operations.py @@ -0,0 +1,717 @@ +# pylint: disable=too-many-lines,too-many-statements +# 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 io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from .._serialization import Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_by_namespace_request( + resource_group_name: str, namespace_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/namespaces/{namespaceName}/taskHubs", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", pattern=r"^[a-zA-Z0-9-]{3,64}$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_request( + resource_group_name: str, namespace_name: str, task_hub_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/namespaces/{namespaceName}/taskHubs/{taskHubName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", pattern=r"^[a-zA-Z0-9-]{3,64}$"), + "taskHubName": _SERIALIZER.url("task_hub_name", task_hub_name, "str", pattern=r"^[a-zA-Z0-9-]{3,64}$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_or_update_request( + resource_group_name: str, namespace_name: str, task_hub_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/namespaces/{namespaceName}/taskHubs/{taskHubName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", pattern=r"^[a-zA-Z0-9-]{3,64}$"), + "taskHubName": _SERIALIZER.url("task_hub_name", task_hub_name, "str", pattern=r"^[a-zA-Z0-9-]{3,64}$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_update_request( + resource_group_name: str, namespace_name: str, task_hub_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/namespaces/{namespaceName}/taskHubs/{taskHubName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", pattern=r"^[a-zA-Z0-9-]{3,64}$"), + "taskHubName": _SERIALIZER.url("task_hub_name", task_hub_name, "str", pattern=r"^[a-zA-Z0-9-]{3,64}$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_request( + resource_group_name: str, namespace_name: str, task_hub_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/namespaces/{namespaceName}/taskHubs/{taskHubName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", pattern=r"^[a-zA-Z0-9-]{3,64}$"), + "taskHubName": _SERIALIZER.url("task_hub_name", task_hub_name, "str", pattern=r"^[a-zA-Z0-9-]{3,64}$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +class TaskHubsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.durabletask.DurabletaskMgmtClient`'s + :attr:`task_hubs` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_namespace( + self, resource_group_name: str, namespace_name: str, **kwargs: Any + ) -> Iterable["_models.TaskHub"]: + """List Task Hubs. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the service. Required. + :type namespace_name: str + :return: An iterator like instance of either TaskHub or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.durabletask.models.TaskHub] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.TaskHubListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_namespace_request( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("TaskHubListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get(self, resource_group_name: str, namespace_name: str, task_hub_name: str, **kwargs: Any) -> _models.TaskHub: + """Get a Task Hub. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the service. Required. + :type namespace_name: str + :param task_hub_name: Task Hub name. Required. + :type task_hub_name: str + :return: TaskHub or the result of cls(response) + :rtype: ~azure.mgmt.durabletask.models.TaskHub + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.TaskHub] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + task_hub_name=task_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("TaskHub", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + namespace_name: str, + task_hub_name: str, + resource: _models.TaskHub, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.TaskHub: + """Create or update a Task Hub. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the service. Required. + :type namespace_name: str + :param task_hub_name: Task Hub name. Required. + :type task_hub_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.durabletask.models.TaskHub + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TaskHub or the result of cls(response) + :rtype: ~azure.mgmt.durabletask.models.TaskHub + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + namespace_name: str, + task_hub_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.TaskHub: + """Create or update a Task Hub. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the service. Required. + :type namespace_name: str + :param task_hub_name: Task Hub name. Required. + :type task_hub_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: TaskHub or the result of cls(response) + :rtype: ~azure.mgmt.durabletask.models.TaskHub + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + namespace_name: str, + task_hub_name: str, + resource: Union[_models.TaskHub, IO[bytes]], + **kwargs: Any + ) -> _models.TaskHub: + """Create or update a Task Hub. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the service. Required. + :type namespace_name: str + :param task_hub_name: Task Hub name. Required. + :type task_hub_name: str + :param resource: Resource create parameters. Is either a TaskHub type or a IO[bytes] type. + Required. + :type resource: ~azure.mgmt.durabletask.models.TaskHub or IO[bytes] + :return: TaskHub or the result of cls(response) + :rtype: ~azure.mgmt.durabletask.models.TaskHub + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TaskHub] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _json = self._serialize.body(resource, "TaskHub") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + task_hub_name=task_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("TaskHub", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def update( + self, + resource_group_name: str, + namespace_name: str, + task_hub_name: str, + properties: _models.TaskHubUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.TaskHub: + """Update a Task Hub. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the service. Required. + :type namespace_name: str + :param task_hub_name: Task Hub name. Required. + :type task_hub_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.durabletask.models.TaskHubUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: TaskHub or the result of cls(response) + :rtype: ~azure.mgmt.durabletask.models.TaskHub + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + namespace_name: str, + task_hub_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.TaskHub: + """Update a Task Hub. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the service. Required. + :type namespace_name: str + :param task_hub_name: Task Hub name. Required. + :type task_hub_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: TaskHub or the result of cls(response) + :rtype: ~azure.mgmt.durabletask.models.TaskHub + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update( + self, + resource_group_name: str, + namespace_name: str, + task_hub_name: str, + properties: Union[_models.TaskHubUpdate, IO[bytes]], + **kwargs: Any + ) -> _models.TaskHub: + """Update a Task Hub. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the service. Required. + :type namespace_name: str + :param task_hub_name: Task Hub name. Required. + :type task_hub_name: str + :param properties: The resource properties to be updated. Is either a TaskHubUpdate type or a + IO[bytes] type. Required. + :type properties: ~azure.mgmt.durabletask.models.TaskHubUpdate or IO[bytes] + :return: TaskHub or the result of cls(response) + :rtype: ~azure.mgmt.durabletask.models.TaskHub + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TaskHub] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _json = self._serialize.body(properties, "TaskHubUpdate") + + _request = build_update_request( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + task_hub_name=task_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("TaskHub", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, namespace_name: str, task_hub_name: str, **kwargs: Any + ) -> None: + """Delete a Task Hub. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the service. Required. + :type namespace_name: str + :param task_hub_name: Task Hub name. Required. + :type task_hub_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + task_hub_name=task_hub_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/src/durabletask/azext_durabletask/vendored_sdks/py.typed b/src/durabletask/azext_durabletask/vendored_sdks/py.typed new file mode 100644 index 00000000000..e5aff4f83af --- /dev/null +++ b/src/durabletask/azext_durabletask/vendored_sdks/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/src/durabletask/azext_durabletask/vendored_sdks/version.py b/src/durabletask/azext_durabletask/vendored_sdks/version.py new file mode 100644 index 00000000000..e6a39d5dfec --- /dev/null +++ b/src/durabletask/azext_durabletask/vendored_sdks/version.py @@ -0,0 +1,12 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +VERSION = "0.7.1" diff --git a/src/durabletask/setup.cfg b/src/durabletask/setup.cfg new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/durabletask/setup.py b/src/durabletask/setup.py new file mode 100644 index 00000000000..f4e45ab4bc8 --- /dev/null +++ b/src/durabletask/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 +try: + from azure_bdist_wheel import cmdclass +except ImportError: + from distutils import log as logger + logger.warn("Wheel is not available, disabling bdist_wheel hook") + +# TODO: Confirm this is the right version number you want and it matches your +# HISTORY.rst entry. +VERSION = '0.1.0' + +# 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', +] + +# TODO: Add any additional SDK dependencies here +DEPENDENCIES = [] + +with open('README.rst', 'r', encoding='utf-8') as f: + README = f.read() +with open('HISTORY.rst', 'r', encoding='utf-8') as f: + HISTORY = f.read() + +setup( + name='durabletask', + version=VERSION, + description='Microsoft Azure Command-Line Tools Durabletask Extension', + # TODO: Update author and email, if applicable + author='Microsoft Corporation', + author_email='azpycli@microsoft.com', + # TODO: change to your extension source code repo if the code will not be put in azure-cli-extensions repo + url='https://github.com/Azure/azure-cli-extensions/tree/master/src/durabletask', + long_description=README + '\n\n' + HISTORY, + license='MIT', + classifiers=CLASSIFIERS, + packages=find_packages(), + install_requires=DEPENDENCIES, + package_data={'azext_durabletask': ['azext_metadata.json']}, +) \ No newline at end of file From 8e8730076a0ec33eb0151fe26dafbdd43a70b999 Mon Sep 17 00:00:00 2001 From: Ryan Lettieri Date: Mon, 2 Sep 2024 13:07:02 -0600 Subject: [PATCH 02/19] More changes to allow for namespace create and list to have appropriate params Signed-off-by: Ryan Lettieri --- src/durabletask/azext_durabletask/_params.py | 2 +- src/durabletask/azext_durabletask/custom.py | 10 +++------- .../operations/_namespaces_operations.py | 18 ------------------ 3 files changed, 4 insertions(+), 26 deletions(-) diff --git a/src/durabletask/azext_durabletask/_params.py b/src/durabletask/azext_durabletask/_params.py index f84c4ae314f..c8d3713ea66 100644 --- a/src/durabletask/azext_durabletask/_params.py +++ b/src/durabletask/azext_durabletask/_params.py @@ -17,7 +17,7 @@ def load_arguments(self, _): with self.argument_context('durabletask') as c: c.argument('tags', tags_type) c.argument('location', validator=get_default_location_from_resource_group) - c.argument('durabletask_name', durabletask_name_type, options_list=['--name', '-n']) + c.argument('namespace_name', durabletask_name_type, options_list=['--name', '-n']) with self.argument_context('durabletask list') as c: c.argument('durabletask_name', durabletask_name_type, id_part=None) diff --git a/src/durabletask/azext_durabletask/custom.py b/src/durabletask/azext_durabletask/custom.py index 2358c0b4286..84f813fb937 100644 --- a/src/durabletask/azext_durabletask/custom.py +++ b/src/durabletask/azext_durabletask/custom.py @@ -15,7 +15,6 @@ def create_durabletask(cmd, client, resource_group_name, durabletask_name, locat def list_durabletask(cmd, client, resource_group_name=None): client = cf_durabletask(cmd.cli_ctx, None) return client.namespaces.list_by_subscription() - # raise CLIError('TODO: Implement `durabletask list`') def update_durabletask(cmd, instance, tags=None): @@ -26,16 +25,13 @@ def update_durabletask(cmd, instance, tags=None): # Namespace Operations -def create_namespace(cmd, client, resource_group_name, durabletask_name, location=None, tags=None): - namespace = TrackedResource(location='eastus') +def create_namespace(cmd, client, resource_group_name, namespace_name, location="northcentralus", tags=None): client = cf_durabletask_namespaces(cmd.cli_ctx, None) - return client.begin_create_or_update(resource_group_name, "test-namespace-api", resource=Namespace(location="eastus")) - raise CLIError('TODO: Implement `durabletask namespace create`') + return client.begin_create_or_update(resource_group_name, namespace_name, resource=Namespace(location=location)) def list_namespace(cmd, client, resource_group_name=None): client = cf_durabletask_namespaces(cmd.cli_ctx, None) - return client.list_by_resource_group(resource_group_name="test-rp-rg-eastus") - raise CLIError('TODO: Implement `durabletask namespace list`') + return client.list_by_resource_group(resource_group_name=resource_group_name) def show_namespace(cmd, client, resource_group_name=None): raise CLIError('TODO: Implement `durabletask namespace show`') diff --git a/src/durabletask/azext_durabletask/vendored_sdks/operations/_namespaces_operations.py b/src/durabletask/azext_durabletask/vendored_sdks/operations/_namespaces_operations.py index 389abaac9a1..e156b6dda8a 100644 --- a/src/durabletask/azext_durabletask/vendored_sdks/operations/_namespaces_operations.py +++ b/src/durabletask/azext_durabletask/vendored_sdks/operations/_namespaces_operations.py @@ -304,11 +304,6 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) _request.method = "GET" - print("RRL REQUEST") - #print(_request) - #_request.url = "https://eastus.management.azure.com/subscriptions/a0d0be64-6f56-451c-a392-2ec805aedfcb/providers/Microsoft.DurableTask/namespaces?api-version=2024-02-01-preview" - print(_request) - # _request.url = "https://northcentralus.management.azure.com/subscriptions/f103df57-5fdd-4f9b-984b-b479bcc8a682/providers/Microsoft.DurableTask/namespaces?api-version=2024-02-01-preview" return _request def extract_data(pipeline_response): @@ -321,15 +316,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): _request = prepare_request(next_link) - print("RRL REQUEST") - print(_request) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - print("RRL response:") - print(response) if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) @@ -501,13 +492,9 @@ def _create_or_update_initial( _json = None _content = None if isinstance(resource, (IOBase, bytes)): - print("RRL isinstance") _content = resource else: _json = self._serialize.body(resource, "Namespace") - print("RRL _json") - # _json = '{"type": "Microsoft.DurableTask/namespaces","location": "northcentralus", "properties": {"ipAllowlist": [ "0.0.0.0/0" ] }}' - print(_json) _request = build_create_or_update_request( resource_group_name=resource_group_name, @@ -529,11 +516,6 @@ def _create_or_update_initial( ) response = pipeline_response.http_response - print("RRL response") - print(response) - - print("RRL _request") - print(_request) if response.status_code not in [200, 201]: try: From 0ffd553df87687ebc9d414e2eca78a360a3cfac4 Mon Sep 17 00:00:00 2001 From: Ryan Lettieri Date: Tue, 3 Sep 2024 09:42:09 -0600 Subject: [PATCH 03/19] Linting and styling Signed-off-by: Ryan Lettieri --- src/durabletask/azext_durabletask/__init__.py | 2 +- .../azext_durabletask/_client_factory.py | 4 ++- src/durabletask/azext_durabletask/_help.py | 2 +- .../azext_durabletask/_validators.py | 1 + src/durabletask/azext_durabletask/commands.py | 5 +--- src/durabletask/azext_durabletask/custom.py | 29 ++++++++++--------- src/durabletask/setup.py | 2 +- 7 files changed, 24 insertions(+), 21 deletions(-) diff --git a/src/durabletask/azext_durabletask/__init__.py b/src/durabletask/azext_durabletask/__init__.py index 5618c021d8b..dbc80a3b2eb 100644 --- a/src/durabletask/azext_durabletask/__init__.py +++ b/src/durabletask/azext_durabletask/__init__.py @@ -17,7 +17,7 @@ def __init__(self, cli_ctx=None): operations_tmpl='azext_durabletask.custom#{}', client_factory=cf_durabletask) super(DurabletaskCommandsLoader, self).__init__(cli_ctx=cli_ctx, - custom_command_type=durabletask_custom) + custom_command_type=durabletask_custom) def load_command_table(self, args): from azext_durabletask.commands import load_command_table diff --git a/src/durabletask/azext_durabletask/_client_factory.py b/src/durabletask/azext_durabletask/_client_factory.py index a4263ced8bd..c143e26b17a 100644 --- a/src/durabletask/azext_durabletask/_client_factory.py +++ b/src/durabletask/azext_durabletask/_client_factory.py @@ -8,8 +8,10 @@ def cf_durabletask(cli_ctx, aux_subscriptions=None, **_): from azext_durabletask.vendored_sdks import DurabletaskMgmtClient return get_mgmt_service_client(cli_ctx, DurabletaskMgmtClient) + def cf_durabletask_namespaces(cli_ctx, aux_subscriptions=None, **_): return cf_durabletask(cli_ctx).namespaces + def cf_durabletask_taskhubs(cli_ctx, aux_subscriptions=None, **_): - return cf_durabletask(cli_ctx).task_hubs \ No newline at end of file + return cf_durabletask(cli_ctx).task_hubs diff --git a/src/durabletask/azext_durabletask/_help.py b/src/durabletask/azext_durabletask/_help.py index 9cb3226f1bd..c5f423c69d0 100644 --- a/src/durabletask/azext_durabletask/_help.py +++ b/src/durabletask/azext_durabletask/_help.py @@ -92,4 +92,4 @@ helps['durabletask taskhub update'] = """ type: command short-summary: Update a Durabletask taskhub. -""" \ No newline at end of file +""" diff --git a/src/durabletask/azext_durabletask/_validators.py b/src/durabletask/azext_durabletask/_validators.py index 821630f5f34..1395c3f7d19 100644 --- a/src/durabletask/azext_durabletask/_validators.py +++ b/src/durabletask/azext_durabletask/_validators.py @@ -6,6 +6,7 @@ def example_name_or_id_validator(cmd, namespace): # Example of a storage account name or ID validator. + # pylint: disable=line-too-long # See: https://github.com/Azure/azure-cli/blob/dev/doc/authoring_command_modules/authoring_commands.md#supporting-name-or-id-parameters from azure.cli.core.commands.client_factory import get_subscription_id from msrestazure.tools import is_valid_resource_id, resource_id diff --git a/src/durabletask/azext_durabletask/commands.py b/src/durabletask/azext_durabletask/commands.py index 8e709376db1..4081c31fa48 100644 --- a/src/durabletask/azext_durabletask/commands.py +++ b/src/durabletask/azext_durabletask/commands.py @@ -29,15 +29,13 @@ def load_command_table(self, _): # g.show_command('show', 'get') g.generic_update_command('update', setter_name='update', custom_func_name='update_durabletask') - with self.command_group('durabletask namespace', durabletask_namespace_sdk, client_factory=cf_durabletask_namespaces) as g: g.custom_command('create', 'create_namespace') g.custom_command('list', 'list_namespace') # g.delete_command('delete', 'delete_namespace') g.generic_update_command('update', setter_name='update', custom_func_name='update_namespace') - - with self.command_group('durabletask taskhub', durabletask_sdk, client_factory=cf_durabletask_taskhubs) as g: + with self.command_group('durabletask taskhub', durabletask_taskhub_sdk, client_factory=cf_durabletask_taskhubs) as g: g.custom_command('create', 'create_taskhub') g.custom_command('list', 'list_taskhub') # g.show_command('show', 'show_taskhub') @@ -45,4 +43,3 @@ def load_command_table(self, _): with self.command_group('durabletask', is_preview=True): pass - diff --git a/src/durabletask/azext_durabletask/custom.py b/src/durabletask/azext_durabletask/custom.py index 84f813fb937..b53f6b2b08f 100644 --- a/src/durabletask/azext_durabletask/custom.py +++ b/src/durabletask/azext_durabletask/custom.py @@ -7,56 +7,59 @@ from azext_durabletask._client_factory import cf_durabletask, cf_durabletask_namespaces, cf_durabletask_taskhubs from azext_durabletask.vendored_sdks.models import Namespace, TrackedResource + def create_durabletask(cmd, client, resource_group_name, durabletask_name, location=None, tags=None): - client = cf_durabletask(cmd.cli_ctx, None) + # client = cf_durabletask(cmd.cli_ctx, None) raise CLIError('TODO: Implement `durabletask create`') def list_durabletask(cmd, client, resource_group_name=None): - client = cf_durabletask(cmd.cli_ctx, None) + # client = cf_durabletask(cmd.cli_ctx, None) return client.namespaces.list_by_subscription() def update_durabletask(cmd, instance, tags=None): - client = cf_durabletask(cmd.cli_ctx, None) + # client = cf_durabletask(cmd.cli_ctx, None) with cmd.update_context(instance) as c: c.set_param('tags', tags) return instance # Namespace Operations -def create_namespace(cmd, client, resource_group_name, namespace_name, location="northcentralus", tags=None): +def create_namespace(cmd, client, resource_group_name, namespace_name, location="northcentralus"): client = cf_durabletask_namespaces(cmd.cli_ctx, None) return client.begin_create_or_update(resource_group_name, namespace_name, resource=Namespace(location=location)) + def list_namespace(cmd, client, resource_group_name=None): client = cf_durabletask_namespaces(cmd.cli_ctx, None) return client.list_by_resource_group(resource_group_name=resource_group_name) + def show_namespace(cmd, client, resource_group_name=None): raise CLIError('TODO: Implement `durabletask namespace show`') + def delete_namespace(cmd, client, resource_group_name=None): raise CLIError('TODO: Implement `durabletask namespace delete`') -def update_namespace(cmd, instance, tags=None): - with cmd.update_context(instance) as c: - c.set_param('tags', tags) - return instance + +def update_namespace(cmd, instance): + raise CLIError('TODO: Implement `durabletask namespace update`') # Taskhub Operations -def create_taskhub(cmd, client, resource_group_name, durabletask_name, location=None, tags=None): +def create_taskhub(cmd, client, resource_group_name, durabletask_name, location=None): raise CLIError('TODO: Implement `durabletask taskhub create`') def list_taskhub(cmd, client, resource_group_name=None): raise CLIError('TODO: Implement `durabletask taskhub list`') + def show_taskhub(cmd, client, resource_group_name=None): raise CLIError('TODO: Implement `durabletask taskhub show`') -def update_taskhub(cmd, instance, tags=None): - with cmd.update_context(instance) as c: - c.set_param('tags', tags) - return instance \ No newline at end of file + +def update_taskhub(cmd, instance): + raise CLIError('TODO: Implement `durabletask taskhub update`') diff --git a/src/durabletask/setup.py b/src/durabletask/setup.py index f4e45ab4bc8..7f2875b955f 100644 --- a/src/durabletask/setup.py +++ b/src/durabletask/setup.py @@ -55,4 +55,4 @@ packages=find_packages(), install_requires=DEPENDENCIES, package_data={'azext_durabletask': ['azext_metadata.json']}, -) \ No newline at end of file +) From c9f109ffafd750ff27507e034c0bcea3fca56ffb Mon Sep 17 00:00:00 2001 From: Ryan Lettieri Date: Tue, 3 Sep 2024 10:09:59 -0600 Subject: [PATCH 04/19] Removing max cli version constraint Signed-off-by: Ryan Lettieri --- src/durabletask/azext_durabletask/azext_metadata.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/durabletask/azext_durabletask/azext_metadata.json b/src/durabletask/azext_durabletask/azext_metadata.json index 9d187e1e307..55c81bf3328 100644 --- a/src/durabletask/azext_durabletask/azext_metadata.json +++ b/src/durabletask/azext_durabletask/azext_metadata.json @@ -1,5 +1,4 @@ { "azext.isPreview": true, - "azext.minCliCoreVersion": "2.0.67", - "azext.maxCliCoreVersion": "2.45.0" + "azext.minCliCoreVersion": "2.0.67" } \ No newline at end of file From 7c3a939d35c039d67d2a767cac51a543db7ceb1c Mon Sep 17 00:00:00 2001 From: Ryan Lettieri Date: Thu, 5 Sep 2024 12:37:32 -0600 Subject: [PATCH 05/19] Adding in additional commands, help, and removing test Signed-off-by: Ryan Lettieri --- src/durabletask/azext_durabletask/_help.py | 49 ++++------------- src/durabletask/azext_durabletask/_params.py | 20 +++++++ .../azext_durabletask/azext_metadata.json | 1 - src/durabletask/azext_durabletask/commands.py | 23 +++----- src/durabletask/azext_durabletask/custom.py | 53 +++++++++---------- .../tests/latest/test_durabletask_scenario.py | 30 ++--------- 6 files changed, 63 insertions(+), 113 deletions(-) diff --git a/src/durabletask/azext_durabletask/_help.py b/src/durabletask/azext_durabletask/_help.py index c5f423c69d0..cb8afb2bb5a 100644 --- a/src/durabletask/azext_durabletask/_help.py +++ b/src/durabletask/azext_durabletask/_help.py @@ -12,62 +12,31 @@ short-summary: Commands to manage Durabletasks. """ -helps['durabletask create'] = """ - type: command - short-summary: Create a Durabletask. -""" - -helps['durabletask list'] = """ - type: command - short-summary: List Durabletasks. -""" - -helps['durabletask delete'] = """ - type: command - short-summary: Delete a Durabletask. -""" - -helps['durabletask show'] = """ - type: command - short-summary: Show details of a Durabletask. -""" - -helps['durabletask update'] = """ - type: command - short-summary: Update a Durabletask. -""" - - helps['durabletask namespace'] = """ type: group short-summary: Commands to manage Durabletask namespaces. """ -helps['durabletask-namespace create'] = """ +helps['durabletask namespace create'] = """ type: command short-summary: Create a Durabletask namespace. """ -helps['durabletask-namespace list'] = """ +helps['durabletask namespace list'] = """ type: command short-summary: List Durabletasks namespaces. """ -helps['durabletask-namespace show'] = """ +helps['durabletask namespace show'] = """ type: command short-summary: Show details of a Durabletask namespace. """ -helps['durabletask-namespace delete'] = """ +helps['durabletask namespace delete'] = """ type: command short-summary: Delete a Durabletask namespace. """ -helps['durabletask-namespace update'] = """ - type: command - short-summary: Update a Durabletask namespace. -""" - helps['durabletask taskhub'] = """ type: group @@ -79,6 +48,11 @@ short-summary: Create a Durabletask taskhub. """ +helps['durabletask taskhub delete'] = """ + type: command + short-summary: Delete a Durabletask taskhub. +""" + helps['durabletask taskhub list'] = """ type: command short-summary: List Durabletasks taskhubs. @@ -88,8 +62,3 @@ type: command short-summary: Show details of a Durabletask taskhub. """ - -helps['durabletask taskhub update'] = """ - type: command - short-summary: Update a Durabletask taskhub. -""" diff --git a/src/durabletask/azext_durabletask/_params.py b/src/durabletask/azext_durabletask/_params.py index c8d3713ea66..b1d92451107 100644 --- a/src/durabletask/azext_durabletask/_params.py +++ b/src/durabletask/azext_durabletask/_params.py @@ -13,6 +13,8 @@ def load_arguments(self, _): from azure.cli.core.commands.validators import get_default_location_from_resource_group durabletask_name_type = CLIArgumentType(options_list='--durabletask-name-name', help='Name of the Durabletask.', id_part='name') + durabletask_taskhub_type = CLIArgumentType(options_list='--durabletask-taskhub-name', help='Name of the Taskhub.', id_part='name') + durabletask_namespace_type = CLIArgumentType(options_list='--durabletask-namespace-name', help='Name of the Namespace.', id_part='name') with self.argument_context('durabletask') as c: c.argument('tags', tags_type) @@ -21,3 +23,21 @@ def load_arguments(self, _): with self.argument_context('durabletask list') as c: c.argument('durabletask_name', durabletask_name_type, id_part=None) + + # Namespace Commands + with self.argument_context('durabletask namespace delete') as c: + c.argument('namespace_name', durabletask_namespace_type, options_list=['--name', '-n']) + + # Taskhub Commands + with self.argument_context('durabletask taskhub list') as c: + c.argument('task_hub_name', durabletask_taskhub_type, options_list=['--task-hub-name', '-t']) + + with self.argument_context('durabletask taskhub show') as c: + c.argument('namespace_name', durabletask_namespace_type, options_list=['--name', '-n']) + c.argument('task_hub_name', durabletask_taskhub_type, options_list=['--task-hub-name', '-t']) + + with self.argument_context('durabletask taskhub create') as c: + c.argument('task_hub_name', durabletask_taskhub_type, options_list=['--task-hub-name', '-t']) + + with self.argument_context('durabletask taskhub delete') as c: + c.argument('task_hub_name', durabletask_taskhub_type, options_list=['--task-hub-name', '-t']) diff --git a/src/durabletask/azext_durabletask/azext_metadata.json b/src/durabletask/azext_durabletask/azext_metadata.json index 55c81bf3328..a954c850c3b 100644 --- a/src/durabletask/azext_durabletask/azext_metadata.json +++ b/src/durabletask/azext_durabletask/azext_metadata.json @@ -1,4 +1,3 @@ { - "azext.isPreview": true, "azext.minCliCoreVersion": "2.0.67" } \ No newline at end of file diff --git a/src/durabletask/azext_durabletask/commands.py b/src/durabletask/azext_durabletask/commands.py index 4081c31fa48..2c63a9f0c53 100644 --- a/src/durabletask/azext_durabletask/commands.py +++ b/src/durabletask/azext_durabletask/commands.py @@ -5,15 +5,11 @@ # pylint: disable=line-too-long from azure.cli.core.commands import CliCommandType -from azext_durabletask._client_factory import cf_durabletask, cf_durabletask_namespaces, cf_durabletask_taskhubs +from azext_durabletask._client_factory import cf_durabletask_namespaces, cf_durabletask_taskhubs def load_command_table(self, _): - durabletask_sdk = CliCommandType( - operations_tmpl='azext_durabletask.vendored_sdks.operations#DurabletaskOperations.{}', - client_factory=cf_durabletask) - durabletask_namespace_sdk = CliCommandType( operations_tmpl='azext_durabletask.vendored_sdks.operations#NamespacesOperations.{}', client_factory=cf_durabletask_namespaces) @@ -22,24 +18,19 @@ def load_command_table(self, _): operations_tmpl='azext_durabletask.vendored_sdks.operations#TaskHubsOperations.{}', client_factory=cf_durabletask_taskhubs) - with self.command_group('durabletask', durabletask_sdk, client_factory=cf_durabletask) as g: - g.custom_command('create', 'create_durabletask') - # g.command('delete', 'delete') - g.custom_command('list', 'list_durabletask') - # g.show_command('show', 'get') - g.generic_update_command('update', setter_name='update', custom_func_name='update_durabletask') - with self.command_group('durabletask namespace', durabletask_namespace_sdk, client_factory=cf_durabletask_namespaces) as g: g.custom_command('create', 'create_namespace') g.custom_command('list', 'list_namespace') - # g.delete_command('delete', 'delete_namespace') - g.generic_update_command('update', setter_name='update', custom_func_name='update_namespace') + g.custom_command('delete', 'delete_namespace') + g.custom_show_command('show', 'show_namespace') + # g.generic_update_command('update', setter_name='update', custom_func_name='update_namespace') with self.command_group('durabletask taskhub', durabletask_taskhub_sdk, client_factory=cf_durabletask_taskhubs) as g: g.custom_command('create', 'create_taskhub') g.custom_command('list', 'list_taskhub') - # g.show_command('show', 'show_taskhub') - g.generic_update_command('update', setter_name='update', custom_func_name='update_taskhub') + g.custom_command('delete', 'delete_taskhub') + g.custom_show_command('show', 'show_taskhub') + # g.generic_update_command('update', setter_name='update', custom_func_name='update_taskhub') with self.command_group('durabletask', is_preview=True): pass diff --git a/src/durabletask/azext_durabletask/custom.py b/src/durabletask/azext_durabletask/custom.py index b53f6b2b08f..04c1e659b0b 100644 --- a/src/durabletask/azext_durabletask/custom.py +++ b/src/durabletask/azext_durabletask/custom.py @@ -4,25 +4,8 @@ # -------------------------------------------------------------------------------------------- from knack.util import CLIError -from azext_durabletask._client_factory import cf_durabletask, cf_durabletask_namespaces, cf_durabletask_taskhubs -from azext_durabletask.vendored_sdks.models import Namespace, TrackedResource - - -def create_durabletask(cmd, client, resource_group_name, durabletask_name, location=None, tags=None): - # client = cf_durabletask(cmd.cli_ctx, None) - raise CLIError('TODO: Implement `durabletask create`') - - -def list_durabletask(cmd, client, resource_group_name=None): - # client = cf_durabletask(cmd.cli_ctx, None) - return client.namespaces.list_by_subscription() - - -def update_durabletask(cmd, instance, tags=None): - # client = cf_durabletask(cmd.cli_ctx, None) - with cmd.update_context(instance) as c: - c.set_param('tags', tags) - return instance +from azext_durabletask._client_factory import cf_durabletask_namespaces, cf_durabletask_taskhubs +from azext_durabletask.vendored_sdks.models import Namespace, TaskHub # Namespace Operations @@ -36,12 +19,14 @@ def list_namespace(cmd, client, resource_group_name=None): return client.list_by_resource_group(resource_group_name=resource_group_name) -def show_namespace(cmd, client, resource_group_name=None): - raise CLIError('TODO: Implement `durabletask namespace show`') +def show_namespace(cmd, client, resource_group_name=None, namespace_name=None): + client = cf_durabletask_namespaces(cmd.cli_ctx, None) + return client.get(resource_group_name=resource_group_name, namespace_name=namespace_name) -def delete_namespace(cmd, client, resource_group_name=None): - raise CLIError('TODO: Implement `durabletask namespace delete`') +def delete_namespace(cmd, client, resource_group_name=None, namespace_name=None): + client = cf_durabletask_namespaces(cmd.cli_ctx, None) + return client.begin_delete(resource_group_name, namespace_name) def update_namespace(cmd, instance): @@ -49,16 +34,26 @@ def update_namespace(cmd, instance): # Taskhub Operations -def create_taskhub(cmd, client, resource_group_name, durabletask_name, location=None): - raise CLIError('TODO: Implement `durabletask taskhub create`') +def create_taskhub(cmd, client, resource_group_name, namespace_name, task_hub_name, location=None): + client = cf_durabletask_taskhubs(cmd.cli_ctx, None) + return client.create_or_update(resource_group_name, namespace_name, task_hub_name, + resource=TaskHub(location=location)) + + +def list_taskhub(cmd, client, resource_group_name, namespace_name=None): + client = cf_durabletask_taskhubs(cmd.cli_ctx, None) + return client.list_by_namespace(resource_group_name=resource_group_name, namespace_name=namespace_name) -def list_taskhub(cmd, client, resource_group_name=None): - raise CLIError('TODO: Implement `durabletask taskhub list`') +def show_taskhub(cmd, client, resource_group_name, namespace_name=None, task_hub_name=None): + client = cf_durabletask_taskhubs(cmd.cli_ctx, None) + return client.get(resource_group_name=resource_group_name, namespace_name=namespace_name, + task_hub_name=task_hub_name) -def show_taskhub(cmd, client, resource_group_name=None): - raise CLIError('TODO: Implement `durabletask taskhub show`') +def delete_taskhub(cmd, client, resource_group_name, namespace_name, task_hub_name): + client = cf_durabletask_taskhubs(cmd.cli_ctx, None) + return client.delete(resource_group_name, namespace_name, task_hub_name) def update_taskhub(cmd, instance): diff --git a/src/durabletask/azext_durabletask/tests/latest/test_durabletask_scenario.py b/src/durabletask/azext_durabletask/tests/latest/test_durabletask_scenario.py index b9e7b5a09d6..0cb9ba504e1 100644 --- a/src/durabletask/azext_durabletask/tests/latest/test_durabletask_scenario.py +++ b/src/durabletask/azext_durabletask/tests/latest/test_durabletask_scenario.py @@ -6,35 +6,11 @@ import os import unittest -from azure_devtools.scenario_tests import AllowLargeResponse from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer) -TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) - - class DurabletaskScenarioTest(ScenarioTest): - @ResourceGroupPreparer(name_prefix='cli_test_durabletask') - def test_durabletask(self, resource_group): - - self.kwargs.update({ - 'name': 'test1' - }) - - self.cmd('durabletask create -g {rg} -n {name} --tags foo=doo', checks=[ - self.check('tags.foo', 'doo'), - self.check('name', '{name}') - ]) - self.cmd('durabletask update -g {rg} -n {name} --tags foo=boo', checks=[ - self.check('tags.foo', 'boo') - ]) - count = len(self.cmd('durabletask list').get_output_in_json()) - self.cmd('durabletask show - {rg} -n {name}', checks=[ - self.check('name', '{name}'), - self.check('resourceGroup', '{rg}'), - self.check('tags.foo', 'boo') - ]) - self.cmd('durabletask delete -g {rg} -n {name}') - final_count = len(self.cmd('durabletask list').get_output_in_json()) - self.assertTrue(final_count, count - 1) \ No newline at end of file + # @ResourceGroupPreparer(name_prefix='cli_test_durabletask') + def test_durabletask(self): + return From 1c2caf1d1a6e679dd525f477fc4a0b06fdc1e77e Mon Sep 17 00:00:00 2001 From: Ryan Lettieri Date: Thu, 5 Sep 2024 15:39:23 -0600 Subject: [PATCH 06/19] More cleanup Signed-off-by: Ryan Lettieri --- .../azext_durabletask/_client_factory.py | 6 +++--- src/durabletask/azext_durabletask/_help.py | 2 +- src/durabletask/azext_durabletask/custom.py | 16 ++++++++-------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/durabletask/azext_durabletask/_client_factory.py b/src/durabletask/azext_durabletask/_client_factory.py index c143e26b17a..548c33a83c7 100644 --- a/src/durabletask/azext_durabletask/_client_factory.py +++ b/src/durabletask/azext_durabletask/_client_factory.py @@ -3,15 +3,15 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -def cf_durabletask(cli_ctx, aux_subscriptions=None, **_): +def cf_durabletask(cli_ctx, **_): from azure.cli.core.commands.client_factory import get_mgmt_service_client from azext_durabletask.vendored_sdks import DurabletaskMgmtClient return get_mgmt_service_client(cli_ctx, DurabletaskMgmtClient) -def cf_durabletask_namespaces(cli_ctx, aux_subscriptions=None, **_): +def cf_durabletask_namespaces(cli_ctx, **_): return cf_durabletask(cli_ctx).namespaces -def cf_durabletask_taskhubs(cli_ctx, aux_subscriptions=None, **_): +def cf_durabletask_taskhubs(cli_ctx, **_): return cf_durabletask(cli_ctx).task_hubs diff --git a/src/durabletask/azext_durabletask/_help.py b/src/durabletask/azext_durabletask/_help.py index cb8afb2bb5a..ff40e4410bf 100644 --- a/src/durabletask/azext_durabletask/_help.py +++ b/src/durabletask/azext_durabletask/_help.py @@ -55,7 +55,7 @@ helps['durabletask taskhub list'] = """ type: command - short-summary: List Durabletasks taskhubs. + short-summary: List Durabletask taskhubs. """ helps['durabletask taskhub show'] = """ diff --git a/src/durabletask/azext_durabletask/custom.py b/src/durabletask/azext_durabletask/custom.py index 04c1e659b0b..aad0b1de152 100644 --- a/src/durabletask/azext_durabletask/custom.py +++ b/src/durabletask/azext_durabletask/custom.py @@ -10,22 +10,22 @@ # Namespace Operations def create_namespace(cmd, client, resource_group_name, namespace_name, location="northcentralus"): - client = cf_durabletask_namespaces(cmd.cli_ctx, None) + client = cf_durabletask_namespaces(cmd.cli_ctx) return client.begin_create_or_update(resource_group_name, namespace_name, resource=Namespace(location=location)) def list_namespace(cmd, client, resource_group_name=None): - client = cf_durabletask_namespaces(cmd.cli_ctx, None) + client = cf_durabletask_namespaces(cmd.cli_ctx) return client.list_by_resource_group(resource_group_name=resource_group_name) def show_namespace(cmd, client, resource_group_name=None, namespace_name=None): - client = cf_durabletask_namespaces(cmd.cli_ctx, None) + client = cf_durabletask_namespaces(cmd.cli_ctx) return client.get(resource_group_name=resource_group_name, namespace_name=namespace_name) def delete_namespace(cmd, client, resource_group_name=None, namespace_name=None): - client = cf_durabletask_namespaces(cmd.cli_ctx, None) + client = cf_durabletask_namespaces(cmd.cli_ctx) return client.begin_delete(resource_group_name, namespace_name) @@ -35,24 +35,24 @@ def update_namespace(cmd, instance): # Taskhub Operations def create_taskhub(cmd, client, resource_group_name, namespace_name, task_hub_name, location=None): - client = cf_durabletask_taskhubs(cmd.cli_ctx, None) + client = cf_durabletask_taskhubs(cmd.cli_ctx) return client.create_or_update(resource_group_name, namespace_name, task_hub_name, resource=TaskHub(location=location)) def list_taskhub(cmd, client, resource_group_name, namespace_name=None): - client = cf_durabletask_taskhubs(cmd.cli_ctx, None) + client = cf_durabletask_taskhubs(cmd.cli_ctx) return client.list_by_namespace(resource_group_name=resource_group_name, namespace_name=namespace_name) def show_taskhub(cmd, client, resource_group_name, namespace_name=None, task_hub_name=None): - client = cf_durabletask_taskhubs(cmd.cli_ctx, None) + client = cf_durabletask_taskhubs(cmd.cli_ctx) return client.get(resource_group_name=resource_group_name, namespace_name=namespace_name, task_hub_name=task_hub_name) def delete_taskhub(cmd, client, resource_group_name, namespace_name, task_hub_name): - client = cf_durabletask_taskhubs(cmd.cli_ctx, None) + client = cf_durabletask_taskhubs(cmd.cli_ctx) return client.delete(resource_group_name, namespace_name, task_hub_name) From c2db05daf84a3cd0b6b4134578969d1a12adaf74 Mon Sep 17 00:00:00 2001 From: Ryan Lettieri Date: Thu, 5 Sep 2024 17:29:36 -0600 Subject: [PATCH 07/19] Fixing ids on list and constructor args Signed-off-by: Ryan Lettieri --- src/durabletask/azext_durabletask/_client_factory.py | 6 +++--- src/durabletask/azext_durabletask/_params.py | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/durabletask/azext_durabletask/_client_factory.py b/src/durabletask/azext_durabletask/_client_factory.py index 548c33a83c7..2ba905cfc3b 100644 --- a/src/durabletask/azext_durabletask/_client_factory.py +++ b/src/durabletask/azext_durabletask/_client_factory.py @@ -3,15 +3,15 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -def cf_durabletask(cli_ctx, **_): +def cf_durabletask(cli_ctx, *_): from azure.cli.core.commands.client_factory import get_mgmt_service_client from azext_durabletask.vendored_sdks import DurabletaskMgmtClient return get_mgmt_service_client(cli_ctx, DurabletaskMgmtClient) -def cf_durabletask_namespaces(cli_ctx, **_): +def cf_durabletask_namespaces(cli_ctx, *_): return cf_durabletask(cli_ctx).namespaces -def cf_durabletask_taskhubs(cli_ctx, **_): +def cf_durabletask_taskhubs(cli_ctx, *_): return cf_durabletask(cli_ctx).task_hubs diff --git a/src/durabletask/azext_durabletask/_params.py b/src/durabletask/azext_durabletask/_params.py index b1d92451107..dfde033d616 100644 --- a/src/durabletask/azext_durabletask/_params.py +++ b/src/durabletask/azext_durabletask/_params.py @@ -13,6 +13,7 @@ def load_arguments(self, _): from azure.cli.core.commands.validators import get_default_location_from_resource_group durabletask_name_type = CLIArgumentType(options_list='--durabletask-name-name', help='Name of the Durabletask.', id_part='name') + durabletask_rg_type = CLIArgumentType(options_list='--durabletask-rg-name', help='Name of the Resource Group.', id_part='name') durabletask_taskhub_type = CLIArgumentType(options_list='--durabletask-taskhub-name', help='Name of the Taskhub.', id_part='name') durabletask_namespace_type = CLIArgumentType(options_list='--durabletask-namespace-name', help='Name of the Namespace.', id_part='name') @@ -30,7 +31,8 @@ def load_arguments(self, _): # Taskhub Commands with self.argument_context('durabletask taskhub list') as c: - c.argument('task_hub_name', durabletask_taskhub_type, options_list=['--task-hub-name', '-t']) + c.argument('namespace_name', durabletask_namespace_type, options_list=['--name', '-n'], id_part=None) + c.argument('resource_group_name', durabletask_rg_type, options_list=['--resource-group', '-g'], id_part=None) with self.argument_context('durabletask taskhub show') as c: c.argument('namespace_name', durabletask_namespace_type, options_list=['--name', '-n']) From 55d5318cc25858a05d2889e299d702f5fe68e8ce Mon Sep 17 00:00:00 2001 From: Ryan Lettieri Date: Fri, 6 Sep 2024 08:56:58 -0600 Subject: [PATCH 08/19] Adressing CI errors for preview and service name Signed-off-by: Ryan Lettieri --- src/durabletask/azext_durabletask/azext_metadata.json | 1 + src/service_name.json | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/durabletask/azext_durabletask/azext_metadata.json b/src/durabletask/azext_durabletask/azext_metadata.json index a954c850c3b..55c81bf3328 100644 --- a/src/durabletask/azext_durabletask/azext_metadata.json +++ b/src/durabletask/azext_durabletask/azext_metadata.json @@ -1,3 +1,4 @@ { + "azext.isPreview": true, "azext.minCliCoreVersion": "2.0.67" } \ No newline at end of file diff --git a/src/service_name.json b/src/service_name.json index b067ce73148..b204931c96f 100644 --- a/src/service_name.json +++ b/src/service_name.json @@ -234,6 +234,11 @@ "AzureServiceName": "Digital Twins", "URL": "https://azure.microsoft.com/services/digital-twins" }, + { + "Command": "az durabletask", + "AzureServiceName": "Durable Task", + "URL": "" + }, { "Command": "az edgeorder", "AzureServiceName": "Edge Order", From 61f8de3661bf541eb0081b3d99e0b06a1d283cf2 Mon Sep 17 00:00:00 2001 From: Ryan Lettieri Date: Fri, 6 Sep 2024 09:20:22 -0600 Subject: [PATCH 09/19] Updating version Signed-off-by: Ryan Lettieri --- src/durabletask/HISTORY.rst | 2 +- src/durabletask/setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/durabletask/HISTORY.rst b/src/durabletask/HISTORY.rst index 8c34bccfff8..abbff5a61a7 100644 --- a/src/durabletask/HISTORY.rst +++ b/src/durabletask/HISTORY.rst @@ -3,6 +3,6 @@ Release History =============== -0.1.0 +1.0.0b1 ++++++ * Initial release. \ No newline at end of file diff --git a/src/durabletask/setup.py b/src/durabletask/setup.py index 7f2875b955f..e2693ea6485 100644 --- a/src/durabletask/setup.py +++ b/src/durabletask/setup.py @@ -16,7 +16,7 @@ # TODO: Confirm this is the right version number you want and it matches your # HISTORY.rst entry. -VERSION = '0.1.0' +VERSION = '1.0.0b1' # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers From 332addd4e1de109d47ddac7c8efddd475e2d9195 Mon Sep 17 00:00:00 2001 From: Ryan Lettieri Date: Tue, 10 Sep 2024 10:09:19 -0600 Subject: [PATCH 10/19] Renaming durabletask to durabletask-preview Signed-off-by: Ryan Lettieri --- .../HISTORY.rst | 0 .../README.rst | 0 .../azext_durabletask_preview}/__init__.py | 0 .../_client_factory.py | 0 .../azext_durabletask_preview}/_help.py | 0 .../azext_durabletask_preview}/_params.py | 0 .../azext_durabletask_preview}/_validators.py | 0 .../azext_metadata.json | 1 + .../azext_durabletask_preview}/commands.py | 0 .../azext_durabletask_preview}/custom.py | 0 .../tests/__init__.py | 0 .../tests/latest/__init__.py | 0 .../latest/recordings/test_durabletask.yaml | 645 ++++++++++++++++++ .../tests/latest/test_durabletask_scenario.py | 0 .../vendored_sdks/__init__.py | 0 .../vendored_sdks/_configuration.py | 0 .../vendored_sdks/_durabletask_mgmt_client.py | 0 .../vendored_sdks/_patch.py | 0 .../vendored_sdks/_serialization.py | 0 .../vendored_sdks/_version.py | 0 .../vendored_sdks/aio/__init__.py | 0 .../vendored_sdks/aio/_configuration.py | 0 .../aio/_durabletask_mgmt_client.py | 0 .../vendored_sdks/aio/_patch.py | 0 .../vendored_sdks/aio/operations/__init__.py | 0 .../aio/operations/_namespaces_operations.py | 0 .../aio/operations/_operations.py | 0 .../vendored_sdks/aio/operations/_patch.py | 0 .../aio/operations/_task_hubs_operations.py | 0 .../vendored_sdks/authoring/__init__.py | 0 .../vendored_sdks/authoring/_configuration.py | 0 .../authoring/_luis_authoring_client.py | 0 .../authoring/models/__init__.py | 0 .../models/_luis_authoring_client_enums.py | 0 .../vendored_sdks/authoring/models/_models.py | 0 .../authoring/models/_models_py3.py | 0 .../authoring/operations/__init__.py | 0 .../authoring/operations/_apps_operations.py | 0 .../operations/_azure_accounts_operations.py | 0 .../operations/_examples_operations.py | 0 .../operations/_features_operations.py | 0 .../authoring/operations/_model_operations.py | 0 .../operations/_pattern_operations.py | 0 .../operations/_settings_operations.py | 0 .../authoring/operations/_train_operations.py | 0 .../operations/_versions_operations.py | 0 .../vendored_sdks/authoring/version.py | 0 .../vendored_sdks/models/__init__.py | 0 .../models/_durabletask_mgmt_client_enums.py | 0 .../vendored_sdks/models/_models_py3.py | 0 .../vendored_sdks/models/_patch.py | 0 .../vendored_sdks/operations/__init__.py | 0 .../operations/_namespaces_operations.py | 0 .../vendored_sdks/operations/_operations.py | 0 .../vendored_sdks/operations/_patch.py | 0 .../operations/_task_hubs_operations.py | 0 .../vendored_sdks/py.typed | 0 .../vendored_sdks/version.py | 0 .../setup.cfg | 0 .../setup.py | 2 +- 60 files changed, 647 insertions(+), 1 deletion(-) rename src/{durabletask => durabletask-preview}/HISTORY.rst (100%) rename src/{durabletask => durabletask-preview}/README.rst (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/__init__.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/_client_factory.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/_help.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/_params.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/_validators.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/azext_metadata.json (67%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/commands.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/custom.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/tests/__init__.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/tests/latest/__init__.py (100%) create mode 100644 src/durabletask-preview/azext_durabletask_preview/tests/latest/recordings/test_durabletask.yaml rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/tests/latest/test_durabletask_scenario.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/vendored_sdks/__init__.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/vendored_sdks/_configuration.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/vendored_sdks/_durabletask_mgmt_client.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/vendored_sdks/_patch.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/vendored_sdks/_serialization.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/vendored_sdks/_version.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/vendored_sdks/aio/__init__.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/vendored_sdks/aio/_configuration.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/vendored_sdks/aio/_durabletask_mgmt_client.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/vendored_sdks/aio/_patch.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/vendored_sdks/aio/operations/__init__.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/vendored_sdks/aio/operations/_namespaces_operations.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/vendored_sdks/aio/operations/_operations.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/vendored_sdks/aio/operations/_patch.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/vendored_sdks/aio/operations/_task_hubs_operations.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/vendored_sdks/authoring/__init__.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/vendored_sdks/authoring/_configuration.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/vendored_sdks/authoring/_luis_authoring_client.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/vendored_sdks/authoring/models/__init__.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/vendored_sdks/authoring/models/_luis_authoring_client_enums.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/vendored_sdks/authoring/models/_models.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/vendored_sdks/authoring/models/_models_py3.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/vendored_sdks/authoring/operations/__init__.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/vendored_sdks/authoring/operations/_apps_operations.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/vendored_sdks/authoring/operations/_azure_accounts_operations.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/vendored_sdks/authoring/operations/_examples_operations.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/vendored_sdks/authoring/operations/_features_operations.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/vendored_sdks/authoring/operations/_model_operations.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/vendored_sdks/authoring/operations/_pattern_operations.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/vendored_sdks/authoring/operations/_settings_operations.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/vendored_sdks/authoring/operations/_train_operations.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/vendored_sdks/authoring/operations/_versions_operations.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/vendored_sdks/authoring/version.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/vendored_sdks/models/__init__.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/vendored_sdks/models/_durabletask_mgmt_client_enums.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/vendored_sdks/models/_models_py3.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/vendored_sdks/models/_patch.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/vendored_sdks/operations/__init__.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/vendored_sdks/operations/_namespaces_operations.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/vendored_sdks/operations/_operations.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/vendored_sdks/operations/_patch.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/vendored_sdks/operations/_task_hubs_operations.py (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/vendored_sdks/py.typed (100%) rename src/{durabletask/azext_durabletask => durabletask-preview/azext_durabletask_preview}/vendored_sdks/version.py (100%) rename src/{durabletask => durabletask-preview}/setup.cfg (100%) rename src/{durabletask => durabletask-preview}/setup.py (98%) diff --git a/src/durabletask/HISTORY.rst b/src/durabletask-preview/HISTORY.rst similarity index 100% rename from src/durabletask/HISTORY.rst rename to src/durabletask-preview/HISTORY.rst diff --git a/src/durabletask/README.rst b/src/durabletask-preview/README.rst similarity index 100% rename from src/durabletask/README.rst rename to src/durabletask-preview/README.rst diff --git a/src/durabletask/azext_durabletask/__init__.py b/src/durabletask-preview/azext_durabletask_preview/__init__.py similarity index 100% rename from src/durabletask/azext_durabletask/__init__.py rename to src/durabletask-preview/azext_durabletask_preview/__init__.py diff --git a/src/durabletask/azext_durabletask/_client_factory.py b/src/durabletask-preview/azext_durabletask_preview/_client_factory.py similarity index 100% rename from src/durabletask/azext_durabletask/_client_factory.py rename to src/durabletask-preview/azext_durabletask_preview/_client_factory.py diff --git a/src/durabletask/azext_durabletask/_help.py b/src/durabletask-preview/azext_durabletask_preview/_help.py similarity index 100% rename from src/durabletask/azext_durabletask/_help.py rename to src/durabletask-preview/azext_durabletask_preview/_help.py diff --git a/src/durabletask/azext_durabletask/_params.py b/src/durabletask-preview/azext_durabletask_preview/_params.py similarity index 100% rename from src/durabletask/azext_durabletask/_params.py rename to src/durabletask-preview/azext_durabletask_preview/_params.py diff --git a/src/durabletask/azext_durabletask/_validators.py b/src/durabletask-preview/azext_durabletask_preview/_validators.py similarity index 100% rename from src/durabletask/azext_durabletask/_validators.py rename to src/durabletask-preview/azext_durabletask_preview/_validators.py diff --git a/src/durabletask/azext_durabletask/azext_metadata.json b/src/durabletask-preview/azext_durabletask_preview/azext_metadata.json similarity index 67% rename from src/durabletask/azext_durabletask/azext_metadata.json rename to src/durabletask-preview/azext_durabletask_preview/azext_metadata.json index 55c81bf3328..8169f3035ba 100644 --- a/src/durabletask/azext_durabletask/azext_metadata.json +++ b/src/durabletask-preview/azext_durabletask_preview/azext_metadata.json @@ -1,4 +1,5 @@ { "azext.isPreview": true, + "name": "durabletask-preview", "azext.minCliCoreVersion": "2.0.67" } \ No newline at end of file diff --git a/src/durabletask/azext_durabletask/commands.py b/src/durabletask-preview/azext_durabletask_preview/commands.py similarity index 100% rename from src/durabletask/azext_durabletask/commands.py rename to src/durabletask-preview/azext_durabletask_preview/commands.py diff --git a/src/durabletask/azext_durabletask/custom.py b/src/durabletask-preview/azext_durabletask_preview/custom.py similarity index 100% rename from src/durabletask/azext_durabletask/custom.py rename to src/durabletask-preview/azext_durabletask_preview/custom.py diff --git a/src/durabletask/azext_durabletask/tests/__init__.py b/src/durabletask-preview/azext_durabletask_preview/tests/__init__.py similarity index 100% rename from src/durabletask/azext_durabletask/tests/__init__.py rename to src/durabletask-preview/azext_durabletask_preview/tests/__init__.py diff --git a/src/durabletask/azext_durabletask/tests/latest/__init__.py b/src/durabletask-preview/azext_durabletask_preview/tests/latest/__init__.py similarity index 100% rename from src/durabletask/azext_durabletask/tests/latest/__init__.py rename to src/durabletask-preview/azext_durabletask_preview/tests/latest/__init__.py diff --git a/src/durabletask-preview/azext_durabletask_preview/tests/latest/recordings/test_durabletask.yaml b/src/durabletask-preview/azext_durabletask_preview/tests/latest/recordings/test_durabletask.yaml new file mode 100644 index 00000000000..c94e38392da --- /dev/null +++ b/src/durabletask-preview/azext_durabletask_preview/tests/latest/recordings/test_durabletask.yaml @@ -0,0 +1,645 @@ +interactions: +- request: + body: '{"location": "northcentralus"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - durabletask namespace create + Connection: + - keep-alive + Content-Length: + - '30' + Content-Type: + - application/json + ParameterSetName: + - -g -n + User-Agent: + - AZURECLI/2.64.0 azsdk-python-core/1.28.0 Python/3.11.6 (Linux-5.15.153.1-microsoft-standard-WSL2-x86_64-with-glibc2.35) + method: PUT + uri: https://eastus2euap.management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_durabletask000001/providers/Microsoft.DurableTask/namespaces/test1?api-version=2024-02-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_durabletask000001/providers/Microsoft.DurableTask/namespaces/test1","name":"test1","type":"microsoft.durabletask/namespaces","location":"northcentralus","systemData":{"createdBy":"ryanlettieri@microsoft.com","createdByType":"User","createdAt":"2024-09-05T17:49:36.205274Z","lastModifiedBy":"ryanlettieri@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2024-09-05T17:49:36.205274Z"},"properties":{"provisioningState":"Accepted","url":"test1-a7c8a9bwdvah.northcentralus.durabletask.io","dashboardUrl":"test1-a7c8a9bwdvah-db.northcentralus.durabletask.io","ipAllowlist":[]}}' + headers: + azure-asyncoperation: + - https://eastus2euap.management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96?api-version=2024-02-01-preview&t=638611553773460250&c=MIIHhjCCBm6gAwIBAgITHgUK3uZNXW0rELEWgAAABQre5jANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDYwHhcNMjQwNzI3MTIwMjAwWhcNMjQxMDI1MTIwMjAwWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALOp9mTbesFKlLY5kaubRq1NFmzMIRssJxSdGLLsTSNZCUTbJ7ozK0IiDfLVQCXyBqGrO3PYMBmeJEMdtKRsd00pJzflYkIE7nnXJBFw-sTxMSt4zsLsbXBMl4dGzNmrGZkYRrhFOSLC122KClMAs8DXhEcJU2_mol-1pxp42MCiq4jkKicedYt3GlUvVl3uSJyeiHw77qxa3x0QbuUm1DszpHTwyHp3x4hfUAwS6TWrZ929rowQ1y96k1x7RKmAIwamEzeg79Q5rsuLDW7yTX3Pg7sp7h3hbBjXeToCLa31ndkNFF9aoSLU3O-xO177GGKO6lhbIpHECNAaCtrFp6ECAwEAAaOCBHMwggRvMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwIwCgYIKwYBBQUHAwEwPAYJKwYBBAGCNxUHBC8wLQYlKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFgh8fIENbYcQIBZAIBBjCCAcsGCCsGAQUFBwEBBIIBvTCCAbkwYwYIKwYBBQUHMAKGV2h0dHA6Ly9jcmwubWljcm9zb2Z0LmNvbS9wa2lpbmZyYS9DZXJ0cy9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDEuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmwyLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MFMGCCsGAQUFBzAChkdodHRwOi8vY3JsMy5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDQuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwHQYDVR0OBBYEFOL38Ka708l__wglsKzbwvptKgiNMA4GA1UdDwEB_wQEAwIFoDCCASYGA1UdHwSCAR0wggEZMIIBFaCCARGgggENhj9odHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ1JML0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwxLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwyLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwzLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmw0LmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmwwgZ0GA1UdIASBlTCBkjAMBgorBgEEAYI3ewEBMGYGCisGAQQBgjd7AgIwWDBWBggrBgEFBQcCAjBKHkgAMwAzAGUAMAAxADkAMgAxAC0ANABkADYANAAtADQAZgA4AGMALQBhADAANQA1AC0ANQBiAGQAYQBmAGYAZAA1AGUAMwAzAGQwDAYKKwYBBAGCN3sDATAMBgorBgEEAYI3ewQBMB8GA1UdIwQYMBaAFPFGaMbxw_ArLX2LauGy-b41_NFBMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATANBgkqhkiG9w0BAQsFAAOCAQEAOjvtmgGG_gQTCeRcW03oj3kuNjkaOoixOTlz3lAC2IQY_-4SRz6Y1-eEdGjDgSL5trZKjpas64eIIdZzKfAeRUiIfIQHFtlEGG-nOH9acyDkUY04bgQhSkkQ7vkiLB95C7sAKLweobXMkBlMNjBNGbJkY_9bCVP_Qgv3ACF5VfFnpj76iqtgNm3IMgoKQWsFliPj6UF8bkP0y2e-hZWKSWTeQIqDscIjvCXo-CAkMzJ7twtIAzttmQQ3UKLeI2kWwO4ZKOFoczpWVNJXtOAk155DuJIZL-A2nNR9xirNPNwpZlKaBwaek91rnTFgaOTCCrG2DFXpg97eI6UL0RrLKQ&s=VramQI0NrVWH41AUWl06xCxbcvI9gdTM-WZOwmcw2_-VLytdhGIYjPH8dfIZ51nFVp_0r02xqxnh3L2IxWPYC8NdWZI3bPPLcAXYNvxWpyax3qkf6hYfWVO36FsePIl4hyUN9DZ5A30y22ayrEoFnkMpm45h881nbtYXPCVulPX51cHG5p7UfoVu_HcRWrfcnlIRuX9tl4gVntZNdXDrNC42BUKjOQXmxfw96jNKOXVNa1S-b4cs2Alj5fZfVAFbmQExO2MCmmNXldZO9aN8NzxLXxZujviFWPcsFwR5-XKgU3SG0C7pA2WGRJqO9VW58gpv71SViad5KMXFqG4jKg&h=ProYQfUxtt5Nar3hDS_12XaCjhZGqlr-9OEA94kmTt4 + cache-control: + - no-cache + content-length: + - '667' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Sep 2024 17:49:37 GMT + etag: + - '"9d005f51-0000-0100-0000-66d9ef310000"' + expires: + - '-1' + mise-correlation-id: + - 875e4860-4de3-4e8b-bc99-14c5e07f0667 + pragma: + - no-cache + set-cookie: + - ARRAffinity=11ce3e72138d4e8ebd1b72edb2b2329aa47554461f6e881b00a82375fc261f2c;Path=/;HttpOnly;Secure;Domain=azapi-rp-dts-prod-northcentralus.ase-dts-prod-northcentralus.p.azurewebsites.net + - ARRAffinitySameSite=11ce3e72138d4e8ebd1b72edb2b2329aa47554461f6e881b00a82375fc261f2c;Path=/;HttpOnly;SameSite=None;Secure;Domain=azapi-rp-dts-prod-northcentralus.ase-dts-prod-northcentralus.p.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=c065741a-65a3-4502-b9c0-547929546b6f/eastus2euap/873c222b-e7cf-4438-a24e-81be8ec5d036 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + x-msedge-ref: + - 'Ref A: 0B872E4FC4A14DFF902149142588C13C Ref B: DM2EDGE0813 Ref C: 2024-09-05T17:49:34Z' + x-powered-by: + - ASP.NET + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - durabletask namespace create + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - AZURECLI/2.64.0 azsdk-python-core/1.28.0 Python/3.11.6 (Linux-5.15.153.1-microsoft-standard-WSL2-x86_64-with-glibc2.35) + method: GET + uri: https://eastus2euap.management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96?api-version=2024-02-01-preview&t=638611553773460250&c=MIIHhjCCBm6gAwIBAgITHgUK3uZNXW0rELEWgAAABQre5jANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDYwHhcNMjQwNzI3MTIwMjAwWhcNMjQxMDI1MTIwMjAwWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALOp9mTbesFKlLY5kaubRq1NFmzMIRssJxSdGLLsTSNZCUTbJ7ozK0IiDfLVQCXyBqGrO3PYMBmeJEMdtKRsd00pJzflYkIE7nnXJBFw-sTxMSt4zsLsbXBMl4dGzNmrGZkYRrhFOSLC122KClMAs8DXhEcJU2_mol-1pxp42MCiq4jkKicedYt3GlUvVl3uSJyeiHw77qxa3x0QbuUm1DszpHTwyHp3x4hfUAwS6TWrZ929rowQ1y96k1x7RKmAIwamEzeg79Q5rsuLDW7yTX3Pg7sp7h3hbBjXeToCLa31ndkNFF9aoSLU3O-xO177GGKO6lhbIpHECNAaCtrFp6ECAwEAAaOCBHMwggRvMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwIwCgYIKwYBBQUHAwEwPAYJKwYBBAGCNxUHBC8wLQYlKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFgh8fIENbYcQIBZAIBBjCCAcsGCCsGAQUFBwEBBIIBvTCCAbkwYwYIKwYBBQUHMAKGV2h0dHA6Ly9jcmwubWljcm9zb2Z0LmNvbS9wa2lpbmZyYS9DZXJ0cy9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDEuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmwyLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MFMGCCsGAQUFBzAChkdodHRwOi8vY3JsMy5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDQuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwHQYDVR0OBBYEFOL38Ka708l__wglsKzbwvptKgiNMA4GA1UdDwEB_wQEAwIFoDCCASYGA1UdHwSCAR0wggEZMIIBFaCCARGgggENhj9odHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ1JML0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwxLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwyLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwzLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmw0LmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmwwgZ0GA1UdIASBlTCBkjAMBgorBgEEAYI3ewEBMGYGCisGAQQBgjd7AgIwWDBWBggrBgEFBQcCAjBKHkgAMwAzAGUAMAAxADkAMgAxAC0ANABkADYANAAtADQAZgA4AGMALQBhADAANQA1AC0ANQBiAGQAYQBmAGYAZAA1AGUAMwAzAGQwDAYKKwYBBAGCN3sDATAMBgorBgEEAYI3ewQBMB8GA1UdIwQYMBaAFPFGaMbxw_ArLX2LauGy-b41_NFBMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATANBgkqhkiG9w0BAQsFAAOCAQEAOjvtmgGG_gQTCeRcW03oj3kuNjkaOoixOTlz3lAC2IQY_-4SRz6Y1-eEdGjDgSL5trZKjpas64eIIdZzKfAeRUiIfIQHFtlEGG-nOH9acyDkUY04bgQhSkkQ7vkiLB95C7sAKLweobXMkBlMNjBNGbJkY_9bCVP_Qgv3ACF5VfFnpj76iqtgNm3IMgoKQWsFliPj6UF8bkP0y2e-hZWKSWTeQIqDscIjvCXo-CAkMzJ7twtIAzttmQQ3UKLeI2kWwO4ZKOFoczpWVNJXtOAk155DuJIZL-A2nNR9xirNPNwpZlKaBwaek91rnTFgaOTCCrG2DFXpg97eI6UL0RrLKQ&s=VramQI0NrVWH41AUWl06xCxbcvI9gdTM-WZOwmcw2_-VLytdhGIYjPH8dfIZ51nFVp_0r02xqxnh3L2IxWPYC8NdWZI3bPPLcAXYNvxWpyax3qkf6hYfWVO36FsePIl4hyUN9DZ5A30y22ayrEoFnkMpm45h881nbtYXPCVulPX51cHG5p7UfoVu_HcRWrfcnlIRuX9tl4gVntZNdXDrNC42BUKjOQXmxfw96jNKOXVNa1S-b4cs2Alj5fZfVAFbmQExO2MCmmNXldZO9aN8NzxLXxZujviFWPcsFwR5-XKgU3SG0C7pA2WGRJqO9VW58gpv71SViad5KMXFqG4jKg&h=ProYQfUxtt5Nar3hDS_12XaCjhZGqlr-9OEA94kmTt4 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","name":"dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_durabletask000001/providers/Microsoft.DurableTask/namespaces/test1","status":"Accepted","startTime":"2024-09-05T17:49:36.8327173Z"}' + headers: + cache-control: + - no-cache + content-length: + - '569' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Sep 2024 17:49:37 GMT + etag: + - '"b7003d3c-0000-0100-0000-66d9ef300000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=c065741a-65a3-4502-b9c0-547929546b6f/eastus2euap/bc8c825b-dff3-45c9-b31c-205df1a4b034 + x-msedge-ref: + - 'Ref A: 58D4B06F062A43E3BD0F9A7E0E74D6F4 Ref B: DM2EDGE0813 Ref C: 2024-09-05T17:49:37Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - durabletask namespace create + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - AZURECLI/2.64.0 azsdk-python-core/1.28.0 Python/3.11.6 (Linux-5.15.153.1-microsoft-standard-WSL2-x86_64-with-glibc2.35) + method: GET + uri: https://eastus2euap.management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96?api-version=2024-02-01-preview&t=638611553773460250&c=MIIHhjCCBm6gAwIBAgITHgUK3uZNXW0rELEWgAAABQre5jANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDYwHhcNMjQwNzI3MTIwMjAwWhcNMjQxMDI1MTIwMjAwWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALOp9mTbesFKlLY5kaubRq1NFmzMIRssJxSdGLLsTSNZCUTbJ7ozK0IiDfLVQCXyBqGrO3PYMBmeJEMdtKRsd00pJzflYkIE7nnXJBFw-sTxMSt4zsLsbXBMl4dGzNmrGZkYRrhFOSLC122KClMAs8DXhEcJU2_mol-1pxp42MCiq4jkKicedYt3GlUvVl3uSJyeiHw77qxa3x0QbuUm1DszpHTwyHp3x4hfUAwS6TWrZ929rowQ1y96k1x7RKmAIwamEzeg79Q5rsuLDW7yTX3Pg7sp7h3hbBjXeToCLa31ndkNFF9aoSLU3O-xO177GGKO6lhbIpHECNAaCtrFp6ECAwEAAaOCBHMwggRvMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwIwCgYIKwYBBQUHAwEwPAYJKwYBBAGCNxUHBC8wLQYlKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFgh8fIENbYcQIBZAIBBjCCAcsGCCsGAQUFBwEBBIIBvTCCAbkwYwYIKwYBBQUHMAKGV2h0dHA6Ly9jcmwubWljcm9zb2Z0LmNvbS9wa2lpbmZyYS9DZXJ0cy9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDEuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmwyLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MFMGCCsGAQUFBzAChkdodHRwOi8vY3JsMy5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDQuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwHQYDVR0OBBYEFOL38Ka708l__wglsKzbwvptKgiNMA4GA1UdDwEB_wQEAwIFoDCCASYGA1UdHwSCAR0wggEZMIIBFaCCARGgggENhj9odHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ1JML0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwxLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwyLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwzLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmw0LmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmwwgZ0GA1UdIASBlTCBkjAMBgorBgEEAYI3ewEBMGYGCisGAQQBgjd7AgIwWDBWBggrBgEFBQcCAjBKHkgAMwAzAGUAMAAxADkAMgAxAC0ANABkADYANAAtADQAZgA4AGMALQBhADAANQA1AC0ANQBiAGQAYQBmAGYAZAA1AGUAMwAzAGQwDAYKKwYBBAGCN3sDATAMBgorBgEEAYI3ewQBMB8GA1UdIwQYMBaAFPFGaMbxw_ArLX2LauGy-b41_NFBMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATANBgkqhkiG9w0BAQsFAAOCAQEAOjvtmgGG_gQTCeRcW03oj3kuNjkaOoixOTlz3lAC2IQY_-4SRz6Y1-eEdGjDgSL5trZKjpas64eIIdZzKfAeRUiIfIQHFtlEGG-nOH9acyDkUY04bgQhSkkQ7vkiLB95C7sAKLweobXMkBlMNjBNGbJkY_9bCVP_Qgv3ACF5VfFnpj76iqtgNm3IMgoKQWsFliPj6UF8bkP0y2e-hZWKSWTeQIqDscIjvCXo-CAkMzJ7twtIAzttmQQ3UKLeI2kWwO4ZKOFoczpWVNJXtOAk155DuJIZL-A2nNR9xirNPNwpZlKaBwaek91rnTFgaOTCCrG2DFXpg97eI6UL0RrLKQ&s=VramQI0NrVWH41AUWl06xCxbcvI9gdTM-WZOwmcw2_-VLytdhGIYjPH8dfIZ51nFVp_0r02xqxnh3L2IxWPYC8NdWZI3bPPLcAXYNvxWpyax3qkf6hYfWVO36FsePIl4hyUN9DZ5A30y22ayrEoFnkMpm45h881nbtYXPCVulPX51cHG5p7UfoVu_HcRWrfcnlIRuX9tl4gVntZNdXDrNC42BUKjOQXmxfw96jNKOXVNa1S-b4cs2Alj5fZfVAFbmQExO2MCmmNXldZO9aN8NzxLXxZujviFWPcsFwR5-XKgU3SG0C7pA2WGRJqO9VW58gpv71SViad5KMXFqG4jKg&h=ProYQfUxtt5Nar3hDS_12XaCjhZGqlr-9OEA94kmTt4 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","name":"dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_durabletask000001/providers/Microsoft.DurableTask/namespaces/test1","status":"Accepted","startTime":"2024-09-05T17:49:36.8327173Z"}' + headers: + cache-control: + - no-cache + content-length: + - '569' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Sep 2024 17:50:07 GMT + etag: + - '"b7003d3c-0000-0100-0000-66d9ef300000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=c065741a-65a3-4502-b9c0-547929546b6f/eastus2euap/8b06fb16-d4ab-4d0e-911e-398ab7716d3d + x-msedge-ref: + - 'Ref A: A879D2EE736C458CB9CD225459D3BAC8 Ref B: DM2EDGE0813 Ref C: 2024-09-05T17:50:07Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - durabletask namespace create + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - AZURECLI/2.64.0 azsdk-python-core/1.28.0 Python/3.11.6 (Linux-5.15.153.1-microsoft-standard-WSL2-x86_64-with-glibc2.35) + method: GET + uri: https://eastus2euap.management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96?api-version=2024-02-01-preview&t=638611553773460250&c=MIIHhjCCBm6gAwIBAgITHgUK3uZNXW0rELEWgAAABQre5jANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDYwHhcNMjQwNzI3MTIwMjAwWhcNMjQxMDI1MTIwMjAwWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALOp9mTbesFKlLY5kaubRq1NFmzMIRssJxSdGLLsTSNZCUTbJ7ozK0IiDfLVQCXyBqGrO3PYMBmeJEMdtKRsd00pJzflYkIE7nnXJBFw-sTxMSt4zsLsbXBMl4dGzNmrGZkYRrhFOSLC122KClMAs8DXhEcJU2_mol-1pxp42MCiq4jkKicedYt3GlUvVl3uSJyeiHw77qxa3x0QbuUm1DszpHTwyHp3x4hfUAwS6TWrZ929rowQ1y96k1x7RKmAIwamEzeg79Q5rsuLDW7yTX3Pg7sp7h3hbBjXeToCLa31ndkNFF9aoSLU3O-xO177GGKO6lhbIpHECNAaCtrFp6ECAwEAAaOCBHMwggRvMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwIwCgYIKwYBBQUHAwEwPAYJKwYBBAGCNxUHBC8wLQYlKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFgh8fIENbYcQIBZAIBBjCCAcsGCCsGAQUFBwEBBIIBvTCCAbkwYwYIKwYBBQUHMAKGV2h0dHA6Ly9jcmwubWljcm9zb2Z0LmNvbS9wa2lpbmZyYS9DZXJ0cy9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDEuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmwyLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MFMGCCsGAQUFBzAChkdodHRwOi8vY3JsMy5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDQuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwHQYDVR0OBBYEFOL38Ka708l__wglsKzbwvptKgiNMA4GA1UdDwEB_wQEAwIFoDCCASYGA1UdHwSCAR0wggEZMIIBFaCCARGgggENhj9odHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ1JML0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwxLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwyLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwzLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmw0LmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmwwgZ0GA1UdIASBlTCBkjAMBgorBgEEAYI3ewEBMGYGCisGAQQBgjd7AgIwWDBWBggrBgEFBQcCAjBKHkgAMwAzAGUAMAAxADkAMgAxAC0ANABkADYANAAtADQAZgA4AGMALQBhADAANQA1AC0ANQBiAGQAYQBmAGYAZAA1AGUAMwAzAGQwDAYKKwYBBAGCN3sDATAMBgorBgEEAYI3ewQBMB8GA1UdIwQYMBaAFPFGaMbxw_ArLX2LauGy-b41_NFBMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATANBgkqhkiG9w0BAQsFAAOCAQEAOjvtmgGG_gQTCeRcW03oj3kuNjkaOoixOTlz3lAC2IQY_-4SRz6Y1-eEdGjDgSL5trZKjpas64eIIdZzKfAeRUiIfIQHFtlEGG-nOH9acyDkUY04bgQhSkkQ7vkiLB95C7sAKLweobXMkBlMNjBNGbJkY_9bCVP_Qgv3ACF5VfFnpj76iqtgNm3IMgoKQWsFliPj6UF8bkP0y2e-hZWKSWTeQIqDscIjvCXo-CAkMzJ7twtIAzttmQQ3UKLeI2kWwO4ZKOFoczpWVNJXtOAk155DuJIZL-A2nNR9xirNPNwpZlKaBwaek91rnTFgaOTCCrG2DFXpg97eI6UL0RrLKQ&s=VramQI0NrVWH41AUWl06xCxbcvI9gdTM-WZOwmcw2_-VLytdhGIYjPH8dfIZ51nFVp_0r02xqxnh3L2IxWPYC8NdWZI3bPPLcAXYNvxWpyax3qkf6hYfWVO36FsePIl4hyUN9DZ5A30y22ayrEoFnkMpm45h881nbtYXPCVulPX51cHG5p7UfoVu_HcRWrfcnlIRuX9tl4gVntZNdXDrNC42BUKjOQXmxfw96jNKOXVNa1S-b4cs2Alj5fZfVAFbmQExO2MCmmNXldZO9aN8NzxLXxZujviFWPcsFwR5-XKgU3SG0C7pA2WGRJqO9VW58gpv71SViad5KMXFqG4jKg&h=ProYQfUxtt5Nar3hDS_12XaCjhZGqlr-9OEA94kmTt4 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","name":"dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_durabletask000001/providers/Microsoft.DurableTask/namespaces/test1","status":"Accepted","startTime":"2024-09-05T17:49:36.8327173Z"}' + headers: + cache-control: + - no-cache + content-length: + - '569' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Sep 2024 17:50:37 GMT + etag: + - '"b7003d3c-0000-0100-0000-66d9ef300000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=c065741a-65a3-4502-b9c0-547929546b6f/eastus2euap/ec7e164b-de6a-4b13-9e72-7610d83139d9 + x-msedge-ref: + - 'Ref A: D1AE21B01679464382FC10D1CFD8E41D Ref B: DM2EDGE0813 Ref C: 2024-09-05T17:50:37Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - durabletask namespace create + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - AZURECLI/2.64.0 azsdk-python-core/1.28.0 Python/3.11.6 (Linux-5.15.153.1-microsoft-standard-WSL2-x86_64-with-glibc2.35) + method: GET + uri: https://eastus2euap.management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96?api-version=2024-02-01-preview&t=638611553773460250&c=MIIHhjCCBm6gAwIBAgITHgUK3uZNXW0rELEWgAAABQre5jANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDYwHhcNMjQwNzI3MTIwMjAwWhcNMjQxMDI1MTIwMjAwWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALOp9mTbesFKlLY5kaubRq1NFmzMIRssJxSdGLLsTSNZCUTbJ7ozK0IiDfLVQCXyBqGrO3PYMBmeJEMdtKRsd00pJzflYkIE7nnXJBFw-sTxMSt4zsLsbXBMl4dGzNmrGZkYRrhFOSLC122KClMAs8DXhEcJU2_mol-1pxp42MCiq4jkKicedYt3GlUvVl3uSJyeiHw77qxa3x0QbuUm1DszpHTwyHp3x4hfUAwS6TWrZ929rowQ1y96k1x7RKmAIwamEzeg79Q5rsuLDW7yTX3Pg7sp7h3hbBjXeToCLa31ndkNFF9aoSLU3O-xO177GGKO6lhbIpHECNAaCtrFp6ECAwEAAaOCBHMwggRvMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwIwCgYIKwYBBQUHAwEwPAYJKwYBBAGCNxUHBC8wLQYlKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFgh8fIENbYcQIBZAIBBjCCAcsGCCsGAQUFBwEBBIIBvTCCAbkwYwYIKwYBBQUHMAKGV2h0dHA6Ly9jcmwubWljcm9zb2Z0LmNvbS9wa2lpbmZyYS9DZXJ0cy9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDEuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmwyLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MFMGCCsGAQUFBzAChkdodHRwOi8vY3JsMy5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDQuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwHQYDVR0OBBYEFOL38Ka708l__wglsKzbwvptKgiNMA4GA1UdDwEB_wQEAwIFoDCCASYGA1UdHwSCAR0wggEZMIIBFaCCARGgggENhj9odHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ1JML0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwxLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwyLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwzLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmw0LmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmwwgZ0GA1UdIASBlTCBkjAMBgorBgEEAYI3ewEBMGYGCisGAQQBgjd7AgIwWDBWBggrBgEFBQcCAjBKHkgAMwAzAGUAMAAxADkAMgAxAC0ANABkADYANAAtADQAZgA4AGMALQBhADAANQA1AC0ANQBiAGQAYQBmAGYAZAA1AGUAMwAzAGQwDAYKKwYBBAGCN3sDATAMBgorBgEEAYI3ewQBMB8GA1UdIwQYMBaAFPFGaMbxw_ArLX2LauGy-b41_NFBMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATANBgkqhkiG9w0BAQsFAAOCAQEAOjvtmgGG_gQTCeRcW03oj3kuNjkaOoixOTlz3lAC2IQY_-4SRz6Y1-eEdGjDgSL5trZKjpas64eIIdZzKfAeRUiIfIQHFtlEGG-nOH9acyDkUY04bgQhSkkQ7vkiLB95C7sAKLweobXMkBlMNjBNGbJkY_9bCVP_Qgv3ACF5VfFnpj76iqtgNm3IMgoKQWsFliPj6UF8bkP0y2e-hZWKSWTeQIqDscIjvCXo-CAkMzJ7twtIAzttmQQ3UKLeI2kWwO4ZKOFoczpWVNJXtOAk155DuJIZL-A2nNR9xirNPNwpZlKaBwaek91rnTFgaOTCCrG2DFXpg97eI6UL0RrLKQ&s=VramQI0NrVWH41AUWl06xCxbcvI9gdTM-WZOwmcw2_-VLytdhGIYjPH8dfIZ51nFVp_0r02xqxnh3L2IxWPYC8NdWZI3bPPLcAXYNvxWpyax3qkf6hYfWVO36FsePIl4hyUN9DZ5A30y22ayrEoFnkMpm45h881nbtYXPCVulPX51cHG5p7UfoVu_HcRWrfcnlIRuX9tl4gVntZNdXDrNC42BUKjOQXmxfw96jNKOXVNa1S-b4cs2Alj5fZfVAFbmQExO2MCmmNXldZO9aN8NzxLXxZujviFWPcsFwR5-XKgU3SG0C7pA2WGRJqO9VW58gpv71SViad5KMXFqG4jKg&h=ProYQfUxtt5Nar3hDS_12XaCjhZGqlr-9OEA94kmTt4 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","name":"dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_durabletask000001/providers/Microsoft.DurableTask/namespaces/test1","status":"Accepted","startTime":"2024-09-05T17:49:36.8327173Z"}' + headers: + cache-control: + - no-cache + content-length: + - '569' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Sep 2024 17:51:07 GMT + etag: + - '"b7003d3c-0000-0100-0000-66d9ef300000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=c065741a-65a3-4502-b9c0-547929546b6f/eastus2euap/d2f18290-384c-4cdf-b81a-40911dae49da + x-msedge-ref: + - 'Ref A: A10383E6CCA348028C562F598E6C7621 Ref B: DM2EDGE0813 Ref C: 2024-09-05T17:51:07Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - durabletask namespace create + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - AZURECLI/2.64.0 azsdk-python-core/1.28.0 Python/3.11.6 (Linux-5.15.153.1-microsoft-standard-WSL2-x86_64-with-glibc2.35) + method: GET + uri: https://eastus2euap.management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96?api-version=2024-02-01-preview&t=638611553773460250&c=MIIHhjCCBm6gAwIBAgITHgUK3uZNXW0rELEWgAAABQre5jANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDYwHhcNMjQwNzI3MTIwMjAwWhcNMjQxMDI1MTIwMjAwWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALOp9mTbesFKlLY5kaubRq1NFmzMIRssJxSdGLLsTSNZCUTbJ7ozK0IiDfLVQCXyBqGrO3PYMBmeJEMdtKRsd00pJzflYkIE7nnXJBFw-sTxMSt4zsLsbXBMl4dGzNmrGZkYRrhFOSLC122KClMAs8DXhEcJU2_mol-1pxp42MCiq4jkKicedYt3GlUvVl3uSJyeiHw77qxa3x0QbuUm1DszpHTwyHp3x4hfUAwS6TWrZ929rowQ1y96k1x7RKmAIwamEzeg79Q5rsuLDW7yTX3Pg7sp7h3hbBjXeToCLa31ndkNFF9aoSLU3O-xO177GGKO6lhbIpHECNAaCtrFp6ECAwEAAaOCBHMwggRvMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwIwCgYIKwYBBQUHAwEwPAYJKwYBBAGCNxUHBC8wLQYlKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFgh8fIENbYcQIBZAIBBjCCAcsGCCsGAQUFBwEBBIIBvTCCAbkwYwYIKwYBBQUHMAKGV2h0dHA6Ly9jcmwubWljcm9zb2Z0LmNvbS9wa2lpbmZyYS9DZXJ0cy9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDEuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmwyLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MFMGCCsGAQUFBzAChkdodHRwOi8vY3JsMy5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDQuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwHQYDVR0OBBYEFOL38Ka708l__wglsKzbwvptKgiNMA4GA1UdDwEB_wQEAwIFoDCCASYGA1UdHwSCAR0wggEZMIIBFaCCARGgggENhj9odHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ1JML0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwxLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwyLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwzLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmw0LmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmwwgZ0GA1UdIASBlTCBkjAMBgorBgEEAYI3ewEBMGYGCisGAQQBgjd7AgIwWDBWBggrBgEFBQcCAjBKHkgAMwAzAGUAMAAxADkAMgAxAC0ANABkADYANAAtADQAZgA4AGMALQBhADAANQA1AC0ANQBiAGQAYQBmAGYAZAA1AGUAMwAzAGQwDAYKKwYBBAGCN3sDATAMBgorBgEEAYI3ewQBMB8GA1UdIwQYMBaAFPFGaMbxw_ArLX2LauGy-b41_NFBMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATANBgkqhkiG9w0BAQsFAAOCAQEAOjvtmgGG_gQTCeRcW03oj3kuNjkaOoixOTlz3lAC2IQY_-4SRz6Y1-eEdGjDgSL5trZKjpas64eIIdZzKfAeRUiIfIQHFtlEGG-nOH9acyDkUY04bgQhSkkQ7vkiLB95C7sAKLweobXMkBlMNjBNGbJkY_9bCVP_Qgv3ACF5VfFnpj76iqtgNm3IMgoKQWsFliPj6UF8bkP0y2e-hZWKSWTeQIqDscIjvCXo-CAkMzJ7twtIAzttmQQ3UKLeI2kWwO4ZKOFoczpWVNJXtOAk155DuJIZL-A2nNR9xirNPNwpZlKaBwaek91rnTFgaOTCCrG2DFXpg97eI6UL0RrLKQ&s=VramQI0NrVWH41AUWl06xCxbcvI9gdTM-WZOwmcw2_-VLytdhGIYjPH8dfIZ51nFVp_0r02xqxnh3L2IxWPYC8NdWZI3bPPLcAXYNvxWpyax3qkf6hYfWVO36FsePIl4hyUN9DZ5A30y22ayrEoFnkMpm45h881nbtYXPCVulPX51cHG5p7UfoVu_HcRWrfcnlIRuX9tl4gVntZNdXDrNC42BUKjOQXmxfw96jNKOXVNa1S-b4cs2Alj5fZfVAFbmQExO2MCmmNXldZO9aN8NzxLXxZujviFWPcsFwR5-XKgU3SG0C7pA2WGRJqO9VW58gpv71SViad5KMXFqG4jKg&h=ProYQfUxtt5Nar3hDS_12XaCjhZGqlr-9OEA94kmTt4 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","name":"dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_durabletask000001/providers/Microsoft.DurableTask/namespaces/test1","status":"Accepted","startTime":"2024-09-05T17:49:36.8327173Z"}' + headers: + cache-control: + - no-cache + content-length: + - '569' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Sep 2024 17:51:37 GMT + etag: + - '"b7003d3c-0000-0100-0000-66d9ef300000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=c065741a-65a3-4502-b9c0-547929546b6f/eastus2euap/e622749c-d437-488d-adf9-64d10103cafc + x-msedge-ref: + - 'Ref A: 352F44DE16FC4A248AA2DA1F4D6B5A67 Ref B: DM2EDGE0813 Ref C: 2024-09-05T17:51:38Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - durabletask namespace create + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - AZURECLI/2.64.0 azsdk-python-core/1.28.0 Python/3.11.6 (Linux-5.15.153.1-microsoft-standard-WSL2-x86_64-with-glibc2.35) + method: GET + uri: https://eastus2euap.management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96?api-version=2024-02-01-preview&t=638611553773460250&c=MIIHhjCCBm6gAwIBAgITHgUK3uZNXW0rELEWgAAABQre5jANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDYwHhcNMjQwNzI3MTIwMjAwWhcNMjQxMDI1MTIwMjAwWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALOp9mTbesFKlLY5kaubRq1NFmzMIRssJxSdGLLsTSNZCUTbJ7ozK0IiDfLVQCXyBqGrO3PYMBmeJEMdtKRsd00pJzflYkIE7nnXJBFw-sTxMSt4zsLsbXBMl4dGzNmrGZkYRrhFOSLC122KClMAs8DXhEcJU2_mol-1pxp42MCiq4jkKicedYt3GlUvVl3uSJyeiHw77qxa3x0QbuUm1DszpHTwyHp3x4hfUAwS6TWrZ929rowQ1y96k1x7RKmAIwamEzeg79Q5rsuLDW7yTX3Pg7sp7h3hbBjXeToCLa31ndkNFF9aoSLU3O-xO177GGKO6lhbIpHECNAaCtrFp6ECAwEAAaOCBHMwggRvMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwIwCgYIKwYBBQUHAwEwPAYJKwYBBAGCNxUHBC8wLQYlKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFgh8fIENbYcQIBZAIBBjCCAcsGCCsGAQUFBwEBBIIBvTCCAbkwYwYIKwYBBQUHMAKGV2h0dHA6Ly9jcmwubWljcm9zb2Z0LmNvbS9wa2lpbmZyYS9DZXJ0cy9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDEuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmwyLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MFMGCCsGAQUFBzAChkdodHRwOi8vY3JsMy5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDQuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwHQYDVR0OBBYEFOL38Ka708l__wglsKzbwvptKgiNMA4GA1UdDwEB_wQEAwIFoDCCASYGA1UdHwSCAR0wggEZMIIBFaCCARGgggENhj9odHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ1JML0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwxLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwyLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwzLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmw0LmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmwwgZ0GA1UdIASBlTCBkjAMBgorBgEEAYI3ewEBMGYGCisGAQQBgjd7AgIwWDBWBggrBgEFBQcCAjBKHkgAMwAzAGUAMAAxADkAMgAxAC0ANABkADYANAAtADQAZgA4AGMALQBhADAANQA1AC0ANQBiAGQAYQBmAGYAZAA1AGUAMwAzAGQwDAYKKwYBBAGCN3sDATAMBgorBgEEAYI3ewQBMB8GA1UdIwQYMBaAFPFGaMbxw_ArLX2LauGy-b41_NFBMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATANBgkqhkiG9w0BAQsFAAOCAQEAOjvtmgGG_gQTCeRcW03oj3kuNjkaOoixOTlz3lAC2IQY_-4SRz6Y1-eEdGjDgSL5trZKjpas64eIIdZzKfAeRUiIfIQHFtlEGG-nOH9acyDkUY04bgQhSkkQ7vkiLB95C7sAKLweobXMkBlMNjBNGbJkY_9bCVP_Qgv3ACF5VfFnpj76iqtgNm3IMgoKQWsFliPj6UF8bkP0y2e-hZWKSWTeQIqDscIjvCXo-CAkMzJ7twtIAzttmQQ3UKLeI2kWwO4ZKOFoczpWVNJXtOAk155DuJIZL-A2nNR9xirNPNwpZlKaBwaek91rnTFgaOTCCrG2DFXpg97eI6UL0RrLKQ&s=VramQI0NrVWH41AUWl06xCxbcvI9gdTM-WZOwmcw2_-VLytdhGIYjPH8dfIZ51nFVp_0r02xqxnh3L2IxWPYC8NdWZI3bPPLcAXYNvxWpyax3qkf6hYfWVO36FsePIl4hyUN9DZ5A30y22ayrEoFnkMpm45h881nbtYXPCVulPX51cHG5p7UfoVu_HcRWrfcnlIRuX9tl4gVntZNdXDrNC42BUKjOQXmxfw96jNKOXVNa1S-b4cs2Alj5fZfVAFbmQExO2MCmmNXldZO9aN8NzxLXxZujviFWPcsFwR5-XKgU3SG0C7pA2WGRJqO9VW58gpv71SViad5KMXFqG4jKg&h=ProYQfUxtt5Nar3hDS_12XaCjhZGqlr-9OEA94kmTt4 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","name":"dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_durabletask000001/providers/Microsoft.DurableTask/namespaces/test1","status":"Accepted","startTime":"2024-09-05T17:49:36.8327173Z"}' + headers: + cache-control: + - no-cache + content-length: + - '569' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Sep 2024 17:52:08 GMT + etag: + - '"b7003d3c-0000-0100-0000-66d9ef300000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=c065741a-65a3-4502-b9c0-547929546b6f/eastus2euap/7dba49eb-8cba-45dd-b303-a4891ea4ca61 + x-msedge-ref: + - 'Ref A: 8627C624E1C84604B2D2DE41930BE119 Ref B: DM2EDGE0813 Ref C: 2024-09-05T17:52:08Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - durabletask namespace create + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - AZURECLI/2.64.0 azsdk-python-core/1.28.0 Python/3.11.6 (Linux-5.15.153.1-microsoft-standard-WSL2-x86_64-with-glibc2.35) + method: GET + uri: https://eastus2euap.management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96?api-version=2024-02-01-preview&t=638611553773460250&c=MIIHhjCCBm6gAwIBAgITHgUK3uZNXW0rELEWgAAABQre5jANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDYwHhcNMjQwNzI3MTIwMjAwWhcNMjQxMDI1MTIwMjAwWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALOp9mTbesFKlLY5kaubRq1NFmzMIRssJxSdGLLsTSNZCUTbJ7ozK0IiDfLVQCXyBqGrO3PYMBmeJEMdtKRsd00pJzflYkIE7nnXJBFw-sTxMSt4zsLsbXBMl4dGzNmrGZkYRrhFOSLC122KClMAs8DXhEcJU2_mol-1pxp42MCiq4jkKicedYt3GlUvVl3uSJyeiHw77qxa3x0QbuUm1DszpHTwyHp3x4hfUAwS6TWrZ929rowQ1y96k1x7RKmAIwamEzeg79Q5rsuLDW7yTX3Pg7sp7h3hbBjXeToCLa31ndkNFF9aoSLU3O-xO177GGKO6lhbIpHECNAaCtrFp6ECAwEAAaOCBHMwggRvMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwIwCgYIKwYBBQUHAwEwPAYJKwYBBAGCNxUHBC8wLQYlKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFgh8fIENbYcQIBZAIBBjCCAcsGCCsGAQUFBwEBBIIBvTCCAbkwYwYIKwYBBQUHMAKGV2h0dHA6Ly9jcmwubWljcm9zb2Z0LmNvbS9wa2lpbmZyYS9DZXJ0cy9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDEuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmwyLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MFMGCCsGAQUFBzAChkdodHRwOi8vY3JsMy5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDQuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwHQYDVR0OBBYEFOL38Ka708l__wglsKzbwvptKgiNMA4GA1UdDwEB_wQEAwIFoDCCASYGA1UdHwSCAR0wggEZMIIBFaCCARGgggENhj9odHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ1JML0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwxLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwyLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwzLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmw0LmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmwwgZ0GA1UdIASBlTCBkjAMBgorBgEEAYI3ewEBMGYGCisGAQQBgjd7AgIwWDBWBggrBgEFBQcCAjBKHkgAMwAzAGUAMAAxADkAMgAxAC0ANABkADYANAAtADQAZgA4AGMALQBhADAANQA1AC0ANQBiAGQAYQBmAGYAZAA1AGUAMwAzAGQwDAYKKwYBBAGCN3sDATAMBgorBgEEAYI3ewQBMB8GA1UdIwQYMBaAFPFGaMbxw_ArLX2LauGy-b41_NFBMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATANBgkqhkiG9w0BAQsFAAOCAQEAOjvtmgGG_gQTCeRcW03oj3kuNjkaOoixOTlz3lAC2IQY_-4SRz6Y1-eEdGjDgSL5trZKjpas64eIIdZzKfAeRUiIfIQHFtlEGG-nOH9acyDkUY04bgQhSkkQ7vkiLB95C7sAKLweobXMkBlMNjBNGbJkY_9bCVP_Qgv3ACF5VfFnpj76iqtgNm3IMgoKQWsFliPj6UF8bkP0y2e-hZWKSWTeQIqDscIjvCXo-CAkMzJ7twtIAzttmQQ3UKLeI2kWwO4ZKOFoczpWVNJXtOAk155DuJIZL-A2nNR9xirNPNwpZlKaBwaek91rnTFgaOTCCrG2DFXpg97eI6UL0RrLKQ&s=VramQI0NrVWH41AUWl06xCxbcvI9gdTM-WZOwmcw2_-VLytdhGIYjPH8dfIZ51nFVp_0r02xqxnh3L2IxWPYC8NdWZI3bPPLcAXYNvxWpyax3qkf6hYfWVO36FsePIl4hyUN9DZ5A30y22ayrEoFnkMpm45h881nbtYXPCVulPX51cHG5p7UfoVu_HcRWrfcnlIRuX9tl4gVntZNdXDrNC42BUKjOQXmxfw96jNKOXVNa1S-b4cs2Alj5fZfVAFbmQExO2MCmmNXldZO9aN8NzxLXxZujviFWPcsFwR5-XKgU3SG0C7pA2WGRJqO9VW58gpv71SViad5KMXFqG4jKg&h=ProYQfUxtt5Nar3hDS_12XaCjhZGqlr-9OEA94kmTt4 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","name":"dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_durabletask000001/providers/Microsoft.DurableTask/namespaces/test1","status":"Accepted","startTime":"2024-09-05T17:49:36.8327173Z"}' + headers: + cache-control: + - no-cache + content-length: + - '569' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Sep 2024 17:52:38 GMT + etag: + - '"b7003d3c-0000-0100-0000-66d9ef300000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=c065741a-65a3-4502-b9c0-547929546b6f/eastus2euap/782eeb4e-8b63-4001-b801-9194e78af235 + x-msedge-ref: + - 'Ref A: 511188A256EE48D999784F52DFFE368B Ref B: DM2EDGE0813 Ref C: 2024-09-05T17:52:38Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - durabletask namespace create + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - AZURECLI/2.64.0 azsdk-python-core/1.28.0 Python/3.11.6 (Linux-5.15.153.1-microsoft-standard-WSL2-x86_64-with-glibc2.35) + method: GET + uri: https://eastus2euap.management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96?api-version=2024-02-01-preview&t=638611553773460250&c=MIIHhjCCBm6gAwIBAgITHgUK3uZNXW0rELEWgAAABQre5jANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDYwHhcNMjQwNzI3MTIwMjAwWhcNMjQxMDI1MTIwMjAwWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALOp9mTbesFKlLY5kaubRq1NFmzMIRssJxSdGLLsTSNZCUTbJ7ozK0IiDfLVQCXyBqGrO3PYMBmeJEMdtKRsd00pJzflYkIE7nnXJBFw-sTxMSt4zsLsbXBMl4dGzNmrGZkYRrhFOSLC122KClMAs8DXhEcJU2_mol-1pxp42MCiq4jkKicedYt3GlUvVl3uSJyeiHw77qxa3x0QbuUm1DszpHTwyHp3x4hfUAwS6TWrZ929rowQ1y96k1x7RKmAIwamEzeg79Q5rsuLDW7yTX3Pg7sp7h3hbBjXeToCLa31ndkNFF9aoSLU3O-xO177GGKO6lhbIpHECNAaCtrFp6ECAwEAAaOCBHMwggRvMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwIwCgYIKwYBBQUHAwEwPAYJKwYBBAGCNxUHBC8wLQYlKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFgh8fIENbYcQIBZAIBBjCCAcsGCCsGAQUFBwEBBIIBvTCCAbkwYwYIKwYBBQUHMAKGV2h0dHA6Ly9jcmwubWljcm9zb2Z0LmNvbS9wa2lpbmZyYS9DZXJ0cy9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDEuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmwyLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MFMGCCsGAQUFBzAChkdodHRwOi8vY3JsMy5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDQuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwHQYDVR0OBBYEFOL38Ka708l__wglsKzbwvptKgiNMA4GA1UdDwEB_wQEAwIFoDCCASYGA1UdHwSCAR0wggEZMIIBFaCCARGgggENhj9odHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ1JML0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwxLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwyLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwzLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmw0LmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmwwgZ0GA1UdIASBlTCBkjAMBgorBgEEAYI3ewEBMGYGCisGAQQBgjd7AgIwWDBWBggrBgEFBQcCAjBKHkgAMwAzAGUAMAAxADkAMgAxAC0ANABkADYANAAtADQAZgA4AGMALQBhADAANQA1AC0ANQBiAGQAYQBmAGYAZAA1AGUAMwAzAGQwDAYKKwYBBAGCN3sDATAMBgorBgEEAYI3ewQBMB8GA1UdIwQYMBaAFPFGaMbxw_ArLX2LauGy-b41_NFBMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATANBgkqhkiG9w0BAQsFAAOCAQEAOjvtmgGG_gQTCeRcW03oj3kuNjkaOoixOTlz3lAC2IQY_-4SRz6Y1-eEdGjDgSL5trZKjpas64eIIdZzKfAeRUiIfIQHFtlEGG-nOH9acyDkUY04bgQhSkkQ7vkiLB95C7sAKLweobXMkBlMNjBNGbJkY_9bCVP_Qgv3ACF5VfFnpj76iqtgNm3IMgoKQWsFliPj6UF8bkP0y2e-hZWKSWTeQIqDscIjvCXo-CAkMzJ7twtIAzttmQQ3UKLeI2kWwO4ZKOFoczpWVNJXtOAk155DuJIZL-A2nNR9xirNPNwpZlKaBwaek91rnTFgaOTCCrG2DFXpg97eI6UL0RrLKQ&s=VramQI0NrVWH41AUWl06xCxbcvI9gdTM-WZOwmcw2_-VLytdhGIYjPH8dfIZ51nFVp_0r02xqxnh3L2IxWPYC8NdWZI3bPPLcAXYNvxWpyax3qkf6hYfWVO36FsePIl4hyUN9DZ5A30y22ayrEoFnkMpm45h881nbtYXPCVulPX51cHG5p7UfoVu_HcRWrfcnlIRuX9tl4gVntZNdXDrNC42BUKjOQXmxfw96jNKOXVNa1S-b4cs2Alj5fZfVAFbmQExO2MCmmNXldZO9aN8NzxLXxZujviFWPcsFwR5-XKgU3SG0C7pA2WGRJqO9VW58gpv71SViad5KMXFqG4jKg&h=ProYQfUxtt5Nar3hDS_12XaCjhZGqlr-9OEA94kmTt4 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","name":"dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_durabletask000001/providers/Microsoft.DurableTask/namespaces/test1","status":"Accepted","startTime":"2024-09-05T17:49:36.8327173Z"}' + headers: + cache-control: + - no-cache + content-length: + - '569' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Sep 2024 17:53:08 GMT + etag: + - '"b7003d3c-0000-0100-0000-66d9ef300000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=c065741a-65a3-4502-b9c0-547929546b6f/eastus2euap/a8bba586-ce4d-4bb9-94c8-a8eecfb9143a + x-msedge-ref: + - 'Ref A: 68E172698ECF4874A2A656AD243E7A06 Ref B: DM2EDGE0813 Ref C: 2024-09-05T17:53:08Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - durabletask namespace create + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - AZURECLI/2.64.0 azsdk-python-core/1.28.0 Python/3.11.6 (Linux-5.15.153.1-microsoft-standard-WSL2-x86_64-with-glibc2.35) + method: GET + uri: https://eastus2euap.management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96?api-version=2024-02-01-preview&t=638611553773460250&c=MIIHhjCCBm6gAwIBAgITHgUK3uZNXW0rELEWgAAABQre5jANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDYwHhcNMjQwNzI3MTIwMjAwWhcNMjQxMDI1MTIwMjAwWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALOp9mTbesFKlLY5kaubRq1NFmzMIRssJxSdGLLsTSNZCUTbJ7ozK0IiDfLVQCXyBqGrO3PYMBmeJEMdtKRsd00pJzflYkIE7nnXJBFw-sTxMSt4zsLsbXBMl4dGzNmrGZkYRrhFOSLC122KClMAs8DXhEcJU2_mol-1pxp42MCiq4jkKicedYt3GlUvVl3uSJyeiHw77qxa3x0QbuUm1DszpHTwyHp3x4hfUAwS6TWrZ929rowQ1y96k1x7RKmAIwamEzeg79Q5rsuLDW7yTX3Pg7sp7h3hbBjXeToCLa31ndkNFF9aoSLU3O-xO177GGKO6lhbIpHECNAaCtrFp6ECAwEAAaOCBHMwggRvMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwIwCgYIKwYBBQUHAwEwPAYJKwYBBAGCNxUHBC8wLQYlKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFgh8fIENbYcQIBZAIBBjCCAcsGCCsGAQUFBwEBBIIBvTCCAbkwYwYIKwYBBQUHMAKGV2h0dHA6Ly9jcmwubWljcm9zb2Z0LmNvbS9wa2lpbmZyYS9DZXJ0cy9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDEuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmwyLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MFMGCCsGAQUFBzAChkdodHRwOi8vY3JsMy5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDQuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwHQYDVR0OBBYEFOL38Ka708l__wglsKzbwvptKgiNMA4GA1UdDwEB_wQEAwIFoDCCASYGA1UdHwSCAR0wggEZMIIBFaCCARGgggENhj9odHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ1JML0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwxLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwyLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwzLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmw0LmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmwwgZ0GA1UdIASBlTCBkjAMBgorBgEEAYI3ewEBMGYGCisGAQQBgjd7AgIwWDBWBggrBgEFBQcCAjBKHkgAMwAzAGUAMAAxADkAMgAxAC0ANABkADYANAAtADQAZgA4AGMALQBhADAANQA1AC0ANQBiAGQAYQBmAGYAZAA1AGUAMwAzAGQwDAYKKwYBBAGCN3sDATAMBgorBgEEAYI3ewQBMB8GA1UdIwQYMBaAFPFGaMbxw_ArLX2LauGy-b41_NFBMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATANBgkqhkiG9w0BAQsFAAOCAQEAOjvtmgGG_gQTCeRcW03oj3kuNjkaOoixOTlz3lAC2IQY_-4SRz6Y1-eEdGjDgSL5trZKjpas64eIIdZzKfAeRUiIfIQHFtlEGG-nOH9acyDkUY04bgQhSkkQ7vkiLB95C7sAKLweobXMkBlMNjBNGbJkY_9bCVP_Qgv3ACF5VfFnpj76iqtgNm3IMgoKQWsFliPj6UF8bkP0y2e-hZWKSWTeQIqDscIjvCXo-CAkMzJ7twtIAzttmQQ3UKLeI2kWwO4ZKOFoczpWVNJXtOAk155DuJIZL-A2nNR9xirNPNwpZlKaBwaek91rnTFgaOTCCrG2DFXpg97eI6UL0RrLKQ&s=VramQI0NrVWH41AUWl06xCxbcvI9gdTM-WZOwmcw2_-VLytdhGIYjPH8dfIZ51nFVp_0r02xqxnh3L2IxWPYC8NdWZI3bPPLcAXYNvxWpyax3qkf6hYfWVO36FsePIl4hyUN9DZ5A30y22ayrEoFnkMpm45h881nbtYXPCVulPX51cHG5p7UfoVu_HcRWrfcnlIRuX9tl4gVntZNdXDrNC42BUKjOQXmxfw96jNKOXVNa1S-b4cs2Alj5fZfVAFbmQExO2MCmmNXldZO9aN8NzxLXxZujviFWPcsFwR5-XKgU3SG0C7pA2WGRJqO9VW58gpv71SViad5KMXFqG4jKg&h=ProYQfUxtt5Nar3hDS_12XaCjhZGqlr-9OEA94kmTt4 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","name":"dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_durabletask000001/providers/Microsoft.DurableTask/namespaces/test1","status":"Accepted","startTime":"2024-09-05T17:49:36.8327173Z"}' + headers: + cache-control: + - no-cache + content-length: + - '569' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Sep 2024 17:53:38 GMT + etag: + - '"b7003d3c-0000-0100-0000-66d9ef300000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=c065741a-65a3-4502-b9c0-547929546b6f/eastus2euap/fca0799b-32e7-4ab5-ad40-02c7a60752d6 + x-msedge-ref: + - 'Ref A: 7DC921AB6851424AB843710818AC73EF Ref B: DM2EDGE0813 Ref C: 2024-09-05T17:53:38Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - durabletask namespace create + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - AZURECLI/2.64.0 azsdk-python-core/1.28.0 Python/3.11.6 (Linux-5.15.153.1-microsoft-standard-WSL2-x86_64-with-glibc2.35) + method: GET + uri: https://eastus2euap.management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96?api-version=2024-02-01-preview&t=638611553773460250&c=MIIHhjCCBm6gAwIBAgITHgUK3uZNXW0rELEWgAAABQre5jANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDYwHhcNMjQwNzI3MTIwMjAwWhcNMjQxMDI1MTIwMjAwWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALOp9mTbesFKlLY5kaubRq1NFmzMIRssJxSdGLLsTSNZCUTbJ7ozK0IiDfLVQCXyBqGrO3PYMBmeJEMdtKRsd00pJzflYkIE7nnXJBFw-sTxMSt4zsLsbXBMl4dGzNmrGZkYRrhFOSLC122KClMAs8DXhEcJU2_mol-1pxp42MCiq4jkKicedYt3GlUvVl3uSJyeiHw77qxa3x0QbuUm1DszpHTwyHp3x4hfUAwS6TWrZ929rowQ1y96k1x7RKmAIwamEzeg79Q5rsuLDW7yTX3Pg7sp7h3hbBjXeToCLa31ndkNFF9aoSLU3O-xO177GGKO6lhbIpHECNAaCtrFp6ECAwEAAaOCBHMwggRvMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwIwCgYIKwYBBQUHAwEwPAYJKwYBBAGCNxUHBC8wLQYlKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFgh8fIENbYcQIBZAIBBjCCAcsGCCsGAQUFBwEBBIIBvTCCAbkwYwYIKwYBBQUHMAKGV2h0dHA6Ly9jcmwubWljcm9zb2Z0LmNvbS9wa2lpbmZyYS9DZXJ0cy9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDEuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmwyLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MFMGCCsGAQUFBzAChkdodHRwOi8vY3JsMy5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDQuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwHQYDVR0OBBYEFOL38Ka708l__wglsKzbwvptKgiNMA4GA1UdDwEB_wQEAwIFoDCCASYGA1UdHwSCAR0wggEZMIIBFaCCARGgggENhj9odHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ1JML0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwxLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwyLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwzLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmw0LmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmwwgZ0GA1UdIASBlTCBkjAMBgorBgEEAYI3ewEBMGYGCisGAQQBgjd7AgIwWDBWBggrBgEFBQcCAjBKHkgAMwAzAGUAMAAxADkAMgAxAC0ANABkADYANAAtADQAZgA4AGMALQBhADAANQA1AC0ANQBiAGQAYQBmAGYAZAA1AGUAMwAzAGQwDAYKKwYBBAGCN3sDATAMBgorBgEEAYI3ewQBMB8GA1UdIwQYMBaAFPFGaMbxw_ArLX2LauGy-b41_NFBMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATANBgkqhkiG9w0BAQsFAAOCAQEAOjvtmgGG_gQTCeRcW03oj3kuNjkaOoixOTlz3lAC2IQY_-4SRz6Y1-eEdGjDgSL5trZKjpas64eIIdZzKfAeRUiIfIQHFtlEGG-nOH9acyDkUY04bgQhSkkQ7vkiLB95C7sAKLweobXMkBlMNjBNGbJkY_9bCVP_Qgv3ACF5VfFnpj76iqtgNm3IMgoKQWsFliPj6UF8bkP0y2e-hZWKSWTeQIqDscIjvCXo-CAkMzJ7twtIAzttmQQ3UKLeI2kWwO4ZKOFoczpWVNJXtOAk155DuJIZL-A2nNR9xirNPNwpZlKaBwaek91rnTFgaOTCCrG2DFXpg97eI6UL0RrLKQ&s=VramQI0NrVWH41AUWl06xCxbcvI9gdTM-WZOwmcw2_-VLytdhGIYjPH8dfIZ51nFVp_0r02xqxnh3L2IxWPYC8NdWZI3bPPLcAXYNvxWpyax3qkf6hYfWVO36FsePIl4hyUN9DZ5A30y22ayrEoFnkMpm45h881nbtYXPCVulPX51cHG5p7UfoVu_HcRWrfcnlIRuX9tl4gVntZNdXDrNC42BUKjOQXmxfw96jNKOXVNa1S-b4cs2Alj5fZfVAFbmQExO2MCmmNXldZO9aN8NzxLXxZujviFWPcsFwR5-XKgU3SG0C7pA2WGRJqO9VW58gpv71SViad5KMXFqG4jKg&h=ProYQfUxtt5Nar3hDS_12XaCjhZGqlr-9OEA94kmTt4 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","name":"dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_durabletask000001/providers/Microsoft.DurableTask/namespaces/test1","status":"Accepted","startTime":"2024-09-05T17:49:36.8327173Z"}' + headers: + cache-control: + - no-cache + content-length: + - '569' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Sep 2024 17:54:08 GMT + etag: + - '"b7003d3c-0000-0100-0000-66d9ef300000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=c065741a-65a3-4502-b9c0-547929546b6f/eastus2euap/76bc8f56-ac35-470f-a3d2-dea617aff82e + x-msedge-ref: + - 'Ref A: 8F5D0C201C71481DA482E4E4245915D9 Ref B: DM2EDGE0813 Ref C: 2024-09-05T17:54:08Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - durabletask namespace create + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - AZURECLI/2.64.0 azsdk-python-core/1.28.0 Python/3.11.6 (Linux-5.15.153.1-microsoft-standard-WSL2-x86_64-with-glibc2.35) + method: GET + uri: https://eastus2euap.management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96?api-version=2024-02-01-preview&t=638611553773460250&c=MIIHhjCCBm6gAwIBAgITHgUK3uZNXW0rELEWgAAABQre5jANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDYwHhcNMjQwNzI3MTIwMjAwWhcNMjQxMDI1MTIwMjAwWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALOp9mTbesFKlLY5kaubRq1NFmzMIRssJxSdGLLsTSNZCUTbJ7ozK0IiDfLVQCXyBqGrO3PYMBmeJEMdtKRsd00pJzflYkIE7nnXJBFw-sTxMSt4zsLsbXBMl4dGzNmrGZkYRrhFOSLC122KClMAs8DXhEcJU2_mol-1pxp42MCiq4jkKicedYt3GlUvVl3uSJyeiHw77qxa3x0QbuUm1DszpHTwyHp3x4hfUAwS6TWrZ929rowQ1y96k1x7RKmAIwamEzeg79Q5rsuLDW7yTX3Pg7sp7h3hbBjXeToCLa31ndkNFF9aoSLU3O-xO177GGKO6lhbIpHECNAaCtrFp6ECAwEAAaOCBHMwggRvMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwIwCgYIKwYBBQUHAwEwPAYJKwYBBAGCNxUHBC8wLQYlKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFgh8fIENbYcQIBZAIBBjCCAcsGCCsGAQUFBwEBBIIBvTCCAbkwYwYIKwYBBQUHMAKGV2h0dHA6Ly9jcmwubWljcm9zb2Z0LmNvbS9wa2lpbmZyYS9DZXJ0cy9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDEuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmwyLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MFMGCCsGAQUFBzAChkdodHRwOi8vY3JsMy5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDQuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwHQYDVR0OBBYEFOL38Ka708l__wglsKzbwvptKgiNMA4GA1UdDwEB_wQEAwIFoDCCASYGA1UdHwSCAR0wggEZMIIBFaCCARGgggENhj9odHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ1JML0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwxLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwyLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwzLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmw0LmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmwwgZ0GA1UdIASBlTCBkjAMBgorBgEEAYI3ewEBMGYGCisGAQQBgjd7AgIwWDBWBggrBgEFBQcCAjBKHkgAMwAzAGUAMAAxADkAMgAxAC0ANABkADYANAAtADQAZgA4AGMALQBhADAANQA1AC0ANQBiAGQAYQBmAGYAZAA1AGUAMwAzAGQwDAYKKwYBBAGCN3sDATAMBgorBgEEAYI3ewQBMB8GA1UdIwQYMBaAFPFGaMbxw_ArLX2LauGy-b41_NFBMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATANBgkqhkiG9w0BAQsFAAOCAQEAOjvtmgGG_gQTCeRcW03oj3kuNjkaOoixOTlz3lAC2IQY_-4SRz6Y1-eEdGjDgSL5trZKjpas64eIIdZzKfAeRUiIfIQHFtlEGG-nOH9acyDkUY04bgQhSkkQ7vkiLB95C7sAKLweobXMkBlMNjBNGbJkY_9bCVP_Qgv3ACF5VfFnpj76iqtgNm3IMgoKQWsFliPj6UF8bkP0y2e-hZWKSWTeQIqDscIjvCXo-CAkMzJ7twtIAzttmQQ3UKLeI2kWwO4ZKOFoczpWVNJXtOAk155DuJIZL-A2nNR9xirNPNwpZlKaBwaek91rnTFgaOTCCrG2DFXpg97eI6UL0RrLKQ&s=VramQI0NrVWH41AUWl06xCxbcvI9gdTM-WZOwmcw2_-VLytdhGIYjPH8dfIZ51nFVp_0r02xqxnh3L2IxWPYC8NdWZI3bPPLcAXYNvxWpyax3qkf6hYfWVO36FsePIl4hyUN9DZ5A30y22ayrEoFnkMpm45h881nbtYXPCVulPX51cHG5p7UfoVu_HcRWrfcnlIRuX9tl4gVntZNdXDrNC42BUKjOQXmxfw96jNKOXVNa1S-b4cs2Alj5fZfVAFbmQExO2MCmmNXldZO9aN8NzxLXxZujviFWPcsFwR5-XKgU3SG0C7pA2WGRJqO9VW58gpv71SViad5KMXFqG4jKg&h=ProYQfUxtt5Nar3hDS_12XaCjhZGqlr-9OEA94kmTt4 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","name":"dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_durabletask000001/providers/Microsoft.DurableTask/namespaces/test1","status":"Accepted","startTime":"2024-09-05T17:49:36.8327173Z"}' + headers: + cache-control: + - no-cache + content-length: + - '569' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Sep 2024 17:54:38 GMT + etag: + - '"b7003d3c-0000-0100-0000-66d9ef300000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=c065741a-65a3-4502-b9c0-547929546b6f/eastus2euap/c337dde3-23b8-4641-acf5-d792f5489dfb + x-msedge-ref: + - 'Ref A: A88A055D50F9410998FBDD0AA6BBB114 Ref B: DM2EDGE0813 Ref C: 2024-09-05T17:54:38Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - durabletask namespace create + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - AZURECLI/2.64.0 azsdk-python-core/1.28.0 Python/3.11.6 (Linux-5.15.153.1-microsoft-standard-WSL2-x86_64-with-glibc2.35) + method: GET + uri: https://eastus2euap.management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96?api-version=2024-02-01-preview&t=638611553773460250&c=MIIHhjCCBm6gAwIBAgITHgUK3uZNXW0rELEWgAAABQre5jANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDYwHhcNMjQwNzI3MTIwMjAwWhcNMjQxMDI1MTIwMjAwWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALOp9mTbesFKlLY5kaubRq1NFmzMIRssJxSdGLLsTSNZCUTbJ7ozK0IiDfLVQCXyBqGrO3PYMBmeJEMdtKRsd00pJzflYkIE7nnXJBFw-sTxMSt4zsLsbXBMl4dGzNmrGZkYRrhFOSLC122KClMAs8DXhEcJU2_mol-1pxp42MCiq4jkKicedYt3GlUvVl3uSJyeiHw77qxa3x0QbuUm1DszpHTwyHp3x4hfUAwS6TWrZ929rowQ1y96k1x7RKmAIwamEzeg79Q5rsuLDW7yTX3Pg7sp7h3hbBjXeToCLa31ndkNFF9aoSLU3O-xO177GGKO6lhbIpHECNAaCtrFp6ECAwEAAaOCBHMwggRvMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwIwCgYIKwYBBQUHAwEwPAYJKwYBBAGCNxUHBC8wLQYlKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFgh8fIENbYcQIBZAIBBjCCAcsGCCsGAQUFBwEBBIIBvTCCAbkwYwYIKwYBBQUHMAKGV2h0dHA6Ly9jcmwubWljcm9zb2Z0LmNvbS9wa2lpbmZyYS9DZXJ0cy9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDEuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmwyLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MFMGCCsGAQUFBzAChkdodHRwOi8vY3JsMy5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDQuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwHQYDVR0OBBYEFOL38Ka708l__wglsKzbwvptKgiNMA4GA1UdDwEB_wQEAwIFoDCCASYGA1UdHwSCAR0wggEZMIIBFaCCARGgggENhj9odHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ1JML0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwxLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwyLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwzLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmw0LmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmwwgZ0GA1UdIASBlTCBkjAMBgorBgEEAYI3ewEBMGYGCisGAQQBgjd7AgIwWDBWBggrBgEFBQcCAjBKHkgAMwAzAGUAMAAxADkAMgAxAC0ANABkADYANAAtADQAZgA4AGMALQBhADAANQA1AC0ANQBiAGQAYQBmAGYAZAA1AGUAMwAzAGQwDAYKKwYBBAGCN3sDATAMBgorBgEEAYI3ewQBMB8GA1UdIwQYMBaAFPFGaMbxw_ArLX2LauGy-b41_NFBMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATANBgkqhkiG9w0BAQsFAAOCAQEAOjvtmgGG_gQTCeRcW03oj3kuNjkaOoixOTlz3lAC2IQY_-4SRz6Y1-eEdGjDgSL5trZKjpas64eIIdZzKfAeRUiIfIQHFtlEGG-nOH9acyDkUY04bgQhSkkQ7vkiLB95C7sAKLweobXMkBlMNjBNGbJkY_9bCVP_Qgv3ACF5VfFnpj76iqtgNm3IMgoKQWsFliPj6UF8bkP0y2e-hZWKSWTeQIqDscIjvCXo-CAkMzJ7twtIAzttmQQ3UKLeI2kWwO4ZKOFoczpWVNJXtOAk155DuJIZL-A2nNR9xirNPNwpZlKaBwaek91rnTFgaOTCCrG2DFXpg97eI6UL0RrLKQ&s=VramQI0NrVWH41AUWl06xCxbcvI9gdTM-WZOwmcw2_-VLytdhGIYjPH8dfIZ51nFVp_0r02xqxnh3L2IxWPYC8NdWZI3bPPLcAXYNvxWpyax3qkf6hYfWVO36FsePIl4hyUN9DZ5A30y22ayrEoFnkMpm45h881nbtYXPCVulPX51cHG5p7UfoVu_HcRWrfcnlIRuX9tl4gVntZNdXDrNC42BUKjOQXmxfw96jNKOXVNa1S-b4cs2Alj5fZfVAFbmQExO2MCmmNXldZO9aN8NzxLXxZujviFWPcsFwR5-XKgU3SG0C7pA2WGRJqO9VW58gpv71SViad5KMXFqG4jKg&h=ProYQfUxtt5Nar3hDS_12XaCjhZGqlr-9OEA94kmTt4 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","name":"dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_durabletask000001/providers/Microsoft.DurableTask/namespaces/test1","status":"Accepted","startTime":"2024-09-05T17:49:36.8327173Z"}' + headers: + cache-control: + - no-cache + content-length: + - '569' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Sep 2024 17:55:08 GMT + etag: + - '"b7003d3c-0000-0100-0000-66d9ef300000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=c065741a-65a3-4502-b9c0-547929546b6f/eastus2euap/fdc86c27-359e-47bc-9fcd-05c5a39650b7 + x-msedge-ref: + - 'Ref A: DF98F9CE6499499799A40269257A550F Ref B: DM2EDGE0813 Ref C: 2024-09-05T17:55:08Z' + status: + code: 200 + message: OK +version: 1 diff --git a/src/durabletask/azext_durabletask/tests/latest/test_durabletask_scenario.py b/src/durabletask-preview/azext_durabletask_preview/tests/latest/test_durabletask_scenario.py similarity index 100% rename from src/durabletask/azext_durabletask/tests/latest/test_durabletask_scenario.py rename to src/durabletask-preview/azext_durabletask_preview/tests/latest/test_durabletask_scenario.py diff --git a/src/durabletask/azext_durabletask/vendored_sdks/__init__.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/__init__.py similarity index 100% rename from src/durabletask/azext_durabletask/vendored_sdks/__init__.py rename to src/durabletask-preview/azext_durabletask_preview/vendored_sdks/__init__.py diff --git a/src/durabletask/azext_durabletask/vendored_sdks/_configuration.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/_configuration.py similarity index 100% rename from src/durabletask/azext_durabletask/vendored_sdks/_configuration.py rename to src/durabletask-preview/azext_durabletask_preview/vendored_sdks/_configuration.py diff --git a/src/durabletask/azext_durabletask/vendored_sdks/_durabletask_mgmt_client.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/_durabletask_mgmt_client.py similarity index 100% rename from src/durabletask/azext_durabletask/vendored_sdks/_durabletask_mgmt_client.py rename to src/durabletask-preview/azext_durabletask_preview/vendored_sdks/_durabletask_mgmt_client.py diff --git a/src/durabletask/azext_durabletask/vendored_sdks/_patch.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/_patch.py similarity index 100% rename from src/durabletask/azext_durabletask/vendored_sdks/_patch.py rename to src/durabletask-preview/azext_durabletask_preview/vendored_sdks/_patch.py diff --git a/src/durabletask/azext_durabletask/vendored_sdks/_serialization.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/_serialization.py similarity index 100% rename from src/durabletask/azext_durabletask/vendored_sdks/_serialization.py rename to src/durabletask-preview/azext_durabletask_preview/vendored_sdks/_serialization.py diff --git a/src/durabletask/azext_durabletask/vendored_sdks/_version.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/_version.py similarity index 100% rename from src/durabletask/azext_durabletask/vendored_sdks/_version.py rename to src/durabletask-preview/azext_durabletask_preview/vendored_sdks/_version.py diff --git a/src/durabletask/azext_durabletask/vendored_sdks/aio/__init__.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/__init__.py similarity index 100% rename from src/durabletask/azext_durabletask/vendored_sdks/aio/__init__.py rename to src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/__init__.py diff --git a/src/durabletask/azext_durabletask/vendored_sdks/aio/_configuration.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/_configuration.py similarity index 100% rename from src/durabletask/azext_durabletask/vendored_sdks/aio/_configuration.py rename to src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/_configuration.py diff --git a/src/durabletask/azext_durabletask/vendored_sdks/aio/_durabletask_mgmt_client.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/_durabletask_mgmt_client.py similarity index 100% rename from src/durabletask/azext_durabletask/vendored_sdks/aio/_durabletask_mgmt_client.py rename to src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/_durabletask_mgmt_client.py diff --git a/src/durabletask/azext_durabletask/vendored_sdks/aio/_patch.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/_patch.py similarity index 100% rename from src/durabletask/azext_durabletask/vendored_sdks/aio/_patch.py rename to src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/_patch.py diff --git a/src/durabletask/azext_durabletask/vendored_sdks/aio/operations/__init__.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/operations/__init__.py similarity index 100% rename from src/durabletask/azext_durabletask/vendored_sdks/aio/operations/__init__.py rename to src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/operations/__init__.py diff --git a/src/durabletask/azext_durabletask/vendored_sdks/aio/operations/_namespaces_operations.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/operations/_namespaces_operations.py similarity index 100% rename from src/durabletask/azext_durabletask/vendored_sdks/aio/operations/_namespaces_operations.py rename to src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/operations/_namespaces_operations.py diff --git a/src/durabletask/azext_durabletask/vendored_sdks/aio/operations/_operations.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/operations/_operations.py similarity index 100% rename from src/durabletask/azext_durabletask/vendored_sdks/aio/operations/_operations.py rename to src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/operations/_operations.py diff --git a/src/durabletask/azext_durabletask/vendored_sdks/aio/operations/_patch.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/operations/_patch.py similarity index 100% rename from src/durabletask/azext_durabletask/vendored_sdks/aio/operations/_patch.py rename to src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/operations/_patch.py diff --git a/src/durabletask/azext_durabletask/vendored_sdks/aio/operations/_task_hubs_operations.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/operations/_task_hubs_operations.py similarity index 100% rename from src/durabletask/azext_durabletask/vendored_sdks/aio/operations/_task_hubs_operations.py rename to src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/operations/_task_hubs_operations.py diff --git a/src/durabletask/azext_durabletask/vendored_sdks/authoring/__init__.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/__init__.py similarity index 100% rename from src/durabletask/azext_durabletask/vendored_sdks/authoring/__init__.py rename to src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/__init__.py diff --git a/src/durabletask/azext_durabletask/vendored_sdks/authoring/_configuration.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/_configuration.py similarity index 100% rename from src/durabletask/azext_durabletask/vendored_sdks/authoring/_configuration.py rename to src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/_configuration.py diff --git a/src/durabletask/azext_durabletask/vendored_sdks/authoring/_luis_authoring_client.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/_luis_authoring_client.py similarity index 100% rename from src/durabletask/azext_durabletask/vendored_sdks/authoring/_luis_authoring_client.py rename to src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/_luis_authoring_client.py diff --git a/src/durabletask/azext_durabletask/vendored_sdks/authoring/models/__init__.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/models/__init__.py similarity index 100% rename from src/durabletask/azext_durabletask/vendored_sdks/authoring/models/__init__.py rename to src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/models/__init__.py diff --git a/src/durabletask/azext_durabletask/vendored_sdks/authoring/models/_luis_authoring_client_enums.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/models/_luis_authoring_client_enums.py similarity index 100% rename from src/durabletask/azext_durabletask/vendored_sdks/authoring/models/_luis_authoring_client_enums.py rename to src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/models/_luis_authoring_client_enums.py diff --git a/src/durabletask/azext_durabletask/vendored_sdks/authoring/models/_models.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/models/_models.py similarity index 100% rename from src/durabletask/azext_durabletask/vendored_sdks/authoring/models/_models.py rename to src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/models/_models.py diff --git a/src/durabletask/azext_durabletask/vendored_sdks/authoring/models/_models_py3.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/models/_models_py3.py similarity index 100% rename from src/durabletask/azext_durabletask/vendored_sdks/authoring/models/_models_py3.py rename to src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/models/_models_py3.py diff --git a/src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/__init__.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/__init__.py similarity index 100% rename from src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/__init__.py rename to src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/__init__.py diff --git a/src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_apps_operations.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_apps_operations.py similarity index 100% rename from src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_apps_operations.py rename to src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_apps_operations.py diff --git a/src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_azure_accounts_operations.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_azure_accounts_operations.py similarity index 100% rename from src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_azure_accounts_operations.py rename to src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_azure_accounts_operations.py diff --git a/src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_examples_operations.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_examples_operations.py similarity index 100% rename from src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_examples_operations.py rename to src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_examples_operations.py diff --git a/src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_features_operations.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_features_operations.py similarity index 100% rename from src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_features_operations.py rename to src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_features_operations.py diff --git a/src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_model_operations.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_model_operations.py similarity index 100% rename from src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_model_operations.py rename to src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_model_operations.py diff --git a/src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_pattern_operations.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_pattern_operations.py similarity index 100% rename from src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_pattern_operations.py rename to src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_pattern_operations.py diff --git a/src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_settings_operations.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_settings_operations.py similarity index 100% rename from src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_settings_operations.py rename to src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_settings_operations.py diff --git a/src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_train_operations.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_train_operations.py similarity index 100% rename from src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_train_operations.py rename to src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_train_operations.py diff --git a/src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_versions_operations.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_versions_operations.py similarity index 100% rename from src/durabletask/azext_durabletask/vendored_sdks/authoring/operations/_versions_operations.py rename to src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_versions_operations.py diff --git a/src/durabletask/azext_durabletask/vendored_sdks/authoring/version.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/version.py similarity index 100% rename from src/durabletask/azext_durabletask/vendored_sdks/authoring/version.py rename to src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/version.py diff --git a/src/durabletask/azext_durabletask/vendored_sdks/models/__init__.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/models/__init__.py similarity index 100% rename from src/durabletask/azext_durabletask/vendored_sdks/models/__init__.py rename to src/durabletask-preview/azext_durabletask_preview/vendored_sdks/models/__init__.py diff --git a/src/durabletask/azext_durabletask/vendored_sdks/models/_durabletask_mgmt_client_enums.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/models/_durabletask_mgmt_client_enums.py similarity index 100% rename from src/durabletask/azext_durabletask/vendored_sdks/models/_durabletask_mgmt_client_enums.py rename to src/durabletask-preview/azext_durabletask_preview/vendored_sdks/models/_durabletask_mgmt_client_enums.py diff --git a/src/durabletask/azext_durabletask/vendored_sdks/models/_models_py3.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/models/_models_py3.py similarity index 100% rename from src/durabletask/azext_durabletask/vendored_sdks/models/_models_py3.py rename to src/durabletask-preview/azext_durabletask_preview/vendored_sdks/models/_models_py3.py diff --git a/src/durabletask/azext_durabletask/vendored_sdks/models/_patch.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/models/_patch.py similarity index 100% rename from src/durabletask/azext_durabletask/vendored_sdks/models/_patch.py rename to src/durabletask-preview/azext_durabletask_preview/vendored_sdks/models/_patch.py diff --git a/src/durabletask/azext_durabletask/vendored_sdks/operations/__init__.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/operations/__init__.py similarity index 100% rename from src/durabletask/azext_durabletask/vendored_sdks/operations/__init__.py rename to src/durabletask-preview/azext_durabletask_preview/vendored_sdks/operations/__init__.py diff --git a/src/durabletask/azext_durabletask/vendored_sdks/operations/_namespaces_operations.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/operations/_namespaces_operations.py similarity index 100% rename from src/durabletask/azext_durabletask/vendored_sdks/operations/_namespaces_operations.py rename to src/durabletask-preview/azext_durabletask_preview/vendored_sdks/operations/_namespaces_operations.py diff --git a/src/durabletask/azext_durabletask/vendored_sdks/operations/_operations.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/operations/_operations.py similarity index 100% rename from src/durabletask/azext_durabletask/vendored_sdks/operations/_operations.py rename to src/durabletask-preview/azext_durabletask_preview/vendored_sdks/operations/_operations.py diff --git a/src/durabletask/azext_durabletask/vendored_sdks/operations/_patch.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/operations/_patch.py similarity index 100% rename from src/durabletask/azext_durabletask/vendored_sdks/operations/_patch.py rename to src/durabletask-preview/azext_durabletask_preview/vendored_sdks/operations/_patch.py diff --git a/src/durabletask/azext_durabletask/vendored_sdks/operations/_task_hubs_operations.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/operations/_task_hubs_operations.py similarity index 100% rename from src/durabletask/azext_durabletask/vendored_sdks/operations/_task_hubs_operations.py rename to src/durabletask-preview/azext_durabletask_preview/vendored_sdks/operations/_task_hubs_operations.py diff --git a/src/durabletask/azext_durabletask/vendored_sdks/py.typed b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/py.typed similarity index 100% rename from src/durabletask/azext_durabletask/vendored_sdks/py.typed rename to src/durabletask-preview/azext_durabletask_preview/vendored_sdks/py.typed diff --git a/src/durabletask/azext_durabletask/vendored_sdks/version.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/version.py similarity index 100% rename from src/durabletask/azext_durabletask/vendored_sdks/version.py rename to src/durabletask-preview/azext_durabletask_preview/vendored_sdks/version.py diff --git a/src/durabletask/setup.cfg b/src/durabletask-preview/setup.cfg similarity index 100% rename from src/durabletask/setup.cfg rename to src/durabletask-preview/setup.cfg diff --git a/src/durabletask/setup.py b/src/durabletask-preview/setup.py similarity index 98% rename from src/durabletask/setup.py rename to src/durabletask-preview/setup.py index e2693ea6485..27320163a9d 100644 --- a/src/durabletask/setup.py +++ b/src/durabletask-preview/setup.py @@ -41,7 +41,7 @@ HISTORY = f.read() setup( - name='durabletask', + name='durabletask-preview', version=VERSION, description='Microsoft Azure Command-Line Tools Durabletask Extension', # TODO: Update author and email, if applicable From 5ae0b407f55eca07e9cdb1c159535908840dc6ef Mon Sep 17 00:00:00 2001 From: Ryan Lettieri Date: Tue, 10 Sep 2024 10:33:01 -0600 Subject: [PATCH 11/19] More name change fixes to add preview Signed-off-by: Ryan Lettieri --- .../azext_durabletask_preview/__init__.py | 10 +++++----- .../azext_durabletask_preview/_client_factory.py | 2 +- .../azext_durabletask_preview/commands.py | 6 +++--- .../azext_durabletask_preview/custom.py | 4 ++-- src/durabletask-preview/setup.py | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/durabletask-preview/azext_durabletask_preview/__init__.py b/src/durabletask-preview/azext_durabletask_preview/__init__.py index dbc80a3b2eb..97aedded478 100644 --- a/src/durabletask-preview/azext_durabletask_preview/__init__.py +++ b/src/durabletask-preview/azext_durabletask_preview/__init__.py @@ -5,27 +5,27 @@ from azure.cli.core import AzCommandsLoader -from azext_durabletask._help import helps # pylint: disable=unused-import +from azext_durabletask_preview._help import helps # pylint: disable=unused-import class DurabletaskCommandsLoader(AzCommandsLoader): def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType - from azext_durabletask._client_factory import cf_durabletask + from azext_durabletask_preview._client_factory import cf_durabletask durabletask_custom = CliCommandType( - operations_tmpl='azext_durabletask.custom#{}', + operations_tmpl='azext_durabletask_preview.custom#{}', client_factory=cf_durabletask) super(DurabletaskCommandsLoader, self).__init__(cli_ctx=cli_ctx, custom_command_type=durabletask_custom) def load_command_table(self, args): - from azext_durabletask.commands import load_command_table + from azext_durabletask_preview.commands import load_command_table load_command_table(self, args) return self.command_table def load_arguments(self, command): - from azext_durabletask._params import load_arguments + from azext_durabletask_preview._params import load_arguments load_arguments(self, command) diff --git a/src/durabletask-preview/azext_durabletask_preview/_client_factory.py b/src/durabletask-preview/azext_durabletask_preview/_client_factory.py index 2ba905cfc3b..101a51c3229 100644 --- a/src/durabletask-preview/azext_durabletask_preview/_client_factory.py +++ b/src/durabletask-preview/azext_durabletask_preview/_client_factory.py @@ -5,7 +5,7 @@ def cf_durabletask(cli_ctx, *_): from azure.cli.core.commands.client_factory import get_mgmt_service_client - from azext_durabletask.vendored_sdks import DurabletaskMgmtClient + from azext_durabletask_preview.vendored_sdks import DurabletaskMgmtClient return get_mgmt_service_client(cli_ctx, DurabletaskMgmtClient) diff --git a/src/durabletask-preview/azext_durabletask_preview/commands.py b/src/durabletask-preview/azext_durabletask_preview/commands.py index 2c63a9f0c53..f1cc4a17e73 100644 --- a/src/durabletask-preview/azext_durabletask_preview/commands.py +++ b/src/durabletask-preview/azext_durabletask_preview/commands.py @@ -5,17 +5,17 @@ # pylint: disable=line-too-long from azure.cli.core.commands import CliCommandType -from azext_durabletask._client_factory import cf_durabletask_namespaces, cf_durabletask_taskhubs +from azext_durabletask_preview._client_factory import cf_durabletask_namespaces, cf_durabletask_taskhubs def load_command_table(self, _): durabletask_namespace_sdk = CliCommandType( - operations_tmpl='azext_durabletask.vendored_sdks.operations#NamespacesOperations.{}', + operations_tmpl='azext_durabletask_preview.vendored_sdks.operations#NamespacesOperations.{}', client_factory=cf_durabletask_namespaces) durabletask_taskhub_sdk = CliCommandType( - operations_tmpl='azext_durabletask.vendored_sdks.operations#TaskHubsOperations.{}', + operations_tmpl='azext_durabletask_preview.vendored_sdks.operations#TaskHubsOperations.{}', client_factory=cf_durabletask_taskhubs) with self.command_group('durabletask namespace', durabletask_namespace_sdk, client_factory=cf_durabletask_namespaces) as g: diff --git a/src/durabletask-preview/azext_durabletask_preview/custom.py b/src/durabletask-preview/azext_durabletask_preview/custom.py index aad0b1de152..e2f3474e392 100644 --- a/src/durabletask-preview/azext_durabletask_preview/custom.py +++ b/src/durabletask-preview/azext_durabletask_preview/custom.py @@ -4,8 +4,8 @@ # -------------------------------------------------------------------------------------------- from knack.util import CLIError -from azext_durabletask._client_factory import cf_durabletask_namespaces, cf_durabletask_taskhubs -from azext_durabletask.vendored_sdks.models import Namespace, TaskHub +from azext_durabletask_preview._client_factory import cf_durabletask_namespaces, cf_durabletask_taskhubs +from azext_durabletask_preview.vendored_sdks.models import Namespace, TaskHub # Namespace Operations diff --git a/src/durabletask-preview/setup.py b/src/durabletask-preview/setup.py index 27320163a9d..01f5abf6b6d 100644 --- a/src/durabletask-preview/setup.py +++ b/src/durabletask-preview/setup.py @@ -54,5 +54,5 @@ classifiers=CLASSIFIERS, packages=find_packages(), install_requires=DEPENDENCIES, - package_data={'azext_durabletask': ['azext_metadata.json']}, + package_data={'azext_durabletask_preview': ['azext_metadata.json']}, ) From 78ff50a1ca03e9108d4392c94b7d6f4d4b49c5df Mon Sep 17 00:00:00 2001 From: Ryan Lettieri Date: Tue, 10 Sep 2024 12:52:55 -0600 Subject: [PATCH 12/19] Changing custom response message for 409 error Signed-off-by: Ryan Lettieri --- .../vendored_sdks/operations/_task_hubs_operations.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/operations/_task_hubs_operations.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/operations/_task_hubs_operations.py index 4c2de7d0bbb..7092c996876 100644 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/operations/_task_hubs_operations.py +++ b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/operations/_task_hubs_operations.py @@ -8,6 +8,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys +import json from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse @@ -506,13 +507,16 @@ def create_or_update( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200, 201, 409]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("TaskHub", pipeline_response.http_response) + if response.status_code == 409: + deserialized.additional_properties["error"]["message"] = "ResourceCreationFailed: Cannot provision taskhub while namespace provisioning pending" + if cls: return cls(pipeline_response, deserialized, {}) # type: ignore From fa37d4aefb2beb849a9b140b4687bc9468064c31 Mon Sep 17 00:00:00 2001 From: Ryan Lettieri Date: Tue, 10 Sep 2024 15:02:41 -0600 Subject: [PATCH 13/19] Updating input params and help tooltips to show required params Signed-off-by: Ryan Lettieri --- .../azext_durabletask_preview/_params.py | 5 +++-- .../azext_durabletask_preview/custom.py | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/durabletask-preview/azext_durabletask_preview/_params.py b/src/durabletask-preview/azext_durabletask_preview/_params.py index dfde033d616..f81bec6892f 100644 --- a/src/durabletask-preview/azext_durabletask_preview/_params.py +++ b/src/durabletask-preview/azext_durabletask_preview/_params.py @@ -23,7 +23,7 @@ def load_arguments(self, _): c.argument('namespace_name', durabletask_name_type, options_list=['--name', '-n']) with self.argument_context('durabletask list') as c: - c.argument('durabletask_name', durabletask_name_type, id_part=None) + c.argument('resource_group_name', durabletask_rg_type, options_list=['--resource-group', '-g'], id_part=None) # Namespace Commands with self.argument_context('durabletask namespace delete') as c: @@ -39,7 +39,8 @@ def load_arguments(self, _): c.argument('task_hub_name', durabletask_taskhub_type, options_list=['--task-hub-name', '-t']) with self.argument_context('durabletask taskhub create') as c: - c.argument('task_hub_name', durabletask_taskhub_type, options_list=['--task-hub-name', '-t']) + c.argument('task_hub_name', durabletask_taskhub_type, options_list=['--task-hub-name', '-n']) + c.argument('namespace_name', durabletask_namespace_type, options_list=['--namespace', '-s'], id_part=None) with self.argument_context('durabletask taskhub delete') as c: c.argument('task_hub_name', durabletask_taskhub_type, options_list=['--task-hub-name', '-t']) diff --git a/src/durabletask-preview/azext_durabletask_preview/custom.py b/src/durabletask-preview/azext_durabletask_preview/custom.py index e2f3474e392..fd9b07c558d 100644 --- a/src/durabletask-preview/azext_durabletask_preview/custom.py +++ b/src/durabletask-preview/azext_durabletask_preview/custom.py @@ -14,7 +14,7 @@ def create_namespace(cmd, client, resource_group_name, namespace_name, location= return client.begin_create_or_update(resource_group_name, namespace_name, resource=Namespace(location=location)) -def list_namespace(cmd, client, resource_group_name=None): +def list_namespace(cmd, client, resource_group_name): client = cf_durabletask_namespaces(cmd.cli_ctx) return client.list_by_resource_group(resource_group_name=resource_group_name) @@ -34,13 +34,13 @@ def update_namespace(cmd, instance): # Taskhub Operations -def create_taskhub(cmd, client, resource_group_name, namespace_name, task_hub_name, location=None): +def create_taskhub(cmd, client, resource_group_name, namespace_name, task_hub_name): client = cf_durabletask_taskhubs(cmd.cli_ctx) return client.create_or_update(resource_group_name, namespace_name, task_hub_name, - resource=TaskHub(location=location)) + resource=TaskHub()) -def list_taskhub(cmd, client, resource_group_name, namespace_name=None): +def list_taskhub(cmd, client, resource_group_name, namespace_name): client = cf_durabletask_taskhubs(cmd.cli_ctx) return client.list_by_namespace(resource_group_name=resource_group_name, namespace_name=namespace_name) From 2e85af9dfa119e836c0e75be649c17ecfadda18b Mon Sep 17 00:00:00 2001 From: Ryan Lettieri Date: Thu, 12 Sep 2024 08:43:23 -0600 Subject: [PATCH 14/19] Updating CODEOWNERS Signed-off-by: Ryan Lettieri --- .github/CODEOWNERS | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 7bdfa03163a..765f2164765 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -325,8 +325,5 @@ /src/mdp/ @ajaykn /src/azext_gallery-service-artifact/ @rohitbhoopalam -/src/azext_durable-task-service/ @RyanLettieri -/src/azext_durabletask/ @RyanLettieri -/src/azext_durabletask/ @RyanLettieri -/src/azext_durable-task-service/ @RyanLettieri -/src/azext_durabletask/ @RyanLettieri + +/src/azext_durabletask-preview/ @RyanLettieri From bb6b73724e7dfb7641e96bfe6edb7e354f8b0fe7 Mon Sep 17 00:00:00 2001 From: Ryan Lettieri Date: Fri, 13 Sep 2024 09:57:18 -0600 Subject: [PATCH 15/19] Regenerating entire extension using tool Signed-off-by: Ryan Lettieri --- src/durabletask-preview/README.rst | 5 - .../_client_factory.py | 17 - .../azext_durabletask_preview/_help.py | 64 - .../azext_durabletask_preview/_params.py | 46 - .../azext_durabletask_preview/_validators.py | 21 - .../azext_metadata.json | 5 - .../azext_durabletask_preview/commands.py | 36 - .../azext_durabletask_preview/custom.py | 60 - .../latest/recordings/test_durabletask.yaml | 645 -- .../vendored_sdks/__init__.py | 26 - .../vendored_sdks/_configuration.py | 65 - .../vendored_sdks/_durabletask_mgmt_client.py | 118 - .../vendored_sdks/_patch.py | 20 - .../vendored_sdks/_serialization.py | 2000 ----- .../vendored_sdks/aio/__init__.py | 23 - .../vendored_sdks/aio/_configuration.py | 65 - .../aio/_durabletask_mgmt_client.py | 120 - .../vendored_sdks/aio/_patch.py | 20 - .../vendored_sdks/aio/operations/__init__.py | 23 - .../aio/operations/_namespaces_operations.py | 793 -- .../aio/operations/_operations.py | 130 - .../vendored_sdks/aio/operations/_patch.py | 20 - .../aio/operations/_task_hubs_operations.py | 548 -- .../vendored_sdks/authoring/__init__.py | 19 - .../vendored_sdks/authoring/_configuration.py | 47 - .../authoring/_luis_authoring_client.py | 90 - .../authoring/models/__init__.py | 346 - .../models/_luis_authoring_client_enums.py | 25 - .../vendored_sdks/authoring/models/_models.py | 3333 -------- .../authoring/models/_models_py3.py | 3333 -------- .../authoring/operations/__init__.py | 32 - .../authoring/operations/_apps_operations.py | 1397 ---- .../operations/_azure_accounts_operations.py | 296 - .../operations/_examples_operations.py | 304 - .../operations/_features_operations.py | 557 -- .../authoring/operations/_model_operations.py | 7086 ----------------- .../operations/_pattern_operations.py | 550 -- .../operations/_settings_operations.py | 156 - .../authoring/operations/_train_operations.py | 158 - .../operations/_versions_operations.py | 705 -- .../vendored_sdks/models/__init__.py | 63 - .../models/_durabletask_mgmt_client_enums.py | 54 - .../vendored_sdks/models/_models_py3.py | 730 -- .../vendored_sdks/models/_patch.py | 20 - .../vendored_sdks/operations/__init__.py | 23 - .../operations/_namespaces_operations.py | 972 --- .../vendored_sdks/operations/_operations.py | 152 - .../vendored_sdks/operations/_patch.py | 20 - .../operations/_task_hubs_operations.py | 721 -- .../vendored_sdks/py.typed | 1 - .../vendored_sdks/version.py | 12 - src/durabletask-preview/setup.cfg | 0 .../HISTORY.rst | 0 src/durabletask/README.md | 5 + .../azext_durabletask}/__init__.py | 30 +- src/durabletask/azext_durabletask/_help.py | 11 + src/durabletask/azext_durabletask/_params.py | 13 + .../azext_durabletask/aaz}/__init__.py | 9 +- .../azext_durabletask/aaz/latest/__init__.py} | 13 +- .../aaz/latest/durabletask/__cmd_group.py | 24 + .../aaz/latest/durabletask/__init__.py | 11 + .../durabletask/namespace/__cmd_group.py | 24 + .../latest/durabletask/namespace/__init__.py | 17 + .../latest/durabletask/namespace/_create.py | 302 + .../latest/durabletask/namespace/_delete.py | 165 + .../aaz/latest/durabletask/namespace/_list.py | 378 + .../aaz/latest/durabletask/namespace/_show.py | 226 + .../latest/durabletask/namespace/_update.py | 444 ++ .../aaz/latest/durabletask/namespace/_wait.py | 224 + .../latest/durabletask/taskhub/__cmd_group.py | 24 + .../latest/durabletask/taskhub/__init__.py | 16 + .../aaz/latest/durabletask/taskhub/_create.py | 251 + .../aaz/latest/durabletask/taskhub/_delete.py | 154 + .../aaz/latest/durabletask/taskhub/_list.py | 222 + .../aaz/latest/durabletask/taskhub/_show.py | 223 + .../aaz/latest/durabletask/taskhub/_update.py | 402 + .../azext_durabletask/azext_metadata.json | 4 + .../azext_durabletask/commands.py} | 15 +- src/durabletask/azext_durabletask/custom.py | 14 + .../azext_durabletask/tests}/__init__.py | 9 +- .../tests/latest/__init__.py | 6 + .../tests/latest/test_durabletask.py} | 18 +- src/durabletask/setup.cfg | 1 + .../setup.py | 35 +- 84 files changed, 3227 insertions(+), 26135 deletions(-) delete mode 100644 src/durabletask-preview/README.rst delete mode 100644 src/durabletask-preview/azext_durabletask_preview/_client_factory.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/_help.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/_params.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/_validators.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/azext_metadata.json delete mode 100644 src/durabletask-preview/azext_durabletask_preview/commands.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/custom.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/tests/latest/recordings/test_durabletask.yaml delete mode 100644 src/durabletask-preview/azext_durabletask_preview/vendored_sdks/__init__.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/vendored_sdks/_configuration.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/vendored_sdks/_durabletask_mgmt_client.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/vendored_sdks/_patch.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/vendored_sdks/_serialization.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/__init__.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/_configuration.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/_durabletask_mgmt_client.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/_patch.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/operations/__init__.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/operations/_namespaces_operations.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/operations/_operations.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/operations/_patch.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/operations/_task_hubs_operations.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/__init__.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/_configuration.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/_luis_authoring_client.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/models/__init__.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/models/_luis_authoring_client_enums.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/models/_models.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/models/_models_py3.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/__init__.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_apps_operations.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_azure_accounts_operations.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_examples_operations.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_features_operations.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_model_operations.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_pattern_operations.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_settings_operations.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_train_operations.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_versions_operations.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/vendored_sdks/models/__init__.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/vendored_sdks/models/_durabletask_mgmt_client_enums.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/vendored_sdks/models/_models_py3.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/vendored_sdks/models/_patch.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/vendored_sdks/operations/__init__.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/vendored_sdks/operations/_namespaces_operations.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/vendored_sdks/operations/_operations.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/vendored_sdks/operations/_patch.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/vendored_sdks/operations/_task_hubs_operations.py delete mode 100644 src/durabletask-preview/azext_durabletask_preview/vendored_sdks/py.typed delete mode 100644 src/durabletask-preview/azext_durabletask_preview/vendored_sdks/version.py delete mode 100644 src/durabletask-preview/setup.cfg rename src/{durabletask-preview => durabletask}/HISTORY.rst (100%) create mode 100644 src/durabletask/README.md rename src/{durabletask-preview/azext_durabletask_preview => durabletask/azext_durabletask}/__init__.py (50%) create mode 100644 src/durabletask/azext_durabletask/_help.py create mode 100644 src/durabletask/azext_durabletask/_params.py rename src/{durabletask-preview/azext_durabletask_preview/tests => durabletask/azext_durabletask/aaz}/__init__.py (66%) rename src/{durabletask-preview/azext_durabletask_preview/vendored_sdks/_version.py => durabletask/azext_durabletask/aaz/latest/__init__.py} (58%) create mode 100644 src/durabletask/azext_durabletask/aaz/latest/durabletask/__cmd_group.py create mode 100644 src/durabletask/azext_durabletask/aaz/latest/durabletask/__init__.py create mode 100644 src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/__cmd_group.py create mode 100644 src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/__init__.py create mode 100644 src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/_create.py create mode 100644 src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/_delete.py create mode 100644 src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/_list.py create mode 100644 src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/_show.py create mode 100644 src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/_update.py create mode 100644 src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/_wait.py create mode 100644 src/durabletask/azext_durabletask/aaz/latest/durabletask/taskhub/__cmd_group.py create mode 100644 src/durabletask/azext_durabletask/aaz/latest/durabletask/taskhub/__init__.py create mode 100644 src/durabletask/azext_durabletask/aaz/latest/durabletask/taskhub/_create.py create mode 100644 src/durabletask/azext_durabletask/aaz/latest/durabletask/taskhub/_delete.py create mode 100644 src/durabletask/azext_durabletask/aaz/latest/durabletask/taskhub/_list.py create mode 100644 src/durabletask/azext_durabletask/aaz/latest/durabletask/taskhub/_show.py create mode 100644 src/durabletask/azext_durabletask/aaz/latest/durabletask/taskhub/_update.py create mode 100644 src/durabletask/azext_durabletask/azext_metadata.json rename src/{durabletask-preview/azext_durabletask_preview/tests/latest/test_durabletask_scenario.py => durabletask/azext_durabletask/commands.py} (58%) create mode 100644 src/durabletask/azext_durabletask/custom.py rename src/{durabletask-preview/azext_durabletask_preview/tests/latest => durabletask/azext_durabletask/tests}/__init__.py (66%) create mode 100644 src/durabletask/azext_durabletask/tests/latest/__init__.py rename src/{durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/version.py => durabletask/azext_durabletask/tests/latest/test_durabletask.py} (51%) create mode 100644 src/durabletask/setup.cfg rename src/{durabletask-preview => durabletask}/setup.py (60%) diff --git a/src/durabletask-preview/README.rst b/src/durabletask-preview/README.rst deleted file mode 100644 index ab16c2c57aa..00000000000 --- a/src/durabletask-preview/README.rst +++ /dev/null @@ -1,5 +0,0 @@ -Microsoft Azure CLI 'durabletask' Extension -========================================== - -This package is for the 'durabletask' extension. -i.e. 'az durabletask' \ No newline at end of file diff --git a/src/durabletask-preview/azext_durabletask_preview/_client_factory.py b/src/durabletask-preview/azext_durabletask_preview/_client_factory.py deleted file mode 100644 index 101a51c3229..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/_client_factory.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - -def cf_durabletask(cli_ctx, *_): - from azure.cli.core.commands.client_factory import get_mgmt_service_client - from azext_durabletask_preview.vendored_sdks import DurabletaskMgmtClient - return get_mgmt_service_client(cli_ctx, DurabletaskMgmtClient) - - -def cf_durabletask_namespaces(cli_ctx, *_): - return cf_durabletask(cli_ctx).namespaces - - -def cf_durabletask_taskhubs(cli_ctx, *_): - return cf_durabletask(cli_ctx).task_hubs diff --git a/src/durabletask-preview/azext_durabletask_preview/_help.py b/src/durabletask-preview/azext_durabletask_preview/_help.py deleted file mode 100644 index ff40e4410bf..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/_help.py +++ /dev/null @@ -1,64 +0,0 @@ -# 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. -# -------------------------------------------------------------------------------------------- - -from knack.help_files import helps # pylint: disable=unused-import - - -helps['durabletask'] = """ - type: group - short-summary: Commands to manage Durabletasks. -""" - -helps['durabletask namespace'] = """ - type: group - short-summary: Commands to manage Durabletask namespaces. -""" - -helps['durabletask namespace create'] = """ - type: command - short-summary: Create a Durabletask namespace. -""" - -helps['durabletask namespace list'] = """ - type: command - short-summary: List Durabletasks namespaces. -""" - -helps['durabletask namespace show'] = """ - type: command - short-summary: Show details of a Durabletask namespace. -""" - -helps['durabletask namespace delete'] = """ - type: command - short-summary: Delete a Durabletask namespace. -""" - - -helps['durabletask taskhub'] = """ - type: group - short-summary: Commands to manage Durabletask taskhubs. -""" - -helps['durabletask taskhub create'] = """ - type: command - short-summary: Create a Durabletask taskhub. -""" - -helps['durabletask taskhub delete'] = """ - type: command - short-summary: Delete a Durabletask taskhub. -""" - -helps['durabletask taskhub list'] = """ - type: command - short-summary: List Durabletask taskhubs. -""" - -helps['durabletask taskhub show'] = """ - type: command - short-summary: Show details of a Durabletask taskhub. -""" diff --git a/src/durabletask-preview/azext_durabletask_preview/_params.py b/src/durabletask-preview/azext_durabletask_preview/_params.py deleted file mode 100644 index f81bec6892f..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/_params.py +++ /dev/null @@ -1,46 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# pylint: disable=line-too-long - -from knack.arguments import CLIArgumentType - - -def load_arguments(self, _): - - from azure.cli.core.commands.parameters import tags_type - from azure.cli.core.commands.validators import get_default_location_from_resource_group - - durabletask_name_type = CLIArgumentType(options_list='--durabletask-name-name', help='Name of the Durabletask.', id_part='name') - durabletask_rg_type = CLIArgumentType(options_list='--durabletask-rg-name', help='Name of the Resource Group.', id_part='name') - durabletask_taskhub_type = CLIArgumentType(options_list='--durabletask-taskhub-name', help='Name of the Taskhub.', id_part='name') - durabletask_namespace_type = CLIArgumentType(options_list='--durabletask-namespace-name', help='Name of the Namespace.', id_part='name') - - with self.argument_context('durabletask') as c: - c.argument('tags', tags_type) - c.argument('location', validator=get_default_location_from_resource_group) - c.argument('namespace_name', durabletask_name_type, options_list=['--name', '-n']) - - with self.argument_context('durabletask list') as c: - c.argument('resource_group_name', durabletask_rg_type, options_list=['--resource-group', '-g'], id_part=None) - - # Namespace Commands - with self.argument_context('durabletask namespace delete') as c: - c.argument('namespace_name', durabletask_namespace_type, options_list=['--name', '-n']) - - # Taskhub Commands - with self.argument_context('durabletask taskhub list') as c: - c.argument('namespace_name', durabletask_namespace_type, options_list=['--name', '-n'], id_part=None) - c.argument('resource_group_name', durabletask_rg_type, options_list=['--resource-group', '-g'], id_part=None) - - with self.argument_context('durabletask taskhub show') as c: - c.argument('namespace_name', durabletask_namespace_type, options_list=['--name', '-n']) - c.argument('task_hub_name', durabletask_taskhub_type, options_list=['--task-hub-name', '-t']) - - with self.argument_context('durabletask taskhub create') as c: - c.argument('task_hub_name', durabletask_taskhub_type, options_list=['--task-hub-name', '-n']) - c.argument('namespace_name', durabletask_namespace_type, options_list=['--namespace', '-s'], id_part=None) - - with self.argument_context('durabletask taskhub delete') as c: - c.argument('task_hub_name', durabletask_taskhub_type, options_list=['--task-hub-name', '-t']) diff --git a/src/durabletask-preview/azext_durabletask_preview/_validators.py b/src/durabletask-preview/azext_durabletask_preview/_validators.py deleted file mode 100644 index 1395c3f7d19..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/_validators.py +++ /dev/null @@ -1,21 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - - -def example_name_or_id_validator(cmd, namespace): - # Example of a storage account name or ID validator. - # pylint: disable=line-too-long - # See: https://github.com/Azure/azure-cli/blob/dev/doc/authoring_command_modules/authoring_commands.md#supporting-name-or-id-parameters - from azure.cli.core.commands.client_factory import get_subscription_id - from msrestazure.tools import is_valid_resource_id, resource_id - if namespace.storage_account: - if not is_valid_resource_id(namespace.RESOURCE): - namespace.storage_account = resource_id( - subscription=get_subscription_id(cmd.cli_ctx), - resource_group=namespace.resource_group_name, - namespace='Microsoft.Storage', - type='storageAccounts', - name=namespace.storage_account - ) diff --git a/src/durabletask-preview/azext_durabletask_preview/azext_metadata.json b/src/durabletask-preview/azext_durabletask_preview/azext_metadata.json deleted file mode 100644 index 8169f3035ba..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/azext_metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "azext.isPreview": true, - "name": "durabletask-preview", - "azext.minCliCoreVersion": "2.0.67" -} \ No newline at end of file diff --git a/src/durabletask-preview/azext_durabletask_preview/commands.py b/src/durabletask-preview/azext_durabletask_preview/commands.py deleted file mode 100644 index f1cc4a17e73..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/commands.py +++ /dev/null @@ -1,36 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - -# pylint: disable=line-too-long -from azure.cli.core.commands import CliCommandType -from azext_durabletask_preview._client_factory import cf_durabletask_namespaces, cf_durabletask_taskhubs - - -def load_command_table(self, _): - - durabletask_namespace_sdk = CliCommandType( - operations_tmpl='azext_durabletask_preview.vendored_sdks.operations#NamespacesOperations.{}', - client_factory=cf_durabletask_namespaces) - - durabletask_taskhub_sdk = CliCommandType( - operations_tmpl='azext_durabletask_preview.vendored_sdks.operations#TaskHubsOperations.{}', - client_factory=cf_durabletask_taskhubs) - - with self.command_group('durabletask namespace', durabletask_namespace_sdk, client_factory=cf_durabletask_namespaces) as g: - g.custom_command('create', 'create_namespace') - g.custom_command('list', 'list_namespace') - g.custom_command('delete', 'delete_namespace') - g.custom_show_command('show', 'show_namespace') - # g.generic_update_command('update', setter_name='update', custom_func_name='update_namespace') - - with self.command_group('durabletask taskhub', durabletask_taskhub_sdk, client_factory=cf_durabletask_taskhubs) as g: - g.custom_command('create', 'create_taskhub') - g.custom_command('list', 'list_taskhub') - g.custom_command('delete', 'delete_taskhub') - g.custom_show_command('show', 'show_taskhub') - # g.generic_update_command('update', setter_name='update', custom_func_name='update_taskhub') - - with self.command_group('durabletask', is_preview=True): - pass diff --git a/src/durabletask-preview/azext_durabletask_preview/custom.py b/src/durabletask-preview/azext_durabletask_preview/custom.py deleted file mode 100644 index fd9b07c558d..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/custom.py +++ /dev/null @@ -1,60 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - -from knack.util import CLIError -from azext_durabletask_preview._client_factory import cf_durabletask_namespaces, cf_durabletask_taskhubs -from azext_durabletask_preview.vendored_sdks.models import Namespace, TaskHub - - -# Namespace Operations -def create_namespace(cmd, client, resource_group_name, namespace_name, location="northcentralus"): - client = cf_durabletask_namespaces(cmd.cli_ctx) - return client.begin_create_or_update(resource_group_name, namespace_name, resource=Namespace(location=location)) - - -def list_namespace(cmd, client, resource_group_name): - client = cf_durabletask_namespaces(cmd.cli_ctx) - return client.list_by_resource_group(resource_group_name=resource_group_name) - - -def show_namespace(cmd, client, resource_group_name=None, namespace_name=None): - client = cf_durabletask_namespaces(cmd.cli_ctx) - return client.get(resource_group_name=resource_group_name, namespace_name=namespace_name) - - -def delete_namespace(cmd, client, resource_group_name=None, namespace_name=None): - client = cf_durabletask_namespaces(cmd.cli_ctx) - return client.begin_delete(resource_group_name, namespace_name) - - -def update_namespace(cmd, instance): - raise CLIError('TODO: Implement `durabletask namespace update`') - - -# Taskhub Operations -def create_taskhub(cmd, client, resource_group_name, namespace_name, task_hub_name): - client = cf_durabletask_taskhubs(cmd.cli_ctx) - return client.create_or_update(resource_group_name, namespace_name, task_hub_name, - resource=TaskHub()) - - -def list_taskhub(cmd, client, resource_group_name, namespace_name): - client = cf_durabletask_taskhubs(cmd.cli_ctx) - return client.list_by_namespace(resource_group_name=resource_group_name, namespace_name=namespace_name) - - -def show_taskhub(cmd, client, resource_group_name, namespace_name=None, task_hub_name=None): - client = cf_durabletask_taskhubs(cmd.cli_ctx) - return client.get(resource_group_name=resource_group_name, namespace_name=namespace_name, - task_hub_name=task_hub_name) - - -def delete_taskhub(cmd, client, resource_group_name, namespace_name, task_hub_name): - client = cf_durabletask_taskhubs(cmd.cli_ctx) - return client.delete(resource_group_name, namespace_name, task_hub_name) - - -def update_taskhub(cmd, instance): - raise CLIError('TODO: Implement `durabletask taskhub update`') diff --git a/src/durabletask-preview/azext_durabletask_preview/tests/latest/recordings/test_durabletask.yaml b/src/durabletask-preview/azext_durabletask_preview/tests/latest/recordings/test_durabletask.yaml deleted file mode 100644 index c94e38392da..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/tests/latest/recordings/test_durabletask.yaml +++ /dev/null @@ -1,645 +0,0 @@ -interactions: -- request: - body: '{"location": "northcentralus"}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - durabletask namespace create - Connection: - - keep-alive - Content-Length: - - '30' - Content-Type: - - application/json - ParameterSetName: - - -g -n - User-Agent: - - AZURECLI/2.64.0 azsdk-python-core/1.28.0 Python/3.11.6 (Linux-5.15.153.1-microsoft-standard-WSL2-x86_64-with-glibc2.35) - method: PUT - uri: https://eastus2euap.management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_durabletask000001/providers/Microsoft.DurableTask/namespaces/test1?api-version=2024-02-01-preview - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_durabletask000001/providers/Microsoft.DurableTask/namespaces/test1","name":"test1","type":"microsoft.durabletask/namespaces","location":"northcentralus","systemData":{"createdBy":"ryanlettieri@microsoft.com","createdByType":"User","createdAt":"2024-09-05T17:49:36.205274Z","lastModifiedBy":"ryanlettieri@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2024-09-05T17:49:36.205274Z"},"properties":{"provisioningState":"Accepted","url":"test1-a7c8a9bwdvah.northcentralus.durabletask.io","dashboardUrl":"test1-a7c8a9bwdvah-db.northcentralus.durabletask.io","ipAllowlist":[]}}' - headers: - azure-asyncoperation: - - https://eastus2euap.management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96?api-version=2024-02-01-preview&t=638611553773460250&c=MIIHhjCCBm6gAwIBAgITHgUK3uZNXW0rELEWgAAABQre5jANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDYwHhcNMjQwNzI3MTIwMjAwWhcNMjQxMDI1MTIwMjAwWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALOp9mTbesFKlLY5kaubRq1NFmzMIRssJxSdGLLsTSNZCUTbJ7ozK0IiDfLVQCXyBqGrO3PYMBmeJEMdtKRsd00pJzflYkIE7nnXJBFw-sTxMSt4zsLsbXBMl4dGzNmrGZkYRrhFOSLC122KClMAs8DXhEcJU2_mol-1pxp42MCiq4jkKicedYt3GlUvVl3uSJyeiHw77qxa3x0QbuUm1DszpHTwyHp3x4hfUAwS6TWrZ929rowQ1y96k1x7RKmAIwamEzeg79Q5rsuLDW7yTX3Pg7sp7h3hbBjXeToCLa31ndkNFF9aoSLU3O-xO177GGKO6lhbIpHECNAaCtrFp6ECAwEAAaOCBHMwggRvMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwIwCgYIKwYBBQUHAwEwPAYJKwYBBAGCNxUHBC8wLQYlKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFgh8fIENbYcQIBZAIBBjCCAcsGCCsGAQUFBwEBBIIBvTCCAbkwYwYIKwYBBQUHMAKGV2h0dHA6Ly9jcmwubWljcm9zb2Z0LmNvbS9wa2lpbmZyYS9DZXJ0cy9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDEuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmwyLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MFMGCCsGAQUFBzAChkdodHRwOi8vY3JsMy5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDQuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwHQYDVR0OBBYEFOL38Ka708l__wglsKzbwvptKgiNMA4GA1UdDwEB_wQEAwIFoDCCASYGA1UdHwSCAR0wggEZMIIBFaCCARGgggENhj9odHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ1JML0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwxLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwyLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwzLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmw0LmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmwwgZ0GA1UdIASBlTCBkjAMBgorBgEEAYI3ewEBMGYGCisGAQQBgjd7AgIwWDBWBggrBgEFBQcCAjBKHkgAMwAzAGUAMAAxADkAMgAxAC0ANABkADYANAAtADQAZgA4AGMALQBhADAANQA1AC0ANQBiAGQAYQBmAGYAZAA1AGUAMwAzAGQwDAYKKwYBBAGCN3sDATAMBgorBgEEAYI3ewQBMB8GA1UdIwQYMBaAFPFGaMbxw_ArLX2LauGy-b41_NFBMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATANBgkqhkiG9w0BAQsFAAOCAQEAOjvtmgGG_gQTCeRcW03oj3kuNjkaOoixOTlz3lAC2IQY_-4SRz6Y1-eEdGjDgSL5trZKjpas64eIIdZzKfAeRUiIfIQHFtlEGG-nOH9acyDkUY04bgQhSkkQ7vkiLB95C7sAKLweobXMkBlMNjBNGbJkY_9bCVP_Qgv3ACF5VfFnpj76iqtgNm3IMgoKQWsFliPj6UF8bkP0y2e-hZWKSWTeQIqDscIjvCXo-CAkMzJ7twtIAzttmQQ3UKLeI2kWwO4ZKOFoczpWVNJXtOAk155DuJIZL-A2nNR9xirNPNwpZlKaBwaek91rnTFgaOTCCrG2DFXpg97eI6UL0RrLKQ&s=VramQI0NrVWH41AUWl06xCxbcvI9gdTM-WZOwmcw2_-VLytdhGIYjPH8dfIZ51nFVp_0r02xqxnh3L2IxWPYC8NdWZI3bPPLcAXYNvxWpyax3qkf6hYfWVO36FsePIl4hyUN9DZ5A30y22ayrEoFnkMpm45h881nbtYXPCVulPX51cHG5p7UfoVu_HcRWrfcnlIRuX9tl4gVntZNdXDrNC42BUKjOQXmxfw96jNKOXVNa1S-b4cs2Alj5fZfVAFbmQExO2MCmmNXldZO9aN8NzxLXxZujviFWPcsFwR5-XKgU3SG0C7pA2WGRJqO9VW58gpv71SViad5KMXFqG4jKg&h=ProYQfUxtt5Nar3hDS_12XaCjhZGqlr-9OEA94kmTt4 - cache-control: - - no-cache - content-length: - - '667' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 05 Sep 2024 17:49:37 GMT - etag: - - '"9d005f51-0000-0100-0000-66d9ef310000"' - expires: - - '-1' - mise-correlation-id: - - 875e4860-4de3-4e8b-bc99-14c5e07f0667 - pragma: - - no-cache - set-cookie: - - ARRAffinity=11ce3e72138d4e8ebd1b72edb2b2329aa47554461f6e881b00a82375fc261f2c;Path=/;HttpOnly;Secure;Domain=azapi-rp-dts-prod-northcentralus.ase-dts-prod-northcentralus.p.azurewebsites.net - - ARRAffinitySameSite=11ce3e72138d4e8ebd1b72edb2b2329aa47554461f6e881b00a82375fc261f2c;Path=/;HttpOnly;SameSite=None;Secure;Domain=azapi-rp-dts-prod-northcentralus.ase-dts-prod-northcentralus.p.azurewebsites.net - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-cache: - - CONFIG_NOCACHE - x-content-type-options: - - nosniff - x-ms-operation-identifier: - - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=c065741a-65a3-4502-b9c0-547929546b6f/eastus2euap/873c222b-e7cf-4438-a24e-81be8ec5d036 - x-ms-providerhub-traffic: - - 'True' - x-ms-ratelimit-remaining-subscription-writes: - - '1198' - x-msedge-ref: - - 'Ref A: 0B872E4FC4A14DFF902149142588C13C Ref B: DM2EDGE0813 Ref C: 2024-09-05T17:49:34Z' - x-powered-by: - - ASP.NET - status: - code: 201 - message: Created -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - durabletask namespace create - Connection: - - keep-alive - ParameterSetName: - - -g -n - User-Agent: - - AZURECLI/2.64.0 azsdk-python-core/1.28.0 Python/3.11.6 (Linux-5.15.153.1-microsoft-standard-WSL2-x86_64-with-glibc2.35) - method: GET - uri: https://eastus2euap.management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96?api-version=2024-02-01-preview&t=638611553773460250&c=MIIHhjCCBm6gAwIBAgITHgUK3uZNXW0rELEWgAAABQre5jANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDYwHhcNMjQwNzI3MTIwMjAwWhcNMjQxMDI1MTIwMjAwWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALOp9mTbesFKlLY5kaubRq1NFmzMIRssJxSdGLLsTSNZCUTbJ7ozK0IiDfLVQCXyBqGrO3PYMBmeJEMdtKRsd00pJzflYkIE7nnXJBFw-sTxMSt4zsLsbXBMl4dGzNmrGZkYRrhFOSLC122KClMAs8DXhEcJU2_mol-1pxp42MCiq4jkKicedYt3GlUvVl3uSJyeiHw77qxa3x0QbuUm1DszpHTwyHp3x4hfUAwS6TWrZ929rowQ1y96k1x7RKmAIwamEzeg79Q5rsuLDW7yTX3Pg7sp7h3hbBjXeToCLa31ndkNFF9aoSLU3O-xO177GGKO6lhbIpHECNAaCtrFp6ECAwEAAaOCBHMwggRvMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwIwCgYIKwYBBQUHAwEwPAYJKwYBBAGCNxUHBC8wLQYlKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFgh8fIENbYcQIBZAIBBjCCAcsGCCsGAQUFBwEBBIIBvTCCAbkwYwYIKwYBBQUHMAKGV2h0dHA6Ly9jcmwubWljcm9zb2Z0LmNvbS9wa2lpbmZyYS9DZXJ0cy9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDEuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmwyLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MFMGCCsGAQUFBzAChkdodHRwOi8vY3JsMy5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDQuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwHQYDVR0OBBYEFOL38Ka708l__wglsKzbwvptKgiNMA4GA1UdDwEB_wQEAwIFoDCCASYGA1UdHwSCAR0wggEZMIIBFaCCARGgggENhj9odHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ1JML0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwxLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwyLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwzLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmw0LmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmwwgZ0GA1UdIASBlTCBkjAMBgorBgEEAYI3ewEBMGYGCisGAQQBgjd7AgIwWDBWBggrBgEFBQcCAjBKHkgAMwAzAGUAMAAxADkAMgAxAC0ANABkADYANAAtADQAZgA4AGMALQBhADAANQA1AC0ANQBiAGQAYQBmAGYAZAA1AGUAMwAzAGQwDAYKKwYBBAGCN3sDATAMBgorBgEEAYI3ewQBMB8GA1UdIwQYMBaAFPFGaMbxw_ArLX2LauGy-b41_NFBMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATANBgkqhkiG9w0BAQsFAAOCAQEAOjvtmgGG_gQTCeRcW03oj3kuNjkaOoixOTlz3lAC2IQY_-4SRz6Y1-eEdGjDgSL5trZKjpas64eIIdZzKfAeRUiIfIQHFtlEGG-nOH9acyDkUY04bgQhSkkQ7vkiLB95C7sAKLweobXMkBlMNjBNGbJkY_9bCVP_Qgv3ACF5VfFnpj76iqtgNm3IMgoKQWsFliPj6UF8bkP0y2e-hZWKSWTeQIqDscIjvCXo-CAkMzJ7twtIAzttmQQ3UKLeI2kWwO4ZKOFoczpWVNJXtOAk155DuJIZL-A2nNR9xirNPNwpZlKaBwaek91rnTFgaOTCCrG2DFXpg97eI6UL0RrLKQ&s=VramQI0NrVWH41AUWl06xCxbcvI9gdTM-WZOwmcw2_-VLytdhGIYjPH8dfIZ51nFVp_0r02xqxnh3L2IxWPYC8NdWZI3bPPLcAXYNvxWpyax3qkf6hYfWVO36FsePIl4hyUN9DZ5A30y22ayrEoFnkMpm45h881nbtYXPCVulPX51cHG5p7UfoVu_HcRWrfcnlIRuX9tl4gVntZNdXDrNC42BUKjOQXmxfw96jNKOXVNa1S-b4cs2Alj5fZfVAFbmQExO2MCmmNXldZO9aN8NzxLXxZujviFWPcsFwR5-XKgU3SG0C7pA2WGRJqO9VW58gpv71SViad5KMXFqG4jKg&h=ProYQfUxtt5Nar3hDS_12XaCjhZGqlr-9OEA94kmTt4 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","name":"dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_durabletask000001/providers/Microsoft.DurableTask/namespaces/test1","status":"Accepted","startTime":"2024-09-05T17:49:36.8327173Z"}' - headers: - cache-control: - - no-cache - content-length: - - '569' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 05 Sep 2024 17:49:37 GMT - etag: - - '"b7003d3c-0000-0100-0000-66d9ef300000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE - x-content-type-options: - - nosniff - x-ms-operation-identifier: - - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=c065741a-65a3-4502-b9c0-547929546b6f/eastus2euap/bc8c825b-dff3-45c9-b31c-205df1a4b034 - x-msedge-ref: - - 'Ref A: 58D4B06F062A43E3BD0F9A7E0E74D6F4 Ref B: DM2EDGE0813 Ref C: 2024-09-05T17:49:37Z' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - durabletask namespace create - Connection: - - keep-alive - ParameterSetName: - - -g -n - User-Agent: - - AZURECLI/2.64.0 azsdk-python-core/1.28.0 Python/3.11.6 (Linux-5.15.153.1-microsoft-standard-WSL2-x86_64-with-glibc2.35) - method: GET - uri: https://eastus2euap.management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96?api-version=2024-02-01-preview&t=638611553773460250&c=MIIHhjCCBm6gAwIBAgITHgUK3uZNXW0rELEWgAAABQre5jANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDYwHhcNMjQwNzI3MTIwMjAwWhcNMjQxMDI1MTIwMjAwWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALOp9mTbesFKlLY5kaubRq1NFmzMIRssJxSdGLLsTSNZCUTbJ7ozK0IiDfLVQCXyBqGrO3PYMBmeJEMdtKRsd00pJzflYkIE7nnXJBFw-sTxMSt4zsLsbXBMl4dGzNmrGZkYRrhFOSLC122KClMAs8DXhEcJU2_mol-1pxp42MCiq4jkKicedYt3GlUvVl3uSJyeiHw77qxa3x0QbuUm1DszpHTwyHp3x4hfUAwS6TWrZ929rowQ1y96k1x7RKmAIwamEzeg79Q5rsuLDW7yTX3Pg7sp7h3hbBjXeToCLa31ndkNFF9aoSLU3O-xO177GGKO6lhbIpHECNAaCtrFp6ECAwEAAaOCBHMwggRvMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwIwCgYIKwYBBQUHAwEwPAYJKwYBBAGCNxUHBC8wLQYlKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFgh8fIENbYcQIBZAIBBjCCAcsGCCsGAQUFBwEBBIIBvTCCAbkwYwYIKwYBBQUHMAKGV2h0dHA6Ly9jcmwubWljcm9zb2Z0LmNvbS9wa2lpbmZyYS9DZXJ0cy9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDEuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmwyLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MFMGCCsGAQUFBzAChkdodHRwOi8vY3JsMy5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDQuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwHQYDVR0OBBYEFOL38Ka708l__wglsKzbwvptKgiNMA4GA1UdDwEB_wQEAwIFoDCCASYGA1UdHwSCAR0wggEZMIIBFaCCARGgggENhj9odHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ1JML0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwxLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwyLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwzLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmw0LmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmwwgZ0GA1UdIASBlTCBkjAMBgorBgEEAYI3ewEBMGYGCisGAQQBgjd7AgIwWDBWBggrBgEFBQcCAjBKHkgAMwAzAGUAMAAxADkAMgAxAC0ANABkADYANAAtADQAZgA4AGMALQBhADAANQA1AC0ANQBiAGQAYQBmAGYAZAA1AGUAMwAzAGQwDAYKKwYBBAGCN3sDATAMBgorBgEEAYI3ewQBMB8GA1UdIwQYMBaAFPFGaMbxw_ArLX2LauGy-b41_NFBMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATANBgkqhkiG9w0BAQsFAAOCAQEAOjvtmgGG_gQTCeRcW03oj3kuNjkaOoixOTlz3lAC2IQY_-4SRz6Y1-eEdGjDgSL5trZKjpas64eIIdZzKfAeRUiIfIQHFtlEGG-nOH9acyDkUY04bgQhSkkQ7vkiLB95C7sAKLweobXMkBlMNjBNGbJkY_9bCVP_Qgv3ACF5VfFnpj76iqtgNm3IMgoKQWsFliPj6UF8bkP0y2e-hZWKSWTeQIqDscIjvCXo-CAkMzJ7twtIAzttmQQ3UKLeI2kWwO4ZKOFoczpWVNJXtOAk155DuJIZL-A2nNR9xirNPNwpZlKaBwaek91rnTFgaOTCCrG2DFXpg97eI6UL0RrLKQ&s=VramQI0NrVWH41AUWl06xCxbcvI9gdTM-WZOwmcw2_-VLytdhGIYjPH8dfIZ51nFVp_0r02xqxnh3L2IxWPYC8NdWZI3bPPLcAXYNvxWpyax3qkf6hYfWVO36FsePIl4hyUN9DZ5A30y22ayrEoFnkMpm45h881nbtYXPCVulPX51cHG5p7UfoVu_HcRWrfcnlIRuX9tl4gVntZNdXDrNC42BUKjOQXmxfw96jNKOXVNa1S-b4cs2Alj5fZfVAFbmQExO2MCmmNXldZO9aN8NzxLXxZujviFWPcsFwR5-XKgU3SG0C7pA2WGRJqO9VW58gpv71SViad5KMXFqG4jKg&h=ProYQfUxtt5Nar3hDS_12XaCjhZGqlr-9OEA94kmTt4 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","name":"dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_durabletask000001/providers/Microsoft.DurableTask/namespaces/test1","status":"Accepted","startTime":"2024-09-05T17:49:36.8327173Z"}' - headers: - cache-control: - - no-cache - content-length: - - '569' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 05 Sep 2024 17:50:07 GMT - etag: - - '"b7003d3c-0000-0100-0000-66d9ef300000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE - x-content-type-options: - - nosniff - x-ms-operation-identifier: - - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=c065741a-65a3-4502-b9c0-547929546b6f/eastus2euap/8b06fb16-d4ab-4d0e-911e-398ab7716d3d - x-msedge-ref: - - 'Ref A: A879D2EE736C458CB9CD225459D3BAC8 Ref B: DM2EDGE0813 Ref C: 2024-09-05T17:50:07Z' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - durabletask namespace create - Connection: - - keep-alive - ParameterSetName: - - -g -n - User-Agent: - - AZURECLI/2.64.0 azsdk-python-core/1.28.0 Python/3.11.6 (Linux-5.15.153.1-microsoft-standard-WSL2-x86_64-with-glibc2.35) - method: GET - uri: https://eastus2euap.management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96?api-version=2024-02-01-preview&t=638611553773460250&c=MIIHhjCCBm6gAwIBAgITHgUK3uZNXW0rELEWgAAABQre5jANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDYwHhcNMjQwNzI3MTIwMjAwWhcNMjQxMDI1MTIwMjAwWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALOp9mTbesFKlLY5kaubRq1NFmzMIRssJxSdGLLsTSNZCUTbJ7ozK0IiDfLVQCXyBqGrO3PYMBmeJEMdtKRsd00pJzflYkIE7nnXJBFw-sTxMSt4zsLsbXBMl4dGzNmrGZkYRrhFOSLC122KClMAs8DXhEcJU2_mol-1pxp42MCiq4jkKicedYt3GlUvVl3uSJyeiHw77qxa3x0QbuUm1DszpHTwyHp3x4hfUAwS6TWrZ929rowQ1y96k1x7RKmAIwamEzeg79Q5rsuLDW7yTX3Pg7sp7h3hbBjXeToCLa31ndkNFF9aoSLU3O-xO177GGKO6lhbIpHECNAaCtrFp6ECAwEAAaOCBHMwggRvMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwIwCgYIKwYBBQUHAwEwPAYJKwYBBAGCNxUHBC8wLQYlKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFgh8fIENbYcQIBZAIBBjCCAcsGCCsGAQUFBwEBBIIBvTCCAbkwYwYIKwYBBQUHMAKGV2h0dHA6Ly9jcmwubWljcm9zb2Z0LmNvbS9wa2lpbmZyYS9DZXJ0cy9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDEuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmwyLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MFMGCCsGAQUFBzAChkdodHRwOi8vY3JsMy5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDQuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwHQYDVR0OBBYEFOL38Ka708l__wglsKzbwvptKgiNMA4GA1UdDwEB_wQEAwIFoDCCASYGA1UdHwSCAR0wggEZMIIBFaCCARGgggENhj9odHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ1JML0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwxLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwyLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwzLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmw0LmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmwwgZ0GA1UdIASBlTCBkjAMBgorBgEEAYI3ewEBMGYGCisGAQQBgjd7AgIwWDBWBggrBgEFBQcCAjBKHkgAMwAzAGUAMAAxADkAMgAxAC0ANABkADYANAAtADQAZgA4AGMALQBhADAANQA1AC0ANQBiAGQAYQBmAGYAZAA1AGUAMwAzAGQwDAYKKwYBBAGCN3sDATAMBgorBgEEAYI3ewQBMB8GA1UdIwQYMBaAFPFGaMbxw_ArLX2LauGy-b41_NFBMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATANBgkqhkiG9w0BAQsFAAOCAQEAOjvtmgGG_gQTCeRcW03oj3kuNjkaOoixOTlz3lAC2IQY_-4SRz6Y1-eEdGjDgSL5trZKjpas64eIIdZzKfAeRUiIfIQHFtlEGG-nOH9acyDkUY04bgQhSkkQ7vkiLB95C7sAKLweobXMkBlMNjBNGbJkY_9bCVP_Qgv3ACF5VfFnpj76iqtgNm3IMgoKQWsFliPj6UF8bkP0y2e-hZWKSWTeQIqDscIjvCXo-CAkMzJ7twtIAzttmQQ3UKLeI2kWwO4ZKOFoczpWVNJXtOAk155DuJIZL-A2nNR9xirNPNwpZlKaBwaek91rnTFgaOTCCrG2DFXpg97eI6UL0RrLKQ&s=VramQI0NrVWH41AUWl06xCxbcvI9gdTM-WZOwmcw2_-VLytdhGIYjPH8dfIZ51nFVp_0r02xqxnh3L2IxWPYC8NdWZI3bPPLcAXYNvxWpyax3qkf6hYfWVO36FsePIl4hyUN9DZ5A30y22ayrEoFnkMpm45h881nbtYXPCVulPX51cHG5p7UfoVu_HcRWrfcnlIRuX9tl4gVntZNdXDrNC42BUKjOQXmxfw96jNKOXVNa1S-b4cs2Alj5fZfVAFbmQExO2MCmmNXldZO9aN8NzxLXxZujviFWPcsFwR5-XKgU3SG0C7pA2WGRJqO9VW58gpv71SViad5KMXFqG4jKg&h=ProYQfUxtt5Nar3hDS_12XaCjhZGqlr-9OEA94kmTt4 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","name":"dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_durabletask000001/providers/Microsoft.DurableTask/namespaces/test1","status":"Accepted","startTime":"2024-09-05T17:49:36.8327173Z"}' - headers: - cache-control: - - no-cache - content-length: - - '569' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 05 Sep 2024 17:50:37 GMT - etag: - - '"b7003d3c-0000-0100-0000-66d9ef300000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE - x-content-type-options: - - nosniff - x-ms-operation-identifier: - - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=c065741a-65a3-4502-b9c0-547929546b6f/eastus2euap/ec7e164b-de6a-4b13-9e72-7610d83139d9 - x-msedge-ref: - - 'Ref A: D1AE21B01679464382FC10D1CFD8E41D Ref B: DM2EDGE0813 Ref C: 2024-09-05T17:50:37Z' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - durabletask namespace create - Connection: - - keep-alive - ParameterSetName: - - -g -n - User-Agent: - - AZURECLI/2.64.0 azsdk-python-core/1.28.0 Python/3.11.6 (Linux-5.15.153.1-microsoft-standard-WSL2-x86_64-with-glibc2.35) - method: GET - uri: https://eastus2euap.management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96?api-version=2024-02-01-preview&t=638611553773460250&c=MIIHhjCCBm6gAwIBAgITHgUK3uZNXW0rELEWgAAABQre5jANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDYwHhcNMjQwNzI3MTIwMjAwWhcNMjQxMDI1MTIwMjAwWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALOp9mTbesFKlLY5kaubRq1NFmzMIRssJxSdGLLsTSNZCUTbJ7ozK0IiDfLVQCXyBqGrO3PYMBmeJEMdtKRsd00pJzflYkIE7nnXJBFw-sTxMSt4zsLsbXBMl4dGzNmrGZkYRrhFOSLC122KClMAs8DXhEcJU2_mol-1pxp42MCiq4jkKicedYt3GlUvVl3uSJyeiHw77qxa3x0QbuUm1DszpHTwyHp3x4hfUAwS6TWrZ929rowQ1y96k1x7RKmAIwamEzeg79Q5rsuLDW7yTX3Pg7sp7h3hbBjXeToCLa31ndkNFF9aoSLU3O-xO177GGKO6lhbIpHECNAaCtrFp6ECAwEAAaOCBHMwggRvMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwIwCgYIKwYBBQUHAwEwPAYJKwYBBAGCNxUHBC8wLQYlKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFgh8fIENbYcQIBZAIBBjCCAcsGCCsGAQUFBwEBBIIBvTCCAbkwYwYIKwYBBQUHMAKGV2h0dHA6Ly9jcmwubWljcm9zb2Z0LmNvbS9wa2lpbmZyYS9DZXJ0cy9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDEuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmwyLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MFMGCCsGAQUFBzAChkdodHRwOi8vY3JsMy5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDQuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwHQYDVR0OBBYEFOL38Ka708l__wglsKzbwvptKgiNMA4GA1UdDwEB_wQEAwIFoDCCASYGA1UdHwSCAR0wggEZMIIBFaCCARGgggENhj9odHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ1JML0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwxLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwyLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwzLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmw0LmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmwwgZ0GA1UdIASBlTCBkjAMBgorBgEEAYI3ewEBMGYGCisGAQQBgjd7AgIwWDBWBggrBgEFBQcCAjBKHkgAMwAzAGUAMAAxADkAMgAxAC0ANABkADYANAAtADQAZgA4AGMALQBhADAANQA1AC0ANQBiAGQAYQBmAGYAZAA1AGUAMwAzAGQwDAYKKwYBBAGCN3sDATAMBgorBgEEAYI3ewQBMB8GA1UdIwQYMBaAFPFGaMbxw_ArLX2LauGy-b41_NFBMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATANBgkqhkiG9w0BAQsFAAOCAQEAOjvtmgGG_gQTCeRcW03oj3kuNjkaOoixOTlz3lAC2IQY_-4SRz6Y1-eEdGjDgSL5trZKjpas64eIIdZzKfAeRUiIfIQHFtlEGG-nOH9acyDkUY04bgQhSkkQ7vkiLB95C7sAKLweobXMkBlMNjBNGbJkY_9bCVP_Qgv3ACF5VfFnpj76iqtgNm3IMgoKQWsFliPj6UF8bkP0y2e-hZWKSWTeQIqDscIjvCXo-CAkMzJ7twtIAzttmQQ3UKLeI2kWwO4ZKOFoczpWVNJXtOAk155DuJIZL-A2nNR9xirNPNwpZlKaBwaek91rnTFgaOTCCrG2DFXpg97eI6UL0RrLKQ&s=VramQI0NrVWH41AUWl06xCxbcvI9gdTM-WZOwmcw2_-VLytdhGIYjPH8dfIZ51nFVp_0r02xqxnh3L2IxWPYC8NdWZI3bPPLcAXYNvxWpyax3qkf6hYfWVO36FsePIl4hyUN9DZ5A30y22ayrEoFnkMpm45h881nbtYXPCVulPX51cHG5p7UfoVu_HcRWrfcnlIRuX9tl4gVntZNdXDrNC42BUKjOQXmxfw96jNKOXVNa1S-b4cs2Alj5fZfVAFbmQExO2MCmmNXldZO9aN8NzxLXxZujviFWPcsFwR5-XKgU3SG0C7pA2WGRJqO9VW58gpv71SViad5KMXFqG4jKg&h=ProYQfUxtt5Nar3hDS_12XaCjhZGqlr-9OEA94kmTt4 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","name":"dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_durabletask000001/providers/Microsoft.DurableTask/namespaces/test1","status":"Accepted","startTime":"2024-09-05T17:49:36.8327173Z"}' - headers: - cache-control: - - no-cache - content-length: - - '569' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 05 Sep 2024 17:51:07 GMT - etag: - - '"b7003d3c-0000-0100-0000-66d9ef300000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE - x-content-type-options: - - nosniff - x-ms-operation-identifier: - - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=c065741a-65a3-4502-b9c0-547929546b6f/eastus2euap/d2f18290-384c-4cdf-b81a-40911dae49da - x-msedge-ref: - - 'Ref A: A10383E6CCA348028C562F598E6C7621 Ref B: DM2EDGE0813 Ref C: 2024-09-05T17:51:07Z' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - durabletask namespace create - Connection: - - keep-alive - ParameterSetName: - - -g -n - User-Agent: - - AZURECLI/2.64.0 azsdk-python-core/1.28.0 Python/3.11.6 (Linux-5.15.153.1-microsoft-standard-WSL2-x86_64-with-glibc2.35) - method: GET - uri: https://eastus2euap.management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96?api-version=2024-02-01-preview&t=638611553773460250&c=MIIHhjCCBm6gAwIBAgITHgUK3uZNXW0rELEWgAAABQre5jANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDYwHhcNMjQwNzI3MTIwMjAwWhcNMjQxMDI1MTIwMjAwWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALOp9mTbesFKlLY5kaubRq1NFmzMIRssJxSdGLLsTSNZCUTbJ7ozK0IiDfLVQCXyBqGrO3PYMBmeJEMdtKRsd00pJzflYkIE7nnXJBFw-sTxMSt4zsLsbXBMl4dGzNmrGZkYRrhFOSLC122KClMAs8DXhEcJU2_mol-1pxp42MCiq4jkKicedYt3GlUvVl3uSJyeiHw77qxa3x0QbuUm1DszpHTwyHp3x4hfUAwS6TWrZ929rowQ1y96k1x7RKmAIwamEzeg79Q5rsuLDW7yTX3Pg7sp7h3hbBjXeToCLa31ndkNFF9aoSLU3O-xO177GGKO6lhbIpHECNAaCtrFp6ECAwEAAaOCBHMwggRvMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwIwCgYIKwYBBQUHAwEwPAYJKwYBBAGCNxUHBC8wLQYlKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFgh8fIENbYcQIBZAIBBjCCAcsGCCsGAQUFBwEBBIIBvTCCAbkwYwYIKwYBBQUHMAKGV2h0dHA6Ly9jcmwubWljcm9zb2Z0LmNvbS9wa2lpbmZyYS9DZXJ0cy9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDEuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmwyLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MFMGCCsGAQUFBzAChkdodHRwOi8vY3JsMy5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDQuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwHQYDVR0OBBYEFOL38Ka708l__wglsKzbwvptKgiNMA4GA1UdDwEB_wQEAwIFoDCCASYGA1UdHwSCAR0wggEZMIIBFaCCARGgggENhj9odHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ1JML0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwxLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwyLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwzLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmw0LmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmwwgZ0GA1UdIASBlTCBkjAMBgorBgEEAYI3ewEBMGYGCisGAQQBgjd7AgIwWDBWBggrBgEFBQcCAjBKHkgAMwAzAGUAMAAxADkAMgAxAC0ANABkADYANAAtADQAZgA4AGMALQBhADAANQA1AC0ANQBiAGQAYQBmAGYAZAA1AGUAMwAzAGQwDAYKKwYBBAGCN3sDATAMBgorBgEEAYI3ewQBMB8GA1UdIwQYMBaAFPFGaMbxw_ArLX2LauGy-b41_NFBMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATANBgkqhkiG9w0BAQsFAAOCAQEAOjvtmgGG_gQTCeRcW03oj3kuNjkaOoixOTlz3lAC2IQY_-4SRz6Y1-eEdGjDgSL5trZKjpas64eIIdZzKfAeRUiIfIQHFtlEGG-nOH9acyDkUY04bgQhSkkQ7vkiLB95C7sAKLweobXMkBlMNjBNGbJkY_9bCVP_Qgv3ACF5VfFnpj76iqtgNm3IMgoKQWsFliPj6UF8bkP0y2e-hZWKSWTeQIqDscIjvCXo-CAkMzJ7twtIAzttmQQ3UKLeI2kWwO4ZKOFoczpWVNJXtOAk155DuJIZL-A2nNR9xirNPNwpZlKaBwaek91rnTFgaOTCCrG2DFXpg97eI6UL0RrLKQ&s=VramQI0NrVWH41AUWl06xCxbcvI9gdTM-WZOwmcw2_-VLytdhGIYjPH8dfIZ51nFVp_0r02xqxnh3L2IxWPYC8NdWZI3bPPLcAXYNvxWpyax3qkf6hYfWVO36FsePIl4hyUN9DZ5A30y22ayrEoFnkMpm45h881nbtYXPCVulPX51cHG5p7UfoVu_HcRWrfcnlIRuX9tl4gVntZNdXDrNC42BUKjOQXmxfw96jNKOXVNa1S-b4cs2Alj5fZfVAFbmQExO2MCmmNXldZO9aN8NzxLXxZujviFWPcsFwR5-XKgU3SG0C7pA2WGRJqO9VW58gpv71SViad5KMXFqG4jKg&h=ProYQfUxtt5Nar3hDS_12XaCjhZGqlr-9OEA94kmTt4 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","name":"dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_durabletask000001/providers/Microsoft.DurableTask/namespaces/test1","status":"Accepted","startTime":"2024-09-05T17:49:36.8327173Z"}' - headers: - cache-control: - - no-cache - content-length: - - '569' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 05 Sep 2024 17:51:37 GMT - etag: - - '"b7003d3c-0000-0100-0000-66d9ef300000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE - x-content-type-options: - - nosniff - x-ms-operation-identifier: - - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=c065741a-65a3-4502-b9c0-547929546b6f/eastus2euap/e622749c-d437-488d-adf9-64d10103cafc - x-msedge-ref: - - 'Ref A: 352F44DE16FC4A248AA2DA1F4D6B5A67 Ref B: DM2EDGE0813 Ref C: 2024-09-05T17:51:38Z' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - durabletask namespace create - Connection: - - keep-alive - ParameterSetName: - - -g -n - User-Agent: - - AZURECLI/2.64.0 azsdk-python-core/1.28.0 Python/3.11.6 (Linux-5.15.153.1-microsoft-standard-WSL2-x86_64-with-glibc2.35) - method: GET - uri: https://eastus2euap.management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96?api-version=2024-02-01-preview&t=638611553773460250&c=MIIHhjCCBm6gAwIBAgITHgUK3uZNXW0rELEWgAAABQre5jANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDYwHhcNMjQwNzI3MTIwMjAwWhcNMjQxMDI1MTIwMjAwWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALOp9mTbesFKlLY5kaubRq1NFmzMIRssJxSdGLLsTSNZCUTbJ7ozK0IiDfLVQCXyBqGrO3PYMBmeJEMdtKRsd00pJzflYkIE7nnXJBFw-sTxMSt4zsLsbXBMl4dGzNmrGZkYRrhFOSLC122KClMAs8DXhEcJU2_mol-1pxp42MCiq4jkKicedYt3GlUvVl3uSJyeiHw77qxa3x0QbuUm1DszpHTwyHp3x4hfUAwS6TWrZ929rowQ1y96k1x7RKmAIwamEzeg79Q5rsuLDW7yTX3Pg7sp7h3hbBjXeToCLa31ndkNFF9aoSLU3O-xO177GGKO6lhbIpHECNAaCtrFp6ECAwEAAaOCBHMwggRvMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwIwCgYIKwYBBQUHAwEwPAYJKwYBBAGCNxUHBC8wLQYlKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFgh8fIENbYcQIBZAIBBjCCAcsGCCsGAQUFBwEBBIIBvTCCAbkwYwYIKwYBBQUHMAKGV2h0dHA6Ly9jcmwubWljcm9zb2Z0LmNvbS9wa2lpbmZyYS9DZXJ0cy9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDEuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmwyLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MFMGCCsGAQUFBzAChkdodHRwOi8vY3JsMy5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDQuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwHQYDVR0OBBYEFOL38Ka708l__wglsKzbwvptKgiNMA4GA1UdDwEB_wQEAwIFoDCCASYGA1UdHwSCAR0wggEZMIIBFaCCARGgggENhj9odHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ1JML0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwxLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwyLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwzLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmw0LmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmwwgZ0GA1UdIASBlTCBkjAMBgorBgEEAYI3ewEBMGYGCisGAQQBgjd7AgIwWDBWBggrBgEFBQcCAjBKHkgAMwAzAGUAMAAxADkAMgAxAC0ANABkADYANAAtADQAZgA4AGMALQBhADAANQA1AC0ANQBiAGQAYQBmAGYAZAA1AGUAMwAzAGQwDAYKKwYBBAGCN3sDATAMBgorBgEEAYI3ewQBMB8GA1UdIwQYMBaAFPFGaMbxw_ArLX2LauGy-b41_NFBMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATANBgkqhkiG9w0BAQsFAAOCAQEAOjvtmgGG_gQTCeRcW03oj3kuNjkaOoixOTlz3lAC2IQY_-4SRz6Y1-eEdGjDgSL5trZKjpas64eIIdZzKfAeRUiIfIQHFtlEGG-nOH9acyDkUY04bgQhSkkQ7vkiLB95C7sAKLweobXMkBlMNjBNGbJkY_9bCVP_Qgv3ACF5VfFnpj76iqtgNm3IMgoKQWsFliPj6UF8bkP0y2e-hZWKSWTeQIqDscIjvCXo-CAkMzJ7twtIAzttmQQ3UKLeI2kWwO4ZKOFoczpWVNJXtOAk155DuJIZL-A2nNR9xirNPNwpZlKaBwaek91rnTFgaOTCCrG2DFXpg97eI6UL0RrLKQ&s=VramQI0NrVWH41AUWl06xCxbcvI9gdTM-WZOwmcw2_-VLytdhGIYjPH8dfIZ51nFVp_0r02xqxnh3L2IxWPYC8NdWZI3bPPLcAXYNvxWpyax3qkf6hYfWVO36FsePIl4hyUN9DZ5A30y22ayrEoFnkMpm45h881nbtYXPCVulPX51cHG5p7UfoVu_HcRWrfcnlIRuX9tl4gVntZNdXDrNC42BUKjOQXmxfw96jNKOXVNa1S-b4cs2Alj5fZfVAFbmQExO2MCmmNXldZO9aN8NzxLXxZujviFWPcsFwR5-XKgU3SG0C7pA2WGRJqO9VW58gpv71SViad5KMXFqG4jKg&h=ProYQfUxtt5Nar3hDS_12XaCjhZGqlr-9OEA94kmTt4 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","name":"dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_durabletask000001/providers/Microsoft.DurableTask/namespaces/test1","status":"Accepted","startTime":"2024-09-05T17:49:36.8327173Z"}' - headers: - cache-control: - - no-cache - content-length: - - '569' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 05 Sep 2024 17:52:08 GMT - etag: - - '"b7003d3c-0000-0100-0000-66d9ef300000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE - x-content-type-options: - - nosniff - x-ms-operation-identifier: - - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=c065741a-65a3-4502-b9c0-547929546b6f/eastus2euap/7dba49eb-8cba-45dd-b303-a4891ea4ca61 - x-msedge-ref: - - 'Ref A: 8627C624E1C84604B2D2DE41930BE119 Ref B: DM2EDGE0813 Ref C: 2024-09-05T17:52:08Z' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - durabletask namespace create - Connection: - - keep-alive - ParameterSetName: - - -g -n - User-Agent: - - AZURECLI/2.64.0 azsdk-python-core/1.28.0 Python/3.11.6 (Linux-5.15.153.1-microsoft-standard-WSL2-x86_64-with-glibc2.35) - method: GET - uri: https://eastus2euap.management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96?api-version=2024-02-01-preview&t=638611553773460250&c=MIIHhjCCBm6gAwIBAgITHgUK3uZNXW0rELEWgAAABQre5jANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDYwHhcNMjQwNzI3MTIwMjAwWhcNMjQxMDI1MTIwMjAwWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALOp9mTbesFKlLY5kaubRq1NFmzMIRssJxSdGLLsTSNZCUTbJ7ozK0IiDfLVQCXyBqGrO3PYMBmeJEMdtKRsd00pJzflYkIE7nnXJBFw-sTxMSt4zsLsbXBMl4dGzNmrGZkYRrhFOSLC122KClMAs8DXhEcJU2_mol-1pxp42MCiq4jkKicedYt3GlUvVl3uSJyeiHw77qxa3x0QbuUm1DszpHTwyHp3x4hfUAwS6TWrZ929rowQ1y96k1x7RKmAIwamEzeg79Q5rsuLDW7yTX3Pg7sp7h3hbBjXeToCLa31ndkNFF9aoSLU3O-xO177GGKO6lhbIpHECNAaCtrFp6ECAwEAAaOCBHMwggRvMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwIwCgYIKwYBBQUHAwEwPAYJKwYBBAGCNxUHBC8wLQYlKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFgh8fIENbYcQIBZAIBBjCCAcsGCCsGAQUFBwEBBIIBvTCCAbkwYwYIKwYBBQUHMAKGV2h0dHA6Ly9jcmwubWljcm9zb2Z0LmNvbS9wa2lpbmZyYS9DZXJ0cy9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDEuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmwyLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MFMGCCsGAQUFBzAChkdodHRwOi8vY3JsMy5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDQuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwHQYDVR0OBBYEFOL38Ka708l__wglsKzbwvptKgiNMA4GA1UdDwEB_wQEAwIFoDCCASYGA1UdHwSCAR0wggEZMIIBFaCCARGgggENhj9odHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ1JML0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwxLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwyLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwzLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmw0LmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmwwgZ0GA1UdIASBlTCBkjAMBgorBgEEAYI3ewEBMGYGCisGAQQBgjd7AgIwWDBWBggrBgEFBQcCAjBKHkgAMwAzAGUAMAAxADkAMgAxAC0ANABkADYANAAtADQAZgA4AGMALQBhADAANQA1AC0ANQBiAGQAYQBmAGYAZAA1AGUAMwAzAGQwDAYKKwYBBAGCN3sDATAMBgorBgEEAYI3ewQBMB8GA1UdIwQYMBaAFPFGaMbxw_ArLX2LauGy-b41_NFBMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATANBgkqhkiG9w0BAQsFAAOCAQEAOjvtmgGG_gQTCeRcW03oj3kuNjkaOoixOTlz3lAC2IQY_-4SRz6Y1-eEdGjDgSL5trZKjpas64eIIdZzKfAeRUiIfIQHFtlEGG-nOH9acyDkUY04bgQhSkkQ7vkiLB95C7sAKLweobXMkBlMNjBNGbJkY_9bCVP_Qgv3ACF5VfFnpj76iqtgNm3IMgoKQWsFliPj6UF8bkP0y2e-hZWKSWTeQIqDscIjvCXo-CAkMzJ7twtIAzttmQQ3UKLeI2kWwO4ZKOFoczpWVNJXtOAk155DuJIZL-A2nNR9xirNPNwpZlKaBwaek91rnTFgaOTCCrG2DFXpg97eI6UL0RrLKQ&s=VramQI0NrVWH41AUWl06xCxbcvI9gdTM-WZOwmcw2_-VLytdhGIYjPH8dfIZ51nFVp_0r02xqxnh3L2IxWPYC8NdWZI3bPPLcAXYNvxWpyax3qkf6hYfWVO36FsePIl4hyUN9DZ5A30y22ayrEoFnkMpm45h881nbtYXPCVulPX51cHG5p7UfoVu_HcRWrfcnlIRuX9tl4gVntZNdXDrNC42BUKjOQXmxfw96jNKOXVNa1S-b4cs2Alj5fZfVAFbmQExO2MCmmNXldZO9aN8NzxLXxZujviFWPcsFwR5-XKgU3SG0C7pA2WGRJqO9VW58gpv71SViad5KMXFqG4jKg&h=ProYQfUxtt5Nar3hDS_12XaCjhZGqlr-9OEA94kmTt4 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","name":"dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_durabletask000001/providers/Microsoft.DurableTask/namespaces/test1","status":"Accepted","startTime":"2024-09-05T17:49:36.8327173Z"}' - headers: - cache-control: - - no-cache - content-length: - - '569' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 05 Sep 2024 17:52:38 GMT - etag: - - '"b7003d3c-0000-0100-0000-66d9ef300000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE - x-content-type-options: - - nosniff - x-ms-operation-identifier: - - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=c065741a-65a3-4502-b9c0-547929546b6f/eastus2euap/782eeb4e-8b63-4001-b801-9194e78af235 - x-msedge-ref: - - 'Ref A: 511188A256EE48D999784F52DFFE368B Ref B: DM2EDGE0813 Ref C: 2024-09-05T17:52:38Z' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - durabletask namespace create - Connection: - - keep-alive - ParameterSetName: - - -g -n - User-Agent: - - AZURECLI/2.64.0 azsdk-python-core/1.28.0 Python/3.11.6 (Linux-5.15.153.1-microsoft-standard-WSL2-x86_64-with-glibc2.35) - method: GET - uri: https://eastus2euap.management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96?api-version=2024-02-01-preview&t=638611553773460250&c=MIIHhjCCBm6gAwIBAgITHgUK3uZNXW0rELEWgAAABQre5jANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDYwHhcNMjQwNzI3MTIwMjAwWhcNMjQxMDI1MTIwMjAwWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALOp9mTbesFKlLY5kaubRq1NFmzMIRssJxSdGLLsTSNZCUTbJ7ozK0IiDfLVQCXyBqGrO3PYMBmeJEMdtKRsd00pJzflYkIE7nnXJBFw-sTxMSt4zsLsbXBMl4dGzNmrGZkYRrhFOSLC122KClMAs8DXhEcJU2_mol-1pxp42MCiq4jkKicedYt3GlUvVl3uSJyeiHw77qxa3x0QbuUm1DszpHTwyHp3x4hfUAwS6TWrZ929rowQ1y96k1x7RKmAIwamEzeg79Q5rsuLDW7yTX3Pg7sp7h3hbBjXeToCLa31ndkNFF9aoSLU3O-xO177GGKO6lhbIpHECNAaCtrFp6ECAwEAAaOCBHMwggRvMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwIwCgYIKwYBBQUHAwEwPAYJKwYBBAGCNxUHBC8wLQYlKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFgh8fIENbYcQIBZAIBBjCCAcsGCCsGAQUFBwEBBIIBvTCCAbkwYwYIKwYBBQUHMAKGV2h0dHA6Ly9jcmwubWljcm9zb2Z0LmNvbS9wa2lpbmZyYS9DZXJ0cy9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDEuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmwyLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MFMGCCsGAQUFBzAChkdodHRwOi8vY3JsMy5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDQuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwHQYDVR0OBBYEFOL38Ka708l__wglsKzbwvptKgiNMA4GA1UdDwEB_wQEAwIFoDCCASYGA1UdHwSCAR0wggEZMIIBFaCCARGgggENhj9odHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ1JML0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwxLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwyLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwzLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmw0LmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmwwgZ0GA1UdIASBlTCBkjAMBgorBgEEAYI3ewEBMGYGCisGAQQBgjd7AgIwWDBWBggrBgEFBQcCAjBKHkgAMwAzAGUAMAAxADkAMgAxAC0ANABkADYANAAtADQAZgA4AGMALQBhADAANQA1AC0ANQBiAGQAYQBmAGYAZAA1AGUAMwAzAGQwDAYKKwYBBAGCN3sDATAMBgorBgEEAYI3ewQBMB8GA1UdIwQYMBaAFPFGaMbxw_ArLX2LauGy-b41_NFBMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATANBgkqhkiG9w0BAQsFAAOCAQEAOjvtmgGG_gQTCeRcW03oj3kuNjkaOoixOTlz3lAC2IQY_-4SRz6Y1-eEdGjDgSL5trZKjpas64eIIdZzKfAeRUiIfIQHFtlEGG-nOH9acyDkUY04bgQhSkkQ7vkiLB95C7sAKLweobXMkBlMNjBNGbJkY_9bCVP_Qgv3ACF5VfFnpj76iqtgNm3IMgoKQWsFliPj6UF8bkP0y2e-hZWKSWTeQIqDscIjvCXo-CAkMzJ7twtIAzttmQQ3UKLeI2kWwO4ZKOFoczpWVNJXtOAk155DuJIZL-A2nNR9xirNPNwpZlKaBwaek91rnTFgaOTCCrG2DFXpg97eI6UL0RrLKQ&s=VramQI0NrVWH41AUWl06xCxbcvI9gdTM-WZOwmcw2_-VLytdhGIYjPH8dfIZ51nFVp_0r02xqxnh3L2IxWPYC8NdWZI3bPPLcAXYNvxWpyax3qkf6hYfWVO36FsePIl4hyUN9DZ5A30y22ayrEoFnkMpm45h881nbtYXPCVulPX51cHG5p7UfoVu_HcRWrfcnlIRuX9tl4gVntZNdXDrNC42BUKjOQXmxfw96jNKOXVNa1S-b4cs2Alj5fZfVAFbmQExO2MCmmNXldZO9aN8NzxLXxZujviFWPcsFwR5-XKgU3SG0C7pA2WGRJqO9VW58gpv71SViad5KMXFqG4jKg&h=ProYQfUxtt5Nar3hDS_12XaCjhZGqlr-9OEA94kmTt4 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","name":"dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_durabletask000001/providers/Microsoft.DurableTask/namespaces/test1","status":"Accepted","startTime":"2024-09-05T17:49:36.8327173Z"}' - headers: - cache-control: - - no-cache - content-length: - - '569' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 05 Sep 2024 17:53:08 GMT - etag: - - '"b7003d3c-0000-0100-0000-66d9ef300000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE - x-content-type-options: - - nosniff - x-ms-operation-identifier: - - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=c065741a-65a3-4502-b9c0-547929546b6f/eastus2euap/a8bba586-ce4d-4bb9-94c8-a8eecfb9143a - x-msedge-ref: - - 'Ref A: 68E172698ECF4874A2A656AD243E7A06 Ref B: DM2EDGE0813 Ref C: 2024-09-05T17:53:08Z' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - durabletask namespace create - Connection: - - keep-alive - ParameterSetName: - - -g -n - User-Agent: - - AZURECLI/2.64.0 azsdk-python-core/1.28.0 Python/3.11.6 (Linux-5.15.153.1-microsoft-standard-WSL2-x86_64-with-glibc2.35) - method: GET - uri: https://eastus2euap.management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96?api-version=2024-02-01-preview&t=638611553773460250&c=MIIHhjCCBm6gAwIBAgITHgUK3uZNXW0rELEWgAAABQre5jANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDYwHhcNMjQwNzI3MTIwMjAwWhcNMjQxMDI1MTIwMjAwWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALOp9mTbesFKlLY5kaubRq1NFmzMIRssJxSdGLLsTSNZCUTbJ7ozK0IiDfLVQCXyBqGrO3PYMBmeJEMdtKRsd00pJzflYkIE7nnXJBFw-sTxMSt4zsLsbXBMl4dGzNmrGZkYRrhFOSLC122KClMAs8DXhEcJU2_mol-1pxp42MCiq4jkKicedYt3GlUvVl3uSJyeiHw77qxa3x0QbuUm1DszpHTwyHp3x4hfUAwS6TWrZ929rowQ1y96k1x7RKmAIwamEzeg79Q5rsuLDW7yTX3Pg7sp7h3hbBjXeToCLa31ndkNFF9aoSLU3O-xO177GGKO6lhbIpHECNAaCtrFp6ECAwEAAaOCBHMwggRvMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwIwCgYIKwYBBQUHAwEwPAYJKwYBBAGCNxUHBC8wLQYlKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFgh8fIENbYcQIBZAIBBjCCAcsGCCsGAQUFBwEBBIIBvTCCAbkwYwYIKwYBBQUHMAKGV2h0dHA6Ly9jcmwubWljcm9zb2Z0LmNvbS9wa2lpbmZyYS9DZXJ0cy9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDEuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmwyLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MFMGCCsGAQUFBzAChkdodHRwOi8vY3JsMy5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDQuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwHQYDVR0OBBYEFOL38Ka708l__wglsKzbwvptKgiNMA4GA1UdDwEB_wQEAwIFoDCCASYGA1UdHwSCAR0wggEZMIIBFaCCARGgggENhj9odHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ1JML0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwxLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwyLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwzLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmw0LmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmwwgZ0GA1UdIASBlTCBkjAMBgorBgEEAYI3ewEBMGYGCisGAQQBgjd7AgIwWDBWBggrBgEFBQcCAjBKHkgAMwAzAGUAMAAxADkAMgAxAC0ANABkADYANAAtADQAZgA4AGMALQBhADAANQA1AC0ANQBiAGQAYQBmAGYAZAA1AGUAMwAzAGQwDAYKKwYBBAGCN3sDATAMBgorBgEEAYI3ewQBMB8GA1UdIwQYMBaAFPFGaMbxw_ArLX2LauGy-b41_NFBMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATANBgkqhkiG9w0BAQsFAAOCAQEAOjvtmgGG_gQTCeRcW03oj3kuNjkaOoixOTlz3lAC2IQY_-4SRz6Y1-eEdGjDgSL5trZKjpas64eIIdZzKfAeRUiIfIQHFtlEGG-nOH9acyDkUY04bgQhSkkQ7vkiLB95C7sAKLweobXMkBlMNjBNGbJkY_9bCVP_Qgv3ACF5VfFnpj76iqtgNm3IMgoKQWsFliPj6UF8bkP0y2e-hZWKSWTeQIqDscIjvCXo-CAkMzJ7twtIAzttmQQ3UKLeI2kWwO4ZKOFoczpWVNJXtOAk155DuJIZL-A2nNR9xirNPNwpZlKaBwaek91rnTFgaOTCCrG2DFXpg97eI6UL0RrLKQ&s=VramQI0NrVWH41AUWl06xCxbcvI9gdTM-WZOwmcw2_-VLytdhGIYjPH8dfIZ51nFVp_0r02xqxnh3L2IxWPYC8NdWZI3bPPLcAXYNvxWpyax3qkf6hYfWVO36FsePIl4hyUN9DZ5A30y22ayrEoFnkMpm45h881nbtYXPCVulPX51cHG5p7UfoVu_HcRWrfcnlIRuX9tl4gVntZNdXDrNC42BUKjOQXmxfw96jNKOXVNa1S-b4cs2Alj5fZfVAFbmQExO2MCmmNXldZO9aN8NzxLXxZujviFWPcsFwR5-XKgU3SG0C7pA2WGRJqO9VW58gpv71SViad5KMXFqG4jKg&h=ProYQfUxtt5Nar3hDS_12XaCjhZGqlr-9OEA94kmTt4 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","name":"dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_durabletask000001/providers/Microsoft.DurableTask/namespaces/test1","status":"Accepted","startTime":"2024-09-05T17:49:36.8327173Z"}' - headers: - cache-control: - - no-cache - content-length: - - '569' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 05 Sep 2024 17:53:38 GMT - etag: - - '"b7003d3c-0000-0100-0000-66d9ef300000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE - x-content-type-options: - - nosniff - x-ms-operation-identifier: - - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=c065741a-65a3-4502-b9c0-547929546b6f/eastus2euap/fca0799b-32e7-4ab5-ad40-02c7a60752d6 - x-msedge-ref: - - 'Ref A: 7DC921AB6851424AB843710818AC73EF Ref B: DM2EDGE0813 Ref C: 2024-09-05T17:53:38Z' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - durabletask namespace create - Connection: - - keep-alive - ParameterSetName: - - -g -n - User-Agent: - - AZURECLI/2.64.0 azsdk-python-core/1.28.0 Python/3.11.6 (Linux-5.15.153.1-microsoft-standard-WSL2-x86_64-with-glibc2.35) - method: GET - uri: https://eastus2euap.management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96?api-version=2024-02-01-preview&t=638611553773460250&c=MIIHhjCCBm6gAwIBAgITHgUK3uZNXW0rELEWgAAABQre5jANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDYwHhcNMjQwNzI3MTIwMjAwWhcNMjQxMDI1MTIwMjAwWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALOp9mTbesFKlLY5kaubRq1NFmzMIRssJxSdGLLsTSNZCUTbJ7ozK0IiDfLVQCXyBqGrO3PYMBmeJEMdtKRsd00pJzflYkIE7nnXJBFw-sTxMSt4zsLsbXBMl4dGzNmrGZkYRrhFOSLC122KClMAs8DXhEcJU2_mol-1pxp42MCiq4jkKicedYt3GlUvVl3uSJyeiHw77qxa3x0QbuUm1DszpHTwyHp3x4hfUAwS6TWrZ929rowQ1y96k1x7RKmAIwamEzeg79Q5rsuLDW7yTX3Pg7sp7h3hbBjXeToCLa31ndkNFF9aoSLU3O-xO177GGKO6lhbIpHECNAaCtrFp6ECAwEAAaOCBHMwggRvMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwIwCgYIKwYBBQUHAwEwPAYJKwYBBAGCNxUHBC8wLQYlKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFgh8fIENbYcQIBZAIBBjCCAcsGCCsGAQUFBwEBBIIBvTCCAbkwYwYIKwYBBQUHMAKGV2h0dHA6Ly9jcmwubWljcm9zb2Z0LmNvbS9wa2lpbmZyYS9DZXJ0cy9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDEuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmwyLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MFMGCCsGAQUFBzAChkdodHRwOi8vY3JsMy5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDQuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwHQYDVR0OBBYEFOL38Ka708l__wglsKzbwvptKgiNMA4GA1UdDwEB_wQEAwIFoDCCASYGA1UdHwSCAR0wggEZMIIBFaCCARGgggENhj9odHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ1JML0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwxLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwyLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwzLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmw0LmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmwwgZ0GA1UdIASBlTCBkjAMBgorBgEEAYI3ewEBMGYGCisGAQQBgjd7AgIwWDBWBggrBgEFBQcCAjBKHkgAMwAzAGUAMAAxADkAMgAxAC0ANABkADYANAAtADQAZgA4AGMALQBhADAANQA1AC0ANQBiAGQAYQBmAGYAZAA1AGUAMwAzAGQwDAYKKwYBBAGCN3sDATAMBgorBgEEAYI3ewQBMB8GA1UdIwQYMBaAFPFGaMbxw_ArLX2LauGy-b41_NFBMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATANBgkqhkiG9w0BAQsFAAOCAQEAOjvtmgGG_gQTCeRcW03oj3kuNjkaOoixOTlz3lAC2IQY_-4SRz6Y1-eEdGjDgSL5trZKjpas64eIIdZzKfAeRUiIfIQHFtlEGG-nOH9acyDkUY04bgQhSkkQ7vkiLB95C7sAKLweobXMkBlMNjBNGbJkY_9bCVP_Qgv3ACF5VfFnpj76iqtgNm3IMgoKQWsFliPj6UF8bkP0y2e-hZWKSWTeQIqDscIjvCXo-CAkMzJ7twtIAzttmQQ3UKLeI2kWwO4ZKOFoczpWVNJXtOAk155DuJIZL-A2nNR9xirNPNwpZlKaBwaek91rnTFgaOTCCrG2DFXpg97eI6UL0RrLKQ&s=VramQI0NrVWH41AUWl06xCxbcvI9gdTM-WZOwmcw2_-VLytdhGIYjPH8dfIZ51nFVp_0r02xqxnh3L2IxWPYC8NdWZI3bPPLcAXYNvxWpyax3qkf6hYfWVO36FsePIl4hyUN9DZ5A30y22ayrEoFnkMpm45h881nbtYXPCVulPX51cHG5p7UfoVu_HcRWrfcnlIRuX9tl4gVntZNdXDrNC42BUKjOQXmxfw96jNKOXVNa1S-b4cs2Alj5fZfVAFbmQExO2MCmmNXldZO9aN8NzxLXxZujviFWPcsFwR5-XKgU3SG0C7pA2WGRJqO9VW58gpv71SViad5KMXFqG4jKg&h=ProYQfUxtt5Nar3hDS_12XaCjhZGqlr-9OEA94kmTt4 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","name":"dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_durabletask000001/providers/Microsoft.DurableTask/namespaces/test1","status":"Accepted","startTime":"2024-09-05T17:49:36.8327173Z"}' - headers: - cache-control: - - no-cache - content-length: - - '569' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 05 Sep 2024 17:54:08 GMT - etag: - - '"b7003d3c-0000-0100-0000-66d9ef300000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE - x-content-type-options: - - nosniff - x-ms-operation-identifier: - - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=c065741a-65a3-4502-b9c0-547929546b6f/eastus2euap/76bc8f56-ac35-470f-a3d2-dea617aff82e - x-msedge-ref: - - 'Ref A: 8F5D0C201C71481DA482E4E4245915D9 Ref B: DM2EDGE0813 Ref C: 2024-09-05T17:54:08Z' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - durabletask namespace create - Connection: - - keep-alive - ParameterSetName: - - -g -n - User-Agent: - - AZURECLI/2.64.0 azsdk-python-core/1.28.0 Python/3.11.6 (Linux-5.15.153.1-microsoft-standard-WSL2-x86_64-with-glibc2.35) - method: GET - uri: https://eastus2euap.management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96?api-version=2024-02-01-preview&t=638611553773460250&c=MIIHhjCCBm6gAwIBAgITHgUK3uZNXW0rELEWgAAABQre5jANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDYwHhcNMjQwNzI3MTIwMjAwWhcNMjQxMDI1MTIwMjAwWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALOp9mTbesFKlLY5kaubRq1NFmzMIRssJxSdGLLsTSNZCUTbJ7ozK0IiDfLVQCXyBqGrO3PYMBmeJEMdtKRsd00pJzflYkIE7nnXJBFw-sTxMSt4zsLsbXBMl4dGzNmrGZkYRrhFOSLC122KClMAs8DXhEcJU2_mol-1pxp42MCiq4jkKicedYt3GlUvVl3uSJyeiHw77qxa3x0QbuUm1DszpHTwyHp3x4hfUAwS6TWrZ929rowQ1y96k1x7RKmAIwamEzeg79Q5rsuLDW7yTX3Pg7sp7h3hbBjXeToCLa31ndkNFF9aoSLU3O-xO177GGKO6lhbIpHECNAaCtrFp6ECAwEAAaOCBHMwggRvMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwIwCgYIKwYBBQUHAwEwPAYJKwYBBAGCNxUHBC8wLQYlKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFgh8fIENbYcQIBZAIBBjCCAcsGCCsGAQUFBwEBBIIBvTCCAbkwYwYIKwYBBQUHMAKGV2h0dHA6Ly9jcmwubWljcm9zb2Z0LmNvbS9wa2lpbmZyYS9DZXJ0cy9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDEuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmwyLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MFMGCCsGAQUFBzAChkdodHRwOi8vY3JsMy5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDQuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwHQYDVR0OBBYEFOL38Ka708l__wglsKzbwvptKgiNMA4GA1UdDwEB_wQEAwIFoDCCASYGA1UdHwSCAR0wggEZMIIBFaCCARGgggENhj9odHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ1JML0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwxLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwyLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwzLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmw0LmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmwwgZ0GA1UdIASBlTCBkjAMBgorBgEEAYI3ewEBMGYGCisGAQQBgjd7AgIwWDBWBggrBgEFBQcCAjBKHkgAMwAzAGUAMAAxADkAMgAxAC0ANABkADYANAAtADQAZgA4AGMALQBhADAANQA1AC0ANQBiAGQAYQBmAGYAZAA1AGUAMwAzAGQwDAYKKwYBBAGCN3sDATAMBgorBgEEAYI3ewQBMB8GA1UdIwQYMBaAFPFGaMbxw_ArLX2LauGy-b41_NFBMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATANBgkqhkiG9w0BAQsFAAOCAQEAOjvtmgGG_gQTCeRcW03oj3kuNjkaOoixOTlz3lAC2IQY_-4SRz6Y1-eEdGjDgSL5trZKjpas64eIIdZzKfAeRUiIfIQHFtlEGG-nOH9acyDkUY04bgQhSkkQ7vkiLB95C7sAKLweobXMkBlMNjBNGbJkY_9bCVP_Qgv3ACF5VfFnpj76iqtgNm3IMgoKQWsFliPj6UF8bkP0y2e-hZWKSWTeQIqDscIjvCXo-CAkMzJ7twtIAzttmQQ3UKLeI2kWwO4ZKOFoczpWVNJXtOAk155DuJIZL-A2nNR9xirNPNwpZlKaBwaek91rnTFgaOTCCrG2DFXpg97eI6UL0RrLKQ&s=VramQI0NrVWH41AUWl06xCxbcvI9gdTM-WZOwmcw2_-VLytdhGIYjPH8dfIZ51nFVp_0r02xqxnh3L2IxWPYC8NdWZI3bPPLcAXYNvxWpyax3qkf6hYfWVO36FsePIl4hyUN9DZ5A30y22ayrEoFnkMpm45h881nbtYXPCVulPX51cHG5p7UfoVu_HcRWrfcnlIRuX9tl4gVntZNdXDrNC42BUKjOQXmxfw96jNKOXVNa1S-b4cs2Alj5fZfVAFbmQExO2MCmmNXldZO9aN8NzxLXxZujviFWPcsFwR5-XKgU3SG0C7pA2WGRJqO9VW58gpv71SViad5KMXFqG4jKg&h=ProYQfUxtt5Nar3hDS_12XaCjhZGqlr-9OEA94kmTt4 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","name":"dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_durabletask000001/providers/Microsoft.DurableTask/namespaces/test1","status":"Accepted","startTime":"2024-09-05T17:49:36.8327173Z"}' - headers: - cache-control: - - no-cache - content-length: - - '569' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 05 Sep 2024 17:54:38 GMT - etag: - - '"b7003d3c-0000-0100-0000-66d9ef300000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE - x-content-type-options: - - nosniff - x-ms-operation-identifier: - - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=c065741a-65a3-4502-b9c0-547929546b6f/eastus2euap/c337dde3-23b8-4641-acf5-d792f5489dfb - x-msedge-ref: - - 'Ref A: A88A055D50F9410998FBDD0AA6BBB114 Ref B: DM2EDGE0813 Ref C: 2024-09-05T17:54:38Z' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - durabletask namespace create - Connection: - - keep-alive - ParameterSetName: - - -g -n - User-Agent: - - AZURECLI/2.64.0 azsdk-python-core/1.28.0 Python/3.11.6 (Linux-5.15.153.1-microsoft-standard-WSL2-x86_64-with-glibc2.35) - method: GET - uri: https://eastus2euap.management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96?api-version=2024-02-01-preview&t=638611553773460250&c=MIIHhjCCBm6gAwIBAgITHgUK3uZNXW0rELEWgAAABQre5jANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDYwHhcNMjQwNzI3MTIwMjAwWhcNMjQxMDI1MTIwMjAwWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALOp9mTbesFKlLY5kaubRq1NFmzMIRssJxSdGLLsTSNZCUTbJ7ozK0IiDfLVQCXyBqGrO3PYMBmeJEMdtKRsd00pJzflYkIE7nnXJBFw-sTxMSt4zsLsbXBMl4dGzNmrGZkYRrhFOSLC122KClMAs8DXhEcJU2_mol-1pxp42MCiq4jkKicedYt3GlUvVl3uSJyeiHw77qxa3x0QbuUm1DszpHTwyHp3x4hfUAwS6TWrZ929rowQ1y96k1x7RKmAIwamEzeg79Q5rsuLDW7yTX3Pg7sp7h3hbBjXeToCLa31ndkNFF9aoSLU3O-xO177GGKO6lhbIpHECNAaCtrFp6ECAwEAAaOCBHMwggRvMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwIwCgYIKwYBBQUHAwEwPAYJKwYBBAGCNxUHBC8wLQYlKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFgh8fIENbYcQIBZAIBBjCCAcsGCCsGAQUFBwEBBIIBvTCCAbkwYwYIKwYBBQUHMAKGV2h0dHA6Ly9jcmwubWljcm9zb2Z0LmNvbS9wa2lpbmZyYS9DZXJ0cy9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDEuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmwyLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MFMGCCsGAQUFBzAChkdodHRwOi8vY3JsMy5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDQuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwHQYDVR0OBBYEFOL38Ka708l__wglsKzbwvptKgiNMA4GA1UdDwEB_wQEAwIFoDCCASYGA1UdHwSCAR0wggEZMIIBFaCCARGgggENhj9odHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ1JML0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwxLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwyLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmwzLmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmyGMWh0dHA6Ly9jcmw0LmFtZS5nYmwvY3JsL0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcmwwgZ0GA1UdIASBlTCBkjAMBgorBgEEAYI3ewEBMGYGCisGAQQBgjd7AgIwWDBWBggrBgEFBQcCAjBKHkgAMwAzAGUAMAAxADkAMgAxAC0ANABkADYANAAtADQAZgA4AGMALQBhADAANQA1AC0ANQBiAGQAYQBmAGYAZAA1AGUAMwAzAGQwDAYKKwYBBAGCN3sDATAMBgorBgEEAYI3ewQBMB8GA1UdIwQYMBaAFPFGaMbxw_ArLX2LauGy-b41_NFBMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATANBgkqhkiG9w0BAQsFAAOCAQEAOjvtmgGG_gQTCeRcW03oj3kuNjkaOoixOTlz3lAC2IQY_-4SRz6Y1-eEdGjDgSL5trZKjpas64eIIdZzKfAeRUiIfIQHFtlEGG-nOH9acyDkUY04bgQhSkkQ7vkiLB95C7sAKLweobXMkBlMNjBNGbJkY_9bCVP_Qgv3ACF5VfFnpj76iqtgNm3IMgoKQWsFliPj6UF8bkP0y2e-hZWKSWTeQIqDscIjvCXo-CAkMzJ7twtIAzttmQQ3UKLeI2kWwO4ZKOFoczpWVNJXtOAk155DuJIZL-A2nNR9xirNPNwpZlKaBwaek91rnTFgaOTCCrG2DFXpg97eI6UL0RrLKQ&s=VramQI0NrVWH41AUWl06xCxbcvI9gdTM-WZOwmcw2_-VLytdhGIYjPH8dfIZ51nFVp_0r02xqxnh3L2IxWPYC8NdWZI3bPPLcAXYNvxWpyax3qkf6hYfWVO36FsePIl4hyUN9DZ5A30y22ayrEoFnkMpm45h881nbtYXPCVulPX51cHG5p7UfoVu_HcRWrfcnlIRuX9tl4gVntZNdXDrNC42BUKjOQXmxfw96jNKOXVNa1S-b4cs2Alj5fZfVAFbmQExO2MCmmNXldZO9aN8NzxLXxZujviFWPcsFwR5-XKgU3SG0C7pA2WGRJqO9VW58gpv71SViad5KMXFqG4jKg&h=ProYQfUxtt5Nar3hDS_12XaCjhZGqlr-9OEA94kmTt4 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DurableTask/locations/NORTHCENTRALUS/operationStatuses/dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","name":"dc3d8ce3-1f77-4c33-8179-b322fd20f82f*C3BBC5036DF900FCC3B84B567E0D262F0AAAB037964665307533D036414F4C96","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_durabletask000001/providers/Microsoft.DurableTask/namespaces/test1","status":"Accepted","startTime":"2024-09-05T17:49:36.8327173Z"}' - headers: - cache-control: - - no-cache - content-length: - - '569' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 05 Sep 2024 17:55:08 GMT - etag: - - '"b7003d3c-0000-0100-0000-66d9ef300000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE - x-content-type-options: - - nosniff - x-ms-operation-identifier: - - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=c065741a-65a3-4502-b9c0-547929546b6f/eastus2euap/fdc86c27-359e-47bc-9fcd-05c5a39650b7 - x-msedge-ref: - - 'Ref A: DF98F9CE6499499799A40269257A550F Ref B: DM2EDGE0813 Ref C: 2024-09-05T17:55:08Z' - status: - code: 200 - message: OK -version: 1 diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/__init__.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/__init__.py deleted file mode 100644 index 72e3f428ab7..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/__init__.py +++ /dev/null @@ -1,26 +0,0 @@ -# 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 ._durabletask_mgmt_client import DurabletaskMgmtClient -from ._version import VERSION - -__version__ = VERSION - -try: - from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "DurabletaskMgmtClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) - -_patch_sdk() diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/_configuration.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/_configuration.py deleted file mode 100644 index 30cc72d5a01..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/_configuration.py +++ /dev/null @@ -1,65 +0,0 @@ -# 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.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy - -from ._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials import TokenCredential - - -class DurabletaskMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long - """Configuration for DurabletaskMgmtClient. - - 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. Required. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. - :type subscription_id: str - :keyword api_version: Api Version. Default value is "2024-02-01-preview". Note that overriding - this default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "2024-02-01-preview") - - 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.") - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = api_version - self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) - kwargs.setdefault("sdk_moniker", "mgmt-durabletask/{}".format(VERSION)) - self.polling_interval = kwargs.get("polling_interval", 30) - 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.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy( - self.credential, *self.credential_scopes, **kwargs - ) diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/_durabletask_mgmt_client.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/_durabletask_mgmt_client.py deleted file mode 100644 index e74190dc32d..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/_durabletask_mgmt_client.py +++ /dev/null @@ -1,118 +0,0 @@ -# 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 copy import deepcopy -from typing import Any, TYPE_CHECKING -from typing_extensions import Self - -from azure.core.pipeline import policies -from azure.core.rest import HttpRequest, HttpResponse -from azure.mgmt.core import ARMPipelineClient -from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy - -from . import models as _models -from ._configuration import DurabletaskMgmtClientConfiguration -from ._serialization import Deserializer, Serializer -from .operations import NamespacesOperations, Operations, TaskHubsOperations - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials import TokenCredential - - -class DurabletaskMgmtClient: # pylint: disable=client-accepts-api-version-keyword - """DurabletaskMgmtClient. - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.durabletask.operations.Operations - :ivar namespaces: NamespacesOperations operations - :vartype namespaces: azure.mgmt.durabletask.operations.NamespacesOperations - :ivar task_hubs: TaskHubsOperations operations - :vartype task_hubs: azure.mgmt.durabletask.operations.TaskHubsOperations - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. - :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". - :type base_url: str - :keyword api_version: Api Version. Default value is "2024-02-01-preview". Note that overriding - this default value may result in unsupported behavior. - :paramtype api_version: str - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - """ - - def __init__( - self, - credential: "TokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = DurabletaskMgmtClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs - ) - _policies = kwargs.pop("policies", None) - if _policies is None: - _policies = [ - policies.RequestIdPolicy(**kwargs), - self._config.headers_policy, - self._config.user_agent_policy, - self._config.proxy_policy, - policies.ContentDecodePolicy(**kwargs), - ARMAutoResourceProviderRegistrationPolicy(), - self._config.redirect_policy, - self._config.retry_policy, - self._config.authentication_policy, - self._config.custom_hook_policy, - self._config.logging_policy, - policies.DistributedTracingPolicy(**kwargs), - # policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, - self._config.http_logging_policy, - ] - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) - - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.namespaces = NamespacesOperations(self._client, self._config, self._serialize, self._deserialize) - self.task_hubs = TaskHubsOperations(self._client, self._config, self._serialize, self._deserialize) - - def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.HttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore - - def close(self) -> None: - self._client.close() - - def __enter__(self) -> Self: - self._client.__enter__() - return self - - def __exit__(self, *exc_details: Any) -> None: - self._client.__exit__(*exc_details) diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/_patch.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/_serialization.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/_serialization.py deleted file mode 100644 index 8139854b97b..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/_serialization.py +++ /dev/null @@ -1,2000 +0,0 @@ -# -------------------------------------------------------------------------- -# -# Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# -------------------------------------------------------------------------- - -# pylint: skip-file -# pyright: reportUnnecessaryTypeIgnoreComment=false - -from base64 import b64decode, b64encode -import calendar -import datetime -import decimal -import email -from enum import Enum -import json -import logging -import re -import sys -import codecs -from typing import ( - Dict, - Any, - cast, - Optional, - Union, - AnyStr, - IO, - Mapping, - Callable, - TypeVar, - MutableMapping, - Type, - List, - Mapping, -) - -try: - from urllib import quote # type: ignore -except ImportError: - from urllib.parse import quote -import xml.etree.ElementTree as ET - -import isodate # type: ignore - -from azure.core.exceptions import DeserializationError, SerializationError -from azure.core.serialization import NULL as CoreNull - -_BOM = codecs.BOM_UTF8.decode(encoding="utf-8") - -ModelType = TypeVar("ModelType", bound="Model") -JSON = MutableMapping[str, Any] - - -class RawDeserializer: - - # Accept "text" because we're open minded people... - JSON_REGEXP = re.compile(r"^(application|text)/([a-z+.]+\+)?json$") - - # Name used in context - CONTEXT_NAME = "deserialized_data" - - @classmethod - def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: Optional[str] = None) -> Any: - """Decode data according to content-type. - - Accept a stream of data as well, but will be load at once in memory for now. - - If no content-type, will return the string version (not bytes, not stream) - - :param data: Input, could be bytes or stream (will be decoded with UTF8) or text - :type data: str or bytes or IO - :param str content_type: The content type. - """ - if hasattr(data, "read"): - # Assume a stream - data = cast(IO, data).read() - - if isinstance(data, bytes): - data_as_str = data.decode(encoding="utf-8-sig") - else: - # Explain to mypy the correct type. - data_as_str = cast(str, data) - - # Remove Byte Order Mark if present in string - data_as_str = data_as_str.lstrip(_BOM) - - if content_type is None: - return data - - if cls.JSON_REGEXP.match(content_type): - try: - return json.loads(data_as_str) - except ValueError as err: - raise DeserializationError("JSON is invalid: {}".format(err), err) - elif "xml" in (content_type or []): - try: - - try: - if isinstance(data, unicode): # type: ignore - # If I'm Python 2.7 and unicode XML will scream if I try a "fromstring" on unicode string - data_as_str = data_as_str.encode(encoding="utf-8") # type: ignore - except NameError: - pass - - return ET.fromstring(data_as_str) # nosec - except ET.ParseError as err: - # It might be because the server has an issue, and returned JSON with - # content-type XML.... - # So let's try a JSON load, and if it's still broken - # let's flow the initial exception - def _json_attemp(data): - try: - return True, json.loads(data) - except ValueError: - return False, None # Don't care about this one - - success, json_result = _json_attemp(data) - if success: - return json_result - # If i'm here, it's not JSON, it's not XML, let's scream - # and raise the last context in this block (the XML exception) - # The function hack is because Py2.7 messes up with exception - # context otherwise. - _LOGGER.critical("Wasn't XML not JSON, failing") - raise DeserializationError("XML is invalid") from err - elif content_type.startswith("text/"): - return data_as_str - raise DeserializationError("Cannot deserialize content-type: {}".format(content_type)) - - @classmethod - def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], headers: Mapping) -> Any: - """Deserialize from HTTP response. - - Use bytes and headers to NOT use any requests/aiohttp or whatever - specific implementation. - Headers will tested for "content-type" - """ - # Try to use content-type from headers if available - content_type = None - if "content-type" in headers: - content_type = headers["content-type"].split(";")[0].strip().lower() - # Ouch, this server did not declare what it sent... - # Let's guess it's JSON... - # Also, since Autorest was considering that an empty body was a valid JSON, - # need that test as well.... - else: - content_type = "application/json" - - if body_bytes: - return cls.deserialize_from_text(body_bytes, content_type) - return None - - -_LOGGER = logging.getLogger(__name__) - -try: - _long_type = long # type: ignore -except NameError: - _long_type = int - - -class UTC(datetime.tzinfo): - """Time Zone info for handling UTC""" - - def utcoffset(self, dt): - """UTF offset for UTC is 0.""" - return datetime.timedelta(0) - - def tzname(self, dt): - """Timestamp representation.""" - return "Z" - - def dst(self, dt): - """No daylight saving for UTC.""" - return datetime.timedelta(hours=1) - - -try: - from datetime import timezone as _FixedOffset # type: ignore -except ImportError: # Python 2.7 - - class _FixedOffset(datetime.tzinfo): # type: ignore - """Fixed offset in minutes east from UTC. - Copy/pasted from Python doc - :param datetime.timedelta offset: offset in timedelta format - """ - - def __init__(self, offset): - self.__offset = offset - - def utcoffset(self, dt): - return self.__offset - - def tzname(self, dt): - return str(self.__offset.total_seconds() / 3600) - - def __repr__(self): - return "".format(self.tzname(None)) - - def dst(self, dt): - return datetime.timedelta(0) - - def __getinitargs__(self): - return (self.__offset,) - - -try: - from datetime import timezone - - TZ_UTC = timezone.utc -except ImportError: - TZ_UTC = UTC() # type: ignore - -_FLATTEN = re.compile(r"(? None: - self.additional_properties: Optional[Dict[str, Any]] = {} - for k in kwargs: - if k not in self._attribute_map: - _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) - elif k in self._validation and self._validation[k].get("readonly", False): - _LOGGER.warning("Readonly attribute %s will be ignored in class %s", k, self.__class__) - else: - setattr(self, k, kwargs[k]) - - def __eq__(self, other: Any) -> bool: - """Compare objects by comparing all attributes.""" - if isinstance(other, self.__class__): - return self.__dict__ == other.__dict__ - return False - - def __ne__(self, other: Any) -> bool: - """Compare objects by comparing all attributes.""" - return not self.__eq__(other) - - def __str__(self) -> str: - return str(self.__dict__) - - @classmethod - def enable_additional_properties_sending(cls) -> None: - cls._attribute_map["additional_properties"] = {"key": "", "type": "{object}"} - - @classmethod - def is_xml_model(cls) -> bool: - try: - cls._xml_map # type: ignore - except AttributeError: - return False - return True - - @classmethod - def _create_xml_node(cls): - """Create XML node.""" - try: - xml_map = cls._xml_map # type: ignore - except AttributeError: - xml_map = {} - - return _create_xml_node(xml_map.get("name", cls.__name__), xml_map.get("prefix", None), xml_map.get("ns", None)) - - def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: - """Return the JSON that would be sent to server from this model. - - This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`. - - If you want XML serialization, you can pass the kwargs is_xml=True. - - :param bool keep_readonly: If you want to serialize the readonly attributes - :returns: A dict JSON compatible object - :rtype: dict - """ - serializer = Serializer(self._infer_class_models()) - return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) # type: ignore - - def as_dict( - self, - keep_readonly: bool = True, - key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, - **kwargs: Any - ) -> JSON: - """Return a dict that can be serialized using json.dump. - - Advanced usage might optionally use a callback as parameter: - - .. code::python - - def my_key_transformer(key, attr_desc, value): - return key - - Key is the attribute name used in Python. Attr_desc - is a dict of metadata. Currently contains 'type' with the - msrest type and 'key' with the RestAPI encoded key. - Value is the current value in this object. - - The string returned will be used to serialize the key. - If the return type is a list, this is considered hierarchical - result dict. - - See the three examples in this file: - - - attribute_transformer - - full_restapi_key_transformer - - last_restapi_key_transformer - - If you want XML serialization, you can pass the kwargs is_xml=True. - - :param function key_transformer: A key transformer function. - :returns: A dict JSON compatible object - :rtype: dict - """ - serializer = Serializer(self._infer_class_models()) - return serializer._serialize(self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs) # type: ignore - - @classmethod - def _infer_class_models(cls): - try: - str_models = cls.__module__.rsplit(".", 1)[0] - models = sys.modules[str_models] - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - if cls.__name__ not in client_models: - raise ValueError("Not Autorest generated code") - except Exception: - # Assume it's not Autorest generated (tests?). Add ourselves as dependencies. - client_models = {cls.__name__: cls} - return client_models - - @classmethod - def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType: - """Parse a str using the RestAPI syntax and return a model. - - :param str data: A str using RestAPI structure. JSON by default. - :param str content_type: JSON by default, set application/xml if XML. - :returns: An instance of this model - :raises: DeserializationError if something went wrong - """ - deserializer = Deserializer(cls._infer_class_models()) - return deserializer(cls.__name__, data, content_type=content_type) # type: ignore - - @classmethod - def from_dict( - cls: Type[ModelType], - data: Any, - key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, - content_type: Optional[str] = None, - ) -> ModelType: - """Parse a dict using given key extractor return a model. - - By default consider key - extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor - and last_rest_key_case_insensitive_extractor) - - :param dict data: A dict using RestAPI structure - :param str content_type: JSON by default, set application/xml if XML. - :returns: An instance of this model - :raises: DeserializationError if something went wrong - """ - deserializer = Deserializer(cls._infer_class_models()) - deserializer.key_extractors = ( # type: ignore - [ # type: ignore - attribute_key_case_insensitive_extractor, - rest_key_case_insensitive_extractor, - last_rest_key_case_insensitive_extractor, - ] - if key_extractors is None - else key_extractors - ) - return deserializer(cls.__name__, data, content_type=content_type) # type: ignore - - @classmethod - def _flatten_subtype(cls, key, objects): - if "_subtype_map" not in cls.__dict__: - return {} - result = dict(cls._subtype_map[key]) - for valuetype in cls._subtype_map[key].values(): - result.update(objects[valuetype]._flatten_subtype(key, objects)) - return result - - @classmethod - def _classify(cls, response, objects): - """Check the class _subtype_map for any child classes. - We want to ignore any inherited _subtype_maps. - Remove the polymorphic key from the initial data. - """ - for subtype_key in cls.__dict__.get("_subtype_map", {}).keys(): - subtype_value = None - - if not isinstance(response, ET.Element): - rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1] - subtype_value = response.pop(rest_api_response_key, None) or response.pop(subtype_key, None) - else: - subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response) - if subtype_value: - # Try to match base class. Can be class name only - # (bug to fix in Autorest to support x-ms-discriminator-name) - if cls.__name__ == subtype_value: - return cls - flatten_mapping_type = cls._flatten_subtype(subtype_key, objects) - try: - return objects[flatten_mapping_type[subtype_value]] # type: ignore - except KeyError: - _LOGGER.warning( - "Subtype value %s has no mapping, use base class %s.", - subtype_value, - cls.__name__, - ) - break - else: - _LOGGER.warning("Discriminator %s is absent or null, use base class %s.", subtype_key, cls.__name__) - break - return cls - - @classmethod - def _get_rest_key_parts(cls, attr_key): - """Get the RestAPI key of this attr, split it and decode part - :param str attr_key: Attribute key must be in attribute_map. - :returns: A list of RestAPI part - :rtype: list - """ - rest_split_key = _FLATTEN.split(cls._attribute_map[attr_key]["key"]) - return [_decode_attribute_map_key(key_part) for key_part in rest_split_key] - - -def _decode_attribute_map_key(key): - """This decode a key in an _attribute_map to the actual key we want to look at - inside the received data. - - :param str key: A key string from the generated code - """ - return key.replace("\\.", ".") - - -class Serializer(object): - """Request object model serializer.""" - - basic_types = {str: "str", int: "int", bool: "bool", float: "float"} - - _xml_basic_types_serializers = {"bool": lambda x: str(x).lower()} - days = {0: "Mon", 1: "Tue", 2: "Wed", 3: "Thu", 4: "Fri", 5: "Sat", 6: "Sun"} - months = { - 1: "Jan", - 2: "Feb", - 3: "Mar", - 4: "Apr", - 5: "May", - 6: "Jun", - 7: "Jul", - 8: "Aug", - 9: "Sep", - 10: "Oct", - 11: "Nov", - 12: "Dec", - } - validation = { - "min_length": lambda x, y: len(x) < y, - "max_length": lambda x, y: len(x) > y, - "minimum": lambda x, y: x < y, - "maximum": lambda x, y: x > y, - "minimum_ex": lambda x, y: x <= y, - "maximum_ex": lambda x, y: x >= y, - "min_items": lambda x, y: len(x) < y, - "max_items": lambda x, y: len(x) > y, - "pattern": lambda x, y: not re.match(y, x, re.UNICODE), - "unique": lambda x, y: len(x) != len(set(x)), - "multiple": lambda x, y: x % y != 0, - } - - def __init__(self, classes: Optional[Mapping[str, type]] = None): - self.serialize_type = { - "iso-8601": Serializer.serialize_iso, - "rfc-1123": Serializer.serialize_rfc, - "unix-time": Serializer.serialize_unix, - "duration": Serializer.serialize_duration, - "date": Serializer.serialize_date, - "time": Serializer.serialize_time, - "decimal": Serializer.serialize_decimal, - "long": Serializer.serialize_long, - "bytearray": Serializer.serialize_bytearray, - "base64": Serializer.serialize_base64, - "object": self.serialize_object, - "[]": self.serialize_iter, - "{}": self.serialize_dict, - } - self.dependencies: Dict[str, type] = dict(classes) if classes else {} - self.key_transformer = full_restapi_key_transformer - self.client_side_validation = True - - def _serialize(self, target_obj, data_type=None, **kwargs): - """Serialize data into a string according to type. - - :param target_obj: The data to be serialized. - :param str data_type: The type to be serialized from. - :rtype: str, dict - :raises: SerializationError if serialization fails. - """ - key_transformer = kwargs.get("key_transformer", self.key_transformer) - keep_readonly = kwargs.get("keep_readonly", False) - if target_obj is None: - return None - - attr_name = None - class_name = target_obj.__class__.__name__ - - if data_type: - return self.serialize_data(target_obj, data_type, **kwargs) - - if not hasattr(target_obj, "_attribute_map"): - data_type = type(target_obj).__name__ - if data_type in self.basic_types.values(): - return self.serialize_data(target_obj, data_type, **kwargs) - - # Force "is_xml" kwargs if we detect a XML model - try: - is_xml_model_serialization = kwargs["is_xml"] - except KeyError: - is_xml_model_serialization = kwargs.setdefault("is_xml", target_obj.is_xml_model()) - - serialized = {} - if is_xml_model_serialization: - serialized = target_obj._create_xml_node() - try: - attributes = target_obj._attribute_map - for attr, attr_desc in attributes.items(): - attr_name = attr - if not keep_readonly and target_obj._validation.get(attr_name, {}).get("readonly", False): - continue - - if attr_name == "additional_properties" and attr_desc["key"] == "": - if target_obj.additional_properties is not None: - serialized.update(target_obj.additional_properties) - continue - try: - - orig_attr = getattr(target_obj, attr) - if is_xml_model_serialization: - pass # Don't provide "transformer" for XML for now. Keep "orig_attr" - else: # JSON - keys, orig_attr = key_transformer(attr, attr_desc.copy(), orig_attr) - keys = keys if isinstance(keys, list) else [keys] - - kwargs["serialization_ctxt"] = attr_desc - new_attr = self.serialize_data(orig_attr, attr_desc["type"], **kwargs) - - if is_xml_model_serialization: - xml_desc = attr_desc.get("xml", {}) - xml_name = xml_desc.get("name", attr_desc["key"]) - xml_prefix = xml_desc.get("prefix", None) - xml_ns = xml_desc.get("ns", None) - if xml_desc.get("attr", False): - if xml_ns: - ET.register_namespace(xml_prefix, xml_ns) - xml_name = "{{{}}}{}".format(xml_ns, xml_name) - serialized.set(xml_name, new_attr) # type: ignore - continue - if xml_desc.get("text", False): - serialized.text = new_attr # type: ignore - continue - if isinstance(new_attr, list): - serialized.extend(new_attr) # type: ignore - elif isinstance(new_attr, ET.Element): - # If the down XML has no XML/Name, we MUST replace the tag with the local tag. But keeping the namespaces. - if "name" not in getattr(orig_attr, "_xml_map", {}): - splitted_tag = new_attr.tag.split("}") - if len(splitted_tag) == 2: # Namespace - new_attr.tag = "}".join([splitted_tag[0], xml_name]) - else: - new_attr.tag = xml_name - serialized.append(new_attr) # type: ignore - else: # That's a basic type - # Integrate namespace if necessary - local_node = _create_xml_node(xml_name, xml_prefix, xml_ns) - local_node.text = str(new_attr) - serialized.append(local_node) # type: ignore - else: # JSON - for k in reversed(keys): # type: ignore - new_attr = {k: new_attr} - - _new_attr = new_attr - _serialized = serialized - for k in keys: # type: ignore - if k not in _serialized: - _serialized.update(_new_attr) # type: ignore - _new_attr = _new_attr[k] # type: ignore - _serialized = _serialized[k] - except ValueError as err: - if isinstance(err, SerializationError): - raise - - except (AttributeError, KeyError, TypeError) as err: - msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) - raise SerializationError(msg) from err - else: - return serialized - - def body(self, data, data_type, **kwargs): - """Serialize data intended for a request body. - - :param data: The data to be serialized. - :param str data_type: The type to be serialized from. - :rtype: dict - :raises: SerializationError if serialization fails. - :raises: ValueError if data is None - """ - - # Just in case this is a dict - internal_data_type_str = data_type.strip("[]{}") - internal_data_type = self.dependencies.get(internal_data_type_str, None) - try: - is_xml_model_serialization = kwargs["is_xml"] - except KeyError: - if internal_data_type and issubclass(internal_data_type, Model): - is_xml_model_serialization = kwargs.setdefault("is_xml", internal_data_type.is_xml_model()) - else: - is_xml_model_serialization = False - if internal_data_type and not isinstance(internal_data_type, Enum): - try: - deserializer = Deserializer(self.dependencies) - # Since it's on serialization, it's almost sure that format is not JSON REST - # We're not able to deal with additional properties for now. - deserializer.additional_properties_detection = False - if is_xml_model_serialization: - deserializer.key_extractors = [ # type: ignore - attribute_key_case_insensitive_extractor, - ] - else: - deserializer.key_extractors = [ - rest_key_case_insensitive_extractor, - attribute_key_case_insensitive_extractor, - last_rest_key_case_insensitive_extractor, - ] - data = deserializer._deserialize(data_type, data) - except DeserializationError as err: - raise SerializationError("Unable to build a model: " + str(err)) from err - - return self._serialize(data, data_type, **kwargs) - - def url(self, name, data, data_type, **kwargs): - """Serialize data intended for a URL path. - - :param data: The data to be serialized. - :param str data_type: The type to be serialized from. - :rtype: str - :raises: TypeError if serialization fails. - :raises: ValueError if data is None - """ - try: - output = self.serialize_data(data, data_type, **kwargs) - if data_type == "bool": - output = json.dumps(output) - - if kwargs.get("skip_quote") is True: - output = str(output) - output = output.replace("{", quote("{")).replace("}", quote("}")) - else: - output = quote(str(output), safe="") - except SerializationError: - raise TypeError("{} must be type {}.".format(name, data_type)) - else: - return output - - def query(self, name, data, data_type, **kwargs): - """Serialize data intended for a URL query. - - :param data: The data to be serialized. - :param str data_type: The type to be serialized from. - :keyword bool skip_quote: Whether to skip quote the serialized result. - Defaults to False. - :rtype: str, list - :raises: TypeError if serialization fails. - :raises: ValueError if data is None - """ - try: - # Treat the list aside, since we don't want to encode the div separator - if data_type.startswith("["): - internal_data_type = data_type[1:-1] - do_quote = not kwargs.get("skip_quote", False) - return self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs) - - # Not a list, regular serialization - output = self.serialize_data(data, data_type, **kwargs) - if data_type == "bool": - output = json.dumps(output) - if kwargs.get("skip_quote") is True: - output = str(output) - else: - output = quote(str(output), safe="") - except SerializationError: - raise TypeError("{} must be type {}.".format(name, data_type)) - else: - return str(output) - - def header(self, name, data, data_type, **kwargs): - """Serialize data intended for a request header. - - :param data: The data to be serialized. - :param str data_type: The type to be serialized from. - :rtype: str - :raises: TypeError if serialization fails. - :raises: ValueError if data is None - """ - try: - if data_type in ["[str]"]: - data = ["" if d is None else d for d in data] - - output = self.serialize_data(data, data_type, **kwargs) - if data_type == "bool": - output = json.dumps(output) - except SerializationError: - raise TypeError("{} must be type {}.".format(name, data_type)) - else: - return str(output) - - def serialize_data(self, data, data_type, **kwargs): - """Serialize generic data according to supplied data type. - - :param data: The data to be serialized. - :param str data_type: The type to be serialized from. - :param bool required: Whether it's essential that the data not be - empty or None - :raises: AttributeError if required data is None. - :raises: ValueError if data is None - :raises: SerializationError if serialization fails. - """ - if data is None: - raise ValueError("No value for given attribute") - - try: - if data is CoreNull: - return None - if data_type in self.basic_types.values(): - return self.serialize_basic(data, data_type, **kwargs) - - elif data_type in self.serialize_type: - return self.serialize_type[data_type](data, **kwargs) - - # If dependencies is empty, try with current data class - # It has to be a subclass of Enum anyway - enum_type = self.dependencies.get(data_type, data.__class__) - if issubclass(enum_type, Enum): - return Serializer.serialize_enum(data, enum_obj=enum_type) - - iter_type = data_type[0] + data_type[-1] - if iter_type in self.serialize_type: - return self.serialize_type[iter_type](data, data_type[1:-1], **kwargs) - - except (ValueError, TypeError) as err: - msg = "Unable to serialize value: {!r} as type: {!r}." - raise SerializationError(msg.format(data, data_type)) from err - else: - return self._serialize(data, **kwargs) - - @classmethod - def _get_custom_serializers(cls, data_type, **kwargs): - custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type) - if custom_serializer: - return custom_serializer - if kwargs.get("is_xml", False): - return cls._xml_basic_types_serializers.get(data_type) - - @classmethod - def serialize_basic(cls, data, data_type, **kwargs): - """Serialize basic builting data type. - Serializes objects to str, int, float or bool. - - Possible kwargs: - - basic_types_serializers dict[str, callable] : If set, use the callable as serializer - - is_xml bool : If set, use xml_basic_types_serializers - - :param data: Object to be serialized. - :param str data_type: Type of object in the iterable. - """ - custom_serializer = cls._get_custom_serializers(data_type, **kwargs) - if custom_serializer: - return custom_serializer(data) - if data_type == "str": - return cls.serialize_unicode(data) - return eval(data_type)(data) # nosec - - @classmethod - def serialize_unicode(cls, data): - """Special handling for serializing unicode strings in Py2. - Encode to UTF-8 if unicode, otherwise handle as a str. - - :param data: Object to be serialized. - :rtype: str - """ - try: # If I received an enum, return its value - return data.value - except AttributeError: - pass - - try: - if isinstance(data, unicode): # type: ignore - # Don't change it, JSON and XML ElementTree are totally able - # to serialize correctly u'' strings - return data - except NameError: - return str(data) - else: - return str(data) - - def serialize_iter(self, data, iter_type, div=None, **kwargs): - """Serialize iterable. - - Supported kwargs: - - serialization_ctxt dict : The current entry of _attribute_map, or same format. - serialization_ctxt['type'] should be same as data_type. - - is_xml bool : If set, serialize as XML - - :param list attr: Object to be serialized. - :param str iter_type: Type of object in the iterable. - :param bool required: Whether the objects in the iterable must - not be None or empty. - :param str div: If set, this str will be used to combine the elements - in the iterable into a combined string. Default is 'None'. - :keyword bool do_quote: Whether to quote the serialized result of each iterable element. - Defaults to False. - :rtype: list, str - """ - if isinstance(data, str): - raise SerializationError("Refuse str type as a valid iter type.") - - serialization_ctxt = kwargs.get("serialization_ctxt", {}) - is_xml = kwargs.get("is_xml", False) - - serialized = [] - for d in data: - try: - serialized.append(self.serialize_data(d, iter_type, **kwargs)) - except ValueError as err: - if isinstance(err, SerializationError): - raise - serialized.append(None) - - if kwargs.get("do_quote", False): - serialized = ["" if s is None else quote(str(s), safe="") for s in serialized] - - if div: - serialized = ["" if s is None else str(s) for s in serialized] - serialized = div.join(serialized) - - if "xml" in serialization_ctxt or is_xml: - # XML serialization is more complicated - xml_desc = serialization_ctxt.get("xml", {}) - xml_name = xml_desc.get("name") - if not xml_name: - xml_name = serialization_ctxt["key"] - - # Create a wrap node if necessary (use the fact that Element and list have "append") - is_wrapped = xml_desc.get("wrapped", False) - node_name = xml_desc.get("itemsName", xml_name) - if is_wrapped: - final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) - else: - final_result = [] - # All list elements to "local_node" - for el in serialized: - if isinstance(el, ET.Element): - el_node = el - else: - el_node = _create_xml_node(node_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) - if el is not None: # Otherwise it writes "None" :-p - el_node.text = str(el) - final_result.append(el_node) - return final_result - return serialized - - def serialize_dict(self, attr, dict_type, **kwargs): - """Serialize a dictionary of objects. - - :param dict attr: Object to be serialized. - :param str dict_type: Type of object in the dictionary. - :param bool required: Whether the objects in the dictionary must - not be None or empty. - :rtype: dict - """ - serialization_ctxt = kwargs.get("serialization_ctxt", {}) - serialized = {} - for key, value in attr.items(): - try: - serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) - except ValueError as err: - if isinstance(err, SerializationError): - raise - serialized[self.serialize_unicode(key)] = None - - if "xml" in serialization_ctxt: - # XML serialization is more complicated - xml_desc = serialization_ctxt["xml"] - xml_name = xml_desc["name"] - - final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) - for key, value in serialized.items(): - ET.SubElement(final_result, key).text = value - return final_result - - return serialized - - def serialize_object(self, attr, **kwargs): - """Serialize a generic object. - This will be handled as a dictionary. If object passed in is not - a basic type (str, int, float, dict, list) it will simply be - cast to str. - - :param dict attr: Object to be serialized. - :rtype: dict or str - """ - if attr is None: - return None - if isinstance(attr, ET.Element): - return attr - obj_type = type(attr) - if obj_type in self.basic_types: - return self.serialize_basic(attr, self.basic_types[obj_type], **kwargs) - if obj_type is _long_type: - return self.serialize_long(attr) - if obj_type is str: - return self.serialize_unicode(attr) - if obj_type is datetime.datetime: - return self.serialize_iso(attr) - if obj_type is datetime.date: - return self.serialize_date(attr) - if obj_type is datetime.time: - return self.serialize_time(attr) - if obj_type is datetime.timedelta: - return self.serialize_duration(attr) - if obj_type is decimal.Decimal: - return self.serialize_decimal(attr) - - # If it's a model or I know this dependency, serialize as a Model - elif obj_type in self.dependencies.values() or isinstance(attr, Model): - return self._serialize(attr) - - if obj_type == dict: - serialized = {} - for key, value in attr.items(): - try: - serialized[self.serialize_unicode(key)] = self.serialize_object(value, **kwargs) - except ValueError: - serialized[self.serialize_unicode(key)] = None - return serialized - - if obj_type == list: - serialized = [] - for obj in attr: - try: - serialized.append(self.serialize_object(obj, **kwargs)) - except ValueError: - pass - return serialized - return str(attr) - - @staticmethod - def serialize_enum(attr, enum_obj=None): - try: - result = attr.value - except AttributeError: - result = attr - try: - enum_obj(result) # type: ignore - return result - except ValueError: - for enum_value in enum_obj: # type: ignore - if enum_value.value.lower() == str(attr).lower(): - return enum_value.value - error = "{!r} is not valid value for enum {!r}" - raise SerializationError(error.format(attr, enum_obj)) - - @staticmethod - def serialize_bytearray(attr, **kwargs): - """Serialize bytearray into base-64 string. - - :param attr: Object to be serialized. - :rtype: str - """ - return b64encode(attr).decode() - - @staticmethod - def serialize_base64(attr, **kwargs): - """Serialize str into base-64 string. - - :param attr: Object to be serialized. - :rtype: str - """ - encoded = b64encode(attr).decode("ascii") - return encoded.strip("=").replace("+", "-").replace("/", "_") - - @staticmethod - def serialize_decimal(attr, **kwargs): - """Serialize Decimal object to float. - - :param attr: Object to be serialized. - :rtype: float - """ - return float(attr) - - @staticmethod - def serialize_long(attr, **kwargs): - """Serialize long (Py2) or int (Py3). - - :param attr: Object to be serialized. - :rtype: int/long - """ - return _long_type(attr) - - @staticmethod - def serialize_date(attr, **kwargs): - """Serialize Date object into ISO-8601 formatted string. - - :param Date attr: Object to be serialized. - :rtype: str - """ - if isinstance(attr, str): - attr = isodate.parse_date(attr) - t = "{:04}-{:02}-{:02}".format(attr.year, attr.month, attr.day) - return t - - @staticmethod - def serialize_time(attr, **kwargs): - """Serialize Time object into ISO-8601 formatted string. - - :param datetime.time attr: Object to be serialized. - :rtype: str - """ - if isinstance(attr, str): - attr = isodate.parse_time(attr) - t = "{:02}:{:02}:{:02}".format(attr.hour, attr.minute, attr.second) - if attr.microsecond: - t += ".{:02}".format(attr.microsecond) - return t - - @staticmethod - def serialize_duration(attr, **kwargs): - """Serialize TimeDelta object into ISO-8601 formatted string. - - :param TimeDelta attr: Object to be serialized. - :rtype: str - """ - if isinstance(attr, str): - attr = isodate.parse_duration(attr) - return isodate.duration_isoformat(attr) - - @staticmethod - def serialize_rfc(attr, **kwargs): - """Serialize Datetime object into RFC-1123 formatted string. - - :param Datetime attr: Object to be serialized. - :rtype: str - :raises: TypeError if format invalid. - """ - try: - if not attr.tzinfo: - _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") - utc = attr.utctimetuple() - except AttributeError: - raise TypeError("RFC1123 object must be valid Datetime object.") - - return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format( - Serializer.days[utc.tm_wday], - utc.tm_mday, - Serializer.months[utc.tm_mon], - utc.tm_year, - utc.tm_hour, - utc.tm_min, - utc.tm_sec, - ) - - @staticmethod - def serialize_iso(attr, **kwargs): - """Serialize Datetime object into ISO-8601 formatted string. - - :param Datetime attr: Object to be serialized. - :rtype: str - :raises: SerializationError if format invalid. - """ - if isinstance(attr, str): - attr = isodate.parse_datetime(attr) - try: - if not attr.tzinfo: - _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") - utc = attr.utctimetuple() - if utc.tm_year > 9999 or utc.tm_year < 1: - raise OverflowError("Hit max or min date") - - microseconds = str(attr.microsecond).rjust(6, "0").rstrip("0").ljust(3, "0") - if microseconds: - microseconds = "." + microseconds - date = "{:04}-{:02}-{:02}T{:02}:{:02}:{:02}".format( - utc.tm_year, utc.tm_mon, utc.tm_mday, utc.tm_hour, utc.tm_min, utc.tm_sec - ) - return date + microseconds + "Z" - except (ValueError, OverflowError) as err: - msg = "Unable to serialize datetime object." - raise SerializationError(msg) from err - except AttributeError as err: - msg = "ISO-8601 object must be valid Datetime object." - raise TypeError(msg) from err - - @staticmethod - def serialize_unix(attr, **kwargs): - """Serialize Datetime object into IntTime format. - This is represented as seconds. - - :param Datetime attr: Object to be serialized. - :rtype: int - :raises: SerializationError if format invalid - """ - if isinstance(attr, int): - return attr - try: - if not attr.tzinfo: - _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") - return int(calendar.timegm(attr.utctimetuple())) - except AttributeError: - raise TypeError("Unix time object must be valid Datetime object.") - - -def rest_key_extractor(attr, attr_desc, data): - key = attr_desc["key"] - working_data = data - - while "." in key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - dict_keys = cast(List[str], _FLATTEN.split(key)) - if len(dict_keys) == 1: - key = _decode_attribute_map_key(dict_keys[0]) - break - working_key = _decode_attribute_map_key(dict_keys[0]) - working_data = working_data.get(working_key, data) - if working_data is None: - # If at any point while following flatten JSON path see None, it means - # that all properties under are None as well - return None - key = ".".join(dict_keys[1:]) - - return working_data.get(key) - - -def rest_key_case_insensitive_extractor(attr, attr_desc, data): - key = attr_desc["key"] - working_data = data - - while "." in key: - dict_keys = _FLATTEN.split(key) - if len(dict_keys) == 1: - key = _decode_attribute_map_key(dict_keys[0]) - break - working_key = _decode_attribute_map_key(dict_keys[0]) - working_data = attribute_key_case_insensitive_extractor(working_key, None, working_data) - if working_data is None: - # If at any point while following flatten JSON path see None, it means - # that all properties under are None as well - return None - key = ".".join(dict_keys[1:]) - - if working_data: - return attribute_key_case_insensitive_extractor(key, None, working_data) - - -def last_rest_key_extractor(attr, attr_desc, data): - """Extract the attribute in "data" based on the last part of the JSON path key.""" - key = attr_desc["key"] - dict_keys = _FLATTEN.split(key) - return attribute_key_extractor(dict_keys[-1], None, data) - - -def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): - """Extract the attribute in "data" based on the last part of the JSON path key. - - This is the case insensitive version of "last_rest_key_extractor" - """ - key = attr_desc["key"] - dict_keys = _FLATTEN.split(key) - return attribute_key_case_insensitive_extractor(dict_keys[-1], None, data) - - -def attribute_key_extractor(attr, _, data): - return data.get(attr) - - -def attribute_key_case_insensitive_extractor(attr, _, data): - found_key = None - lower_attr = attr.lower() - for key in data: - if lower_attr == key.lower(): - found_key = key - break - - return data.get(found_key) - - -def _extract_name_from_internal_type(internal_type): - """Given an internal type XML description, extract correct XML name with namespace. - - :param dict internal_type: An model type - :rtype: tuple - :returns: A tuple XML name + namespace dict - """ - internal_type_xml_map = getattr(internal_type, "_xml_map", {}) - xml_name = internal_type_xml_map.get("name", internal_type.__name__) - xml_ns = internal_type_xml_map.get("ns", None) - if xml_ns: - xml_name = "{{{}}}{}".format(xml_ns, xml_name) - return xml_name - - -def xml_key_extractor(attr, attr_desc, data): - if isinstance(data, dict): - return None - - # Test if this model is XML ready first - if not isinstance(data, ET.Element): - return None - - xml_desc = attr_desc.get("xml", {}) - xml_name = xml_desc.get("name", attr_desc["key"]) - - # Look for a children - is_iter_type = attr_desc["type"].startswith("[") - is_wrapped = xml_desc.get("wrapped", False) - internal_type = attr_desc.get("internalType", None) - internal_type_xml_map = getattr(internal_type, "_xml_map", {}) - - # Integrate namespace if necessary - xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None)) - if xml_ns: - xml_name = "{{{}}}{}".format(xml_ns, xml_name) - - # If it's an attribute, that's simple - if xml_desc.get("attr", False): - return data.get(xml_name) - - # If it's x-ms-text, that's simple too - if xml_desc.get("text", False): - return data.text - - # Scenario where I take the local name: - # - Wrapped node - # - Internal type is an enum (considered basic types) - # - Internal type has no XML/Name node - if is_wrapped or (internal_type and (issubclass(internal_type, Enum) or "name" not in internal_type_xml_map)): - children = data.findall(xml_name) - # If internal type has a local name and it's not a list, I use that name - elif not is_iter_type and internal_type and "name" in internal_type_xml_map: - xml_name = _extract_name_from_internal_type(internal_type) - children = data.findall(xml_name) - # That's an array - else: - if internal_type: # Complex type, ignore itemsName and use the complex type name - items_name = _extract_name_from_internal_type(internal_type) - else: - items_name = xml_desc.get("itemsName", xml_name) - children = data.findall(items_name) - - if len(children) == 0: - if is_iter_type: - if is_wrapped: - return None # is_wrapped no node, we want None - else: - return [] # not wrapped, assume empty list - return None # Assume it's not there, maybe an optional node. - - # If is_iter_type and not wrapped, return all found children - if is_iter_type: - if not is_wrapped: - return children - else: # Iter and wrapped, should have found one node only (the wrap one) - if len(children) != 1: - raise DeserializationError( - "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( - xml_name - ) - ) - return list(children[0]) # Might be empty list and that's ok. - - # Here it's not a itertype, we should have found one element only or empty - if len(children) > 1: - raise DeserializationError("Find several XML '{}' where it was not expected".format(xml_name)) - return children[0] - - -class Deserializer(object): - """Response object model deserializer. - - :param dict classes: Class type dictionary for deserializing complex types. - :ivar list key_extractors: Ordered list of extractors to be used by this deserializer. - """ - - basic_types = {str: "str", int: "int", bool: "bool", float: "float"} - - valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") - - def __init__(self, classes: Optional[Mapping[str, type]] = None): - self.deserialize_type = { - "iso-8601": Deserializer.deserialize_iso, - "rfc-1123": Deserializer.deserialize_rfc, - "unix-time": Deserializer.deserialize_unix, - "duration": Deserializer.deserialize_duration, - "date": Deserializer.deserialize_date, - "time": Deserializer.deserialize_time, - "decimal": Deserializer.deserialize_decimal, - "long": Deserializer.deserialize_long, - "bytearray": Deserializer.deserialize_bytearray, - "base64": Deserializer.deserialize_base64, - "object": self.deserialize_object, - "[]": self.deserialize_iter, - "{}": self.deserialize_dict, - } - self.deserialize_expected_types = { - "duration": (isodate.Duration, datetime.timedelta), - "iso-8601": (datetime.datetime), - } - self.dependencies: Dict[str, type] = dict(classes) if classes else {} - self.key_extractors = [rest_key_extractor, xml_key_extractor] - # Additional properties only works if the "rest_key_extractor" is used to - # extract the keys. Making it to work whatever the key extractor is too much - # complicated, with no real scenario for now. - # So adding a flag to disable additional properties detection. This flag should be - # used if your expect the deserialization to NOT come from a JSON REST syntax. - # Otherwise, result are unexpected - self.additional_properties_detection = True - - def __call__(self, target_obj, response_data, content_type=None): - """Call the deserializer to process a REST response. - - :param str target_obj: Target data type to deserialize to. - :param requests.Response response_data: REST response object. - :param str content_type: Swagger "produces" if available. - :raises: DeserializationError if deserialization fails. - :return: Deserialized object. - """ - data = self._unpack_content(response_data, content_type) - return self._deserialize(target_obj, data) - - def _deserialize(self, target_obj, data): - """Call the deserializer on a model. - - Data needs to be already deserialized as JSON or XML ElementTree - - :param str target_obj: Target data type to deserialize to. - :param object data: Object to deserialize. - :raises: DeserializationError if deserialization fails. - :return: Deserialized object. - """ - # This is already a model, go recursive just in case - if hasattr(data, "_attribute_map"): - constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")] - try: - for attr, mapconfig in data._attribute_map.items(): - if attr in constants: - continue - value = getattr(data, attr) - if value is None: - continue - local_type = mapconfig["type"] - internal_data_type = local_type.strip("[]{}") - if internal_data_type not in self.dependencies or isinstance(internal_data_type, Enum): - continue - setattr(data, attr, self._deserialize(local_type, value)) - return data - except AttributeError: - return - - response, class_name = self._classify_target(target_obj, data) - - if isinstance(response, str): - return self.deserialize_data(data, response) - elif isinstance(response, type) and issubclass(response, Enum): - return self.deserialize_enum(data, response) - - if data is None or data is CoreNull: - return data - try: - attributes = response._attribute_map # type: ignore - d_attrs = {} - for attr, attr_desc in attributes.items(): - # Check empty string. If it's not empty, someone has a real "additionalProperties"... - if attr == "additional_properties" and attr_desc["key"] == "": - continue - raw_value = None - # Enhance attr_desc with some dynamic data - attr_desc = attr_desc.copy() # Do a copy, do not change the real one - internal_data_type = attr_desc["type"].strip("[]{}") - if internal_data_type in self.dependencies: - attr_desc["internalType"] = self.dependencies[internal_data_type] - - for key_extractor in self.key_extractors: - found_value = key_extractor(attr, attr_desc, data) - if found_value is not None: - if raw_value is not None and raw_value != found_value: - msg = ( - "Ignoring extracted value '%s' from %s for key '%s'" - " (duplicate extraction, follow extractors order)" - ) - _LOGGER.warning(msg, found_value, key_extractor, attr) - continue - raw_value = found_value - - value = self.deserialize_data(raw_value, attr_desc["type"]) - d_attrs[attr] = value - except (AttributeError, TypeError, KeyError) as err: - msg = "Unable to deserialize to object: " + class_name # type: ignore - raise DeserializationError(msg) from err - else: - additional_properties = self._build_additional_properties(attributes, data) - return self._instantiate_model(response, d_attrs, additional_properties) - - def _build_additional_properties(self, attribute_map, data): - if not self.additional_properties_detection: - return None - if "additional_properties" in attribute_map and attribute_map.get("additional_properties", {}).get("key") != "": - # Check empty string. If it's not empty, someone has a real "additionalProperties" - return None - if isinstance(data, ET.Element): - data = {el.tag: el.text for el in data} - - known_keys = { - _decode_attribute_map_key(_FLATTEN.split(desc["key"])[0]) - for desc in attribute_map.values() - if desc["key"] != "" - } - present_keys = set(data.keys()) - missing_keys = present_keys - known_keys - return {key: data[key] for key in missing_keys} - - def _classify_target(self, target, data): - """Check to see whether the deserialization target object can - be classified into a subclass. - Once classification has been determined, initialize object. - - :param str target: The target object type to deserialize to. - :param str/dict data: The response data to deserialize. - """ - if target is None: - return None, None - - if isinstance(target, str): - try: - target = self.dependencies[target] - except KeyError: - return target, target - - try: - target = target._classify(data, self.dependencies) # type: ignore - except AttributeError: - pass # Target is not a Model, no classify - return target, target.__class__.__name__ # type: ignore - - def failsafe_deserialize(self, target_obj, data, content_type=None): - """Ignores any errors encountered in deserialization, - and falls back to not deserializing the object. Recommended - for use in error deserialization, as we want to return the - HttpResponseError to users, and not have them deal with - a deserialization error. - - :param str target_obj: The target object type to deserialize to. - :param str/dict data: The response data to deserialize. - :param str content_type: Swagger "produces" if available. - """ - try: - return self(target_obj, data, content_type=content_type) - except: - _LOGGER.debug( - "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True - ) - return None - - @staticmethod - def _unpack_content(raw_data, content_type=None): - """Extract the correct structure for deserialization. - - If raw_data is a PipelineResponse, try to extract the result of RawDeserializer. - if we can't, raise. Your Pipeline should have a RawDeserializer. - - If not a pipeline response and raw_data is bytes or string, use content-type - to decode it. If no content-type, try JSON. - - If raw_data is something else, bypass all logic and return it directly. - - :param raw_data: Data to be processed. - :param content_type: How to parse if raw_data is a string/bytes. - :raises JSONDecodeError: If JSON is requested and parsing is impossible. - :raises UnicodeDecodeError: If bytes is not UTF8 - """ - # Assume this is enough to detect a Pipeline Response without importing it - context = getattr(raw_data, "context", {}) - if context: - if RawDeserializer.CONTEXT_NAME in context: - return context[RawDeserializer.CONTEXT_NAME] - raise ValueError("This pipeline didn't have the RawDeserializer policy; can't deserialize") - - # Assume this is enough to recognize universal_http.ClientResponse without importing it - if hasattr(raw_data, "body"): - return RawDeserializer.deserialize_from_http_generics(raw_data.text(), raw_data.headers) - - # Assume this enough to recognize requests.Response without importing it. - if hasattr(raw_data, "_content_consumed"): - return RawDeserializer.deserialize_from_http_generics(raw_data.text, raw_data.headers) - - if isinstance(raw_data, (str, bytes)) or hasattr(raw_data, "read"): - return RawDeserializer.deserialize_from_text(raw_data, content_type) # type: ignore - return raw_data - - def _instantiate_model(self, response, attrs, additional_properties=None): - """Instantiate a response model passing in deserialized args. - - :param response: The response model class. - :param d_attrs: The deserialized response attributes. - """ - if callable(response): - subtype = getattr(response, "_subtype_map", {}) - try: - readonly = [k for k, v in response._validation.items() if v.get("readonly")] - const = [k for k, v in response._validation.items() if v.get("constant")] - kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} - response_obj = response(**kwargs) - for attr in readonly: - setattr(response_obj, attr, attrs.get(attr)) - if additional_properties: - response_obj.additional_properties = additional_properties - return response_obj - except TypeError as err: - msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore - raise DeserializationError(msg + str(err)) - else: - try: - for attr, value in attrs.items(): - setattr(response, attr, value) - return response - except Exception as exp: - msg = "Unable to populate response model. " - msg += "Type: {}, Error: {}".format(type(response), exp) - raise DeserializationError(msg) - - def deserialize_data(self, data, data_type): - """Process data for deserialization according to data type. - - :param str data: The response string to be deserialized. - :param str data_type: The type to deserialize to. - :raises: DeserializationError if deserialization fails. - :return: Deserialized object. - """ - if data is None: - return data - - try: - if not data_type: - return data - if data_type in self.basic_types.values(): - return self.deserialize_basic(data, data_type) - if data_type in self.deserialize_type: - if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())): - return data - - is_a_text_parsing_type = lambda x: x not in ["object", "[]", r"{}"] - if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text: - return None - data_val = self.deserialize_type[data_type](data) - return data_val - - iter_type = data_type[0] + data_type[-1] - if iter_type in self.deserialize_type: - return self.deserialize_type[iter_type](data, data_type[1:-1]) - - obj_type = self.dependencies[data_type] - if issubclass(obj_type, Enum): - if isinstance(data, ET.Element): - data = data.text - return self.deserialize_enum(data, obj_type) - - except (ValueError, TypeError, AttributeError) as err: - msg = "Unable to deserialize response data." - msg += " Data: {}, {}".format(data, data_type) - raise DeserializationError(msg) from err - else: - return self._deserialize(obj_type, data) - - def deserialize_iter(self, attr, iter_type): - """Deserialize an iterable. - - :param list attr: Iterable to be deserialized. - :param str iter_type: The type of object in the iterable. - :rtype: list - """ - if attr is None: - return None - if isinstance(attr, ET.Element): # If I receive an element here, get the children - attr = list(attr) - if not isinstance(attr, (list, set)): - raise DeserializationError("Cannot deserialize as [{}] an object of type {}".format(iter_type, type(attr))) - return [self.deserialize_data(a, iter_type) for a in attr] - - def deserialize_dict(self, attr, dict_type): - """Deserialize a dictionary. - - :param dict/list attr: Dictionary to be deserialized. Also accepts - a list of key, value pairs. - :param str dict_type: The object type of the items in the dictionary. - :rtype: dict - """ - if isinstance(attr, list): - return {x["key"]: self.deserialize_data(x["value"], dict_type) for x in attr} - - if isinstance(attr, ET.Element): - # Transform value into {"Key": "value"} - attr = {el.tag: el.text for el in attr} - return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()} - - def deserialize_object(self, attr, **kwargs): - """Deserialize a generic object. - This will be handled as a dictionary. - - :param dict attr: Dictionary to be deserialized. - :rtype: dict - :raises: TypeError if non-builtin datatype encountered. - """ - if attr is None: - return None - if isinstance(attr, ET.Element): - # Do no recurse on XML, just return the tree as-is - return attr - if isinstance(attr, str): - return self.deserialize_basic(attr, "str") - obj_type = type(attr) - if obj_type in self.basic_types: - return self.deserialize_basic(attr, self.basic_types[obj_type]) - if obj_type is _long_type: - return self.deserialize_long(attr) - - if obj_type == dict: - deserialized = {} - for key, value in attr.items(): - try: - deserialized[key] = self.deserialize_object(value, **kwargs) - except ValueError: - deserialized[key] = None - return deserialized - - if obj_type == list: - deserialized = [] - for obj in attr: - try: - deserialized.append(self.deserialize_object(obj, **kwargs)) - except ValueError: - pass - return deserialized - - else: - error = "Cannot deserialize generic object with type: " - raise TypeError(error + str(obj_type)) - - def deserialize_basic(self, attr, data_type): - """Deserialize basic builtin data type from string. - Will attempt to convert to str, int, float and bool. - This function will also accept '1', '0', 'true' and 'false' as - valid bool values. - - :param str attr: response string to be deserialized. - :param str data_type: deserialization data type. - :rtype: str, int, float or bool - :raises: TypeError if string format is not valid. - """ - # If we're here, data is supposed to be a basic type. - # If it's still an XML node, take the text - if isinstance(attr, ET.Element): - attr = attr.text - if not attr: - if data_type == "str": - # None or '', node is empty string. - return "" - else: - # None or '', node with a strong type is None. - # Don't try to model "empty bool" or "empty int" - return None - - if data_type == "bool": - if attr in [True, False, 1, 0]: - return bool(attr) - elif isinstance(attr, str): - if attr.lower() in ["true", "1"]: - return True - elif attr.lower() in ["false", "0"]: - return False - raise TypeError("Invalid boolean value: {}".format(attr)) - - if data_type == "str": - return self.deserialize_unicode(attr) - return eval(data_type)(attr) # nosec - - @staticmethod - def deserialize_unicode(data): - """Preserve unicode objects in Python 2, otherwise return data - as a string. - - :param str data: response string to be deserialized. - :rtype: str or unicode - """ - # We might be here because we have an enum modeled as string, - # and we try to deserialize a partial dict with enum inside - if isinstance(data, Enum): - return data - - # Consider this is real string - try: - if isinstance(data, unicode): # type: ignore - return data - except NameError: - return str(data) - else: - return str(data) - - @staticmethod - def deserialize_enum(data, enum_obj): - """Deserialize string into enum object. - - If the string is not a valid enum value it will be returned as-is - and a warning will be logged. - - :param str data: Response string to be deserialized. If this value is - None or invalid it will be returned as-is. - :param Enum enum_obj: Enum object to deserialize to. - :rtype: Enum - """ - if isinstance(data, enum_obj) or data is None: - return data - if isinstance(data, Enum): - data = data.value - if isinstance(data, int): - # Workaround. We might consider remove it in the future. - try: - return list(enum_obj.__members__.values())[data] - except IndexError: - error = "{!r} is not a valid index for enum {!r}" - raise DeserializationError(error.format(data, enum_obj)) - try: - return enum_obj(str(data)) - except ValueError: - for enum_value in enum_obj: - if enum_value.value.lower() == str(data).lower(): - return enum_value - # We don't fail anymore for unknown value, we deserialize as a string - _LOGGER.warning("Deserializer is not able to find %s as valid enum in %s", data, enum_obj) - return Deserializer.deserialize_unicode(data) - - @staticmethod - def deserialize_bytearray(attr): - """Deserialize string into bytearray. - - :param str attr: response string to be deserialized. - :rtype: bytearray - :raises: TypeError if string format invalid. - """ - if isinstance(attr, ET.Element): - attr = attr.text - return bytearray(b64decode(attr)) # type: ignore - - @staticmethod - def deserialize_base64(attr): - """Deserialize base64 encoded string into string. - - :param str attr: response string to be deserialized. - :rtype: bytearray - :raises: TypeError if string format invalid. - """ - if isinstance(attr, ET.Element): - attr = attr.text - padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore - attr = attr + padding # type: ignore - encoded = attr.replace("-", "+").replace("_", "/") - return b64decode(encoded) - - @staticmethod - def deserialize_decimal(attr): - """Deserialize string into Decimal object. - - :param str attr: response string to be deserialized. - :rtype: Decimal - :raises: DeserializationError if string format invalid. - """ - if isinstance(attr, ET.Element): - attr = attr.text - try: - return decimal.Decimal(str(attr)) # type: ignore - except decimal.DecimalException as err: - msg = "Invalid decimal {}".format(attr) - raise DeserializationError(msg) from err - - @staticmethod - def deserialize_long(attr): - """Deserialize string into long (Py2) or int (Py3). - - :param str attr: response string to be deserialized. - :rtype: long or int - :raises: ValueError if string format invalid. - """ - if isinstance(attr, ET.Element): - attr = attr.text - return _long_type(attr) # type: ignore - - @staticmethod - def deserialize_duration(attr): - """Deserialize ISO-8601 formatted string into TimeDelta object. - - :param str attr: response string to be deserialized. - :rtype: TimeDelta - :raises: DeserializationError if string format invalid. - """ - if isinstance(attr, ET.Element): - attr = attr.text - try: - duration = isodate.parse_duration(attr) - except (ValueError, OverflowError, AttributeError) as err: - msg = "Cannot deserialize duration object." - raise DeserializationError(msg) from err - else: - return duration - - @staticmethod - def deserialize_date(attr): - """Deserialize ISO-8601 formatted string into Date object. - - :param str attr: response string to be deserialized. - :rtype: Date - :raises: DeserializationError if string format invalid. - """ - if isinstance(attr, ET.Element): - attr = attr.text - if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore - raise DeserializationError("Date must have only digits and -. Received: %s" % attr) - # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. - return isodate.parse_date(attr, defaultmonth=0, defaultday=0) - - @staticmethod - def deserialize_time(attr): - """Deserialize ISO-8601 formatted string into time object. - - :param str attr: response string to be deserialized. - :rtype: datetime.time - :raises: DeserializationError if string format invalid. - """ - if isinstance(attr, ET.Element): - attr = attr.text - if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore - raise DeserializationError("Date must have only digits and -. Received: %s" % attr) - return isodate.parse_time(attr) - - @staticmethod - def deserialize_rfc(attr): - """Deserialize RFC-1123 formatted string into Datetime object. - - :param str attr: response string to be deserialized. - :rtype: Datetime - :raises: DeserializationError if string format invalid. - """ - if isinstance(attr, ET.Element): - attr = attr.text - try: - parsed_date = email.utils.parsedate_tz(attr) # type: ignore - date_obj = datetime.datetime( - *parsed_date[:6], tzinfo=_FixedOffset(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) - ) - if not date_obj.tzinfo: - date_obj = date_obj.astimezone(tz=TZ_UTC) - except ValueError as err: - msg = "Cannot deserialize to rfc datetime object." - raise DeserializationError(msg) from err - else: - return date_obj - - @staticmethod - def deserialize_iso(attr): - """Deserialize ISO-8601 formatted string into Datetime object. - - :param str attr: response string to be deserialized. - :rtype: Datetime - :raises: DeserializationError if string format invalid. - """ - if isinstance(attr, ET.Element): - attr = attr.text - try: - attr = attr.upper() # type: ignore - match = Deserializer.valid_date.match(attr) - if not match: - raise ValueError("Invalid datetime string: " + attr) - - check_decimal = attr.split(".") - if len(check_decimal) > 1: - decimal_str = "" - for digit in check_decimal[1]: - if digit.isdigit(): - decimal_str += digit - else: - break - if len(decimal_str) > 6: - attr = attr.replace(decimal_str, decimal_str[0:6]) - - date_obj = isodate.parse_datetime(attr) - test_utc = date_obj.utctimetuple() - if test_utc.tm_year > 9999 or test_utc.tm_year < 1: - raise OverflowError("Hit max or min date") - except (ValueError, OverflowError, AttributeError) as err: - msg = "Cannot deserialize datetime object." - raise DeserializationError(msg) from err - else: - return date_obj - - @staticmethod - def deserialize_unix(attr): - """Serialize Datetime object into IntTime format. - This is represented as seconds. - - :param int attr: Object to be serialized. - :rtype: Datetime - :raises: DeserializationError if format invalid - """ - if isinstance(attr, ET.Element): - attr = int(attr.text) # type: ignore - try: - attr = int(attr) - date_obj = datetime.datetime.fromtimestamp(attr, TZ_UTC) - except ValueError as err: - msg = "Cannot deserialize to unix datetime object." - raise DeserializationError(msg) from err - else: - return date_obj diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/__init__.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/__init__.py deleted file mode 100644 index d21c978735c..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/__init__.py +++ /dev/null @@ -1,23 +0,0 @@ -# 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 ._durabletask_mgmt_client import DurabletaskMgmtClient - -try: - from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "DurabletaskMgmtClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) - -_patch_sdk() diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/_configuration.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/_configuration.py deleted file mode 100644 index 3fdd7959cc8..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/_configuration.py +++ /dev/null @@ -1,65 +0,0 @@ -# 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.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy - -from .._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class DurabletaskMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long - """Configuration for DurabletaskMgmtClient. - - 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. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. - :type subscription_id: str - :keyword api_version: Api Version. Default value is "2024-02-01-preview". Note that overriding - this default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "2024-02-01-preview") - - 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.") - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = api_version - self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) - kwargs.setdefault("sdk_moniker", "mgmt-durabletask/{}".format(VERSION)) - self.polling_interval = kwargs.get("polling_interval", 30) - 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.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( - self.credential, *self.credential_scopes, **kwargs - ) diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/_durabletask_mgmt_client.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/_durabletask_mgmt_client.py deleted file mode 100644 index b44e3286b20..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/_durabletask_mgmt_client.py +++ /dev/null @@ -1,120 +0,0 @@ -# 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 copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING -from typing_extensions import Self - -from azure.core.pipeline import policies -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.mgmt.core import AsyncARMPipelineClient -from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy - -from .. import models as _models -from .._serialization import Deserializer, Serializer -from ._configuration import DurabletaskMgmtClientConfiguration -from .operations import NamespacesOperations, Operations, TaskHubsOperations - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class DurabletaskMgmtClient: # pylint: disable=client-accepts-api-version-keyword - """DurabletaskMgmtClient. - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.durabletask.aio.operations.Operations - :ivar namespaces: NamespacesOperations operations - :vartype namespaces: azure.mgmt.durabletask.aio.operations.NamespacesOperations - :ivar task_hubs: TaskHubsOperations operations - :vartype task_hubs: azure.mgmt.durabletask.aio.operations.TaskHubsOperations - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. - :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". - :type base_url: str - :keyword api_version: Api Version. Default value is "2024-02-01-preview". Note that overriding - this default value may result in unsupported behavior. - :paramtype api_version: str - :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: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = DurabletaskMgmtClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs - ) - _policies = kwargs.pop("policies", None) - if _policies is None: - _policies = [ - policies.RequestIdPolicy(**kwargs), - self._config.headers_policy, - self._config.user_agent_policy, - self._config.proxy_policy, - policies.ContentDecodePolicy(**kwargs), - AsyncARMAutoResourceProviderRegistrationPolicy(), - self._config.redirect_policy, - self._config.retry_policy, - self._config.authentication_policy, - self._config.custom_hook_policy, - self._config.logging_policy, - policies.DistributedTracingPolicy(**kwargs), - policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, - self._config.http_logging_policy, - ] - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) - - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.namespaces = NamespacesOperations(self._client, self._config, self._serialize, self._deserialize) - self.task_hubs = TaskHubsOperations(self._client, self._config, self._serialize, self._deserialize) - - def _send_request( - self, request: HttpRequest, *, stream: bool = False, **kwargs: Any - ) -> Awaitable[AsyncHttpResponse]: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = await client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.AsyncHttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> Self: - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details: Any) -> None: - await self._client.__aexit__(*exc_details) diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/_patch.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/operations/__init__.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/operations/__init__.py deleted file mode 100644 index 03a0d30262e..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/operations/__init__.py +++ /dev/null @@ -1,23 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._operations import Operations -from ._namespaces_operations import NamespacesOperations -from ._task_hubs_operations import TaskHubsOperations - -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "Operations", - "NamespacesOperations", - "TaskHubsOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/operations/_namespaces_operations.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/operations/_namespaces_operations.py deleted file mode 100644 index d2975e0238e..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/operations/_namespaces_operations.py +++ /dev/null @@ -1,793 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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 io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ...operations._namespaces_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_resource_group_request, - build_list_by_subscription_request, - build_update_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class NamespacesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.durabletask.aio.DurabletaskMgmtClient`'s - :attr:`namespaces` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Namespace"]: - """List Namespace resources by subscription ID. - - :return: An iterator like instance of either Namespace or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.durabletask.models.Namespace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NamespaceListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("NamespaceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.Namespace"]: - """List Namespace resources by resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of either Namespace or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.durabletask.models.Namespace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NamespaceListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("NamespaceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get(self, resource_group_name: str, namespace_name: str, **kwargs: Any) -> _models.Namespace: - """Get a Namespace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the service. Required. - :type namespace_name: str - :return: Namespace or the result of cls(response) - :rtype: ~azure.mgmt.durabletask.models.Namespace - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.Namespace] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Namespace", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - namespace_name: str, - resource: Union[_models.Namespace, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _json = self._serialize.body(resource, "Namespace") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - namespace_name: str, - resource: _models.Namespace, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Namespace]: - """Create a Namespace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the service. Required. - :type namespace_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.durabletask.models.Namespace - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either Namespace or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.Namespace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - namespace_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Namespace]: - """Create a Namespace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the service. Required. - :type namespace_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either Namespace or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.Namespace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - namespace_name: str, - resource: Union[_models.Namespace, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.Namespace]: - """Create a Namespace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the service. Required. - :type namespace_name: str - :param resource: Resource create parameters. Is either a Namespace type or a IO[bytes] type. - Required. - :type resource: ~azure.mgmt.durabletask.models.Namespace or IO[bytes] - :return: An instance of AsyncLROPoller that returns either Namespace or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.Namespace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Namespace] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - resource=resource, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Namespace", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.Namespace].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Namespace]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _update_initial( - self, - resource_group_name: str, - namespace_name: str, - properties: Union[_models.NamespaceUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties - else: - _json = self._serialize.body(properties, "NamespaceUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - namespace_name: str, - properties: _models.NamespaceUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Namespace]: - """Update a Namespace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the service. Required. - :type namespace_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.durabletask.models.NamespaceUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either Namespace or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.Namespace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - namespace_name: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Namespace]: - """Update a Namespace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the service. Required. - :type namespace_name: str - :param properties: The resource properties to be updated. Required. - :type properties: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either Namespace or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.Namespace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - namespace_name: str, - properties: Union[_models.NamespaceUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.Namespace]: - """Update a Namespace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the service. Required. - :type namespace_name: str - :param properties: The resource properties to be updated. Is either a NamespaceUpdate type or a - IO[bytes] type. Required. - :type properties: ~azure.mgmt.durabletask.models.NamespaceUpdate or IO[bytes] - :return: An instance of AsyncLROPoller that returns either Namespace or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.Namespace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Namespace] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - properties=properties, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Namespace", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.Namespace].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Namespace]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, namespace_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete(self, resource_group_name: str, namespace_name: str, **kwargs: Any) -> AsyncLROPoller[None]: - """Delete a Namespace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the service. Required. - :type namespace_name: str - :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: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/operations/_operations.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/operations/_operations.py deleted file mode 100644 index f3fe8f9288f..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/operations/_operations.py +++ /dev/null @@ -1,130 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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 sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ...operations._operations import build_list_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class Operations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.durabletask.aio.DurabletaskMgmtClient`'s - :attr:`operations` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: - """List the operations for the provider. - - :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.durabletask.models.Operation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OperationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/operations/_patch.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/operations/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/operations/_task_hubs_operations.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/operations/_task_hubs_operations.py deleted file mode 100644 index d49184ec12a..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/aio/operations/_task_hubs_operations.py +++ /dev/null @@ -1,548 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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 io import IOBase -import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ...operations._task_hubs_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_namespace_request, - build_update_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class TaskHubsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.durabletask.aio.DurabletaskMgmtClient`'s - :attr:`task_hubs` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_namespace( - self, resource_group_name: str, namespace_name: str, **kwargs: Any - ) -> AsyncIterable["_models.TaskHub"]: - """List Task Hubs. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the service. Required. - :type namespace_name: str - :return: An iterator like instance of either TaskHub or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.durabletask.models.TaskHub] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.TaskHubListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_namespace_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("TaskHubListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, namespace_name: str, task_hub_name: str, **kwargs: Any - ) -> _models.TaskHub: - """Get a Task Hub. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the service. Required. - :type namespace_name: str - :param task_hub_name: Task Hub name. Required. - :type task_hub_name: str - :return: TaskHub or the result of cls(response) - :rtype: ~azure.mgmt.durabletask.models.TaskHub - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.TaskHub] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - task_hub_name=task_hub_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("TaskHub", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - namespace_name: str, - task_hub_name: str, - resource: _models.TaskHub, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.TaskHub: - """Create or update a Task Hub. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the service. Required. - :type namespace_name: str - :param task_hub_name: Task Hub name. Required. - :type task_hub_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.durabletask.models.TaskHub - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: TaskHub or the result of cls(response) - :rtype: ~azure.mgmt.durabletask.models.TaskHub - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - namespace_name: str, - task_hub_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.TaskHub: - """Create or update a Task Hub. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the service. Required. - :type namespace_name: str - :param task_hub_name: Task Hub name. Required. - :type task_hub_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: TaskHub or the result of cls(response) - :rtype: ~azure.mgmt.durabletask.models.TaskHub - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - namespace_name: str, - task_hub_name: str, - resource: Union[_models.TaskHub, IO[bytes]], - **kwargs: Any - ) -> _models.TaskHub: - """Create or update a Task Hub. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the service. Required. - :type namespace_name: str - :param task_hub_name: Task Hub name. Required. - :type task_hub_name: str - :param resource: Resource create parameters. Is either a TaskHub type or a IO[bytes] type. - Required. - :type resource: ~azure.mgmt.durabletask.models.TaskHub or IO[bytes] - :return: TaskHub or the result of cls(response) - :rtype: ~azure.mgmt.durabletask.models.TaskHub - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.TaskHub] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _json = self._serialize.body(resource, "TaskHub") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - task_hub_name=task_hub_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("TaskHub", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def update( - self, - resource_group_name: str, - namespace_name: str, - task_hub_name: str, - properties: _models.TaskHubUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.TaskHub: - """Update a Task Hub. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the service. Required. - :type namespace_name: str - :param task_hub_name: Task Hub name. Required. - :type task_hub_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.durabletask.models.TaskHubUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: TaskHub or the result of cls(response) - :rtype: ~azure.mgmt.durabletask.models.TaskHub - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, - resource_group_name: str, - namespace_name: str, - task_hub_name: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.TaskHub: - """Update a Task Hub. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the service. Required. - :type namespace_name: str - :param task_hub_name: Task Hub name. Required. - :type task_hub_name: str - :param properties: The resource properties to be updated. Required. - :type properties: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: TaskHub or the result of cls(response) - :rtype: ~azure.mgmt.durabletask.models.TaskHub - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - namespace_name: str, - task_hub_name: str, - properties: Union[_models.TaskHubUpdate, IO[bytes]], - **kwargs: Any - ) -> _models.TaskHub: - """Update a Task Hub. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the service. Required. - :type namespace_name: str - :param task_hub_name: Task Hub name. Required. - :type task_hub_name: str - :param properties: The resource properties to be updated. Is either a TaskHubUpdate type or a - IO[bytes] type. Required. - :type properties: ~azure.mgmt.durabletask.models.TaskHubUpdate or IO[bytes] - :return: TaskHub or the result of cls(response) - :rtype: ~azure.mgmt.durabletask.models.TaskHub - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.TaskHub] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties - else: - _json = self._serialize.body(properties, "TaskHubUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - task_hub_name=task_hub_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("TaskHub", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, namespace_name: str, task_hub_name: str, **kwargs: Any - ) -> None: - """Delete a Task Hub. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the service. Required. - :type namespace_name: str - :param task_hub_name: Task Hub name. Required. - :type task_hub_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - task_hub_name=task_hub_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/__init__.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/__init__.py deleted file mode 100644 index 49718dcd228..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from ._configuration import LUISAuthoringClientConfiguration -from ._luis_authoring_client import LUISAuthoringClient -__all__ = ['LUISAuthoringClient', 'LUISAuthoringClientConfiguration'] - -from .version import VERSION - -__version__ = VERSION - diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/_configuration.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/_configuration.py deleted file mode 100644 index 1a32e73d6cb..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/_configuration.py +++ /dev/null @@ -1,47 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest import Configuration - -from .version import VERSION - - -class LUISAuthoringClientConfiguration(Configuration): - """Configuration for LUISAuthoringClient - Note that all parameters used to create this instance are saved as instance - attributes. - - :param endpoint: Supported Cognitive Services endpoints (protocol and - hostname, for example: https://westus.api.cognitive.microsoft.com). - :type endpoint: str - :param credentials: Subscription credentials which uniquely identify - client subscription. - :type credentials: None - """ - - def __init__( - self, endpoint, credentials): - - if endpoint is None: - raise ValueError("Parameter 'endpoint' must not be None.") - if credentials is None: - raise ValueError("Parameter 'credentials' must not be None.") - base_url = '{Endpoint}/luis/authoring/v3.0-preview' - - super(LUISAuthoringClientConfiguration, self).__init__(base_url) - - # Starting Autorest.Python 4.0.64, make connection pool activated by default - self.keep_alive = True - - self.add_user_agent('azure-cognitiveservices-language-luis/{}'.format(VERSION)) - - self.endpoint = endpoint - self.credentials = credentials diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/_luis_authoring_client.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/_luis_authoring_client.py deleted file mode 100644 index 185b9453df6..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/_luis_authoring_client.py +++ /dev/null @@ -1,90 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.service_client import SDKClient -from msrest import Serializer, Deserializer - -from ._configuration import LUISAuthoringClientConfiguration -from msrest.exceptions import HttpOperationError -from .operations import FeaturesOperations -from .operations import ExamplesOperations -from .operations import ModelOperations -from .operations import AppsOperations -from .operations import VersionsOperations -from .operations import TrainOperations -from .operations import PatternOperations -from .operations import SettingsOperations -from .operations import AzureAccountsOperations -from . import models - - -class LUISAuthoringClient(SDKClient): - """LUISAuthoringClient - - :ivar config: Configuration for client. - :vartype config: LUISAuthoringClientConfiguration - - :ivar features: Features operations - :vartype features: azure.cognitiveservices.language.luis.authoring.operations.FeaturesOperations - :ivar examples: Examples operations - :vartype examples: azure.cognitiveservices.language.luis.authoring.operations.ExamplesOperations - :ivar model: Model operations - :vartype model: azure.cognitiveservices.language.luis.authoring.operations.ModelOperations - :ivar apps: Apps operations - :vartype apps: azure.cognitiveservices.language.luis.authoring.operations.AppsOperations - :ivar versions: Versions operations - :vartype versions: azure.cognitiveservices.language.luis.authoring.operations.VersionsOperations - :ivar train: Train operations - :vartype train: azure.cognitiveservices.language.luis.authoring.operations.TrainOperations - :ivar pattern: Pattern operations - :vartype pattern: azure.cognitiveservices.language.luis.authoring.operations.PatternOperations - :ivar settings: Settings operations - :vartype settings: azure.cognitiveservices.language.luis.authoring.operations.SettingsOperations - :ivar azure_accounts: AzureAccounts operations - :vartype azure_accounts: azure.cognitiveservices.language.luis.authoring.operations.AzureAccountsOperations - - :param endpoint: Supported Cognitive Services endpoints (protocol and - hostname, for example: https://westus.api.cognitive.microsoft.com). - :type endpoint: str - :param credentials: Subscription credentials which uniquely identify - client subscription. - :type credentials: None - """ - - def __init__( - self, endpoint, credentials): - - self.config = LUISAuthoringClientConfiguration(endpoint, credentials) - super(LUISAuthoringClient, self).__init__(self.config.credentials, self.config) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '3.0-preview' - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - - self.features = FeaturesOperations( - self._client, self.config, self._serialize, self._deserialize) - self.examples = ExamplesOperations( - self._client, self.config, self._serialize, self._deserialize) - self.model = ModelOperations( - self._client, self.config, self._serialize, self._deserialize) - self.apps = AppsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.versions = VersionsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.train = TrainOperations( - self._client, self.config, self._serialize, self._deserialize) - self.pattern = PatternOperations( - self._client, self.config, self._serialize, self._deserialize) - self.settings = SettingsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.azure_accounts = AzureAccountsOperations( - self._client, self.config, self._serialize, self._deserialize) diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/models/__init__.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/models/__init__.py deleted file mode 100644 index 4fb287da083..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/models/__init__.py +++ /dev/null @@ -1,346 +0,0 @@ -# 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 ApplicationCreateObject - from ._models_py3 import ApplicationInfoResponse - from ._models_py3 import ApplicationPublishObject - from ._models_py3 import ApplicationSettings - from ._models_py3 import ApplicationSettingUpdateObject - from ._models_py3 import ApplicationUpdateObject - from ._models_py3 import AppVersionSettingObject - from ._models_py3 import AvailableCulture - from ._models_py3 import AvailablePrebuiltEntityModel - from ._models_py3 import AzureAccountInfoObject - from ._models_py3 import BatchLabelExample - from ._models_py3 import ChildEntity - from ._models_py3 import ChildEntityModelCreateObject - from ._models_py3 import ClosedList - from ._models_py3 import ClosedListEntityExtractor - from ._models_py3 import ClosedListModelCreateObject - from ._models_py3 import ClosedListModelPatchObject - from ._models_py3 import ClosedListModelUpdateObject - from ._models_py3 import CollaboratorsArray - from ._models_py3 import CompositeChildModelCreateObject - from ._models_py3 import CompositeEntityExtractor - from ._models_py3 import CompositeEntityModel - from ._models_py3 import CustomPrebuiltModel - from ._models_py3 import EndpointInfo - from ._models_py3 import EnqueueTrainingResponse - from ._models_py3 import EntitiesSuggestionExample - from ._models_py3 import EntityExtractor - from ._models_py3 import EntityLabel - from ._models_py3 import EntityLabelObject - from ._models_py3 import EntityModelCreateObject - from ._models_py3 import EntityModelInfo - from ._models_py3 import EntityModelUpdateObject - from ._models_py3 import EntityPrediction - from ._models_py3 import EntityRole - from ._models_py3 import EntityRoleCreateObject - from ._models_py3 import EntityRoleUpdateObject - from ._models_py3 import ErrorResponse, ErrorResponseException - from ._models_py3 import ExampleLabelObject - from ._models_py3 import ExplicitListItem - from ._models_py3 import ExplicitListItemCreateObject - from ._models_py3 import ExplicitListItemUpdateObject - from ._models_py3 import FeatureInfoObject - from ._models_py3 import FeaturesResponseObject - from ._models_py3 import HierarchicalChildEntity - from ._models_py3 import HierarchicalChildModelUpdateObject - from ._models_py3 import HierarchicalEntityExtractor - from ._models_py3 import HierarchicalModel - from ._models_py3 import HierarchicalModelV2 - from ._models_py3 import IntentClassifier - from ._models_py3 import IntentPrediction - from ._models_py3 import IntentsSuggestionExample - from ._models_py3 import JsonChild - from ._models_py3 import JSONEntity - from ._models_py3 import JSONModelFeature - from ._models_py3 import JsonModelFeatureInformation - from ._models_py3 import JSONRegexFeature - from ._models_py3 import JSONUtterance - from ._models_py3 import LabeledUtterance - from ._models_py3 import LabelExampleResponse - from ._models_py3 import LabelTextObject - from ._models_py3 import LuisApp - from ._models_py3 import LuisAppV2 - from ._models_py3 import ModelCreateObject - from ._models_py3 import ModelFeatureInformation - from ._models_py3 import ModelInfo - from ._models_py3 import ModelInfoResponse - from ._models_py3 import ModelTrainingDetails - from ._models_py3 import ModelTrainingInfo - from ._models_py3 import ModelUpdateObject - from ._models_py3 import NDepthEntityExtractor - from ._models_py3 import OperationError - from ._models_py3 import OperationStatus - from ._models_py3 import PatternAny - from ._models_py3 import PatternAnyEntityExtractor - from ._models_py3 import PatternAnyModelCreateObject - from ._models_py3 import PatternAnyModelUpdateObject - from ._models_py3 import PatternFeatureInfo - from ._models_py3 import PatternRule - from ._models_py3 import PatternRuleCreateObject - from ._models_py3 import PatternRuleInfo - from ._models_py3 import PatternRuleUpdateObject - from ._models_py3 import PersonalAssistantsResponse - from ._models_py3 import PhraselistCreateObject - from ._models_py3 import PhraseListFeatureInfo - from ._models_py3 import PhraselistUpdateObject - from ._models_py3 import PrebuiltDomain - from ._models_py3 import PrebuiltDomainCreateBaseObject - from ._models_py3 import PrebuiltDomainCreateObject - from ._models_py3 import PrebuiltDomainItem - from ._models_py3 import PrebuiltDomainModelCreateObject - from ._models_py3 import PrebuiltDomainObject - from ._models_py3 import PrebuiltEntity - from ._models_py3 import PrebuiltEntityExtractor - from ._models_py3 import ProductionOrStagingEndpointInfo - from ._models_py3 import PublishSettings - from ._models_py3 import PublishSettingUpdateObject - from ._models_py3 import RegexEntity - from ._models_py3 import RegexEntityExtractor - from ._models_py3 import RegexModelCreateObject - from ._models_py3 import RegexModelUpdateObject - from ._models_py3 import SubClosedList - from ._models_py3 import SubClosedListResponse - from ._models_py3 import TaskUpdateObject - from ._models_py3 import UserAccessList - from ._models_py3 import UserCollaborator - from ._models_py3 import VersionInfo - from ._models_py3 import WordListBaseUpdateObject - from ._models_py3 import WordListObject -except (SyntaxError, ImportError): - from ._models import ApplicationCreateObject - from ._models import ApplicationInfoResponse - from ._models import ApplicationPublishObject - from ._models import ApplicationSettings - from ._models import ApplicationSettingUpdateObject - from ._models import ApplicationUpdateObject - from ._models import AppVersionSettingObject - from ._models import AvailableCulture - from ._models import AvailablePrebuiltEntityModel - from ._models import AzureAccountInfoObject - from ._models import BatchLabelExample - from ._models import ChildEntity - from ._models import ChildEntityModelCreateObject - from ._models import ClosedList - from ._models import ClosedListEntityExtractor - from ._models import ClosedListModelCreateObject - from ._models import ClosedListModelPatchObject - from ._models import ClosedListModelUpdateObject - from ._models import CollaboratorsArray - from ._models import CompositeChildModelCreateObject - from ._models import CompositeEntityExtractor - from ._models import CompositeEntityModel - from ._models import CustomPrebuiltModel - from ._models import EndpointInfo - from ._models import EnqueueTrainingResponse - from ._models import EntitiesSuggestionExample - from ._models import EntityExtractor - from ._models import EntityLabel - from ._models import EntityLabelObject - from ._models import EntityModelCreateObject - from ._models import EntityModelInfo - from ._models import EntityModelUpdateObject - from ._models import EntityPrediction - from ._models import EntityRole - from ._models import EntityRoleCreateObject - from ._models import EntityRoleUpdateObject - from ._models import ErrorResponse, ErrorResponseException - from ._models import ExampleLabelObject - from ._models import ExplicitListItem - from ._models import ExplicitListItemCreateObject - from ._models import ExplicitListItemUpdateObject - from ._models import FeatureInfoObject - from ._models import FeaturesResponseObject - from ._models import HierarchicalChildEntity - from ._models import HierarchicalChildModelUpdateObject - from ._models import HierarchicalEntityExtractor - from ._models import HierarchicalModel - from ._models import HierarchicalModelV2 - from ._models import IntentClassifier - from ._models import IntentPrediction - from ._models import IntentsSuggestionExample - from ._models import JsonChild - from ._models import JSONEntity - from ._models import JSONModelFeature - from ._models import JsonModelFeatureInformation - from ._models import JSONRegexFeature - from ._models import JSONUtterance - from ._models import LabeledUtterance - from ._models import LabelExampleResponse - from ._models import LabelTextObject - from ._models import LuisApp - from ._models import LuisAppV2 - from ._models import ModelCreateObject - from ._models import ModelFeatureInformation - from ._models import ModelInfo - from ._models import ModelInfoResponse - from ._models import ModelTrainingDetails - from ._models import ModelTrainingInfo - from ._models import ModelUpdateObject - from ._models import NDepthEntityExtractor - from ._models import OperationError - from ._models import OperationStatus - from ._models import PatternAny - from ._models import PatternAnyEntityExtractor - from ._models import PatternAnyModelCreateObject - from ._models import PatternAnyModelUpdateObject - from ._models import PatternFeatureInfo - from ._models import PatternRule - from ._models import PatternRuleCreateObject - from ._models import PatternRuleInfo - from ._models import PatternRuleUpdateObject - from ._models import PersonalAssistantsResponse - from ._models import PhraselistCreateObject - from ._models import PhraseListFeatureInfo - from ._models import PhraselistUpdateObject - from ._models import PrebuiltDomain - from ._models import PrebuiltDomainCreateBaseObject - from ._models import PrebuiltDomainCreateObject - from ._models import PrebuiltDomainItem - from ._models import PrebuiltDomainModelCreateObject - from ._models import PrebuiltDomainObject - from ._models import PrebuiltEntity - from ._models import PrebuiltEntityExtractor - from ._models import ProductionOrStagingEndpointInfo - from ._models import PublishSettings - from ._models import PublishSettingUpdateObject - from ._models import RegexEntity - from ._models import RegexEntityExtractor - from ._models import RegexModelCreateObject - from ._models import RegexModelUpdateObject - from ._models import SubClosedList - from ._models import SubClosedListResponse - from ._models import TaskUpdateObject - from ._models import UserAccessList - from ._models import UserCollaborator - from ._models import VersionInfo - from ._models import WordListBaseUpdateObject - from ._models import WordListObject -from ._luis_authoring_client_enums import ( - OperationStatusType, - TrainingStatus, -) - -__all__ = [ - 'ApplicationCreateObject', - 'ApplicationInfoResponse', - 'ApplicationPublishObject', - 'ApplicationSettings', - 'ApplicationSettingUpdateObject', - 'ApplicationUpdateObject', - 'AppVersionSettingObject', - 'AvailableCulture', - 'AvailablePrebuiltEntityModel', - 'AzureAccountInfoObject', - 'BatchLabelExample', - 'ChildEntity', - 'ChildEntityModelCreateObject', - 'ClosedList', - 'ClosedListEntityExtractor', - 'ClosedListModelCreateObject', - 'ClosedListModelPatchObject', - 'ClosedListModelUpdateObject', - 'CollaboratorsArray', - 'CompositeChildModelCreateObject', - 'CompositeEntityExtractor', - 'CompositeEntityModel', - 'CustomPrebuiltModel', - 'EndpointInfo', - 'EnqueueTrainingResponse', - 'EntitiesSuggestionExample', - 'EntityExtractor', - 'EntityLabel', - 'EntityLabelObject', - 'EntityModelCreateObject', - 'EntityModelInfo', - 'EntityModelUpdateObject', - 'EntityPrediction', - 'EntityRole', - 'EntityRoleCreateObject', - 'EntityRoleUpdateObject', - 'ErrorResponse', 'ErrorResponseException', - 'ExampleLabelObject', - 'ExplicitListItem', - 'ExplicitListItemCreateObject', - 'ExplicitListItemUpdateObject', - 'FeatureInfoObject', - 'FeaturesResponseObject', - 'HierarchicalChildEntity', - 'HierarchicalChildModelUpdateObject', - 'HierarchicalEntityExtractor', - 'HierarchicalModel', - 'HierarchicalModelV2', - 'IntentClassifier', - 'IntentPrediction', - 'IntentsSuggestionExample', - 'JsonChild', - 'JSONEntity', - 'JSONModelFeature', - 'JsonModelFeatureInformation', - 'JSONRegexFeature', - 'JSONUtterance', - 'LabeledUtterance', - 'LabelExampleResponse', - 'LabelTextObject', - 'LuisApp', - 'LuisAppV2', - 'ModelCreateObject', - 'ModelFeatureInformation', - 'ModelInfo', - 'ModelInfoResponse', - 'ModelTrainingDetails', - 'ModelTrainingInfo', - 'ModelUpdateObject', - 'NDepthEntityExtractor', - 'OperationError', - 'OperationStatus', - 'PatternAny', - 'PatternAnyEntityExtractor', - 'PatternAnyModelCreateObject', - 'PatternAnyModelUpdateObject', - 'PatternFeatureInfo', - 'PatternRule', - 'PatternRuleCreateObject', - 'PatternRuleInfo', - 'PatternRuleUpdateObject', - 'PersonalAssistantsResponse', - 'PhraselistCreateObject', - 'PhraseListFeatureInfo', - 'PhraselistUpdateObject', - 'PrebuiltDomain', - 'PrebuiltDomainCreateBaseObject', - 'PrebuiltDomainCreateObject', - 'PrebuiltDomainItem', - 'PrebuiltDomainModelCreateObject', - 'PrebuiltDomainObject', - 'PrebuiltEntity', - 'PrebuiltEntityExtractor', - 'ProductionOrStagingEndpointInfo', - 'PublishSettings', - 'PublishSettingUpdateObject', - 'RegexEntity', - 'RegexEntityExtractor', - 'RegexModelCreateObject', - 'RegexModelUpdateObject', - 'SubClosedList', - 'SubClosedListResponse', - 'TaskUpdateObject', - 'UserAccessList', - 'UserCollaborator', - 'VersionInfo', - 'WordListBaseUpdateObject', - 'WordListObject', - 'TrainingStatus', - 'OperationStatusType', -] diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/models/_luis_authoring_client_enums.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/models/_luis_authoring_client_enums.py deleted file mode 100644 index f85ad6da8c8..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/models/_luis_authoring_client_enums.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from enum import Enum - - -class TrainingStatus(str, Enum): - - needs_training = "NeedsTraining" - in_progress = "InProgress" - trained = "Trained" - - -class OperationStatusType(str, Enum): - - failed = "Failed" - success = "Success" diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/models/_models.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/models/_models.py deleted file mode 100644 index 2f626bf3131..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/models/_models.py +++ /dev/null @@ -1,3333 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError - - -class ApplicationCreateObject(Model): - """Properties for creating a new LUIS Application. - - All required parameters must be populated in order to send to Azure. - - :param culture: Required. The culture for the new application. It is the - language that your app understands and speaks. E.g.: "en-us". Note: the - culture cannot be changed after the app is created. - :type culture: str - :param domain: The domain for the new application. Optional. E.g.: Comics. - :type domain: str - :param description: Description of the new application. Optional. - :type description: str - :param initial_version_id: The initial version ID. Optional. Default value - is: "0.1" - :type initial_version_id: str - :param usage_scenario: Defines the scenario for the new application. - Optional. E.g.: IoT. - :type usage_scenario: str - :param name: Required. The name for the new application. - :type name: str - """ - - _validation = { - 'culture': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'culture': {'key': 'culture', 'type': 'str'}, - 'domain': {'key': 'domain', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'initial_version_id': {'key': 'initialVersionId', 'type': 'str'}, - 'usage_scenario': {'key': 'usageScenario', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ApplicationCreateObject, self).__init__(**kwargs) - self.culture = kwargs.get('culture', None) - self.domain = kwargs.get('domain', None) - self.description = kwargs.get('description', None) - self.initial_version_id = kwargs.get('initial_version_id', None) - self.usage_scenario = kwargs.get('usage_scenario', None) - self.name = kwargs.get('name', None) - - -class ApplicationInfoResponse(Model): - """Response containing the Application Info. - - :param id: The ID (GUID) of the application. - :type id: str - :param name: The name of the application. - :type name: str - :param description: The description of the application. - :type description: str - :param culture: The culture of the application. For example, "en-us". - :type culture: str - :param usage_scenario: Defines the scenario for the new application. - Optional. For example, IoT. - :type usage_scenario: str - :param domain: The domain for the new application. Optional. For example, - Comics. - :type domain: str - :param versions_count: Amount of model versions within the application. - :type versions_count: int - :param created_date_time: The version's creation timestamp. - :type created_date_time: str - :param endpoints: The Runtime endpoint URL for this model version. - :type endpoints: object - :param endpoint_hits_count: Number of calls made to this endpoint. - :type endpoint_hits_count: int - :param active_version: The version ID currently marked as active. - :type active_version: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'culture': {'key': 'culture', 'type': 'str'}, - 'usage_scenario': {'key': 'usageScenario', 'type': 'str'}, - 'domain': {'key': 'domain', 'type': 'str'}, - 'versions_count': {'key': 'versionsCount', 'type': 'int'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'str'}, - 'endpoints': {'key': 'endpoints', 'type': 'object'}, - 'endpoint_hits_count': {'key': 'endpointHitsCount', 'type': 'int'}, - 'active_version': {'key': 'activeVersion', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ApplicationInfoResponse, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.name = kwargs.get('name', None) - self.description = kwargs.get('description', None) - self.culture = kwargs.get('culture', None) - self.usage_scenario = kwargs.get('usage_scenario', None) - self.domain = kwargs.get('domain', None) - self.versions_count = kwargs.get('versions_count', None) - self.created_date_time = kwargs.get('created_date_time', None) - self.endpoints = kwargs.get('endpoints', None) - self.endpoint_hits_count = kwargs.get('endpoint_hits_count', None) - self.active_version = kwargs.get('active_version', None) - - -class ApplicationPublishObject(Model): - """Object model for publishing a specific application version. - - :param version_id: The version ID to publish. - :type version_id: str - :param is_staging: Indicates if the staging slot should be used, instead - of the Production one. Default value: False . - :type is_staging: bool - """ - - _attribute_map = { - 'version_id': {'key': 'versionId', 'type': 'str'}, - 'is_staging': {'key': 'isStaging', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(ApplicationPublishObject, self).__init__(**kwargs) - self.version_id = kwargs.get('version_id', None) - self.is_staging = kwargs.get('is_staging', False) - - -class ApplicationSettings(Model): - """The application settings. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. The application ID. - :type id: str - :param is_public: Required. Setting your application as public allows - other people to use your application's endpoint using their own keys for - billing purposes. - :type is_public: bool - """ - - _validation = { - 'id': {'required': True}, - 'is_public': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'is_public': {'key': 'public', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(ApplicationSettings, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.is_public = kwargs.get('is_public', None) - - -class ApplicationSettingUpdateObject(Model): - """Object model for updating an application's settings. - - :param is_public: Setting your application as public allows other people - to use your application's endpoint using their own keys. - :type is_public: bool - """ - - _attribute_map = { - 'is_public': {'key': 'public', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(ApplicationSettingUpdateObject, self).__init__(**kwargs) - self.is_public = kwargs.get('is_public', None) - - -class ApplicationUpdateObject(Model): - """Object model for updating the name or description of an application. - - :param name: The application's new name. - :type name: str - :param description: The application's new description. - :type description: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ApplicationUpdateObject, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.description = kwargs.get('description', None) - - -class AppVersionSettingObject(Model): - """Object model of an application version setting. - - :param name: The application version setting name. - :type name: str - :param value: The application version setting value. - :type value: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(AppVersionSettingObject, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.value = kwargs.get('value', None) - - -class AvailableCulture(Model): - """Available culture for using in a new application. - - :param name: The language name. - :type name: str - :param code: The ISO value for the language. - :type code: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'code': {'key': 'code', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(AvailableCulture, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.code = kwargs.get('code', None) - - -class AvailablePrebuiltEntityModel(Model): - """Available Prebuilt entity model for using in an application. - - :param name: The entity name. - :type name: str - :param description: The entity description and usage information. - :type description: str - :param examples: Usage examples. - :type examples: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'examples': {'key': 'examples', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(AvailablePrebuiltEntityModel, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.description = kwargs.get('description', None) - self.examples = kwargs.get('examples', None) - - -class AzureAccountInfoObject(Model): - """Defines the Azure account information object. - - All required parameters must be populated in order to send to Azure. - - :param azure_subscription_id: Required. The id for the Azure subscription. - :type azure_subscription_id: str - :param resource_group: Required. The Azure resource group name. - :type resource_group: str - :param account_name: Required. The Azure account name. - :type account_name: str - """ - - _validation = { - 'azure_subscription_id': {'required': True}, - 'resource_group': {'required': True}, - 'account_name': {'required': True}, - } - - _attribute_map = { - 'azure_subscription_id': {'key': 'azureSubscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(AzureAccountInfoObject, self).__init__(**kwargs) - self.azure_subscription_id = kwargs.get('azure_subscription_id', None) - self.resource_group = kwargs.get('resource_group', None) - self.account_name = kwargs.get('account_name', None) - - -class BatchLabelExample(Model): - """Response when adding a batch of labeled example utterances. - - :param value: - :type value: - ~azure.cognitiveservices.language.luis.authoring.models.LabelExampleResponse - :param has_error: - :type has_error: bool - :param error: - :type error: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'LabelExampleResponse'}, - 'has_error': {'key': 'hasError', 'type': 'bool'}, - 'error': {'key': 'error', 'type': 'OperationStatus'}, - } - - def __init__(self, **kwargs): - super(BatchLabelExample, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.has_error = kwargs.get('has_error', None) - self.error = kwargs.get('error', None) - - -class ChildEntity(Model): - """The base child entity type. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. The ID (GUID) belonging to a child entity. - :type id: str - :param name: The name of a child entity. - :type name: str - :param instance_of: Instance of Model. - :type instance_of: str - :param type_id: The type ID of the Entity Model. - :type type_id: int - :param readable_type: Possible values include: 'Entity Extractor', 'Child - Entity Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child - Entity Extractor', 'Composite Entity Extractor', 'List Entity Extractor', - 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity - Extractor', 'Closed List Entity Extractor', 'Regex Entity Extractor' - :type readable_type: str or - ~azure.cognitiveservices.language.luis.authoring.models.enum - :param children: List of children - :type children: - list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntity] - """ - - _validation = { - 'id': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'instance_of': {'key': 'instanceOf', 'type': 'str'}, - 'type_id': {'key': 'typeId', 'type': 'int'}, - 'readable_type': {'key': 'readableType', 'type': 'str'}, - 'children': {'key': 'children', 'type': '[ChildEntity]'}, - } - - def __init__(self, **kwargs): - super(ChildEntity, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.name = kwargs.get('name', None) - self.instance_of = kwargs.get('instance_of', None) - self.type_id = kwargs.get('type_id', None) - self.readable_type = kwargs.get('readable_type', None) - self.children = kwargs.get('children', None) - - -class ChildEntityModelCreateObject(Model): - """A child entity extractor create object. - - :param children: Child entities. - :type children: - list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntityModelCreateObject] - :param name: Entity name. - :type name: str - :param instance_of: The instance of model name - :type instance_of: str - """ - - _attribute_map = { - 'children': {'key': 'children', 'type': '[ChildEntityModelCreateObject]'}, - 'name': {'key': 'name', 'type': 'str'}, - 'instance_of': {'key': 'instanceOf', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ChildEntityModelCreateObject, self).__init__(**kwargs) - self.children = kwargs.get('children', None) - self.name = kwargs.get('name', None) - self.instance_of = kwargs.get('instance_of', None) - - -class ClosedList(Model): - """Exported Model - A list entity. - - :param name: Name of the list entity. - :type name: str - :param sub_lists: Sublists for the list entity. - :type sub_lists: - list[~azure.cognitiveservices.language.luis.authoring.models.SubClosedList] - :param roles: - :type roles: list[str] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'sub_lists': {'key': 'subLists', 'type': '[SubClosedList]'}, - 'roles': {'key': 'roles', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(ClosedList, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.sub_lists = kwargs.get('sub_lists', None) - self.roles = kwargs.get('roles', None) - - -class ClosedListEntityExtractor(Model): - """List Entity Extractor. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. The ID of the Entity Model. - :type id: str - :param name: Name of the Entity Model. - :type name: str - :param type_id: The type ID of the Entity Model. - :type type_id: int - :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', - 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List - Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', - 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex - Entity Extractor' - :type readable_type: str or - ~azure.cognitiveservices.language.luis.authoring.models.enum - :param roles: - :type roles: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] - :param sub_lists: List of sublists. - :type sub_lists: - list[~azure.cognitiveservices.language.luis.authoring.models.SubClosedListResponse] - """ - - _validation = { - 'id': {'required': True}, - 'readable_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type_id': {'key': 'typeId', 'type': 'int'}, - 'readable_type': {'key': 'readableType', 'type': 'str'}, - 'roles': {'key': 'roles', 'type': '[EntityRole]'}, - 'sub_lists': {'key': 'subLists', 'type': '[SubClosedListResponse]'}, - } - - def __init__(self, **kwargs): - super(ClosedListEntityExtractor, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.name = kwargs.get('name', None) - self.type_id = kwargs.get('type_id', None) - self.readable_type = kwargs.get('readable_type', None) - self.roles = kwargs.get('roles', None) - self.sub_lists = kwargs.get('sub_lists', None) - - -class ClosedListModelCreateObject(Model): - """Object model for creating a list entity. - - :param sub_lists: Sublists for the feature. - :type sub_lists: - list[~azure.cognitiveservices.language.luis.authoring.models.WordListObject] - :param name: Name of the list entity. - :type name: str - """ - - _attribute_map = { - 'sub_lists': {'key': 'subLists', 'type': '[WordListObject]'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ClosedListModelCreateObject, self).__init__(**kwargs) - self.sub_lists = kwargs.get('sub_lists', None) - self.name = kwargs.get('name', None) - - -class ClosedListModelPatchObject(Model): - """Object model for adding a batch of sublists to an existing list entity. - - :param sub_lists: Sublists to add. - :type sub_lists: - list[~azure.cognitiveservices.language.luis.authoring.models.WordListObject] - """ - - _attribute_map = { - 'sub_lists': {'key': 'subLists', 'type': '[WordListObject]'}, - } - - def __init__(self, **kwargs): - super(ClosedListModelPatchObject, self).__init__(**kwargs) - self.sub_lists = kwargs.get('sub_lists', None) - - -class ClosedListModelUpdateObject(Model): - """Object model for updating a list entity. - - :param sub_lists: The new sublists for the feature. - :type sub_lists: - list[~azure.cognitiveservices.language.luis.authoring.models.WordListObject] - :param name: The new name of the list entity. - :type name: str - """ - - _attribute_map = { - 'sub_lists': {'key': 'subLists', 'type': '[WordListObject]'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ClosedListModelUpdateObject, self).__init__(**kwargs) - self.sub_lists = kwargs.get('sub_lists', None) - self.name = kwargs.get('name', None) - - -class CollaboratorsArray(Model): - """CollaboratorsArray. - - :param emails: The email address of the users. - :type emails: list[str] - """ - - _attribute_map = { - 'emails': {'key': 'emails', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(CollaboratorsArray, self).__init__(**kwargs) - self.emails = kwargs.get('emails', None) - - -class CompositeChildModelCreateObject(Model): - """CompositeChildModelCreateObject. - - :param name: - :type name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(CompositeChildModelCreateObject, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - - -class CompositeEntityExtractor(Model): - """A Composite Entity Extractor. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. The ID of the Entity Model. - :type id: str - :param name: Name of the Entity Model. - :type name: str - :param type_id: The type ID of the Entity Model. - :type type_id: int - :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', - 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List - Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', - 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex - Entity Extractor' - :type readable_type: str or - ~azure.cognitiveservices.language.luis.authoring.models.enum - :param roles: - :type roles: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] - :param children: List of child entities. - :type children: - list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntity] - """ - - _validation = { - 'id': {'required': True}, - 'readable_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type_id': {'key': 'typeId', 'type': 'int'}, - 'readable_type': {'key': 'readableType', 'type': 'str'}, - 'roles': {'key': 'roles', 'type': '[EntityRole]'}, - 'children': {'key': 'children', 'type': '[ChildEntity]'}, - } - - def __init__(self, **kwargs): - super(CompositeEntityExtractor, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.name = kwargs.get('name', None) - self.type_id = kwargs.get('type_id', None) - self.readable_type = kwargs.get('readable_type', None) - self.roles = kwargs.get('roles', None) - self.children = kwargs.get('children', None) - - -class CompositeEntityModel(Model): - """A composite entity extractor. - - :param children: Child entities. - :type children: list[str] - :param name: Entity name. - :type name: str - """ - - _attribute_map = { - 'children': {'key': 'children', 'type': '[str]'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(CompositeEntityModel, self).__init__(**kwargs) - self.children = kwargs.get('children', None) - self.name = kwargs.get('name', None) - - -class CustomPrebuiltModel(Model): - """A Custom Prebuilt model. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. The ID of the Entity Model. - :type id: str - :param name: Name of the Entity Model. - :type name: str - :param type_id: The type ID of the Entity Model. - :type type_id: int - :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', - 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List - Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', - 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex - Entity Extractor' - :type readable_type: str or - ~azure.cognitiveservices.language.luis.authoring.models.enum - :param custom_prebuilt_domain_name: The domain name. - :type custom_prebuilt_domain_name: str - :param custom_prebuilt_model_name: The intent name or entity name. - :type custom_prebuilt_model_name: str - :param roles: - :type roles: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] - """ - - _validation = { - 'id': {'required': True}, - 'readable_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type_id': {'key': 'typeId', 'type': 'int'}, - 'readable_type': {'key': 'readableType', 'type': 'str'}, - 'custom_prebuilt_domain_name': {'key': 'customPrebuiltDomainName', 'type': 'str'}, - 'custom_prebuilt_model_name': {'key': 'customPrebuiltModelName', 'type': 'str'}, - 'roles': {'key': 'roles', 'type': '[EntityRole]'}, - } - - def __init__(self, **kwargs): - super(CustomPrebuiltModel, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.name = kwargs.get('name', None) - self.type_id = kwargs.get('type_id', None) - self.readable_type = kwargs.get('readable_type', None) - self.custom_prebuilt_domain_name = kwargs.get('custom_prebuilt_domain_name', None) - self.custom_prebuilt_model_name = kwargs.get('custom_prebuilt_model_name', None) - self.roles = kwargs.get('roles', None) - - -class EndpointInfo(Model): - """The base class "ProductionOrStagingEndpointInfo" inherits from. - - :param version_id: The version ID to publish. - :type version_id: str - :param is_staging: Indicates if the staging slot should be used, instead - of the Production one. - :type is_staging: bool - :param endpoint_url: The Runtime endpoint URL for this model version. - :type endpoint_url: str - :param region: The target region that the application is published to. - :type region: str - :param assigned_endpoint_key: The endpoint key. - :type assigned_endpoint_key: str - :param endpoint_region: The endpoint's region. - :type endpoint_region: str - :param failed_regions: Regions where publishing failed. - :type failed_regions: str - :param published_date_time: Timestamp when was last published. - :type published_date_time: str - """ - - _attribute_map = { - 'version_id': {'key': 'versionId', 'type': 'str'}, - 'is_staging': {'key': 'isStaging', 'type': 'bool'}, - 'endpoint_url': {'key': 'endpointUrl', 'type': 'str'}, - 'region': {'key': 'region', 'type': 'str'}, - 'assigned_endpoint_key': {'key': 'assignedEndpointKey', 'type': 'str'}, - 'endpoint_region': {'key': 'endpointRegion', 'type': 'str'}, - 'failed_regions': {'key': 'failedRegions', 'type': 'str'}, - 'published_date_time': {'key': 'publishedDateTime', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(EndpointInfo, self).__init__(**kwargs) - self.version_id = kwargs.get('version_id', None) - self.is_staging = kwargs.get('is_staging', None) - self.endpoint_url = kwargs.get('endpoint_url', None) - self.region = kwargs.get('region', None) - self.assigned_endpoint_key = kwargs.get('assigned_endpoint_key', None) - self.endpoint_region = kwargs.get('endpoint_region', None) - self.failed_regions = kwargs.get('failed_regions', None) - self.published_date_time = kwargs.get('published_date_time', None) - - -class EnqueueTrainingResponse(Model): - """Response model when requesting to train the model. - - :param status_id: The train request status ID. - :type status_id: int - :param status: Possible values include: 'Queued', 'InProgress', - 'UpToDate', 'Fail', 'Success' - :type status: str or - ~azure.cognitiveservices.language.luis.authoring.models.enum - """ - - _attribute_map = { - 'status_id': {'key': 'statusId', 'type': 'int'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(EnqueueTrainingResponse, self).__init__(**kwargs) - self.status_id = kwargs.get('status_id', None) - self.status = kwargs.get('status', None) - - -class EntitiesSuggestionExample(Model): - """Predicted/suggested entity. - - :param text: The utterance. For example, "What's the weather like in - seattle?" - :type text: str - :param tokenized_text: The utterance tokenized. - :type tokenized_text: list[str] - :param intent_predictions: Predicted/suggested intents. - :type intent_predictions: - list[~azure.cognitiveservices.language.luis.authoring.models.IntentPrediction] - :param entity_predictions: Predicted/suggested entities. - :type entity_predictions: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityPrediction] - """ - - _attribute_map = { - 'text': {'key': 'text', 'type': 'str'}, - 'tokenized_text': {'key': 'tokenizedText', 'type': '[str]'}, - 'intent_predictions': {'key': 'intentPredictions', 'type': '[IntentPrediction]'}, - 'entity_predictions': {'key': 'entityPredictions', 'type': '[EntityPrediction]'}, - } - - def __init__(self, **kwargs): - super(EntitiesSuggestionExample, self).__init__(**kwargs) - self.text = kwargs.get('text', None) - self.tokenized_text = kwargs.get('tokenized_text', None) - self.intent_predictions = kwargs.get('intent_predictions', None) - self.entity_predictions = kwargs.get('entity_predictions', None) - - -class EntityExtractor(Model): - """Entity Extractor. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. The ID of the Entity Model. - :type id: str - :param name: Name of the Entity Model. - :type name: str - :param type_id: The type ID of the Entity Model. - :type type_id: int - :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', - 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List - Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', - 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex - Entity Extractor' - :type readable_type: str or - ~azure.cognitiveservices.language.luis.authoring.models.enum - :param roles: - :type roles: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] - :param custom_prebuilt_domain_name: The domain name. - :type custom_prebuilt_domain_name: str - :param custom_prebuilt_model_name: The intent name or entity name. - :type custom_prebuilt_model_name: str - """ - - _validation = { - 'id': {'required': True}, - 'readable_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type_id': {'key': 'typeId', 'type': 'int'}, - 'readable_type': {'key': 'readableType', 'type': 'str'}, - 'roles': {'key': 'roles', 'type': '[EntityRole]'}, - 'custom_prebuilt_domain_name': {'key': 'customPrebuiltDomainName', 'type': 'str'}, - 'custom_prebuilt_model_name': {'key': 'customPrebuiltModelName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(EntityExtractor, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.name = kwargs.get('name', None) - self.type_id = kwargs.get('type_id', None) - self.readable_type = kwargs.get('readable_type', None) - self.roles = kwargs.get('roles', None) - self.custom_prebuilt_domain_name = kwargs.get('custom_prebuilt_domain_name', None) - self.custom_prebuilt_model_name = kwargs.get('custom_prebuilt_model_name', None) - - -class EntityLabel(Model): - """Defines the entity type and position of the extracted entity within the - example. - - All required parameters must be populated in order to send to Azure. - - :param entity_name: Required. The entity type. - :type entity_name: str - :param start_token_index: Required. The index within the utterance where - the extracted entity starts. - :type start_token_index: int - :param end_token_index: Required. The index within the utterance where the - extracted entity ends. - :type end_token_index: int - :param role: The role of the predicted entity. - :type role: str - :param role_id: The role id for the predicted entity. - :type role_id: str - :param children: - :type children: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityLabel] - """ - - _validation = { - 'entity_name': {'required': True}, - 'start_token_index': {'required': True}, - 'end_token_index': {'required': True}, - } - - _attribute_map = { - 'entity_name': {'key': 'entityName', 'type': 'str'}, - 'start_token_index': {'key': 'startTokenIndex', 'type': 'int'}, - 'end_token_index': {'key': 'endTokenIndex', 'type': 'int'}, - 'role': {'key': 'role', 'type': 'str'}, - 'role_id': {'key': 'roleId', 'type': 'str'}, - 'children': {'key': 'children', 'type': '[EntityLabel]'}, - } - - def __init__(self, **kwargs): - super(EntityLabel, self).__init__(**kwargs) - self.entity_name = kwargs.get('entity_name', None) - self.start_token_index = kwargs.get('start_token_index', None) - self.end_token_index = kwargs.get('end_token_index', None) - self.role = kwargs.get('role', None) - self.role_id = kwargs.get('role_id', None) - self.children = kwargs.get('children', None) - - -class EntityLabelObject(Model): - """Defines the entity type and position of the extracted entity within the - example. - - All required parameters must be populated in order to send to Azure. - - :param entity_name: Required. The entity type. - :type entity_name: str - :param start_char_index: Required. The index within the utterance where - the extracted entity starts. - :type start_char_index: int - :param end_char_index: Required. The index within the utterance where the - extracted entity ends. - :type end_char_index: int - :param role: The role the entity plays in the utterance. - :type role: str - :param children: The identified entities within the example utterance. - :type children: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityLabelObject] - """ - - _validation = { - 'entity_name': {'required': True}, - 'start_char_index': {'required': True}, - 'end_char_index': {'required': True}, - } - - _attribute_map = { - 'entity_name': {'key': 'entityName', 'type': 'str'}, - 'start_char_index': {'key': 'startCharIndex', 'type': 'int'}, - 'end_char_index': {'key': 'endCharIndex', 'type': 'int'}, - 'role': {'key': 'role', 'type': 'str'}, - 'children': {'key': 'children', 'type': '[EntityLabelObject]'}, - } - - def __init__(self, **kwargs): - super(EntityLabelObject, self).__init__(**kwargs) - self.entity_name = kwargs.get('entity_name', None) - self.start_char_index = kwargs.get('start_char_index', None) - self.end_char_index = kwargs.get('end_char_index', None) - self.role = kwargs.get('role', None) - self.children = kwargs.get('children', None) - - -class EntityModelCreateObject(Model): - """An entity extractor create object. - - :param children: Child entities. - :type children: - list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntityModelCreateObject] - :param name: Entity name. - :type name: str - """ - - _attribute_map = { - 'children': {'key': 'children', 'type': '[ChildEntityModelCreateObject]'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(EntityModelCreateObject, self).__init__(**kwargs) - self.children = kwargs.get('children', None) - self.name = kwargs.get('name', None) - - -class ModelInfo(Model): - """Base type used in entity types. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. The ID of the Entity Model. - :type id: str - :param name: Name of the Entity Model. - :type name: str - :param type_id: The type ID of the Entity Model. - :type type_id: int - :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', - 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List - Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', - 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex - Entity Extractor' - :type readable_type: str or - ~azure.cognitiveservices.language.luis.authoring.models.enum - """ - - _validation = { - 'id': {'required': True}, - 'readable_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type_id': {'key': 'typeId', 'type': 'int'}, - 'readable_type': {'key': 'readableType', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ModelInfo, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.name = kwargs.get('name', None) - self.type_id = kwargs.get('type_id', None) - self.readable_type = kwargs.get('readable_type', None) - - -class EntityModelInfo(ModelInfo): - """An Entity Extractor model info. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. The ID of the Entity Model. - :type id: str - :param name: Name of the Entity Model. - :type name: str - :param type_id: The type ID of the Entity Model. - :type type_id: int - :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', - 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List - Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', - 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex - Entity Extractor' - :type readable_type: str or - ~azure.cognitiveservices.language.luis.authoring.models.enum - :param roles: - :type roles: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] - """ - - _validation = { - 'id': {'required': True}, - 'readable_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type_id': {'key': 'typeId', 'type': 'int'}, - 'readable_type': {'key': 'readableType', 'type': 'str'}, - 'roles': {'key': 'roles', 'type': '[EntityRole]'}, - } - - def __init__(self, **kwargs): - super(EntityModelInfo, self).__init__(**kwargs) - self.roles = kwargs.get('roles', None) - - -class EntityModelUpdateObject(Model): - """An entity extractor update object. - - :param name: Entity name. - :type name: str - :param instance_of: The instance of model name - :type instance_of: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'instance_of': {'key': 'instanceOf', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(EntityModelUpdateObject, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.instance_of = kwargs.get('instance_of', None) - - -class EntityPrediction(Model): - """A suggested entity. - - All required parameters must be populated in order to send to Azure. - - :param entity_name: Required. The entity's name - :type entity_name: str - :param start_token_index: Required. The index within the utterance where - the extracted entity starts. - :type start_token_index: int - :param end_token_index: Required. The index within the utterance where the - extracted entity ends. - :type end_token_index: int - :param phrase: Required. The actual token(s) that comprise the entity. - :type phrase: str - :param children: - :type children: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityPrediction] - """ - - _validation = { - 'entity_name': {'required': True}, - 'start_token_index': {'required': True}, - 'end_token_index': {'required': True}, - 'phrase': {'required': True}, - } - - _attribute_map = { - 'entity_name': {'key': 'entityName', 'type': 'str'}, - 'start_token_index': {'key': 'startTokenIndex', 'type': 'int'}, - 'end_token_index': {'key': 'endTokenIndex', 'type': 'int'}, - 'phrase': {'key': 'phrase', 'type': 'str'}, - 'children': {'key': 'children', 'type': '[EntityPrediction]'}, - } - - def __init__(self, **kwargs): - super(EntityPrediction, self).__init__(**kwargs) - self.entity_name = kwargs.get('entity_name', None) - self.start_token_index = kwargs.get('start_token_index', None) - self.end_token_index = kwargs.get('end_token_index', None) - self.phrase = kwargs.get('phrase', None) - self.children = kwargs.get('children', None) - - -class EntityRole(Model): - """Entity extractor role. - - :param id: The entity role ID. - :type id: str - :param name: The entity role name. - :type name: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(EntityRole, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.name = kwargs.get('name', None) - - -class EntityRoleCreateObject(Model): - """Object model for creating an entity role. - - :param name: The entity role name. - :type name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(EntityRoleCreateObject, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - - -class EntityRoleUpdateObject(Model): - """Object model for updating an entity role. - - :param name: The entity role name. - :type name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(EntityRoleUpdateObject, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - - -class ErrorResponse(Model): - """Error response when invoking an operation on the API. - - :param additional_properties: Unmatched properties from the message are - deserialized this collection - :type additional_properties: dict[str, object] - :param error_type: - :type error_type: str - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'error_type': {'key': 'errorType', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ErrorResponse, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.error_type = kwargs.get('error_type', None) - - -class ErrorResponseException(HttpOperationError): - """Server responded with exception of type: 'ErrorResponse'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) - - -class ExampleLabelObject(Model): - """A labeled example utterance. - - :param text: The example utterance. - :type text: str - :param entity_labels: The identified entities within the example - utterance. - :type entity_labels: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityLabelObject] - :param intent_name: The identified intent representing the example - utterance. - :type intent_name: str - """ - - _attribute_map = { - 'text': {'key': 'text', 'type': 'str'}, - 'entity_labels': {'key': 'entityLabels', 'type': '[EntityLabelObject]'}, - 'intent_name': {'key': 'intentName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ExampleLabelObject, self).__init__(**kwargs) - self.text = kwargs.get('text', None) - self.entity_labels = kwargs.get('entity_labels', None) - self.intent_name = kwargs.get('intent_name', None) - - -class ExplicitListItem(Model): - """Explicit (exception) list item. - - :param id: The explicit list item ID. - :type id: long - :param explicit_list_item: The explicit list item value. - :type explicit_list_item: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'long'}, - 'explicit_list_item': {'key': 'explicitListItem', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ExplicitListItem, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.explicit_list_item = kwargs.get('explicit_list_item', None) - - -class ExplicitListItemCreateObject(Model): - """Object model for creating an explicit (exception) list item. - - :param explicit_list_item: The explicit list item. - :type explicit_list_item: str - """ - - _attribute_map = { - 'explicit_list_item': {'key': 'explicitListItem', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ExplicitListItemCreateObject, self).__init__(**kwargs) - self.explicit_list_item = kwargs.get('explicit_list_item', None) - - -class ExplicitListItemUpdateObject(Model): - """Model object for updating an explicit (exception) list item. - - :param explicit_list_item: The explicit list item. - :type explicit_list_item: str - """ - - _attribute_map = { - 'explicit_list_item': {'key': 'explicitListItem', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ExplicitListItemUpdateObject, self).__init__(**kwargs) - self.explicit_list_item = kwargs.get('explicit_list_item', None) - - -class FeatureInfoObject(Model): - """The base class Features-related response objects inherit from. - - :param id: A six-digit ID used for Features. - :type id: int - :param name: The name of the Feature. - :type name: str - :param is_active: Indicates if the feature is enabled. - :type is_active: bool - :param enabled_for_all_models: Indicates if the feature is enabled for all - models in the application. - :type enabled_for_all_models: bool - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'str'}, - 'is_active': {'key': 'isActive', 'type': 'bool'}, - 'enabled_for_all_models': {'key': 'enabledForAllModels', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(FeatureInfoObject, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.name = kwargs.get('name', None) - self.is_active = kwargs.get('is_active', None) - self.enabled_for_all_models = kwargs.get('enabled_for_all_models', None) - - -class FeaturesResponseObject(Model): - """Model Features, including Patterns and Phraselists. - - :param phraselist_features: - :type phraselist_features: - list[~azure.cognitiveservices.language.luis.authoring.models.PhraseListFeatureInfo] - :param pattern_features: - :type pattern_features: - list[~azure.cognitiveservices.language.luis.authoring.models.PatternFeatureInfo] - """ - - _attribute_map = { - 'phraselist_features': {'key': 'phraselistFeatures', 'type': '[PhraseListFeatureInfo]'}, - 'pattern_features': {'key': 'patternFeatures', 'type': '[PatternFeatureInfo]'}, - } - - def __init__(self, **kwargs): - super(FeaturesResponseObject, self).__init__(**kwargs) - self.phraselist_features = kwargs.get('phraselist_features', None) - self.pattern_features = kwargs.get('pattern_features', None) - - -class HierarchicalChildEntity(ChildEntity): - """A Hierarchical Child Entity. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. The ID (GUID) belonging to a child entity. - :type id: str - :param name: The name of a child entity. - :type name: str - :param instance_of: Instance of Model. - :type instance_of: str - :param type_id: The type ID of the Entity Model. - :type type_id: int - :param readable_type: Possible values include: 'Entity Extractor', 'Child - Entity Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child - Entity Extractor', 'Composite Entity Extractor', 'List Entity Extractor', - 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity - Extractor', 'Closed List Entity Extractor', 'Regex Entity Extractor' - :type readable_type: str or - ~azure.cognitiveservices.language.luis.authoring.models.enum - :param children: List of children - :type children: - list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntity] - """ - - _validation = { - 'id': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'instance_of': {'key': 'instanceOf', 'type': 'str'}, - 'type_id': {'key': 'typeId', 'type': 'int'}, - 'readable_type': {'key': 'readableType', 'type': 'str'}, - 'children': {'key': 'children', 'type': '[ChildEntity]'}, - } - - def __init__(self, **kwargs): - super(HierarchicalChildEntity, self).__init__(**kwargs) - - -class HierarchicalChildModelUpdateObject(Model): - """HierarchicalChildModelUpdateObject. - - :param name: - :type name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(HierarchicalChildModelUpdateObject, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - - -class HierarchicalEntityExtractor(Model): - """Hierarchical Entity Extractor. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. The ID of the Entity Model. - :type id: str - :param name: Name of the Entity Model. - :type name: str - :param type_id: The type ID of the Entity Model. - :type type_id: int - :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', - 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List - Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', - 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex - Entity Extractor' - :type readable_type: str or - ~azure.cognitiveservices.language.luis.authoring.models.enum - :param roles: - :type roles: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] - :param children: List of child entities. - :type children: - list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntity] - """ - - _validation = { - 'id': {'required': True}, - 'readable_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type_id': {'key': 'typeId', 'type': 'int'}, - 'readable_type': {'key': 'readableType', 'type': 'str'}, - 'roles': {'key': 'roles', 'type': '[EntityRole]'}, - 'children': {'key': 'children', 'type': '[ChildEntity]'}, - } - - def __init__(self, **kwargs): - super(HierarchicalEntityExtractor, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.name = kwargs.get('name', None) - self.type_id = kwargs.get('type_id', None) - self.readable_type = kwargs.get('readable_type', None) - self.roles = kwargs.get('roles', None) - self.children = kwargs.get('children', None) - - -class HierarchicalModel(Model): - """HierarchicalModel. - - :param name: - :type name: str - :param children: - :type children: - list[~azure.cognitiveservices.language.luis.authoring.models.JsonChild] - :param features: - :type features: - list[~azure.cognitiveservices.language.luis.authoring.models.JsonModelFeatureInformation] - :param roles: - :type roles: list[str] - :param inherits: - :type inherits: - ~azure.cognitiveservices.language.luis.authoring.models.PrebuiltDomainObject - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'children': {'key': 'children', 'type': '[JsonChild]'}, - 'features': {'key': 'features', 'type': '[JsonModelFeatureInformation]'}, - 'roles': {'key': 'roles', 'type': '[str]'}, - 'inherits': {'key': 'inherits', 'type': 'PrebuiltDomainObject'}, - } - - def __init__(self, **kwargs): - super(HierarchicalModel, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.children = kwargs.get('children', None) - self.features = kwargs.get('features', None) - self.roles = kwargs.get('roles', None) - self.inherits = kwargs.get('inherits', None) - - -class HierarchicalModelV2(Model): - """HierarchicalModelV2. - - :param name: - :type name: str - :param children: - :type children: list[str] - :param inherits: - :type inherits: - ~azure.cognitiveservices.language.luis.authoring.models.PrebuiltDomainObject - :param roles: - :type roles: list[str] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'children': {'key': 'children', 'type': '[str]'}, - 'inherits': {'key': 'inherits', 'type': 'PrebuiltDomainObject'}, - 'roles': {'key': 'roles', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(HierarchicalModelV2, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.children = kwargs.get('children', None) - self.inherits = kwargs.get('inherits', None) - self.roles = kwargs.get('roles', None) - - -class IntentClassifier(ModelInfo): - """Intent Classifier. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. The ID of the Entity Model. - :type id: str - :param name: Name of the Entity Model. - :type name: str - :param type_id: The type ID of the Entity Model. - :type type_id: int - :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', - 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List - Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', - 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex - Entity Extractor' - :type readable_type: str or - ~azure.cognitiveservices.language.luis.authoring.models.enum - :param custom_prebuilt_domain_name: The domain name. - :type custom_prebuilt_domain_name: str - :param custom_prebuilt_model_name: The intent name or entity name. - :type custom_prebuilt_model_name: str - """ - - _validation = { - 'id': {'required': True}, - 'readable_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type_id': {'key': 'typeId', 'type': 'int'}, - 'readable_type': {'key': 'readableType', 'type': 'str'}, - 'custom_prebuilt_domain_name': {'key': 'customPrebuiltDomainName', 'type': 'str'}, - 'custom_prebuilt_model_name': {'key': 'customPrebuiltModelName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(IntentClassifier, self).__init__(**kwargs) - self.custom_prebuilt_domain_name = kwargs.get('custom_prebuilt_domain_name', None) - self.custom_prebuilt_model_name = kwargs.get('custom_prebuilt_model_name', None) - - -class IntentPrediction(Model): - """A suggested intent. - - :param name: The intent's name - :type name: str - :param score: The intent's score, based on the prediction model. - :type score: float - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'score': {'key': 'score', 'type': 'float'}, - } - - def __init__(self, **kwargs): - super(IntentPrediction, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.score = kwargs.get('score', None) - - -class IntentsSuggestionExample(Model): - """Predicted/suggested intent. - - :param text: The utterance. For example, "What's the weather like in - seattle?" - :type text: str - :param tokenized_text: The tokenized utterance. - :type tokenized_text: list[str] - :param intent_predictions: Predicted/suggested intents. - :type intent_predictions: - list[~azure.cognitiveservices.language.luis.authoring.models.IntentPrediction] - :param entity_predictions: Predicted/suggested entities. - :type entity_predictions: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityPrediction] - """ - - _attribute_map = { - 'text': {'key': 'text', 'type': 'str'}, - 'tokenized_text': {'key': 'tokenizedText', 'type': '[str]'}, - 'intent_predictions': {'key': 'intentPredictions', 'type': '[IntentPrediction]'}, - 'entity_predictions': {'key': 'entityPredictions', 'type': '[EntityPrediction]'}, - } - - def __init__(self, **kwargs): - super(IntentsSuggestionExample, self).__init__(**kwargs) - self.text = kwargs.get('text', None) - self.tokenized_text = kwargs.get('tokenized_text', None) - self.intent_predictions = kwargs.get('intent_predictions', None) - self.entity_predictions = kwargs.get('entity_predictions', None) - - -class JsonChild(Model): - """JsonChild. - - :param name: - :type name: str - :param instance_of: - :type instance_of: str - :param children: - :type children: - list[~azure.cognitiveservices.language.luis.authoring.models.JsonChild] - :param features: - :type features: - list[~azure.cognitiveservices.language.luis.authoring.models.JsonModelFeatureInformation] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'instance_of': {'key': 'instanceOf', 'type': 'str'}, - 'children': {'key': 'children', 'type': '[JsonChild]'}, - 'features': {'key': 'features', 'type': '[JsonModelFeatureInformation]'}, - } - - def __init__(self, **kwargs): - super(JsonChild, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.instance_of = kwargs.get('instance_of', None) - self.children = kwargs.get('children', None) - self.features = kwargs.get('features', None) - - -class JSONEntity(Model): - """Exported Model - Extracted Entity from utterance. - - All required parameters must be populated in order to send to Azure. - - :param start_pos: Required. The index within the utterance where the - extracted entity starts. - :type start_pos: int - :param end_pos: Required. The index within the utterance where the - extracted entity ends. - :type end_pos: int - :param entity: Required. The entity name. - :type entity: str - :param role: The role the entity plays in the utterance. - :type role: str - :param children: - :type children: - list[~azure.cognitiveservices.language.luis.authoring.models.JSONEntity] - """ - - _validation = { - 'start_pos': {'required': True}, - 'end_pos': {'required': True}, - 'entity': {'required': True}, - } - - _attribute_map = { - 'start_pos': {'key': 'startPos', 'type': 'int'}, - 'end_pos': {'key': 'endPos', 'type': 'int'}, - 'entity': {'key': 'entity', 'type': 'str'}, - 'role': {'key': 'role', 'type': 'str'}, - 'children': {'key': 'children', 'type': '[JSONEntity]'}, - } - - def __init__(self, **kwargs): - super(JSONEntity, self).__init__(**kwargs) - self.start_pos = kwargs.get('start_pos', None) - self.end_pos = kwargs.get('end_pos', None) - self.entity = kwargs.get('entity', None) - self.role = kwargs.get('role', None) - self.children = kwargs.get('children', None) - - -class JSONModelFeature(Model): - """Exported Model - Phraselist Model Feature. - - :param activated: Indicates if the feature is enabled. - :type activated: bool - :param name: The Phraselist name. - :type name: str - :param words: List of comma-separated phrases that represent the - Phraselist. - :type words: str - :param mode: An interchangeable phrase list feature serves as a list of - synonyms for training. A non-exchangeable phrase list serves as separate - features for training. So, if your non-interchangeable phrase list - contains 5 phrases, they will be mapped to 5 separate features. You can - think of the non-interchangeable phrase list as an additional bag of words - to add to LUIS existing vocabulary features. It is used as a lexicon - lookup feature where its value is 1 if the lexicon contains a given word - or 0 if it doesn’t. Default value is true. - :type mode: bool - :param enabled_for_all_models: Indicates if the Phraselist is enabled for - all models in the application. Default value: True . - :type enabled_for_all_models: bool - """ - - _attribute_map = { - 'activated': {'key': 'activated', 'type': 'bool'}, - 'name': {'key': 'name', 'type': 'str'}, - 'words': {'key': 'words', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'bool'}, - 'enabled_for_all_models': {'key': 'enabledForAllModels', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(JSONModelFeature, self).__init__(**kwargs) - self.activated = kwargs.get('activated', None) - self.name = kwargs.get('name', None) - self.words = kwargs.get('words', None) - self.mode = kwargs.get('mode', None) - self.enabled_for_all_models = kwargs.get('enabled_for_all_models', True) - - -class JsonModelFeatureInformation(Model): - """An object containing the model feature information either the model name or - feature name. - - :param model_name: The name of the model used. - :type model_name: str - :param feature_name: The name of the feature used. - :type feature_name: str - """ - - _attribute_map = { - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'feature_name': {'key': 'featureName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(JsonModelFeatureInformation, self).__init__(**kwargs) - self.model_name = kwargs.get('model_name', None) - self.feature_name = kwargs.get('feature_name', None) - - -class JSONRegexFeature(Model): - """Exported Model - A Pattern feature. - - :param pattern: The Regular Expression to match. - :type pattern: str - :param activated: Indicates if the Pattern feature is enabled. - :type activated: bool - :param name: Name of the feature. - :type name: str - """ - - _attribute_map = { - 'pattern': {'key': 'pattern', 'type': 'str'}, - 'activated': {'key': 'activated', 'type': 'bool'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(JSONRegexFeature, self).__init__(**kwargs) - self.pattern = kwargs.get('pattern', None) - self.activated = kwargs.get('activated', None) - self.name = kwargs.get('name', None) - - -class JSONUtterance(Model): - """Exported Model - Utterance that was used to train the model. - - :param text: The utterance. - :type text: str - :param intent: The matched intent. - :type intent: str - :param entities: The matched entities. - :type entities: - list[~azure.cognitiveservices.language.luis.authoring.models.JSONEntity] - """ - - _attribute_map = { - 'text': {'key': 'text', 'type': 'str'}, - 'intent': {'key': 'intent', 'type': 'str'}, - 'entities': {'key': 'entities', 'type': '[JSONEntity]'}, - } - - def __init__(self, **kwargs): - super(JSONUtterance, self).__init__(**kwargs) - self.text = kwargs.get('text', None) - self.intent = kwargs.get('intent', None) - self.entities = kwargs.get('entities', None) - - -class LabeledUtterance(Model): - """A prediction and label pair of an example. - - :param id: ID of Labeled Utterance. - :type id: int - :param text: The utterance. For example, "What's the weather like in - seattle?" - :type text: str - :param tokenized_text: The utterance tokenized. - :type tokenized_text: list[str] - :param intent_label: The intent matching the example. - :type intent_label: str - :param entity_labels: The entities matching the example. - :type entity_labels: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityLabel] - :param intent_predictions: List of suggested intents. - :type intent_predictions: - list[~azure.cognitiveservices.language.luis.authoring.models.IntentPrediction] - :param entity_predictions: List of suggested entities. - :type entity_predictions: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityPrediction] - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'int'}, - 'text': {'key': 'text', 'type': 'str'}, - 'tokenized_text': {'key': 'tokenizedText', 'type': '[str]'}, - 'intent_label': {'key': 'intentLabel', 'type': 'str'}, - 'entity_labels': {'key': 'entityLabels', 'type': '[EntityLabel]'}, - 'intent_predictions': {'key': 'intentPredictions', 'type': '[IntentPrediction]'}, - 'entity_predictions': {'key': 'entityPredictions', 'type': '[EntityPrediction]'}, - } - - def __init__(self, **kwargs): - super(LabeledUtterance, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.text = kwargs.get('text', None) - self.tokenized_text = kwargs.get('tokenized_text', None) - self.intent_label = kwargs.get('intent_label', None) - self.entity_labels = kwargs.get('entity_labels', None) - self.intent_predictions = kwargs.get('intent_predictions', None) - self.entity_predictions = kwargs.get('entity_predictions', None) - - -class LabelExampleResponse(Model): - """Response when adding a labeled example utterance. - - :param utterance_text: The example utterance. - :type utterance_text: str - :param example_id: The newly created sample ID. - :type example_id: int - """ - - _attribute_map = { - 'utterance_text': {'key': 'UtteranceText', 'type': 'str'}, - 'example_id': {'key': 'ExampleId', 'type': 'int'}, - } - - def __init__(self, **kwargs): - super(LabelExampleResponse, self).__init__(**kwargs) - self.utterance_text = kwargs.get('utterance_text', None) - self.example_id = kwargs.get('example_id', None) - - -class LabelTextObject(Model): - """An object containing the example utterance's text. - - :param id: The ID of the Label. - :type id: int - :param text: The text of the label. - :type text: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'int'}, - 'text': {'key': 'text', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(LabelTextObject, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.text = kwargs.get('text', None) - - -class LuisApp(Model): - """Exported Model - An exported LUIS Application. - - :param additional_properties: Unmatched properties from the message are - deserialized this collection - :type additional_properties: dict[str, object] - :param name: The name of the application. - :type name: str - :param version_id: The version ID of the application that was exported. - :type version_id: str - :param desc: The description of the application. - :type desc: str - :param culture: The culture of the application. E.g.: en-us. - :type culture: str - :param intents: List of intents. - :type intents: - list[~azure.cognitiveservices.language.luis.authoring.models.HierarchicalModel] - :param entities: List of entities. - :type entities: - list[~azure.cognitiveservices.language.luis.authoring.models.HierarchicalModel] - :param closed_lists: List of list entities. - :type closed_lists: - list[~azure.cognitiveservices.language.luis.authoring.models.ClosedList] - :param composites: List of composite entities. - :type composites: - list[~azure.cognitiveservices.language.luis.authoring.models.HierarchicalModel] - :param hierarchicals: List of hierarchical entities. - :type hierarchicals: - list[~azure.cognitiveservices.language.luis.authoring.models.HierarchicalModel] - :param pattern_any_entities: List of Pattern.Any entities. - :type pattern_any_entities: - list[~azure.cognitiveservices.language.luis.authoring.models.PatternAny] - :param regex_entities: List of regular expression entities. - :type regex_entities: - list[~azure.cognitiveservices.language.luis.authoring.models.RegexEntity] - :param prebuilt_entities: List of prebuilt entities. - :type prebuilt_entities: - list[~azure.cognitiveservices.language.luis.authoring.models.PrebuiltEntity] - :param regex_features: List of pattern features. - :type regex_features: - list[~azure.cognitiveservices.language.luis.authoring.models.JSONRegexFeature] - :param phraselists: List of model features. - :type phraselists: - list[~azure.cognitiveservices.language.luis.authoring.models.JSONModelFeature] - :param patterns: List of patterns. - :type patterns: - list[~azure.cognitiveservices.language.luis.authoring.models.PatternRule] - :param utterances: List of example utterances. - :type utterances: - list[~azure.cognitiveservices.language.luis.authoring.models.JSONUtterance] - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'name': {'key': 'name', 'type': 'str'}, - 'version_id': {'key': 'versionId', 'type': 'str'}, - 'desc': {'key': 'desc', 'type': 'str'}, - 'culture': {'key': 'culture', 'type': 'str'}, - 'intents': {'key': 'intents', 'type': '[HierarchicalModel]'}, - 'entities': {'key': 'entities', 'type': '[HierarchicalModel]'}, - 'closed_lists': {'key': 'closedLists', 'type': '[ClosedList]'}, - 'composites': {'key': 'composites', 'type': '[HierarchicalModel]'}, - 'hierarchicals': {'key': 'hierarchicals', 'type': '[HierarchicalModel]'}, - 'pattern_any_entities': {'key': 'patternAnyEntities', 'type': '[PatternAny]'}, - 'regex_entities': {'key': 'regex_entities', 'type': '[RegexEntity]'}, - 'prebuilt_entities': {'key': 'prebuiltEntities', 'type': '[PrebuiltEntity]'}, - 'regex_features': {'key': 'regex_features', 'type': '[JSONRegexFeature]'}, - 'phraselists': {'key': 'phraselists', 'type': '[JSONModelFeature]'}, - 'patterns': {'key': 'patterns', 'type': '[PatternRule]'}, - 'utterances': {'key': 'utterances', 'type': '[JSONUtterance]'}, - } - - def __init__(self, **kwargs): - super(LuisApp, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.name = kwargs.get('name', None) - self.version_id = kwargs.get('version_id', None) - self.desc = kwargs.get('desc', None) - self.culture = kwargs.get('culture', None) - self.intents = kwargs.get('intents', None) - self.entities = kwargs.get('entities', None) - self.closed_lists = kwargs.get('closed_lists', None) - self.composites = kwargs.get('composites', None) - self.hierarchicals = kwargs.get('hierarchicals', None) - self.pattern_any_entities = kwargs.get('pattern_any_entities', None) - self.regex_entities = kwargs.get('regex_entities', None) - self.prebuilt_entities = kwargs.get('prebuilt_entities', None) - self.regex_features = kwargs.get('regex_features', None) - self.phraselists = kwargs.get('phraselists', None) - self.patterns = kwargs.get('patterns', None) - self.utterances = kwargs.get('utterances', None) - - -class LuisAppV2(Model): - """Exported Model - An exported LUIS Application. - - :param additional_properties: Unmatched properties from the message are - deserialized this collection - :type additional_properties: dict[str, object] - :param luis_schema_version: Luis schema deserialization version. - :type luis_schema_version: str - :param name: The name of the application. - :type name: str - :param version_id: The version ID of the application that was exported. - :type version_id: str - :param desc: The description of the application. - :type desc: str - :param culture: The culture of the application. E.g.: en-us. - :type culture: str - :param intents: List of intents. - :type intents: - list[~azure.cognitiveservices.language.luis.authoring.models.HierarchicalModelV2] - :param entities: List of entities. - :type entities: - list[~azure.cognitiveservices.language.luis.authoring.models.HierarchicalModelV2] - :param closed_lists: List of list entities. - :type closed_lists: - list[~azure.cognitiveservices.language.luis.authoring.models.ClosedList] - :param composites: List of composite entities. - :type composites: - list[~azure.cognitiveservices.language.luis.authoring.models.HierarchicalModelV2] - :param pattern_any_entities: List of Pattern.Any entities. - :type pattern_any_entities: - list[~azure.cognitiveservices.language.luis.authoring.models.PatternAny] - :param regex_entities: List of regular expression entities. - :type regex_entities: - list[~azure.cognitiveservices.language.luis.authoring.models.RegexEntity] - :param prebuilt_entities: List of prebuilt entities. - :type prebuilt_entities: - list[~azure.cognitiveservices.language.luis.authoring.models.PrebuiltEntity] - :param regex_features: List of pattern features. - :type regex_features: - list[~azure.cognitiveservices.language.luis.authoring.models.JSONRegexFeature] - :param model_features: List of model features. - :type model_features: - list[~azure.cognitiveservices.language.luis.authoring.models.JSONModelFeature] - :param patterns: List of patterns. - :type patterns: - list[~azure.cognitiveservices.language.luis.authoring.models.PatternRule] - :param utterances: List of example utterances. - :type utterances: - list[~azure.cognitiveservices.language.luis.authoring.models.JSONUtterance] - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'luis_schema_version': {'key': 'luis_schema_version', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'version_id': {'key': 'versionId', 'type': 'str'}, - 'desc': {'key': 'desc', 'type': 'str'}, - 'culture': {'key': 'culture', 'type': 'str'}, - 'intents': {'key': 'intents', 'type': '[HierarchicalModelV2]'}, - 'entities': {'key': 'entities', 'type': '[HierarchicalModelV2]'}, - 'closed_lists': {'key': 'closedLists', 'type': '[ClosedList]'}, - 'composites': {'key': 'composites', 'type': '[HierarchicalModelV2]'}, - 'pattern_any_entities': {'key': 'patternAnyEntities', 'type': '[PatternAny]'}, - 'regex_entities': {'key': 'regex_entities', 'type': '[RegexEntity]'}, - 'prebuilt_entities': {'key': 'prebuiltEntities', 'type': '[PrebuiltEntity]'}, - 'regex_features': {'key': 'regex_features', 'type': '[JSONRegexFeature]'}, - 'model_features': {'key': 'model_features', 'type': '[JSONModelFeature]'}, - 'patterns': {'key': 'patterns', 'type': '[PatternRule]'}, - 'utterances': {'key': 'utterances', 'type': '[JSONUtterance]'}, - } - - def __init__(self, **kwargs): - super(LuisAppV2, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.luis_schema_version = kwargs.get('luis_schema_version', None) - self.name = kwargs.get('name', None) - self.version_id = kwargs.get('version_id', None) - self.desc = kwargs.get('desc', None) - self.culture = kwargs.get('culture', None) - self.intents = kwargs.get('intents', None) - self.entities = kwargs.get('entities', None) - self.closed_lists = kwargs.get('closed_lists', None) - self.composites = kwargs.get('composites', None) - self.pattern_any_entities = kwargs.get('pattern_any_entities', None) - self.regex_entities = kwargs.get('regex_entities', None) - self.prebuilt_entities = kwargs.get('prebuilt_entities', None) - self.regex_features = kwargs.get('regex_features', None) - self.model_features = kwargs.get('model_features', None) - self.patterns = kwargs.get('patterns', None) - self.utterances = kwargs.get('utterances', None) - - -class ModelCreateObject(Model): - """Object model for creating a new entity extractor. - - :param name: Name of the new entity extractor. - :type name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ModelCreateObject, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - - -class ModelFeatureInformation(Model): - """An object containing the model feature information either the model name or - feature name. - - :param model_name: The name of the model used. - :type model_name: str - :param feature_name: The name of the feature used. - :type feature_name: str - :param is_required: - :type is_required: bool - """ - - _attribute_map = { - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'feature_name': {'key': 'featureName', 'type': 'str'}, - 'is_required': {'key': 'isRequired', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(ModelFeatureInformation, self).__init__(**kwargs) - self.model_name = kwargs.get('model_name', None) - self.feature_name = kwargs.get('feature_name', None) - self.is_required = kwargs.get('is_required', None) - - -class ModelInfoResponse(Model): - """An application model info. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. The ID of the Entity Model. - :type id: str - :param name: Name of the Entity Model. - :type name: str - :param type_id: The type ID of the Entity Model. - :type type_id: int - :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', - 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List - Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', - 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex - Entity Extractor' - :type readable_type: str or - ~azure.cognitiveservices.language.luis.authoring.models.enum - :param roles: - :type roles: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] - :param children: List of child entities. - :type children: - list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntity] - :param sub_lists: List of sublists. - :type sub_lists: - list[~azure.cognitiveservices.language.luis.authoring.models.SubClosedListResponse] - :param custom_prebuilt_domain_name: The domain name. - :type custom_prebuilt_domain_name: str - :param custom_prebuilt_model_name: The intent name or entity name. - :type custom_prebuilt_model_name: str - :param regex_pattern: The Regular Expression entity pattern. - :type regex_pattern: str - :param explicit_list: - :type explicit_list: - list[~azure.cognitiveservices.language.luis.authoring.models.ExplicitListItem] - """ - - _validation = { - 'id': {'required': True}, - 'readable_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type_id': {'key': 'typeId', 'type': 'int'}, - 'readable_type': {'key': 'readableType', 'type': 'str'}, - 'roles': {'key': 'roles', 'type': '[EntityRole]'}, - 'children': {'key': 'children', 'type': '[ChildEntity]'}, - 'sub_lists': {'key': 'subLists', 'type': '[SubClosedListResponse]'}, - 'custom_prebuilt_domain_name': {'key': 'customPrebuiltDomainName', 'type': 'str'}, - 'custom_prebuilt_model_name': {'key': 'customPrebuiltModelName', 'type': 'str'}, - 'regex_pattern': {'key': 'regexPattern', 'type': 'str'}, - 'explicit_list': {'key': 'explicitList', 'type': '[ExplicitListItem]'}, - } - - def __init__(self, **kwargs): - super(ModelInfoResponse, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.name = kwargs.get('name', None) - self.type_id = kwargs.get('type_id', None) - self.readable_type = kwargs.get('readable_type', None) - self.roles = kwargs.get('roles', None) - self.children = kwargs.get('children', None) - self.sub_lists = kwargs.get('sub_lists', None) - self.custom_prebuilt_domain_name = kwargs.get('custom_prebuilt_domain_name', None) - self.custom_prebuilt_model_name = kwargs.get('custom_prebuilt_model_name', None) - self.regex_pattern = kwargs.get('regex_pattern', None) - self.explicit_list = kwargs.get('explicit_list', None) - - -class ModelTrainingDetails(Model): - """Model Training Details. - - :param status_id: The train request status ID. - :type status_id: int - :param status: Possible values include: 'Queued', 'InProgress', - 'UpToDate', 'Fail', 'Success' - :type status: str or - ~azure.cognitiveservices.language.luis.authoring.models.enum - :param example_count: The count of examples used to train the model. - :type example_count: int - :param training_date_time: When the model was trained. - :type training_date_time: datetime - :param failure_reason: Reason for the training failure. - :type failure_reason: str - """ - - _attribute_map = { - 'status_id': {'key': 'statusId', 'type': 'int'}, - 'status': {'key': 'status', 'type': 'str'}, - 'example_count': {'key': 'exampleCount', 'type': 'int'}, - 'training_date_time': {'key': 'trainingDateTime', 'type': 'iso-8601'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ModelTrainingDetails, self).__init__(**kwargs) - self.status_id = kwargs.get('status_id', None) - self.status = kwargs.get('status', None) - self.example_count = kwargs.get('example_count', None) - self.training_date_time = kwargs.get('training_date_time', None) - self.failure_reason = kwargs.get('failure_reason', None) - - -class ModelTrainingInfo(Model): - """Model Training Info. - - :param model_id: The ID (GUID) of the model. - :type model_id: str - :param details: - :type details: - ~azure.cognitiveservices.language.luis.authoring.models.ModelTrainingDetails - """ - - _attribute_map = { - 'model_id': {'key': 'modelId', 'type': 'str'}, - 'details': {'key': 'details', 'type': 'ModelTrainingDetails'}, - } - - def __init__(self, **kwargs): - super(ModelTrainingInfo, self).__init__(**kwargs) - self.model_id = kwargs.get('model_id', None) - self.details = kwargs.get('details', None) - - -class ModelUpdateObject(Model): - """Object model for updating an intent classifier. - - :param name: The entity's new name. - :type name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ModelUpdateObject, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - - -class NDepthEntityExtractor(Model): - """N-Depth Entity Extractor. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. The ID of the Entity Model. - :type id: str - :param name: Name of the Entity Model. - :type name: str - :param type_id: The type ID of the Entity Model. - :type type_id: int - :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', - 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List - Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', - 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex - Entity Extractor' - :type readable_type: str or - ~azure.cognitiveservices.language.luis.authoring.models.enum - :param roles: - :type roles: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] - :param custom_prebuilt_domain_name: The domain name. - :type custom_prebuilt_domain_name: str - :param custom_prebuilt_model_name: The intent name or entity name. - :type custom_prebuilt_model_name: str - :param children: - :type children: - list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntity] - """ - - _validation = { - 'id': {'required': True}, - 'readable_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type_id': {'key': 'typeId', 'type': 'int'}, - 'readable_type': {'key': 'readableType', 'type': 'str'}, - 'roles': {'key': 'roles', 'type': '[EntityRole]'}, - 'custom_prebuilt_domain_name': {'key': 'customPrebuiltDomainName', 'type': 'str'}, - 'custom_prebuilt_model_name': {'key': 'customPrebuiltModelName', 'type': 'str'}, - 'children': {'key': 'children', 'type': '[ChildEntity]'}, - } - - def __init__(self, **kwargs): - super(NDepthEntityExtractor, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.name = kwargs.get('name', None) - self.type_id = kwargs.get('type_id', None) - self.readable_type = kwargs.get('readable_type', None) - self.roles = kwargs.get('roles', None) - self.custom_prebuilt_domain_name = kwargs.get('custom_prebuilt_domain_name', None) - self.custom_prebuilt_model_name = kwargs.get('custom_prebuilt_model_name', None) - self.children = kwargs.get('children', None) - - -class OperationError(Model): - """Operation error details when invoking an operation on the API. - - :param code: - :type code: str - :param message: - :type message: str - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(OperationError, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - - -class OperationStatus(Model): - """Response of an Operation status. - - :param code: Status Code. Possible values include: 'Failed', 'FAILED', - 'Success' - :type code: str or - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatusType - :param message: Status details. - :type message: str - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(OperationStatus, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - - -class PatternAny(Model): - """Pattern.Any Entity Extractor. - - :param name: - :type name: str - :param explicit_list: - :type explicit_list: list[str] - :param roles: - :type roles: list[str] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'explicit_list': {'key': 'explicitList', 'type': '[str]'}, - 'roles': {'key': 'roles', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(PatternAny, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.explicit_list = kwargs.get('explicit_list', None) - self.roles = kwargs.get('roles', None) - - -class PatternAnyEntityExtractor(Model): - """Pattern.Any Entity Extractor. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. The ID of the Entity Model. - :type id: str - :param name: Name of the Entity Model. - :type name: str - :param type_id: The type ID of the Entity Model. - :type type_id: int - :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', - 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List - Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', - 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex - Entity Extractor' - :type readable_type: str or - ~azure.cognitiveservices.language.luis.authoring.models.enum - :param roles: - :type roles: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] - :param explicit_list: - :type explicit_list: - list[~azure.cognitiveservices.language.luis.authoring.models.ExplicitListItem] - """ - - _validation = { - 'id': {'required': True}, - 'readable_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type_id': {'key': 'typeId', 'type': 'int'}, - 'readable_type': {'key': 'readableType', 'type': 'str'}, - 'roles': {'key': 'roles', 'type': '[EntityRole]'}, - 'explicit_list': {'key': 'explicitList', 'type': '[ExplicitListItem]'}, - } - - def __init__(self, **kwargs): - super(PatternAnyEntityExtractor, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.name = kwargs.get('name', None) - self.type_id = kwargs.get('type_id', None) - self.readable_type = kwargs.get('readable_type', None) - self.roles = kwargs.get('roles', None) - self.explicit_list = kwargs.get('explicit_list', None) - - -class PatternAnyModelCreateObject(Model): - """Model object for creating a Pattern.Any entity model. - - :param name: The model name. - :type name: str - :param explicit_list: The Pattern.Any explicit list. - :type explicit_list: list[str] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'explicit_list': {'key': 'explicitList', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(PatternAnyModelCreateObject, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.explicit_list = kwargs.get('explicit_list', None) - - -class PatternAnyModelUpdateObject(Model): - """Model object for updating a Pattern.Any entity model. - - :param name: The model name. - :type name: str - :param explicit_list: The Pattern.Any explicit list. - :type explicit_list: list[str] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'explicit_list': {'key': 'explicitList', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(PatternAnyModelUpdateObject, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.explicit_list = kwargs.get('explicit_list', None) - - -class PatternFeatureInfo(FeatureInfoObject): - """Pattern feature. - - :param id: A six-digit ID used for Features. - :type id: int - :param name: The name of the Feature. - :type name: str - :param is_active: Indicates if the feature is enabled. - :type is_active: bool - :param enabled_for_all_models: Indicates if the feature is enabled for all - models in the application. - :type enabled_for_all_models: bool - :param pattern: The Regular Expression to match. - :type pattern: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'str'}, - 'is_active': {'key': 'isActive', 'type': 'bool'}, - 'enabled_for_all_models': {'key': 'enabledForAllModels', 'type': 'bool'}, - 'pattern': {'key': 'pattern', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(PatternFeatureInfo, self).__init__(**kwargs) - self.pattern = kwargs.get('pattern', None) - - -class PatternRule(Model): - """Pattern. - - :param pattern: The pattern text. - :type pattern: str - :param intent: The intent's name where the pattern belongs to. - :type intent: str - """ - - _attribute_map = { - 'pattern': {'key': 'pattern', 'type': 'str'}, - 'intent': {'key': 'intent', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(PatternRule, self).__init__(**kwargs) - self.pattern = kwargs.get('pattern', None) - self.intent = kwargs.get('intent', None) - - -class PatternRuleCreateObject(Model): - """Object model for creating a pattern. - - :param pattern: The pattern text. - :type pattern: str - :param intent: The intent's name which the pattern belongs to. - :type intent: str - """ - - _attribute_map = { - 'pattern': {'key': 'pattern', 'type': 'str'}, - 'intent': {'key': 'intent', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(PatternRuleCreateObject, self).__init__(**kwargs) - self.pattern = kwargs.get('pattern', None) - self.intent = kwargs.get('intent', None) - - -class PatternRuleInfo(Model): - """Pattern rule. - - :param id: The pattern ID. - :type id: str - :param pattern: The pattern text. - :type pattern: str - :param intent: The intent's name where the pattern belongs to. - :type intent: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'pattern': {'key': 'pattern', 'type': 'str'}, - 'intent': {'key': 'intent', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(PatternRuleInfo, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.pattern = kwargs.get('pattern', None) - self.intent = kwargs.get('intent', None) - - -class PatternRuleUpdateObject(Model): - """Object model for updating a pattern. - - :param id: The pattern ID. - :type id: str - :param pattern: The pattern text. - :type pattern: str - :param intent: The intent's name which the pattern belongs to. - :type intent: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'pattern': {'key': 'pattern', 'type': 'str'}, - 'intent': {'key': 'intent', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(PatternRuleUpdateObject, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.pattern = kwargs.get('pattern', None) - self.intent = kwargs.get('intent', None) - - -class PersonalAssistantsResponse(Model): - """Response containing user's endpoint keys and the endpoint URLs of the - prebuilt Cortana applications. - - :param endpoint_keys: - :type endpoint_keys: list[str] - :param endpoint_urls: - :type endpoint_urls: dict[str, str] - """ - - _attribute_map = { - 'endpoint_keys': {'key': 'endpointKeys', 'type': '[str]'}, - 'endpoint_urls': {'key': 'endpointUrls', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(PersonalAssistantsResponse, self).__init__(**kwargs) - self.endpoint_keys = kwargs.get('endpoint_keys', None) - self.endpoint_urls = kwargs.get('endpoint_urls', None) - - -class PhraselistCreateObject(Model): - """Object model for creating a phraselist model. - - :param phrases: List of comma-separated phrases that represent the - Phraselist. - :type phrases: str - :param name: The Phraselist name. - :type name: str - :param is_exchangeable: An interchangeable phrase list feature serves as a - list of synonyms for training. A non-exchangeable phrase list serves as - separate features for training. So, if your non-interchangeable phrase - list contains 5 phrases, they will be mapped to 5 separate features. You - can think of the non-interchangeable phrase list as an additional bag of - words to add to LUIS existing vocabulary features. It is used as a lexicon - lookup feature where its value is 1 if the lexicon contains a given word - or 0 if it doesn’t. Default value is true. Default value: True . - :type is_exchangeable: bool - :param enabled_for_all_models: Indicates if the Phraselist is enabled for - all models in the application. Default value: True . - :type enabled_for_all_models: bool - """ - - _attribute_map = { - 'phrases': {'key': 'phrases', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'is_exchangeable': {'key': 'isExchangeable', 'type': 'bool'}, - 'enabled_for_all_models': {'key': 'enabledForAllModels', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(PhraselistCreateObject, self).__init__(**kwargs) - self.phrases = kwargs.get('phrases', None) - self.name = kwargs.get('name', None) - self.is_exchangeable = kwargs.get('is_exchangeable', True) - self.enabled_for_all_models = kwargs.get('enabled_for_all_models', True) - - -class PhraseListFeatureInfo(FeatureInfoObject): - """Phraselist Feature. - - :param id: A six-digit ID used for Features. - :type id: int - :param name: The name of the Feature. - :type name: str - :param is_active: Indicates if the feature is enabled. - :type is_active: bool - :param enabled_for_all_models: Indicates if the feature is enabled for all - models in the application. - :type enabled_for_all_models: bool - :param phrases: A list of comma-separated values. - :type phrases: str - :param is_exchangeable: An exchangeable phrase list feature are serves as - single feature to the LUIS underlying training algorithm. It is used as a - lexicon lookup feature where its value is 1 if the lexicon contains a - given word or 0 if it doesn’t. Think of an exchangeable as a synonyms - list. A non-exchangeable phrase list feature has all the phrases in the - list serve as separate features to the underlying training algorithm. So, - if you your phrase list feature contains 5 phrases, they will be mapped to - 5 separate features. You can think of the non-exchangeable phrase list - feature as an additional bag of words that you are willing to add to LUIS - existing vocabulary features. Think of a non-exchangeable as set of - different words. Default value is true. - :type is_exchangeable: bool - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'str'}, - 'is_active': {'key': 'isActive', 'type': 'bool'}, - 'enabled_for_all_models': {'key': 'enabledForAllModels', 'type': 'bool'}, - 'phrases': {'key': 'phrases', 'type': 'str'}, - 'is_exchangeable': {'key': 'isExchangeable', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(PhraseListFeatureInfo, self).__init__(**kwargs) - self.phrases = kwargs.get('phrases', None) - self.is_exchangeable = kwargs.get('is_exchangeable', None) - - -class PhraselistUpdateObject(Model): - """Object model for updating a Phraselist. - - :param phrases: List of comma-separated phrases that represent the - Phraselist. - :type phrases: str - :param name: The Phraselist name. - :type name: str - :param is_active: Indicates if the Phraselist is enabled. Default value: - True . - :type is_active: bool - :param is_exchangeable: An exchangeable phrase list feature are serves as - single feature to the LUIS underlying training algorithm. It is used as a - lexicon lookup feature where its value is 1 if the lexicon contains a - given word or 0 if it doesn’t. Think of an exchangeable as a synonyms - list. A non-exchangeable phrase list feature has all the phrases in the - list serve as separate features to the underlying training algorithm. So, - if you your phrase list feature contains 5 phrases, they will be mapped to - 5 separate features. You can think of the non-exchangeable phrase list - feature as an additional bag of words that you are willing to add to LUIS - existing vocabulary features. Think of a non-exchangeable as set of - different words. Default value is true. Default value: True . - :type is_exchangeable: bool - :param enabled_for_all_models: Indicates if the Phraselist is enabled for - all models in the application. Default value: True . - :type enabled_for_all_models: bool - """ - - _attribute_map = { - 'phrases': {'key': 'phrases', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'is_active': {'key': 'isActive', 'type': 'bool'}, - 'is_exchangeable': {'key': 'isExchangeable', 'type': 'bool'}, - 'enabled_for_all_models': {'key': 'enabledForAllModels', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(PhraselistUpdateObject, self).__init__(**kwargs) - self.phrases = kwargs.get('phrases', None) - self.name = kwargs.get('name', None) - self.is_active = kwargs.get('is_active', True) - self.is_exchangeable = kwargs.get('is_exchangeable', True) - self.enabled_for_all_models = kwargs.get('enabled_for_all_models', True) - - -class PrebuiltDomain(Model): - """Prebuilt Domain. - - :param name: - :type name: str - :param culture: - :type culture: str - :param description: - :type description: str - :param examples: - :type examples: str - :param intents: - :type intents: - list[~azure.cognitiveservices.language.luis.authoring.models.PrebuiltDomainItem] - :param entities: - :type entities: - list[~azure.cognitiveservices.language.luis.authoring.models.PrebuiltDomainItem] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'culture': {'key': 'culture', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'examples': {'key': 'examples', 'type': 'str'}, - 'intents': {'key': 'intents', 'type': '[PrebuiltDomainItem]'}, - 'entities': {'key': 'entities', 'type': '[PrebuiltDomainItem]'}, - } - - def __init__(self, **kwargs): - super(PrebuiltDomain, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.culture = kwargs.get('culture', None) - self.description = kwargs.get('description', None) - self.examples = kwargs.get('examples', None) - self.intents = kwargs.get('intents', None) - self.entities = kwargs.get('entities', None) - - -class PrebuiltDomainCreateBaseObject(Model): - """A model object containing the name of the custom prebuilt entity and the - name of the domain to which this model belongs. - - :param domain_name: The domain name. - :type domain_name: str - """ - - _attribute_map = { - 'domain_name': {'key': 'domainName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(PrebuiltDomainCreateBaseObject, self).__init__(**kwargs) - self.domain_name = kwargs.get('domain_name', None) - - -class PrebuiltDomainCreateObject(Model): - """A prebuilt domain create object containing the name and culture of the - domain. - - :param domain_name: The domain name. - :type domain_name: str - :param culture: The culture of the new domain. - :type culture: str - """ - - _attribute_map = { - 'domain_name': {'key': 'domainName', 'type': 'str'}, - 'culture': {'key': 'culture', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(PrebuiltDomainCreateObject, self).__init__(**kwargs) - self.domain_name = kwargs.get('domain_name', None) - self.culture = kwargs.get('culture', None) - - -class PrebuiltDomainItem(Model): - """PrebuiltDomainItem. - - :param name: - :type name: str - :param description: - :type description: str - :param examples: - :type examples: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'examples': {'key': 'examples', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(PrebuiltDomainItem, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.description = kwargs.get('description', None) - self.examples = kwargs.get('examples', None) - - -class PrebuiltDomainModelCreateObject(Model): - """A model object containing the name of the custom prebuilt intent or entity - and the name of the domain to which this model belongs. - - :param domain_name: The domain name. - :type domain_name: str - :param model_name: The intent name or entity name. - :type model_name: str - """ - - _attribute_map = { - 'domain_name': {'key': 'domainName', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(PrebuiltDomainModelCreateObject, self).__init__(**kwargs) - self.domain_name = kwargs.get('domain_name', None) - self.model_name = kwargs.get('model_name', None) - - -class PrebuiltDomainObject(Model): - """PrebuiltDomainObject. - - :param domain_name: - :type domain_name: str - :param model_name: - :type model_name: str - """ - - _attribute_map = { - 'domain_name': {'key': 'domain_name', 'type': 'str'}, - 'model_name': {'key': 'model_name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(PrebuiltDomainObject, self).__init__(**kwargs) - self.domain_name = kwargs.get('domain_name', None) - self.model_name = kwargs.get('model_name', None) - - -class PrebuiltEntity(Model): - """Prebuilt Entity Extractor. - - :param name: - :type name: str - :param roles: - :type roles: list[str] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'roles': {'key': 'roles', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(PrebuiltEntity, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.roles = kwargs.get('roles', None) - - -class PrebuiltEntityExtractor(Model): - """Prebuilt Entity Extractor. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. The ID of the Entity Model. - :type id: str - :param name: Name of the Entity Model. - :type name: str - :param type_id: The type ID of the Entity Model. - :type type_id: int - :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', - 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List - Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', - 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex - Entity Extractor' - :type readable_type: str or - ~azure.cognitiveservices.language.luis.authoring.models.enum - :param roles: - :type roles: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] - """ - - _validation = { - 'id': {'required': True}, - 'readable_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type_id': {'key': 'typeId', 'type': 'int'}, - 'readable_type': {'key': 'readableType', 'type': 'str'}, - 'roles': {'key': 'roles', 'type': '[EntityRole]'}, - } - - def __init__(self, **kwargs): - super(PrebuiltEntityExtractor, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.name = kwargs.get('name', None) - self.type_id = kwargs.get('type_id', None) - self.readable_type = kwargs.get('readable_type', None) - self.roles = kwargs.get('roles', None) - - -class ProductionOrStagingEndpointInfo(EndpointInfo): - """ProductionOrStagingEndpointInfo. - - :param version_id: The version ID to publish. - :type version_id: str - :param is_staging: Indicates if the staging slot should be used, instead - of the Production one. - :type is_staging: bool - :param endpoint_url: The Runtime endpoint URL for this model version. - :type endpoint_url: str - :param region: The target region that the application is published to. - :type region: str - :param assigned_endpoint_key: The endpoint key. - :type assigned_endpoint_key: str - :param endpoint_region: The endpoint's region. - :type endpoint_region: str - :param failed_regions: Regions where publishing failed. - :type failed_regions: str - :param published_date_time: Timestamp when was last published. - :type published_date_time: str - """ - - _attribute_map = { - 'version_id': {'key': 'versionId', 'type': 'str'}, - 'is_staging': {'key': 'isStaging', 'type': 'bool'}, - 'endpoint_url': {'key': 'endpointUrl', 'type': 'str'}, - 'region': {'key': 'region', 'type': 'str'}, - 'assigned_endpoint_key': {'key': 'assignedEndpointKey', 'type': 'str'}, - 'endpoint_region': {'key': 'endpointRegion', 'type': 'str'}, - 'failed_regions': {'key': 'failedRegions', 'type': 'str'}, - 'published_date_time': {'key': 'publishedDateTime', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ProductionOrStagingEndpointInfo, self).__init__(**kwargs) - - -class PublishSettings(Model): - """The application publish settings. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. The application ID. - :type id: str - :param is_sentiment_analysis_enabled: Required. Setting sentiment analysis - as true returns the sentiment of the input utterance along with the - response - :type is_sentiment_analysis_enabled: bool - :param is_speech_enabled: Required. Enables speech priming in your app - :type is_speech_enabled: bool - :param is_spell_checker_enabled: Required. Enables spell checking of the - utterance. - :type is_spell_checker_enabled: bool - """ - - _validation = { - 'id': {'required': True}, - 'is_sentiment_analysis_enabled': {'required': True}, - 'is_speech_enabled': {'required': True}, - 'is_spell_checker_enabled': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'is_sentiment_analysis_enabled': {'key': 'sentimentAnalysis', 'type': 'bool'}, - 'is_speech_enabled': {'key': 'speech', 'type': 'bool'}, - 'is_spell_checker_enabled': {'key': 'spellChecker', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(PublishSettings, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.is_sentiment_analysis_enabled = kwargs.get('is_sentiment_analysis_enabled', None) - self.is_speech_enabled = kwargs.get('is_speech_enabled', None) - self.is_spell_checker_enabled = kwargs.get('is_spell_checker_enabled', None) - - -class PublishSettingUpdateObject(Model): - """Object model for updating an application's publish settings. - - :param sentiment_analysis: Setting sentiment analysis as true returns the - Sentiment of the input utterance along with the response - :type sentiment_analysis: bool - :param speech: Setting speech as public enables speech priming in your app - :type speech: bool - :param spell_checker: Setting spell checker as public enables spell - checking the input utterance. - :type spell_checker: bool - """ - - _attribute_map = { - 'sentiment_analysis': {'key': 'sentimentAnalysis', 'type': 'bool'}, - 'speech': {'key': 'speech', 'type': 'bool'}, - 'spell_checker': {'key': 'spellChecker', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(PublishSettingUpdateObject, self).__init__(**kwargs) - self.sentiment_analysis = kwargs.get('sentiment_analysis', None) - self.speech = kwargs.get('speech', None) - self.spell_checker = kwargs.get('spell_checker', None) - - -class RegexEntity(Model): - """Regular Expression Entity Extractor. - - :param name: - :type name: str - :param regex_pattern: - :type regex_pattern: str - :param roles: - :type roles: list[str] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'regex_pattern': {'key': 'regexPattern', 'type': 'str'}, - 'roles': {'key': 'roles', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(RegexEntity, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.regex_pattern = kwargs.get('regex_pattern', None) - self.roles = kwargs.get('roles', None) - - -class RegexEntityExtractor(Model): - """Regular Expression Entity Extractor. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. The ID of the Entity Model. - :type id: str - :param name: Name of the Entity Model. - :type name: str - :param type_id: The type ID of the Entity Model. - :type type_id: int - :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', - 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List - Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', - 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex - Entity Extractor' - :type readable_type: str or - ~azure.cognitiveservices.language.luis.authoring.models.enum - :param roles: - :type roles: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] - :param regex_pattern: The Regular Expression entity pattern. - :type regex_pattern: str - """ - - _validation = { - 'id': {'required': True}, - 'readable_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type_id': {'key': 'typeId', 'type': 'int'}, - 'readable_type': {'key': 'readableType', 'type': 'str'}, - 'roles': {'key': 'roles', 'type': '[EntityRole]'}, - 'regex_pattern': {'key': 'regexPattern', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(RegexEntityExtractor, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.name = kwargs.get('name', None) - self.type_id = kwargs.get('type_id', None) - self.readable_type = kwargs.get('readable_type', None) - self.roles = kwargs.get('roles', None) - self.regex_pattern = kwargs.get('regex_pattern', None) - - -class RegexModelCreateObject(Model): - """Model object for creating a regular expression entity model. - - :param regex_pattern: The regular expression entity pattern. - :type regex_pattern: str - :param name: The model name. - :type name: str - """ - - _attribute_map = { - 'regex_pattern': {'key': 'regexPattern', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(RegexModelCreateObject, self).__init__(**kwargs) - self.regex_pattern = kwargs.get('regex_pattern', None) - self.name = kwargs.get('name', None) - - -class RegexModelUpdateObject(Model): - """Model object for updating a regular expression entity model. - - :param regex_pattern: The regular expression entity pattern. - :type regex_pattern: str - :param name: The model name. - :type name: str - """ - - _attribute_map = { - 'regex_pattern': {'key': 'regexPattern', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(RegexModelUpdateObject, self).__init__(**kwargs) - self.regex_pattern = kwargs.get('regex_pattern', None) - self.name = kwargs.get('name', None) - - -class SubClosedList(Model): - """Sublist of items for a list entity. - - :param canonical_form: The standard form that the list represents. - :type canonical_form: str - :param list: List of synonym words. - :type list: list[str] - """ - - _attribute_map = { - 'canonical_form': {'key': 'canonicalForm', 'type': 'str'}, - 'list': {'key': 'list', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(SubClosedList, self).__init__(**kwargs) - self.canonical_form = kwargs.get('canonical_form', None) - self.list = kwargs.get('list', None) - - -class SubClosedListResponse(SubClosedList): - """Sublist of items for a list entity. - - :param canonical_form: The standard form that the list represents. - :type canonical_form: str - :param list: List of synonym words. - :type list: list[str] - :param id: The sublist ID - :type id: int - """ - - _attribute_map = { - 'canonical_form': {'key': 'canonicalForm', 'type': 'str'}, - 'list': {'key': 'list', 'type': '[str]'}, - 'id': {'key': 'id', 'type': 'int'}, - } - - def __init__(self, **kwargs): - super(SubClosedListResponse, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - -class TaskUpdateObject(Model): - """Object model for cloning an application's version. - - :param version: The new version for the cloned model. - :type version: str - """ - - _attribute_map = { - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(TaskUpdateObject, self).__init__(**kwargs) - self.version = kwargs.get('version', None) - - -class UserAccessList(Model): - """List of user permissions. - - :param owner: The email address of owner of the application. - :type owner: str - :param emails: - :type emails: list[str] - """ - - _attribute_map = { - 'owner': {'key': 'owner', 'type': 'str'}, - 'emails': {'key': 'emails', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(UserAccessList, self).__init__(**kwargs) - self.owner = kwargs.get('owner', None) - self.emails = kwargs.get('emails', None) - - -class UserCollaborator(Model): - """UserCollaborator. - - :param email: The email address of the user. - :type email: str - """ - - _attribute_map = { - 'email': {'key': 'email', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(UserCollaborator, self).__init__(**kwargs) - self.email = kwargs.get('email', None) - - -class VersionInfo(Model): - """Object model of an application version. - - All required parameters must be populated in order to send to Azure. - - :param version: Required. The version ID. E.g.: "0.1" - :type version: str - :param created_date_time: The version's creation timestamp. - :type created_date_time: datetime - :param last_modified_date_time: Timestamp of the last update. - :type last_modified_date_time: datetime - :param last_trained_date_time: Timestamp of the last time the model was - trained. - :type last_trained_date_time: datetime - :param last_published_date_time: Timestamp when was last published. - :type last_published_date_time: datetime - :param endpoint_url: The Runtime endpoint URL for this model version. - :type endpoint_url: str - :param assigned_endpoint_key: The endpoint key. - :type assigned_endpoint_key: dict[str, str] - :param external_api_keys: External keys. - :type external_api_keys: object - :param intents_count: Number of intents in this model. - :type intents_count: int - :param entities_count: Number of entities in this model. - :type entities_count: int - :param endpoint_hits_count: Number of calls made to this endpoint. - :type endpoint_hits_count: int - :param training_status: Required. The current training status. Possible - values include: 'NeedsTraining', 'InProgress', 'Trained' - :type training_status: str or - ~azure.cognitiveservices.language.luis.authoring.models.TrainingStatus - """ - - _validation = { - 'version': {'required': True}, - 'training_status': {'required': True}, - } - - _attribute_map = { - 'version': {'key': 'version', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'last_modified_date_time': {'key': 'lastModifiedDateTime', 'type': 'iso-8601'}, - 'last_trained_date_time': {'key': 'lastTrainedDateTime', 'type': 'iso-8601'}, - 'last_published_date_time': {'key': 'lastPublishedDateTime', 'type': 'iso-8601'}, - 'endpoint_url': {'key': 'endpointUrl', 'type': 'str'}, - 'assigned_endpoint_key': {'key': 'assignedEndpointKey', 'type': '{str}'}, - 'external_api_keys': {'key': 'externalApiKeys', 'type': 'object'}, - 'intents_count': {'key': 'intentsCount', 'type': 'int'}, - 'entities_count': {'key': 'entitiesCount', 'type': 'int'}, - 'endpoint_hits_count': {'key': 'endpointHitsCount', 'type': 'int'}, - 'training_status': {'key': 'trainingStatus', 'type': 'TrainingStatus'}, - } - - def __init__(self, **kwargs): - super(VersionInfo, self).__init__(**kwargs) - self.version = kwargs.get('version', None) - self.created_date_time = kwargs.get('created_date_time', None) - self.last_modified_date_time = kwargs.get('last_modified_date_time', None) - self.last_trained_date_time = kwargs.get('last_trained_date_time', None) - self.last_published_date_time = kwargs.get('last_published_date_time', None) - self.endpoint_url = kwargs.get('endpoint_url', None) - self.assigned_endpoint_key = kwargs.get('assigned_endpoint_key', None) - self.external_api_keys = kwargs.get('external_api_keys', None) - self.intents_count = kwargs.get('intents_count', None) - self.entities_count = kwargs.get('entities_count', None) - self.endpoint_hits_count = kwargs.get('endpoint_hits_count', None) - self.training_status = kwargs.get('training_status', None) - - -class WordListBaseUpdateObject(Model): - """Object model for updating one of the list entity's sublists. - - :param canonical_form: The standard form that the list represents. - :type canonical_form: str - :param list: List of synonym words. - :type list: list[str] - """ - - _attribute_map = { - 'canonical_form': {'key': 'canonicalForm', 'type': 'str'}, - 'list': {'key': 'list', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(WordListBaseUpdateObject, self).__init__(**kwargs) - self.canonical_form = kwargs.get('canonical_form', None) - self.list = kwargs.get('list', None) - - -class WordListObject(Model): - """Sublist of items for a list entity. - - :param canonical_form: The standard form that the list represents. - :type canonical_form: str - :param list: List of synonym words. - :type list: list[str] - """ - - _attribute_map = { - 'canonical_form': {'key': 'canonicalForm', 'type': 'str'}, - 'list': {'key': 'list', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(WordListObject, self).__init__(**kwargs) - self.canonical_form = kwargs.get('canonical_form', None) - self.list = kwargs.get('list', None) diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/models/_models_py3.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/models/_models_py3.py deleted file mode 100644 index 98cf9a88e87..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/models/_models_py3.py +++ /dev/null @@ -1,3333 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError - - -class ApplicationCreateObject(Model): - """Properties for creating a new LUIS Application. - - All required parameters must be populated in order to send to Azure. - - :param culture: Required. The culture for the new application. It is the - language that your app understands and speaks. E.g.: "en-us". Note: the - culture cannot be changed after the app is created. - :type culture: str - :param domain: The domain for the new application. Optional. E.g.: Comics. - :type domain: str - :param description: Description of the new application. Optional. - :type description: str - :param initial_version_id: The initial version ID. Optional. Default value - is: "0.1" - :type initial_version_id: str - :param usage_scenario: Defines the scenario for the new application. - Optional. E.g.: IoT. - :type usage_scenario: str - :param name: Required. The name for the new application. - :type name: str - """ - - _validation = { - 'culture': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'culture': {'key': 'culture', 'type': 'str'}, - 'domain': {'key': 'domain', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'initial_version_id': {'key': 'initialVersionId', 'type': 'str'}, - 'usage_scenario': {'key': 'usageScenario', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, culture: str, name: str, domain: str=None, description: str=None, initial_version_id: str=None, usage_scenario: str=None, **kwargs) -> None: - super(ApplicationCreateObject, self).__init__(**kwargs) - self.culture = culture - self.domain = domain - self.description = description - self.initial_version_id = initial_version_id - self.usage_scenario = usage_scenario - self.name = name - - -class ApplicationInfoResponse(Model): - """Response containing the Application Info. - - :param id: The ID (GUID) of the application. - :type id: str - :param name: The name of the application. - :type name: str - :param description: The description of the application. - :type description: str - :param culture: The culture of the application. For example, "en-us". - :type culture: str - :param usage_scenario: Defines the scenario for the new application. - Optional. For example, IoT. - :type usage_scenario: str - :param domain: The domain for the new application. Optional. For example, - Comics. - :type domain: str - :param versions_count: Amount of model versions within the application. - :type versions_count: int - :param created_date_time: The version's creation timestamp. - :type created_date_time: str - :param endpoints: The Runtime endpoint URL for this model version. - :type endpoints: object - :param endpoint_hits_count: Number of calls made to this endpoint. - :type endpoint_hits_count: int - :param active_version: The version ID currently marked as active. - :type active_version: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'culture': {'key': 'culture', 'type': 'str'}, - 'usage_scenario': {'key': 'usageScenario', 'type': 'str'}, - 'domain': {'key': 'domain', 'type': 'str'}, - 'versions_count': {'key': 'versionsCount', 'type': 'int'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'str'}, - 'endpoints': {'key': 'endpoints', 'type': 'object'}, - 'endpoint_hits_count': {'key': 'endpointHitsCount', 'type': 'int'}, - 'active_version': {'key': 'activeVersion', 'type': 'str'}, - } - - def __init__(self, *, id: str=None, name: str=None, description: str=None, culture: str=None, usage_scenario: str=None, domain: str=None, versions_count: int=None, created_date_time: str=None, endpoints=None, endpoint_hits_count: int=None, active_version: str=None, **kwargs) -> None: - super(ApplicationInfoResponse, self).__init__(**kwargs) - self.id = id - self.name = name - self.description = description - self.culture = culture - self.usage_scenario = usage_scenario - self.domain = domain - self.versions_count = versions_count - self.created_date_time = created_date_time - self.endpoints = endpoints - self.endpoint_hits_count = endpoint_hits_count - self.active_version = active_version - - -class ApplicationPublishObject(Model): - """Object model for publishing a specific application version. - - :param version_id: The version ID to publish. - :type version_id: str - :param is_staging: Indicates if the staging slot should be used, instead - of the Production one. Default value: False . - :type is_staging: bool - """ - - _attribute_map = { - 'version_id': {'key': 'versionId', 'type': 'str'}, - 'is_staging': {'key': 'isStaging', 'type': 'bool'}, - } - - def __init__(self, *, version_id: str=None, is_staging: bool=False, **kwargs) -> None: - super(ApplicationPublishObject, self).__init__(**kwargs) - self.version_id = version_id - self.is_staging = is_staging - - -class ApplicationSettings(Model): - """The application settings. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. The application ID. - :type id: str - :param is_public: Required. Setting your application as public allows - other people to use your application's endpoint using their own keys for - billing purposes. - :type is_public: bool - """ - - _validation = { - 'id': {'required': True}, - 'is_public': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'is_public': {'key': 'public', 'type': 'bool'}, - } - - def __init__(self, *, id: str, is_public: bool, **kwargs) -> None: - super(ApplicationSettings, self).__init__(**kwargs) - self.id = id - self.is_public = is_public - - -class ApplicationSettingUpdateObject(Model): - """Object model for updating an application's settings. - - :param is_public: Setting your application as public allows other people - to use your application's endpoint using their own keys. - :type is_public: bool - """ - - _attribute_map = { - 'is_public': {'key': 'public', 'type': 'bool'}, - } - - def __init__(self, *, is_public: bool=None, **kwargs) -> None: - super(ApplicationSettingUpdateObject, self).__init__(**kwargs) - self.is_public = is_public - - -class ApplicationUpdateObject(Model): - """Object model for updating the name or description of an application. - - :param name: The application's new name. - :type name: str - :param description: The application's new description. - :type description: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__(self, *, name: str=None, description: str=None, **kwargs) -> None: - super(ApplicationUpdateObject, self).__init__(**kwargs) - self.name = name - self.description = description - - -class AppVersionSettingObject(Model): - """Object model of an application version setting. - - :param name: The application version setting name. - :type name: str - :param value: The application version setting value. - :type value: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, *, name: str=None, value: str=None, **kwargs) -> None: - super(AppVersionSettingObject, self).__init__(**kwargs) - self.name = name - self.value = value - - -class AvailableCulture(Model): - """Available culture for using in a new application. - - :param name: The language name. - :type name: str - :param code: The ISO value for the language. - :type code: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'code': {'key': 'code', 'type': 'str'}, - } - - def __init__(self, *, name: str=None, code: str=None, **kwargs) -> None: - super(AvailableCulture, self).__init__(**kwargs) - self.name = name - self.code = code - - -class AvailablePrebuiltEntityModel(Model): - """Available Prebuilt entity model for using in an application. - - :param name: The entity name. - :type name: str - :param description: The entity description and usage information. - :type description: str - :param examples: Usage examples. - :type examples: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'examples': {'key': 'examples', 'type': 'str'}, - } - - def __init__(self, *, name: str=None, description: str=None, examples: str=None, **kwargs) -> None: - super(AvailablePrebuiltEntityModel, self).__init__(**kwargs) - self.name = name - self.description = description - self.examples = examples - - -class AzureAccountInfoObject(Model): - """Defines the Azure account information object. - - All required parameters must be populated in order to send to Azure. - - :param azure_subscription_id: Required. The id for the Azure subscription. - :type azure_subscription_id: str - :param resource_group: Required. The Azure resource group name. - :type resource_group: str - :param account_name: Required. The Azure account name. - :type account_name: str - """ - - _validation = { - 'azure_subscription_id': {'required': True}, - 'resource_group': {'required': True}, - 'account_name': {'required': True}, - } - - _attribute_map = { - 'azure_subscription_id': {'key': 'azureSubscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - } - - def __init__(self, *, azure_subscription_id: str, resource_group: str, account_name: str, **kwargs) -> None: - super(AzureAccountInfoObject, self).__init__(**kwargs) - self.azure_subscription_id = azure_subscription_id - self.resource_group = resource_group - self.account_name = account_name - - -class BatchLabelExample(Model): - """Response when adding a batch of labeled example utterances. - - :param value: - :type value: - ~azure.cognitiveservices.language.luis.authoring.models.LabelExampleResponse - :param has_error: - :type has_error: bool - :param error: - :type error: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'LabelExampleResponse'}, - 'has_error': {'key': 'hasError', 'type': 'bool'}, - 'error': {'key': 'error', 'type': 'OperationStatus'}, - } - - def __init__(self, *, value=None, has_error: bool=None, error=None, **kwargs) -> None: - super(BatchLabelExample, self).__init__(**kwargs) - self.value = value - self.has_error = has_error - self.error = error - - -class ChildEntity(Model): - """The base child entity type. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. The ID (GUID) belonging to a child entity. - :type id: str - :param name: The name of a child entity. - :type name: str - :param instance_of: Instance of Model. - :type instance_of: str - :param type_id: The type ID of the Entity Model. - :type type_id: int - :param readable_type: Possible values include: 'Entity Extractor', 'Child - Entity Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child - Entity Extractor', 'Composite Entity Extractor', 'List Entity Extractor', - 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity - Extractor', 'Closed List Entity Extractor', 'Regex Entity Extractor' - :type readable_type: str or - ~azure.cognitiveservices.language.luis.authoring.models.enum - :param children: List of children - :type children: - list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntity] - """ - - _validation = { - 'id': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'instance_of': {'key': 'instanceOf', 'type': 'str'}, - 'type_id': {'key': 'typeId', 'type': 'int'}, - 'readable_type': {'key': 'readableType', 'type': 'str'}, - 'children': {'key': 'children', 'type': '[ChildEntity]'}, - } - - def __init__(self, *, id: str, name: str=None, instance_of: str=None, type_id: int=None, readable_type=None, children=None, **kwargs) -> None: - super(ChildEntity, self).__init__(**kwargs) - self.id = id - self.name = name - self.instance_of = instance_of - self.type_id = type_id - self.readable_type = readable_type - self.children = children - - -class ChildEntityModelCreateObject(Model): - """A child entity extractor create object. - - :param children: Child entities. - :type children: - list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntityModelCreateObject] - :param name: Entity name. - :type name: str - :param instance_of: The instance of model name - :type instance_of: str - """ - - _attribute_map = { - 'children': {'key': 'children', 'type': '[ChildEntityModelCreateObject]'}, - 'name': {'key': 'name', 'type': 'str'}, - 'instance_of': {'key': 'instanceOf', 'type': 'str'}, - } - - def __init__(self, *, children=None, name: str=None, instance_of: str=None, **kwargs) -> None: - super(ChildEntityModelCreateObject, self).__init__(**kwargs) - self.children = children - self.name = name - self.instance_of = instance_of - - -class ClosedList(Model): - """Exported Model - A list entity. - - :param name: Name of the list entity. - :type name: str - :param sub_lists: Sublists for the list entity. - :type sub_lists: - list[~azure.cognitiveservices.language.luis.authoring.models.SubClosedList] - :param roles: - :type roles: list[str] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'sub_lists': {'key': 'subLists', 'type': '[SubClosedList]'}, - 'roles': {'key': 'roles', 'type': '[str]'}, - } - - def __init__(self, *, name: str=None, sub_lists=None, roles=None, **kwargs) -> None: - super(ClosedList, self).__init__(**kwargs) - self.name = name - self.sub_lists = sub_lists - self.roles = roles - - -class ClosedListEntityExtractor(Model): - """List Entity Extractor. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. The ID of the Entity Model. - :type id: str - :param name: Name of the Entity Model. - :type name: str - :param type_id: The type ID of the Entity Model. - :type type_id: int - :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', - 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List - Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', - 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex - Entity Extractor' - :type readable_type: str or - ~azure.cognitiveservices.language.luis.authoring.models.enum - :param roles: - :type roles: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] - :param sub_lists: List of sublists. - :type sub_lists: - list[~azure.cognitiveservices.language.luis.authoring.models.SubClosedListResponse] - """ - - _validation = { - 'id': {'required': True}, - 'readable_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type_id': {'key': 'typeId', 'type': 'int'}, - 'readable_type': {'key': 'readableType', 'type': 'str'}, - 'roles': {'key': 'roles', 'type': '[EntityRole]'}, - 'sub_lists': {'key': 'subLists', 'type': '[SubClosedListResponse]'}, - } - - def __init__(self, *, id: str, readable_type, name: str=None, type_id: int=None, roles=None, sub_lists=None, **kwargs) -> None: - super(ClosedListEntityExtractor, self).__init__(**kwargs) - self.id = id - self.name = name - self.type_id = type_id - self.readable_type = readable_type - self.roles = roles - self.sub_lists = sub_lists - - -class ClosedListModelCreateObject(Model): - """Object model for creating a list entity. - - :param sub_lists: Sublists for the feature. - :type sub_lists: - list[~azure.cognitiveservices.language.luis.authoring.models.WordListObject] - :param name: Name of the list entity. - :type name: str - """ - - _attribute_map = { - 'sub_lists': {'key': 'subLists', 'type': '[WordListObject]'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, sub_lists=None, name: str=None, **kwargs) -> None: - super(ClosedListModelCreateObject, self).__init__(**kwargs) - self.sub_lists = sub_lists - self.name = name - - -class ClosedListModelPatchObject(Model): - """Object model for adding a batch of sublists to an existing list entity. - - :param sub_lists: Sublists to add. - :type sub_lists: - list[~azure.cognitiveservices.language.luis.authoring.models.WordListObject] - """ - - _attribute_map = { - 'sub_lists': {'key': 'subLists', 'type': '[WordListObject]'}, - } - - def __init__(self, *, sub_lists=None, **kwargs) -> None: - super(ClosedListModelPatchObject, self).__init__(**kwargs) - self.sub_lists = sub_lists - - -class ClosedListModelUpdateObject(Model): - """Object model for updating a list entity. - - :param sub_lists: The new sublists for the feature. - :type sub_lists: - list[~azure.cognitiveservices.language.luis.authoring.models.WordListObject] - :param name: The new name of the list entity. - :type name: str - """ - - _attribute_map = { - 'sub_lists': {'key': 'subLists', 'type': '[WordListObject]'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, sub_lists=None, name: str=None, **kwargs) -> None: - super(ClosedListModelUpdateObject, self).__init__(**kwargs) - self.sub_lists = sub_lists - self.name = name - - -class CollaboratorsArray(Model): - """CollaboratorsArray. - - :param emails: The email address of the users. - :type emails: list[str] - """ - - _attribute_map = { - 'emails': {'key': 'emails', 'type': '[str]'}, - } - - def __init__(self, *, emails=None, **kwargs) -> None: - super(CollaboratorsArray, self).__init__(**kwargs) - self.emails = emails - - -class CompositeChildModelCreateObject(Model): - """CompositeChildModelCreateObject. - - :param name: - :type name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, name: str=None, **kwargs) -> None: - super(CompositeChildModelCreateObject, self).__init__(**kwargs) - self.name = name - - -class CompositeEntityExtractor(Model): - """A Composite Entity Extractor. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. The ID of the Entity Model. - :type id: str - :param name: Name of the Entity Model. - :type name: str - :param type_id: The type ID of the Entity Model. - :type type_id: int - :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', - 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List - Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', - 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex - Entity Extractor' - :type readable_type: str or - ~azure.cognitiveservices.language.luis.authoring.models.enum - :param roles: - :type roles: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] - :param children: List of child entities. - :type children: - list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntity] - """ - - _validation = { - 'id': {'required': True}, - 'readable_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type_id': {'key': 'typeId', 'type': 'int'}, - 'readable_type': {'key': 'readableType', 'type': 'str'}, - 'roles': {'key': 'roles', 'type': '[EntityRole]'}, - 'children': {'key': 'children', 'type': '[ChildEntity]'}, - } - - def __init__(self, *, id: str, readable_type, name: str=None, type_id: int=None, roles=None, children=None, **kwargs) -> None: - super(CompositeEntityExtractor, self).__init__(**kwargs) - self.id = id - self.name = name - self.type_id = type_id - self.readable_type = readable_type - self.roles = roles - self.children = children - - -class CompositeEntityModel(Model): - """A composite entity extractor. - - :param children: Child entities. - :type children: list[str] - :param name: Entity name. - :type name: str - """ - - _attribute_map = { - 'children': {'key': 'children', 'type': '[str]'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, children=None, name: str=None, **kwargs) -> None: - super(CompositeEntityModel, self).__init__(**kwargs) - self.children = children - self.name = name - - -class CustomPrebuiltModel(Model): - """A Custom Prebuilt model. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. The ID of the Entity Model. - :type id: str - :param name: Name of the Entity Model. - :type name: str - :param type_id: The type ID of the Entity Model. - :type type_id: int - :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', - 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List - Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', - 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex - Entity Extractor' - :type readable_type: str or - ~azure.cognitiveservices.language.luis.authoring.models.enum - :param custom_prebuilt_domain_name: The domain name. - :type custom_prebuilt_domain_name: str - :param custom_prebuilt_model_name: The intent name or entity name. - :type custom_prebuilt_model_name: str - :param roles: - :type roles: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] - """ - - _validation = { - 'id': {'required': True}, - 'readable_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type_id': {'key': 'typeId', 'type': 'int'}, - 'readable_type': {'key': 'readableType', 'type': 'str'}, - 'custom_prebuilt_domain_name': {'key': 'customPrebuiltDomainName', 'type': 'str'}, - 'custom_prebuilt_model_name': {'key': 'customPrebuiltModelName', 'type': 'str'}, - 'roles': {'key': 'roles', 'type': '[EntityRole]'}, - } - - def __init__(self, *, id: str, readable_type, name: str=None, type_id: int=None, custom_prebuilt_domain_name: str=None, custom_prebuilt_model_name: str=None, roles=None, **kwargs) -> None: - super(CustomPrebuiltModel, self).__init__(**kwargs) - self.id = id - self.name = name - self.type_id = type_id - self.readable_type = readable_type - self.custom_prebuilt_domain_name = custom_prebuilt_domain_name - self.custom_prebuilt_model_name = custom_prebuilt_model_name - self.roles = roles - - -class EndpointInfo(Model): - """The base class "ProductionOrStagingEndpointInfo" inherits from. - - :param version_id: The version ID to publish. - :type version_id: str - :param is_staging: Indicates if the staging slot should be used, instead - of the Production one. - :type is_staging: bool - :param endpoint_url: The Runtime endpoint URL for this model version. - :type endpoint_url: str - :param region: The target region that the application is published to. - :type region: str - :param assigned_endpoint_key: The endpoint key. - :type assigned_endpoint_key: str - :param endpoint_region: The endpoint's region. - :type endpoint_region: str - :param failed_regions: Regions where publishing failed. - :type failed_regions: str - :param published_date_time: Timestamp when was last published. - :type published_date_time: str - """ - - _attribute_map = { - 'version_id': {'key': 'versionId', 'type': 'str'}, - 'is_staging': {'key': 'isStaging', 'type': 'bool'}, - 'endpoint_url': {'key': 'endpointUrl', 'type': 'str'}, - 'region': {'key': 'region', 'type': 'str'}, - 'assigned_endpoint_key': {'key': 'assignedEndpointKey', 'type': 'str'}, - 'endpoint_region': {'key': 'endpointRegion', 'type': 'str'}, - 'failed_regions': {'key': 'failedRegions', 'type': 'str'}, - 'published_date_time': {'key': 'publishedDateTime', 'type': 'str'}, - } - - def __init__(self, *, version_id: str=None, is_staging: bool=None, endpoint_url: str=None, region: str=None, assigned_endpoint_key: str=None, endpoint_region: str=None, failed_regions: str=None, published_date_time: str=None, **kwargs) -> None: - super(EndpointInfo, self).__init__(**kwargs) - self.version_id = version_id - self.is_staging = is_staging - self.endpoint_url = endpoint_url - self.region = region - self.assigned_endpoint_key = assigned_endpoint_key - self.endpoint_region = endpoint_region - self.failed_regions = failed_regions - self.published_date_time = published_date_time - - -class EnqueueTrainingResponse(Model): - """Response model when requesting to train the model. - - :param status_id: The train request status ID. - :type status_id: int - :param status: Possible values include: 'Queued', 'InProgress', - 'UpToDate', 'Fail', 'Success' - :type status: str or - ~azure.cognitiveservices.language.luis.authoring.models.enum - """ - - _attribute_map = { - 'status_id': {'key': 'statusId', 'type': 'int'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__(self, *, status_id: int=None, status=None, **kwargs) -> None: - super(EnqueueTrainingResponse, self).__init__(**kwargs) - self.status_id = status_id - self.status = status - - -class EntitiesSuggestionExample(Model): - """Predicted/suggested entity. - - :param text: The utterance. For example, "What's the weather like in - seattle?" - :type text: str - :param tokenized_text: The utterance tokenized. - :type tokenized_text: list[str] - :param intent_predictions: Predicted/suggested intents. - :type intent_predictions: - list[~azure.cognitiveservices.language.luis.authoring.models.IntentPrediction] - :param entity_predictions: Predicted/suggested entities. - :type entity_predictions: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityPrediction] - """ - - _attribute_map = { - 'text': {'key': 'text', 'type': 'str'}, - 'tokenized_text': {'key': 'tokenizedText', 'type': '[str]'}, - 'intent_predictions': {'key': 'intentPredictions', 'type': '[IntentPrediction]'}, - 'entity_predictions': {'key': 'entityPredictions', 'type': '[EntityPrediction]'}, - } - - def __init__(self, *, text: str=None, tokenized_text=None, intent_predictions=None, entity_predictions=None, **kwargs) -> None: - super(EntitiesSuggestionExample, self).__init__(**kwargs) - self.text = text - self.tokenized_text = tokenized_text - self.intent_predictions = intent_predictions - self.entity_predictions = entity_predictions - - -class EntityExtractor(Model): - """Entity Extractor. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. The ID of the Entity Model. - :type id: str - :param name: Name of the Entity Model. - :type name: str - :param type_id: The type ID of the Entity Model. - :type type_id: int - :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', - 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List - Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', - 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex - Entity Extractor' - :type readable_type: str or - ~azure.cognitiveservices.language.luis.authoring.models.enum - :param roles: - :type roles: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] - :param custom_prebuilt_domain_name: The domain name. - :type custom_prebuilt_domain_name: str - :param custom_prebuilt_model_name: The intent name or entity name. - :type custom_prebuilt_model_name: str - """ - - _validation = { - 'id': {'required': True}, - 'readable_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type_id': {'key': 'typeId', 'type': 'int'}, - 'readable_type': {'key': 'readableType', 'type': 'str'}, - 'roles': {'key': 'roles', 'type': '[EntityRole]'}, - 'custom_prebuilt_domain_name': {'key': 'customPrebuiltDomainName', 'type': 'str'}, - 'custom_prebuilt_model_name': {'key': 'customPrebuiltModelName', 'type': 'str'}, - } - - def __init__(self, *, id: str, readable_type, name: str=None, type_id: int=None, roles=None, custom_prebuilt_domain_name: str=None, custom_prebuilt_model_name: str=None, **kwargs) -> None: - super(EntityExtractor, self).__init__(**kwargs) - self.id = id - self.name = name - self.type_id = type_id - self.readable_type = readable_type - self.roles = roles - self.custom_prebuilt_domain_name = custom_prebuilt_domain_name - self.custom_prebuilt_model_name = custom_prebuilt_model_name - - -class EntityLabel(Model): - """Defines the entity type and position of the extracted entity within the - example. - - All required parameters must be populated in order to send to Azure. - - :param entity_name: Required. The entity type. - :type entity_name: str - :param start_token_index: Required. The index within the utterance where - the extracted entity starts. - :type start_token_index: int - :param end_token_index: Required. The index within the utterance where the - extracted entity ends. - :type end_token_index: int - :param role: The role of the predicted entity. - :type role: str - :param role_id: The role id for the predicted entity. - :type role_id: str - :param children: - :type children: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityLabel] - """ - - _validation = { - 'entity_name': {'required': True}, - 'start_token_index': {'required': True}, - 'end_token_index': {'required': True}, - } - - _attribute_map = { - 'entity_name': {'key': 'entityName', 'type': 'str'}, - 'start_token_index': {'key': 'startTokenIndex', 'type': 'int'}, - 'end_token_index': {'key': 'endTokenIndex', 'type': 'int'}, - 'role': {'key': 'role', 'type': 'str'}, - 'role_id': {'key': 'roleId', 'type': 'str'}, - 'children': {'key': 'children', 'type': '[EntityLabel]'}, - } - - def __init__(self, *, entity_name: str, start_token_index: int, end_token_index: int, role: str=None, role_id: str=None, children=None, **kwargs) -> None: - super(EntityLabel, self).__init__(**kwargs) - self.entity_name = entity_name - self.start_token_index = start_token_index - self.end_token_index = end_token_index - self.role = role - self.role_id = role_id - self.children = children - - -class EntityLabelObject(Model): - """Defines the entity type and position of the extracted entity within the - example. - - All required parameters must be populated in order to send to Azure. - - :param entity_name: Required. The entity type. - :type entity_name: str - :param start_char_index: Required. The index within the utterance where - the extracted entity starts. - :type start_char_index: int - :param end_char_index: Required. The index within the utterance where the - extracted entity ends. - :type end_char_index: int - :param role: The role the entity plays in the utterance. - :type role: str - :param children: The identified entities within the example utterance. - :type children: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityLabelObject] - """ - - _validation = { - 'entity_name': {'required': True}, - 'start_char_index': {'required': True}, - 'end_char_index': {'required': True}, - } - - _attribute_map = { - 'entity_name': {'key': 'entityName', 'type': 'str'}, - 'start_char_index': {'key': 'startCharIndex', 'type': 'int'}, - 'end_char_index': {'key': 'endCharIndex', 'type': 'int'}, - 'role': {'key': 'role', 'type': 'str'}, - 'children': {'key': 'children', 'type': '[EntityLabelObject]'}, - } - - def __init__(self, *, entity_name: str, start_char_index: int, end_char_index: int, role: str=None, children=None, **kwargs) -> None: - super(EntityLabelObject, self).__init__(**kwargs) - self.entity_name = entity_name - self.start_char_index = start_char_index - self.end_char_index = end_char_index - self.role = role - self.children = children - - -class EntityModelCreateObject(Model): - """An entity extractor create object. - - :param children: Child entities. - :type children: - list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntityModelCreateObject] - :param name: Entity name. - :type name: str - """ - - _attribute_map = { - 'children': {'key': 'children', 'type': '[ChildEntityModelCreateObject]'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, children=None, name: str=None, **kwargs) -> None: - super(EntityModelCreateObject, self).__init__(**kwargs) - self.children = children - self.name = name - - -class ModelInfo(Model): - """Base type used in entity types. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. The ID of the Entity Model. - :type id: str - :param name: Name of the Entity Model. - :type name: str - :param type_id: The type ID of the Entity Model. - :type type_id: int - :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', - 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List - Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', - 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex - Entity Extractor' - :type readable_type: str or - ~azure.cognitiveservices.language.luis.authoring.models.enum - """ - - _validation = { - 'id': {'required': True}, - 'readable_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type_id': {'key': 'typeId', 'type': 'int'}, - 'readable_type': {'key': 'readableType', 'type': 'str'}, - } - - def __init__(self, *, id: str, readable_type, name: str=None, type_id: int=None, **kwargs) -> None: - super(ModelInfo, self).__init__(**kwargs) - self.id = id - self.name = name - self.type_id = type_id - self.readable_type = readable_type - - -class EntityModelInfo(ModelInfo): - """An Entity Extractor model info. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. The ID of the Entity Model. - :type id: str - :param name: Name of the Entity Model. - :type name: str - :param type_id: The type ID of the Entity Model. - :type type_id: int - :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', - 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List - Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', - 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex - Entity Extractor' - :type readable_type: str or - ~azure.cognitiveservices.language.luis.authoring.models.enum - :param roles: - :type roles: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] - """ - - _validation = { - 'id': {'required': True}, - 'readable_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type_id': {'key': 'typeId', 'type': 'int'}, - 'readable_type': {'key': 'readableType', 'type': 'str'}, - 'roles': {'key': 'roles', 'type': '[EntityRole]'}, - } - - def __init__(self, *, id: str, readable_type, name: str=None, type_id: int=None, roles=None, **kwargs) -> None: - super(EntityModelInfo, self).__init__(id=id, name=name, type_id=type_id, readable_type=readable_type, **kwargs) - self.roles = roles - - -class EntityModelUpdateObject(Model): - """An entity extractor update object. - - :param name: Entity name. - :type name: str - :param instance_of: The instance of model name - :type instance_of: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'instance_of': {'key': 'instanceOf', 'type': 'str'}, - } - - def __init__(self, *, name: str=None, instance_of: str=None, **kwargs) -> None: - super(EntityModelUpdateObject, self).__init__(**kwargs) - self.name = name - self.instance_of = instance_of - - -class EntityPrediction(Model): - """A suggested entity. - - All required parameters must be populated in order to send to Azure. - - :param entity_name: Required. The entity's name - :type entity_name: str - :param start_token_index: Required. The index within the utterance where - the extracted entity starts. - :type start_token_index: int - :param end_token_index: Required. The index within the utterance where the - extracted entity ends. - :type end_token_index: int - :param phrase: Required. The actual token(s) that comprise the entity. - :type phrase: str - :param children: - :type children: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityPrediction] - """ - - _validation = { - 'entity_name': {'required': True}, - 'start_token_index': {'required': True}, - 'end_token_index': {'required': True}, - 'phrase': {'required': True}, - } - - _attribute_map = { - 'entity_name': {'key': 'entityName', 'type': 'str'}, - 'start_token_index': {'key': 'startTokenIndex', 'type': 'int'}, - 'end_token_index': {'key': 'endTokenIndex', 'type': 'int'}, - 'phrase': {'key': 'phrase', 'type': 'str'}, - 'children': {'key': 'children', 'type': '[EntityPrediction]'}, - } - - def __init__(self, *, entity_name: str, start_token_index: int, end_token_index: int, phrase: str, children=None, **kwargs) -> None: - super(EntityPrediction, self).__init__(**kwargs) - self.entity_name = entity_name - self.start_token_index = start_token_index - self.end_token_index = end_token_index - self.phrase = phrase - self.children = children - - -class EntityRole(Model): - """Entity extractor role. - - :param id: The entity role ID. - :type id: str - :param name: The entity role name. - :type name: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, id: str=None, name: str=None, **kwargs) -> None: - super(EntityRole, self).__init__(**kwargs) - self.id = id - self.name = name - - -class EntityRoleCreateObject(Model): - """Object model for creating an entity role. - - :param name: The entity role name. - :type name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, name: str=None, **kwargs) -> None: - super(EntityRoleCreateObject, self).__init__(**kwargs) - self.name = name - - -class EntityRoleUpdateObject(Model): - """Object model for updating an entity role. - - :param name: The entity role name. - :type name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, name: str=None, **kwargs) -> None: - super(EntityRoleUpdateObject, self).__init__(**kwargs) - self.name = name - - -class ErrorResponse(Model): - """Error response when invoking an operation on the API. - - :param additional_properties: Unmatched properties from the message are - deserialized this collection - :type additional_properties: dict[str, object] - :param error_type: - :type error_type: str - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'error_type': {'key': 'errorType', 'type': 'str'}, - } - - def __init__(self, *, additional_properties=None, error_type: str=None, **kwargs) -> None: - super(ErrorResponse, self).__init__(**kwargs) - self.additional_properties = additional_properties - self.error_type = error_type - - -class ErrorResponseException(HttpOperationError): - """Server responded with exception of type: 'ErrorResponse'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) - - -class ExampleLabelObject(Model): - """A labeled example utterance. - - :param text: The example utterance. - :type text: str - :param entity_labels: The identified entities within the example - utterance. - :type entity_labels: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityLabelObject] - :param intent_name: The identified intent representing the example - utterance. - :type intent_name: str - """ - - _attribute_map = { - 'text': {'key': 'text', 'type': 'str'}, - 'entity_labels': {'key': 'entityLabels', 'type': '[EntityLabelObject]'}, - 'intent_name': {'key': 'intentName', 'type': 'str'}, - } - - def __init__(self, *, text: str=None, entity_labels=None, intent_name: str=None, **kwargs) -> None: - super(ExampleLabelObject, self).__init__(**kwargs) - self.text = text - self.entity_labels = entity_labels - self.intent_name = intent_name - - -class ExplicitListItem(Model): - """Explicit (exception) list item. - - :param id: The explicit list item ID. - :type id: long - :param explicit_list_item: The explicit list item value. - :type explicit_list_item: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'long'}, - 'explicit_list_item': {'key': 'explicitListItem', 'type': 'str'}, - } - - def __init__(self, *, id: int=None, explicit_list_item: str=None, **kwargs) -> None: - super(ExplicitListItem, self).__init__(**kwargs) - self.id = id - self.explicit_list_item = explicit_list_item - - -class ExplicitListItemCreateObject(Model): - """Object model for creating an explicit (exception) list item. - - :param explicit_list_item: The explicit list item. - :type explicit_list_item: str - """ - - _attribute_map = { - 'explicit_list_item': {'key': 'explicitListItem', 'type': 'str'}, - } - - def __init__(self, *, explicit_list_item: str=None, **kwargs) -> None: - super(ExplicitListItemCreateObject, self).__init__(**kwargs) - self.explicit_list_item = explicit_list_item - - -class ExplicitListItemUpdateObject(Model): - """Model object for updating an explicit (exception) list item. - - :param explicit_list_item: The explicit list item. - :type explicit_list_item: str - """ - - _attribute_map = { - 'explicit_list_item': {'key': 'explicitListItem', 'type': 'str'}, - } - - def __init__(self, *, explicit_list_item: str=None, **kwargs) -> None: - super(ExplicitListItemUpdateObject, self).__init__(**kwargs) - self.explicit_list_item = explicit_list_item - - -class FeatureInfoObject(Model): - """The base class Features-related response objects inherit from. - - :param id: A six-digit ID used for Features. - :type id: int - :param name: The name of the Feature. - :type name: str - :param is_active: Indicates if the feature is enabled. - :type is_active: bool - :param enabled_for_all_models: Indicates if the feature is enabled for all - models in the application. - :type enabled_for_all_models: bool - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'str'}, - 'is_active': {'key': 'isActive', 'type': 'bool'}, - 'enabled_for_all_models': {'key': 'enabledForAllModels', 'type': 'bool'}, - } - - def __init__(self, *, id: int=None, name: str=None, is_active: bool=None, enabled_for_all_models: bool=None, **kwargs) -> None: - super(FeatureInfoObject, self).__init__(**kwargs) - self.id = id - self.name = name - self.is_active = is_active - self.enabled_for_all_models = enabled_for_all_models - - -class FeaturesResponseObject(Model): - """Model Features, including Patterns and Phraselists. - - :param phraselist_features: - :type phraselist_features: - list[~azure.cognitiveservices.language.luis.authoring.models.PhraseListFeatureInfo] - :param pattern_features: - :type pattern_features: - list[~azure.cognitiveservices.language.luis.authoring.models.PatternFeatureInfo] - """ - - _attribute_map = { - 'phraselist_features': {'key': 'phraselistFeatures', 'type': '[PhraseListFeatureInfo]'}, - 'pattern_features': {'key': 'patternFeatures', 'type': '[PatternFeatureInfo]'}, - } - - def __init__(self, *, phraselist_features=None, pattern_features=None, **kwargs) -> None: - super(FeaturesResponseObject, self).__init__(**kwargs) - self.phraselist_features = phraselist_features - self.pattern_features = pattern_features - - -class HierarchicalChildEntity(ChildEntity): - """A Hierarchical Child Entity. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. The ID (GUID) belonging to a child entity. - :type id: str - :param name: The name of a child entity. - :type name: str - :param instance_of: Instance of Model. - :type instance_of: str - :param type_id: The type ID of the Entity Model. - :type type_id: int - :param readable_type: Possible values include: 'Entity Extractor', 'Child - Entity Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child - Entity Extractor', 'Composite Entity Extractor', 'List Entity Extractor', - 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity - Extractor', 'Closed List Entity Extractor', 'Regex Entity Extractor' - :type readable_type: str or - ~azure.cognitiveservices.language.luis.authoring.models.enum - :param children: List of children - :type children: - list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntity] - """ - - _validation = { - 'id': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'instance_of': {'key': 'instanceOf', 'type': 'str'}, - 'type_id': {'key': 'typeId', 'type': 'int'}, - 'readable_type': {'key': 'readableType', 'type': 'str'}, - 'children': {'key': 'children', 'type': '[ChildEntity]'}, - } - - def __init__(self, *, id: str, name: str=None, instance_of: str=None, type_id: int=None, readable_type=None, children=None, **kwargs) -> None: - super(HierarchicalChildEntity, self).__init__(id=id, name=name, instance_of=instance_of, type_id=type_id, readable_type=readable_type, children=children, **kwargs) - - -class HierarchicalChildModelUpdateObject(Model): - """HierarchicalChildModelUpdateObject. - - :param name: - :type name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, name: str=None, **kwargs) -> None: - super(HierarchicalChildModelUpdateObject, self).__init__(**kwargs) - self.name = name - - -class HierarchicalEntityExtractor(Model): - """Hierarchical Entity Extractor. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. The ID of the Entity Model. - :type id: str - :param name: Name of the Entity Model. - :type name: str - :param type_id: The type ID of the Entity Model. - :type type_id: int - :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', - 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List - Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', - 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex - Entity Extractor' - :type readable_type: str or - ~azure.cognitiveservices.language.luis.authoring.models.enum - :param roles: - :type roles: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] - :param children: List of child entities. - :type children: - list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntity] - """ - - _validation = { - 'id': {'required': True}, - 'readable_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type_id': {'key': 'typeId', 'type': 'int'}, - 'readable_type': {'key': 'readableType', 'type': 'str'}, - 'roles': {'key': 'roles', 'type': '[EntityRole]'}, - 'children': {'key': 'children', 'type': '[ChildEntity]'}, - } - - def __init__(self, *, id: str, readable_type, name: str=None, type_id: int=None, roles=None, children=None, **kwargs) -> None: - super(HierarchicalEntityExtractor, self).__init__(**kwargs) - self.id = id - self.name = name - self.type_id = type_id - self.readable_type = readable_type - self.roles = roles - self.children = children - - -class HierarchicalModel(Model): - """HierarchicalModel. - - :param name: - :type name: str - :param children: - :type children: - list[~azure.cognitiveservices.language.luis.authoring.models.JsonChild] - :param features: - :type features: - list[~azure.cognitiveservices.language.luis.authoring.models.JsonModelFeatureInformation] - :param roles: - :type roles: list[str] - :param inherits: - :type inherits: - ~azure.cognitiveservices.language.luis.authoring.models.PrebuiltDomainObject - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'children': {'key': 'children', 'type': '[JsonChild]'}, - 'features': {'key': 'features', 'type': '[JsonModelFeatureInformation]'}, - 'roles': {'key': 'roles', 'type': '[str]'}, - 'inherits': {'key': 'inherits', 'type': 'PrebuiltDomainObject'}, - } - - def __init__(self, *, name: str=None, children=None, features=None, roles=None, inherits=None, **kwargs) -> None: - super(HierarchicalModel, self).__init__(**kwargs) - self.name = name - self.children = children - self.features = features - self.roles = roles - self.inherits = inherits - - -class HierarchicalModelV2(Model): - """HierarchicalModelV2. - - :param name: - :type name: str - :param children: - :type children: list[str] - :param inherits: - :type inherits: - ~azure.cognitiveservices.language.luis.authoring.models.PrebuiltDomainObject - :param roles: - :type roles: list[str] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'children': {'key': 'children', 'type': '[str]'}, - 'inherits': {'key': 'inherits', 'type': 'PrebuiltDomainObject'}, - 'roles': {'key': 'roles', 'type': '[str]'}, - } - - def __init__(self, *, name: str=None, children=None, inherits=None, roles=None, **kwargs) -> None: - super(HierarchicalModelV2, self).__init__(**kwargs) - self.name = name - self.children = children - self.inherits = inherits - self.roles = roles - - -class IntentClassifier(ModelInfo): - """Intent Classifier. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. The ID of the Entity Model. - :type id: str - :param name: Name of the Entity Model. - :type name: str - :param type_id: The type ID of the Entity Model. - :type type_id: int - :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', - 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List - Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', - 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex - Entity Extractor' - :type readable_type: str or - ~azure.cognitiveservices.language.luis.authoring.models.enum - :param custom_prebuilt_domain_name: The domain name. - :type custom_prebuilt_domain_name: str - :param custom_prebuilt_model_name: The intent name or entity name. - :type custom_prebuilt_model_name: str - """ - - _validation = { - 'id': {'required': True}, - 'readable_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type_id': {'key': 'typeId', 'type': 'int'}, - 'readable_type': {'key': 'readableType', 'type': 'str'}, - 'custom_prebuilt_domain_name': {'key': 'customPrebuiltDomainName', 'type': 'str'}, - 'custom_prebuilt_model_name': {'key': 'customPrebuiltModelName', 'type': 'str'}, - } - - def __init__(self, *, id: str, readable_type, name: str=None, type_id: int=None, custom_prebuilt_domain_name: str=None, custom_prebuilt_model_name: str=None, **kwargs) -> None: - super(IntentClassifier, self).__init__(id=id, name=name, type_id=type_id, readable_type=readable_type, **kwargs) - self.custom_prebuilt_domain_name = custom_prebuilt_domain_name - self.custom_prebuilt_model_name = custom_prebuilt_model_name - - -class IntentPrediction(Model): - """A suggested intent. - - :param name: The intent's name - :type name: str - :param score: The intent's score, based on the prediction model. - :type score: float - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'score': {'key': 'score', 'type': 'float'}, - } - - def __init__(self, *, name: str=None, score: float=None, **kwargs) -> None: - super(IntentPrediction, self).__init__(**kwargs) - self.name = name - self.score = score - - -class IntentsSuggestionExample(Model): - """Predicted/suggested intent. - - :param text: The utterance. For example, "What's the weather like in - seattle?" - :type text: str - :param tokenized_text: The tokenized utterance. - :type tokenized_text: list[str] - :param intent_predictions: Predicted/suggested intents. - :type intent_predictions: - list[~azure.cognitiveservices.language.luis.authoring.models.IntentPrediction] - :param entity_predictions: Predicted/suggested entities. - :type entity_predictions: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityPrediction] - """ - - _attribute_map = { - 'text': {'key': 'text', 'type': 'str'}, - 'tokenized_text': {'key': 'tokenizedText', 'type': '[str]'}, - 'intent_predictions': {'key': 'intentPredictions', 'type': '[IntentPrediction]'}, - 'entity_predictions': {'key': 'entityPredictions', 'type': '[EntityPrediction]'}, - } - - def __init__(self, *, text: str=None, tokenized_text=None, intent_predictions=None, entity_predictions=None, **kwargs) -> None: - super(IntentsSuggestionExample, self).__init__(**kwargs) - self.text = text - self.tokenized_text = tokenized_text - self.intent_predictions = intent_predictions - self.entity_predictions = entity_predictions - - -class JsonChild(Model): - """JsonChild. - - :param name: - :type name: str - :param instance_of: - :type instance_of: str - :param children: - :type children: - list[~azure.cognitiveservices.language.luis.authoring.models.JsonChild] - :param features: - :type features: - list[~azure.cognitiveservices.language.luis.authoring.models.JsonModelFeatureInformation] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'instance_of': {'key': 'instanceOf', 'type': 'str'}, - 'children': {'key': 'children', 'type': '[JsonChild]'}, - 'features': {'key': 'features', 'type': '[JsonModelFeatureInformation]'}, - } - - def __init__(self, *, name: str=None, instance_of: str=None, children=None, features=None, **kwargs) -> None: - super(JsonChild, self).__init__(**kwargs) - self.name = name - self.instance_of = instance_of - self.children = children - self.features = features - - -class JSONEntity(Model): - """Exported Model - Extracted Entity from utterance. - - All required parameters must be populated in order to send to Azure. - - :param start_pos: Required. The index within the utterance where the - extracted entity starts. - :type start_pos: int - :param end_pos: Required. The index within the utterance where the - extracted entity ends. - :type end_pos: int - :param entity: Required. The entity name. - :type entity: str - :param role: The role the entity plays in the utterance. - :type role: str - :param children: - :type children: - list[~azure.cognitiveservices.language.luis.authoring.models.JSONEntity] - """ - - _validation = { - 'start_pos': {'required': True}, - 'end_pos': {'required': True}, - 'entity': {'required': True}, - } - - _attribute_map = { - 'start_pos': {'key': 'startPos', 'type': 'int'}, - 'end_pos': {'key': 'endPos', 'type': 'int'}, - 'entity': {'key': 'entity', 'type': 'str'}, - 'role': {'key': 'role', 'type': 'str'}, - 'children': {'key': 'children', 'type': '[JSONEntity]'}, - } - - def __init__(self, *, start_pos: int, end_pos: int, entity: str, role: str=None, children=None, **kwargs) -> None: - super(JSONEntity, self).__init__(**kwargs) - self.start_pos = start_pos - self.end_pos = end_pos - self.entity = entity - self.role = role - self.children = children - - -class JSONModelFeature(Model): - """Exported Model - Phraselist Model Feature. - - :param activated: Indicates if the feature is enabled. - :type activated: bool - :param name: The Phraselist name. - :type name: str - :param words: List of comma-separated phrases that represent the - Phraselist. - :type words: str - :param mode: An interchangeable phrase list feature serves as a list of - synonyms for training. A non-exchangeable phrase list serves as separate - features for training. So, if your non-interchangeable phrase list - contains 5 phrases, they will be mapped to 5 separate features. You can - think of the non-interchangeable phrase list as an additional bag of words - to add to LUIS existing vocabulary features. It is used as a lexicon - lookup feature where its value is 1 if the lexicon contains a given word - or 0 if it doesn’t. Default value is true. - :type mode: bool - :param enabled_for_all_models: Indicates if the Phraselist is enabled for - all models in the application. Default value: True . - :type enabled_for_all_models: bool - """ - - _attribute_map = { - 'activated': {'key': 'activated', 'type': 'bool'}, - 'name': {'key': 'name', 'type': 'str'}, - 'words': {'key': 'words', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'bool'}, - 'enabled_for_all_models': {'key': 'enabledForAllModels', 'type': 'bool'}, - } - - def __init__(self, *, activated: bool=None, name: str=None, words: str=None, mode: bool=None, enabled_for_all_models: bool=True, **kwargs) -> None: - super(JSONModelFeature, self).__init__(**kwargs) - self.activated = activated - self.name = name - self.words = words - self.mode = mode - self.enabled_for_all_models = enabled_for_all_models - - -class JsonModelFeatureInformation(Model): - """An object containing the model feature information either the model name or - feature name. - - :param model_name: The name of the model used. - :type model_name: str - :param feature_name: The name of the feature used. - :type feature_name: str - """ - - _attribute_map = { - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'feature_name': {'key': 'featureName', 'type': 'str'}, - } - - def __init__(self, *, model_name: str=None, feature_name: str=None, **kwargs) -> None: - super(JsonModelFeatureInformation, self).__init__(**kwargs) - self.model_name = model_name - self.feature_name = feature_name - - -class JSONRegexFeature(Model): - """Exported Model - A Pattern feature. - - :param pattern: The Regular Expression to match. - :type pattern: str - :param activated: Indicates if the Pattern feature is enabled. - :type activated: bool - :param name: Name of the feature. - :type name: str - """ - - _attribute_map = { - 'pattern': {'key': 'pattern', 'type': 'str'}, - 'activated': {'key': 'activated', 'type': 'bool'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, pattern: str=None, activated: bool=None, name: str=None, **kwargs) -> None: - super(JSONRegexFeature, self).__init__(**kwargs) - self.pattern = pattern - self.activated = activated - self.name = name - - -class JSONUtterance(Model): - """Exported Model - Utterance that was used to train the model. - - :param text: The utterance. - :type text: str - :param intent: The matched intent. - :type intent: str - :param entities: The matched entities. - :type entities: - list[~azure.cognitiveservices.language.luis.authoring.models.JSONEntity] - """ - - _attribute_map = { - 'text': {'key': 'text', 'type': 'str'}, - 'intent': {'key': 'intent', 'type': 'str'}, - 'entities': {'key': 'entities', 'type': '[JSONEntity]'}, - } - - def __init__(self, *, text: str=None, intent: str=None, entities=None, **kwargs) -> None: - super(JSONUtterance, self).__init__(**kwargs) - self.text = text - self.intent = intent - self.entities = entities - - -class LabeledUtterance(Model): - """A prediction and label pair of an example. - - :param id: ID of Labeled Utterance. - :type id: int - :param text: The utterance. For example, "What's the weather like in - seattle?" - :type text: str - :param tokenized_text: The utterance tokenized. - :type tokenized_text: list[str] - :param intent_label: The intent matching the example. - :type intent_label: str - :param entity_labels: The entities matching the example. - :type entity_labels: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityLabel] - :param intent_predictions: List of suggested intents. - :type intent_predictions: - list[~azure.cognitiveservices.language.luis.authoring.models.IntentPrediction] - :param entity_predictions: List of suggested entities. - :type entity_predictions: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityPrediction] - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'int'}, - 'text': {'key': 'text', 'type': 'str'}, - 'tokenized_text': {'key': 'tokenizedText', 'type': '[str]'}, - 'intent_label': {'key': 'intentLabel', 'type': 'str'}, - 'entity_labels': {'key': 'entityLabels', 'type': '[EntityLabel]'}, - 'intent_predictions': {'key': 'intentPredictions', 'type': '[IntentPrediction]'}, - 'entity_predictions': {'key': 'entityPredictions', 'type': '[EntityPrediction]'}, - } - - def __init__(self, *, id: int=None, text: str=None, tokenized_text=None, intent_label: str=None, entity_labels=None, intent_predictions=None, entity_predictions=None, **kwargs) -> None: - super(LabeledUtterance, self).__init__(**kwargs) - self.id = id - self.text = text - self.tokenized_text = tokenized_text - self.intent_label = intent_label - self.entity_labels = entity_labels - self.intent_predictions = intent_predictions - self.entity_predictions = entity_predictions - - -class LabelExampleResponse(Model): - """Response when adding a labeled example utterance. - - :param utterance_text: The example utterance. - :type utterance_text: str - :param example_id: The newly created sample ID. - :type example_id: int - """ - - _attribute_map = { - 'utterance_text': {'key': 'UtteranceText', 'type': 'str'}, - 'example_id': {'key': 'ExampleId', 'type': 'int'}, - } - - def __init__(self, *, utterance_text: str=None, example_id: int=None, **kwargs) -> None: - super(LabelExampleResponse, self).__init__(**kwargs) - self.utterance_text = utterance_text - self.example_id = example_id - - -class LabelTextObject(Model): - """An object containing the example utterance's text. - - :param id: The ID of the Label. - :type id: int - :param text: The text of the label. - :type text: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'int'}, - 'text': {'key': 'text', 'type': 'str'}, - } - - def __init__(self, *, id: int=None, text: str=None, **kwargs) -> None: - super(LabelTextObject, self).__init__(**kwargs) - self.id = id - self.text = text - - -class LuisApp(Model): - """Exported Model - An exported LUIS Application. - - :param additional_properties: Unmatched properties from the message are - deserialized this collection - :type additional_properties: dict[str, object] - :param name: The name of the application. - :type name: str - :param version_id: The version ID of the application that was exported. - :type version_id: str - :param desc: The description of the application. - :type desc: str - :param culture: The culture of the application. E.g.: en-us. - :type culture: str - :param intents: List of intents. - :type intents: - list[~azure.cognitiveservices.language.luis.authoring.models.HierarchicalModel] - :param entities: List of entities. - :type entities: - list[~azure.cognitiveservices.language.luis.authoring.models.HierarchicalModel] - :param closed_lists: List of list entities. - :type closed_lists: - list[~azure.cognitiveservices.language.luis.authoring.models.ClosedList] - :param composites: List of composite entities. - :type composites: - list[~azure.cognitiveservices.language.luis.authoring.models.HierarchicalModel] - :param hierarchicals: List of hierarchical entities. - :type hierarchicals: - list[~azure.cognitiveservices.language.luis.authoring.models.HierarchicalModel] - :param pattern_any_entities: List of Pattern.Any entities. - :type pattern_any_entities: - list[~azure.cognitiveservices.language.luis.authoring.models.PatternAny] - :param regex_entities: List of regular expression entities. - :type regex_entities: - list[~azure.cognitiveservices.language.luis.authoring.models.RegexEntity] - :param prebuilt_entities: List of prebuilt entities. - :type prebuilt_entities: - list[~azure.cognitiveservices.language.luis.authoring.models.PrebuiltEntity] - :param regex_features: List of pattern features. - :type regex_features: - list[~azure.cognitiveservices.language.luis.authoring.models.JSONRegexFeature] - :param phraselists: List of model features. - :type phraselists: - list[~azure.cognitiveservices.language.luis.authoring.models.JSONModelFeature] - :param patterns: List of patterns. - :type patterns: - list[~azure.cognitiveservices.language.luis.authoring.models.PatternRule] - :param utterances: List of example utterances. - :type utterances: - list[~azure.cognitiveservices.language.luis.authoring.models.JSONUtterance] - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'name': {'key': 'name', 'type': 'str'}, - 'version_id': {'key': 'versionId', 'type': 'str'}, - 'desc': {'key': 'desc', 'type': 'str'}, - 'culture': {'key': 'culture', 'type': 'str'}, - 'intents': {'key': 'intents', 'type': '[HierarchicalModel]'}, - 'entities': {'key': 'entities', 'type': '[HierarchicalModel]'}, - 'closed_lists': {'key': 'closedLists', 'type': '[ClosedList]'}, - 'composites': {'key': 'composites', 'type': '[HierarchicalModel]'}, - 'hierarchicals': {'key': 'hierarchicals', 'type': '[HierarchicalModel]'}, - 'pattern_any_entities': {'key': 'patternAnyEntities', 'type': '[PatternAny]'}, - 'regex_entities': {'key': 'regex_entities', 'type': '[RegexEntity]'}, - 'prebuilt_entities': {'key': 'prebuiltEntities', 'type': '[PrebuiltEntity]'}, - 'regex_features': {'key': 'regex_features', 'type': '[JSONRegexFeature]'}, - 'phraselists': {'key': 'phraselists', 'type': '[JSONModelFeature]'}, - 'patterns': {'key': 'patterns', 'type': '[PatternRule]'}, - 'utterances': {'key': 'utterances', 'type': '[JSONUtterance]'}, - } - - def __init__(self, *, additional_properties=None, name: str=None, version_id: str=None, desc: str=None, culture: str=None, intents=None, entities=None, closed_lists=None, composites=None, hierarchicals=None, pattern_any_entities=None, regex_entities=None, prebuilt_entities=None, regex_features=None, phraselists=None, patterns=None, utterances=None, **kwargs) -> None: - super(LuisApp, self).__init__(**kwargs) - self.additional_properties = additional_properties - self.name = name - self.version_id = version_id - self.desc = desc - self.culture = culture - self.intents = intents - self.entities = entities - self.closed_lists = closed_lists - self.composites = composites - self.hierarchicals = hierarchicals - self.pattern_any_entities = pattern_any_entities - self.regex_entities = regex_entities - self.prebuilt_entities = prebuilt_entities - self.regex_features = regex_features - self.phraselists = phraselists - self.patterns = patterns - self.utterances = utterances - - -class LuisAppV2(Model): - """Exported Model - An exported LUIS Application. - - :param additional_properties: Unmatched properties from the message are - deserialized this collection - :type additional_properties: dict[str, object] - :param luis_schema_version: Luis schema deserialization version. - :type luis_schema_version: str - :param name: The name of the application. - :type name: str - :param version_id: The version ID of the application that was exported. - :type version_id: str - :param desc: The description of the application. - :type desc: str - :param culture: The culture of the application. E.g.: en-us. - :type culture: str - :param intents: List of intents. - :type intents: - list[~azure.cognitiveservices.language.luis.authoring.models.HierarchicalModelV2] - :param entities: List of entities. - :type entities: - list[~azure.cognitiveservices.language.luis.authoring.models.HierarchicalModelV2] - :param closed_lists: List of list entities. - :type closed_lists: - list[~azure.cognitiveservices.language.luis.authoring.models.ClosedList] - :param composites: List of composite entities. - :type composites: - list[~azure.cognitiveservices.language.luis.authoring.models.HierarchicalModelV2] - :param pattern_any_entities: List of Pattern.Any entities. - :type pattern_any_entities: - list[~azure.cognitiveservices.language.luis.authoring.models.PatternAny] - :param regex_entities: List of regular expression entities. - :type regex_entities: - list[~azure.cognitiveservices.language.luis.authoring.models.RegexEntity] - :param prebuilt_entities: List of prebuilt entities. - :type prebuilt_entities: - list[~azure.cognitiveservices.language.luis.authoring.models.PrebuiltEntity] - :param regex_features: List of pattern features. - :type regex_features: - list[~azure.cognitiveservices.language.luis.authoring.models.JSONRegexFeature] - :param model_features: List of model features. - :type model_features: - list[~azure.cognitiveservices.language.luis.authoring.models.JSONModelFeature] - :param patterns: List of patterns. - :type patterns: - list[~azure.cognitiveservices.language.luis.authoring.models.PatternRule] - :param utterances: List of example utterances. - :type utterances: - list[~azure.cognitiveservices.language.luis.authoring.models.JSONUtterance] - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'luis_schema_version': {'key': 'luis_schema_version', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'version_id': {'key': 'versionId', 'type': 'str'}, - 'desc': {'key': 'desc', 'type': 'str'}, - 'culture': {'key': 'culture', 'type': 'str'}, - 'intents': {'key': 'intents', 'type': '[HierarchicalModelV2]'}, - 'entities': {'key': 'entities', 'type': '[HierarchicalModelV2]'}, - 'closed_lists': {'key': 'closedLists', 'type': '[ClosedList]'}, - 'composites': {'key': 'composites', 'type': '[HierarchicalModelV2]'}, - 'pattern_any_entities': {'key': 'patternAnyEntities', 'type': '[PatternAny]'}, - 'regex_entities': {'key': 'regex_entities', 'type': '[RegexEntity]'}, - 'prebuilt_entities': {'key': 'prebuiltEntities', 'type': '[PrebuiltEntity]'}, - 'regex_features': {'key': 'regex_features', 'type': '[JSONRegexFeature]'}, - 'model_features': {'key': 'model_features', 'type': '[JSONModelFeature]'}, - 'patterns': {'key': 'patterns', 'type': '[PatternRule]'}, - 'utterances': {'key': 'utterances', 'type': '[JSONUtterance]'}, - } - - def __init__(self, *, additional_properties=None, luis_schema_version: str=None, name: str=None, version_id: str=None, desc: str=None, culture: str=None, intents=None, entities=None, closed_lists=None, composites=None, pattern_any_entities=None, regex_entities=None, prebuilt_entities=None, regex_features=None, model_features=None, patterns=None, utterances=None, **kwargs) -> None: - super(LuisAppV2, self).__init__(**kwargs) - self.additional_properties = additional_properties - self.luis_schema_version = luis_schema_version - self.name = name - self.version_id = version_id - self.desc = desc - self.culture = culture - self.intents = intents - self.entities = entities - self.closed_lists = closed_lists - self.composites = composites - self.pattern_any_entities = pattern_any_entities - self.regex_entities = regex_entities - self.prebuilt_entities = prebuilt_entities - self.regex_features = regex_features - self.model_features = model_features - self.patterns = patterns - self.utterances = utterances - - -class ModelCreateObject(Model): - """Object model for creating a new entity extractor. - - :param name: Name of the new entity extractor. - :type name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, name: str=None, **kwargs) -> None: - super(ModelCreateObject, self).__init__(**kwargs) - self.name = name - - -class ModelFeatureInformation(Model): - """An object containing the model feature information either the model name or - feature name. - - :param model_name: The name of the model used. - :type model_name: str - :param feature_name: The name of the feature used. - :type feature_name: str - :param is_required: - :type is_required: bool - """ - - _attribute_map = { - 'model_name': {'key': 'modelName', 'type': 'str'}, - 'feature_name': {'key': 'featureName', 'type': 'str'}, - 'is_required': {'key': 'isRequired', 'type': 'bool'}, - } - - def __init__(self, *, model_name: str=None, feature_name: str=None, is_required: bool=None, **kwargs) -> None: - super(ModelFeatureInformation, self).__init__(**kwargs) - self.model_name = model_name - self.feature_name = feature_name - self.is_required = is_required - - -class ModelInfoResponse(Model): - """An application model info. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. The ID of the Entity Model. - :type id: str - :param name: Name of the Entity Model. - :type name: str - :param type_id: The type ID of the Entity Model. - :type type_id: int - :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', - 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List - Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', - 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex - Entity Extractor' - :type readable_type: str or - ~azure.cognitiveservices.language.luis.authoring.models.enum - :param roles: - :type roles: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] - :param children: List of child entities. - :type children: - list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntity] - :param sub_lists: List of sublists. - :type sub_lists: - list[~azure.cognitiveservices.language.luis.authoring.models.SubClosedListResponse] - :param custom_prebuilt_domain_name: The domain name. - :type custom_prebuilt_domain_name: str - :param custom_prebuilt_model_name: The intent name or entity name. - :type custom_prebuilt_model_name: str - :param regex_pattern: The Regular Expression entity pattern. - :type regex_pattern: str - :param explicit_list: - :type explicit_list: - list[~azure.cognitiveservices.language.luis.authoring.models.ExplicitListItem] - """ - - _validation = { - 'id': {'required': True}, - 'readable_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type_id': {'key': 'typeId', 'type': 'int'}, - 'readable_type': {'key': 'readableType', 'type': 'str'}, - 'roles': {'key': 'roles', 'type': '[EntityRole]'}, - 'children': {'key': 'children', 'type': '[ChildEntity]'}, - 'sub_lists': {'key': 'subLists', 'type': '[SubClosedListResponse]'}, - 'custom_prebuilt_domain_name': {'key': 'customPrebuiltDomainName', 'type': 'str'}, - 'custom_prebuilt_model_name': {'key': 'customPrebuiltModelName', 'type': 'str'}, - 'regex_pattern': {'key': 'regexPattern', 'type': 'str'}, - 'explicit_list': {'key': 'explicitList', 'type': '[ExplicitListItem]'}, - } - - def __init__(self, *, id: str, readable_type, name: str=None, type_id: int=None, roles=None, children=None, sub_lists=None, custom_prebuilt_domain_name: str=None, custom_prebuilt_model_name: str=None, regex_pattern: str=None, explicit_list=None, **kwargs) -> None: - super(ModelInfoResponse, self).__init__(**kwargs) - self.id = id - self.name = name - self.type_id = type_id - self.readable_type = readable_type - self.roles = roles - self.children = children - self.sub_lists = sub_lists - self.custom_prebuilt_domain_name = custom_prebuilt_domain_name - self.custom_prebuilt_model_name = custom_prebuilt_model_name - self.regex_pattern = regex_pattern - self.explicit_list = explicit_list - - -class ModelTrainingDetails(Model): - """Model Training Details. - - :param status_id: The train request status ID. - :type status_id: int - :param status: Possible values include: 'Queued', 'InProgress', - 'UpToDate', 'Fail', 'Success' - :type status: str or - ~azure.cognitiveservices.language.luis.authoring.models.enum - :param example_count: The count of examples used to train the model. - :type example_count: int - :param training_date_time: When the model was trained. - :type training_date_time: datetime - :param failure_reason: Reason for the training failure. - :type failure_reason: str - """ - - _attribute_map = { - 'status_id': {'key': 'statusId', 'type': 'int'}, - 'status': {'key': 'status', 'type': 'str'}, - 'example_count': {'key': 'exampleCount', 'type': 'int'}, - 'training_date_time': {'key': 'trainingDateTime', 'type': 'iso-8601'}, - 'failure_reason': {'key': 'failureReason', 'type': 'str'}, - } - - def __init__(self, *, status_id: int=None, status=None, example_count: int=None, training_date_time=None, failure_reason: str=None, **kwargs) -> None: - super(ModelTrainingDetails, self).__init__(**kwargs) - self.status_id = status_id - self.status = status - self.example_count = example_count - self.training_date_time = training_date_time - self.failure_reason = failure_reason - - -class ModelTrainingInfo(Model): - """Model Training Info. - - :param model_id: The ID (GUID) of the model. - :type model_id: str - :param details: - :type details: - ~azure.cognitiveservices.language.luis.authoring.models.ModelTrainingDetails - """ - - _attribute_map = { - 'model_id': {'key': 'modelId', 'type': 'str'}, - 'details': {'key': 'details', 'type': 'ModelTrainingDetails'}, - } - - def __init__(self, *, model_id: str=None, details=None, **kwargs) -> None: - super(ModelTrainingInfo, self).__init__(**kwargs) - self.model_id = model_id - self.details = details - - -class ModelUpdateObject(Model): - """Object model for updating an intent classifier. - - :param name: The entity's new name. - :type name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, name: str=None, **kwargs) -> None: - super(ModelUpdateObject, self).__init__(**kwargs) - self.name = name - - -class NDepthEntityExtractor(Model): - """N-Depth Entity Extractor. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. The ID of the Entity Model. - :type id: str - :param name: Name of the Entity Model. - :type name: str - :param type_id: The type ID of the Entity Model. - :type type_id: int - :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', - 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List - Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', - 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex - Entity Extractor' - :type readable_type: str or - ~azure.cognitiveservices.language.luis.authoring.models.enum - :param roles: - :type roles: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] - :param custom_prebuilt_domain_name: The domain name. - :type custom_prebuilt_domain_name: str - :param custom_prebuilt_model_name: The intent name or entity name. - :type custom_prebuilt_model_name: str - :param children: - :type children: - list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntity] - """ - - _validation = { - 'id': {'required': True}, - 'readable_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type_id': {'key': 'typeId', 'type': 'int'}, - 'readable_type': {'key': 'readableType', 'type': 'str'}, - 'roles': {'key': 'roles', 'type': '[EntityRole]'}, - 'custom_prebuilt_domain_name': {'key': 'customPrebuiltDomainName', 'type': 'str'}, - 'custom_prebuilt_model_name': {'key': 'customPrebuiltModelName', 'type': 'str'}, - 'children': {'key': 'children', 'type': '[ChildEntity]'}, - } - - def __init__(self, *, id: str, readable_type, name: str=None, type_id: int=None, roles=None, custom_prebuilt_domain_name: str=None, custom_prebuilt_model_name: str=None, children=None, **kwargs) -> None: - super(NDepthEntityExtractor, self).__init__(**kwargs) - self.id = id - self.name = name - self.type_id = type_id - self.readable_type = readable_type - self.roles = roles - self.custom_prebuilt_domain_name = custom_prebuilt_domain_name - self.custom_prebuilt_model_name = custom_prebuilt_model_name - self.children = children - - -class OperationError(Model): - """Operation error details when invoking an operation on the API. - - :param code: - :type code: str - :param message: - :type message: str - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None: - super(OperationError, self).__init__(**kwargs) - self.code = code - self.message = message - - -class OperationStatus(Model): - """Response of an Operation status. - - :param code: Status Code. Possible values include: 'Failed', 'FAILED', - 'Success' - :type code: str or - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatusType - :param message: Status details. - :type message: str - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, *, code=None, message: str=None, **kwargs) -> None: - super(OperationStatus, self).__init__(**kwargs) - self.code = code - self.message = message - - -class PatternAny(Model): - """Pattern.Any Entity Extractor. - - :param name: - :type name: str - :param explicit_list: - :type explicit_list: list[str] - :param roles: - :type roles: list[str] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'explicit_list': {'key': 'explicitList', 'type': '[str]'}, - 'roles': {'key': 'roles', 'type': '[str]'}, - } - - def __init__(self, *, name: str=None, explicit_list=None, roles=None, **kwargs) -> None: - super(PatternAny, self).__init__(**kwargs) - self.name = name - self.explicit_list = explicit_list - self.roles = roles - - -class PatternAnyEntityExtractor(Model): - """Pattern.Any Entity Extractor. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. The ID of the Entity Model. - :type id: str - :param name: Name of the Entity Model. - :type name: str - :param type_id: The type ID of the Entity Model. - :type type_id: int - :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', - 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List - Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', - 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex - Entity Extractor' - :type readable_type: str or - ~azure.cognitiveservices.language.luis.authoring.models.enum - :param roles: - :type roles: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] - :param explicit_list: - :type explicit_list: - list[~azure.cognitiveservices.language.luis.authoring.models.ExplicitListItem] - """ - - _validation = { - 'id': {'required': True}, - 'readable_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type_id': {'key': 'typeId', 'type': 'int'}, - 'readable_type': {'key': 'readableType', 'type': 'str'}, - 'roles': {'key': 'roles', 'type': '[EntityRole]'}, - 'explicit_list': {'key': 'explicitList', 'type': '[ExplicitListItem]'}, - } - - def __init__(self, *, id: str, readable_type, name: str=None, type_id: int=None, roles=None, explicit_list=None, **kwargs) -> None: - super(PatternAnyEntityExtractor, self).__init__(**kwargs) - self.id = id - self.name = name - self.type_id = type_id - self.readable_type = readable_type - self.roles = roles - self.explicit_list = explicit_list - - -class PatternAnyModelCreateObject(Model): - """Model object for creating a Pattern.Any entity model. - - :param name: The model name. - :type name: str - :param explicit_list: The Pattern.Any explicit list. - :type explicit_list: list[str] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'explicit_list': {'key': 'explicitList', 'type': '[str]'}, - } - - def __init__(self, *, name: str=None, explicit_list=None, **kwargs) -> None: - super(PatternAnyModelCreateObject, self).__init__(**kwargs) - self.name = name - self.explicit_list = explicit_list - - -class PatternAnyModelUpdateObject(Model): - """Model object for updating a Pattern.Any entity model. - - :param name: The model name. - :type name: str - :param explicit_list: The Pattern.Any explicit list. - :type explicit_list: list[str] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'explicit_list': {'key': 'explicitList', 'type': '[str]'}, - } - - def __init__(self, *, name: str=None, explicit_list=None, **kwargs) -> None: - super(PatternAnyModelUpdateObject, self).__init__(**kwargs) - self.name = name - self.explicit_list = explicit_list - - -class PatternFeatureInfo(FeatureInfoObject): - """Pattern feature. - - :param id: A six-digit ID used for Features. - :type id: int - :param name: The name of the Feature. - :type name: str - :param is_active: Indicates if the feature is enabled. - :type is_active: bool - :param enabled_for_all_models: Indicates if the feature is enabled for all - models in the application. - :type enabled_for_all_models: bool - :param pattern: The Regular Expression to match. - :type pattern: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'str'}, - 'is_active': {'key': 'isActive', 'type': 'bool'}, - 'enabled_for_all_models': {'key': 'enabledForAllModels', 'type': 'bool'}, - 'pattern': {'key': 'pattern', 'type': 'str'}, - } - - def __init__(self, *, id: int=None, name: str=None, is_active: bool=None, enabled_for_all_models: bool=None, pattern: str=None, **kwargs) -> None: - super(PatternFeatureInfo, self).__init__(id=id, name=name, is_active=is_active, enabled_for_all_models=enabled_for_all_models, **kwargs) - self.pattern = pattern - - -class PatternRule(Model): - """Pattern. - - :param pattern: The pattern text. - :type pattern: str - :param intent: The intent's name where the pattern belongs to. - :type intent: str - """ - - _attribute_map = { - 'pattern': {'key': 'pattern', 'type': 'str'}, - 'intent': {'key': 'intent', 'type': 'str'}, - } - - def __init__(self, *, pattern: str=None, intent: str=None, **kwargs) -> None: - super(PatternRule, self).__init__(**kwargs) - self.pattern = pattern - self.intent = intent - - -class PatternRuleCreateObject(Model): - """Object model for creating a pattern. - - :param pattern: The pattern text. - :type pattern: str - :param intent: The intent's name which the pattern belongs to. - :type intent: str - """ - - _attribute_map = { - 'pattern': {'key': 'pattern', 'type': 'str'}, - 'intent': {'key': 'intent', 'type': 'str'}, - } - - def __init__(self, *, pattern: str=None, intent: str=None, **kwargs) -> None: - super(PatternRuleCreateObject, self).__init__(**kwargs) - self.pattern = pattern - self.intent = intent - - -class PatternRuleInfo(Model): - """Pattern rule. - - :param id: The pattern ID. - :type id: str - :param pattern: The pattern text. - :type pattern: str - :param intent: The intent's name where the pattern belongs to. - :type intent: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'pattern': {'key': 'pattern', 'type': 'str'}, - 'intent': {'key': 'intent', 'type': 'str'}, - } - - def __init__(self, *, id: str=None, pattern: str=None, intent: str=None, **kwargs) -> None: - super(PatternRuleInfo, self).__init__(**kwargs) - self.id = id - self.pattern = pattern - self.intent = intent - - -class PatternRuleUpdateObject(Model): - """Object model for updating a pattern. - - :param id: The pattern ID. - :type id: str - :param pattern: The pattern text. - :type pattern: str - :param intent: The intent's name which the pattern belongs to. - :type intent: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'pattern': {'key': 'pattern', 'type': 'str'}, - 'intent': {'key': 'intent', 'type': 'str'}, - } - - def __init__(self, *, id: str=None, pattern: str=None, intent: str=None, **kwargs) -> None: - super(PatternRuleUpdateObject, self).__init__(**kwargs) - self.id = id - self.pattern = pattern - self.intent = intent - - -class PersonalAssistantsResponse(Model): - """Response containing user's endpoint keys and the endpoint URLs of the - prebuilt Cortana applications. - - :param endpoint_keys: - :type endpoint_keys: list[str] - :param endpoint_urls: - :type endpoint_urls: dict[str, str] - """ - - _attribute_map = { - 'endpoint_keys': {'key': 'endpointKeys', 'type': '[str]'}, - 'endpoint_urls': {'key': 'endpointUrls', 'type': '{str}'}, - } - - def __init__(self, *, endpoint_keys=None, endpoint_urls=None, **kwargs) -> None: - super(PersonalAssistantsResponse, self).__init__(**kwargs) - self.endpoint_keys = endpoint_keys - self.endpoint_urls = endpoint_urls - - -class PhraselistCreateObject(Model): - """Object model for creating a phraselist model. - - :param phrases: List of comma-separated phrases that represent the - Phraselist. - :type phrases: str - :param name: The Phraselist name. - :type name: str - :param is_exchangeable: An interchangeable phrase list feature serves as a - list of synonyms for training. A non-exchangeable phrase list serves as - separate features for training. So, if your non-interchangeable phrase - list contains 5 phrases, they will be mapped to 5 separate features. You - can think of the non-interchangeable phrase list as an additional bag of - words to add to LUIS existing vocabulary features. It is used as a lexicon - lookup feature where its value is 1 if the lexicon contains a given word - or 0 if it doesn’t. Default value is true. Default value: True . - :type is_exchangeable: bool - :param enabled_for_all_models: Indicates if the Phraselist is enabled for - all models in the application. Default value: True . - :type enabled_for_all_models: bool - """ - - _attribute_map = { - 'phrases': {'key': 'phrases', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'is_exchangeable': {'key': 'isExchangeable', 'type': 'bool'}, - 'enabled_for_all_models': {'key': 'enabledForAllModels', 'type': 'bool'}, - } - - def __init__(self, *, phrases: str=None, name: str=None, is_exchangeable: bool=True, enabled_for_all_models: bool=True, **kwargs) -> None: - super(PhraselistCreateObject, self).__init__(**kwargs) - self.phrases = phrases - self.name = name - self.is_exchangeable = is_exchangeable - self.enabled_for_all_models = enabled_for_all_models - - -class PhraseListFeatureInfo(FeatureInfoObject): - """Phraselist Feature. - - :param id: A six-digit ID used for Features. - :type id: int - :param name: The name of the Feature. - :type name: str - :param is_active: Indicates if the feature is enabled. - :type is_active: bool - :param enabled_for_all_models: Indicates if the feature is enabled for all - models in the application. - :type enabled_for_all_models: bool - :param phrases: A list of comma-separated values. - :type phrases: str - :param is_exchangeable: An exchangeable phrase list feature are serves as - single feature to the LUIS underlying training algorithm. It is used as a - lexicon lookup feature where its value is 1 if the lexicon contains a - given word or 0 if it doesn’t. Think of an exchangeable as a synonyms - list. A non-exchangeable phrase list feature has all the phrases in the - list serve as separate features to the underlying training algorithm. So, - if you your phrase list feature contains 5 phrases, they will be mapped to - 5 separate features. You can think of the non-exchangeable phrase list - feature as an additional bag of words that you are willing to add to LUIS - existing vocabulary features. Think of a non-exchangeable as set of - different words. Default value is true. - :type is_exchangeable: bool - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'str'}, - 'is_active': {'key': 'isActive', 'type': 'bool'}, - 'enabled_for_all_models': {'key': 'enabledForAllModels', 'type': 'bool'}, - 'phrases': {'key': 'phrases', 'type': 'str'}, - 'is_exchangeable': {'key': 'isExchangeable', 'type': 'bool'}, - } - - def __init__(self, *, id: int=None, name: str=None, is_active: bool=None, enabled_for_all_models: bool=None, phrases: str=None, is_exchangeable: bool=None, **kwargs) -> None: - super(PhraseListFeatureInfo, self).__init__(id=id, name=name, is_active=is_active, enabled_for_all_models=enabled_for_all_models, **kwargs) - self.phrases = phrases - self.is_exchangeable = is_exchangeable - - -class PhraselistUpdateObject(Model): - """Object model for updating a Phraselist. - - :param phrases: List of comma-separated phrases that represent the - Phraselist. - :type phrases: str - :param name: The Phraselist name. - :type name: str - :param is_active: Indicates if the Phraselist is enabled. Default value: - True . - :type is_active: bool - :param is_exchangeable: An exchangeable phrase list feature are serves as - single feature to the LUIS underlying training algorithm. It is used as a - lexicon lookup feature where its value is 1 if the lexicon contains a - given word or 0 if it doesn’t. Think of an exchangeable as a synonyms - list. A non-exchangeable phrase list feature has all the phrases in the - list serve as separate features to the underlying training algorithm. So, - if you your phrase list feature contains 5 phrases, they will be mapped to - 5 separate features. You can think of the non-exchangeable phrase list - feature as an additional bag of words that you are willing to add to LUIS - existing vocabulary features. Think of a non-exchangeable as set of - different words. Default value is true. Default value: True . - :type is_exchangeable: bool - :param enabled_for_all_models: Indicates if the Phraselist is enabled for - all models in the application. Default value: True . - :type enabled_for_all_models: bool - """ - - _attribute_map = { - 'phrases': {'key': 'phrases', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'is_active': {'key': 'isActive', 'type': 'bool'}, - 'is_exchangeable': {'key': 'isExchangeable', 'type': 'bool'}, - 'enabled_for_all_models': {'key': 'enabledForAllModels', 'type': 'bool'}, - } - - def __init__(self, *, phrases: str=None, name: str=None, is_active: bool=True, is_exchangeable: bool=True, enabled_for_all_models: bool=True, **kwargs) -> None: - super(PhraselistUpdateObject, self).__init__(**kwargs) - self.phrases = phrases - self.name = name - self.is_active = is_active - self.is_exchangeable = is_exchangeable - self.enabled_for_all_models = enabled_for_all_models - - -class PrebuiltDomain(Model): - """Prebuilt Domain. - - :param name: - :type name: str - :param culture: - :type culture: str - :param description: - :type description: str - :param examples: - :type examples: str - :param intents: - :type intents: - list[~azure.cognitiveservices.language.luis.authoring.models.PrebuiltDomainItem] - :param entities: - :type entities: - list[~azure.cognitiveservices.language.luis.authoring.models.PrebuiltDomainItem] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'culture': {'key': 'culture', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'examples': {'key': 'examples', 'type': 'str'}, - 'intents': {'key': 'intents', 'type': '[PrebuiltDomainItem]'}, - 'entities': {'key': 'entities', 'type': '[PrebuiltDomainItem]'}, - } - - def __init__(self, *, name: str=None, culture: str=None, description: str=None, examples: str=None, intents=None, entities=None, **kwargs) -> None: - super(PrebuiltDomain, self).__init__(**kwargs) - self.name = name - self.culture = culture - self.description = description - self.examples = examples - self.intents = intents - self.entities = entities - - -class PrebuiltDomainCreateBaseObject(Model): - """A model object containing the name of the custom prebuilt entity and the - name of the domain to which this model belongs. - - :param domain_name: The domain name. - :type domain_name: str - """ - - _attribute_map = { - 'domain_name': {'key': 'domainName', 'type': 'str'}, - } - - def __init__(self, *, domain_name: str=None, **kwargs) -> None: - super(PrebuiltDomainCreateBaseObject, self).__init__(**kwargs) - self.domain_name = domain_name - - -class PrebuiltDomainCreateObject(Model): - """A prebuilt domain create object containing the name and culture of the - domain. - - :param domain_name: The domain name. - :type domain_name: str - :param culture: The culture of the new domain. - :type culture: str - """ - - _attribute_map = { - 'domain_name': {'key': 'domainName', 'type': 'str'}, - 'culture': {'key': 'culture', 'type': 'str'}, - } - - def __init__(self, *, domain_name: str=None, culture: str=None, **kwargs) -> None: - super(PrebuiltDomainCreateObject, self).__init__(**kwargs) - self.domain_name = domain_name - self.culture = culture - - -class PrebuiltDomainItem(Model): - """PrebuiltDomainItem. - - :param name: - :type name: str - :param description: - :type description: str - :param examples: - :type examples: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'examples': {'key': 'examples', 'type': 'str'}, - } - - def __init__(self, *, name: str=None, description: str=None, examples: str=None, **kwargs) -> None: - super(PrebuiltDomainItem, self).__init__(**kwargs) - self.name = name - self.description = description - self.examples = examples - - -class PrebuiltDomainModelCreateObject(Model): - """A model object containing the name of the custom prebuilt intent or entity - and the name of the domain to which this model belongs. - - :param domain_name: The domain name. - :type domain_name: str - :param model_name: The intent name or entity name. - :type model_name: str - """ - - _attribute_map = { - 'domain_name': {'key': 'domainName', 'type': 'str'}, - 'model_name': {'key': 'modelName', 'type': 'str'}, - } - - def __init__(self, *, domain_name: str=None, model_name: str=None, **kwargs) -> None: - super(PrebuiltDomainModelCreateObject, self).__init__(**kwargs) - self.domain_name = domain_name - self.model_name = model_name - - -class PrebuiltDomainObject(Model): - """PrebuiltDomainObject. - - :param domain_name: - :type domain_name: str - :param model_name: - :type model_name: str - """ - - _attribute_map = { - 'domain_name': {'key': 'domain_name', 'type': 'str'}, - 'model_name': {'key': 'model_name', 'type': 'str'}, - } - - def __init__(self, *, domain_name: str=None, model_name: str=None, **kwargs) -> None: - super(PrebuiltDomainObject, self).__init__(**kwargs) - self.domain_name = domain_name - self.model_name = model_name - - -class PrebuiltEntity(Model): - """Prebuilt Entity Extractor. - - :param name: - :type name: str - :param roles: - :type roles: list[str] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'roles': {'key': 'roles', 'type': '[str]'}, - } - - def __init__(self, *, name: str=None, roles=None, **kwargs) -> None: - super(PrebuiltEntity, self).__init__(**kwargs) - self.name = name - self.roles = roles - - -class PrebuiltEntityExtractor(Model): - """Prebuilt Entity Extractor. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. The ID of the Entity Model. - :type id: str - :param name: Name of the Entity Model. - :type name: str - :param type_id: The type ID of the Entity Model. - :type type_id: int - :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', - 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List - Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', - 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex - Entity Extractor' - :type readable_type: str or - ~azure.cognitiveservices.language.luis.authoring.models.enum - :param roles: - :type roles: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] - """ - - _validation = { - 'id': {'required': True}, - 'readable_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type_id': {'key': 'typeId', 'type': 'int'}, - 'readable_type': {'key': 'readableType', 'type': 'str'}, - 'roles': {'key': 'roles', 'type': '[EntityRole]'}, - } - - def __init__(self, *, id: str, readable_type, name: str=None, type_id: int=None, roles=None, **kwargs) -> None: - super(PrebuiltEntityExtractor, self).__init__(**kwargs) - self.id = id - self.name = name - self.type_id = type_id - self.readable_type = readable_type - self.roles = roles - - -class ProductionOrStagingEndpointInfo(EndpointInfo): - """ProductionOrStagingEndpointInfo. - - :param version_id: The version ID to publish. - :type version_id: str - :param is_staging: Indicates if the staging slot should be used, instead - of the Production one. - :type is_staging: bool - :param endpoint_url: The Runtime endpoint URL for this model version. - :type endpoint_url: str - :param region: The target region that the application is published to. - :type region: str - :param assigned_endpoint_key: The endpoint key. - :type assigned_endpoint_key: str - :param endpoint_region: The endpoint's region. - :type endpoint_region: str - :param failed_regions: Regions where publishing failed. - :type failed_regions: str - :param published_date_time: Timestamp when was last published. - :type published_date_time: str - """ - - _attribute_map = { - 'version_id': {'key': 'versionId', 'type': 'str'}, - 'is_staging': {'key': 'isStaging', 'type': 'bool'}, - 'endpoint_url': {'key': 'endpointUrl', 'type': 'str'}, - 'region': {'key': 'region', 'type': 'str'}, - 'assigned_endpoint_key': {'key': 'assignedEndpointKey', 'type': 'str'}, - 'endpoint_region': {'key': 'endpointRegion', 'type': 'str'}, - 'failed_regions': {'key': 'failedRegions', 'type': 'str'}, - 'published_date_time': {'key': 'publishedDateTime', 'type': 'str'}, - } - - def __init__(self, *, version_id: str=None, is_staging: bool=None, endpoint_url: str=None, region: str=None, assigned_endpoint_key: str=None, endpoint_region: str=None, failed_regions: str=None, published_date_time: str=None, **kwargs) -> None: - super(ProductionOrStagingEndpointInfo, self).__init__(version_id=version_id, is_staging=is_staging, endpoint_url=endpoint_url, region=region, assigned_endpoint_key=assigned_endpoint_key, endpoint_region=endpoint_region, failed_regions=failed_regions, published_date_time=published_date_time, **kwargs) - - -class PublishSettings(Model): - """The application publish settings. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. The application ID. - :type id: str - :param is_sentiment_analysis_enabled: Required. Setting sentiment analysis - as true returns the sentiment of the input utterance along with the - response - :type is_sentiment_analysis_enabled: bool - :param is_speech_enabled: Required. Enables speech priming in your app - :type is_speech_enabled: bool - :param is_spell_checker_enabled: Required. Enables spell checking of the - utterance. - :type is_spell_checker_enabled: bool - """ - - _validation = { - 'id': {'required': True}, - 'is_sentiment_analysis_enabled': {'required': True}, - 'is_speech_enabled': {'required': True}, - 'is_spell_checker_enabled': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'is_sentiment_analysis_enabled': {'key': 'sentimentAnalysis', 'type': 'bool'}, - 'is_speech_enabled': {'key': 'speech', 'type': 'bool'}, - 'is_spell_checker_enabled': {'key': 'spellChecker', 'type': 'bool'}, - } - - def __init__(self, *, id: str, is_sentiment_analysis_enabled: bool, is_speech_enabled: bool, is_spell_checker_enabled: bool, **kwargs) -> None: - super(PublishSettings, self).__init__(**kwargs) - self.id = id - self.is_sentiment_analysis_enabled = is_sentiment_analysis_enabled - self.is_speech_enabled = is_speech_enabled - self.is_spell_checker_enabled = is_spell_checker_enabled - - -class PublishSettingUpdateObject(Model): - """Object model for updating an application's publish settings. - - :param sentiment_analysis: Setting sentiment analysis as true returns the - Sentiment of the input utterance along with the response - :type sentiment_analysis: bool - :param speech: Setting speech as public enables speech priming in your app - :type speech: bool - :param spell_checker: Setting spell checker as public enables spell - checking the input utterance. - :type spell_checker: bool - """ - - _attribute_map = { - 'sentiment_analysis': {'key': 'sentimentAnalysis', 'type': 'bool'}, - 'speech': {'key': 'speech', 'type': 'bool'}, - 'spell_checker': {'key': 'spellChecker', 'type': 'bool'}, - } - - def __init__(self, *, sentiment_analysis: bool=None, speech: bool=None, spell_checker: bool=None, **kwargs) -> None: - super(PublishSettingUpdateObject, self).__init__(**kwargs) - self.sentiment_analysis = sentiment_analysis - self.speech = speech - self.spell_checker = spell_checker - - -class RegexEntity(Model): - """Regular Expression Entity Extractor. - - :param name: - :type name: str - :param regex_pattern: - :type regex_pattern: str - :param roles: - :type roles: list[str] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'regex_pattern': {'key': 'regexPattern', 'type': 'str'}, - 'roles': {'key': 'roles', 'type': '[str]'}, - } - - def __init__(self, *, name: str=None, regex_pattern: str=None, roles=None, **kwargs) -> None: - super(RegexEntity, self).__init__(**kwargs) - self.name = name - self.regex_pattern = regex_pattern - self.roles = roles - - -class RegexEntityExtractor(Model): - """Regular Expression Entity Extractor. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. The ID of the Entity Model. - :type id: str - :param name: Name of the Entity Model. - :type name: str - :param type_id: The type ID of the Entity Model. - :type type_id: int - :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', - 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List - Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', - 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex - Entity Extractor' - :type readable_type: str or - ~azure.cognitiveservices.language.luis.authoring.models.enum - :param roles: - :type roles: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] - :param regex_pattern: The Regular Expression entity pattern. - :type regex_pattern: str - """ - - _validation = { - 'id': {'required': True}, - 'readable_type': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type_id': {'key': 'typeId', 'type': 'int'}, - 'readable_type': {'key': 'readableType', 'type': 'str'}, - 'roles': {'key': 'roles', 'type': '[EntityRole]'}, - 'regex_pattern': {'key': 'regexPattern', 'type': 'str'}, - } - - def __init__(self, *, id: str, readable_type, name: str=None, type_id: int=None, roles=None, regex_pattern: str=None, **kwargs) -> None: - super(RegexEntityExtractor, self).__init__(**kwargs) - self.id = id - self.name = name - self.type_id = type_id - self.readable_type = readable_type - self.roles = roles - self.regex_pattern = regex_pattern - - -class RegexModelCreateObject(Model): - """Model object for creating a regular expression entity model. - - :param regex_pattern: The regular expression entity pattern. - :type regex_pattern: str - :param name: The model name. - :type name: str - """ - - _attribute_map = { - 'regex_pattern': {'key': 'regexPattern', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, regex_pattern: str=None, name: str=None, **kwargs) -> None: - super(RegexModelCreateObject, self).__init__(**kwargs) - self.regex_pattern = regex_pattern - self.name = name - - -class RegexModelUpdateObject(Model): - """Model object for updating a regular expression entity model. - - :param regex_pattern: The regular expression entity pattern. - :type regex_pattern: str - :param name: The model name. - :type name: str - """ - - _attribute_map = { - 'regex_pattern': {'key': 'regexPattern', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, regex_pattern: str=None, name: str=None, **kwargs) -> None: - super(RegexModelUpdateObject, self).__init__(**kwargs) - self.regex_pattern = regex_pattern - self.name = name - - -class SubClosedList(Model): - """Sublist of items for a list entity. - - :param canonical_form: The standard form that the list represents. - :type canonical_form: str - :param list: List of synonym words. - :type list: list[str] - """ - - _attribute_map = { - 'canonical_form': {'key': 'canonicalForm', 'type': 'str'}, - 'list': {'key': 'list', 'type': '[str]'}, - } - - def __init__(self, *, canonical_form: str=None, list=None, **kwargs) -> None: - super(SubClosedList, self).__init__(**kwargs) - self.canonical_form = canonical_form - self.list = list - - -class SubClosedListResponse(SubClosedList): - """Sublist of items for a list entity. - - :param canonical_form: The standard form that the list represents. - :type canonical_form: str - :param list: List of synonym words. - :type list: list[str] - :param id: The sublist ID - :type id: int - """ - - _attribute_map = { - 'canonical_form': {'key': 'canonicalForm', 'type': 'str'}, - 'list': {'key': 'list', 'type': '[str]'}, - 'id': {'key': 'id', 'type': 'int'}, - } - - def __init__(self, *, canonical_form: str=None, list=None, id: int=None, **kwargs) -> None: - super(SubClosedListResponse, self).__init__(canonical_form=canonical_form, list=list, **kwargs) - self.id = id - - -class TaskUpdateObject(Model): - """Object model for cloning an application's version. - - :param version: The new version for the cloned model. - :type version: str - """ - - _attribute_map = { - 'version': {'key': 'version', 'type': 'str'}, - } - - def __init__(self, *, version: str=None, **kwargs) -> None: - super(TaskUpdateObject, self).__init__(**kwargs) - self.version = version - - -class UserAccessList(Model): - """List of user permissions. - - :param owner: The email address of owner of the application. - :type owner: str - :param emails: - :type emails: list[str] - """ - - _attribute_map = { - 'owner': {'key': 'owner', 'type': 'str'}, - 'emails': {'key': 'emails', 'type': '[str]'}, - } - - def __init__(self, *, owner: str=None, emails=None, **kwargs) -> None: - super(UserAccessList, self).__init__(**kwargs) - self.owner = owner - self.emails = emails - - -class UserCollaborator(Model): - """UserCollaborator. - - :param email: The email address of the user. - :type email: str - """ - - _attribute_map = { - 'email': {'key': 'email', 'type': 'str'}, - } - - def __init__(self, *, email: str=None, **kwargs) -> None: - super(UserCollaborator, self).__init__(**kwargs) - self.email = email - - -class VersionInfo(Model): - """Object model of an application version. - - All required parameters must be populated in order to send to Azure. - - :param version: Required. The version ID. E.g.: "0.1" - :type version: str - :param created_date_time: The version's creation timestamp. - :type created_date_time: datetime - :param last_modified_date_time: Timestamp of the last update. - :type last_modified_date_time: datetime - :param last_trained_date_time: Timestamp of the last time the model was - trained. - :type last_trained_date_time: datetime - :param last_published_date_time: Timestamp when was last published. - :type last_published_date_time: datetime - :param endpoint_url: The Runtime endpoint URL for this model version. - :type endpoint_url: str - :param assigned_endpoint_key: The endpoint key. - :type assigned_endpoint_key: dict[str, str] - :param external_api_keys: External keys. - :type external_api_keys: object - :param intents_count: Number of intents in this model. - :type intents_count: int - :param entities_count: Number of entities in this model. - :type entities_count: int - :param endpoint_hits_count: Number of calls made to this endpoint. - :type endpoint_hits_count: int - :param training_status: Required. The current training status. Possible - values include: 'NeedsTraining', 'InProgress', 'Trained' - :type training_status: str or - ~azure.cognitiveservices.language.luis.authoring.models.TrainingStatus - """ - - _validation = { - 'version': {'required': True}, - 'training_status': {'required': True}, - } - - _attribute_map = { - 'version': {'key': 'version', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'last_modified_date_time': {'key': 'lastModifiedDateTime', 'type': 'iso-8601'}, - 'last_trained_date_time': {'key': 'lastTrainedDateTime', 'type': 'iso-8601'}, - 'last_published_date_time': {'key': 'lastPublishedDateTime', 'type': 'iso-8601'}, - 'endpoint_url': {'key': 'endpointUrl', 'type': 'str'}, - 'assigned_endpoint_key': {'key': 'assignedEndpointKey', 'type': '{str}'}, - 'external_api_keys': {'key': 'externalApiKeys', 'type': 'object'}, - 'intents_count': {'key': 'intentsCount', 'type': 'int'}, - 'entities_count': {'key': 'entitiesCount', 'type': 'int'}, - 'endpoint_hits_count': {'key': 'endpointHitsCount', 'type': 'int'}, - 'training_status': {'key': 'trainingStatus', 'type': 'TrainingStatus'}, - } - - def __init__(self, *, version: str, training_status, created_date_time=None, last_modified_date_time=None, last_trained_date_time=None, last_published_date_time=None, endpoint_url: str=None, assigned_endpoint_key=None, external_api_keys=None, intents_count: int=None, entities_count: int=None, endpoint_hits_count: int=None, **kwargs) -> None: - super(VersionInfo, self).__init__(**kwargs) - self.version = version - self.created_date_time = created_date_time - self.last_modified_date_time = last_modified_date_time - self.last_trained_date_time = last_trained_date_time - self.last_published_date_time = last_published_date_time - self.endpoint_url = endpoint_url - self.assigned_endpoint_key = assigned_endpoint_key - self.external_api_keys = external_api_keys - self.intents_count = intents_count - self.entities_count = entities_count - self.endpoint_hits_count = endpoint_hits_count - self.training_status = training_status - - -class WordListBaseUpdateObject(Model): - """Object model for updating one of the list entity's sublists. - - :param canonical_form: The standard form that the list represents. - :type canonical_form: str - :param list: List of synonym words. - :type list: list[str] - """ - - _attribute_map = { - 'canonical_form': {'key': 'canonicalForm', 'type': 'str'}, - 'list': {'key': 'list', 'type': '[str]'}, - } - - def __init__(self, *, canonical_form: str=None, list=None, **kwargs) -> None: - super(WordListBaseUpdateObject, self).__init__(**kwargs) - self.canonical_form = canonical_form - self.list = list - - -class WordListObject(Model): - """Sublist of items for a list entity. - - :param canonical_form: The standard form that the list represents. - :type canonical_form: str - :param list: List of synonym words. - :type list: list[str] - """ - - _attribute_map = { - 'canonical_form': {'key': 'canonicalForm', 'type': 'str'}, - 'list': {'key': 'list', 'type': '[str]'}, - } - - def __init__(self, *, canonical_form: str=None, list=None, **kwargs) -> None: - super(WordListObject, self).__init__(**kwargs) - self.canonical_form = canonical_form - self.list = list diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/__init__.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/__init__.py deleted file mode 100644 index 0d53c240e24..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/__init__.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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 ._features_operations import FeaturesOperations -from ._examples_operations import ExamplesOperations -from ._model_operations import ModelOperations -from ._apps_operations import AppsOperations -from ._versions_operations import VersionsOperations -from ._train_operations import TrainOperations -from ._pattern_operations import PatternOperations -from ._settings_operations import SettingsOperations -from ._azure_accounts_operations import AzureAccountsOperations - -__all__ = [ - 'FeaturesOperations', - 'ExamplesOperations', - 'ModelOperations', - 'AppsOperations', - 'VersionsOperations', - 'TrainOperations', - 'PatternOperations', - 'SettingsOperations', - 'AzureAccountsOperations', -] diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_apps_operations.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_apps_operations.py deleted file mode 100644 index 3fae6767912..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_apps_operations.py +++ /dev/null @@ -1,1397 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.pipeline import ClientRawResponse -from msrest.exceptions import HttpOperationError - -from .. import models - - -class AppsOperations(object): - """AppsOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - - self.config = config - - def add( - self, application_create_object, custom_headers=None, raw=False, **operation_config): - """Creates a new LUIS app. - - :param application_create_object: An application containing Name, - Description (optional), Culture, Usage Scenario (optional), Domain - (optional) and initial version ID (optional) of the application. - Default value for the version ID is "0.1". Note: the culture cannot be - changed after the app is created. - :type application_create_object: - ~azure.cognitiveservices.language.luis.authoring.models.ApplicationCreateObject - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: str or ClientRawResponse if raw=true - :rtype: str or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.add.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(application_create_object, 'ApplicationCreateObject') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 201: - deserialized = self._deserialize('str', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - add.metadata = {'url': '/apps/'} - - def list( - self, skip=0, take=100, custom_headers=None, raw=False, **operation_config): - """Lists all of the user's applications. - - :param skip: The number of entries to skip. Default value is 0. - :type skip: int - :param take: The number of entries to return. Maximum page size is - 500. Default is 100. - :type take: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.ApplicationInfoResponse] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if skip is not None: - query_parameters['skip'] = self._serialize.query("skip", skip, 'int', minimum=0) - if take is not None: - query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[ApplicationInfoResponse]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list.metadata = {'url': '/apps/'} - - def import_method( - self, luis_app, app_name=None, custom_headers=None, raw=False, **operation_config): - """Imports an application to LUIS, the application's structure is included - in the request body. - - :param luis_app: A LUIS application structure. - :type luis_app: - ~azure.cognitiveservices.language.luis.authoring.models.LuisApp - :param app_name: The application name to create. If not specified, the - application name will be read from the imported object. If the - application name already exists, an error is returned. - :type app_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: str or ClientRawResponse if raw=true - :rtype: str or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.import_method.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if app_name is not None: - query_parameters['appName'] = self._serialize.query("app_name", app_name, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(luis_app, 'LuisApp') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 201: - deserialized = self._deserialize('str', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - import_method.metadata = {'url': '/apps/import'} - - def list_cortana_endpoints( - self, custom_headers=None, raw=False, **operation_config): - """Gets the endpoint URLs for the prebuilt Cortana applications. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: PersonalAssistantsResponse or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.PersonalAssistantsResponse - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list_cortana_endpoints.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('PersonalAssistantsResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_cortana_endpoints.metadata = {'url': '/apps/assistants'} - - def list_domains( - self, custom_headers=None, raw=False, **operation_config): - """Gets the available application domains. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: list[str] or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list_domains.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[str]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_domains.metadata = {'url': '/apps/domains'} - - def list_usage_scenarios( - self, custom_headers=None, raw=False, **operation_config): - """Gets the application available usage scenarios. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: list[str] or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list_usage_scenarios.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[str]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_usage_scenarios.metadata = {'url': '/apps/usagescenarios'} - - def list_supported_cultures( - self, custom_headers=None, raw=False, **operation_config): - """Gets a list of supported cultures. Cultures are equivalent to the - written language and locale. For example,"en-us" represents the U.S. - variation of English. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.AvailableCulture] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list_supported_cultures.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[AvailableCulture]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_supported_cultures.metadata = {'url': '/apps/cultures'} - - def download_query_logs( - self, app_id, custom_headers=None, raw=False, callback=None, **operation_config): - """Gets the logs of the past month's endpoint queries for the application. - - :param app_id: The application ID. - :type app_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param callback: When specified, will be called with each chunk of - data that is streamed. The callback should take two arguments, the - bytes of the current chunk of data and the response object. If the - data is uploading, response will be None. - :type callback: Callable[Bytes, response=None] - :param operation_config: :ref:`Operation configuration - overrides`. - :return: object or ClientRawResponse if raw=true - :rtype: Generator or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`HttpOperationError` - """ - # Construct URL - url = self.download_query_logs.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/octet-stream' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=True, **operation_config) - - if response.status_code not in [200]: - raise HttpOperationError(self._deserialize, response) - - deserialized = self._client.stream_download(response, callback) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - download_query_logs.metadata = {'url': '/apps/{appId}/querylogs'} - - def get( - self, app_id, custom_headers=None, raw=False, **operation_config): - """Gets the application info. - - :param app_id: The application ID. - :type app_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ApplicationInfoResponse or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.ApplicationInfoResponse - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('ApplicationInfoResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/apps/{appId}'} - - def update( - self, app_id, name=None, description=None, custom_headers=None, raw=False, **operation_config): - """Updates the name or description of the application. - - :param app_id: The application ID. - :type app_id: str - :param name: The application's new name. - :type name: str - :param description: The application's new description. - :type description: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - application_update_object = models.ApplicationUpdateObject(name=name, description=description) - - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(application_update_object, 'ApplicationUpdateObject') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update.metadata = {'url': '/apps/{appId}'} - - def delete( - self, app_id, force=False, custom_headers=None, raw=False, **operation_config): - """Deletes an application. - - :param app_id: The application ID. - :type app_id: str - :param force: A flag to indicate whether to force an operation. - :type force: bool - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if force is not None: - query_parameters['force'] = self._serialize.query("force", force, 'bool') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - delete.metadata = {'url': '/apps/{appId}'} - - def publish( - self, app_id, version_id=None, is_staging=False, custom_headers=None, raw=False, **operation_config): - """Publishes a specific version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID to publish. - :type version_id: str - :param is_staging: Indicates if the staging slot should be used, - instead of the Production one. - :type is_staging: bool - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ProductionOrStagingEndpointInfo or ClientRawResponse if - raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.ProductionOrStagingEndpointInfo - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - application_publish_object = models.ApplicationPublishObject(version_id=version_id, is_staging=is_staging) - - # Construct URL - url = self.publish.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(application_publish_object, 'ApplicationPublishObject') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201, 207]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 201: - deserialized = self._deserialize('ProductionOrStagingEndpointInfo', response) - if response.status_code == 207: - deserialized = self._deserialize('ProductionOrStagingEndpointInfo', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - publish.metadata = {'url': '/apps/{appId}/publish'} - - def get_settings( - self, app_id, custom_headers=None, raw=False, **operation_config): - """Get the application settings including 'UseAllTrainingData'. - - :param app_id: The application ID. - :type app_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ApplicationSettings or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.ApplicationSettings - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get_settings.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('ApplicationSettings', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_settings.metadata = {'url': '/apps/{appId}/settings'} - - def update_settings( - self, app_id, is_public=None, custom_headers=None, raw=False, **operation_config): - """Updates the application settings including 'UseAllTrainingData'. - - :param app_id: The application ID. - :type app_id: str - :param is_public: Setting your application as public allows other - people to use your application's endpoint using their own keys. - :type is_public: bool - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - application_setting_update_object = models.ApplicationSettingUpdateObject(is_public=is_public) - - # Construct URL - url = self.update_settings.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(application_setting_update_object, 'ApplicationSettingUpdateObject') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update_settings.metadata = {'url': '/apps/{appId}/settings'} - - def get_publish_settings( - self, app_id, custom_headers=None, raw=False, **operation_config): - """Get the application publish settings including 'UseAllTrainingData'. - - :param app_id: The application ID. - :type app_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: PublishSettings or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.PublishSettings - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get_publish_settings.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('PublishSettings', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_publish_settings.metadata = {'url': '/apps/{appId}/publishsettings'} - - def update_publish_settings( - self, app_id, publish_setting_update_object, custom_headers=None, raw=False, **operation_config): - """Updates the application publish settings including - 'UseAllTrainingData'. - - :param app_id: The application ID. - :type app_id: str - :param publish_setting_update_object: An object containing the new - publish application settings. - :type publish_setting_update_object: - ~azure.cognitiveservices.language.luis.authoring.models.PublishSettingUpdateObject - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.update_publish_settings.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(publish_setting_update_object, 'PublishSettingUpdateObject') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update_publish_settings.metadata = {'url': '/apps/{appId}/publishsettings'} - - def list_endpoints( - self, app_id, custom_headers=None, raw=False, **operation_config): - """Returns the available endpoint deployment regions and URLs. - - :param app_id: The application ID. - :type app_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: dict or ClientRawResponse if raw=true - :rtype: dict[str, str] or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list_endpoints.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('{str}', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_endpoints.metadata = {'url': '/apps/{appId}/endpoints'} - - def list_available_custom_prebuilt_domains( - self, custom_headers=None, raw=False, **operation_config): - """Gets all the available custom prebuilt domains for all cultures. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.PrebuiltDomain] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list_available_custom_prebuilt_domains.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[PrebuiltDomain]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_available_custom_prebuilt_domains.metadata = {'url': '/apps/customprebuiltdomains'} - - def add_custom_prebuilt_domain( - self, domain_name=None, culture=None, custom_headers=None, raw=False, **operation_config): - """Adds a prebuilt domain along with its intent and entity models as a new - application. - - :param domain_name: The domain name. - :type domain_name: str - :param culture: The culture of the new domain. - :type culture: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: str or ClientRawResponse if raw=true - :rtype: str or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - prebuilt_domain_create_object = models.PrebuiltDomainCreateObject(domain_name=domain_name, culture=culture) - - # Construct URL - url = self.add_custom_prebuilt_domain.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(prebuilt_domain_create_object, 'PrebuiltDomainCreateObject') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 201: - deserialized = self._deserialize('str', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - add_custom_prebuilt_domain.metadata = {'url': '/apps/customprebuiltdomains'} - - def list_available_custom_prebuilt_domains_for_culture( - self, culture, custom_headers=None, raw=False, **operation_config): - """Gets all the available prebuilt domains for a specific culture. - - :param culture: Culture. - :type culture: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.PrebuiltDomain] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list_available_custom_prebuilt_domains_for_culture.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'culture': self._serialize.url("culture", culture, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[PrebuiltDomain]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_available_custom_prebuilt_domains_for_culture.metadata = {'url': '/apps/customprebuiltdomains/{culture}'} - - def package_published_application_as_gzip( - self, app_id, slot_name, custom_headers=None, raw=False, callback=None, **operation_config): - """package - Gets published LUIS application package in binary stream GZip - format. - - Packages a published LUIS application as a GZip file to be used in the - LUIS container. - - :param app_id: The application ID. - :type app_id: str - :param slot_name: The publishing slot name. - :type slot_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param callback: When specified, will be called with each chunk of - data that is streamed. The callback should take two arguments, the - bytes of the current chunk of data and the response object. If the - data is uploading, response will be None. - :type callback: Callable[Bytes, response=None] - :param operation_config: :ref:`Operation configuration - overrides`. - :return: object or ClientRawResponse if raw=true - :rtype: Generator or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.package_published_application_as_gzip.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'slotName': self._serialize.url("slot_name", slot_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=True, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = self._client.stream_download(response, callback) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - package_published_application_as_gzip.metadata = {'url': '/package/{appId}/slot/{slotName}/gzip'} - - def package_trained_application_as_gzip( - self, app_id, version_id, custom_headers=None, raw=False, callback=None, **operation_config): - """package - Gets trained LUIS application package in binary stream GZip - format. - - Packages trained LUIS application as GZip file to be used in the LUIS - container. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param callback: When specified, will be called with each chunk of - data that is streamed. The callback should take two arguments, the - bytes of the current chunk of data and the response object. If the - data is uploading, response will be None. - :type callback: Callable[Bytes, response=None] - :param operation_config: :ref:`Operation configuration - overrides`. - :return: object or ClientRawResponse if raw=true - :rtype: Generator or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.package_trained_application_as_gzip.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=True, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = self._client.stream_download(response, callback) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - package_trained_application_as_gzip.metadata = {'url': '/package/{appId}/versions/{versionId}/gzip'} - - def import_v2_app( - self, luis_app_v2, app_name=None, custom_headers=None, raw=False, **operation_config): - """Imports an application to LUIS, the application's structure is included - in the request body. - - :param luis_app_v2: A LUIS application structure. - :type luis_app_v2: - ~azure.cognitiveservices.language.luis.authoring.models.LuisAppV2 - :param app_name: The application name to create. If not specified, the - application name will be read from the imported object. If the - application name already exists, an error is returned. - :type app_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: str or ClientRawResponse if raw=true - :rtype: str or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.import_v2_app.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if app_name is not None: - query_parameters['appName'] = self._serialize.query("app_name", app_name, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(luis_app_v2, 'LuisAppV2') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 201: - deserialized = self._deserialize('str', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - import_v2_app.metadata = {'url': '/apps/import'} - - def import_lu_format( - self, luis_app_lu, app_name=None, custom_headers=None, raw=False, **operation_config): - """Imports an application to LUIS, the application's structure is included - in the request body. - - :param luis_app_lu: A LUIS application structure. - :type luis_app_lu: str - :param app_name: The application name to create. If not specified, the - application name will be read from the imported object. If the - application name already exists, an error is returned. - :type app_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: str or ClientRawResponse if raw=true - :rtype: str or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.import_lu_format.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if app_name is not None: - query_parameters['appName'] = self._serialize.query("app_name", app_name, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'text/plain' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(luis_app_lu, 'str') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 201: - deserialized = self._deserialize('str', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - import_lu_format.metadata = {'url': '/apps/import'} diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_azure_accounts_operations.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_azure_accounts_operations.py deleted file mode 100644 index 462f857f162..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_azure_accounts_operations.py +++ /dev/null @@ -1,296 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class AzureAccountsOperations(object): - """AzureAccountsOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - - self.config = config - - def assign_to_app( - self, app_id, arm_token=None, azure_account_info_object=None, custom_headers=None, raw=False, **operation_config): - """apps - Assign a LUIS Azure account to an application. - - Assigns an Azure account to the application. - - :param app_id: The application ID. - :type app_id: str - :param arm_token: The custom arm token header to use; containing the - user's ARM token used to validate azure accounts information. - :type arm_token: str - :param azure_account_info_object: The Azure account information - object. - :type azure_account_info_object: - ~azure.cognitiveservices.language.luis.authoring.models.AzureAccountInfoObject - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.assign_to_app.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - if arm_token is not None: - header_parameters['ArmToken'] = self._serialize.header("arm_token", arm_token, 'str') - - # Construct body - if azure_account_info_object is not None: - body_content = self._serialize.body(azure_account_info_object, 'AzureAccountInfoObject') - else: - body_content = None - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 201: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - assign_to_app.metadata = {'url': '/apps/{appId}/azureaccounts'} - - def get_assigned( - self, app_id, arm_token=None, custom_headers=None, raw=False, **operation_config): - """apps - Get LUIS Azure accounts assigned to the application. - - Gets the LUIS Azure accounts assigned to the application for the user - using his ARM token. - - :param app_id: The application ID. - :type app_id: str - :param arm_token: The custom arm token header to use; containing the - user's ARM token used to validate azure accounts information. - :type arm_token: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.AzureAccountInfoObject] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get_assigned.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - if arm_token is not None: - header_parameters['ArmToken'] = self._serialize.header("arm_token", arm_token, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[AzureAccountInfoObject]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_assigned.metadata = {'url': '/apps/{appId}/azureaccounts'} - - def remove_from_app( - self, app_id, arm_token=None, azure_account_info_object=None, custom_headers=None, raw=False, **operation_config): - """apps - Removes an assigned LUIS Azure account from an application. - - Removes assigned Azure account from the application. - - :param app_id: The application ID. - :type app_id: str - :param arm_token: The custom arm token header to use; containing the - user's ARM token used to validate azure accounts information. - :type arm_token: str - :param azure_account_info_object: The Azure account information - object. - :type azure_account_info_object: - ~azure.cognitiveservices.language.luis.authoring.models.AzureAccountInfoObject - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.remove_from_app.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - if arm_token is not None: - header_parameters['ArmToken'] = self._serialize.header("arm_token", arm_token, 'str') - - # Construct body - if azure_account_info_object is not None: - body_content = self._serialize.body(azure_account_info_object, 'AzureAccountInfoObject') - else: - body_content = None - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - remove_from_app.metadata = {'url': '/apps/{appId}/azureaccounts'} - - def list_user_luis_accounts( - self, arm_token=None, custom_headers=None, raw=False, **operation_config): - """user - Get LUIS Azure accounts. - - Gets the LUIS Azure accounts for the user using his ARM token. - - :param arm_token: The custom arm token header to use; containing the - user's ARM token used to validate azure accounts information. - :type arm_token: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.AzureAccountInfoObject] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list_user_luis_accounts.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - if arm_token is not None: - header_parameters['ArmToken'] = self._serialize.header("arm_token", arm_token, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[AzureAccountInfoObject]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_user_luis_accounts.metadata = {'url': '/azureaccounts'} diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_examples_operations.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_examples_operations.py deleted file mode 100644 index a25af3a6395..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_examples_operations.py +++ /dev/null @@ -1,304 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class ExamplesOperations(object): - """ExamplesOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - - self.config = config - - def add( - self, app_id, version_id, example_label_object, enable_nested_children=False, custom_headers=None, raw=False, **operation_config): - """Adds a labeled example utterance in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param example_label_object: A labeled example utterance with the - expected intent and entities. - :type example_label_object: - ~azure.cognitiveservices.language.luis.authoring.models.ExampleLabelObject - :param enable_nested_children: Toggles nested/flat format - :type enable_nested_children: bool - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: LabelExampleResponse or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.LabelExampleResponse - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.add.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if enable_nested_children is not None: - query_parameters['enableNestedChildren'] = self._serialize.query("enable_nested_children", enable_nested_children, 'bool') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(example_label_object, 'ExampleLabelObject') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 201: - deserialized = self._deserialize('LabelExampleResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - add.metadata = {'url': '/apps/{appId}/versions/{versionId}/example'} - - def batch( - self, app_id, version_id, example_label_object_array, enable_nested_children=False, custom_headers=None, raw=False, **operation_config): - """Adds a batch of labeled example utterances to a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param example_label_object_array: Array of example utterances. - :type example_label_object_array: - list[~azure.cognitiveservices.language.luis.authoring.models.ExampleLabelObject] - :param enable_nested_children: Toggles nested/flat format - :type enable_nested_children: bool - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.BatchLabelExample] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.batch.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if enable_nested_children is not None: - query_parameters['enableNestedChildren'] = self._serialize.query("enable_nested_children", enable_nested_children, 'bool') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(example_label_object_array, '[ExampleLabelObject]') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201, 207]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 201: - deserialized = self._deserialize('[BatchLabelExample]', response) - if response.status_code == 207: - deserialized = self._deserialize('[BatchLabelExample]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - batch.metadata = {'url': '/apps/{appId}/versions/{versionId}/examples'} - - def list( - self, app_id, version_id, skip=0, take=100, enable_nested_children=False, custom_headers=None, raw=False, **operation_config): - """Returns example utterances to be reviewed from a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param skip: The number of entries to skip. Default value is 0. - :type skip: int - :param take: The number of entries to return. Maximum page size is - 500. Default is 100. - :type take: int - :param enable_nested_children: Toggles nested/flat format - :type enable_nested_children: bool - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.LabeledUtterance] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if skip is not None: - query_parameters['skip'] = self._serialize.query("skip", skip, 'int', minimum=0) - if take is not None: - query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0) - if enable_nested_children is not None: - query_parameters['enableNestedChildren'] = self._serialize.query("enable_nested_children", enable_nested_children, 'bool') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[LabeledUtterance]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list.metadata = {'url': '/apps/{appId}/versions/{versionId}/examples'} - - def delete( - self, app_id, version_id, example_id, custom_headers=None, raw=False, **operation_config): - """Deletes the labeled example utterances with the specified ID from a - version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param example_id: The example ID. - :type example_id: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'exampleId': self._serialize.url("example_id", example_id, 'int') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - delete.metadata = {'url': '/apps/{appId}/versions/{versionId}/examples/{exampleId}'} diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_features_operations.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_features_operations.py deleted file mode 100644 index 1843ed6e9d0..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_features_operations.py +++ /dev/null @@ -1,557 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class FeaturesOperations(object): - """FeaturesOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - - self.config = config - - def add_phrase_list( - self, app_id, version_id, phraselist_create_object, custom_headers=None, raw=False, **operation_config): - """Creates a new phraselist feature in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param phraselist_create_object: A Phraselist object containing Name, - comma-separated Phrases and the isExchangeable boolean. Default value - for isExchangeable is true. - :type phraselist_create_object: - ~azure.cognitiveservices.language.luis.authoring.models.PhraselistCreateObject - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: int or ClientRawResponse if raw=true - :rtype: int or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.add_phrase_list.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(phraselist_create_object, 'PhraselistCreateObject') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 201: - deserialized = self._deserialize('int', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - add_phrase_list.metadata = {'url': '/apps/{appId}/versions/{versionId}/phraselists'} - - def list_phrase_lists( - self, app_id, version_id, skip=0, take=100, custom_headers=None, raw=False, **operation_config): - """Gets all the phraselist features in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param skip: The number of entries to skip. Default value is 0. - :type skip: int - :param take: The number of entries to return. Maximum page size is - 500. Default is 100. - :type take: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.PhraseListFeatureInfo] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list_phrase_lists.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if skip is not None: - query_parameters['skip'] = self._serialize.query("skip", skip, 'int', minimum=0) - if take is not None: - query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[PhraseListFeatureInfo]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_phrase_lists.metadata = {'url': '/apps/{appId}/versions/{versionId}/phraselists'} - - def list( - self, app_id, version_id, skip=0, take=100, custom_headers=None, raw=False, **operation_config): - """Gets all the extraction phraselist and pattern features in a version of - the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param skip: The number of entries to skip. Default value is 0. - :type skip: int - :param take: The number of entries to return. Maximum page size is - 500. Default is 100. - :type take: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: FeaturesResponseObject or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.FeaturesResponseObject - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if skip is not None: - query_parameters['skip'] = self._serialize.query("skip", skip, 'int', minimum=0) - if take is not None: - query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('FeaturesResponseObject', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list.metadata = {'url': '/apps/{appId}/versions/{versionId}/features'} - - def get_phrase_list( - self, app_id, version_id, phraselist_id, custom_headers=None, raw=False, **operation_config): - """Gets phraselist feature info in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param phraselist_id: The ID of the feature to be retrieved. - :type phraselist_id: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: PhraseListFeatureInfo or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.PhraseListFeatureInfo - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get_phrase_list.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'phraselistId': self._serialize.url("phraselist_id", phraselist_id, 'int') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('PhraseListFeatureInfo', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_phrase_list.metadata = {'url': '/apps/{appId}/versions/{versionId}/phraselists/{phraselistId}'} - - def update_phrase_list( - self, app_id, version_id, phraselist_id, phraselist_update_object=None, custom_headers=None, raw=False, **operation_config): - """Updates the phrases, the state and the name of the phraselist feature - in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param phraselist_id: The ID of the feature to be updated. - :type phraselist_id: int - :param phraselist_update_object: The new values for: - Just a boolean - called IsActive, in which case the status of the feature will be - changed. - Name, Pattern, Mode, and a boolean called IsActive to - update the feature. - :type phraselist_update_object: - ~azure.cognitiveservices.language.luis.authoring.models.PhraselistUpdateObject - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.update_phrase_list.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'phraselistId': self._serialize.url("phraselist_id", phraselist_id, 'int') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - if phraselist_update_object is not None: - body_content = self._serialize.body(phraselist_update_object, 'PhraselistUpdateObject') - else: - body_content = None - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update_phrase_list.metadata = {'url': '/apps/{appId}/versions/{versionId}/phraselists/{phraselistId}'} - - def delete_phrase_list( - self, app_id, version_id, phraselist_id, custom_headers=None, raw=False, **operation_config): - """Deletes a phraselist feature from a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param phraselist_id: The ID of the feature to be deleted. - :type phraselist_id: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete_phrase_list.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'phraselistId': self._serialize.url("phraselist_id", phraselist_id, 'int') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - delete_phrase_list.metadata = {'url': '/apps/{appId}/versions/{versionId}/phraselists/{phraselistId}'} - - def add_intent_feature( - self, app_id, version_id, intent_id, feature_relation_create_object, custom_headers=None, raw=False, **operation_config): - """Adds a new feature relation to be used by the intent in a version of - the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param intent_id: The intent classifier ID. - :type intent_id: str - :param feature_relation_create_object: A Feature relation information - object. - :type feature_relation_create_object: - ~azure.cognitiveservices.language.luis.authoring.models.ModelFeatureInformation - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.add_intent_feature.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'intentId': self._serialize.url("intent_id", intent_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(feature_relation_create_object, 'ModelFeatureInformation') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - add_intent_feature.metadata = {'url': '/apps/{appId}/versions/{versionId}/intents/{intentId}/features'} - - def add_entity_feature( - self, app_id, version_id, entity_id, feature_relation_create_object, custom_headers=None, raw=False, **operation_config): - """Adds a new feature relation to be used by the entity in a version of - the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: The entity extractor ID. - :type entity_id: str - :param feature_relation_create_object: A Feature relation information - object. - :type feature_relation_create_object: - ~azure.cognitiveservices.language.luis.authoring.models.ModelFeatureInformation - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.add_entity_feature.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(feature_relation_create_object, 'ModelFeatureInformation') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - add_entity_feature.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities/{entityId}/features'} diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_model_operations.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_model_operations.py deleted file mode 100644 index 3cb9ff0f420..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_model_operations.py +++ /dev/null @@ -1,7086 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class ModelOperations(object): - """ModelOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - - self.config = config - - def add_intent( - self, app_id, version_id, name=None, custom_headers=None, raw=False, **operation_config): - """Adds an intent to a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param name: Name of the new entity extractor. - :type name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: str or ClientRawResponse if raw=true - :rtype: str or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - intent_create_object = models.ModelCreateObject(name=name) - - # Construct URL - url = self.add_intent.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(intent_create_object, 'ModelCreateObject') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 201: - deserialized = self._deserialize('str', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - add_intent.metadata = {'url': '/apps/{appId}/versions/{versionId}/intents'} - - def list_intents( - self, app_id, version_id, skip=0, take=100, custom_headers=None, raw=False, **operation_config): - """Gets information about the intent models in a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param skip: The number of entries to skip. Default value is 0. - :type skip: int - :param take: The number of entries to return. Maximum page size is - 500. Default is 100. - :type take: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.IntentClassifier] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list_intents.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if skip is not None: - query_parameters['skip'] = self._serialize.query("skip", skip, 'int', minimum=0) - if take is not None: - query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[IntentClassifier]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_intents.metadata = {'url': '/apps/{appId}/versions/{versionId}/intents'} - - def add_entity( - self, app_id, version_id, children=None, name=None, custom_headers=None, raw=False, **operation_config): - """Adds an entity extractor to a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param children: Child entities. - :type children: - list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntityModelCreateObject] - :param name: Entity name. - :type name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: str or ClientRawResponse if raw=true - :rtype: str or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - entity_model_create_object = models.EntityModelCreateObject(children=children, name=name) - - # Construct URL - url = self.add_entity.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(entity_model_create_object, 'EntityModelCreateObject') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 201: - deserialized = self._deserialize('str', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - add_entity.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities'} - - def list_entities( - self, app_id, version_id, skip=0, take=100, custom_headers=None, raw=False, **operation_config): - """Gets information about all the simple entity models in a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param skip: The number of entries to skip. Default value is 0. - :type skip: int - :param take: The number of entries to return. Maximum page size is - 500. Default is 100. - :type take: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.NDepthEntityExtractor] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list_entities.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if skip is not None: - query_parameters['skip'] = self._serialize.query("skip", skip, 'int', minimum=0) - if take is not None: - query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[NDepthEntityExtractor]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_entities.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities'} - - def list_hierarchical_entities( - self, app_id, version_id, skip=0, take=100, custom_headers=None, raw=False, **operation_config): - """Gets information about all the hierarchical entity models in a version - of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param skip: The number of entries to skip. Default value is 0. - :type skip: int - :param take: The number of entries to return. Maximum page size is - 500. Default is 100. - :type take: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.HierarchicalEntityExtractor] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list_hierarchical_entities.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if skip is not None: - query_parameters['skip'] = self._serialize.query("skip", skip, 'int', minimum=0) - if take is not None: - query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[HierarchicalEntityExtractor]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_hierarchical_entities.metadata = {'url': '/apps/{appId}/versions/{versionId}/hierarchicalentities'} - - def list_composite_entities( - self, app_id, version_id, skip=0, take=100, custom_headers=None, raw=False, **operation_config): - """Gets information about all the composite entity models in a version of - the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param skip: The number of entries to skip. Default value is 0. - :type skip: int - :param take: The number of entries to return. Maximum page size is - 500. Default is 100. - :type take: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.CompositeEntityExtractor] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list_composite_entities.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if skip is not None: - query_parameters['skip'] = self._serialize.query("skip", skip, 'int', minimum=0) - if take is not None: - query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[CompositeEntityExtractor]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_composite_entities.metadata = {'url': '/apps/{appId}/versions/{versionId}/compositeentities'} - - def list_closed_lists( - self, app_id, version_id, skip=0, take=100, custom_headers=None, raw=False, **operation_config): - """Gets information about all the list entity models in a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param skip: The number of entries to skip. Default value is 0. - :type skip: int - :param take: The number of entries to return. Maximum page size is - 500. Default is 100. - :type take: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.ClosedListEntityExtractor] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list_closed_lists.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if skip is not None: - query_parameters['skip'] = self._serialize.query("skip", skip, 'int', minimum=0) - if take is not None: - query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[ClosedListEntityExtractor]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_closed_lists.metadata = {'url': '/apps/{appId}/versions/{versionId}/closedlists'} - - def add_closed_list( - self, app_id, version_id, sub_lists=None, name=None, custom_headers=None, raw=False, **operation_config): - """Adds a list entity model to a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param sub_lists: Sublists for the feature. - :type sub_lists: - list[~azure.cognitiveservices.language.luis.authoring.models.WordListObject] - :param name: Name of the list entity. - :type name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: str or ClientRawResponse if raw=true - :rtype: str or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - closed_list_model_create_object = models.ClosedListModelCreateObject(sub_lists=sub_lists, name=name) - - # Construct URL - url = self.add_closed_list.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(closed_list_model_create_object, 'ClosedListModelCreateObject') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 201: - deserialized = self._deserialize('str', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - add_closed_list.metadata = {'url': '/apps/{appId}/versions/{versionId}/closedlists'} - - def add_prebuilt( - self, app_id, version_id, prebuilt_extractor_names, custom_headers=None, raw=False, **operation_config): - """Adds a list of prebuilt entities to a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param prebuilt_extractor_names: An array of prebuilt entity extractor - names. - :type prebuilt_extractor_names: list[str] - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.PrebuiltEntityExtractor] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.add_prebuilt.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(prebuilt_extractor_names, '[str]') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 201: - deserialized = self._deserialize('[PrebuiltEntityExtractor]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - add_prebuilt.metadata = {'url': '/apps/{appId}/versions/{versionId}/prebuilts'} - - def list_prebuilts( - self, app_id, version_id, skip=0, take=100, custom_headers=None, raw=False, **operation_config): - """Gets information about all the prebuilt entities in a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param skip: The number of entries to skip. Default value is 0. - :type skip: int - :param take: The number of entries to return. Maximum page size is - 500. Default is 100. - :type take: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.PrebuiltEntityExtractor] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list_prebuilts.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if skip is not None: - query_parameters['skip'] = self._serialize.query("skip", skip, 'int', minimum=0) - if take is not None: - query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[PrebuiltEntityExtractor]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_prebuilts.metadata = {'url': '/apps/{appId}/versions/{versionId}/prebuilts'} - - def list_prebuilt_entities( - self, app_id, version_id, custom_headers=None, raw=False, **operation_config): - """Gets all the available prebuilt entities in a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.AvailablePrebuiltEntityModel] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list_prebuilt_entities.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[AvailablePrebuiltEntityModel]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_prebuilt_entities.metadata = {'url': '/apps/{appId}/versions/{versionId}/listprebuilts'} - - def list_models( - self, app_id, version_id, skip=0, take=100, custom_headers=None, raw=False, **operation_config): - """Gets information about all the intent and entity models in a version of - the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param skip: The number of entries to skip. Default value is 0. - :type skip: int - :param take: The number of entries to return. Maximum page size is - 500. Default is 100. - :type take: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.ModelInfoResponse] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list_models.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if skip is not None: - query_parameters['skip'] = self._serialize.query("skip", skip, 'int', minimum=0) - if take is not None: - query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[ModelInfoResponse]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_models.metadata = {'url': '/apps/{appId}/versions/{versionId}/models'} - - def examples_method( - self, app_id, version_id, model_id, skip=0, take=100, custom_headers=None, raw=False, **operation_config): - """Gets the example utterances for the given intent or entity model in a - version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param model_id: The ID (GUID) of the model. - :type model_id: str - :param skip: The number of entries to skip. Default value is 0. - :type skip: int - :param take: The number of entries to return. Maximum page size is - 500. Default is 100. - :type take: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.LabelTextObject] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.examples_method.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'modelId': self._serialize.url("model_id", model_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if skip is not None: - query_parameters['skip'] = self._serialize.query("skip", skip, 'int', minimum=0) - if take is not None: - query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[LabelTextObject]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - examples_method.metadata = {'url': '/apps/{appId}/versions/{versionId}/models/{modelId}/examples'} - - def get_intent( - self, app_id, version_id, intent_id, custom_headers=None, raw=False, **operation_config): - """Gets information about the intent model in a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param intent_id: The intent classifier ID. - :type intent_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: IntentClassifier or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.IntentClassifier - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get_intent.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'intentId': self._serialize.url("intent_id", intent_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('IntentClassifier', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_intent.metadata = {'url': '/apps/{appId}/versions/{versionId}/intents/{intentId}'} - - def update_intent( - self, app_id, version_id, intent_id, name=None, custom_headers=None, raw=False, **operation_config): - """Updates the name of an intent in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param intent_id: The intent classifier ID. - :type intent_id: str - :param name: The entity's new name. - :type name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - model_update_object = models.ModelUpdateObject(name=name) - - # Construct URL - url = self.update_intent.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'intentId': self._serialize.url("intent_id", intent_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(model_update_object, 'ModelUpdateObject') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update_intent.metadata = {'url': '/apps/{appId}/versions/{versionId}/intents/{intentId}'} - - def delete_intent( - self, app_id, version_id, intent_id, delete_utterances=False, custom_headers=None, raw=False, **operation_config): - """Deletes an intent from a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param intent_id: The intent classifier ID. - :type intent_id: str - :param delete_utterances: If true, deletes the intent's example - utterances. If false, moves the example utterances to the None intent. - The default value is false. - :type delete_utterances: bool - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete_intent.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'intentId': self._serialize.url("intent_id", intent_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if delete_utterances is not None: - query_parameters['deleteUtterances'] = self._serialize.query("delete_utterances", delete_utterances, 'bool') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - delete_intent.metadata = {'url': '/apps/{appId}/versions/{versionId}/intents/{intentId}'} - - def get_entity( - self, app_id, version_id, entity_id, custom_headers=None, raw=False, **operation_config): - """Gets information about an entity model in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: The entity extractor ID. - :type entity_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: NDepthEntityExtractor or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.NDepthEntityExtractor - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get_entity.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('NDepthEntityExtractor', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_entity.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities/{entityId}'} - - def delete_entity( - self, app_id, version_id, entity_id, custom_headers=None, raw=False, **operation_config): - """Deletes an entity or a child from a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: The entity extractor or the child entity extractor - ID. - :type entity_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete_entity.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - delete_entity.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities/{entityId}'} - - def update_entity_child( - self, app_id, version_id, entity_id, name=None, instance_of=None, custom_headers=None, raw=False, **operation_config): - """Updates the name of an entity extractor or the name and instanceOf - model of a child entity extractor. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: The entity extractor or the child entity extractor - ID. - :type entity_id: str - :param name: Entity name. - :type name: str - :param instance_of: The instance of model name - :type instance_of: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - entity_model_update_object = models.EntityModelUpdateObject(name=name, instance_of=instance_of) - - # Construct URL - url = self.update_entity_child.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(entity_model_update_object, 'EntityModelUpdateObject') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update_entity_child.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities/{entityId}'} - - def get_intent_features( - self, app_id, version_id, intent_id, custom_headers=None, raw=False, **operation_config): - """Gets the information of the features used by the intent in a version of - the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param intent_id: The intent classifier ID. - :type intent_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.ModelFeatureInformation] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get_intent_features.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'intentId': self._serialize.url("intent_id", intent_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[ModelFeatureInformation]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_intent_features.metadata = {'url': '/apps/{appId}/versions/{versionId}/intents/{intentId}/features'} - - def replace_intent_features( - self, app_id, version_id, intent_id, feature_relations_update_object, custom_headers=None, raw=False, **operation_config): - """Updates the information of the features used by the intent in a version - of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param intent_id: The intent classifier ID. - :type intent_id: str - :param feature_relations_update_object: A list of feature information - objects containing the new feature relations. - :type feature_relations_update_object: - list[~azure.cognitiveservices.language.luis.authoring.models.ModelFeatureInformation] - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.replace_intent_features.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'intentId': self._serialize.url("intent_id", intent_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(feature_relations_update_object, '[ModelFeatureInformation]') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - replace_intent_features.metadata = {'url': '/apps/{appId}/versions/{versionId}/intents/{intentId}/features'} - - def delete_intent_feature( - self, app_id, version_id, intent_id, feature_relation_delete_object, custom_headers=None, raw=False, **operation_config): - """Deletes a relation from the feature relations used by the intent in a - version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param intent_id: The intent classifier ID. - :type intent_id: str - :param feature_relation_delete_object: A feature information object - containing the feature relation to delete. - :type feature_relation_delete_object: - ~azure.cognitiveservices.language.luis.authoring.models.ModelFeatureInformation - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete_intent_feature.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'intentId': self._serialize.url("intent_id", intent_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(feature_relation_delete_object, 'ModelFeatureInformation') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - delete_intent_feature.metadata = {'url': '/apps/{appId}/versions/{versionId}/intents/{intentId}/features'} - - def get_entity_features( - self, app_id, version_id, entity_id, custom_headers=None, raw=False, **operation_config): - """Gets the information of the features used by the entity in a version of - the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: The entity extractor ID. - :type entity_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.ModelFeatureInformation] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get_entity_features.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[ModelFeatureInformation]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_entity_features.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities/{entityId}/features'} - - def replace_entity_features( - self, app_id, version_id, entity_id, feature_relations_update_object, custom_headers=None, raw=False, **operation_config): - """Updates the information of the features used by the entity in a version - of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: The entity extractor ID. - :type entity_id: str - :param feature_relations_update_object: A list of feature information - objects containing the new feature relations. - :type feature_relations_update_object: - list[~azure.cognitiveservices.language.luis.authoring.models.ModelFeatureInformation] - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.replace_entity_features.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(feature_relations_update_object, '[ModelFeatureInformation]') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - replace_entity_features.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities/{entityId}/features'} - - def delete_entity_feature( - self, app_id, version_id, entity_id, feature_relation_delete_object, custom_headers=None, raw=False, **operation_config): - """Deletes a relation from the feature relations used by the entity in a - version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: The entity extractor ID. - :type entity_id: str - :param feature_relation_delete_object: A feature information object - containing the feature relation to delete. - :type feature_relation_delete_object: - ~azure.cognitiveservices.language.luis.authoring.models.ModelFeatureInformation - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete_entity_feature.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(feature_relation_delete_object, 'ModelFeatureInformation') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - delete_entity_feature.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities/{entityId}/features'} - - def get_hierarchical_entity( - self, app_id, version_id, h_entity_id, custom_headers=None, raw=False, **operation_config): - """Gets information about a hierarchical entity in a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param h_entity_id: The hierarchical entity extractor ID. - :type h_entity_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: HierarchicalEntityExtractor or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.HierarchicalEntityExtractor - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get_hierarchical_entity.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'hEntityId': self._serialize.url("h_entity_id", h_entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('HierarchicalEntityExtractor', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_hierarchical_entity.metadata = {'url': '/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}'} - - def update_hierarchical_entity( - self, app_id, version_id, h_entity_id, name=None, custom_headers=None, raw=False, **operation_config): - """Updates the name of a hierarchical entity model in a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param h_entity_id: The hierarchical entity extractor ID. - :type h_entity_id: str - :param name: The entity's new name. - :type name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - model_update_object = models.ModelUpdateObject(name=name) - - # Construct URL - url = self.update_hierarchical_entity.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'hEntityId': self._serialize.url("h_entity_id", h_entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(model_update_object, 'ModelUpdateObject') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update_hierarchical_entity.metadata = {'url': '/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}'} - - def delete_hierarchical_entity( - self, app_id, version_id, h_entity_id, custom_headers=None, raw=False, **operation_config): - """Deletes a hierarchical entity from a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param h_entity_id: The hierarchical entity extractor ID. - :type h_entity_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete_hierarchical_entity.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'hEntityId': self._serialize.url("h_entity_id", h_entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - delete_hierarchical_entity.metadata = {'url': '/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}'} - - def get_composite_entity( - self, app_id, version_id, c_entity_id, custom_headers=None, raw=False, **operation_config): - """Gets information about a composite entity in a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param c_entity_id: The composite entity extractor ID. - :type c_entity_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: CompositeEntityExtractor or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.CompositeEntityExtractor - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get_composite_entity.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'cEntityId': self._serialize.url("c_entity_id", c_entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('CompositeEntityExtractor', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_composite_entity.metadata = {'url': '/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}'} - - def update_composite_entity( - self, app_id, version_id, c_entity_id, children=None, name=None, custom_headers=None, raw=False, **operation_config): - """Updates a composite entity in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param c_entity_id: The composite entity extractor ID. - :type c_entity_id: str - :param children: Child entities. - :type children: list[str] - :param name: Entity name. - :type name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - composite_model_update_object = models.CompositeEntityModel(children=children, name=name) - - # Construct URL - url = self.update_composite_entity.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'cEntityId': self._serialize.url("c_entity_id", c_entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(composite_model_update_object, 'CompositeEntityModel') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update_composite_entity.metadata = {'url': '/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}'} - - def delete_composite_entity( - self, app_id, version_id, c_entity_id, custom_headers=None, raw=False, **operation_config): - """Deletes a composite entity from a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param c_entity_id: The composite entity extractor ID. - :type c_entity_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete_composite_entity.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'cEntityId': self._serialize.url("c_entity_id", c_entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - delete_composite_entity.metadata = {'url': '/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}'} - - def get_closed_list( - self, app_id, version_id, cl_entity_id, custom_headers=None, raw=False, **operation_config): - """Gets information about a list entity in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param cl_entity_id: The list model ID. - :type cl_entity_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ClosedListEntityExtractor or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.ClosedListEntityExtractor - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get_closed_list.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'clEntityId': self._serialize.url("cl_entity_id", cl_entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('ClosedListEntityExtractor', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_closed_list.metadata = {'url': '/apps/{appId}/versions/{versionId}/closedlists/{clEntityId}'} - - def update_closed_list( - self, app_id, version_id, cl_entity_id, sub_lists=None, name=None, custom_headers=None, raw=False, **operation_config): - """Updates the list entity in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param cl_entity_id: The list model ID. - :type cl_entity_id: str - :param sub_lists: The new sublists for the feature. - :type sub_lists: - list[~azure.cognitiveservices.language.luis.authoring.models.WordListObject] - :param name: The new name of the list entity. - :type name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - closed_list_model_update_object = models.ClosedListModelUpdateObject(sub_lists=sub_lists, name=name) - - # Construct URL - url = self.update_closed_list.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'clEntityId': self._serialize.url("cl_entity_id", cl_entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(closed_list_model_update_object, 'ClosedListModelUpdateObject') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update_closed_list.metadata = {'url': '/apps/{appId}/versions/{versionId}/closedlists/{clEntityId}'} - - def patch_closed_list( - self, app_id, version_id, cl_entity_id, sub_lists=None, custom_headers=None, raw=False, **operation_config): - """Adds a batch of sublists to an existing list entity in a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param cl_entity_id: The list entity model ID. - :type cl_entity_id: str - :param sub_lists: Sublists to add. - :type sub_lists: - list[~azure.cognitiveservices.language.luis.authoring.models.WordListObject] - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - closed_list_model_patch_object = models.ClosedListModelPatchObject(sub_lists=sub_lists) - - # Construct URL - url = self.patch_closed_list.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'clEntityId': self._serialize.url("cl_entity_id", cl_entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(closed_list_model_patch_object, 'ClosedListModelPatchObject') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - patch_closed_list.metadata = {'url': '/apps/{appId}/versions/{versionId}/closedlists/{clEntityId}'} - - def delete_closed_list( - self, app_id, version_id, cl_entity_id, custom_headers=None, raw=False, **operation_config): - """Deletes a list entity model from a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param cl_entity_id: The list entity model ID. - :type cl_entity_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete_closed_list.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'clEntityId': self._serialize.url("cl_entity_id", cl_entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - delete_closed_list.metadata = {'url': '/apps/{appId}/versions/{versionId}/closedlists/{clEntityId}'} - - def get_prebuilt( - self, app_id, version_id, prebuilt_id, custom_headers=None, raw=False, **operation_config): - """Gets information about a prebuilt entity model in a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param prebuilt_id: The prebuilt entity extractor ID. - :type prebuilt_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: PrebuiltEntityExtractor or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.PrebuiltEntityExtractor - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get_prebuilt.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'prebuiltId': self._serialize.url("prebuilt_id", prebuilt_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('PrebuiltEntityExtractor', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_prebuilt.metadata = {'url': '/apps/{appId}/versions/{versionId}/prebuilts/{prebuiltId}'} - - def delete_prebuilt( - self, app_id, version_id, prebuilt_id, custom_headers=None, raw=False, **operation_config): - """Deletes a prebuilt entity extractor from a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param prebuilt_id: The prebuilt entity extractor ID. - :type prebuilt_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete_prebuilt.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'prebuiltId': self._serialize.url("prebuilt_id", prebuilt_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - delete_prebuilt.metadata = {'url': '/apps/{appId}/versions/{versionId}/prebuilts/{prebuiltId}'} - - def delete_sub_list( - self, app_id, version_id, cl_entity_id, sub_list_id, custom_headers=None, raw=False, **operation_config): - """Deletes a sublist of a specific list entity model from a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param cl_entity_id: The list entity extractor ID. - :type cl_entity_id: str - :param sub_list_id: The sublist ID. - :type sub_list_id: long - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete_sub_list.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'clEntityId': self._serialize.url("cl_entity_id", cl_entity_id, 'str'), - 'subListId': self._serialize.url("sub_list_id", sub_list_id, 'long') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - delete_sub_list.metadata = {'url': '/apps/{appId}/versions/{versionId}/closedlists/{clEntityId}/sublists/{subListId}'} - - def update_sub_list( - self, app_id, version_id, cl_entity_id, sub_list_id, canonical_form=None, list=None, custom_headers=None, raw=False, **operation_config): - """Updates one of the list entity's sublists in a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param cl_entity_id: The list entity extractor ID. - :type cl_entity_id: str - :param sub_list_id: The sublist ID. - :type sub_list_id: long - :param canonical_form: The standard form that the list represents. - :type canonical_form: str - :param list: List of synonym words. - :type list: list[str] - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - word_list_base_update_object = models.WordListBaseUpdateObject(canonical_form=canonical_form, list=list) - - # Construct URL - url = self.update_sub_list.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'clEntityId': self._serialize.url("cl_entity_id", cl_entity_id, 'str'), - 'subListId': self._serialize.url("sub_list_id", sub_list_id, 'long') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(word_list_base_update_object, 'WordListBaseUpdateObject') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update_sub_list.metadata = {'url': '/apps/{appId}/versions/{versionId}/closedlists/{clEntityId}/sublists/{subListId}'} - - def list_intent_suggestions( - self, app_id, version_id, intent_id, take=100, enable_nested_children=False, custom_headers=None, raw=False, **operation_config): - """Suggests example utterances that would improve the accuracy of the - intent model in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param intent_id: The intent classifier ID. - :type intent_id: str - :param take: The number of entries to return. Maximum page size is - 500. Default is 100. - :type take: int - :param enable_nested_children: Toggles nested/flat format - :type enable_nested_children: bool - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.IntentsSuggestionExample] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list_intent_suggestions.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'intentId': self._serialize.url("intent_id", intent_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if take is not None: - query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0) - if enable_nested_children is not None: - query_parameters['enableNestedChildren'] = self._serialize.query("enable_nested_children", enable_nested_children, 'bool') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[IntentsSuggestionExample]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_intent_suggestions.metadata = {'url': '/apps/{appId}/versions/{versionId}/intents/{intentId}/suggest'} - - def list_entity_suggestions( - self, app_id, version_id, entity_id, take=100, enable_nested_children=False, custom_headers=None, raw=False, **operation_config): - """Get suggested example utterances that would improve the accuracy of the - entity model in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: The target entity extractor model to enhance. - :type entity_id: str - :param take: The number of entries to return. Maximum page size is - 500. Default is 100. - :type take: int - :param enable_nested_children: Toggles nested/flat format - :type enable_nested_children: bool - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.EntitiesSuggestionExample] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list_entity_suggestions.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if take is not None: - query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0) - if enable_nested_children is not None: - query_parameters['enableNestedChildren'] = self._serialize.query("enable_nested_children", enable_nested_children, 'bool') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[EntitiesSuggestionExample]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_entity_suggestions.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities/{entityId}/suggest'} - - def add_sub_list( - self, app_id, version_id, cl_entity_id, canonical_form=None, list=None, custom_headers=None, raw=False, **operation_config): - """Adds a sublist to an existing list entity in a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param cl_entity_id: The list entity extractor ID. - :type cl_entity_id: str - :param canonical_form: The standard form that the list represents. - :type canonical_form: str - :param list: List of synonym words. - :type list: list[str] - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: long or ClientRawResponse if raw=true - :rtype: long or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - word_list_create_object = models.WordListObject(canonical_form=canonical_form, list=list) - - # Construct URL - url = self.add_sub_list.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'clEntityId': self._serialize.url("cl_entity_id", cl_entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(word_list_create_object, 'WordListObject') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 201: - deserialized = self._deserialize('long', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - add_sub_list.metadata = {'url': '/apps/{appId}/versions/{versionId}/closedlists/{clEntityId}/sublists'} - - def add_custom_prebuilt_domain( - self, app_id, version_id, domain_name=None, custom_headers=None, raw=False, **operation_config): - """Adds a customizable prebuilt domain along with all of its intent and - entity models in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param domain_name: The domain name. - :type domain_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: list[str] or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - prebuilt_domain_object = models.PrebuiltDomainCreateBaseObject(domain_name=domain_name) - - # Construct URL - url = self.add_custom_prebuilt_domain.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(prebuilt_domain_object, 'PrebuiltDomainCreateBaseObject') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 201: - deserialized = self._deserialize('[str]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - add_custom_prebuilt_domain.metadata = {'url': '/apps/{appId}/versions/{versionId}/customprebuiltdomains'} - - def add_custom_prebuilt_intent( - self, app_id, version_id, domain_name=None, model_name=None, custom_headers=None, raw=False, **operation_config): - """Adds a customizable prebuilt intent model to a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param domain_name: The domain name. - :type domain_name: str - :param model_name: The intent name or entity name. - :type model_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: str or ClientRawResponse if raw=true - :rtype: str or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - prebuilt_domain_model_create_object = models.PrebuiltDomainModelCreateObject(domain_name=domain_name, model_name=model_name) - - # Construct URL - url = self.add_custom_prebuilt_intent.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(prebuilt_domain_model_create_object, 'PrebuiltDomainModelCreateObject') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 201: - deserialized = self._deserialize('str', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - add_custom_prebuilt_intent.metadata = {'url': '/apps/{appId}/versions/{versionId}/customprebuiltintents'} - - def list_custom_prebuilt_intents( - self, app_id, version_id, custom_headers=None, raw=False, **operation_config): - """Gets information about customizable prebuilt intents added to a version - of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.IntentClassifier] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list_custom_prebuilt_intents.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[IntentClassifier]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_custom_prebuilt_intents.metadata = {'url': '/apps/{appId}/versions/{versionId}/customprebuiltintents'} - - def add_custom_prebuilt_entity( - self, app_id, version_id, domain_name=None, model_name=None, custom_headers=None, raw=False, **operation_config): - """Adds a prebuilt entity model to a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param domain_name: The domain name. - :type domain_name: str - :param model_name: The intent name or entity name. - :type model_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: str or ClientRawResponse if raw=true - :rtype: str or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - prebuilt_domain_model_create_object = models.PrebuiltDomainModelCreateObject(domain_name=domain_name, model_name=model_name) - - # Construct URL - url = self.add_custom_prebuilt_entity.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(prebuilt_domain_model_create_object, 'PrebuiltDomainModelCreateObject') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 201: - deserialized = self._deserialize('str', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - add_custom_prebuilt_entity.metadata = {'url': '/apps/{appId}/versions/{versionId}/customprebuiltentities'} - - def list_custom_prebuilt_entities( - self, app_id, version_id, custom_headers=None, raw=False, **operation_config): - """Gets all prebuilt entities used in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityExtractor] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list_custom_prebuilt_entities.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[EntityExtractor]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_custom_prebuilt_entities.metadata = {'url': '/apps/{appId}/versions/{versionId}/customprebuiltentities'} - - def list_custom_prebuilt_models( - self, app_id, version_id, custom_headers=None, raw=False, **operation_config): - """Gets all prebuilt intent and entity model information used in a version - of this application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.CustomPrebuiltModel] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list_custom_prebuilt_models.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[CustomPrebuiltModel]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_custom_prebuilt_models.metadata = {'url': '/apps/{appId}/versions/{versionId}/customprebuiltmodels'} - - def delete_custom_prebuilt_domain( - self, app_id, version_id, domain_name, custom_headers=None, raw=False, **operation_config): - """Deletes a prebuilt domain's models in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param domain_name: Domain name. - :type domain_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete_custom_prebuilt_domain.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'domainName': self._serialize.url("domain_name", domain_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - delete_custom_prebuilt_domain.metadata = {'url': '/apps/{appId}/versions/{versionId}/customprebuiltdomains/{domainName}'} - - def add_entity_child( - self, app_id, version_id, entity_id, child_entity_model_create_object, custom_headers=None, raw=False, **operation_config): - """Creates a single child in an existing entity model hierarchy in a - version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: The entity extractor ID. - :type entity_id: str - :param child_entity_model_create_object: A model object containing the - name of the new child model and its children. - :type child_entity_model_create_object: - ~azure.cognitiveservices.language.luis.authoring.models.ChildEntityModelCreateObject - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: str or ClientRawResponse if raw=true - :rtype: str or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.add_entity_child.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(child_entity_model_create_object, 'ChildEntityModelCreateObject') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 201: - deserialized = self._deserialize('str', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - add_entity_child.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities/{entityId}/children'} - - def get_hierarchical_entity_child( - self, app_id, version_id, h_entity_id, h_child_id, custom_headers=None, raw=False, **operation_config): - """Gets information about the child's model contained in an hierarchical - entity child model in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param h_entity_id: The hierarchical entity extractor ID. - :type h_entity_id: str - :param h_child_id: The hierarchical entity extractor child ID. - :type h_child_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: HierarchicalChildEntity or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.HierarchicalChildEntity - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get_hierarchical_entity_child.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'hEntityId': self._serialize.url("h_entity_id", h_entity_id, 'str'), - 'hChildId': self._serialize.url("h_child_id", h_child_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('HierarchicalChildEntity', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_hierarchical_entity_child.metadata = {'url': '/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/children/{hChildId}'} - - def update_hierarchical_entity_child( - self, app_id, version_id, h_entity_id, h_child_id, name=None, custom_headers=None, raw=False, **operation_config): - """Renames a single child in an existing hierarchical entity model in a - version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param h_entity_id: The hierarchical entity extractor ID. - :type h_entity_id: str - :param h_child_id: The hierarchical entity extractor child ID. - :type h_child_id: str - :param name: - :type name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - hierarchical_child_model_update_object = models.HierarchicalChildModelUpdateObject(name=name) - - # Construct URL - url = self.update_hierarchical_entity_child.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'hEntityId': self._serialize.url("h_entity_id", h_entity_id, 'str'), - 'hChildId': self._serialize.url("h_child_id", h_child_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(hierarchical_child_model_update_object, 'HierarchicalChildModelUpdateObject') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update_hierarchical_entity_child.metadata = {'url': '/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/children/{hChildId}'} - - def delete_hierarchical_entity_child( - self, app_id, version_id, h_entity_id, h_child_id, custom_headers=None, raw=False, **operation_config): - """Deletes a hierarchical entity extractor child in a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param h_entity_id: The hierarchical entity extractor ID. - :type h_entity_id: str - :param h_child_id: The hierarchical entity extractor child ID. - :type h_child_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete_hierarchical_entity_child.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'hEntityId': self._serialize.url("h_entity_id", h_entity_id, 'str'), - 'hChildId': self._serialize.url("h_child_id", h_child_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - delete_hierarchical_entity_child.metadata = {'url': '/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/children/{hChildId}'} - - def add_composite_entity_child( - self, app_id, version_id, c_entity_id, name=None, custom_headers=None, raw=False, **operation_config): - """Creates a single child in an existing composite entity model in a - version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param c_entity_id: The composite entity extractor ID. - :type c_entity_id: str - :param name: - :type name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: str or ClientRawResponse if raw=true - :rtype: str or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - composite_child_model_create_object = models.CompositeChildModelCreateObject(name=name) - - # Construct URL - url = self.add_composite_entity_child.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'cEntityId': self._serialize.url("c_entity_id", c_entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(composite_child_model_create_object, 'CompositeChildModelCreateObject') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 201: - deserialized = self._deserialize('str', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - add_composite_entity_child.metadata = {'url': '/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/children'} - - def delete_composite_entity_child( - self, app_id, version_id, c_entity_id, c_child_id, custom_headers=None, raw=False, **operation_config): - """Deletes a composite entity extractor child from a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param c_entity_id: The composite entity extractor ID. - :type c_entity_id: str - :param c_child_id: The hierarchical entity extractor child ID. - :type c_child_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete_composite_entity_child.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'cEntityId': self._serialize.url("c_entity_id", c_entity_id, 'str'), - 'cChildId': self._serialize.url("c_child_id", c_child_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - delete_composite_entity_child.metadata = {'url': '/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/children/{cChildId}'} - - def list_regex_entity_infos( - self, app_id, version_id, skip=0, take=100, custom_headers=None, raw=False, **operation_config): - """Gets information about the regular expression entity models in a - version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param skip: The number of entries to skip. Default value is 0. - :type skip: int - :param take: The number of entries to return. Maximum page size is - 500. Default is 100. - :type take: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.RegexEntityExtractor] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list_regex_entity_infos.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if skip is not None: - query_parameters['skip'] = self._serialize.query("skip", skip, 'int', minimum=0) - if take is not None: - query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[RegexEntityExtractor]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_regex_entity_infos.metadata = {'url': '/apps/{appId}/versions/{versionId}/regexentities'} - - def create_regex_entity_model( - self, app_id, version_id, regex_pattern=None, name=None, custom_headers=None, raw=False, **operation_config): - """Adds a regular expression entity model to a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param regex_pattern: The regular expression entity pattern. - :type regex_pattern: str - :param name: The model name. - :type name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: str or ClientRawResponse if raw=true - :rtype: str or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - regex_entity_extractor_create_obj = models.RegexModelCreateObject(regex_pattern=regex_pattern, name=name) - - # Construct URL - url = self.create_regex_entity_model.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(regex_entity_extractor_create_obj, 'RegexModelCreateObject') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 201: - deserialized = self._deserialize('str', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create_regex_entity_model.metadata = {'url': '/apps/{appId}/versions/{versionId}/regexentities'} - - def list_pattern_any_entity_infos( - self, app_id, version_id, skip=0, take=100, custom_headers=None, raw=False, **operation_config): - """Get information about the Pattern.Any entity models in a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param skip: The number of entries to skip. Default value is 0. - :type skip: int - :param take: The number of entries to return. Maximum page size is - 500. Default is 100. - :type take: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.PatternAnyEntityExtractor] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list_pattern_any_entity_infos.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if skip is not None: - query_parameters['skip'] = self._serialize.query("skip", skip, 'int', minimum=0) - if take is not None: - query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[PatternAnyEntityExtractor]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_pattern_any_entity_infos.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities'} - - def create_pattern_any_entity_model( - self, app_id, version_id, name=None, explicit_list=None, custom_headers=None, raw=False, **operation_config): - """Adds a pattern.any entity extractor to a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param name: The model name. - :type name: str - :param explicit_list: The Pattern.Any explicit list. - :type explicit_list: list[str] - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: str or ClientRawResponse if raw=true - :rtype: str or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - extractor_create_object = models.PatternAnyModelCreateObject(name=name, explicit_list=explicit_list) - - # Construct URL - url = self.create_pattern_any_entity_model.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(extractor_create_object, 'PatternAnyModelCreateObject') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 201: - deserialized = self._deserialize('str', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create_pattern_any_entity_model.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities'} - - def list_entity_roles( - self, app_id, version_id, entity_id, custom_headers=None, raw=False, **operation_config): - """Get all roles for an entity in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: entity Id - :type entity_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list_entity_roles.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[EntityRole]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_entity_roles.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities/{entityId}/roles'} - - def create_entity_role( - self, app_id, version_id, entity_id, name=None, custom_headers=None, raw=False, **operation_config): - """Create an entity role in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: The entity model ID. - :type entity_id: str - :param name: The entity role name. - :type name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: str or ClientRawResponse if raw=true - :rtype: str or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - entity_role_create_object = models.EntityRoleCreateObject(name=name) - - # Construct URL - url = self.create_entity_role.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(entity_role_create_object, 'EntityRoleCreateObject') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 201: - deserialized = self._deserialize('str', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities/{entityId}/roles'} - - def list_prebuilt_entity_roles( - self, app_id, version_id, entity_id, custom_headers=None, raw=False, **operation_config): - """Get a prebuilt entity's roles in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: entity Id - :type entity_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list_prebuilt_entity_roles.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[EntityRole]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_prebuilt_entity_roles.metadata = {'url': '/apps/{appId}/versions/{versionId}/prebuilts/{entityId}/roles'} - - def create_prebuilt_entity_role( - self, app_id, version_id, entity_id, name=None, custom_headers=None, raw=False, **operation_config): - """Create a role for a prebuilt entity in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: The entity model ID. - :type entity_id: str - :param name: The entity role name. - :type name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: str or ClientRawResponse if raw=true - :rtype: str or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - entity_role_create_object = models.EntityRoleCreateObject(name=name) - - # Construct URL - url = self.create_prebuilt_entity_role.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(entity_role_create_object, 'EntityRoleCreateObject') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 201: - deserialized = self._deserialize('str', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create_prebuilt_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/prebuilts/{entityId}/roles'} - - def list_closed_list_entity_roles( - self, app_id, version_id, entity_id, custom_headers=None, raw=False, **operation_config): - """Get all roles for a list entity in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: entity Id - :type entity_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list_closed_list_entity_roles.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[EntityRole]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_closed_list_entity_roles.metadata = {'url': '/apps/{appId}/versions/{versionId}/closedlists/{entityId}/roles'} - - def create_closed_list_entity_role( - self, app_id, version_id, entity_id, name=None, custom_headers=None, raw=False, **operation_config): - """Create a role for a list entity in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: The entity model ID. - :type entity_id: str - :param name: The entity role name. - :type name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: str or ClientRawResponse if raw=true - :rtype: str or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - entity_role_create_object = models.EntityRoleCreateObject(name=name) - - # Construct URL - url = self.create_closed_list_entity_role.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(entity_role_create_object, 'EntityRoleCreateObject') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 201: - deserialized = self._deserialize('str', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create_closed_list_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/closedlists/{entityId}/roles'} - - def list_regex_entity_roles( - self, app_id, version_id, entity_id, custom_headers=None, raw=False, **operation_config): - """Get all roles for a regular expression entity in a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: entity Id - :type entity_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list_regex_entity_roles.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[EntityRole]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_regex_entity_roles.metadata = {'url': '/apps/{appId}/versions/{versionId}/regexentities/{entityId}/roles'} - - def create_regex_entity_role( - self, app_id, version_id, entity_id, name=None, custom_headers=None, raw=False, **operation_config): - """Create a role for an regular expression entity in a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: The entity model ID. - :type entity_id: str - :param name: The entity role name. - :type name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: str or ClientRawResponse if raw=true - :rtype: str or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - entity_role_create_object = models.EntityRoleCreateObject(name=name) - - # Construct URL - url = self.create_regex_entity_role.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(entity_role_create_object, 'EntityRoleCreateObject') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 201: - deserialized = self._deserialize('str', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create_regex_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/regexentities/{entityId}/roles'} - - def list_composite_entity_roles( - self, app_id, version_id, c_entity_id, custom_headers=None, raw=False, **operation_config): - """Get all roles for a composite entity in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param c_entity_id: The composite entity extractor ID. - :type c_entity_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list_composite_entity_roles.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'cEntityId': self._serialize.url("c_entity_id", c_entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[EntityRole]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_composite_entity_roles.metadata = {'url': '/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/roles'} - - def create_composite_entity_role( - self, app_id, version_id, c_entity_id, name=None, custom_headers=None, raw=False, **operation_config): - """Create a role for a composite entity in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param c_entity_id: The composite entity extractor ID. - :type c_entity_id: str - :param name: The entity role name. - :type name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: str or ClientRawResponse if raw=true - :rtype: str or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - entity_role_create_object = models.EntityRoleCreateObject(name=name) - - # Construct URL - url = self.create_composite_entity_role.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'cEntityId': self._serialize.url("c_entity_id", c_entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(entity_role_create_object, 'EntityRoleCreateObject') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 201: - deserialized = self._deserialize('str', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create_composite_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/roles'} - - def list_pattern_any_entity_roles( - self, app_id, version_id, entity_id, custom_headers=None, raw=False, **operation_config): - """Get all roles for a Pattern.any entity in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: entity Id - :type entity_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list_pattern_any_entity_roles.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[EntityRole]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_pattern_any_entity_roles.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/roles'} - - def create_pattern_any_entity_role( - self, app_id, version_id, entity_id, name=None, custom_headers=None, raw=False, **operation_config): - """Create a role for an Pattern.any entity in a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: The entity model ID. - :type entity_id: str - :param name: The entity role name. - :type name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: str or ClientRawResponse if raw=true - :rtype: str or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - entity_role_create_object = models.EntityRoleCreateObject(name=name) - - # Construct URL - url = self.create_pattern_any_entity_role.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(entity_role_create_object, 'EntityRoleCreateObject') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 201: - deserialized = self._deserialize('str', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create_pattern_any_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/roles'} - - def list_hierarchical_entity_roles( - self, app_id, version_id, h_entity_id, custom_headers=None, raw=False, **operation_config): - """Get all roles for a hierarchical entity in a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param h_entity_id: The hierarchical entity extractor ID. - :type h_entity_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list_hierarchical_entity_roles.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'hEntityId': self._serialize.url("h_entity_id", h_entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[EntityRole]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_hierarchical_entity_roles.metadata = {'url': '/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/roles'} - - def create_hierarchical_entity_role( - self, app_id, version_id, h_entity_id, name=None, custom_headers=None, raw=False, **operation_config): - """Create a role for an hierarchical entity in a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param h_entity_id: The hierarchical entity extractor ID. - :type h_entity_id: str - :param name: The entity role name. - :type name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: str or ClientRawResponse if raw=true - :rtype: str or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - entity_role_create_object = models.EntityRoleCreateObject(name=name) - - # Construct URL - url = self.create_hierarchical_entity_role.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'hEntityId': self._serialize.url("h_entity_id", h_entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(entity_role_create_object, 'EntityRoleCreateObject') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 201: - deserialized = self._deserialize('str', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create_hierarchical_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/roles'} - - def list_custom_prebuilt_entity_roles( - self, app_id, version_id, entity_id, custom_headers=None, raw=False, **operation_config): - """Get all roles for a prebuilt entity in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: entity Id - :type entity_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list_custom_prebuilt_entity_roles.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[EntityRole]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_custom_prebuilt_entity_roles.metadata = {'url': '/apps/{appId}/versions/{versionId}/customprebuiltentities/{entityId}/roles'} - - def create_custom_prebuilt_entity_role( - self, app_id, version_id, entity_id, name=None, custom_headers=None, raw=False, **operation_config): - """Create a role for a prebuilt entity in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: The entity model ID. - :type entity_id: str - :param name: The entity role name. - :type name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: str or ClientRawResponse if raw=true - :rtype: str or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - entity_role_create_object = models.EntityRoleCreateObject(name=name) - - # Construct URL - url = self.create_custom_prebuilt_entity_role.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(entity_role_create_object, 'EntityRoleCreateObject') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 201: - deserialized = self._deserialize('str', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create_custom_prebuilt_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/customprebuiltentities/{entityId}/roles'} - - def get_explicit_list( - self, app_id, version_id, entity_id, custom_headers=None, raw=False, **operation_config): - """Get the explicit (exception) list of the pattern.any entity in a - version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: The Pattern.Any entity id. - :type entity_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.ExplicitListItem] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get_explicit_list.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[ExplicitListItem]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_explicit_list.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/explicitlist'} - - def add_explicit_list_item( - self, app_id, version_id, entity_id, explicit_list_item=None, custom_headers=None, raw=False, **operation_config): - """Add a new exception to the explicit list for the Pattern.Any entity in - a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: The Pattern.Any entity extractor ID. - :type entity_id: str - :param explicit_list_item: The explicit list item. - :type explicit_list_item: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: int or ClientRawResponse if raw=true - :rtype: int or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - item = models.ExplicitListItemCreateObject(explicit_list_item=explicit_list_item) - - # Construct URL - url = self.add_explicit_list_item.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(item, 'ExplicitListItemCreateObject') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 201: - deserialized = self._deserialize('int', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - add_explicit_list_item.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/explicitlist'} - - def get_regex_entity_entity_info( - self, app_id, version_id, regex_entity_id, custom_headers=None, raw=False, **operation_config): - """Gets information about a regular expression entity in a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param regex_entity_id: The regular expression entity model ID. - :type regex_entity_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: RegexEntityExtractor or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.RegexEntityExtractor - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get_regex_entity_entity_info.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'regexEntityId': self._serialize.url("regex_entity_id", regex_entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('RegexEntityExtractor', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_regex_entity_entity_info.metadata = {'url': '/apps/{appId}/versions/{versionId}/regexentities/{regexEntityId}'} - - def update_regex_entity_model( - self, app_id, version_id, regex_entity_id, regex_pattern=None, name=None, custom_headers=None, raw=False, **operation_config): - """Updates the regular expression entity in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param regex_entity_id: The regular expression entity extractor ID. - :type regex_entity_id: str - :param regex_pattern: The regular expression entity pattern. - :type regex_pattern: str - :param name: The model name. - :type name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - regex_entity_update_object = models.RegexModelUpdateObject(regex_pattern=regex_pattern, name=name) - - # Construct URL - url = self.update_regex_entity_model.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'regexEntityId': self._serialize.url("regex_entity_id", regex_entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(regex_entity_update_object, 'RegexModelUpdateObject') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update_regex_entity_model.metadata = {'url': '/apps/{appId}/versions/{versionId}/regexentities/{regexEntityId}'} - - def delete_regex_entity_model( - self, app_id, version_id, regex_entity_id, custom_headers=None, raw=False, **operation_config): - """Deletes a regular expression entity from a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param regex_entity_id: The regular expression entity extractor ID. - :type regex_entity_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete_regex_entity_model.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'regexEntityId': self._serialize.url("regex_entity_id", regex_entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - delete_regex_entity_model.metadata = {'url': '/apps/{appId}/versions/{versionId}/regexentities/{regexEntityId}'} - - def get_pattern_any_entity_info( - self, app_id, version_id, entity_id, custom_headers=None, raw=False, **operation_config): - """Gets information about the Pattern.Any model in a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: The entity extractor ID. - :type entity_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: PatternAnyEntityExtractor or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.PatternAnyEntityExtractor - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get_pattern_any_entity_info.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('PatternAnyEntityExtractor', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_pattern_any_entity_info.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}'} - - def update_pattern_any_entity_model( - self, app_id, version_id, entity_id, name=None, explicit_list=None, custom_headers=None, raw=False, **operation_config): - """Updates the name and explicit (exception) list of a Pattern.Any entity - model in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: The Pattern.Any entity extractor ID. - :type entity_id: str - :param name: The model name. - :type name: str - :param explicit_list: The Pattern.Any explicit list. - :type explicit_list: list[str] - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - pattern_any_update_object = models.PatternAnyModelUpdateObject(name=name, explicit_list=explicit_list) - - # Construct URL - url = self.update_pattern_any_entity_model.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(pattern_any_update_object, 'PatternAnyModelUpdateObject') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update_pattern_any_entity_model.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}'} - - def delete_pattern_any_entity_model( - self, app_id, version_id, entity_id, custom_headers=None, raw=False, **operation_config): - """Deletes a Pattern.Any entity extractor from a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: The Pattern.Any entity extractor ID. - :type entity_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete_pattern_any_entity_model.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - delete_pattern_any_entity_model.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}'} - - def get_entity_role( - self, app_id, version_id, entity_id, role_id, custom_headers=None, raw=False, **operation_config): - """Get one role for a given entity in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: entity ID. - :type entity_id: str - :param role_id: entity role ID. - :type role_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: EntityRole or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.EntityRole or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get_entity_role.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str'), - 'roleId': self._serialize.url("role_id", role_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('EntityRole', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities/{entityId}/roles/{roleId}'} - - def update_entity_role( - self, app_id, version_id, entity_id, role_id, name=None, custom_headers=None, raw=False, **operation_config): - """Update a role for a given entity in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: The entity ID. - :type entity_id: str - :param role_id: The entity role ID. - :type role_id: str - :param name: The entity role name. - :type name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - entity_role_update_object = models.EntityRoleUpdateObject(name=name) - - # Construct URL - url = self.update_entity_role.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str'), - 'roleId': self._serialize.url("role_id", role_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(entity_role_update_object, 'EntityRoleUpdateObject') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities/{entityId}/roles/{roleId}'} - - def delete_entity_role( - self, app_id, version_id, entity_id, role_id, custom_headers=None, raw=False, **operation_config): - """Delete an entity role in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: The entity ID. - :type entity_id: str - :param role_id: The entity role Id. - :type role_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete_entity_role.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str'), - 'roleId': self._serialize.url("role_id", role_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - delete_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities/{entityId}/roles/{roleId}'} - - def get_prebuilt_entity_role( - self, app_id, version_id, entity_id, role_id, custom_headers=None, raw=False, **operation_config): - """Get one role for a given prebuilt entity in a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: entity ID. - :type entity_id: str - :param role_id: entity role ID. - :type role_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: EntityRole or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.EntityRole or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get_prebuilt_entity_role.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str'), - 'roleId': self._serialize.url("role_id", role_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('EntityRole', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_prebuilt_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/prebuilts/{entityId}/roles/{roleId}'} - - def update_prebuilt_entity_role( - self, app_id, version_id, entity_id, role_id, name=None, custom_headers=None, raw=False, **operation_config): - """Update a role for a given prebuilt entity in a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: The entity ID. - :type entity_id: str - :param role_id: The entity role ID. - :type role_id: str - :param name: The entity role name. - :type name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - entity_role_update_object = models.EntityRoleUpdateObject(name=name) - - # Construct URL - url = self.update_prebuilt_entity_role.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str'), - 'roleId': self._serialize.url("role_id", role_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(entity_role_update_object, 'EntityRoleUpdateObject') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update_prebuilt_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/prebuilts/{entityId}/roles/{roleId}'} - - def delete_prebuilt_entity_role( - self, app_id, version_id, entity_id, role_id, custom_headers=None, raw=False, **operation_config): - """Delete a role in a prebuilt entity in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: The entity ID. - :type entity_id: str - :param role_id: The entity role Id. - :type role_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete_prebuilt_entity_role.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str'), - 'roleId': self._serialize.url("role_id", role_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - delete_prebuilt_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/prebuilts/{entityId}/roles/{roleId}'} - - def get_closed_list_entity_role( - self, app_id, version_id, entity_id, role_id, custom_headers=None, raw=False, **operation_config): - """Get one role for a given list entity in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: entity ID. - :type entity_id: str - :param role_id: entity role ID. - :type role_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: EntityRole or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.EntityRole or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get_closed_list_entity_role.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str'), - 'roleId': self._serialize.url("role_id", role_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('EntityRole', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_closed_list_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/closedlists/{entityId}/roles/{roleId}'} - - def update_closed_list_entity_role( - self, app_id, version_id, entity_id, role_id, name=None, custom_headers=None, raw=False, **operation_config): - """Update a role for a given list entity in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: The entity ID. - :type entity_id: str - :param role_id: The entity role ID. - :type role_id: str - :param name: The entity role name. - :type name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - entity_role_update_object = models.EntityRoleUpdateObject(name=name) - - # Construct URL - url = self.update_closed_list_entity_role.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str'), - 'roleId': self._serialize.url("role_id", role_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(entity_role_update_object, 'EntityRoleUpdateObject') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update_closed_list_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/closedlists/{entityId}/roles/{roleId}'} - - def delete_closed_list_entity_role( - self, app_id, version_id, entity_id, role_id, custom_headers=None, raw=False, **operation_config): - """Delete a role for a given list entity in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: The entity ID. - :type entity_id: str - :param role_id: The entity role Id. - :type role_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete_closed_list_entity_role.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str'), - 'roleId': self._serialize.url("role_id", role_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - delete_closed_list_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/closedlists/{entityId}/roles/{roleId}'} - - def get_regex_entity_role( - self, app_id, version_id, entity_id, role_id, custom_headers=None, raw=False, **operation_config): - """Get one role for a given regular expression entity in a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: entity ID. - :type entity_id: str - :param role_id: entity role ID. - :type role_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: EntityRole or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.EntityRole or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get_regex_entity_role.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str'), - 'roleId': self._serialize.url("role_id", role_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('EntityRole', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_regex_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/regexentities/{entityId}/roles/{roleId}'} - - def update_regex_entity_role( - self, app_id, version_id, entity_id, role_id, name=None, custom_headers=None, raw=False, **operation_config): - """Update a role for a given regular expression entity in a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: The entity ID. - :type entity_id: str - :param role_id: The entity role ID. - :type role_id: str - :param name: The entity role name. - :type name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - entity_role_update_object = models.EntityRoleUpdateObject(name=name) - - # Construct URL - url = self.update_regex_entity_role.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str'), - 'roleId': self._serialize.url("role_id", role_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(entity_role_update_object, 'EntityRoleUpdateObject') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update_regex_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/regexentities/{entityId}/roles/{roleId}'} - - def delete_regex_entity_role( - self, app_id, version_id, entity_id, role_id, custom_headers=None, raw=False, **operation_config): - """Delete a role for a given regular expression in a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: The entity ID. - :type entity_id: str - :param role_id: The entity role Id. - :type role_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete_regex_entity_role.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str'), - 'roleId': self._serialize.url("role_id", role_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - delete_regex_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/regexentities/{entityId}/roles/{roleId}'} - - def get_composite_entity_role( - self, app_id, version_id, c_entity_id, role_id, custom_headers=None, raw=False, **operation_config): - """Get one role for a given composite entity in a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param c_entity_id: The composite entity extractor ID. - :type c_entity_id: str - :param role_id: entity role ID. - :type role_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: EntityRole or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.EntityRole or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get_composite_entity_role.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'cEntityId': self._serialize.url("c_entity_id", c_entity_id, 'str'), - 'roleId': self._serialize.url("role_id", role_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('EntityRole', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_composite_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/roles/{roleId}'} - - def update_composite_entity_role( - self, app_id, version_id, c_entity_id, role_id, name=None, custom_headers=None, raw=False, **operation_config): - """Update a role for a given composite entity in a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param c_entity_id: The composite entity extractor ID. - :type c_entity_id: str - :param role_id: The entity role ID. - :type role_id: str - :param name: The entity role name. - :type name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - entity_role_update_object = models.EntityRoleUpdateObject(name=name) - - # Construct URL - url = self.update_composite_entity_role.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'cEntityId': self._serialize.url("c_entity_id", c_entity_id, 'str'), - 'roleId': self._serialize.url("role_id", role_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(entity_role_update_object, 'EntityRoleUpdateObject') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update_composite_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/roles/{roleId}'} - - def delete_composite_entity_role( - self, app_id, version_id, c_entity_id, role_id, custom_headers=None, raw=False, **operation_config): - """Delete a role for a given composite entity in a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param c_entity_id: The composite entity extractor ID. - :type c_entity_id: str - :param role_id: The entity role Id. - :type role_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete_composite_entity_role.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'cEntityId': self._serialize.url("c_entity_id", c_entity_id, 'str'), - 'roleId': self._serialize.url("role_id", role_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - delete_composite_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/roles/{roleId}'} - - def get_pattern_any_entity_role( - self, app_id, version_id, entity_id, role_id, custom_headers=None, raw=False, **operation_config): - """Get one role for a given Pattern.any entity in a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: entity ID. - :type entity_id: str - :param role_id: entity role ID. - :type role_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: EntityRole or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.EntityRole or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get_pattern_any_entity_role.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str'), - 'roleId': self._serialize.url("role_id", role_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('EntityRole', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_pattern_any_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/roles/{roleId}'} - - def update_pattern_any_entity_role( - self, app_id, version_id, entity_id, role_id, name=None, custom_headers=None, raw=False, **operation_config): - """Update a role for a given Pattern.any entity in a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: The entity ID. - :type entity_id: str - :param role_id: The entity role ID. - :type role_id: str - :param name: The entity role name. - :type name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - entity_role_update_object = models.EntityRoleUpdateObject(name=name) - - # Construct URL - url = self.update_pattern_any_entity_role.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str'), - 'roleId': self._serialize.url("role_id", role_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(entity_role_update_object, 'EntityRoleUpdateObject') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update_pattern_any_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/roles/{roleId}'} - - def delete_pattern_any_entity_role( - self, app_id, version_id, entity_id, role_id, custom_headers=None, raw=False, **operation_config): - """Delete a role for a given Pattern.any entity in a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: The entity ID. - :type entity_id: str - :param role_id: The entity role Id. - :type role_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete_pattern_any_entity_role.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str'), - 'roleId': self._serialize.url("role_id", role_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - delete_pattern_any_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/roles/{roleId}'} - - def get_hierarchical_entity_role( - self, app_id, version_id, h_entity_id, role_id, custom_headers=None, raw=False, **operation_config): - """Get one role for a given hierarchical entity in a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param h_entity_id: The hierarchical entity extractor ID. - :type h_entity_id: str - :param role_id: entity role ID. - :type role_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: EntityRole or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.EntityRole or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get_hierarchical_entity_role.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'hEntityId': self._serialize.url("h_entity_id", h_entity_id, 'str'), - 'roleId': self._serialize.url("role_id", role_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('EntityRole', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_hierarchical_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/roles/{roleId}'} - - def update_hierarchical_entity_role( - self, app_id, version_id, h_entity_id, role_id, name=None, custom_headers=None, raw=False, **operation_config): - """Update a role for a given hierarchical entity in a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param h_entity_id: The hierarchical entity extractor ID. - :type h_entity_id: str - :param role_id: The entity role ID. - :type role_id: str - :param name: The entity role name. - :type name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - entity_role_update_object = models.EntityRoleUpdateObject(name=name) - - # Construct URL - url = self.update_hierarchical_entity_role.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'hEntityId': self._serialize.url("h_entity_id", h_entity_id, 'str'), - 'roleId': self._serialize.url("role_id", role_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(entity_role_update_object, 'EntityRoleUpdateObject') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update_hierarchical_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/roles/{roleId}'} - - def delete_hierarchical_entity_role( - self, app_id, version_id, h_entity_id, role_id, custom_headers=None, raw=False, **operation_config): - """Delete a role for a given hierarchical role in a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param h_entity_id: The hierarchical entity extractor ID. - :type h_entity_id: str - :param role_id: The entity role Id. - :type role_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete_hierarchical_entity_role.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'hEntityId': self._serialize.url("h_entity_id", h_entity_id, 'str'), - 'roleId': self._serialize.url("role_id", role_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - delete_hierarchical_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/roles/{roleId}'} - - def get_custom_entity_role( - self, app_id, version_id, entity_id, role_id, custom_headers=None, raw=False, **operation_config): - """Get one role for a given prebuilt entity in a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: entity ID. - :type entity_id: str - :param role_id: entity role ID. - :type role_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: EntityRole or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.EntityRole or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get_custom_entity_role.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str'), - 'roleId': self._serialize.url("role_id", role_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('EntityRole', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_custom_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/customprebuiltentities/{entityId}/roles/{roleId}'} - - def update_custom_prebuilt_entity_role( - self, app_id, version_id, entity_id, role_id, name=None, custom_headers=None, raw=False, **operation_config): - """Update a role for a given prebuilt entity in a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: The entity ID. - :type entity_id: str - :param role_id: The entity role ID. - :type role_id: str - :param name: The entity role name. - :type name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - entity_role_update_object = models.EntityRoleUpdateObject(name=name) - - # Construct URL - url = self.update_custom_prebuilt_entity_role.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str'), - 'roleId': self._serialize.url("role_id", role_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(entity_role_update_object, 'EntityRoleUpdateObject') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update_custom_prebuilt_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/customprebuiltentities/{entityId}/roles/{roleId}'} - - def delete_custom_entity_role( - self, app_id, version_id, entity_id, role_id, custom_headers=None, raw=False, **operation_config): - """Delete a role for a given prebuilt entity in a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: The entity ID. - :type entity_id: str - :param role_id: The entity role Id. - :type role_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete_custom_entity_role.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str'), - 'roleId': self._serialize.url("role_id", role_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - delete_custom_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/customprebuiltentities/{entityId}/roles/{roleId}'} - - def get_explicit_list_item( - self, app_id, version_id, entity_id, item_id, custom_headers=None, raw=False, **operation_config): - """Get the explicit (exception) list of the pattern.any entity in a - version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: The Pattern.Any entity Id. - :type entity_id: str - :param item_id: The explicit list item Id. - :type item_id: long - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ExplicitListItem or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.ExplicitListItem - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get_explicit_list_item.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str'), - 'itemId': self._serialize.url("item_id", item_id, 'long') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('ExplicitListItem', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_explicit_list_item.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/explicitlist/{itemId}'} - - def update_explicit_list_item( - self, app_id, version_id, entity_id, item_id, explicit_list_item=None, custom_headers=None, raw=False, **operation_config): - """Updates an explicit (exception) list item for a Pattern.Any entity in a - version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: The Pattern.Any entity extractor ID. - :type entity_id: str - :param item_id: The explicit list item ID. - :type item_id: long - :param explicit_list_item: The explicit list item. - :type explicit_list_item: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - item = models.ExplicitListItemUpdateObject(explicit_list_item=explicit_list_item) - - # Construct URL - url = self.update_explicit_list_item.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str'), - 'itemId': self._serialize.url("item_id", item_id, 'long') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(item, 'ExplicitListItemUpdateObject') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update_explicit_list_item.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/explicitlist/{itemId}'} - - def delete_explicit_list_item( - self, app_id, version_id, entity_id, item_id, custom_headers=None, raw=False, **operation_config): - """Delete an item from the explicit (exception) list for a Pattern.any - entity in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param entity_id: The pattern.any entity id. - :type entity_id: str - :param item_id: The explicit list item which will be deleted. - :type item_id: long - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete_explicit_list_item.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'entityId': self._serialize.url("entity_id", entity_id, 'str'), - 'itemId': self._serialize.url("item_id", item_id, 'long') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - delete_explicit_list_item.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/explicitlist/{itemId}'} diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_pattern_operations.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_pattern_operations.py deleted file mode 100644 index 17c40c26654..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_pattern_operations.py +++ /dev/null @@ -1,550 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class PatternOperations(object): - """PatternOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - - self.config = config - - def add_pattern( - self, app_id, version_id, pattern=None, intent=None, custom_headers=None, raw=False, **operation_config): - """Adds a pattern to a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param pattern: The pattern text. - :type pattern: str - :param intent: The intent's name which the pattern belongs to. - :type intent: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: PatternRuleInfo or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.PatternRuleInfo - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - pattern1 = models.PatternRuleCreateObject(pattern=pattern, intent=intent) - - # Construct URL - url = self.add_pattern.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(pattern1, 'PatternRuleCreateObject') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 201: - deserialized = self._deserialize('PatternRuleInfo', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - add_pattern.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternrule'} - - def list_patterns( - self, app_id, version_id, skip=0, take=100, custom_headers=None, raw=False, **operation_config): - """Gets patterns in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param skip: The number of entries to skip. Default value is 0. - :type skip: int - :param take: The number of entries to return. Maximum page size is - 500. Default is 100. - :type take: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.PatternRuleInfo] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list_patterns.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if skip is not None: - query_parameters['skip'] = self._serialize.query("skip", skip, 'int', minimum=0) - if take is not None: - query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[PatternRuleInfo]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_patterns.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternrules'} - - def update_patterns( - self, app_id, version_id, patterns, custom_headers=None, raw=False, **operation_config): - """Updates patterns in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param patterns: An array represents the patterns. - :type patterns: - list[~azure.cognitiveservices.language.luis.authoring.models.PatternRuleUpdateObject] - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.PatternRuleInfo] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.update_patterns.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(patterns, '[PatternRuleUpdateObject]') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[PatternRuleInfo]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update_patterns.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternrules'} - - def batch_add_patterns( - self, app_id, version_id, patterns, custom_headers=None, raw=False, **operation_config): - """Adds a batch of patterns in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param patterns: A JSON array containing patterns. - :type patterns: - list[~azure.cognitiveservices.language.luis.authoring.models.PatternRuleCreateObject] - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.PatternRuleInfo] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.batch_add_patterns.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(patterns, '[PatternRuleCreateObject]') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 201: - deserialized = self._deserialize('[PatternRuleInfo]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - batch_add_patterns.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternrules'} - - def delete_patterns( - self, app_id, version_id, pattern_ids, custom_headers=None, raw=False, **operation_config): - """Deletes a list of patterns in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param pattern_ids: The patterns IDs. - :type pattern_ids: list[str] - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete_patterns.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(pattern_ids, '[str]') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - delete_patterns.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternrules'} - - def update_pattern( - self, app_id, version_id, pattern_id, pattern, custom_headers=None, raw=False, **operation_config): - """Updates a pattern in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param pattern_id: The pattern ID. - :type pattern_id: str - :param pattern: An object representing a pattern. - :type pattern: - ~azure.cognitiveservices.language.luis.authoring.models.PatternRuleUpdateObject - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: PatternRuleInfo or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.PatternRuleInfo - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.update_pattern.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'patternId': self._serialize.url("pattern_id", pattern_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(pattern, 'PatternRuleUpdateObject') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('PatternRuleInfo', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update_pattern.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternrules/{patternId}'} - - def delete_pattern( - self, app_id, version_id, pattern_id, custom_headers=None, raw=False, **operation_config): - """Deletes the pattern with the specified ID from a version of the - application.. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param pattern_id: The pattern ID. - :type pattern_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete_pattern.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'patternId': self._serialize.url("pattern_id", pattern_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - delete_pattern.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternrules/{patternId}'} - - def list_intent_patterns( - self, app_id, version_id, intent_id, skip=0, take=100, custom_headers=None, raw=False, **operation_config): - """Returns patterns for the specific intent in a version of the - application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param intent_id: The intent classifier ID. - :type intent_id: str - :param skip: The number of entries to skip. Default value is 0. - :type skip: int - :param take: The number of entries to return. Maximum page size is - 500. Default is 100. - :type take: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.PatternRuleInfo] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list_intent_patterns.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str'), - 'intentId': self._serialize.url("intent_id", intent_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if skip is not None: - query_parameters['skip'] = self._serialize.query("skip", skip, 'int', minimum=0) - if take is not None: - query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[PatternRuleInfo]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_intent_patterns.metadata = {'url': '/apps/{appId}/versions/{versionId}/intents/{intentId}/patternrules'} diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_settings_operations.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_settings_operations.py deleted file mode 100644 index 1a34c6b298c..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_settings_operations.py +++ /dev/null @@ -1,156 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class SettingsOperations(object): - """SettingsOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - - self.config = config - - def list( - self, app_id, version_id, custom_headers=None, raw=False, **operation_config): - """Gets the settings in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.AppVersionSettingObject] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[AppVersionSettingObject]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list.metadata = {'url': '/apps/{appId}/versions/{versionId}/settings'} - - def update( - self, app_id, version_id, list_of_app_version_setting_object, custom_headers=None, raw=False, **operation_config): - """Updates the settings in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param list_of_app_version_setting_object: A list of the updated - application version settings. - :type list_of_app_version_setting_object: - list[~azure.cognitiveservices.language.luis.authoring.models.AppVersionSettingObject] - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(list_of_app_version_setting_object, '[AppVersionSettingObject]') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update.metadata = {'url': '/apps/{appId}/versions/{versionId}/settings'} diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_train_operations.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_train_operations.py deleted file mode 100644 index c48ed5feb31..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_train_operations.py +++ /dev/null @@ -1,158 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class TrainOperations(object): - """TrainOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - - self.config = config - - def train_version( - self, app_id, version_id, custom_headers=None, raw=False, **operation_config): - """Sends a training request for a version of a specified LUIS app. This - POST request initiates a request asynchronously. To determine whether - the training request is successful, submit a GET request to get - training status. Note: The application version is not fully trained - unless all the models (intents and entities) are trained successfully - or are up to date. To verify training success, get the training status - at least once after training is complete. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: EnqueueTrainingResponse or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.EnqueueTrainingResponse - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.train_version.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [202]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 202: - deserialized = self._deserialize('EnqueueTrainingResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - train_version.metadata = {'url': '/apps/{appId}/versions/{versionId}/train'} - - def get_status( - self, app_id, version_id, custom_headers=None, raw=False, **operation_config): - """Gets the training status of all models (intents and entities) for the - specified LUIS app. You must call the train API to train the LUIS app - before you call this API to get training status. "appID" specifies the - LUIS app ID. "versionId" specifies the version number of the LUIS app. - For example, "0.1". - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.ModelTrainingInfo] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get_status.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[ModelTrainingInfo]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_status.metadata = {'url': '/apps/{appId}/versions/{versionId}/train'} diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_versions_operations.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_versions_operations.py deleted file mode 100644 index 2feedf52ab7..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/operations/_versions_operations.py +++ /dev/null @@ -1,705 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.pipeline import ClientRawResponse -from msrest.exceptions import HttpOperationError - -from .. import models - - -class VersionsOperations(object): - """VersionsOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar format: Lu format extension. Constant value: "lu". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - - self.config = config - self.format = "lu" - - def clone( - self, app_id, version_id, version=None, custom_headers=None, raw=False, **operation_config): - """Creates a new version from the selected version. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param version: The new version for the cloned model. - :type version: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: str or ClientRawResponse if raw=true - :rtype: str or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - version_clone_object = models.TaskUpdateObject(version=version) - - # Construct URL - url = self.clone.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(version_clone_object, 'TaskUpdateObject') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 201: - deserialized = self._deserialize('str', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - clone.metadata = {'url': '/apps/{appId}/versions/{versionId}/clone'} - - def list( - self, app_id, skip=0, take=100, custom_headers=None, raw=False, **operation_config): - """Gets a list of versions for this application ID. - - :param app_id: The application ID. - :type app_id: str - :param skip: The number of entries to skip. Default value is 0. - :type skip: int - :param take: The number of entries to return. Maximum page size is - 500. Default is 100. - :type take: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.VersionInfo] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if skip is not None: - query_parameters['skip'] = self._serialize.query("skip", skip, 'int', minimum=0) - if take is not None: - query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[VersionInfo]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list.metadata = {'url': '/apps/{appId}/versions'} - - def get( - self, app_id, version_id, custom_headers=None, raw=False, **operation_config): - """Gets the version information such as date created, last modified date, - endpoint URL, count of intents and entities, training and publishing - status. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: VersionInfo or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.VersionInfo or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('VersionInfo', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/apps/{appId}/versions/{versionId}/'} - - def update( - self, app_id, version_id, version=None, custom_headers=None, raw=False, **operation_config): - """Updates the name or description of the application version. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param version: The new version for the cloned model. - :type version: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - version_update_object = models.TaskUpdateObject(version=version) - - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(version_update_object, 'TaskUpdateObject') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update.metadata = {'url': '/apps/{appId}/versions/{versionId}/'} - - def delete( - self, app_id, version_id, custom_headers=None, raw=False, **operation_config): - """Deletes an application version. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - delete.metadata = {'url': '/apps/{appId}/versions/{versionId}/'} - - def export( - self, app_id, version_id, custom_headers=None, raw=False, **operation_config): - """Exports a LUIS application to JSON format. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: LuisApp or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.LuisApp or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.export.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('LuisApp', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - export.metadata = {'url': '/apps/{appId}/versions/{versionId}/export'} - - def import_method( - self, app_id, luis_app, version_id=None, custom_headers=None, raw=False, **operation_config): - """Imports a new version into a LUIS application. - - :param app_id: The application ID. - :type app_id: str - :param luis_app: A LUIS application structure. - :type luis_app: - ~azure.cognitiveservices.language.luis.authoring.models.LuisApp - :param version_id: The new versionId to import. If not specified, the - versionId will be read from the imported object. - :type version_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: str or ClientRawResponse if raw=true - :rtype: str or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.import_method.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if version_id is not None: - query_parameters['versionId'] = self._serialize.query("version_id", version_id, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(luis_app, 'LuisApp') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 201: - deserialized = self._deserialize('str', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - import_method.metadata = {'url': '/apps/{appId}/versions/import'} - - def delete_unlabelled_utterance( - self, app_id, version_id, utterance, custom_headers=None, raw=False, **operation_config): - """Deleted an unlabelled utterance in a version of the application. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param utterance: The utterance text to delete. - :type utterance: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationStatus or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete_unlabelled_utterance.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(utterance, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - delete_unlabelled_utterance.metadata = {'url': '/apps/{appId}/versions/{versionId}/suggest'} - - def import_v2_app( - self, app_id, luis_app_v2, version_id=None, custom_headers=None, raw=False, **operation_config): - """Imports a new version into a LUIS application. - - :param app_id: The application ID. - :type app_id: str - :param luis_app_v2: A LUIS application structure. - :type luis_app_v2: - ~azure.cognitiveservices.language.luis.authoring.models.LuisAppV2 - :param version_id: The new versionId to import. If not specified, the - versionId will be read from the imported object. - :type version_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: str or ClientRawResponse if raw=true - :rtype: str or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.import_v2_app.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if version_id is not None: - query_parameters['versionId'] = self._serialize.query("version_id", version_id, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(luis_app_v2, 'LuisAppV2') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 201: - deserialized = self._deserialize('str', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - import_v2_app.metadata = {'url': '/apps/{appId}/versions/import'} - - def import_lu_format( - self, app_id, luis_app_lu, version_id=None, custom_headers=None, raw=False, **operation_config): - """Imports a new version into a LUIS application. - - :param app_id: The application ID. - :type app_id: str - :param luis_app_lu: An LU representing the LUIS application structure. - :type luis_app_lu: str - :param version_id: The new versionId to import. If not specified, the - versionId will be read from the imported object. - :type version_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: str or ClientRawResponse if raw=true - :rtype: str or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.import_lu_format.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if version_id is not None: - query_parameters['versionId'] = self._serialize.query("version_id", version_id, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'text/plain' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(luis_app_lu, 'str') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 201: - deserialized = self._deserialize('str', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - import_lu_format.metadata = {'url': '/apps/{appId}/versions/import'} - - def export_lu_format( - self, app_id, version_id, custom_headers=None, raw=False, callback=None, **operation_config): - """Exports a LUIS application to text format. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param callback: When specified, will be called with each chunk of - data that is streamed. The callback should take two arguments, the - bytes of the current chunk of data and the response object. If the - data is uploading, response will be None. - :type callback: Callable[Bytes, response=None] - :param operation_config: :ref:`Operation configuration - overrides`. - :return: object or ClientRawResponse if raw=true - :rtype: Generator or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`HttpOperationError` - """ - # Construct URL - url = self.export_lu_format.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'appId': self._serialize.url("app_id", app_id, 'str'), - 'versionId': self._serialize.url("version_id", version_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['format'] = self._serialize.query("self.format", self.format, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/octet-stream' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=True, **operation_config) - - if response.status_code not in [200]: - raise HttpOperationError(self._deserialize, response) - - deserialized = self._client.stream_download(response, callback) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - export_lu_format.metadata = {'url': '/apps/{appId}/versions/{versionId}/export'} diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/models/__init__.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/models/__init__.py deleted file mode 100644 index b907474da4c..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/models/__init__.py +++ /dev/null @@ -1,63 +0,0 @@ -# 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 ._models_py3 import ErrorAdditionalInfo -from ._models_py3 import ErrorDetail -from ._models_py3 import ErrorResponse -from ._models_py3 import Namespace -from ._models_py3 import NamespaceListResult -from ._models_py3 import NamespaceProperties -from ._models_py3 import NamespacePropertiesUpdate -from ._models_py3 import NamespaceUpdate -from ._models_py3 import Operation -from ._models_py3 import OperationDisplay -from ._models_py3 import OperationListResult -from ._models_py3 import ProxyResource -from ._models_py3 import Resource -from ._models_py3 import SystemData -from ._models_py3 import TaskHub -from ._models_py3 import TaskHubListResult -from ._models_py3 import TaskHubProperties -from ._models_py3 import TaskHubUpdate -from ._models_py3 import TrackedResource - -from ._durabletask_mgmt_client_enums import ActionType -from ._durabletask_mgmt_client_enums import CreatedByType -from ._durabletask_mgmt_client_enums import Origin -from ._durabletask_mgmt_client_enums import ProvisioningState -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "ErrorAdditionalInfo", - "ErrorDetail", - "ErrorResponse", - "Namespace", - "NamespaceListResult", - "NamespaceProperties", - "NamespacePropertiesUpdate", - "NamespaceUpdate", - "Operation", - "OperationDisplay", - "OperationListResult", - "ProxyResource", - "Resource", - "SystemData", - "TaskHub", - "TaskHubListResult", - "TaskHubProperties", - "TaskHubUpdate", - "TrackedResource", - "ActionType", - "CreatedByType", - "Origin", - "ProvisioningState", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/models/_durabletask_mgmt_client_enums.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/models/_durabletask_mgmt_client_enums.py deleted file mode 100644 index 3e1734239fa..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/models/_durabletask_mgmt_client_enums.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 -from azure.core import CaseInsensitiveEnumMeta - - -class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.""" - - INTERNAL = "Internal" - - -class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of identity that created the resource.""" - - USER = "User" - APPLICATION = "Application" - MANAGED_IDENTITY = "ManagedIdentity" - KEY = "Key" - - -class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit - logs UX. Default value is "user,system". - """ - - USER = "user" - SYSTEM = "system" - USER_SYSTEM = "user,system" - - -class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The status of the current operation.""" - - SUCCEEDED = "Succeeded" - """Resource has been created.""" - FAILED = "Failed" - """Resource creation failed.""" - CANCELED = "Canceled" - """Resource creation was canceled.""" - PROVISIONING = "Provisioning" - """The resource is being provisioned""" - UPDATING = "Updating" - """The resource is updating""" - DELETING = "Deleting" - """The resource is being deleted""" - ACCEPTED = "Accepted" - """The resource create request has been accepted""" diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/models/_models_py3.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/models/_models_py3.py deleted file mode 100644 index 3ed2783efd9..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/models/_models_py3.py +++ /dev/null @@ -1,730 +0,0 @@ -# coding=utf-8 -# pylint: disable=too-many-lines -# -------------------------------------------------------------------------- -# 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 datetime -from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union - -from .. import _serialization - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models - - -class ErrorAdditionalInfo(_serialization.Model): - """The resource management error additional info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: JSON - """ - - _validation = { - "type": {"readonly": True}, - "info": {"readonly": True}, - } - - _attribute_map = { - "type": {"key": "type", "type": "str"}, - "info": {"key": "info", "type": "object"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.type = None - self.info = None - - -class ErrorDetail(_serialization.Model): - """The error detail. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.durabletask.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: list[~azure.mgmt.durabletask.models.ErrorAdditionalInfo] - """ - - _validation = { - "code": {"readonly": True}, - "message": {"readonly": True}, - "target": {"readonly": True}, - "details": {"readonly": True}, - "additional_info": {"readonly": True}, - } - - _attribute_map = { - "code": {"key": "code", "type": "str"}, - "message": {"key": "message", "type": "str"}, - "target": {"key": "target", "type": "str"}, - "details": {"key": "details", "type": "[ErrorDetail]"}, - "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None - - -class ErrorResponse(_serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed - operations. (This also follows the OData error response format.). - - :ivar error: The error object. - :vartype error: ~azure.mgmt.durabletask.models.ErrorDetail - """ - - _attribute_map = { - "error": {"key": "error", "type": "ErrorDetail"}, - } - - def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: Any) -> None: - """ - :keyword error: The error object. - :paramtype error: ~azure.mgmt.durabletask.models.ErrorDetail - """ - super().__init__(**kwargs) - self.error = error - - -class Resource(_serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.durabletask.models.SystemData - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.system_data = None - - -class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which - has 'tags' and a 'location'. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.durabletask.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - } - - def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - """ - super().__init__(**kwargs) - self.tags = tags - self.location = location - - -class Namespace(TrackedResource): - """A DurableTaskService resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.durabletask.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.durabletask.models.NamespaceProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "properties": {"key": "properties", "type": "NamespaceProperties"}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - properties: Optional["_models.NamespaceProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword properties: The resource-specific properties for this resource. - :paramtype properties: ~azure.mgmt.durabletask.models.NamespaceProperties - """ - super().__init__(tags=tags, location=location, **kwargs) - self.properties = properties - - -class NamespaceListResult(_serialization.Model): - """The response of a Namespace list operation. - - All required parameters must be populated in order to send to server. - - :ivar value: The Namespace items on this page. Required. - :vartype value: list[~azure.mgmt.durabletask.models.Namespace] - :ivar next_link: The link to the next page of items. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Namespace]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.Namespace"], next_link: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword value: The Namespace items on this page. Required. - :paramtype value: list[~azure.mgmt.durabletask.models.Namespace] - :keyword next_link: The link to the next page of items. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class NamespaceProperties(_serialization.Model): - """Details of the Namespace. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded", - "Failed", "Canceled", "Provisioning", "Updating", "Deleting", and "Accepted". - :vartype provisioning_state: str or ~azure.mgmt.durabletask.models.ProvisioningState - :ivar url: URL of the durable task service. - :vartype url: str - :ivar dashboard_url: URL of the durable task service dashboard. - :vartype dashboard_url: str - :ivar ip_allowlist: IP allow list for durable task service. Values can be Pv4, IPv6 or CIDR. - :vartype ip_allowlist: list[str] - """ - - _validation = { - "provisioning_state": {"readonly": True}, - "url": {"readonly": True}, - "dashboard_url": {"readonly": True}, - } - - _attribute_map = { - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "url": {"key": "url", "type": "str"}, - "dashboard_url": {"key": "dashboardUrl", "type": "str"}, - "ip_allowlist": {"key": "ipAllowlist", "type": "[str]"}, - } - - def __init__(self, *, ip_allowlist: Optional[List[str]] = None, **kwargs: Any) -> None: - """ - :keyword ip_allowlist: IP allow list for durable task service. Values can be Pv4, IPv6 or CIDR. - :paramtype ip_allowlist: list[str] - """ - super().__init__(**kwargs) - self.provisioning_state = None - self.url = None - self.dashboard_url = None - self.ip_allowlist = ip_allowlist - - -class NamespacePropertiesUpdate(_serialization.Model): - """The template for adding optional properties. - - :ivar ip_allowlist: IP allow list for durable task service. Values can be Pv4, IPv6 or CIDR. - :vartype ip_allowlist: list[str] - """ - - _attribute_map = { - "ip_allowlist": {"key": "ipAllowlist", "type": "[str]"}, - } - - def __init__(self, *, ip_allowlist: Optional[List[str]] = None, **kwargs: Any) -> None: - """ - :keyword ip_allowlist: IP allow list for durable task service. Values can be Pv4, IPv6 or CIDR. - :paramtype ip_allowlist: list[str] - """ - super().__init__(**kwargs) - self.ip_allowlist = ip_allowlist - - -class NamespaceUpdate(_serialization.Model): - """Update namespace. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar properties: RP-specific properties. - :vartype properties: ~azure.mgmt.durabletask.models.NamespaceProperties - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "properties": {"key": "properties", "type": "NamespaceProperties"}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - properties: Optional["_models.NamespaceProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword properties: RP-specific properties. - :paramtype properties: ~azure.mgmt.durabletask.models.NamespaceProperties - """ - super().__init__(**kwargs) - self.tags = tags - self.properties = properties - - -class Operation(_serialization.Model): - """Details of a REST API operation, returned from the Resource Provider Operations API. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - :vartype name: str - :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for - data-plane operations and "false" for ARM/control-plane operations. - :vartype is_data_action: bool - :ivar display: Localized display information for this particular operation. - :vartype display: ~azure.mgmt.durabletask.models.OperationDisplay - :ivar origin: The intended executor of the operation; as in Resource Based Access Control - (RBAC) and audit logs UX. Default value is "user,system". Known values are: "user", "system", - and "user,system". - :vartype origin: str or ~azure.mgmt.durabletask.models.Origin - :ivar action_type: Enum. Indicates the action type. "Internal" refers to actions that are for - internal only APIs. "Internal" - :vartype action_type: str or ~azure.mgmt.durabletask.models.ActionType - """ - - _validation = { - "name": {"readonly": True}, - "is_data_action": {"readonly": True}, - "origin": {"readonly": True}, - "action_type": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "is_data_action": {"key": "isDataAction", "type": "bool"}, - "display": {"key": "display", "type": "OperationDisplay"}, - "origin": {"key": "origin", "type": "str"}, - "action_type": {"key": "actionType", "type": "str"}, - } - - def __init__(self, *, display: Optional["_models.OperationDisplay"] = None, **kwargs: Any) -> None: - """ - :keyword display: Localized display information for this particular operation. - :paramtype display: ~azure.mgmt.durabletask.models.OperationDisplay - """ - super().__init__(**kwargs) - self.name = None - self.is_data_action = None - self.display = display - self.origin = None - self.action_type = None - - -class OperationDisplay(_serialization.Model): - """Localized display information for this particular operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft - Monitoring Insights" or "Microsoft Compute". - :vartype provider: str - :ivar resource: The localized friendly name of the resource type related to this operation. - E.g. "Virtual Machines" or "Job Schedule Collections". - :vartype resource: str - :ivar operation: The concise, localized friendly name for the operation; suitable for - dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". - :vartype operation: str - :ivar description: The short, localized friendly description of the operation; suitable for - tool tips and detailed views. - :vartype description: str - """ - - _validation = { - "provider": {"readonly": True}, - "resource": {"readonly": True}, - "operation": {"readonly": True}, - "description": {"readonly": True}, - } - - _attribute_map = { - "provider": {"key": "provider", "type": "str"}, - "resource": {"key": "resource", "type": "str"}, - "operation": {"key": "operation", "type": "str"}, - "description": {"key": "description", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.provider = None - self.resource = None - self.operation = None - self.description = None - - -class OperationListResult(_serialization.Model): - """A list of REST API operations supported by an Azure Resource Provider. It contains an URL link - to get the next set of results. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of operations supported by the resource provider. - :vartype value: list[~azure.mgmt.durabletask.models.Operation] - :ivar next_link: URL to get the next set of operation list results (if there are any). - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Operation]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - self.next_link = None - - -class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have - tags and a location. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.durabletask.models.SystemData - """ - - -class SystemData(_serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :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. Known values are: - "User", "Application", "ManagedIdentity", and "Key". - :vartype created_by_type: str or ~azure.mgmt.durabletask.models.CreatedByType - :ivar created_at: The timestamp of resource creation (UTC). - :vartype created_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. Known values - are: "User", "Application", "ManagedIdentity", and "Key". - :vartype last_modified_by_type: str or ~azure.mgmt.durabletask.models.CreatedByType - :ivar last_modified_at: The timestamp of resource last modification (UTC). - :vartype last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - "created_by": {"key": "createdBy", "type": "str"}, - "created_by_type": {"key": "createdByType", "type": "str"}, - "created_at": {"key": "createdAt", "type": "iso-8601"}, - "last_modified_by": {"key": "lastModifiedBy", "type": "str"}, - "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"}, - "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, - } - - def __init__( - self, - *, - created_by: Optional[str] = None, - created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, - created_at: Optional[datetime.datetime] = None, - last_modified_by: Optional[str] = None, - last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, - last_modified_at: Optional[datetime.datetime] = None, - **kwargs: Any - ) -> None: - """ - :keyword created_by: The identity that created the resource. - :paramtype created_by: str - :keyword created_by_type: The type of identity that created the resource. Known values are: - "User", "Application", "ManagedIdentity", and "Key". - :paramtype created_by_type: str or ~azure.mgmt.durabletask.models.CreatedByType - :keyword created_at: The timestamp of resource creation (UTC). - :paramtype created_at: ~datetime.datetime - :keyword last_modified_by: The identity that last modified the resource. - :paramtype last_modified_by: str - :keyword last_modified_by_type: The type of identity that last modified the resource. Known - values are: "User", "Application", "ManagedIdentity", and "Key". - :paramtype last_modified_by_type: str or ~azure.mgmt.durabletask.models.CreatedByType - :keyword last_modified_at: The timestamp of resource last modification (UTC). - :paramtype last_modified_at: ~datetime.datetime - """ - super().__init__(**kwargs) - self.created_by = created_by - self.created_by_type = created_by_type - self.created_at = created_at - self.last_modified_by = last_modified_by - self.last_modified_by_type = last_modified_by_type - self.last_modified_at = last_modified_at - - -class TaskHub(ProxyResource): - """An Task Hub resource belonging to the namespace. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.durabletask.models.SystemData - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.durabletask.models.TaskHubProperties - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "TaskHubProperties"}, - "tags": {"key": "tags", "type": "{str}"}, - } - - def __init__( - self, - *, - properties: Optional["_models.TaskHubProperties"] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs: Any - ) -> None: - """ - :keyword properties: The resource-specific properties for this resource. - :paramtype properties: ~azure.mgmt.durabletask.models.TaskHubProperties - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - """ - super().__init__(**kwargs) - self.properties = properties - self.tags = tags - - -class TaskHubListResult(_serialization.Model): - """The response of a TaskHub list operation. - - All required parameters must be populated in order to send to server. - - :ivar value: The TaskHub items on this page. Required. - :vartype value: list[~azure.mgmt.durabletask.models.TaskHub] - :ivar next_link: The link to the next page of items. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[TaskHub]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.TaskHub"], next_link: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword value: The TaskHub items on this page. Required. - :paramtype value: list[~azure.mgmt.durabletask.models.TaskHub] - :keyword next_link: The link to the next page of items. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class TaskHubProperties(_serialization.Model): - """The properties of Task Hub. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded", - "Failed", "Canceled", "Provisioning", "Updating", "Deleting", and "Accepted". - :vartype provisioning_state: str or ~azure.mgmt.durabletask.models.ProvisioningState - """ - - _validation = { - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "provisioning_state": {"key": "provisioningState", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.provisioning_state = None - - -class TaskHubUpdate(_serialization.Model): - """Update Task Hub. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - } - - def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - """ - super().__init__(**kwargs) - self.tags = tags diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/models/_patch.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/models/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/models/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/operations/__init__.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/operations/__init__.py deleted file mode 100644 index 03a0d30262e..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/operations/__init__.py +++ /dev/null @@ -1,23 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._operations import Operations -from ._namespaces_operations import NamespacesOperations -from ._task_hubs_operations import TaskHubsOperations - -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "Operations", - "NamespacesOperations", - "TaskHubsOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/operations/_namespaces_operations.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/operations/_namespaces_operations.py deleted file mode 100644 index e156b6dda8a..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/operations/_namespaces_operations.py +++ /dev/null @@ -1,972 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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 io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.DurableTask/namespaces") - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_resource_group_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/namespaces", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, namespace_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/namespaces/{namespaceName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", pattern=r"^[a-zA-Z0-9-]{3,64}$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, namespace_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/namespaces/{namespaceName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", pattern=r"^[a-zA-Z0-9-]{3,64}$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, namespace_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/namespaces/{namespaceName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", pattern=r"^[a-zA-Z0-9-]{3,64}$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, namespace_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/namespaces/{namespaceName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", pattern=r"^[a-zA-Z0-9-]{3,64}$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class NamespacesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.durabletask.DurabletaskMgmtClient`'s - :attr:`namespaces` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.Namespace"]: - """List Namespace resources by subscription ID. - - :return: An iterator like instance of either Namespace or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.durabletask.models.Namespace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NamespaceListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("NamespaceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Namespace"]: - """List Namespace resources by resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of either Namespace or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.durabletask.models.Namespace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NamespaceListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("NamespaceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get(self, resource_group_name: str, namespace_name: str, **kwargs: Any) -> _models.Namespace: - """Get a Namespace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the service. Required. - :type namespace_name: str - :return: Namespace or the result of cls(response) - :rtype: ~azure.mgmt.durabletask.models.Namespace - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.Namespace] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Namespace", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - namespace_name: str, - resource: Union[_models.Namespace, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _json = self._serialize.body(resource, "Namespace") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - namespace_name: str, - resource: _models.Namespace, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Namespace]: - """Create a Namespace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the service. Required. - :type namespace_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.durabletask.models.Namespace - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either Namespace or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.Namespace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - namespace_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Namespace]: - """Create a Namespace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the service. Required. - :type namespace_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either Namespace or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.Namespace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - namespace_name: str, - resource: Union[_models.Namespace, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Namespace]: - """Create a Namespace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the service. Required. - :type namespace_name: str - :param resource: Resource create parameters. Is either a Namespace type or a IO[bytes] type. - Required. - :type resource: ~azure.mgmt.durabletask.models.Namespace or IO[bytes] - :return: An instance of LROPoller that returns either Namespace or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.Namespace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Namespace] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - resource=resource, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Namespace", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Namespace].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Namespace]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _update_initial( - self, - resource_group_name: str, - namespace_name: str, - properties: Union[_models.NamespaceUpdate, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties - else: - _json = self._serialize.body(properties, "NamespaceUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - namespace_name: str, - properties: _models.NamespaceUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Namespace]: - """Update a Namespace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the service. Required. - :type namespace_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.durabletask.models.NamespaceUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either Namespace or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.Namespace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - namespace_name: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Namespace]: - """Update a Namespace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the service. Required. - :type namespace_name: str - :param properties: The resource properties to be updated. Required. - :type properties: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either Namespace or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.Namespace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - namespace_name: str, - properties: Union[_models.NamespaceUpdate, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Namespace]: - """Update a Namespace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the service. Required. - :type namespace_name: str - :param properties: The resource properties to be updated. Is either a NamespaceUpdate type or a - IO[bytes] type. Required. - :type properties: ~azure.mgmt.durabletask.models.NamespaceUpdate or IO[bytes] - :return: An instance of LROPoller that returns either Namespace or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.Namespace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Namespace] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - properties=properties, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Namespace", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Namespace].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Namespace]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial(self, resource_group_name: str, namespace_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete(self, resource_group_name: str, namespace_name: str, **kwargs: Any) -> LROPoller[None]: - """Delete a Namespace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the service. Required. - :type namespace_name: str - :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: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/operations/_operations.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/operations/_operations.py deleted file mode 100644 index ec72d57216b..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/operations/_operations.py +++ /dev/null @@ -1,152 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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 sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/providers/Microsoft.DurableTask/operations") - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class Operations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.durabletask.DurabletaskMgmtClient`'s - :attr:`operations` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: - """List the operations for the provider. - - :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.durabletask.models.Operation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OperationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/operations/_patch.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/operations/_patch.py deleted file mode 100644 index f7dd3251033..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/operations/_task_hubs_operations.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/operations/_task_hubs_operations.py deleted file mode 100644 index 7092c996876..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/operations/_task_hubs_operations.py +++ /dev/null @@ -1,721 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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 io import IOBase -import sys -import json -from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_namespace_request( - resource_group_name: str, namespace_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/namespaces/{namespaceName}/taskHubs", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", pattern=r"^[a-zA-Z0-9-]{3,64}$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, namespace_name: str, task_hub_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/namespaces/{namespaceName}/taskHubs/{taskHubName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", pattern=r"^[a-zA-Z0-9-]{3,64}$"), - "taskHubName": _SERIALIZER.url("task_hub_name", task_hub_name, "str", pattern=r"^[a-zA-Z0-9-]{3,64}$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, namespace_name: str, task_hub_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/namespaces/{namespaceName}/taskHubs/{taskHubName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", pattern=r"^[a-zA-Z0-9-]{3,64}$"), - "taskHubName": _SERIALIZER.url("task_hub_name", task_hub_name, "str", pattern=r"^[a-zA-Z0-9-]{3,64}$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, namespace_name: str, task_hub_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/namespaces/{namespaceName}/taskHubs/{taskHubName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", pattern=r"^[a-zA-Z0-9-]{3,64}$"), - "taskHubName": _SERIALIZER.url("task_hub_name", task_hub_name, "str", pattern=r"^[a-zA-Z0-9-]{3,64}$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, namespace_name: str, task_hub_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/namespaces/{namespaceName}/taskHubs/{taskHubName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", pattern=r"^[a-zA-Z0-9-]{3,64}$"), - "taskHubName": _SERIALIZER.url("task_hub_name", task_hub_name, "str", pattern=r"^[a-zA-Z0-9-]{3,64}$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class TaskHubsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.durabletask.DurabletaskMgmtClient`'s - :attr:`task_hubs` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_namespace( - self, resource_group_name: str, namespace_name: str, **kwargs: Any - ) -> Iterable["_models.TaskHub"]: - """List Task Hubs. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the service. Required. - :type namespace_name: str - :return: An iterator like instance of either TaskHub or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.durabletask.models.TaskHub] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.TaskHubListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_namespace_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("TaskHubListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get(self, resource_group_name: str, namespace_name: str, task_hub_name: str, **kwargs: Any) -> _models.TaskHub: - """Get a Task Hub. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the service. Required. - :type namespace_name: str - :param task_hub_name: Task Hub name. Required. - :type task_hub_name: str - :return: TaskHub or the result of cls(response) - :rtype: ~azure.mgmt.durabletask.models.TaskHub - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.TaskHub] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - task_hub_name=task_hub_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("TaskHub", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - namespace_name: str, - task_hub_name: str, - resource: _models.TaskHub, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.TaskHub: - """Create or update a Task Hub. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the service. Required. - :type namespace_name: str - :param task_hub_name: Task Hub name. Required. - :type task_hub_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.durabletask.models.TaskHub - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: TaskHub or the result of cls(response) - :rtype: ~azure.mgmt.durabletask.models.TaskHub - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - namespace_name: str, - task_hub_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.TaskHub: - """Create or update a Task Hub. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the service. Required. - :type namespace_name: str - :param task_hub_name: Task Hub name. Required. - :type task_hub_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: TaskHub or the result of cls(response) - :rtype: ~azure.mgmt.durabletask.models.TaskHub - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - namespace_name: str, - task_hub_name: str, - resource: Union[_models.TaskHub, IO[bytes]], - **kwargs: Any - ) -> _models.TaskHub: - """Create or update a Task Hub. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the service. Required. - :type namespace_name: str - :param task_hub_name: Task Hub name. Required. - :type task_hub_name: str - :param resource: Resource create parameters. Is either a TaskHub type or a IO[bytes] type. - Required. - :type resource: ~azure.mgmt.durabletask.models.TaskHub or IO[bytes] - :return: TaskHub or the result of cls(response) - :rtype: ~azure.mgmt.durabletask.models.TaskHub - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.TaskHub] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _json = self._serialize.body(resource, "TaskHub") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - task_hub_name=task_hub_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 409]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("TaskHub", pipeline_response.http_response) - - if response.status_code == 409: - deserialized.additional_properties["error"]["message"] = "ResourceCreationFailed: Cannot provision taskhub while namespace provisioning pending" - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def update( - self, - resource_group_name: str, - namespace_name: str, - task_hub_name: str, - properties: _models.TaskHubUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.TaskHub: - """Update a Task Hub. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the service. Required. - :type namespace_name: str - :param task_hub_name: Task Hub name. Required. - :type task_hub_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.durabletask.models.TaskHubUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: TaskHub or the result of cls(response) - :rtype: ~azure.mgmt.durabletask.models.TaskHub - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, - resource_group_name: str, - namespace_name: str, - task_hub_name: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.TaskHub: - """Update a Task Hub. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the service. Required. - :type namespace_name: str - :param task_hub_name: Task Hub name. Required. - :type task_hub_name: str - :param properties: The resource properties to be updated. Required. - :type properties: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: TaskHub or the result of cls(response) - :rtype: ~azure.mgmt.durabletask.models.TaskHub - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def update( - self, - resource_group_name: str, - namespace_name: str, - task_hub_name: str, - properties: Union[_models.TaskHubUpdate, IO[bytes]], - **kwargs: Any - ) -> _models.TaskHub: - """Update a Task Hub. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the service. Required. - :type namespace_name: str - :param task_hub_name: Task Hub name. Required. - :type task_hub_name: str - :param properties: The resource properties to be updated. Is either a TaskHubUpdate type or a - IO[bytes] type. Required. - :type properties: ~azure.mgmt.durabletask.models.TaskHubUpdate or IO[bytes] - :return: TaskHub or the result of cls(response) - :rtype: ~azure.mgmt.durabletask.models.TaskHub - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.TaskHub] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties - else: - _json = self._serialize.body(properties, "TaskHubUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - task_hub_name=task_hub_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("TaskHub", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, namespace_name: str, task_hub_name: str, **kwargs: Any - ) -> None: - """Delete a Task Hub. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the service. Required. - :type namespace_name: str - :param task_hub_name: Task Hub name. Required. - :type task_hub_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - task_hub_name=task_hub_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/py.typed b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/py.typed deleted file mode 100644 index e5aff4f83af..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/version.py b/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/version.py deleted file mode 100644 index e6a39d5dfec..00000000000 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/version.py +++ /dev/null @@ -1,12 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -VERSION = "0.7.1" diff --git a/src/durabletask-preview/setup.cfg b/src/durabletask-preview/setup.cfg deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/durabletask-preview/HISTORY.rst b/src/durabletask/HISTORY.rst similarity index 100% rename from src/durabletask-preview/HISTORY.rst rename to src/durabletask/HISTORY.rst diff --git a/src/durabletask/README.md b/src/durabletask/README.md new file mode 100644 index 00000000000..8cdc003b514 --- /dev/null +++ b/src/durabletask/README.md @@ -0,0 +1,5 @@ +# Azure CLI Durabletask Extension # +This is an extension to Azure CLI to manage Durabletask resources. + +## How to use ## +Please add commands usage here. \ No newline at end of file diff --git a/src/durabletask-preview/azext_durabletask_preview/__init__.py b/src/durabletask/azext_durabletask/__init__.py similarity index 50% rename from src/durabletask-preview/azext_durabletask_preview/__init__.py rename to src/durabletask/azext_durabletask/__init__.py index 97aedded478..519f828db4f 100644 --- a/src/durabletask-preview/azext_durabletask_preview/__init__.py +++ b/src/durabletask/azext_durabletask/__init__.py @@ -1,31 +1,41 @@ # -------------------------------------------------------------------------------------------- # 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 aaz-dev-tools # -------------------------------------------------------------------------------------------- from azure.cli.core import AzCommandsLoader - -from azext_durabletask_preview._help import helps # pylint: disable=unused-import +from azext_durabletask._help import helps # pylint: disable=unused-import class DurabletaskCommandsLoader(AzCommandsLoader): def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType - from azext_durabletask_preview._client_factory import cf_durabletask - durabletask_custom = CliCommandType( - operations_tmpl='azext_durabletask_preview.custom#{}', - client_factory=cf_durabletask) - super(DurabletaskCommandsLoader, self).__init__(cli_ctx=cli_ctx, - custom_command_type=durabletask_custom) + custom_command_type = CliCommandType( + operations_tmpl='azext_durabletask.custom#{}') + super().__init__(cli_ctx=cli_ctx, + custom_command_type=custom_command_type) def load_command_table(self, args): - from azext_durabletask_preview.commands import load_command_table + from azext_durabletask.commands import load_command_table + from azure.cli.core.aaz import load_aaz_command_table + try: + from . import aaz + except ImportError: + aaz = None + if aaz: + load_aaz_command_table( + loader=self, + aaz_pkg_name=aaz.__name__, + args=args + ) load_command_table(self, args) return self.command_table def load_arguments(self, command): - from azext_durabletask_preview._params import load_arguments + from azext_durabletask._params import load_arguments load_arguments(self, command) diff --git a/src/durabletask/azext_durabletask/_help.py b/src/durabletask/azext_durabletask/_help.py new file mode 100644 index 00000000000..126d5d00714 --- /dev/null +++ b/src/durabletask/azext_durabletask/_help.py @@ -0,0 +1,11 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: disable=line-too-long +# pylint: disable=too-many-lines + +from knack.help_files import helps # pylint: disable=unused-import diff --git a/src/durabletask/azext_durabletask/_params.py b/src/durabletask/azext_durabletask/_params.py new file mode 100644 index 00000000000..cfcec717c9c --- /dev/null +++ b/src/durabletask/azext_durabletask/_params.py @@ -0,0 +1,13 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements + + +def load_arguments(self, _): # pylint: disable=unused-argument + pass diff --git a/src/durabletask-preview/azext_durabletask_preview/tests/__init__.py b/src/durabletask/azext_durabletask/aaz/__init__.py similarity index 66% rename from src/durabletask-preview/azext_durabletask_preview/tests/__init__.py rename to src/durabletask/azext_durabletask/aaz/__init__.py index 2dcf9bb68b3..5757aea3175 100644 --- a/src/durabletask-preview/azext_durabletask_preview/tests/__init__.py +++ b/src/durabletask/azext_durabletask/aaz/__init__.py @@ -1,5 +1,6 @@ -# ----------------------------------------------------------------------------- +# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# ----------------------------------------------------------------------------- \ No newline at end of file +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/_version.py b/src/durabletask/azext_durabletask/aaz/latest/__init__.py similarity index 58% rename from src/durabletask-preview/azext_durabletask_preview/vendored_sdks/_version.py rename to src/durabletask/azext_durabletask/aaz/latest/__init__.py index c47f66669f1..f6acc11aa4e 100644 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/_version.py +++ b/src/durabletask/azext_durabletask/aaz/latest/__init__.py @@ -1,9 +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. -# -------------------------------------------------------------------------- +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa -VERSION = "1.0.0" diff --git a/src/durabletask/azext_durabletask/aaz/latest/durabletask/__cmd_group.py b/src/durabletask/azext_durabletask/aaz/latest/durabletask/__cmd_group.py new file mode 100644 index 00000000000..962c5ac01c1 --- /dev/null +++ b/src/durabletask/azext_durabletask/aaz/latest/durabletask/__cmd_group.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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "durabletask", + is_preview=True, +) +class __CMDGroup(AAZCommandGroup): + """Commands to manage Durabletasks. + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/durabletask/azext_durabletask/aaz/latest/durabletask/__init__.py b/src/durabletask/azext_durabletask/aaz/latest/durabletask/__init__.py new file mode 100644 index 00000000000..5a9d61963d6 --- /dev/null +++ b/src/durabletask/azext_durabletask/aaz/latest/durabletask/__init__.py @@ -0,0 +1,11 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * diff --git a/src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/__cmd_group.py b/src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/__cmd_group.py new file mode 100644 index 00000000000..b99c7e5f830 --- /dev/null +++ b/src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/__cmd_group.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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "durabletask namespace", + is_preview=True, +) +class __CMDGroup(AAZCommandGroup): + """Commands to manage Durabletask namespaces + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/__init__.py b/src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/__init__.py new file mode 100644 index 00000000000..db73033039b --- /dev/null +++ b/src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/__init__.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._create import * +from ._delete import * +from ._list import * +from ._show import * +from ._update import * +from ._wait import * diff --git a/src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/_create.py b/src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/_create.py new file mode 100644 index 00000000000..6975637a886 --- /dev/null +++ b/src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/_create.py @@ -0,0 +1,302 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "durabletask namespace create", + is_preview=True, +) +class Create(AAZCommand): + """Create a Namespace + """ + + _aaz_info = { + "version": "2024-02-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.durabletask/namespaces/{}", "2024-02-01-preview"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.namespace_name = AAZStrArg( + options=["-n", "--name", "--namespace-name"], + help="The name of the service", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9-]{3,64}$", + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + help="The name of the resource group", + required=True, + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.ip_allowlist = AAZListArg( + options=["--ip-allowlist"], + arg_group="Properties", + help="IP allow list for durable task service. Values can be Pv4, IPv6 or CIDR", + ) + + ip_allowlist = cls._args_schema.ip_allowlist + ip_allowlist.Element = AAZStrArg() + + # define Arg Group "Resource" + + _args_schema = cls._args_schema + _args_schema.location = AAZResourceLocationArg( + arg_group="Resource", + help="The geo-location where the resource lives", + required=True, + fmt=AAZResourceLocationArgFormat( + resource_group_arg="resource_group", + ), + ) + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Resource", + help="Resource tags.", + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg() + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.NamespacesCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class NamespacesCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200, 201]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/namespaces/{namespaceName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "namespaceName", self.ctx.args.namespace_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2024-02-01-preview", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("location", AAZStrType, ".location", typ_kwargs={"flags": {"required": True}}) + _builder.set_prop("properties", AAZObjectType) + _builder.set_prop("tags", AAZDictType, ".tags") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("ipAllowlist", AAZListType, ".ip_allowlist") + + ip_allowlist = _builder.get(".properties.ipAllowlist") + if ip_allowlist is not None: + ip_allowlist.set_elements(AAZStrType, ".") + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + + _schema_on_200_201 = cls._schema_on_200_201 + _schema_on_200_201.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200_201.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.properties = AAZObjectType() + _schema_on_200_201.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200_201.tags = AAZDictType() + _schema_on_200_201.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties + properties.dashboard_url = AAZStrType( + serialized_name="dashboardUrl", + flags={"read_only": True}, + ) + properties.ip_allowlist = AAZListType( + serialized_name="ipAllowlist", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.url = AAZStrType( + flags={"read_only": True}, + ) + + ip_allowlist = cls._schema_on_200_201.properties.ip_allowlist + ip_allowlist.Element = AAZStrType() + + system_data = cls._schema_on_200_201.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200_201.tags + tags.Element = AAZStrType() + + return cls._schema_on_200_201 + + +class _CreateHelper: + """Helper class for Create""" + + +__all__ = ["Create"] diff --git a/src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/_delete.py b/src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/_delete.py new file mode 100644 index 00000000000..a328dc7ab1b --- /dev/null +++ b/src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/_delete.py @@ -0,0 +1,165 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "durabletask namespace delete", + is_preview=True, + confirmation="Are you sure you want to perform this operation?", +) +class Delete(AAZCommand): + """Delete a Namespace + """ + + _aaz_info = { + "version": "2024-02-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.durabletask/namespaces/{}", "2024-02-01-preview"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, None) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.namespace_name = AAZStrArg( + options=["-n", "--name", "--namespace-name"], + help="The name of the service", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9-]{3,64}$", + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + help="The name of the resource group", + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.NamespacesDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class NamespacesDelete(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [204]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_204, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200, 201]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/namespaces/{namespaceName}", + **self.url_parameters + ) + + @property + def method(self): + return "DELETE" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "namespaceName", self.ctx.args.namespace_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2024-02-01-preview", + required=True, + ), + } + return parameters + + def on_204(self, session): + pass + + def on_200_201(self, session): + pass + + +class _DeleteHelper: + """Helper class for Delete""" + + +__all__ = ["Delete"] diff --git a/src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/_list.py b/src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/_list.py new file mode 100644 index 00000000000..f306d217a48 --- /dev/null +++ b/src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/_list.py @@ -0,0 +1,378 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "durabletask namespace list", + is_preview=True, +) +class List(AAZCommand): + """List Namespace resources by subscription ID + """ + + _aaz_info = { + "version": "2024-02-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.durabletask/namespaces", "2024-02-01-preview"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.durabletask/namespaces", "2024-02-01-preview"], + ] + } + + AZ_SUPPORT_PAGINATION = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_paging(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.resource_group = AAZResourceGroupNameArg( + help="The name of the resource group", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + condition_0 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id) + condition_1 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True + if condition_0: + self.NamespacesListByResourceGroup(ctx=self.ctx)() + if condition_1: + self.NamespacesListBySubscription(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) + next_link = self.deserialize_output(self.ctx.vars.instance.next_link) + return result, next_link + + class NamespacesListByResourceGroup(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/namespaces", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2024-02-01-preview", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + ) + _schema_on_200.value = AAZListType( + flags={"required": True}, + ) + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.location = AAZStrType( + flags={"required": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType() + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.dashboard_url = AAZStrType( + serialized_name="dashboardUrl", + flags={"read_only": True}, + ) + properties.ip_allowlist = AAZListType( + serialized_name="ipAllowlist", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.url = AAZStrType( + flags={"read_only": True}, + ) + + ip_allowlist = cls._schema_on_200.value.Element.properties.ip_allowlist + ip_allowlist.Element = AAZStrType() + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.value.Element.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + class NamespacesListBySubscription(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/providers/Microsoft.DurableTask/namespaces", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2024-02-01-preview", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + ) + _schema_on_200.value = AAZListType( + flags={"required": True}, + ) + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.location = AAZStrType( + flags={"required": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType() + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.dashboard_url = AAZStrType( + serialized_name="dashboardUrl", + flags={"read_only": True}, + ) + properties.ip_allowlist = AAZListType( + serialized_name="ipAllowlist", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.url = AAZStrType( + flags={"read_only": True}, + ) + + ip_allowlist = cls._schema_on_200.value.Element.properties.ip_allowlist + ip_allowlist.Element = AAZStrType() + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.value.Element.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + +__all__ = ["List"] diff --git a/src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/_show.py b/src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/_show.py new file mode 100644 index 00000000000..439d6bc5cde --- /dev/null +++ b/src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/_show.py @@ -0,0 +1,226 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "durabletask namespace show", + is_preview=True, +) +class Show(AAZCommand): + """Get a Namespace + """ + + _aaz_info = { + "version": "2024-02-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.durabletask/namespaces/{}", "2024-02-01-preview"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.namespace_name = AAZStrArg( + options=["-n", "--name", "--namespace-name"], + help="The name of the service", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9-]{3,64}$", + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + help="The name of the resource group", + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.NamespacesGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class NamespacesGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/namespaces/{namespaceName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "namespaceName", self.ctx.args.namespace_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2024-02-01-preview", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType() + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.dashboard_url = AAZStrType( + serialized_name="dashboardUrl", + flags={"read_only": True}, + ) + properties.ip_allowlist = AAZListType( + serialized_name="ipAllowlist", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.url = AAZStrType( + flags={"read_only": True}, + ) + + ip_allowlist = cls._schema_on_200.properties.ip_allowlist + ip_allowlist.Element = AAZStrType() + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + +__all__ = ["Show"] diff --git a/src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/_update.py b/src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/_update.py new file mode 100644 index 00000000000..0b7140a20c7 --- /dev/null +++ b/src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/_update.py @@ -0,0 +1,444 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "durabletask namespace update", + is_preview=True, +) +class Update(AAZCommand): + """Update a Namespace + """ + + _aaz_info = { + "version": "2024-02-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.durabletask/namespaces/{}", "2024-02-01-preview"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + AZ_SUPPORT_GENERIC_UPDATE = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.namespace_name = AAZStrArg( + options=["-n", "--name", "--namespace-name"], + help="The name of the service", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9-]{3,64}$", + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + help="The name of the resource group", + required=True, + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.ip_allowlist = AAZListArg( + options=["--ip-allowlist"], + arg_group="Properties", + help="IP allow list for durable task service. Values can be Pv4, IPv6 or CIDR", + nullable=True, + ) + + ip_allowlist = cls._args_schema.ip_allowlist + ip_allowlist.Element = AAZStrArg( + nullable=True, + ) + + # define Arg Group "Resource" + + _args_schema = cls._args_schema + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Resource", + help="Resource tags.", + nullable=True, + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg( + nullable=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.NamespacesGet(ctx=self.ctx)() + self.pre_instance_update(self.ctx.vars.instance) + self.InstanceUpdateByJson(ctx=self.ctx)() + self.InstanceUpdateByGeneric(ctx=self.ctx)() + self.post_instance_update(self.ctx.vars.instance) + yield self.NamespacesCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + @register_callback + def pre_instance_update(self, instance): + pass + + @register_callback + def post_instance_update(self, instance): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class NamespacesGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/namespaces/{namespaceName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "namespaceName", self.ctx.args.namespace_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2024-02-01-preview", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _UpdateHelper._build_schema_namespace_read(cls._schema_on_200) + + return cls._schema_on_200 + + class NamespacesCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200, 201]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/namespaces/{namespaceName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "namespaceName", self.ctx.args.namespace_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2024-02-01-preview", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + value=self.ctx.vars.instance, + ) + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + _UpdateHelper._build_schema_namespace_read(cls._schema_on_200_201) + + return cls._schema_on_200_201 + + class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance(self.ctx.vars.instance) + + def _update_instance(self, instance): + _instance_value, _builder = self.new_content_builder( + self.ctx.args, + value=instance, + typ=AAZObjectType + ) + _builder.set_prop("properties", AAZObjectType) + _builder.set_prop("tags", AAZDictType, ".tags") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("ipAllowlist", AAZListType, ".ip_allowlist") + + ip_allowlist = _builder.get(".properties.ipAllowlist") + if ip_allowlist is not None: + ip_allowlist.set_elements(AAZStrType, ".") + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return _instance_value + + class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance_by_generic( + self.ctx.vars.instance, + self.ctx.generic_update_args + ) + + +class _UpdateHelper: + """Helper class for Update""" + + _schema_namespace_read = None + + @classmethod + def _build_schema_namespace_read(cls, _schema): + if cls._schema_namespace_read is not None: + _schema.id = cls._schema_namespace_read.id + _schema.location = cls._schema_namespace_read.location + _schema.name = cls._schema_namespace_read.name + _schema.properties = cls._schema_namespace_read.properties + _schema.system_data = cls._schema_namespace_read.system_data + _schema.tags = cls._schema_namespace_read.tags + _schema.type = cls._schema_namespace_read.type + return + + cls._schema_namespace_read = _schema_namespace_read = AAZObjectType() + + namespace_read = _schema_namespace_read + namespace_read.id = AAZStrType( + flags={"read_only": True}, + ) + namespace_read.location = AAZStrType( + flags={"required": True}, + ) + namespace_read.name = AAZStrType( + flags={"read_only": True}, + ) + namespace_read.properties = AAZObjectType() + namespace_read.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + namespace_read.tags = AAZDictType() + namespace_read.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = _schema_namespace_read.properties + properties.dashboard_url = AAZStrType( + serialized_name="dashboardUrl", + flags={"read_only": True}, + ) + properties.ip_allowlist = AAZListType( + serialized_name="ipAllowlist", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.url = AAZStrType( + flags={"read_only": True}, + ) + + ip_allowlist = _schema_namespace_read.properties.ip_allowlist + ip_allowlist.Element = AAZStrType() + + system_data = _schema_namespace_read.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = _schema_namespace_read.tags + tags.Element = AAZStrType() + + _schema.id = cls._schema_namespace_read.id + _schema.location = cls._schema_namespace_read.location + _schema.name = cls._schema_namespace_read.name + _schema.properties = cls._schema_namespace_read.properties + _schema.system_data = cls._schema_namespace_read.system_data + _schema.tags = cls._schema_namespace_read.tags + _schema.type = cls._schema_namespace_read.type + + +__all__ = ["Update"] diff --git a/src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/_wait.py b/src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/_wait.py new file mode 100644 index 00000000000..b0ee22a8e94 --- /dev/null +++ b/src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/_wait.py @@ -0,0 +1,224 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "durabletask namespace wait", +) +class Wait(AAZWaitCommand): + """Place the CLI in a waiting state until a condition is met. + """ + + _aaz_info = { + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.durabletask/namespaces/{}", "2024-02-01-preview"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.namespace_name = AAZStrArg( + options=["-n", "--name", "--namespace-name"], + help="The name of the service", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9-]{3,64}$", + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + help="The name of the resource group", + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.NamespacesGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) + return result + + class NamespacesGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/namespaces/{namespaceName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "namespaceName", self.ctx.args.namespace_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2024-02-01-preview", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType() + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.dashboard_url = AAZStrType( + serialized_name="dashboardUrl", + flags={"read_only": True}, + ) + properties.ip_allowlist = AAZListType( + serialized_name="ipAllowlist", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.url = AAZStrType( + flags={"read_only": True}, + ) + + ip_allowlist = cls._schema_on_200.properties.ip_allowlist + ip_allowlist.Element = AAZStrType() + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _WaitHelper: + """Helper class for Wait""" + + +__all__ = ["Wait"] diff --git a/src/durabletask/azext_durabletask/aaz/latest/durabletask/taskhub/__cmd_group.py b/src/durabletask/azext_durabletask/aaz/latest/durabletask/taskhub/__cmd_group.py new file mode 100644 index 00000000000..c9db4f502b6 --- /dev/null +++ b/src/durabletask/azext_durabletask/aaz/latest/durabletask/taskhub/__cmd_group.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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "durabletask taskhub", + is_preview=True, +) +class __CMDGroup(AAZCommandGroup): + """Commands to manage Durabletask taskhubs. + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/durabletask/azext_durabletask/aaz/latest/durabletask/taskhub/__init__.py b/src/durabletask/azext_durabletask/aaz/latest/durabletask/taskhub/__init__.py new file mode 100644 index 00000000000..c401f439385 --- /dev/null +++ b/src/durabletask/azext_durabletask/aaz/latest/durabletask/taskhub/__init__.py @@ -0,0 +1,16 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._create import * +from ._delete import * +from ._list import * +from ._show import * +from ._update import * diff --git a/src/durabletask/azext_durabletask/aaz/latest/durabletask/taskhub/_create.py b/src/durabletask/azext_durabletask/aaz/latest/durabletask/taskhub/_create.py new file mode 100644 index 00000000000..367240312a1 --- /dev/null +++ b/src/durabletask/azext_durabletask/aaz/latest/durabletask/taskhub/_create.py @@ -0,0 +1,251 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "durabletask taskhub create", + is_preview=True, +) +class Create(AAZCommand): + """Create a Task Hub + """ + + _aaz_info = { + "version": "2024-02-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.durabletask/namespaces/{}/taskhubs/{}", "2024-02-01-preview"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.namespace_name = AAZStrArg( + options=["-s", "--namespace-name"], + help="The name of the namespace", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9-]{3,64}$", + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + help="The name of the resource group", + required=True, + ) + _args_schema.task_hub_name = AAZStrArg( + options=["-n", "--name", "--task-hub-name"], + help="Task Hub name", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9-]{3,64}$", + ), + ) + + # define Arg Group "Resource" + + _args_schema = cls._args_schema + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Resource", + help="Resource tags.", + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg() + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.TaskHubsCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class TaskHubsCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200, 201]: + return self.on_200_201(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/namespaces/{namespaceName}/taskHubs/{taskHubName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "namespaceName", self.ctx.args.namespace_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + **self.serialize_url_param( + "taskHubName", self.ctx.args.task_hub_name, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2024-02-01-preview", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("tags", AAZDictType, ".tags") + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + + _schema_on_200_201 = cls._schema_on_200_201 + _schema_on_200_201.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.properties = AAZObjectType() + _schema_on_200_201.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200_201.tags = AAZDictType() + _schema_on_200_201.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + system_data = cls._schema_on_200_201.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200_201.tags + tags.Element = AAZStrType() + + return cls._schema_on_200_201 + + +class _CreateHelper: + """Helper class for Create""" + + +__all__ = ["Create"] diff --git a/src/durabletask/azext_durabletask/aaz/latest/durabletask/taskhub/_delete.py b/src/durabletask/azext_durabletask/aaz/latest/durabletask/taskhub/_delete.py new file mode 100644 index 00000000000..b8e78eace24 --- /dev/null +++ b/src/durabletask/azext_durabletask/aaz/latest/durabletask/taskhub/_delete.py @@ -0,0 +1,154 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "durabletask taskhub delete", + is_preview=True, + confirmation="Are you sure you want to perform this operation?", +) +class Delete(AAZCommand): + """Delete a Task Hub + """ + + _aaz_info = { + "version": "2024-02-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.durabletask/namespaces/{}/taskhubs/{}", "2024-02-01-preview"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return None + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.namespace_name = AAZStrArg( + options=["-s", "--namespace-name"], + help="The name of the namespace", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9-]{3,64}$", + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + help="The name of the resource group", + required=True, + ) + _args_schema.task_hub_name = AAZStrArg( + options=["-n", "--name", "--task-hub-name"], + help="Task Hub name", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9-]{3,64}$", + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.TaskHubsDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class TaskHubsDelete(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + if session.http_response.status_code in [204]: + return self.on_204(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/namespaces/{namespaceName}/taskHubs/{taskHubName}", + **self.url_parameters + ) + + @property + def method(self): + return "DELETE" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "namespaceName", self.ctx.args.namespace_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + **self.serialize_url_param( + "taskHubName", self.ctx.args.task_hub_name, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2024-02-01-preview", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + def on_204(self, session): + pass + + +class _DeleteHelper: + """Helper class for Delete""" + + +__all__ = ["Delete"] diff --git a/src/durabletask/azext_durabletask/aaz/latest/durabletask/taskhub/_list.py b/src/durabletask/azext_durabletask/aaz/latest/durabletask/taskhub/_list.py new file mode 100644 index 00000000000..7f8d8dfc55d --- /dev/null +++ b/src/durabletask/azext_durabletask/aaz/latest/durabletask/taskhub/_list.py @@ -0,0 +1,222 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "durabletask taskhub list", + is_preview=True, +) +class List(AAZCommand): + """List Task Hubs + """ + + _aaz_info = { + "version": "2024-02-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.durabletask/namespaces/{}/taskhubs", "2024-02-01-preview"], + ] + } + + AZ_SUPPORT_PAGINATION = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_paging(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.namespace_name = AAZStrArg( + options=["-s", "--namespace-name"], + help="The name of the namespace", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9-]{3,64}$", + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + help="The name of the resource group", + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.TaskHubsListByNamespace(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) + next_link = self.deserialize_output(self.ctx.vars.instance.next_link) + return result, next_link + + class TaskHubsListByNamespace(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/namespaces/{namespaceName}/taskHubs", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "namespaceName", self.ctx.args.namespace_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2024-02-01-preview", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + ) + _schema_on_200.value = AAZListType( + flags={"required": True}, + ) + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType() + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.value.Element.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + +__all__ = ["List"] diff --git a/src/durabletask/azext_durabletask/aaz/latest/durabletask/taskhub/_show.py b/src/durabletask/azext_durabletask/aaz/latest/durabletask/taskhub/_show.py new file mode 100644 index 00000000000..8f58d0de5ec --- /dev/null +++ b/src/durabletask/azext_durabletask/aaz/latest/durabletask/taskhub/_show.py @@ -0,0 +1,223 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "durabletask taskhub show", + is_preview=True, +) +class Show(AAZCommand): + """Get a Task Hub + """ + + _aaz_info = { + "version": "2024-02-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.durabletask/namespaces/{}/taskhubs/{}", "2024-02-01-preview"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.namespace_name = AAZStrArg( + options=["-s", "--namespace-name"], + help="The name of the namespace", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9-]{3,64}$", + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + help="The name of the resource group", + required=True, + ) + _args_schema.task_hub_name = AAZStrArg( + options=["-n", "--name", "--task-hub-name"], + help="Task Hub name", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9-]{3,64}$", + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.TaskHubsGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class TaskHubsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/namespaces/{namespaceName}/taskHubs/{taskHubName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "namespaceName", self.ctx.args.namespace_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + **self.serialize_url_param( + "taskHubName", self.ctx.args.task_hub_name, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2024-02-01-preview", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType() + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + +__all__ = ["Show"] diff --git a/src/durabletask/azext_durabletask/aaz/latest/durabletask/taskhub/_update.py b/src/durabletask/azext_durabletask/aaz/latest/durabletask/taskhub/_update.py new file mode 100644 index 00000000000..51e4bf4148b --- /dev/null +++ b/src/durabletask/azext_durabletask/aaz/latest/durabletask/taskhub/_update.py @@ -0,0 +1,402 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "durabletask taskhub update", + is_preview=True, +) +class Update(AAZCommand): + """Update a Task Hub + """ + + _aaz_info = { + "version": "2024-02-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.durabletask/namespaces/{}/taskhubs/{}", "2024-02-01-preview"], + ] + } + + AZ_SUPPORT_GENERIC_UPDATE = True + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.namespace_name = AAZStrArg( + options=["-s", "--namespace-name"], + help="The name of the namespace", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9-]{3,64}$", + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + help="The name of the resource group", + required=True, + ) + _args_schema.task_hub_name = AAZStrArg( + options=["-n", "--name", "--task-hub-name"], + help="Task Hub name", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9-]{3,64}$", + ), + ) + + # define Arg Group "Resource" + + _args_schema = cls._args_schema + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Resource", + help="Resource tags.", + nullable=True, + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg( + nullable=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.TaskHubsGet(ctx=self.ctx)() + self.pre_instance_update(self.ctx.vars.instance) + self.InstanceUpdateByJson(ctx=self.ctx)() + self.InstanceUpdateByGeneric(ctx=self.ctx)() + self.post_instance_update(self.ctx.vars.instance) + self.TaskHubsCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + @register_callback + def pre_instance_update(self, instance): + pass + + @register_callback + def post_instance_update(self, instance): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class TaskHubsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/namespaces/{namespaceName}/taskHubs/{taskHubName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "namespaceName", self.ctx.args.namespace_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + **self.serialize_url_param( + "taskHubName", self.ctx.args.task_hub_name, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2024-02-01-preview", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _UpdateHelper._build_schema_task_hub_read(cls._schema_on_200) + + return cls._schema_on_200 + + class TaskHubsCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200, 201]: + return self.on_200_201(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/namespaces/{namespaceName}/taskHubs/{taskHubName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "namespaceName", self.ctx.args.namespace_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + **self.serialize_url_param( + "taskHubName", self.ctx.args.task_hub_name, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2024-02-01-preview", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + value=self.ctx.vars.instance, + ) + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + _UpdateHelper._build_schema_task_hub_read(cls._schema_on_200_201) + + return cls._schema_on_200_201 + + class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance(self.ctx.vars.instance) + + def _update_instance(self, instance): + _instance_value, _builder = self.new_content_builder( + self.ctx.args, + value=instance, + typ=AAZObjectType + ) + _builder.set_prop("tags", AAZDictType, ".tags") + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return _instance_value + + class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance_by_generic( + self.ctx.vars.instance, + self.ctx.generic_update_args + ) + + +class _UpdateHelper: + """Helper class for Update""" + + _schema_task_hub_read = None + + @classmethod + def _build_schema_task_hub_read(cls, _schema): + if cls._schema_task_hub_read is not None: + _schema.id = cls._schema_task_hub_read.id + _schema.name = cls._schema_task_hub_read.name + _schema.properties = cls._schema_task_hub_read.properties + _schema.system_data = cls._schema_task_hub_read.system_data + _schema.tags = cls._schema_task_hub_read.tags + _schema.type = cls._schema_task_hub_read.type + return + + cls._schema_task_hub_read = _schema_task_hub_read = AAZObjectType() + + task_hub_read = _schema_task_hub_read + task_hub_read.id = AAZStrType( + flags={"read_only": True}, + ) + task_hub_read.name = AAZStrType( + flags={"read_only": True}, + ) + task_hub_read.properties = AAZObjectType() + task_hub_read.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + task_hub_read.tags = AAZDictType() + task_hub_read.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = _schema_task_hub_read.properties + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + system_data = _schema_task_hub_read.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = _schema_task_hub_read.tags + tags.Element = AAZStrType() + + _schema.id = cls._schema_task_hub_read.id + _schema.name = cls._schema_task_hub_read.name + _schema.properties = cls._schema_task_hub_read.properties + _schema.system_data = cls._schema_task_hub_read.system_data + _schema.tags = cls._schema_task_hub_read.tags + _schema.type = cls._schema_task_hub_read.type + + +__all__ = ["Update"] diff --git a/src/durabletask/azext_durabletask/azext_metadata.json b/src/durabletask/azext_durabletask/azext_metadata.json new file mode 100644 index 00000000000..b1e08d1f4b1 --- /dev/null +++ b/src/durabletask/azext_durabletask/azext_metadata.json @@ -0,0 +1,4 @@ +{ + "azext.isPreview": true, + "azext.minCliCoreVersion": "2.61.0" +} \ No newline at end of file diff --git a/src/durabletask-preview/azext_durabletask_preview/tests/latest/test_durabletask_scenario.py b/src/durabletask/azext_durabletask/commands.py similarity index 58% rename from src/durabletask-preview/azext_durabletask_preview/tests/latest/test_durabletask_scenario.py rename to src/durabletask/azext_durabletask/commands.py index 0cb9ba504e1..b0d842e4993 100644 --- a/src/durabletask-preview/azext_durabletask_preview/tests/latest/test_durabletask_scenario.py +++ b/src/durabletask/azext_durabletask/commands.py @@ -1,16 +1,15 @@ # -------------------------------------------------------------------------------------------- # 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 aaz-dev-tools # -------------------------------------------------------------------------------------------- -import os -import unittest +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements -from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer) +# from azure.cli.core.commands import CliCommandType -class DurabletaskScenarioTest(ScenarioTest): - - # @ResourceGroupPreparer(name_prefix='cli_test_durabletask') - def test_durabletask(self): - return +def load_command_table(self, _): # pylint: disable=unused-argument + pass diff --git a/src/durabletask/azext_durabletask/custom.py b/src/durabletask/azext_durabletask/custom.py new file mode 100644 index 00000000000..86df1e48ef5 --- /dev/null +++ b/src/durabletask/azext_durabletask/custom.py @@ -0,0 +1,14 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements + +from knack.log import get_logger + + +logger = get_logger(__name__) diff --git a/src/durabletask-preview/azext_durabletask_preview/tests/latest/__init__.py b/src/durabletask/azext_durabletask/tests/__init__.py similarity index 66% rename from src/durabletask-preview/azext_durabletask_preview/tests/latest/__init__.py rename to src/durabletask/azext_durabletask/tests/__init__.py index 2dcf9bb68b3..5757aea3175 100644 --- a/src/durabletask-preview/azext_durabletask_preview/tests/latest/__init__.py +++ b/src/durabletask/azext_durabletask/tests/__init__.py @@ -1,5 +1,6 @@ -# ----------------------------------------------------------------------------- +# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# ----------------------------------------------------------------------------- \ No newline at end of file +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- diff --git a/src/durabletask/azext_durabletask/tests/latest/__init__.py b/src/durabletask/azext_durabletask/tests/latest/__init__.py new file mode 100644 index 00000000000..5757aea3175 --- /dev/null +++ b/src/durabletask/azext_durabletask/tests/latest/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- diff --git a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/version.py b/src/durabletask/azext_durabletask/tests/latest/test_durabletask.py similarity index 51% rename from src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/version.py rename to src/durabletask/azext_durabletask/tests/latest/test_durabletask.py index 63f83465c87..1049f26f0e0 100644 --- a/src/durabletask-preview/azext_durabletask_preview/vendored_sdks/authoring/version.py +++ b/src/durabletask/azext_durabletask/tests/latest/test_durabletask.py @@ -1,13 +1,13 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- +# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. +# 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. -# -------------------------------------------------------------------------- +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- -VERSION = "2.0" +from azure.cli.testsdk import * + +class DurabletaskScenario(ScenarioTest): + # TODO: add tests here + pass diff --git a/src/durabletask/setup.cfg b/src/durabletask/setup.cfg new file mode 100644 index 00000000000..2fdd96e5d39 --- /dev/null +++ b/src/durabletask/setup.cfg @@ -0,0 +1 @@ +#setup.cfg \ No newline at end of file diff --git a/src/durabletask-preview/setup.py b/src/durabletask/setup.py similarity index 60% rename from src/durabletask-preview/setup.py rename to src/durabletask/setup.py index 01f5abf6b6d..fb75a7997f4 100644 --- a/src/durabletask-preview/setup.py +++ b/src/durabletask/setup.py @@ -1,20 +1,14 @@ -#!/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. +# +# Code generated by aaz-dev-tools # -------------------------------------------------------------------------------------------- - from codecs import open from setuptools import setup, find_packages -try: - from azure_bdist_wheel import cmdclass -except ImportError: - from distutils import log as logger - logger.warn("Wheel is not available, disabling bdist_wheel hook") -# TODO: Confirm this is the right version number you want and it matches your + # HISTORY.rst entry. VERSION = '1.0.0b1' @@ -26,33 +20,30 @@ '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', + 'Programming Language :: Python :: 3.9', 'License :: OSI Approved :: MIT License', ] -# TODO: Add any additional SDK dependencies here DEPENDENCIES = [] -with open('README.rst', 'r', encoding='utf-8') as f: +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='durabletask-preview', + name='durabletask', version=VERSION, - description='Microsoft Azure Command-Line Tools Durabletask Extension', - # TODO: Update author and email, if applicable - author='Microsoft Corporation', - author_email='azpycli@microsoft.com', - # TODO: change to your extension source code repo if the code will not be put in azure-cli-extensions repo - url='https://github.com/Azure/azure-cli-extensions/tree/master/src/durabletask', + description='Microsoft Azure Command-Line Tools Durabletask Extension.', long_description=README + '\n\n' + HISTORY, license='MIT', + author='Microsoft Corporation', + author_email='azpycli@microsoft.com', + url='https://github.com/Azure/azure-cli-extensions/tree/main/src/durabletask', classifiers=CLASSIFIERS, - packages=find_packages(), - install_requires=DEPENDENCIES, - package_data={'azext_durabletask_preview': ['azext_metadata.json']}, + packages=find_packages(exclude=["tests"]), + package_data={'azext_durabletask': ['azext_metadata.json']}, + install_requires=DEPENDENCIES ) From 4b46f6a76a7ee3d2f0c6fba42364bae6076c9d00 Mon Sep 17 00:00:00 2001 From: Ryan Lettieri Date: Mon, 16 Sep 2024 10:00:01 -0600 Subject: [PATCH 16/19] Fixing Codeowners Signed-off-by: Ryan Lettieri --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 765f2164765..16435bc6a39 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -326,4 +326,4 @@ /src/azext_gallery-service-artifact/ @rohitbhoopalam -/src/azext_durabletask-preview/ @RyanLettieri +/src/azext_durabletask/ @RyanLettieri From 29c4214016f4813a41b4d36e21558f4267a4a383 Mon Sep 17 00:00:00 2001 From: Ryan Lettieri Date: Mon, 16 Sep 2024 10:32:33 -0600 Subject: [PATCH 17/19] Updating min cli version for durabletask Signed-off-by: Ryan Lettieri --- src/durabletask/azext_durabletask/azext_metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/durabletask/azext_durabletask/azext_metadata.json b/src/durabletask/azext_durabletask/azext_metadata.json index b1e08d1f4b1..9491320bc7d 100644 --- a/src/durabletask/azext_durabletask/azext_metadata.json +++ b/src/durabletask/azext_durabletask/azext_metadata.json @@ -1,4 +1,4 @@ { "azext.isPreview": true, - "azext.minCliCoreVersion": "2.61.0" + "azext.minCliCoreVersion": "2.48.0" } \ No newline at end of file From 4c3c20e6aff34cdba22f2385a283013516d25d32 Mon Sep 17 00:00:00 2001 From: Ryan Lettieri Date: Mon, 16 Sep 2024 11:45:35 -0600 Subject: [PATCH 18/19] Adding always pass test Signed-off-by: Ryan Lettieri --- src/durabletask/azext_durabletask/azext_metadata.json | 2 +- .../azext_durabletask/tests/latest/test_durabletask.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/durabletask/azext_durabletask/azext_metadata.json b/src/durabletask/azext_durabletask/azext_metadata.json index 9491320bc7d..b1e08d1f4b1 100644 --- a/src/durabletask/azext_durabletask/azext_metadata.json +++ b/src/durabletask/azext_durabletask/azext_metadata.json @@ -1,4 +1,4 @@ { "azext.isPreview": true, - "azext.minCliCoreVersion": "2.48.0" + "azext.minCliCoreVersion": "2.61.0" } \ No newline at end of file diff --git a/src/durabletask/azext_durabletask/tests/latest/test_durabletask.py b/src/durabletask/azext_durabletask/tests/latest/test_durabletask.py index 1049f26f0e0..b11a19813ff 100644 --- a/src/durabletask/azext_durabletask/tests/latest/test_durabletask.py +++ b/src/durabletask/azext_durabletask/tests/latest/test_durabletask.py @@ -9,5 +9,5 @@ class DurabletaskScenario(ScenarioTest): - # TODO: add tests here - pass + def test_help(self): + pass From e242a2294e27d119af8fc1e0df7f8256e4a73b3a Mon Sep 17 00:00:00 2001 From: Ryan Lettieri Date: Tue, 17 Sep 2024 20:49:24 -0600 Subject: [PATCH 19/19] Updating readme and adding examples for durabletask commands Signed-off-by: Ryan Lettieri --- src/durabletask/README.md | 33 ++++++++++++++++++- .../latest/durabletask/namespace/_create.py | 3 ++ .../latest/durabletask/namespace/_delete.py | 3 ++ .../aaz/latest/durabletask/namespace/_list.py | 3 ++ .../aaz/latest/durabletask/namespace/_show.py | 5 ++- .../aaz/latest/durabletask/namespace/_wait.py | 2 +- .../aaz/latest/durabletask/taskhub/_create.py | 3 ++ .../aaz/latest/durabletask/taskhub/_delete.py | 3 ++ .../aaz/latest/durabletask/taskhub/_list.py | 3 ++ .../aaz/latest/durabletask/taskhub/_show.py | 3 ++ 10 files changed, 58 insertions(+), 3 deletions(-) diff --git a/src/durabletask/README.md b/src/durabletask/README.md index 8cdc003b514..744aeeef94e 100644 --- a/src/durabletask/README.md +++ b/src/durabletask/README.md @@ -2,4 +2,35 @@ This is an extension to Azure CLI to manage Durabletask resources. ## How to use ## -Please add commands usage here. \ No newline at end of file +Install this extension using the following CLI command `az extension add --name durabletask`. + +Remove this extension using the following CLI command `az extension remove --name durabletask`. + +For more information on how to use this service, run the following CLI commands: + +` az durabletask namespace -h ` +` az durabletask taskhub -h ` + +You can create a namespace with the following command: +` az durabletask namespace create -g "" -n ""` + +List all the namespaces in your resource group: +` az durabletask namespace list -g ` + +Show the information for a particular namespace within a resource group: +` az durabletask namespace show -g -n ` + +Delete a namespace: +` az durabletask namespace delete -g -n ` + +You can create a taskhub with the following command: +` az durabletask taskhub create -g -s -n ` + +List all taskhubs within a particular namespace: +` az durabletask taskhub list -g -n ` + +Show information on a single taskhub: +` az durabletask taskhub show -g -s -n ` + +Delete a taskhub: +` az durabletask taskhub delete -g -s -n ` \ No newline at end of file diff --git a/src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/_create.py b/src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/_create.py index 6975637a886..bc014ad0a8f 100644 --- a/src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/_create.py +++ b/src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/_create.py @@ -17,6 +17,9 @@ ) class Create(AAZCommand): """Create a Namespace + + :example: Create a namespace in northcentralus + az durabletask namespace create -g resource-group-name -n namespace-name --location northcentralus """ _aaz_info = { diff --git a/src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/_delete.py b/src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/_delete.py index a328dc7ab1b..573be66fba3 100644 --- a/src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/_delete.py +++ b/src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/_delete.py @@ -18,6 +18,9 @@ ) class Delete(AAZCommand): """Delete a Namespace + + :example: Delete a namespace + az durabletask namespace delete -g resource-group-name -n namespace-name """ _aaz_info = { diff --git a/src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/_list.py b/src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/_list.py index f306d217a48..905d3da1654 100644 --- a/src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/_list.py +++ b/src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/_list.py @@ -17,6 +17,9 @@ ) class List(AAZCommand): """List Namespace resources by subscription ID + + :example: List all namespaces in a resource group + az durabletask namespace list -g resource-group-name """ _aaz_info = { diff --git a/src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/_show.py b/src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/_show.py index 439d6bc5cde..766b02eeeb8 100644 --- a/src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/_show.py +++ b/src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/_show.py @@ -17,6 +17,9 @@ ) class Show(AAZCommand): """Get a Namespace + + :example: Show information on a particular namespace + az durabletask namespace show -g resource-group-name -n namespace-name """ _aaz_info = { @@ -44,7 +47,7 @@ def _build_arguments_schema(cls, *args, **kwargs): _args_schema = cls._args_schema _args_schema.namespace_name = AAZStrArg( options=["-n", "--name", "--namespace-name"], - help="The name of the service", + help="The name of the namespace", required=True, id_part="name", fmt=AAZStrArgFormat( diff --git a/src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/_wait.py b/src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/_wait.py index b0ee22a8e94..d9570bcdd6e 100644 --- a/src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/_wait.py +++ b/src/durabletask/azext_durabletask/aaz/latest/durabletask/namespace/_wait.py @@ -42,7 +42,7 @@ def _build_arguments_schema(cls, *args, **kwargs): _args_schema = cls._args_schema _args_schema.namespace_name = AAZStrArg( options=["-n", "--name", "--namespace-name"], - help="The name of the service", + help="The name of the namespace", required=True, id_part="name", fmt=AAZStrArgFormat( diff --git a/src/durabletask/azext_durabletask/aaz/latest/durabletask/taskhub/_create.py b/src/durabletask/azext_durabletask/aaz/latest/durabletask/taskhub/_create.py index 367240312a1..f99f630d13d 100644 --- a/src/durabletask/azext_durabletask/aaz/latest/durabletask/taskhub/_create.py +++ b/src/durabletask/azext_durabletask/aaz/latest/durabletask/taskhub/_create.py @@ -17,6 +17,9 @@ ) class Create(AAZCommand): """Create a Task Hub + + :example: Create a taskhub in a namespace + az durabletask taskhub create -g resource-grou-name -s testnamespace -n taskhub-name """ _aaz_info = { diff --git a/src/durabletask/azext_durabletask/aaz/latest/durabletask/taskhub/_delete.py b/src/durabletask/azext_durabletask/aaz/latest/durabletask/taskhub/_delete.py index b8e78eace24..0989617377c 100644 --- a/src/durabletask/azext_durabletask/aaz/latest/durabletask/taskhub/_delete.py +++ b/src/durabletask/azext_durabletask/aaz/latest/durabletask/taskhub/_delete.py @@ -18,6 +18,9 @@ ) class Delete(AAZCommand): """Delete a Task Hub + + :example: Delete a taskhub + az durabletask taskhub delete -g resource-grou-name -s namespace-name -n taskhub-name """ _aaz_info = { diff --git a/src/durabletask/azext_durabletask/aaz/latest/durabletask/taskhub/_list.py b/src/durabletask/azext_durabletask/aaz/latest/durabletask/taskhub/_list.py index 7f8d8dfc55d..85bb0ac0b65 100644 --- a/src/durabletask/azext_durabletask/aaz/latest/durabletask/taskhub/_list.py +++ b/src/durabletask/azext_durabletask/aaz/latest/durabletask/taskhub/_list.py @@ -17,6 +17,9 @@ ) class List(AAZCommand): """List Task Hubs + + :example: List all taskhubs for a given namespace + az durabletask taskhub show -g resource-group-name -s namespace-name """ _aaz_info = { diff --git a/src/durabletask/azext_durabletask/aaz/latest/durabletask/taskhub/_show.py b/src/durabletask/azext_durabletask/aaz/latest/durabletask/taskhub/_show.py index 8f58d0de5ec..cab9504d9fe 100644 --- a/src/durabletask/azext_durabletask/aaz/latest/durabletask/taskhub/_show.py +++ b/src/durabletask/azext_durabletask/aaz/latest/durabletask/taskhub/_show.py @@ -17,6 +17,9 @@ ) class Show(AAZCommand): """Get a Task Hub + + :example: Show information on a particular taskhub + az durabletask taskhub show -g resource-group-name -s namespace-name -n taskhub-name """ _aaz_info = {