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/cognitiveservices/language/luis/authoring/luis_authoring_client.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/luis_authoring_client.py index 697917008e81..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 @@ -22,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 @@ -79,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). @@ -117,3 +120,5 @@ def __init__( 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 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 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/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 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 8d8753b35a2d..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 = {} @@ -696,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) @@ -1159,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_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/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 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..c47a8246eabf 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,18 @@ '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'], + } )