diff --git a/azure-cognitiveservices-language-luis/MANIFEST.in b/azure-cognitiveservices-language-luis/MANIFEST.in index bb37a2723dae..7f728a95d094 100644 --- a/azure-cognitiveservices-language-luis/MANIFEST.in +++ b/azure-cognitiveservices-language-luis/MANIFEST.in @@ -1 +1,5 @@ include *.rst +include azure/__init__.py +include azure/cognitiveservices/__init__.py +include azure/cognitiveservices/language/__init__.py + diff --git a/azure-cognitiveservices-language-luis/README.rst b/azure-cognitiveservices-language-luis/README.rst index 837869e535e6..72aa0880e806 100644 --- a/azure-cognitiveservices-language-luis/README.rst +++ b/azure-cognitiveservices-language-luis/README.rst @@ -8,25 +8,6 @@ This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For a more complete set of Azure libraries, see the `azure `__ bundle package. -Compatibility -============= - -**IMPORTANT**: If you have an earlier version of the azure package -(version < 1.0), you should uninstall it before installing this package. - -You can check the version using pip: - -.. code:: shell - - pip freeze - -If you see azure==0.11.0 (or any version below 1.0), uninstall it first: - -.. code:: shell - - pip uninstall azure - - Usage ===== 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 b6563fe9d625..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 @@ -21,6 +21,8 @@ from .operations.train_operations import TrainOperations 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 @@ -76,6 +78,10 @@ class LUISAuthoringClient(SDKClient): :vartype permissions: azure.cognitiveservices.language.luis.authoring.operations.PermissionsOperations :ivar pattern: Pattern operations :vartype pattern: azure.cognitiveservices.language.luis.authoring.operations.PatternOperations + :ivar settings: Settings operations + :vartype settings: azure.cognitiveservices.language.luis.authoring.operations.SettingsOperations + :ivar azure_accounts: AzureAccounts operations + :vartype azure_accounts: azure.cognitiveservices.language.luis.authoring.operations.AzureAccountsOperations :param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com). @@ -112,3 +118,7 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.pattern = PatternOperations( self._client, self.config, self._serialize, self._deserialize) + self.settings = SettingsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.azure_accounts = AzureAccountsOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/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 ee0e09955392..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 @@ -108,6 +108,8 @@ from .pattern_any_entity_extractor_py3 import PatternAnyEntityExtractor 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 @@ -210,6 +212,8 @@ from .pattern_any_entity_extractor import PatternAnyEntityExtractor 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 @@ -317,6 +321,8 @@ 'PatternAnyEntityExtractor', 'PatternRuleInfo', 'LabelTextObject', + 'AppVersionSettingObject', + 'AzureAccountInfoObject', 'HierarchicalChildModelUpdateObject', 'HierarchicalChildModelCreateObject', 'CompositeChildModelCreateObject', diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/app_version_setting_object.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/app_version_setting_object.py new file mode 100644 index 000000000000..4e2e5ff7bcb8 --- /dev/null +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/app_version_setting_object.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AppVersionSettingObject(Model): + """Object model of an application version setting. + + :param name: The application version setting name. + :type name: str + :param value: The application version setting value. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AppVersionSettingObject, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/app_version_setting_object_py3.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/app_version_setting_object_py3.py new file mode 100644 index 000000000000..2aef25bb7bf8 --- /dev/null +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/app_version_setting_object_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AppVersionSettingObject(Model): + """Object model of an application version setting. + + :param name: The application version setting name. + :type name: str + :param value: The application version setting value. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, value: str=None, **kwargs) -> None: + super(AppVersionSettingObject, self).__init__(**kwargs) + self.name = name + self.value = value diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/application_publish_object.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/application_publish_object.py index 756b803da141..963186f835c7 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/application_publish_object.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/application_publish_object.py @@ -20,18 +20,14 @@ class ApplicationPublishObject(Model): :param is_staging: Indicates if the staging slot should be used, instead of the Production one. Default value: False . :type is_staging: bool - :param region: The target region that the application is published to. - :type region: str """ _attribute_map = { 'version_id': {'key': 'versionId', 'type': 'str'}, 'is_staging': {'key': 'isStaging', 'type': 'bool'}, - 'region': {'key': 'region', 'type': 'str'}, } def __init__(self, **kwargs): super(ApplicationPublishObject, self).__init__(**kwargs) self.version_id = kwargs.get('version_id', None) self.is_staging = kwargs.get('is_staging', False) - self.region = kwargs.get('region', None) diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/application_publish_object_py3.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/application_publish_object_py3.py index 9064fb0e6440..3bda03edfe1a 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/application_publish_object_py3.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/application_publish_object_py3.py @@ -20,18 +20,14 @@ class ApplicationPublishObject(Model): :param is_staging: Indicates if the staging slot should be used, instead of the Production one. Default value: False . :type is_staging: bool - :param region: The target region that the application is published to. - :type region: str """ _attribute_map = { 'version_id': {'key': 'versionId', 'type': 'str'}, 'is_staging': {'key': 'isStaging', 'type': 'bool'}, - 'region': {'key': 'region', 'type': 'str'}, } - def __init__(self, *, version_id: str=None, is_staging: bool=False, region: str=None, **kwargs) -> None: + def __init__(self, *, version_id: str=None, is_staging: bool=False, **kwargs) -> None: super(ApplicationPublishObject, self).__init__(**kwargs) self.version_id = version_id self.is_staging = is_staging - self.region = region 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/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/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/luis_authoring_client_enums.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/luis_authoring_client_enums.py index f85ad6da8c8e..3bfeb07e7bff 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/luis_authoring_client_enums.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/luis_authoring_client_enums.py @@ -22,4 +22,5 @@ class TrainingStatus(str, Enum): class OperationStatusType(str, Enum): failed = "Failed" + failed = "FAILED" success = "Success" 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/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/__init__.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/__init__.py index a77faab1cd1d..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 @@ -17,6 +17,8 @@ from .train_operations import TrainOperations from .permissions_operations import PermissionsOperations from .pattern_operations import PatternOperations +from .settings_operations import SettingsOperations +from .azure_accounts_operations import AzureAccountsOperations __all__ = [ 'FeaturesOperations', @@ -27,4 +29,6 @@ 'TrainOperations', '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 18b46100b82a..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 @@ -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: @@ -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 = {} @@ -646,15 +650,16 @@ def delete( delete.metadata = {'url': '/apps/{appId}'} def publish( - self, app_id, application_publish_object, custom_headers=None, raw=False, **operation_config): + self, app_id, version_id=None, is_staging=False, custom_headers=None, raw=False, **operation_config): """Publishes a specific version of the application. :param app_id: The application ID. :type app_id: str - :param application_publish_object: The application publish object. The - region is the target region that the application is published to. - :type application_publish_object: - ~azure.cognitiveservices.language.luis.authoring.models.ApplicationPublishObject + :param version_id: The version ID to publish. + :type version_id: str + :param is_staging: Indicates if the staging slot should be used, + instead of the Production one. + :type is_staging: bool :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -668,6 +673,8 @@ def publish( :raises: :class:`ErrorResponseException` """ + application_publish_object = models.ApplicationPublishObject(version_id=version_id, is_staging=is_staging) + # Construct URL url = self.publish.metadata['url'] path_format_arguments = { @@ -693,13 +700,15 @@ 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]: raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 201: deserialized = self._deserialize('ProductionOrStagingEndpointInfo', response) + if response.status_code == 207: + deserialized = self._deserialize('ProductionOrStagingEndpointInfo', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -1156,3 +1165,129 @@ 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, callback=None, **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 callback: When specified, will be called with each chunk of + data that is streamed. The callback should take two arguments, the + bytes of the current chunk of data and the response object. If the + data is uploading, response will be None. + :type callback: Callable[Bytes, response=None] + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: Generator or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.package_published_application_as_gzip.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'slotName': self._serialize.url("slot_name", slot_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=True, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._client.stream_download(response, callback) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + package_published_application_as_gzip.metadata = {'url': '/package/{appId}/slot/{slotName}/gzip'} + + def package_trained_application_as_gzip( + self, app_id, version_id, custom_headers=None, raw=False, callback=None, **operation_config): + """package - Gets trained LUIS application package in binary stream GZip + format. + + Packages trained LUIS application as GZip. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param callback: When specified, will be called with each chunk of + data that is streamed. The callback should take two arguments, the + bytes of the current chunk of data and the response object. If the + data is uploading, response will be None. + :type callback: Callable[Bytes, response=None] + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: Generator or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.package_trained_application_as_gzip.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=True, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._client.stream_download(response, callback) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + package_trained_application_as_gzip.metadata = {'url': '/package/{appId}/versions/{versionId}/gzip'} 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..dfe57349f549 --- /dev/null +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/azure_accounts_operations.py @@ -0,0 +1,278 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class AzureAccountsOperations(object): + """AzureAccountsOperations operations. + + :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: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.assign_to_app.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + if azure_account_info_object is not None: + body_content = self._serialize.body(azure_account_info_object, 'AzureAccountInfoObject') + else: + body_content = None + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + assign_to_app.metadata = {'url': '/apps/{appId}/azureaccounts'} + + def get_assigned( + self, app_id, 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: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.AzureAccountInfoObject] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_assigned.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[AzureAccountInfoObject]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_assigned.metadata = {'url': '/apps/{appId}/azureaccounts'} + + def remove_from_app( + self, app_id, 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: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.remove_from_app.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + if azure_account_info_object is not None: + body_content = self._serialize.body(azure_account_info_object, 'AzureAccountInfoObject') + else: + body_content = None + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + remove_from_app.metadata = {'url': '/apps/{appId}/azureaccounts'} + + def 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: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.AzureAccountInfoObject] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_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]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[AzureAccountInfoObject]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_user_luis_accounts.metadata = {'url': '/azureaccounts'} diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/model_operations.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/model_operations.py index 12eaada5a040..138cbbc9de8f 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/model_operations.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/model_operations.py @@ -165,7 +165,7 @@ def list_intents( def add_entity( self, app_id, version_id, name=None, custom_headers=None, raw=False, **operation_config): - """Adds an entity extractor to the application. + """Adds a simple entity extractor to the application. :param app_id: The application ID. :type app_id: str diff --git a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/settings_operations.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/settings_operations.py new file mode 100644 index 000000000000..e5850e0c0e5b --- /dev/null +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/settings_operations.py @@ -0,0 +1,158 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class SettingsOperations(object): + """SettingsOperations 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 list( + self, app_id, version_id, custom_headers=None, raw=False, **operation_config): + """Gets the application version settings. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.language.luis.authoring.models.AppVersionSettingObject] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[AppVersionSettingObject]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/apps/{appId}/versions/{versionId}/settings'} + + def update( + self, app_id, version_id, name=None, value=None, custom_headers=None, raw=False, **operation_config): + """Updates the application version settings. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param name: The application version setting name. + :type name: str + :param value: The application version setting value. + :type value: str + :param dict custom_headers: headers that will 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` + """ + list_of_app_version_setting_object = models.AppVersionSettingObject(name=name, value=value) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'appId': self._serialize.url("app_id", app_id, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(list_of_app_version_setting_object, 'AppVersionSettingObject') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/apps/{appId}/versions/{versionId}/settings'} diff --git a/azure-cognitiveservices-language-luis/setup.py b/azure-cognitiveservices-language-luis/setup.py index c47a8246eabf..467a156b460d 100644 --- a/azure-cognitiveservices-language-luis/setup.py +++ b/azure-cognitiveservices-language-luis/setup.py @@ -79,6 +79,7 @@ ]), install_requires=[ 'msrest>=0.5.0', + 'msrestazure>=0.4.32,<2.0.0', 'azure-common~=1.1', ], extras_require={