From 28d50cc473ac19548d5ae976b2fa531d4df0a861 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Sun, 25 Nov 2018 11:43:22 +0000 Subject: [PATCH 01/12] Generated from 431fadac7b30b7c33b9fa6468874fce839869345 fixing build errors --- .../luis/authoring/luis_authoring_client.py | 269 ++++++++++++++++++ .../luis/authoring/models/__init__.py | 3 + .../models/azure_account_info_object.py | 44 +++ .../models/azure_account_info_object_py3.py | 44 +++ 4 files changed, 360 insertions(+) create mode 100644 azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/azure_account_info_object.py create mode 100644 azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/azure_account_info_object_py3.py diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/luis_authoring_client.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/luis_authoring_client.py index 697917008e81..5a615ac3aa9b 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/luis_authoring_client.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/luis_authoring_client.py @@ -12,6 +12,7 @@ from msrest.service_client import SDKClient from msrest import Configuration, Serializer, Deserializer from .version import VERSION +from msrest.pipeline import ClientRawResponse from msrest.exceptions import HttpOperationError from .operations.features_operations import FeaturesOperations from .operations.examples_operations import ExamplesOperations @@ -117,3 +118,271 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.settings = SettingsOperations( self._client, self.config, self._serialize, self._deserialize) + + def fivebe_three_two_two_two_eighte_eight_four_seven_threede_one_one_six_three_two_five_five_one_five( + self, app_id, azure_account_info_object=None, custom_headers=None, raw=False, **operation_config): + """apps - Assign a LUIS azure accounts to an application. + + Assigns an azure account to the application. + + :param app_id: The application ID. + :type app_id: 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: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`HttpOperationError` + """ + # Construct URL + url = self.fivebe_three_two_two_two_eighte_eight_four_seven_threede_one_one_six_three_two_five_five_one_five.metadata['url'] + path_format_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 + 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, 400, 401, 403, 429]: + raise HttpOperationError(self._deserialize, response) + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('OperationStatus', response) + if response.status_code == 400: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 401: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 403: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 429: + deserialized = self._deserialize('ErrorResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + fivebe_three_two_two_two_eighte_eight_four_seven_threede_one_one_six_three_two_five_five_one_five.metadata = {'url': '/apps/{appId}/azureaccounts'} + + def fivebe_three_two_zero_two_eighta_oned_four_eightf_eight_eightcfd_five_sevene_two_zero( + self, app_id, 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 dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`HttpOperationError` + """ + # Construct URL + url = self.fivebe_three_two_zero_two_eighta_oned_four_eightf_eight_eightcfd_five_sevene_two_zero.metadata['url'] + path_format_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, 400, 401, 403, 429]: + raise HttpOperationError(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[AzureAccountInfoObject]', response) + if response.status_code == 400: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 401: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 403: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 429: + deserialized = self._deserialize('ErrorResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + fivebe_three_two_zero_two_eighta_oned_four_eightf_eight_eightcfd_five_sevene_two_zero.metadata = {'url': '/apps/{appId}/azureaccounts'} + + def fivebe_three_two_five_five_fourf_eight_five_nine_onedb_threea_eight_six_two_three_twoe_one( + self, app_id, 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 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: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`HttpOperationError` + """ + # Construct URL + url = self.fivebe_three_two_five_five_fourf_eight_five_nine_onedb_threea_eight_six_two_three_twoe_one.metadata['url'] + path_format_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 + 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, 400, 401, 403, 429]: + raise HttpOperationError(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + if response.status_code == 400: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 401: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 403: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 429: + deserialized = self._deserialize('ErrorResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + fivebe_three_two_five_five_fourf_eight_five_nine_onedb_threea_eight_six_two_three_twoe_one.metadata = {'url': '/apps/{appId}/azureaccounts'} + + def fivebe_three_one_threecec_one_eight_oneae_seven_two_zeroaa_twob_two_sixc( + self, 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 dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`HttpOperationError` + """ + # Construct URL + url = self.fivebe_three_one_threecec_one_eight_oneae_seven_two_zeroaa_twob_two_sixc.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, 400, 401, 403, 429]: + raise HttpOperationError(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[AzureAccountInfoObject]', response) + if response.status_code == 400: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 401: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 403: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 429: + deserialized = self._deserialize('ErrorResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + fivebe_three_one_threecec_one_eight_oneae_seven_two_zeroaa_twob_two_sixc.metadata = {'url': '/azureaccounts'} diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/__init__.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/__init__.py index 235f2f5dc58e..ba32b6e3600a 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/__init__.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/__init__.py @@ -109,6 +109,7 @@ from .pattern_rule_info_py3 import PatternRuleInfo from .label_text_object_py3 import LabelTextObject from .app_version_setting_object_py3 import AppVersionSettingObject + from .azure_account_info_object_py3 import AzureAccountInfoObject from .hierarchical_child_model_update_object_py3 import HierarchicalChildModelUpdateObject from .hierarchical_child_model_create_object_py3 import HierarchicalChildModelCreateObject from .composite_child_model_create_object_py3 import CompositeChildModelCreateObject @@ -212,6 +213,7 @@ from .pattern_rule_info import PatternRuleInfo from .label_text_object import LabelTextObject from .app_version_setting_object import AppVersionSettingObject + from .azure_account_info_object import AzureAccountInfoObject from .hierarchical_child_model_update_object import HierarchicalChildModelUpdateObject from .hierarchical_child_model_create_object import HierarchicalChildModelCreateObject from .composite_child_model_create_object import CompositeChildModelCreateObject @@ -320,6 +322,7 @@ 'PatternRuleInfo', 'LabelTextObject', 'AppVersionSettingObject', + 'AzureAccountInfoObject', 'HierarchicalChildModelUpdateObject', 'HierarchicalChildModelCreateObject', 'CompositeChildModelCreateObject', diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/azure_account_info_object.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/azure_account_info_object.py new file mode 100644 index 000000000000..edc9ef3ab968 --- /dev/null +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/azure_account_info_object.py @@ -0,0 +1,44 @@ +# 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 + + +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) diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/azure_account_info_object_py3.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/azure_account_info_object_py3.py new file mode 100644 index 000000000000..e0cefd0de20e --- /dev/null +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/azure_account_info_object_py3.py @@ -0,0 +1,44 @@ +# 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 + + +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 From 4b2d3e9e3c5023af02b75417df190515feee297c Mon Sep 17 00:00:00 2001 From: azuresdkci Date: Sun, 25 Nov 2018 11:48:23 +0000 Subject: [PATCH 02/12] Packaging update of azure-cognitiveservices-language-luis --- .../MANIFEST.in | 5 +- .../azure/__init__.py | 2 +- .../azure/cognitiveservices/__init__.py | 2 +- .../cognitiveservices/language/__init__.py | 2 +- .../azure_bdist_wheel.py | 54 ------------------- .../setup.cfg | 1 - .../setup.py | 18 ++++--- 7 files changed, 17 insertions(+), 67 deletions(-) delete mode 100644 azure-cognitiveservices-language-luis/azure_bdist_wheel.py diff --git a/azure-cognitiveservices-language-luis/MANIFEST.in b/azure-cognitiveservices-language-luis/MANIFEST.in index 9ecaeb15de50..7f728a95d094 100644 --- a/azure-cognitiveservices-language-luis/MANIFEST.in +++ b/azure-cognitiveservices-language-luis/MANIFEST.in @@ -1,2 +1,5 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file +include azure/__init__.py +include azure/cognitiveservices/__init__.py +include azure/cognitiveservices/language/__init__.py + diff --git a/azure-cognitiveservices-language-luis/azure/__init__.py b/azure-cognitiveservices-language-luis/azure/__init__.py index de40ea7ca058..0260537a02bb 100644 --- a/azure-cognitiveservices-language-luis/azure/__init__.py +++ b/azure-cognitiveservices-language-luis/azure/__init__.py @@ -1 +1 @@ -__import__('pkg_resources').declare_namespace(__name__) +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/__init__.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/__init__.py index de40ea7ca058..0260537a02bb 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/__init__.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/__init__.py @@ -1 +1 @@ -__import__('pkg_resources').declare_namespace(__name__) +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/__init__.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/__init__.py index de40ea7ca058..0260537a02bb 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/__init__.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/__init__.py @@ -1 +1 @@ -__import__('pkg_resources').declare_namespace(__name__) +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-cognitiveservices-language-luis/azure_bdist_wheel.py b/azure-cognitiveservices-language-luis/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b61775..000000000000 --- a/azure-cognitiveservices-language-luis/azure_bdist_wheel.py +++ /dev/null @@ -1,54 +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 distutils import log as logger -import os.path - -from wheel.bdist_wheel import bdist_wheel -class azure_bdist_wheel(bdist_wheel): - """The purpose of this class is to build wheel a little differently than the sdist, - without requiring to build the wheel from the sdist (i.e. you can build the wheel - directly from source). - """ - - description = "Create an Azure wheel distribution" - - user_options = bdist_wheel.user_options + \ - [('azure-namespace-package=', None, - "Name of the deepest nspkg used")] - - def initialize_options(self): - bdist_wheel.initialize_options(self) - self.azure_namespace_package = None - - def finalize_options(self): - bdist_wheel.finalize_options(self) - if self.azure_namespace_package and not self.azure_namespace_package.endswith("-nspkg"): - raise ValueError("azure_namespace_package must finish by -nspkg") - - def run(self): - if not self.distribution.install_requires: - self.distribution.install_requires = [] - self.distribution.install_requires.append( - "{}>=2.0.0".format(self.azure_namespace_package)) - bdist_wheel.run(self) - - def write_record(self, bdist_dir, distinfo_dir): - if self.azure_namespace_package: - # Split and remove last part, assuming it's "nspkg" - subparts = self.azure_namespace_package.split('-')[0:-1] - folder_with_init = [os.path.join(*subparts[0:i+1]) for i in range(len(subparts))] - for azure_sub_package in folder_with_init: - init_file = os.path.join(bdist_dir, azure_sub_package, '__init__.py') - if os.path.isfile(init_file): - logger.info("manually remove {} while building the wheel".format(init_file)) - os.remove(init_file) - else: - raise ValueError("Unable to find {}. Are you sure of your namespace package?".format(init_file)) - bdist_wheel.write_record(self, bdist_dir, distinfo_dir) -cmdclass = { - 'bdist_wheel': azure_bdist_wheel, -} diff --git a/azure-cognitiveservices-language-luis/setup.cfg b/azure-cognitiveservices-language-luis/setup.cfg index 2d986195ea2f..3c6e79cf31da 100644 --- a/azure-cognitiveservices-language-luis/setup.cfg +++ b/azure-cognitiveservices-language-luis/setup.cfg @@ -1,3 +1,2 @@ [bdist_wheel] universal=1 -azure-namespace-package=azure-cognitiveservices-language-nspkg \ No newline at end of file diff --git a/azure-cognitiveservices-language-luis/setup.py b/azure-cognitiveservices-language-luis/setup.py index cf9f2f5a5b34..467a156b460d 100644 --- a/azure-cognitiveservices-language-luis/setup.py +++ b/azure-cognitiveservices-language-luis/setup.py @@ -10,12 +10,6 @@ import os.path from io import open from setuptools import find_packages, setup -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") - cmdclass = {} # Change the PACKAGE_NAME only to change folder and different name PACKAGE_NAME = "azure-cognitiveservices-language-luis" @@ -76,11 +70,19 @@ 'License :: OSI Approved :: MIT License', ], zip_safe=False, - packages=find_packages(exclude=["tests"]), + packages=find_packages(exclude=[ + 'tests', + # Exclude packages that will be covered by PEP420 or nspkg + 'azure', + 'azure.cognitiveservices', + 'azure.cognitiveservices.language', + ]), install_requires=[ 'msrest>=0.5.0', 'msrestazure>=0.4.32,<2.0.0', 'azure-common~=1.1', ], - cmdclass=cmdclass + extras_require={ + ":python_version<'3.0'": ['azure-cognitiveservices-language-nspkg'], + } ) From 213691e3f6910876c9cd9e9441a9f8abf10a6022 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Sun, 25 Nov 2018 12:24:13 +0000 Subject: [PATCH 03/12] Generated from 82cee8e19ad81e9d82d712cfabad1649b91b619a Merge pull request #1 from omarelhariry/a-moghan/PublishingResponses Adding Publishing To Regions Status --- .../language/luis/authoring/models/endpoint_info.py | 4 ++++ .../luis/authoring/models/endpoint_info_py3.py | 6 +++++- .../models/production_or_staging_endpoint_info.py | 3 +++ .../production_or_staging_endpoint_info_py3.py | 7 +++++-- .../luis/authoring/operations/apps_operations.py | 13 +++++++------ 5 files changed, 24 insertions(+), 9 deletions(-) diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/endpoint_info.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/endpoint_info.py index be6fd40e4f7d..b856fa279c9d 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/endpoint_info.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/endpoint_info.py @@ -28,6 +28,8 @@ class EndpointInfo(Model): :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 """ @@ -39,6 +41,7 @@ class EndpointInfo(Model): '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'}, } @@ -50,4 +53,5 @@ def __init__(self, **kwargs): 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) diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/endpoint_info_py3.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/endpoint_info_py3.py index 3e8f171a9067..8673ea254c98 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/endpoint_info_py3.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/endpoint_info_py3.py @@ -28,6 +28,8 @@ class EndpointInfo(Model): :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 """ @@ -39,10 +41,11 @@ class EndpointInfo(Model): '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, published_date_time: str=None, **kwargs) -> None: + 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 @@ -50,4 +53,5 @@ def __init__(self, *, version_id: str=None, is_staging: bool=None, 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 diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/production_or_staging_endpoint_info.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/production_or_staging_endpoint_info.py index a51c82080aec..c7e36e53396d 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/production_or_staging_endpoint_info.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/production_or_staging_endpoint_info.py @@ -28,6 +28,8 @@ class ProductionOrStagingEndpointInfo(EndpointInfo): :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 """ @@ -39,6 +41,7 @@ class ProductionOrStagingEndpointInfo(EndpointInfo): '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'}, } diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/production_or_staging_endpoint_info_py3.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/production_or_staging_endpoint_info_py3.py index c6a1ee157c3e..edc0837d4135 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/production_or_staging_endpoint_info_py3.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/production_or_staging_endpoint_info_py3.py @@ -28,6 +28,8 @@ class ProductionOrStagingEndpointInfo(EndpointInfo): :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 """ @@ -39,8 +41,9 @@ class ProductionOrStagingEndpointInfo(EndpointInfo): '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, 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, published_date_time=published_date_time, **kwargs) + 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) diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/apps_operations.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/apps_operations.py index 8d8753b35a2d..a65c27c0f48a 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/apps_operations.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/apps_operations.py @@ -661,11 +661,8 @@ def publish( 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 + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ @@ -696,13 +693,17 @@ def publish( 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]: + if response.status_code not in [201, 207, 503]: 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 response.status_code == 503: + deserialized = self._deserialize('str', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) From 4b2e8baffad2178399ae31aed2603c655ce6ffaa Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 27 Nov 2018 12:21:46 +0000 Subject: [PATCH 04/12] Generated from 23a7c077da0b751b8ad2b246d8da041d0906f90d Fixing formats --- .../luis/authoring/luis_authoring_client.py | 274 +----------------- .../luis/authoring/models/__init__.py | 9 +- .../models/azure_account_info_object.py | 44 --- .../models/azure_account_info_object_py3.py | 44 --- ...ispatch_connected_service_delete_object.py | 28 ++ ...tch_connected_service_delete_object_py3.py | 28 ++ .../dispatch_connected_service_object.py | 53 ++++ .../dispatch_connected_service_object_py3.py | 53 ++++ .../luis/authoring/models/endpoint_info.py | 4 - .../authoring/models/endpoint_info_py3.py | 6 +- .../production_or_staging_endpoint_info.py | 3 - ...production_or_staging_endpoint_info_py3.py | 7 +- .../luis/authoring/operations/__init__.py | 2 + .../authoring/operations/apps_operations.py | 13 +- .../operations/dispatch_operations.py | 226 +++++++++++++++ 15 files changed, 410 insertions(+), 384 deletions(-) delete mode 100644 azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/azure_account_info_object.py delete mode 100644 azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/azure_account_info_object_py3.py create mode 100644 azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_delete_object.py create mode 100644 azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_delete_object_py3.py create mode 100644 azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_object.py create mode 100644 azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_object_py3.py create mode 100644 azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/dispatch_operations.py diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/luis_authoring_client.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/luis_authoring_client.py index 5a615ac3aa9b..d53c49366596 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/luis_authoring_client.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/luis_authoring_client.py @@ -12,7 +12,6 @@ from msrest.service_client import SDKClient from msrest import Configuration, Serializer, Deserializer from .version import VERSION -from msrest.pipeline import ClientRawResponse from msrest.exceptions import HttpOperationError from .operations.features_operations import FeaturesOperations from .operations.examples_operations import ExamplesOperations @@ -23,6 +22,7 @@ from .operations.permissions_operations import PermissionsOperations from .operations.pattern_operations import PatternOperations from .operations.settings_operations import SettingsOperations +from .operations.dispatch_operations import DispatchOperations from . import models @@ -80,6 +80,8 @@ class LUISAuthoringClient(SDKClient): :vartype pattern: azure.cognitiveservices.language.luis.authoring.operations.PatternOperations :ivar settings: Settings operations :vartype settings: azure.cognitiveservices.language.luis.authoring.operations.SettingsOperations + :ivar dispatch: Dispatch operations + :vartype dispatch: azure.cognitiveservices.language.luis.authoring.operations.DispatchOperations :param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com). @@ -118,271 +120,5 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.settings = SettingsOperations( self._client, self.config, self._serialize, self._deserialize) - - def fivebe_three_two_two_two_eighte_eight_four_seven_threede_one_one_six_three_two_five_five_one_five( - self, app_id, azure_account_info_object=None, custom_headers=None, raw=False, **operation_config): - """apps - Assign a LUIS azure accounts to an application. - - Assigns an azure account to the application. - - :param app_id: The application ID. - :type app_id: 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: object or ClientRawResponse if raw=true - :rtype: object or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`HttpOperationError` - """ - # Construct URL - url = self.fivebe_three_two_two_two_eighte_eight_four_seven_threede_one_one_six_three_two_five_five_one_five.metadata['url'] - path_format_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 - 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, 400, 401, 403, 429]: - raise HttpOperationError(self._deserialize, response) - - deserialized = None - - if response.status_code == 201: - deserialized = self._deserialize('OperationStatus', response) - if response.status_code == 400: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 401: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 403: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 429: - deserialized = self._deserialize('ErrorResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - fivebe_three_two_two_two_eighte_eight_four_seven_threede_one_one_six_three_two_five_five_one_five.metadata = {'url': '/apps/{appId}/azureaccounts'} - - def fivebe_three_two_zero_two_eighta_oned_four_eightf_eight_eightcfd_five_sevene_two_zero( - self, app_id, 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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: object or ClientRawResponse if raw=true - :rtype: object or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`HttpOperationError` - """ - # Construct URL - url = self.fivebe_three_two_zero_two_eighta_oned_four_eightf_eight_eightcfd_five_sevene_two_zero.metadata['url'] - path_format_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, 400, 401, 403, 429]: - raise HttpOperationError(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[AzureAccountInfoObject]', response) - if response.status_code == 400: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 401: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 403: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 429: - deserialized = self._deserialize('ErrorResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - fivebe_three_two_zero_two_eighta_oned_four_eightf_eight_eightcfd_five_sevene_two_zero.metadata = {'url': '/apps/{appId}/azureaccounts'} - - def fivebe_three_two_five_five_fourf_eight_five_nine_onedb_threea_eight_six_two_three_twoe_one( - self, app_id, 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 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: object or ClientRawResponse if raw=true - :rtype: object or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`HttpOperationError` - """ - # Construct URL - url = self.fivebe_three_two_five_five_fourf_eight_five_nine_onedb_threea_eight_six_two_three_twoe_one.metadata['url'] - path_format_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 - 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, 400, 401, 403, 429]: - raise HttpOperationError(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - if response.status_code == 400: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 401: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 403: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 429: - deserialized = self._deserialize('ErrorResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - fivebe_three_two_five_five_fourf_eight_five_nine_onedb_threea_eight_six_two_three_twoe_one.metadata = {'url': '/apps/{appId}/azureaccounts'} - - def fivebe_three_one_threecec_one_eight_oneae_seven_two_zeroaa_twob_two_sixc( - self, 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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: object or ClientRawResponse if raw=true - :rtype: object or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`HttpOperationError` - """ - # Construct URL - url = self.fivebe_three_one_threecec_one_eight_oneae_seven_two_zeroaa_twob_two_sixc.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, 400, 401, 403, 429]: - raise HttpOperationError(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[AzureAccountInfoObject]', response) - if response.status_code == 400: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 401: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 403: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 429: - deserialized = self._deserialize('ErrorResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - fivebe_three_one_threecec_one_eight_oneae_seven_two_zeroaa_twob_two_sixc.metadata = {'url': '/azureaccounts'} + self.dispatch = DispatchOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/__init__.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/__init__.py index ba32b6e3600a..7d422a24d1fb 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/__init__.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/__init__.py @@ -21,6 +21,8 @@ from .application_setting_update_object_py3 import ApplicationSettingUpdateObject from .publish_setting_update_object_py3 import PublishSettingUpdateObject from .example_label_object_py3 import ExampleLabelObject + from .dispatch_connected_service_delete_object_py3 import DispatchConnectedServiceDeleteObject + from .dispatch_connected_service_object_py3 import DispatchConnectedServiceObject from .phraselist_create_object_py3 import PhraselistCreateObject from .sub_closed_list_py3 import SubClosedList from .sub_closed_list_response_py3 import SubClosedListResponse @@ -109,7 +111,6 @@ from .pattern_rule_info_py3 import PatternRuleInfo from .label_text_object_py3 import LabelTextObject from .app_version_setting_object_py3 import AppVersionSettingObject - from .azure_account_info_object_py3 import AzureAccountInfoObject from .hierarchical_child_model_update_object_py3 import HierarchicalChildModelUpdateObject from .hierarchical_child_model_create_object_py3 import HierarchicalChildModelCreateObject from .composite_child_model_create_object_py3 import CompositeChildModelCreateObject @@ -125,6 +126,8 @@ from .application_setting_update_object import ApplicationSettingUpdateObject from .publish_setting_update_object import PublishSettingUpdateObject from .example_label_object import ExampleLabelObject + from .dispatch_connected_service_delete_object import DispatchConnectedServiceDeleteObject + from .dispatch_connected_service_object import DispatchConnectedServiceObject from .phraselist_create_object import PhraselistCreateObject from .sub_closed_list import SubClosedList from .sub_closed_list_response import SubClosedListResponse @@ -213,7 +216,6 @@ from .pattern_rule_info import PatternRuleInfo from .label_text_object import LabelTextObject from .app_version_setting_object import AppVersionSettingObject - from .azure_account_info_object import AzureAccountInfoObject from .hierarchical_child_model_update_object import HierarchicalChildModelUpdateObject from .hierarchical_child_model_create_object import HierarchicalChildModelCreateObject from .composite_child_model_create_object import CompositeChildModelCreateObject @@ -234,6 +236,8 @@ 'ApplicationSettingUpdateObject', 'PublishSettingUpdateObject', 'ExampleLabelObject', + 'DispatchConnectedServiceDeleteObject', + 'DispatchConnectedServiceObject', 'PhraselistCreateObject', 'SubClosedList', 'SubClosedListResponse', @@ -322,7 +326,6 @@ 'PatternRuleInfo', 'LabelTextObject', 'AppVersionSettingObject', - 'AzureAccountInfoObject', 'HierarchicalChildModelUpdateObject', 'HierarchicalChildModelCreateObject', 'CompositeChildModelCreateObject', diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/azure_account_info_object.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/azure_account_info_object.py deleted file mode 100644 index edc9ef3ab968..000000000000 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/azure_account_info_object.py +++ /dev/null @@ -1,44 +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 - - -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) diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/azure_account_info_object_py3.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/azure_account_info_object_py3.py deleted file mode 100644 index e0cefd0de20e..000000000000 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/azure_account_info_object_py3.py +++ /dev/null @@ -1,44 +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 - - -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 diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_delete_object.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_delete_object.py new file mode 100644 index 000000000000..229fc17d3a77 --- /dev/null +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_delete_object.py @@ -0,0 +1,28 @@ +# 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 + + +class DispatchConnectedServiceDeleteObject(Model): + """An intent to delete its disptch connected service. + + :param intent_name: The name of the intent connected to the dispatch + :type intent_name: str + """ + + _attribute_map = { + 'intent_name': {'key': 'intentName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DispatchConnectedServiceDeleteObject, self).__init__(**kwargs) + self.intent_name = kwargs.get('intent_name', None) diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_delete_object_py3.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_delete_object_py3.py new file mode 100644 index 000000000000..f69d7297404a --- /dev/null +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_delete_object_py3.py @@ -0,0 +1,28 @@ +# 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 + + +class DispatchConnectedServiceDeleteObject(Model): + """An intent to delete its disptch connected service. + + :param intent_name: The name of the intent connected to the dispatch + :type intent_name: str + """ + + _attribute_map = { + 'intent_name': {'key': 'intentName', 'type': 'str'}, + } + + def __init__(self, *, intent_name: str=None, **kwargs) -> None: + super(DispatchConnectedServiceDeleteObject, self).__init__(**kwargs) + self.intent_name = intent_name diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_object.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_object.py new file mode 100644 index 000000000000..48837926efd2 --- /dev/null +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_object.py @@ -0,0 +1,53 @@ +# 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 + + +class DispatchConnectedServiceObject(Model): + """A disptch connected service. + + :param intent_name: The name of the intent connected to the dispatch + :type intent_name: str + :param type: The type of the connected service [luis/qna] + :type type: str + :param name: The name of the connected LUIS app (only if type is luis) + :type name: str + :param app_id: The ID of the connected LUIS app (only if type is luis) + :type app_id: str + :param version: The version ID of the connected LUIS app (only if type is + luis) + :type version: str + :param region: The region of the connected LUIS app (only if type is luis) + :type region: str + :param kb_id: The ID of the connected QnA app (only if type is qna) + :type kb_id: str + """ + + _attribute_map = { + 'intent_name': {'key': 'intentName', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'app_id': {'key': 'appId', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'region': {'key': 'region', 'type': 'str'}, + 'kb_id': {'key': 'kbId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DispatchConnectedServiceObject, self).__init__(**kwargs) + self.intent_name = kwargs.get('intent_name', None) + self.type = kwargs.get('type', None) + self.name = kwargs.get('name', None) + self.app_id = kwargs.get('app_id', None) + self.version = kwargs.get('version', None) + self.region = kwargs.get('region', None) + self.kb_id = kwargs.get('kb_id', None) diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_object_py3.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_object_py3.py new file mode 100644 index 000000000000..4b27012dba82 --- /dev/null +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_object_py3.py @@ -0,0 +1,53 @@ +# 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 + + +class DispatchConnectedServiceObject(Model): + """A disptch connected service. + + :param intent_name: The name of the intent connected to the dispatch + :type intent_name: str + :param type: The type of the connected service [luis/qna] + :type type: str + :param name: The name of the connected LUIS app (only if type is luis) + :type name: str + :param app_id: The ID of the connected LUIS app (only if type is luis) + :type app_id: str + :param version: The version ID of the connected LUIS app (only if type is + luis) + :type version: str + :param region: The region of the connected LUIS app (only if type is luis) + :type region: str + :param kb_id: The ID of the connected QnA app (only if type is qna) + :type kb_id: str + """ + + _attribute_map = { + 'intent_name': {'key': 'intentName', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'app_id': {'key': 'appId', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'region': {'key': 'region', 'type': 'str'}, + 'kb_id': {'key': 'kbId', 'type': 'str'}, + } + + def __init__(self, *, intent_name: str=None, type: str=None, name: str=None, app_id: str=None, version: str=None, region: str=None, kb_id: str=None, **kwargs) -> None: + super(DispatchConnectedServiceObject, self).__init__(**kwargs) + self.intent_name = intent_name + self.type = type + self.name = name + self.app_id = app_id + self.version = version + self.region = region + self.kb_id = kb_id diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/endpoint_info.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/endpoint_info.py index b856fa279c9d..be6fd40e4f7d 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/endpoint_info.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/endpoint_info.py @@ -28,8 +28,6 @@ class EndpointInfo(Model): :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 """ @@ -41,7 +39,6 @@ class EndpointInfo(Model): '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'}, } @@ -53,5 +50,4 @@ def __init__(self, **kwargs): 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) diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/endpoint_info_py3.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/endpoint_info_py3.py index 8673ea254c98..3e8f171a9067 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/endpoint_info_py3.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/endpoint_info_py3.py @@ -28,8 +28,6 @@ class EndpointInfo(Model): :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 """ @@ -41,11 +39,10 @@ class EndpointInfo(Model): '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: + 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, published_date_time: str=None, **kwargs) -> None: super(EndpointInfo, self).__init__(**kwargs) self.version_id = version_id self.is_staging = is_staging @@ -53,5 +50,4 @@ def __init__(self, *, version_id: str=None, is_staging: bool=None, 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 diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/production_or_staging_endpoint_info.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/production_or_staging_endpoint_info.py index c7e36e53396d..a51c82080aec 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/production_or_staging_endpoint_info.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/production_or_staging_endpoint_info.py @@ -28,8 +28,6 @@ class ProductionOrStagingEndpointInfo(EndpointInfo): :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 """ @@ -41,7 +39,6 @@ class ProductionOrStagingEndpointInfo(EndpointInfo): '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'}, } diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/production_or_staging_endpoint_info_py3.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/production_or_staging_endpoint_info_py3.py index edc0837d4135..c6a1ee157c3e 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/production_or_staging_endpoint_info_py3.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/production_or_staging_endpoint_info_py3.py @@ -28,8 +28,6 @@ class ProductionOrStagingEndpointInfo(EndpointInfo): :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 """ @@ -41,9 +39,8 @@ class ProductionOrStagingEndpointInfo(EndpointInfo): '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) + 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, 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, published_date_time=published_date_time, **kwargs) diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/__init__.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/__init__.py index 7ab51f6a50cc..2c701e84ecce 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/__init__.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/__init__.py @@ -18,6 +18,7 @@ from .permissions_operations import PermissionsOperations from .pattern_operations import PatternOperations from .settings_operations import SettingsOperations +from .dispatch_operations import DispatchOperations __all__ = [ 'FeaturesOperations', @@ -29,4 +30,5 @@ 'PermissionsOperations', 'PatternOperations', 'SettingsOperations', + 'DispatchOperations', ] diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/apps_operations.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/apps_operations.py index a65c27c0f48a..8d8753b35a2d 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/apps_operations.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/apps_operations.py @@ -661,8 +661,11 @@ def publish( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: object or ClientRawResponse if raw=true - :rtype: object or ~msrest.pipeline.ClientRawResponse + :return: ProductionOrStagingEndpointInfo or ClientRawResponse if + raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.ProductionOrStagingEndpointInfo + or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ @@ -693,17 +696,13 @@ def publish( 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, 503]: + if response.status_code not in [201]: 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 response.status_code == 503: - deserialized = self._deserialize('str', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/dispatch_operations.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/dispatch_operations.py new file mode 100644 index 000000000000..e53c36f89a5c --- /dev/null +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/dispatch_operations.py @@ -0,0 +1,226 @@ +# 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 DispatchOperations(object): + """DispatchOperations operations. + + :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 batch_update_connected_services( + self, app_id, version_id, connected_services, custom_headers=None, raw=False, **operation_config): + """Updates connected services. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param connected_services: A JSON array of service connections. + :type connected_services: + list[~azure.cognitiveservices.language.luis.authoring.models.DispatchConnectedServiceObject] + :param dict custom_headers: headers that will 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.batch_update_connected_services.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.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(connected_services, '[DispatchConnectedServiceObject]') + + # 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 + batch_update_connected_services.metadata = {'url': '/apps/{appId}/versions/{versionId}/connectedServices'} + + def batch_add_connected_services( + self, app_id, version_id, connected_services, custom_headers=None, raw=False, **operation_config): + """Adds connected services. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param connected_services: A JSON array of service connections. + :type connected_services: + list[~azure.cognitiveservices.language.luis.authoring.models.DispatchConnectedServiceObject] + :param dict custom_headers: headers that will 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.batch_add_connected_services.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.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(connected_services, '[DispatchConnectedServiceObject]') + + # 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 + batch_add_connected_services.metadata = {'url': '/apps/{appId}/versions/{versionId}/connectedServices'} + + def delete_connected_services( + self, app_id, version_id, intent_names, custom_headers=None, raw=False, **operation_config): + """Deletes the services connected to the specified intents. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param intent_names: The intent names. + :type intent_names: + list[~azure.cognitiveservices.language.luis.authoring.models.DispatchConnectedServiceDeleteObject] + :param dict custom_headers: headers that will 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_connected_services.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.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_names, '[DispatchConnectedServiceDeleteObject]') + + # 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_connected_services.metadata = {'url': '/apps/{appId}/versions/{versionId}/connectedServices'} From 1bf522d8fd61fbd04e7a9b4ff958800b259f8e1d Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 28 Nov 2018 11:30:52 +0000 Subject: [PATCH 05/12] Generated from 4289fc27afed08636bf27abb57ace4a1ff69b7ee Fixing OAV errors --- .../luis/authoring/luis_authoring_client.py | 274 +++++++++++++++++- .../luis/authoring/models/__init__.py | 9 +- .../models/azure_account_info_object.py | 44 +++ .../models/azure_account_info_object_py3.py | 44 +++ ...ispatch_connected_service_delete_object.py | 28 -- ...tch_connected_service_delete_object_py3.py | 28 -- .../dispatch_connected_service_object.py | 53 ---- .../dispatch_connected_service_object_py3.py | 53 ---- .../luis/authoring/models/endpoint_info.py | 4 + .../authoring/models/endpoint_info_py3.py | 6 +- .../production_or_staging_endpoint_info.py | 3 + ...production_or_staging_endpoint_info_py3.py | 7 +- .../luis/authoring/operations/__init__.py | 2 - .../authoring/operations/apps_operations.py | 13 +- .../operations/dispatch_operations.py | 226 --------------- 15 files changed, 384 insertions(+), 410 deletions(-) create mode 100644 azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/azure_account_info_object.py create mode 100644 azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/azure_account_info_object_py3.py delete mode 100644 azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_delete_object.py delete mode 100644 azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_delete_object_py3.py delete mode 100644 azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_object.py delete mode 100644 azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_object_py3.py delete mode 100644 azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/dispatch_operations.py diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/luis_authoring_client.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/luis_authoring_client.py index d53c49366596..5a615ac3aa9b 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/luis_authoring_client.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/luis_authoring_client.py @@ -12,6 +12,7 @@ from msrest.service_client import SDKClient from msrest import Configuration, Serializer, Deserializer from .version import VERSION +from msrest.pipeline import ClientRawResponse from msrest.exceptions import HttpOperationError from .operations.features_operations import FeaturesOperations from .operations.examples_operations import ExamplesOperations @@ -22,7 +23,6 @@ from .operations.permissions_operations import PermissionsOperations from .operations.pattern_operations import PatternOperations from .operations.settings_operations import SettingsOperations -from .operations.dispatch_operations import DispatchOperations from . import models @@ -80,8 +80,6 @@ class LUISAuthoringClient(SDKClient): :vartype pattern: azure.cognitiveservices.language.luis.authoring.operations.PatternOperations :ivar settings: Settings operations :vartype settings: azure.cognitiveservices.language.luis.authoring.operations.SettingsOperations - :ivar dispatch: Dispatch operations - :vartype dispatch: azure.cognitiveservices.language.luis.authoring.operations.DispatchOperations :param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com). @@ -120,5 +118,271 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.settings = SettingsOperations( self._client, self.config, self._serialize, self._deserialize) - self.dispatch = DispatchOperations( - self._client, self.config, self._serialize, self._deserialize) + + def fivebe_three_two_two_two_eighte_eight_four_seven_threede_one_one_six_three_two_five_five_one_five( + self, app_id, azure_account_info_object=None, custom_headers=None, raw=False, **operation_config): + """apps - Assign a LUIS azure accounts to an application. + + Assigns an azure account to the application. + + :param app_id: The application ID. + :type app_id: 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: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`HttpOperationError` + """ + # Construct URL + url = self.fivebe_three_two_two_two_eighte_eight_four_seven_threede_one_one_six_three_two_five_five_one_five.metadata['url'] + path_format_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 + 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, 400, 401, 403, 429]: + raise HttpOperationError(self._deserialize, response) + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('OperationStatus', response) + if response.status_code == 400: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 401: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 403: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 429: + deserialized = self._deserialize('ErrorResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + fivebe_three_two_two_two_eighte_eight_four_seven_threede_one_one_six_three_two_five_five_one_five.metadata = {'url': '/apps/{appId}/azureaccounts'} + + def fivebe_three_two_zero_two_eighta_oned_four_eightf_eight_eightcfd_five_sevene_two_zero( + self, app_id, 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 dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`HttpOperationError` + """ + # Construct URL + url = self.fivebe_three_two_zero_two_eighta_oned_four_eightf_eight_eightcfd_five_sevene_two_zero.metadata['url'] + path_format_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, 400, 401, 403, 429]: + raise HttpOperationError(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[AzureAccountInfoObject]', response) + if response.status_code == 400: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 401: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 403: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 429: + deserialized = self._deserialize('ErrorResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + fivebe_three_two_zero_two_eighta_oned_four_eightf_eight_eightcfd_five_sevene_two_zero.metadata = {'url': '/apps/{appId}/azureaccounts'} + + def fivebe_three_two_five_five_fourf_eight_five_nine_onedb_threea_eight_six_two_three_twoe_one( + self, app_id, 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 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: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`HttpOperationError` + """ + # Construct URL + url = self.fivebe_three_two_five_five_fourf_eight_five_nine_onedb_threea_eight_six_two_three_twoe_one.metadata['url'] + path_format_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 + 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, 400, 401, 403, 429]: + raise HttpOperationError(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + if response.status_code == 400: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 401: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 403: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 429: + deserialized = self._deserialize('ErrorResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + fivebe_three_two_five_five_fourf_eight_five_nine_onedb_threea_eight_six_two_three_twoe_one.metadata = {'url': '/apps/{appId}/azureaccounts'} + + def fivebe_three_one_threecec_one_eight_oneae_seven_two_zeroaa_twob_two_sixc( + self, 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 dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`HttpOperationError` + """ + # Construct URL + url = self.fivebe_three_one_threecec_one_eight_oneae_seven_two_zeroaa_twob_two_sixc.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, 400, 401, 403, 429]: + raise HttpOperationError(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[AzureAccountInfoObject]', response) + if response.status_code == 400: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 401: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 403: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 429: + deserialized = self._deserialize('ErrorResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + fivebe_three_one_threecec_one_eight_oneae_seven_two_zeroaa_twob_two_sixc.metadata = {'url': '/azureaccounts'} diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/__init__.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/__init__.py index 7d422a24d1fb..ba32b6e3600a 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/__init__.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/__init__.py @@ -21,8 +21,6 @@ from .application_setting_update_object_py3 import ApplicationSettingUpdateObject from .publish_setting_update_object_py3 import PublishSettingUpdateObject from .example_label_object_py3 import ExampleLabelObject - from .dispatch_connected_service_delete_object_py3 import DispatchConnectedServiceDeleteObject - from .dispatch_connected_service_object_py3 import DispatchConnectedServiceObject from .phraselist_create_object_py3 import PhraselistCreateObject from .sub_closed_list_py3 import SubClosedList from .sub_closed_list_response_py3 import SubClosedListResponse @@ -111,6 +109,7 @@ from .pattern_rule_info_py3 import PatternRuleInfo from .label_text_object_py3 import LabelTextObject from .app_version_setting_object_py3 import AppVersionSettingObject + from .azure_account_info_object_py3 import AzureAccountInfoObject from .hierarchical_child_model_update_object_py3 import HierarchicalChildModelUpdateObject from .hierarchical_child_model_create_object_py3 import HierarchicalChildModelCreateObject from .composite_child_model_create_object_py3 import CompositeChildModelCreateObject @@ -126,8 +125,6 @@ from .application_setting_update_object import ApplicationSettingUpdateObject from .publish_setting_update_object import PublishSettingUpdateObject from .example_label_object import ExampleLabelObject - from .dispatch_connected_service_delete_object import DispatchConnectedServiceDeleteObject - from .dispatch_connected_service_object import DispatchConnectedServiceObject from .phraselist_create_object import PhraselistCreateObject from .sub_closed_list import SubClosedList from .sub_closed_list_response import SubClosedListResponse @@ -216,6 +213,7 @@ from .pattern_rule_info import PatternRuleInfo from .label_text_object import LabelTextObject from .app_version_setting_object import AppVersionSettingObject + from .azure_account_info_object import AzureAccountInfoObject from .hierarchical_child_model_update_object import HierarchicalChildModelUpdateObject from .hierarchical_child_model_create_object import HierarchicalChildModelCreateObject from .composite_child_model_create_object import CompositeChildModelCreateObject @@ -236,8 +234,6 @@ 'ApplicationSettingUpdateObject', 'PublishSettingUpdateObject', 'ExampleLabelObject', - 'DispatchConnectedServiceDeleteObject', - 'DispatchConnectedServiceObject', 'PhraselistCreateObject', 'SubClosedList', 'SubClosedListResponse', @@ -326,6 +322,7 @@ 'PatternRuleInfo', 'LabelTextObject', 'AppVersionSettingObject', + 'AzureAccountInfoObject', 'HierarchicalChildModelUpdateObject', 'HierarchicalChildModelCreateObject', 'CompositeChildModelCreateObject', diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/azure_account_info_object.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/azure_account_info_object.py new file mode 100644 index 000000000000..edc9ef3ab968 --- /dev/null +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/azure_account_info_object.py @@ -0,0 +1,44 @@ +# 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 + + +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) diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/azure_account_info_object_py3.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/azure_account_info_object_py3.py new file mode 100644 index 000000000000..e0cefd0de20e --- /dev/null +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/azure_account_info_object_py3.py @@ -0,0 +1,44 @@ +# 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 + + +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 diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_delete_object.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_delete_object.py deleted file mode 100644 index 229fc17d3a77..000000000000 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_delete_object.py +++ /dev/null @@ -1,28 +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 - - -class DispatchConnectedServiceDeleteObject(Model): - """An intent to delete its disptch connected service. - - :param intent_name: The name of the intent connected to the dispatch - :type intent_name: str - """ - - _attribute_map = { - 'intent_name': {'key': 'intentName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(DispatchConnectedServiceDeleteObject, self).__init__(**kwargs) - self.intent_name = kwargs.get('intent_name', None) diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_delete_object_py3.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_delete_object_py3.py deleted file mode 100644 index f69d7297404a..000000000000 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_delete_object_py3.py +++ /dev/null @@ -1,28 +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 - - -class DispatchConnectedServiceDeleteObject(Model): - """An intent to delete its disptch connected service. - - :param intent_name: The name of the intent connected to the dispatch - :type intent_name: str - """ - - _attribute_map = { - 'intent_name': {'key': 'intentName', 'type': 'str'}, - } - - def __init__(self, *, intent_name: str=None, **kwargs) -> None: - super(DispatchConnectedServiceDeleteObject, self).__init__(**kwargs) - self.intent_name = intent_name diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_object.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_object.py deleted file mode 100644 index 48837926efd2..000000000000 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_object.py +++ /dev/null @@ -1,53 +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 - - -class DispatchConnectedServiceObject(Model): - """A disptch connected service. - - :param intent_name: The name of the intent connected to the dispatch - :type intent_name: str - :param type: The type of the connected service [luis/qna] - :type type: str - :param name: The name of the connected LUIS app (only if type is luis) - :type name: str - :param app_id: The ID of the connected LUIS app (only if type is luis) - :type app_id: str - :param version: The version ID of the connected LUIS app (only if type is - luis) - :type version: str - :param region: The region of the connected LUIS app (only if type is luis) - :type region: str - :param kb_id: The ID of the connected QnA app (only if type is qna) - :type kb_id: str - """ - - _attribute_map = { - 'intent_name': {'key': 'intentName', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'app_id': {'key': 'appId', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - 'region': {'key': 'region', 'type': 'str'}, - 'kb_id': {'key': 'kbId', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(DispatchConnectedServiceObject, self).__init__(**kwargs) - self.intent_name = kwargs.get('intent_name', None) - self.type = kwargs.get('type', None) - self.name = kwargs.get('name', None) - self.app_id = kwargs.get('app_id', None) - self.version = kwargs.get('version', None) - self.region = kwargs.get('region', None) - self.kb_id = kwargs.get('kb_id', None) diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_object_py3.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_object_py3.py deleted file mode 100644 index 4b27012dba82..000000000000 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_object_py3.py +++ /dev/null @@ -1,53 +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 - - -class DispatchConnectedServiceObject(Model): - """A disptch connected service. - - :param intent_name: The name of the intent connected to the dispatch - :type intent_name: str - :param type: The type of the connected service [luis/qna] - :type type: str - :param name: The name of the connected LUIS app (only if type is luis) - :type name: str - :param app_id: The ID of the connected LUIS app (only if type is luis) - :type app_id: str - :param version: The version ID of the connected LUIS app (only if type is - luis) - :type version: str - :param region: The region of the connected LUIS app (only if type is luis) - :type region: str - :param kb_id: The ID of the connected QnA app (only if type is qna) - :type kb_id: str - """ - - _attribute_map = { - 'intent_name': {'key': 'intentName', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'app_id': {'key': 'appId', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - 'region': {'key': 'region', 'type': 'str'}, - 'kb_id': {'key': 'kbId', 'type': 'str'}, - } - - def __init__(self, *, intent_name: str=None, type: str=None, name: str=None, app_id: str=None, version: str=None, region: str=None, kb_id: str=None, **kwargs) -> None: - super(DispatchConnectedServiceObject, self).__init__(**kwargs) - self.intent_name = intent_name - self.type = type - self.name = name - self.app_id = app_id - self.version = version - self.region = region - self.kb_id = kb_id diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/endpoint_info.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/endpoint_info.py index be6fd40e4f7d..b856fa279c9d 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/endpoint_info.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/endpoint_info.py @@ -28,6 +28,8 @@ class EndpointInfo(Model): :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 """ @@ -39,6 +41,7 @@ class EndpointInfo(Model): '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'}, } @@ -50,4 +53,5 @@ def __init__(self, **kwargs): 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) diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/endpoint_info_py3.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/endpoint_info_py3.py index 3e8f171a9067..8673ea254c98 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/endpoint_info_py3.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/endpoint_info_py3.py @@ -28,6 +28,8 @@ class EndpointInfo(Model): :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 """ @@ -39,10 +41,11 @@ class EndpointInfo(Model): '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, published_date_time: str=None, **kwargs) -> None: + 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 @@ -50,4 +53,5 @@ def __init__(self, *, version_id: str=None, is_staging: bool=None, 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 diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/production_or_staging_endpoint_info.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/production_or_staging_endpoint_info.py index a51c82080aec..c7e36e53396d 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/production_or_staging_endpoint_info.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/production_or_staging_endpoint_info.py @@ -28,6 +28,8 @@ class ProductionOrStagingEndpointInfo(EndpointInfo): :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 """ @@ -39,6 +41,7 @@ class ProductionOrStagingEndpointInfo(EndpointInfo): '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'}, } diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/production_or_staging_endpoint_info_py3.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/production_or_staging_endpoint_info_py3.py index c6a1ee157c3e..edc0837d4135 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/production_or_staging_endpoint_info_py3.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/production_or_staging_endpoint_info_py3.py @@ -28,6 +28,8 @@ class ProductionOrStagingEndpointInfo(EndpointInfo): :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 """ @@ -39,8 +41,9 @@ class ProductionOrStagingEndpointInfo(EndpointInfo): '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, 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, published_date_time=published_date_time, **kwargs) + 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) diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/__init__.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/__init__.py index 2c701e84ecce..7ab51f6a50cc 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/__init__.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/__init__.py @@ -18,7 +18,6 @@ from .permissions_operations import PermissionsOperations from .pattern_operations import PatternOperations from .settings_operations import SettingsOperations -from .dispatch_operations import DispatchOperations __all__ = [ 'FeaturesOperations', @@ -30,5 +29,4 @@ 'PermissionsOperations', 'PatternOperations', 'SettingsOperations', - 'DispatchOperations', ] diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/apps_operations.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/apps_operations.py index 8d8753b35a2d..a65c27c0f48a 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/apps_operations.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/apps_operations.py @@ -661,11 +661,8 @@ def publish( 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 + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ @@ -696,13 +693,17 @@ def publish( 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]: + if response.status_code not in [201, 207, 503]: 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 response.status_code == 503: + deserialized = self._deserialize('str', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/dispatch_operations.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/dispatch_operations.py deleted file mode 100644 index e53c36f89a5c..000000000000 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/dispatch_operations.py +++ /dev/null @@ -1,226 +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 DispatchOperations(object): - """DispatchOperations operations. - - :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 batch_update_connected_services( - self, app_id, version_id, connected_services, custom_headers=None, raw=False, **operation_config): - """Updates connected services. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param connected_services: A JSON array of service connections. - :type connected_services: - list[~azure.cognitiveservices.language.luis.authoring.models.DispatchConnectedServiceObject] - :param dict custom_headers: headers that will 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.batch_update_connected_services.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.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(connected_services, '[DispatchConnectedServiceObject]') - - # 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 - batch_update_connected_services.metadata = {'url': '/apps/{appId}/versions/{versionId}/connectedServices'} - - def batch_add_connected_services( - self, app_id, version_id, connected_services, custom_headers=None, raw=False, **operation_config): - """Adds connected services. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param connected_services: A JSON array of service connections. - :type connected_services: - list[~azure.cognitiveservices.language.luis.authoring.models.DispatchConnectedServiceObject] - :param dict custom_headers: headers that will 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.batch_add_connected_services.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.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(connected_services, '[DispatchConnectedServiceObject]') - - # 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 - batch_add_connected_services.metadata = {'url': '/apps/{appId}/versions/{versionId}/connectedServices'} - - def delete_connected_services( - self, app_id, version_id, intent_names, custom_headers=None, raw=False, **operation_config): - """Deletes the services connected to the specified intents. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param intent_names: The intent names. - :type intent_names: - list[~azure.cognitiveservices.language.luis.authoring.models.DispatchConnectedServiceDeleteObject] - :param dict custom_headers: headers that will 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_connected_services.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.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_names, '[DispatchConnectedServiceDeleteObject]') - - # 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_connected_services.metadata = {'url': '/apps/{appId}/versions/{versionId}/connectedServices'} From ed4e7f3300ff5cb5b85901dabe17cd33305dae99 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 28 Nov 2018 12:19:09 +0000 Subject: [PATCH 06/12] Generated from 3b62ef631bbcf684da8597627f22d1869bb37c7d Merge pull request #2 from omarelhariry/kayousef/Dispatch_APIs Adding dispatch APIs --- .../luis/authoring/luis_authoring_client.py | 5 + .../luis/authoring/models/__init__.py | 6 + ...ispatch_connected_service_delete_object.py | 28 ++ ...tch_connected_service_delete_object_py3.py | 28 ++ .../dispatch_connected_service_object.py | 53 ++++ .../dispatch_connected_service_object_py3.py | 53 ++++ .../luis/authoring/operations/__init__.py | 2 + .../operations/dispatch_operations.py | 245 ++++++++++++++++++ 8 files changed, 420 insertions(+) create mode 100644 azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_delete_object.py create mode 100644 azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_delete_object_py3.py create mode 100644 azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_object.py create mode 100644 azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_object_py3.py create mode 100644 azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/dispatch_operations.py diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/luis_authoring_client.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/luis_authoring_client.py index 5a615ac3aa9b..56ca0a56799e 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/luis_authoring_client.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/luis_authoring_client.py @@ -23,6 +23,7 @@ from .operations.permissions_operations import PermissionsOperations from .operations.pattern_operations import PatternOperations from .operations.settings_operations import SettingsOperations +from .operations.dispatch_operations import DispatchOperations from . import models @@ -80,6 +81,8 @@ class LUISAuthoringClient(SDKClient): :vartype pattern: azure.cognitiveservices.language.luis.authoring.operations.PatternOperations :ivar settings: Settings operations :vartype settings: azure.cognitiveservices.language.luis.authoring.operations.SettingsOperations + :ivar dispatch: Dispatch operations + :vartype dispatch: azure.cognitiveservices.language.luis.authoring.operations.DispatchOperations :param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com). @@ -118,6 +121,8 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.settings = SettingsOperations( self._client, self.config, self._serialize, self._deserialize) + self.dispatch = DispatchOperations( + self._client, self.config, self._serialize, self._deserialize) def fivebe_three_two_two_two_eighte_eight_four_seven_threede_one_one_six_three_two_five_five_one_five( self, app_id, azure_account_info_object=None, custom_headers=None, raw=False, **operation_config): diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/__init__.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/__init__.py index ba32b6e3600a..54665bf7fe00 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/__init__.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/__init__.py @@ -21,6 +21,8 @@ from .application_setting_update_object_py3 import ApplicationSettingUpdateObject from .publish_setting_update_object_py3 import PublishSettingUpdateObject from .example_label_object_py3 import ExampleLabelObject + from .dispatch_connected_service_delete_object_py3 import DispatchConnectedServiceDeleteObject + from .dispatch_connected_service_object_py3 import DispatchConnectedServiceObject from .phraselist_create_object_py3 import PhraselistCreateObject from .sub_closed_list_py3 import SubClosedList from .sub_closed_list_response_py3 import SubClosedListResponse @@ -125,6 +127,8 @@ from .application_setting_update_object import ApplicationSettingUpdateObject from .publish_setting_update_object import PublishSettingUpdateObject from .example_label_object import ExampleLabelObject + from .dispatch_connected_service_delete_object import DispatchConnectedServiceDeleteObject + from .dispatch_connected_service_object import DispatchConnectedServiceObject from .phraselist_create_object import PhraselistCreateObject from .sub_closed_list import SubClosedList from .sub_closed_list_response import SubClosedListResponse @@ -234,6 +238,8 @@ 'ApplicationSettingUpdateObject', 'PublishSettingUpdateObject', 'ExampleLabelObject', + 'DispatchConnectedServiceDeleteObject', + 'DispatchConnectedServiceObject', 'PhraselistCreateObject', 'SubClosedList', 'SubClosedListResponse', diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_delete_object.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_delete_object.py new file mode 100644 index 000000000000..229fc17d3a77 --- /dev/null +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_delete_object.py @@ -0,0 +1,28 @@ +# 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 + + +class DispatchConnectedServiceDeleteObject(Model): + """An intent to delete its disptch connected service. + + :param intent_name: The name of the intent connected to the dispatch + :type intent_name: str + """ + + _attribute_map = { + 'intent_name': {'key': 'intentName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DispatchConnectedServiceDeleteObject, self).__init__(**kwargs) + self.intent_name = kwargs.get('intent_name', None) diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_delete_object_py3.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_delete_object_py3.py new file mode 100644 index 000000000000..f69d7297404a --- /dev/null +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_delete_object_py3.py @@ -0,0 +1,28 @@ +# 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 + + +class DispatchConnectedServiceDeleteObject(Model): + """An intent to delete its disptch connected service. + + :param intent_name: The name of the intent connected to the dispatch + :type intent_name: str + """ + + _attribute_map = { + 'intent_name': {'key': 'intentName', 'type': 'str'}, + } + + def __init__(self, *, intent_name: str=None, **kwargs) -> None: + super(DispatchConnectedServiceDeleteObject, self).__init__(**kwargs) + self.intent_name = intent_name diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_object.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_object.py new file mode 100644 index 000000000000..48837926efd2 --- /dev/null +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_object.py @@ -0,0 +1,53 @@ +# 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 + + +class DispatchConnectedServiceObject(Model): + """A disptch connected service. + + :param intent_name: The name of the intent connected to the dispatch + :type intent_name: str + :param type: The type of the connected service [luis/qna] + :type type: str + :param name: The name of the connected LUIS app (only if type is luis) + :type name: str + :param app_id: The ID of the connected LUIS app (only if type is luis) + :type app_id: str + :param version: The version ID of the connected LUIS app (only if type is + luis) + :type version: str + :param region: The region of the connected LUIS app (only if type is luis) + :type region: str + :param kb_id: The ID of the connected QnA app (only if type is qna) + :type kb_id: str + """ + + _attribute_map = { + 'intent_name': {'key': 'intentName', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'app_id': {'key': 'appId', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'region': {'key': 'region', 'type': 'str'}, + 'kb_id': {'key': 'kbId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DispatchConnectedServiceObject, self).__init__(**kwargs) + self.intent_name = kwargs.get('intent_name', None) + self.type = kwargs.get('type', None) + self.name = kwargs.get('name', None) + self.app_id = kwargs.get('app_id', None) + self.version = kwargs.get('version', None) + self.region = kwargs.get('region', None) + self.kb_id = kwargs.get('kb_id', None) diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_object_py3.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_object_py3.py new file mode 100644 index 000000000000..4b27012dba82 --- /dev/null +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_object_py3.py @@ -0,0 +1,53 @@ +# 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 + + +class DispatchConnectedServiceObject(Model): + """A disptch connected service. + + :param intent_name: The name of the intent connected to the dispatch + :type intent_name: str + :param type: The type of the connected service [luis/qna] + :type type: str + :param name: The name of the connected LUIS app (only if type is luis) + :type name: str + :param app_id: The ID of the connected LUIS app (only if type is luis) + :type app_id: str + :param version: The version ID of the connected LUIS app (only if type is + luis) + :type version: str + :param region: The region of the connected LUIS app (only if type is luis) + :type region: str + :param kb_id: The ID of the connected QnA app (only if type is qna) + :type kb_id: str + """ + + _attribute_map = { + 'intent_name': {'key': 'intentName', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'app_id': {'key': 'appId', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'region': {'key': 'region', 'type': 'str'}, + 'kb_id': {'key': 'kbId', 'type': 'str'}, + } + + def __init__(self, *, intent_name: str=None, type: str=None, name: str=None, app_id: str=None, version: str=None, region: str=None, kb_id: str=None, **kwargs) -> None: + super(DispatchConnectedServiceObject, self).__init__(**kwargs) + self.intent_name = intent_name + self.type = type + self.name = name + self.app_id = app_id + self.version = version + self.region = region + self.kb_id = kb_id diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/__init__.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/__init__.py index 7ab51f6a50cc..2c701e84ecce 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/__init__.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/__init__.py @@ -18,6 +18,7 @@ from .permissions_operations import PermissionsOperations from .pattern_operations import PatternOperations from .settings_operations import SettingsOperations +from .dispatch_operations import DispatchOperations __all__ = [ 'FeaturesOperations', @@ -29,4 +30,5 @@ 'PermissionsOperations', 'PatternOperations', 'SettingsOperations', + 'DispatchOperations', ] diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/dispatch_operations.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/dispatch_operations.py new file mode 100644 index 000000000000..cda8a34732d9 --- /dev/null +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/dispatch_operations.py @@ -0,0 +1,245 @@ +# 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 DispatchOperations(object): + """DispatchOperations operations. + + :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 batch_update_connected_services( + self, app_id, version_id, connected_services, custom_headers=None, raw=False, **operation_config): + """Updates connected services. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param connected_services: A JSON array of service connections. + :type connected_services: + list[~azure.cognitiveservices.language.luis.authoring.models.DispatchConnectedServiceObject] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`HttpOperationError` + """ + # Construct URL + url = self.batch_update_connected_services.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.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(connected_services, '[DispatchConnectedServiceObject]') + + # 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, 400, 401, 403, 429]: + raise HttpOperationError(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + if response.status_code == 400: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 401: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 403: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 429: + deserialized = self._deserialize('ErrorResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + batch_update_connected_services.metadata = {'url': '/apps/{appId}/versions/{versionId}/connectedServices'} + + def batch_add_connected_services( + self, app_id, version_id, connected_services, custom_headers=None, raw=False, **operation_config): + """Adds connected services. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param connected_services: A JSON array of service connections. + :type connected_services: + list[~azure.cognitiveservices.language.luis.authoring.models.DispatchConnectedServiceObject] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`HttpOperationError` + """ + # Construct URL + url = self.batch_add_connected_services.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.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(connected_services, '[DispatchConnectedServiceObject]') + + # 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, 400, 401, 403, 429]: + raise HttpOperationError(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + if response.status_code == 400: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 401: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 403: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 429: + deserialized = self._deserialize('ErrorResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + batch_add_connected_services.metadata = {'url': '/apps/{appId}/versions/{versionId}/connectedServices'} + + def delete_connected_services( + self, app_id, version_id, intent_names, custom_headers=None, raw=False, **operation_config): + """Deletes the services connected to the specified intents. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param intent_names: The intent names. + :type intent_names: + list[~azure.cognitiveservices.language.luis.authoring.models.DispatchConnectedServiceDeleteObject] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`HttpOperationError` + """ + # Construct URL + url = self.delete_connected_services.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.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_names, '[DispatchConnectedServiceDeleteObject]') + + # 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, 400, 401, 403, 429]: + raise HttpOperationError(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + if response.status_code == 400: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 401: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 403: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 429: + deserialized = self._deserialize('ErrorResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete_connected_services.metadata = {'url': '/apps/{appId}/versions/{versionId}/connectedServices'} From 4cdf38fc5657d4915d046a1a3d59f410b2935ea3 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Sun, 2 Dec 2018 10:27:03 +0000 Subject: [PATCH 07/12] Generated from 4289fc27afed08636bf27abb57ace4a1ff69b7ee Fixing OAV errors --- .../luis/authoring/luis_authoring_client.py | 5 - .../luis/authoring/models/__init__.py | 6 - ...ispatch_connected_service_delete_object.py | 28 -- ...tch_connected_service_delete_object_py3.py | 28 -- .../dispatch_connected_service_object.py | 53 ---- .../dispatch_connected_service_object_py3.py | 53 ---- .../luis/authoring/operations/__init__.py | 2 - .../operations/dispatch_operations.py | 245 ------------------ 8 files changed, 420 deletions(-) delete mode 100644 azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_delete_object.py delete mode 100644 azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_delete_object_py3.py delete mode 100644 azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_object.py delete mode 100644 azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_object_py3.py delete mode 100644 azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/dispatch_operations.py diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/luis_authoring_client.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/luis_authoring_client.py index 56ca0a56799e..5a615ac3aa9b 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/luis_authoring_client.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/luis_authoring_client.py @@ -23,7 +23,6 @@ from .operations.permissions_operations import PermissionsOperations from .operations.pattern_operations import PatternOperations from .operations.settings_operations import SettingsOperations -from .operations.dispatch_operations import DispatchOperations from . import models @@ -81,8 +80,6 @@ class LUISAuthoringClient(SDKClient): :vartype pattern: azure.cognitiveservices.language.luis.authoring.operations.PatternOperations :ivar settings: Settings operations :vartype settings: azure.cognitiveservices.language.luis.authoring.operations.SettingsOperations - :ivar dispatch: Dispatch operations - :vartype dispatch: azure.cognitiveservices.language.luis.authoring.operations.DispatchOperations :param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com). @@ -121,8 +118,6 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.settings = SettingsOperations( self._client, self.config, self._serialize, self._deserialize) - self.dispatch = DispatchOperations( - self._client, self.config, self._serialize, self._deserialize) def fivebe_three_two_two_two_eighte_eight_four_seven_threede_one_one_six_three_two_five_five_one_five( self, app_id, azure_account_info_object=None, custom_headers=None, raw=False, **operation_config): diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/__init__.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/__init__.py index 54665bf7fe00..ba32b6e3600a 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/__init__.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/__init__.py @@ -21,8 +21,6 @@ from .application_setting_update_object_py3 import ApplicationSettingUpdateObject from .publish_setting_update_object_py3 import PublishSettingUpdateObject from .example_label_object_py3 import ExampleLabelObject - from .dispatch_connected_service_delete_object_py3 import DispatchConnectedServiceDeleteObject - from .dispatch_connected_service_object_py3 import DispatchConnectedServiceObject from .phraselist_create_object_py3 import PhraselistCreateObject from .sub_closed_list_py3 import SubClosedList from .sub_closed_list_response_py3 import SubClosedListResponse @@ -127,8 +125,6 @@ from .application_setting_update_object import ApplicationSettingUpdateObject from .publish_setting_update_object import PublishSettingUpdateObject from .example_label_object import ExampleLabelObject - from .dispatch_connected_service_delete_object import DispatchConnectedServiceDeleteObject - from .dispatch_connected_service_object import DispatchConnectedServiceObject from .phraselist_create_object import PhraselistCreateObject from .sub_closed_list import SubClosedList from .sub_closed_list_response import SubClosedListResponse @@ -238,8 +234,6 @@ 'ApplicationSettingUpdateObject', 'PublishSettingUpdateObject', 'ExampleLabelObject', - 'DispatchConnectedServiceDeleteObject', - 'DispatchConnectedServiceObject', 'PhraselistCreateObject', 'SubClosedList', 'SubClosedListResponse', diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_delete_object.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_delete_object.py deleted file mode 100644 index 229fc17d3a77..000000000000 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_delete_object.py +++ /dev/null @@ -1,28 +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 - - -class DispatchConnectedServiceDeleteObject(Model): - """An intent to delete its disptch connected service. - - :param intent_name: The name of the intent connected to the dispatch - :type intent_name: str - """ - - _attribute_map = { - 'intent_name': {'key': 'intentName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(DispatchConnectedServiceDeleteObject, self).__init__(**kwargs) - self.intent_name = kwargs.get('intent_name', None) diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_delete_object_py3.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_delete_object_py3.py deleted file mode 100644 index f69d7297404a..000000000000 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_delete_object_py3.py +++ /dev/null @@ -1,28 +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 - - -class DispatchConnectedServiceDeleteObject(Model): - """An intent to delete its disptch connected service. - - :param intent_name: The name of the intent connected to the dispatch - :type intent_name: str - """ - - _attribute_map = { - 'intent_name': {'key': 'intentName', 'type': 'str'}, - } - - def __init__(self, *, intent_name: str=None, **kwargs) -> None: - super(DispatchConnectedServiceDeleteObject, self).__init__(**kwargs) - self.intent_name = intent_name diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_object.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_object.py deleted file mode 100644 index 48837926efd2..000000000000 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_object.py +++ /dev/null @@ -1,53 +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 - - -class DispatchConnectedServiceObject(Model): - """A disptch connected service. - - :param intent_name: The name of the intent connected to the dispatch - :type intent_name: str - :param type: The type of the connected service [luis/qna] - :type type: str - :param name: The name of the connected LUIS app (only if type is luis) - :type name: str - :param app_id: The ID of the connected LUIS app (only if type is luis) - :type app_id: str - :param version: The version ID of the connected LUIS app (only if type is - luis) - :type version: str - :param region: The region of the connected LUIS app (only if type is luis) - :type region: str - :param kb_id: The ID of the connected QnA app (only if type is qna) - :type kb_id: str - """ - - _attribute_map = { - 'intent_name': {'key': 'intentName', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'app_id': {'key': 'appId', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - 'region': {'key': 'region', 'type': 'str'}, - 'kb_id': {'key': 'kbId', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(DispatchConnectedServiceObject, self).__init__(**kwargs) - self.intent_name = kwargs.get('intent_name', None) - self.type = kwargs.get('type', None) - self.name = kwargs.get('name', None) - self.app_id = kwargs.get('app_id', None) - self.version = kwargs.get('version', None) - self.region = kwargs.get('region', None) - self.kb_id = kwargs.get('kb_id', None) diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_object_py3.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_object_py3.py deleted file mode 100644 index 4b27012dba82..000000000000 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/dispatch_connected_service_object_py3.py +++ /dev/null @@ -1,53 +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 - - -class DispatchConnectedServiceObject(Model): - """A disptch connected service. - - :param intent_name: The name of the intent connected to the dispatch - :type intent_name: str - :param type: The type of the connected service [luis/qna] - :type type: str - :param name: The name of the connected LUIS app (only if type is luis) - :type name: str - :param app_id: The ID of the connected LUIS app (only if type is luis) - :type app_id: str - :param version: The version ID of the connected LUIS app (only if type is - luis) - :type version: str - :param region: The region of the connected LUIS app (only if type is luis) - :type region: str - :param kb_id: The ID of the connected QnA app (only if type is qna) - :type kb_id: str - """ - - _attribute_map = { - 'intent_name': {'key': 'intentName', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'app_id': {'key': 'appId', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - 'region': {'key': 'region', 'type': 'str'}, - 'kb_id': {'key': 'kbId', 'type': 'str'}, - } - - def __init__(self, *, intent_name: str=None, type: str=None, name: str=None, app_id: str=None, version: str=None, region: str=None, kb_id: str=None, **kwargs) -> None: - super(DispatchConnectedServiceObject, self).__init__(**kwargs) - self.intent_name = intent_name - self.type = type - self.name = name - self.app_id = app_id - self.version = version - self.region = region - self.kb_id = kb_id diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/__init__.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/__init__.py index 2c701e84ecce..7ab51f6a50cc 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/__init__.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/__init__.py @@ -18,7 +18,6 @@ from .permissions_operations import PermissionsOperations from .pattern_operations import PatternOperations from .settings_operations import SettingsOperations -from .dispatch_operations import DispatchOperations __all__ = [ 'FeaturesOperations', @@ -30,5 +29,4 @@ 'PermissionsOperations', 'PatternOperations', 'SettingsOperations', - 'DispatchOperations', ] diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/dispatch_operations.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/dispatch_operations.py deleted file mode 100644 index cda8a34732d9..000000000000 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/dispatch_operations.py +++ /dev/null @@ -1,245 +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 DispatchOperations(object): - """DispatchOperations operations. - - :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 batch_update_connected_services( - self, app_id, version_id, connected_services, custom_headers=None, raw=False, **operation_config): - """Updates connected services. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param connected_services: A JSON array of service connections. - :type connected_services: - list[~azure.cognitiveservices.language.luis.authoring.models.DispatchConnectedServiceObject] - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: object or ClientRawResponse if raw=true - :rtype: object or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`HttpOperationError` - """ - # Construct URL - url = self.batch_update_connected_services.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.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(connected_services, '[DispatchConnectedServiceObject]') - - # 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, 400, 401, 403, 429]: - raise HttpOperationError(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - if response.status_code == 400: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 401: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 403: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 429: - deserialized = self._deserialize('ErrorResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - batch_update_connected_services.metadata = {'url': '/apps/{appId}/versions/{versionId}/connectedServices'} - - def batch_add_connected_services( - self, app_id, version_id, connected_services, custom_headers=None, raw=False, **operation_config): - """Adds connected services. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param connected_services: A JSON array of service connections. - :type connected_services: - list[~azure.cognitiveservices.language.luis.authoring.models.DispatchConnectedServiceObject] - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: object or ClientRawResponse if raw=true - :rtype: object or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`HttpOperationError` - """ - # Construct URL - url = self.batch_add_connected_services.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.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(connected_services, '[DispatchConnectedServiceObject]') - - # 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, 400, 401, 403, 429]: - raise HttpOperationError(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - if response.status_code == 400: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 401: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 403: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 429: - deserialized = self._deserialize('ErrorResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - batch_add_connected_services.metadata = {'url': '/apps/{appId}/versions/{versionId}/connectedServices'} - - def delete_connected_services( - self, app_id, version_id, intent_names, custom_headers=None, raw=False, **operation_config): - """Deletes the services connected to the specified intents. - - :param app_id: The application ID. - :type app_id: str - :param version_id: The version ID. - :type version_id: str - :param intent_names: The intent names. - :type intent_names: - list[~azure.cognitiveservices.language.luis.authoring.models.DispatchConnectedServiceDeleteObject] - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: object or ClientRawResponse if raw=true - :rtype: object or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`HttpOperationError` - """ - # Construct URL - url = self.delete_connected_services.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.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_names, '[DispatchConnectedServiceDeleteObject]') - - # 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, 400, 401, 403, 429]: - raise HttpOperationError(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - if response.status_code == 400: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 401: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 403: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 429: - deserialized = self._deserialize('ErrorResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - delete_connected_services.metadata = {'url': '/apps/{appId}/versions/{versionId}/connectedServices'} From 5260d0a98001b083b3d207cc8d0f7fb72e1d08a5 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 6 Dec 2018 12:27:41 +0000 Subject: [PATCH 08/12] Generated from c7d11c54fe4f164073a570f2dba2510ddbf91c76 Add application-json as a 2nd prdocues format for packaging APIs, to describe the error responses --- .../luis/authoring/luis_authoring_client.py | 134 +++++++++++++++++- .../authoring/models/example_label_object.py | 4 +- .../models/example_label_object_py3.py | 4 +- .../models/publish_setting_update_object.py | 2 +- .../publish_setting_update_object_py3.py | 2 +- .../luis/authoring/models/publish_settings.py | 2 +- .../authoring/models/publish_settings_py3.py | 2 +- .../authoring/operations/apps_operations.py | 2 +- 8 files changed, 142 insertions(+), 10 deletions(-) diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/luis_authoring_client.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/luis_authoring_client.py index 5a615ac3aa9b..eed59e034811 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/luis_authoring_client.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/luis_authoring_client.py @@ -121,7 +121,7 @@ def __init__( def fivebe_three_two_two_two_eighte_eight_four_seven_threede_one_one_six_three_two_five_five_one_five( self, app_id, azure_account_info_object=None, custom_headers=None, raw=False, **operation_config): - """apps - Assign a LUIS azure accounts to an application. + """apps - Assign a LUIS azure account to an application. Assigns an azure account to the application. @@ -386,3 +386,135 @@ def fivebe_three_one_threecec_one_eight_oneae_seven_two_zeroaa_twob_two_sixc( return deserialized fivebe_three_one_threecec_one_eight_oneae_seven_two_zeroaa_twob_two_sixc.metadata = {'url': '/azureaccounts'} + + def apps_packagepublishedapplicationasgzip( + self, app_id, slot_name, custom_headers=None, raw=False, **operation_config): + """package - Gets published LUIS application package in binary stream GZip + format. + + Packages published LUIS application as GZip. + + :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 operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`HttpOperationError` + """ + # Construct URL + url = self.apps_packagepublishedapplicationasgzip.metadata['url'] + path_format_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=False, **operation_config) + + if response.status_code not in [200, 400, 401, 403, 429]: + raise HttpOperationError(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._client.stream_download(response, callback) + if response.status_code == 400: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 401: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 403: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 429: + deserialized = self._deserialize('ErrorResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + apps_packagepublishedapplicationasgzip.metadata = {'url': '/package/{appId}/slot/{slotName}/gzip'} + + def apps_packagetrainedapplicationasgzip( + self, app_id, version_id, custom_headers=None, raw=False, **operation_config): + """package - Gets trained LUIS application package in binary stream GZip + format. + + Packages trained LUIS application as GZip. + + :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: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`HttpOperationError` + """ + # Construct URL + url = self.apps_packagetrainedapplicationasgzip.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.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, 400, 401, 403, 429]: + raise HttpOperationError(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._client.stream_download(response, callback) + if response.status_code == 400: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 401: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 403: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 429: + deserialized = self._deserialize('ErrorResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + apps_packagetrainedapplicationasgzip.metadata = {'url': '/package/{appId}/versions/{versionId}/gzip'} diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/example_label_object.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/example_label_object.py index a9a12a017d9c..772fa64008cb 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/example_label_object.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/example_label_object.py @@ -17,10 +17,10 @@ class ExampleLabelObject(Model): :param text: The sample's utterance. :type text: str - :param entity_labels: The idenfied entities within the utterance. + :param entity_labels: The identified entities within the utterance. :type entity_labels: list[~azure.cognitiveservices.language.luis.authoring.models.EntityLabelObject] - :param intent_name: The idenfitied intent representing the utterance. + :param intent_name: The identified intent representing the utterance. :type intent_name: str """ diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/example_label_object_py3.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/example_label_object_py3.py index 6587bf9cbb17..e470ce415a49 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/example_label_object_py3.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/example_label_object_py3.py @@ -17,10 +17,10 @@ class ExampleLabelObject(Model): :param text: The sample's utterance. :type text: str - :param entity_labels: The idenfied entities within the utterance. + :param entity_labels: The identified entities within the utterance. :type entity_labels: list[~azure.cognitiveservices.language.luis.authoring.models.EntityLabelObject] - :param intent_name: The idenfitied intent representing the utterance. + :param intent_name: The identified intent representing the utterance. :type intent_name: str """ diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/publish_setting_update_object.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/publish_setting_update_object.py index 40528595c704..fa555891f6f4 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/publish_setting_update_object.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/publish_setting_update_object.py @@ -16,7 +16,7 @@ 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 resopnse + 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 diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/publish_setting_update_object_py3.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/publish_setting_update_object_py3.py index 356e854eaa15..a9dae2e391f3 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/publish_setting_update_object_py3.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/publish_setting_update_object_py3.py @@ -16,7 +16,7 @@ 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 resopnse + 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 diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/publish_settings.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/publish_settings.py index 1a099987d6de..7dc6b8754515 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/publish_settings.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/publish_settings.py @@ -21,7 +21,7 @@ class PublishSettings(Model): :type id: str :param is_sentiment_analysis_enabled: Required. Setting sentiment analysis as true returns the Sentiment of the input utterance along with the - resopnse + response :type is_sentiment_analysis_enabled: bool :param is_speech_enabled: Required. Setting speech as public enables speech priming in your app diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/publish_settings_py3.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/publish_settings_py3.py index 0da2f80efdad..f8ade900514e 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/publish_settings_py3.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/publish_settings_py3.py @@ -21,7 +21,7 @@ class PublishSettings(Model): :type id: str :param is_sentiment_analysis_enabled: Required. Setting sentiment analysis as true returns the Sentiment of the input utterance along with the - resopnse + response :type is_sentiment_analysis_enabled: bool :param is_speech_enabled: Required. Setting speech as public enables speech priming in your app diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/apps_operations.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/apps_operations.py index a65c27c0f48a..92735b3cf18c 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/apps_operations.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/apps_operations.py @@ -157,7 +157,7 @@ def list( 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 should be - included in in the request body. + included in the request body. :param luis_app: A LUIS application structure. :type luis_app: From 724f9163e270fab8e2fe86d9a921d2a45276bf87 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 11 Dec 2018 12:11:16 +0000 Subject: [PATCH 09/12] Generated from b8ee038af90c620395c27635c989a3a6364335a4 Updating operation ids --- .../luis/authoring/luis_authoring_client.py | 406 +----------------- .../luis/authoring/operations/__init__.py | 2 + .../authoring/operations/apps_operations.py | 138 +++++- .../operations/azure_accounts_operations.py | 303 +++++++++++++ 4 files changed, 447 insertions(+), 402 deletions(-) create mode 100644 azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/azure_accounts_operations.py diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/luis_authoring_client.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/luis_authoring_client.py index eed59e034811..52df018e9a89 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/luis_authoring_client.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/luis_authoring_client.py @@ -12,7 +12,6 @@ from msrest.service_client import SDKClient from msrest import Configuration, Serializer, Deserializer from .version import VERSION -from msrest.pipeline import ClientRawResponse from msrest.exceptions import HttpOperationError from .operations.features_operations import FeaturesOperations from .operations.examples_operations import ExamplesOperations @@ -23,6 +22,7 @@ from .operations.permissions_operations import PermissionsOperations from .operations.pattern_operations import PatternOperations from .operations.settings_operations import SettingsOperations +from .operations.azure_accounts_operations import AzureAccountsOperations from . import models @@ -80,6 +80,8 @@ class LUISAuthoringClient(SDKClient): :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). @@ -118,403 +120,5 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.settings = SettingsOperations( self._client, self.config, self._serialize, self._deserialize) - - def fivebe_three_two_two_two_eighte_eight_four_seven_threede_one_one_six_three_two_five_five_one_five( - self, app_id, 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 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: object or ClientRawResponse if raw=true - :rtype: object or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`HttpOperationError` - """ - # Construct URL - url = self.fivebe_three_two_two_two_eighte_eight_four_seven_threede_one_one_six_three_two_five_five_one_five.metadata['url'] - path_format_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 - 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, 400, 401, 403, 429]: - raise HttpOperationError(self._deserialize, response) - - deserialized = None - - if response.status_code == 201: - deserialized = self._deserialize('OperationStatus', response) - if response.status_code == 400: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 401: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 403: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 429: - deserialized = self._deserialize('ErrorResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - fivebe_three_two_two_two_eighte_eight_four_seven_threede_one_one_six_three_two_five_five_one_five.metadata = {'url': '/apps/{appId}/azureaccounts'} - - def fivebe_three_two_zero_two_eighta_oned_four_eightf_eight_eightcfd_five_sevene_two_zero( - self, app_id, 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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: object or ClientRawResponse if raw=true - :rtype: object or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`HttpOperationError` - """ - # Construct URL - url = self.fivebe_three_two_zero_two_eighta_oned_four_eightf_eight_eightcfd_five_sevene_two_zero.metadata['url'] - path_format_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, 400, 401, 403, 429]: - raise HttpOperationError(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[AzureAccountInfoObject]', response) - if response.status_code == 400: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 401: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 403: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 429: - deserialized = self._deserialize('ErrorResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - fivebe_three_two_zero_two_eighta_oned_four_eightf_eight_eightcfd_five_sevene_two_zero.metadata = {'url': '/apps/{appId}/azureaccounts'} - - def fivebe_three_two_five_five_fourf_eight_five_nine_onedb_threea_eight_six_two_three_twoe_one( - self, app_id, 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 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: object or ClientRawResponse if raw=true - :rtype: object or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`HttpOperationError` - """ - # Construct URL - url = self.fivebe_three_two_five_five_fourf_eight_five_nine_onedb_threea_eight_six_two_three_twoe_one.metadata['url'] - path_format_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 - 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, 400, 401, 403, 429]: - raise HttpOperationError(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) - if response.status_code == 400: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 401: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 403: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 429: - deserialized = self._deserialize('ErrorResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - fivebe_three_two_five_five_fourf_eight_five_nine_onedb_threea_eight_six_two_three_twoe_one.metadata = {'url': '/apps/{appId}/azureaccounts'} - - def fivebe_three_one_threecec_one_eight_oneae_seven_two_zeroaa_twob_two_sixc( - self, 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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: object or ClientRawResponse if raw=true - :rtype: object or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`HttpOperationError` - """ - # Construct URL - url = self.fivebe_three_one_threecec_one_eight_oneae_seven_two_zeroaa_twob_two_sixc.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, 400, 401, 403, 429]: - raise HttpOperationError(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[AzureAccountInfoObject]', response) - if response.status_code == 400: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 401: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 403: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 429: - deserialized = self._deserialize('ErrorResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - fivebe_three_one_threecec_one_eight_oneae_seven_two_zeroaa_twob_two_sixc.metadata = {'url': '/azureaccounts'} - - def apps_packagepublishedapplicationasgzip( - self, app_id, slot_name, custom_headers=None, raw=False, **operation_config): - """package - Gets published LUIS application package in binary stream GZip - format. - - Packages published LUIS application as GZip. - - :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 operation_config: :ref:`Operation configuration - overrides`. - :return: object or ClientRawResponse if raw=true - :rtype: object or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`HttpOperationError` - """ - # Construct URL - url = self.apps_packagepublishedapplicationasgzip.metadata['url'] - path_format_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=False, **operation_config) - - if response.status_code not in [200, 400, 401, 403, 429]: - raise HttpOperationError(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._client.stream_download(response, callback) - if response.status_code == 400: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 401: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 403: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 429: - deserialized = self._deserialize('ErrorResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - apps_packagepublishedapplicationasgzip.metadata = {'url': '/package/{appId}/slot/{slotName}/gzip'} - - def apps_packagetrainedapplicationasgzip( - self, app_id, version_id, custom_headers=None, raw=False, **operation_config): - """package - Gets trained LUIS application package in binary stream GZip - format. - - Packages trained LUIS application as GZip. - - :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: object or ClientRawResponse if raw=true - :rtype: object or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`HttpOperationError` - """ - # Construct URL - url = self.apps_packagetrainedapplicationasgzip.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.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, 400, 401, 403, 429]: - raise HttpOperationError(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._client.stream_download(response, callback) - if response.status_code == 400: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 401: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 403: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 429: - deserialized = self._deserialize('ErrorResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - apps_packagetrainedapplicationasgzip.metadata = {'url': '/package/{appId}/versions/{versionId}/gzip'} + self.azure_accounts = AzureAccountsOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/__init__.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/__init__.py index 7ab51f6a50cc..4e467d3e81d4 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/__init__.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/__init__.py @@ -18,6 +18,7 @@ from .permissions_operations import PermissionsOperations from .pattern_operations import PatternOperations from .settings_operations import SettingsOperations +from .azure_accounts_operations import AzureAccountsOperations __all__ = [ 'FeaturesOperations', @@ -29,4 +30,5 @@ 'PermissionsOperations', 'PatternOperations', 'SettingsOperations', + 'AzureAccountsOperations', ] diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/apps_operations.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/apps_operations.py index 92735b3cf18c..9315a214872f 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/apps_operations.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/apps_operations.py @@ -592,11 +592,13 @@ def update( update.metadata = {'url': '/apps/{appId}'} def delete( - self, app_id, custom_headers=None, raw=False, **operation_config): + 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 @@ -619,6 +621,8 @@ def delete( # Construct parameters query_parameters = {} + if force is not None: + query_parameters['force'] = self._serialize.query("force", force, 'bool') # Construct headers header_parameters = {} @@ -1160,3 +1164,135 @@ def list_available_custom_prebuilt_domains_for_culture( 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, **operation_config): + """package - Gets published LUIS application package in binary stream GZip + format. + + Packages published LUIS application as GZip. + + :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 operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`HttpOperationError` + """ + # 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=False, **operation_config) + + if response.status_code not in [200, 400, 401, 403, 429]: + raise HttpOperationError(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._client.stream_download(response, callback) + if response.status_code == 400: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 401: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 403: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 429: + deserialized = self._deserialize('ErrorResponse', response) + + 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, **operation_config): + """package - Gets trained LUIS application package in binary stream GZip + format. + + Packages trained LUIS application as GZip. + + :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: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`HttpOperationError` + """ + # 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=False, **operation_config) + + if response.status_code not in [200, 400, 401, 403, 429]: + raise HttpOperationError(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._client.stream_download(response, callback) + if response.status_code == 400: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 401: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 403: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 429: + deserialized = self._deserialize('ErrorResponse', response) + + 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'} diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/azure_accounts_operations.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/azure_accounts_operations.py new file mode 100644 index 000000000000..82f74387a8f9 --- /dev/null +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/azure_accounts_operations.py @@ -0,0 +1,303 @@ +# 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 AzureAccountsOperations(object): + """AzureAccountsOperations operations. + + :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, 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 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: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`HttpOperationError` + """ + # 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) + + # 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, 400, 401, 403, 429]: + raise HttpOperationError(self._deserialize, response) + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('OperationStatus', response) + if response.status_code == 400: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 401: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 403: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 429: + deserialized = self._deserialize('ErrorResponse', 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, 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 dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`HttpOperationError` + """ + # 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) + + # 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, 400, 401, 403, 429]: + raise HttpOperationError(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[AzureAccountInfoObject]', response) + if response.status_code == 400: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 401: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 403: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 429: + deserialized = self._deserialize('ErrorResponse', 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, 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 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: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`HttpOperationError` + """ + # 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) + + # 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, 400, 401, 403, 429]: + raise HttpOperationError(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + if response.status_code == 400: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 401: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 403: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 429: + deserialized = self._deserialize('ErrorResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + remove_from_app.metadata = {'url': '/apps/{appId}/azureaccounts'} + + def get_user_luis_accounts( + self, 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 dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`HttpOperationError` + """ + # Construct URL + url = self.get_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) + + # 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, 400, 401, 403, 429]: + raise HttpOperationError(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[AzureAccountInfoObject]', response) + if response.status_code == 400: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 401: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 403: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 429: + deserialized = self._deserialize('ErrorResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_user_luis_accounts.metadata = {'url': '/azureaccounts'} From db19d926b758ab15b1e16684347090acb813f840 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 13 Dec 2018 08:21:46 +0000 Subject: [PATCH 10/12] Generated from 32e19a3f178eab8d32f3fd79316bbaf7569ca7c8 fix oav and remove error responses --- .../authoring/operations/apps_operations.py | 61 +++++++------- .../operations/azure_accounts_operations.py | 81 +++++++------------ 2 files changed, 56 insertions(+), 86 deletions(-) diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/apps_operations.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/apps_operations.py index 9315a214872f..574f5e9dd4c9 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/apps_operations.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/apps_operations.py @@ -665,8 +665,11 @@ def publish( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: object or ClientRawResponse if raw=true - :rtype: object or ~msrest.pipeline.ClientRawResponse + :return: ProductionOrStagingEndpointInfo or ClientRawResponse if + raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.ProductionOrStagingEndpointInfo + or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ @@ -697,7 +700,7 @@ def publish( 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, 503]: + if response.status_code not in [201, 207]: raise models.ErrorResponseException(self._deserialize, response) deserialized = None @@ -706,8 +709,6 @@ def publish( deserialized = self._deserialize('ProductionOrStagingEndpointInfo', response) if response.status_code == 207: deserialized = self._deserialize('ProductionOrStagingEndpointInfo', response) - if response.status_code == 503: - deserialized = self._deserialize('str', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -1166,7 +1167,7 @@ def list_available_custom_prebuilt_domains_for_culture( 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, **operation_config): + 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. @@ -1179,12 +1180,17 @@ def package_published_application_as_gzip( :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: object or ~msrest.pipeline.ClientRawResponse + :rtype: Generator or ~msrest.pipeline.ClientRawResponse :raises: - :class:`HttpOperationError` + :class:`ErrorResponseException` """ # Construct URL url = self.package_published_application_as_gzip.metadata['url'] @@ -1206,23 +1212,15 @@ def package_published_application_as_gzip( # Construct and send request request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + response = self._client.send(request, stream=True, **operation_config) - if response.status_code not in [200, 400, 401, 403, 429]: - raise HttpOperationError(self._deserialize, response) + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: deserialized = self._client.stream_download(response, callback) - if response.status_code == 400: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 401: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 403: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 429: - deserialized = self._deserialize('ErrorResponse', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -1232,7 +1230,7 @@ def package_published_application_as_gzip( 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, **operation_config): + 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. @@ -1245,12 +1243,17 @@ def package_trained_application_as_gzip( :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: object or ~msrest.pipeline.ClientRawResponse + :rtype: Generator or ~msrest.pipeline.ClientRawResponse :raises: - :class:`HttpOperationError` + :class:`ErrorResponseException` """ # Construct URL url = self.package_trained_application_as_gzip.metadata['url'] @@ -1272,23 +1275,15 @@ def package_trained_application_as_gzip( # Construct and send request request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + response = self._client.send(request, stream=True, **operation_config) - if response.status_code not in [200, 400, 401, 403, 429]: - raise HttpOperationError(self._deserialize, response) + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: deserialized = self._client.stream_download(response, callback) - if response.status_code == 400: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 401: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 403: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 429: - deserialized = self._deserialize('ErrorResponse', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/azure_accounts_operations.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/azure_accounts_operations.py index 82f74387a8f9..dfe57349f549 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/azure_accounts_operations.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/azure_accounts_operations.py @@ -10,7 +10,6 @@ # -------------------------------------------------------------------------- from msrest.pipeline import ClientRawResponse -from msrest.exceptions import HttpOperationError from .. import models @@ -51,10 +50,12 @@ def assign_to_app( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: object or ClientRawResponse if raw=true - :rtype: object or ~msrest.pipeline.ClientRawResponse + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse :raises: - :class:`HttpOperationError` + :class:`ErrorResponseException` """ # Construct URL url = self.assign_to_app.metadata['url'] @@ -84,21 +85,13 @@ def assign_to_app( 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, 400, 401, 403, 429]: - raise HttpOperationError(self._deserialize, response) + 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 response.status_code == 400: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 401: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 403: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 429: - deserialized = self._deserialize('ErrorResponse', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -121,10 +114,12 @@ def get_assigned( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: object or ClientRawResponse if raw=true - :rtype: object or ~msrest.pipeline.ClientRawResponse + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.AzureAccountInfoObject] + or ~msrest.pipeline.ClientRawResponse :raises: - :class:`HttpOperationError` + :class:`ErrorResponseException` """ # Construct URL url = self.get_assigned.metadata['url'] @@ -147,21 +142,13 @@ def get_assigned( 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, 400, 401, 403, 429]: - raise HttpOperationError(self._deserialize, response) + 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 response.status_code == 400: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 401: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 403: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 429: - deserialized = self._deserialize('ErrorResponse', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -187,10 +174,12 @@ def remove_from_app( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: object or ClientRawResponse if raw=true - :rtype: object or ~msrest.pipeline.ClientRawResponse + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse :raises: - :class:`HttpOperationError` + :class:`ErrorResponseException` """ # Construct URL url = self.remove_from_app.metadata['url'] @@ -220,21 +209,13 @@ def remove_from_app( 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, 400, 401, 403, 429]: - raise HttpOperationError(self._deserialize, response) + 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 response.status_code == 400: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 401: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 403: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 429: - deserialized = self._deserialize('ErrorResponse', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -254,10 +235,12 @@ def get_user_luis_accounts( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: object or ClientRawResponse if raw=true - :rtype: object or ~msrest.pipeline.ClientRawResponse + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.AzureAccountInfoObject] + or ~msrest.pipeline.ClientRawResponse :raises: - :class:`HttpOperationError` + :class:`ErrorResponseException` """ # Construct URL url = self.get_user_luis_accounts.metadata['url'] @@ -279,21 +262,13 @@ def get_user_luis_accounts( 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, 400, 401, 403, 429]: - raise HttpOperationError(self._deserialize, response) + 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 response.status_code == 400: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 401: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 403: - deserialized = self._deserialize('ErrorResponse', response) - if response.status_code == 429: - deserialized = self._deserialize('ErrorResponse', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) From cc9b8ae6f07913f3a3f094ef75b5581bf01d0d94 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Thu, 13 Dec 2018 09:07:53 -0800 Subject: [PATCH 11/12] Update sdk_packaging.toml --- azure-cognitiveservices-language-luis/sdk_packaging.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-cognitiveservices-language-luis/sdk_packaging.toml b/azure-cognitiveservices-language-luis/sdk_packaging.toml index ffd80048fed4..41db1d0cb149 100644 --- a/azure-cognitiveservices-language-luis/sdk_packaging.toml +++ b/azure-cognitiveservices-language-luis/sdk_packaging.toml @@ -4,3 +4,4 @@ package_pprint_name = "Cognitive Services LUIS" package_doc_id = "cognitive-services" is_stable = false is_arm = false +need_msrestazure = false From 7b7461d33ce50edca3891f9a6e35af1e3048f5da Mon Sep 17 00:00:00 2001 From: azuresdkci Date: Thu, 13 Dec 2018 17:12:24 +0000 Subject: [PATCH 12/12] Packaging update of azure-cognitiveservices-language-luis --- azure-cognitiveservices-language-luis/setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/azure-cognitiveservices-language-luis/setup.py b/azure-cognitiveservices-language-luis/setup.py index 467a156b460d..c47a8246eabf 100644 --- a/azure-cognitiveservices-language-luis/setup.py +++ b/azure-cognitiveservices-language-luis/setup.py @@ -79,7 +79,6 @@ ]), install_requires=[ 'msrest>=0.5.0', - 'msrestazure>=0.4.32,<2.0.0', 'azure-common~=1.1', ], extras_require={