From c83effcf7e1701844202679001b63c03e015384e Mon Sep 17 00:00:00 2001 From: Azure SDK Bot Date: Mon, 2 Dec 2019 10:12:33 +0800 Subject: [PATCH] [AutoPR cosmos-db/resource-manager] Fix response structure (#8704) * Generated from 49871ca03fed5f6e6d5868c5fc779abb07f38e1d Fix response structure * Generated from ee13f8f1b953ef574227af8d0d6296aedad206a6 Add new properties and fix CI * Packaging update of azure-cognitiveservices-knowledge-qnamaker * Generated from c89a971a7edf5c22aa990089bc59f68a6c61747b Remove unrelated properties * Generated from 95419ab0fc19466e62f05035c84d4f6b7bc80cb9 Remove unrelated properties --- .../README.rst | 2 +- .../knowledge/qnamaker/__init__.py | 7 +- .../knowledge/qnamaker/_configuration.py | 47 + ..._amaker_client.py => _qn_amaker_client.py} | 48 +- .../qnamaker/_qn_amaker_runtime_client.py | 49 + .../knowledge/qnamaker/models/__init__.py | 142 +- .../knowledge/qnamaker/models/_models.py | 589 +++++++++ .../knowledge/qnamaker/models/_models_py3.py | 589 +++++++++ ...nt_enums.py => _qn_amaker_client_enums.py} | 6 - .../models/_qn_amaker_runtime_client_enums.py | 30 + .../qnamaker/models/alterations_dto.py | 34 - .../qnamaker/models/alterations_dto_py3.py | 34 - .../qnamaker/models/create_kb_dto.py | 49 - .../qnamaker/models/create_kb_dto_py3.py | 49 - .../qnamaker/models/create_kb_input_dto.py | 39 - .../models/create_kb_input_dto_py3.py | 39 - .../qnamaker/models/delete_kb_contents_dto.py | 32 - .../models/delete_kb_contents_dto_py3.py | 32 - .../qnamaker/models/endpoint_keys_dto.py | 40 - .../qnamaker/models/endpoint_keys_dto_py3.py | 40 - .../knowledge/qnamaker/models/error.py | 61 - .../knowledge/qnamaker/models/error_py3.py | 61 - .../qnamaker/models/error_response.py | 43 - .../qnamaker/models/error_response_error.py | 55 - .../models/error_response_error_py3.py | 55 - .../qnamaker/models/error_response_py3.py | 43 - .../knowledge/qnamaker/models/file_dto.py | 40 - .../knowledge/qnamaker/models/file_dto_py3.py | 40 - .../qnamaker/models/inner_error_model.py | 37 - .../qnamaker/models/inner_error_model_py3.py | 37 - .../qnamaker/models/knowledgebase_dto.py | 65 - .../qnamaker/models/knowledgebase_dto_py3.py | 65 - .../qnamaker/models/knowledgebases_dto.py | 29 - .../qnamaker/models/knowledgebases_dto_py3.py | 29 - .../knowledge/qnamaker/models/metadata_dto.py | 39 - .../qnamaker/models/metadata_dto_py3.py | 39 - .../knowledge/qnamaker/models/operation.py | 57 - .../qnamaker/models/operation_py3.py | 57 - .../qnamaker/models/qn_adocuments_dto.py | 29 - .../qnamaker/models/qn_adocuments_dto_py3.py | 29 - .../knowledge/qnamaker/models/qn_adto.py | 54 - .../knowledge/qnamaker/models/qn_adto_py3.py | 54 - .../qnamaker/models/replace_kb_dto.py | 36 - .../qnamaker/models/replace_kb_dto_py3.py | 36 - .../qnamaker/models/update_kb_contents_dto.py | 39 - .../models/update_kb_contents_dto_py3.py | 39 - .../models/update_kb_operation_dto.py | 39 - .../models/update_kb_operation_dto_add.py | 36 - .../models/update_kb_operation_dto_add_py3.py | 36 - .../models/update_kb_operation_dto_delete.py | 30 - .../update_kb_operation_dto_delete_py3.py | 30 - .../models/update_kb_operation_dto_py3.py | 39 - .../models/update_kb_operation_dto_update.py | 36 - .../update_kb_operation_dto_update_py3.py | 36 - .../qnamaker/models/update_metadata_dto.py | 34 - .../models/update_metadata_dto_py3.py | 34 - .../qnamaker/models/update_qna_dto.py | 52 - .../models/update_qna_dto_metadata.py | 32 - .../models/update_qna_dto_metadata_py3.py | 32 - .../qnamaker/models/update_qna_dto_py3.py | 52 - .../models/update_qna_dto_questions.py | 30 - .../models/update_qna_dto_questions_py3.py | 30 - .../qnamaker/models/update_questions_dto.py | 33 - .../models/update_questions_dto_py3.py | 33 - .../qnamaker/models/word_alterations_dto.py | 35 - .../models/word_alterations_dto_py3.py | 35 - .../knowledge/qnamaker/operations/__init__.py | 10 +- ...erations.py => _alterations_operations.py} | 3 +- ...ations.py => _endpoint_keys_operations.py} | 4 +- .../_endpoint_settings_operations.py | 143 ++ ...ations.py => _knowledgebase_operations.py} | 9 +- .../{operations.py => _operations.py} | 5 +- .../operations/_runtime_operations.py | 149 +++ .../setup.py | 1 - .../azure/mgmt/cosmosdb/models/__init__.py | 46 + .../_cosmos_db_management_client_enums.py | 14 + .../azure/mgmt/cosmosdb/models/_models.py | 1120 ++++++++++------ .../azure/mgmt/cosmosdb/models/_models_py3.py | 1152 +++++++++++------ 78 files changed, 3190 insertions(+), 3245 deletions(-) create mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/_configuration.py rename sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/{qn_amaker_client.py => _qn_amaker_client.py} (64%) create mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/_qn_amaker_runtime_client.py create mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/_models.py create mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/_models_py3.py rename sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/{qn_amaker_client_enums.py => _qn_amaker_client_enums.py} (93%) create mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/_qn_amaker_runtime_client_enums.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/alterations_dto.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/alterations_dto_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/create_kb_dto.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/create_kb_dto_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/create_kb_input_dto.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/create_kb_input_dto_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/delete_kb_contents_dto.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/delete_kb_contents_dto_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/endpoint_keys_dto.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/endpoint_keys_dto_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/error.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/error_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/error_response.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/error_response_error.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/error_response_error_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/error_response_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/file_dto.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/file_dto_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/inner_error_model.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/inner_error_model_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/knowledgebase_dto.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/knowledgebase_dto_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/knowledgebases_dto.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/knowledgebases_dto_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/metadata_dto.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/metadata_dto_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/operation.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/operation_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/qn_adocuments_dto.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/qn_adocuments_dto_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/qn_adto.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/qn_adto_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/replace_kb_dto.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/replace_kb_dto_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_kb_contents_dto.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_kb_contents_dto_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_kb_operation_dto.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_kb_operation_dto_add.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_kb_operation_dto_add_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_kb_operation_dto_delete.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_kb_operation_dto_delete_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_kb_operation_dto_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_kb_operation_dto_update.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_kb_operation_dto_update_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_metadata_dto.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_metadata_dto_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_qna_dto.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_qna_dto_metadata.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_qna_dto_metadata_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_qna_dto_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_qna_dto_questions.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_qna_dto_questions_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_questions_dto.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_questions_dto_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/word_alterations_dto.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/word_alterations_dto_py3.py rename sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/operations/{alterations_operations.py => _alterations_operations.py} (97%) rename sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/operations/{endpoint_keys_operations.py => _endpoint_keys_operations.py} (97%) create mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/operations/_endpoint_settings_operations.py rename sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/operations/{knowledgebase_operations.py => _knowledgebase_operations.py} (99%) rename sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/operations/{operations.py => _operations.py} (96%) create mode 100644 sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/operations/_runtime_operations.py diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/README.rst b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/README.rst index 53e6fe10520b..e57dfef31d25 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/README.rst +++ b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/README.rst @@ -3,7 +3,7 @@ Microsoft Azure SDK for Python This is the Microsoft Azure QnA Maker Client Library. -This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. +This package has been tested with Python 2.7, 3.5, 3.6 and 3.7. For a more complete set of Azure libraries, see the `azure `__ bundle package. diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/__init__.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/__init__.py index 1b5232d238e3..f283c224f42c 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/__init__.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/__init__.py @@ -9,10 +9,11 @@ # regenerated. # -------------------------------------------------------------------------- -from .qn_amaker_client import QnAMakerClient -from .version import VERSION +from ._configuration import QnAMakerRuntimeClientConfiguration +from ._qn_amaker_runtime_client import QnAMakerRuntimeClient +__all__ = ['QnAMakerRuntimeClient', 'QnAMakerRuntimeClientConfiguration'] -__all__ = ['QnAMakerClient'] +from .version import VERSION __version__ = VERSION diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/_configuration.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/_configuration.py new file mode 100644 index 000000000000..57d958a26600 --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/_configuration.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest import Configuration + +from .version import VERSION + + +class QnAMakerRuntimeClientConfiguration(Configuration): + """Configuration for QnAMakerRuntimeClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param runtime_endpoint: QnA Maker App Service endpoint (for example: + https://{qnaservice-hostname}.azurewebsites.net). + :type runtime_endpoint: str + :param credentials: Subscription credentials which uniquely identify + client subscription. + :type credentials: None + """ + + def __init__( + self, runtime_endpoint, credentials): + + if runtime_endpoint is None: + raise ValueError("Parameter 'runtime_endpoint' must not be None.") + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + base_url = '{RuntimeEndpoint}/qnamaker' + + super(QnAMakerRuntimeClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-cognitiveservices-knowledge-qnamaker/{}'.format(VERSION)) + + self.runtime_endpoint = runtime_endpoint + self.credentials = credentials diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/qn_amaker_client.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/_qn_amaker_client.py similarity index 64% rename from sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/qn_amaker_client.py rename to sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/_qn_amaker_client.py index aef5f6b21336..0dd860988506 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/qn_amaker_client.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/_qn_amaker_client.py @@ -10,51 +10,25 @@ # -------------------------------------------------------------------------- from msrest.service_client import SDKClient -from msrest import Configuration, Serializer, Deserializer -from .version import VERSION -from .operations.endpoint_keys_operations import EndpointKeysOperations -from .operations.alterations_operations import AlterationsOperations -from .operations.knowledgebase_operations import KnowledgebaseOperations -from .operations.operations import Operations +from msrest import Serializer, Deserializer + +from ._configuration import QnAMakerClientConfiguration +from .operations import EndpointSettingsOperations +from .operations import EndpointKeysOperations +from .operations import AlterationsOperations +from .operations import KnowledgebaseOperations +from .operations import Operations from . import models -class QnAMakerClientConfiguration(Configuration): - """Configuration for QnAMakerClient - Note that all parameters used to create this instance are saved as instance - attributes. - - :param endpoint: Supported Cognitive Services endpoints (protocol and - hostname, for example: https://westus.api.cognitive.microsoft.com). - :type endpoint: str - :param credentials: Subscription credentials which uniquely identify - client subscription. - :type credentials: None - """ - - def __init__( - self, endpoint, credentials): - - if endpoint is None: - raise ValueError("Parameter 'endpoint' must not be None.") - if credentials is None: - raise ValueError("Parameter 'credentials' must not be None.") - base_url = '{Endpoint}/qnamaker/v4.0' - - super(QnAMakerClientConfiguration, self).__init__(base_url) - - self.add_user_agent('azure-cognitiveservices-knowledge-qnamaker/{}'.format(VERSION)) - - self.endpoint = endpoint - self.credentials = credentials - - class QnAMakerClient(SDKClient): """An API for QnAMaker Service :ivar config: Configuration for client. :vartype config: QnAMakerClientConfiguration + :ivar endpoint_settings: EndpointSettings operations + :vartype endpoint_settings: azure.cognitiveservices.knowledge.qnamaker.operations.EndpointSettingsOperations :ivar endpoint_keys: EndpointKeys operations :vartype endpoint_keys: azure.cognitiveservices.knowledge.qnamaker.operations.EndpointKeysOperations :ivar alterations: Alterations operations @@ -83,6 +57,8 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) + self.endpoint_settings = EndpointSettingsOperations( + self._client, self.config, self._serialize, self._deserialize) self.endpoint_keys = EndpointKeysOperations( self._client, self.config, self._serialize, self._deserialize) self.alterations = AlterationsOperations( diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/_qn_amaker_runtime_client.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/_qn_amaker_runtime_client.py new file mode 100644 index 000000000000..62bf2d97b390 --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/_qn_amaker_runtime_client.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.service_client import SDKClient +from msrest import Serializer, Deserializer + +from ._configuration import QnAMakerRuntimeClientConfiguration +from .operations import RuntimeOperations +from . import models + + +class QnAMakerRuntimeClient(SDKClient): + """An API for QnAMaker runtime + + :ivar config: Configuration for client. + :vartype config: QnAMakerRuntimeClientConfiguration + + :ivar runtime: Runtime operations + :vartype runtime: azure.cognitiveservices.knowledge.qnamaker.operations.RuntimeOperations + + :param runtime_endpoint: QnA Maker App Service endpoint (for example: + https://{qnaservice-hostname}.azurewebsites.net). + :type runtime_endpoint: str + :param credentials: Subscription credentials which uniquely identify + client subscription. + :type credentials: None + """ + + def __init__( + self, runtime_endpoint, credentials): + + self.config = QnAMakerRuntimeClientConfiguration(runtime_endpoint, credentials) + super(QnAMakerRuntimeClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '4.0' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.runtime = RuntimeOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/__init__.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/__init__.py index b204c1cef2bf..a1181c783561 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/__init__.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/__init__.py @@ -10,101 +10,65 @@ # -------------------------------------------------------------------------- try: - from .update_kb_operation_dto_add_py3 import UpdateKbOperationDTOAdd - from .update_kb_operation_dto_delete_py3 import UpdateKbOperationDTODelete - from .update_kb_operation_dto_update_py3 import UpdateKbOperationDTOUpdate - from .update_kb_operation_dto_py3 import UpdateKbOperationDTO - from .update_qna_dto_questions_py3 import UpdateQnaDTOQuestions - from .update_qna_dto_metadata_py3 import UpdateQnaDTOMetadata - from .update_qna_dto_py3 import UpdateQnaDTO - from .update_kb_contents_dto_py3 import UpdateKbContentsDTO - from .update_questions_dto_py3 import UpdateQuestionsDTO - from .metadata_dto_py3 import MetadataDTO - from .update_metadata_dto_py3 import UpdateMetadataDTO - from .delete_kb_contents_dto_py3 import DeleteKbContentsDTO - from .qn_adto_py3 import QnADTO - from .file_dto_py3 import FileDTO - from .create_kb_input_dto_py3 import CreateKbInputDTO - from .qn_adocuments_dto_py3 import QnADocumentsDTO - from .create_kb_dto_py3 import CreateKbDTO - from .replace_kb_dto_py3 import ReplaceKbDTO - from .error_response_error_py3 import ErrorResponseError - from .error_response_py3 import ErrorResponse, ErrorResponseException - from .inner_error_model_py3 import InnerErrorModel - from .error_py3 import Error - from .operation_py3 import Operation - from .knowledgebase_dto_py3 import KnowledgebaseDTO - from .knowledgebases_dto_py3 import KnowledgebasesDTO - from .alterations_dto_py3 import AlterationsDTO - from .word_alterations_dto_py3 import WordAlterationsDTO - from .endpoint_keys_dto_py3 import EndpointKeysDTO + from ._models_py3 import ContextDTO + from ._models_py3 import Error + from ._models_py3 import ErrorResponse, ErrorResponseException + from ._models_py3 import ErrorResponseError + from ._models_py3 import FeedbackRecordDTO + from ._models_py3 import FeedbackRecordsDTO + from ._models_py3 import InnerErrorModel + from ._models_py3 import MetadataDTO + from ._models_py3 import PromptDTO + from ._models_py3 import PromptDTOQna + from ._models_py3 import QnADTO + from ._models_py3 import QnADTOContext + from ._models_py3 import QnASearchResult + from ._models_py3 import QnASearchResultContext + from ._models_py3 import QnASearchResultList + from ._models_py3 import QueryContextDTO + from ._models_py3 import QueryDTO + from ._models_py3 import QueryDTOContext except (SyntaxError, ImportError): - from .update_kb_operation_dto_add import UpdateKbOperationDTOAdd - from .update_kb_operation_dto_delete import UpdateKbOperationDTODelete - from .update_kb_operation_dto_update import UpdateKbOperationDTOUpdate - from .update_kb_operation_dto import UpdateKbOperationDTO - from .update_qna_dto_questions import UpdateQnaDTOQuestions - from .update_qna_dto_metadata import UpdateQnaDTOMetadata - from .update_qna_dto import UpdateQnaDTO - from .update_kb_contents_dto import UpdateKbContentsDTO - from .update_questions_dto import UpdateQuestionsDTO - from .metadata_dto import MetadataDTO - from .update_metadata_dto import UpdateMetadataDTO - from .delete_kb_contents_dto import DeleteKbContentsDTO - from .qn_adto import QnADTO - from .file_dto import FileDTO - from .create_kb_input_dto import CreateKbInputDTO - from .qn_adocuments_dto import QnADocumentsDTO - from .create_kb_dto import CreateKbDTO - from .replace_kb_dto import ReplaceKbDTO - from .error_response_error import ErrorResponseError - from .error_response import ErrorResponse, ErrorResponseException - from .inner_error_model import InnerErrorModel - from .error import Error - from .operation import Operation - from .knowledgebase_dto import KnowledgebaseDTO - from .knowledgebases_dto import KnowledgebasesDTO - from .alterations_dto import AlterationsDTO - from .word_alterations_dto import WordAlterationsDTO - from .endpoint_keys_dto import EndpointKeysDTO -from .qn_amaker_client_enums import ( - KnowledgebaseEnvironmentType, + from ._models import ContextDTO + from ._models import Error + from ._models import ErrorResponse, ErrorResponseException + from ._models import ErrorResponseError + from ._models import FeedbackRecordDTO + from ._models import FeedbackRecordsDTO + from ._models import InnerErrorModel + from ._models import MetadataDTO + from ._models import PromptDTO + from ._models import PromptDTOQna + from ._models import QnADTO + from ._models import QnADTOContext + from ._models import QnASearchResult + from ._models import QnASearchResultContext + from ._models import QnASearchResultList + from ._models import QueryContextDTO + from ._models import QueryDTO + from ._models import QueryDTOContext +from ._qn_amaker_runtime_client_enums import ( ErrorCodeType, - OperationStateType, - EnvironmentType, ) __all__ = [ - 'UpdateKbOperationDTOAdd', - 'UpdateKbOperationDTODelete', - 'UpdateKbOperationDTOUpdate', - 'UpdateKbOperationDTO', - 'UpdateQnaDTOQuestions', - 'UpdateQnaDTOMetadata', - 'UpdateQnaDTO', - 'UpdateKbContentsDTO', - 'UpdateQuestionsDTO', - 'MetadataDTO', - 'UpdateMetadataDTO', - 'DeleteKbContentsDTO', - 'QnADTO', - 'FileDTO', - 'CreateKbInputDTO', - 'QnADocumentsDTO', - 'CreateKbDTO', - 'ReplaceKbDTO', - 'ErrorResponseError', + 'ContextDTO', + 'Error', 'ErrorResponse', 'ErrorResponseException', + 'ErrorResponseError', + 'FeedbackRecordDTO', + 'FeedbackRecordsDTO', 'InnerErrorModel', - 'Error', - 'Operation', - 'KnowledgebaseDTO', - 'KnowledgebasesDTO', - 'AlterationsDTO', - 'WordAlterationsDTO', - 'EndpointKeysDTO', - 'KnowledgebaseEnvironmentType', + 'MetadataDTO', + 'PromptDTO', + 'PromptDTOQna', + 'QnADTO', + 'QnADTOContext', + 'QnASearchResult', + 'QnASearchResultContext', + 'QnASearchResultList', + 'QueryContextDTO', + 'QueryDTO', + 'QueryDTOContext', 'ErrorCodeType', - 'OperationStateType', - 'EnvironmentType', ] diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/_models.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/_models.py new file mode 100644 index 000000000000..0734197a0076 --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/_models.py @@ -0,0 +1,589 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class ContextDTO(Model): + """Context associated with Qna. + + :param is_context_only: To mark if a prompt is relevant only with a + previous question or not. + true - Do not include this QnA as search result for queries without + context + false - ignores context and includes this QnA in search result + :type is_context_only: bool + :param prompts: List of prompts associated with the answer. + :type prompts: + list[~azure.cognitiveservices.knowledge.qnamaker.models.PromptDTO] + """ + + _validation = { + 'prompts': {'max_items': 20}, + } + + _attribute_map = { + 'is_context_only': {'key': 'isContextOnly', 'type': 'bool'}, + 'prompts': {'key': 'prompts', 'type': '[PromptDTO]'}, + } + + def __init__(self, **kwargs): + super(ContextDTO, self).__init__(**kwargs) + self.is_context_only = kwargs.get('is_context_only', None) + self.prompts = kwargs.get('prompts', None) + + +class Error(Model): + """The error object. As per Microsoft One API guidelines - + https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. One of a server-defined set of error codes. + Possible values include: 'BadArgument', 'Forbidden', 'NotFound', + 'KbNotFound', 'Unauthorized', 'Unspecified', 'EndpointKeysError', + 'QuotaExceeded', 'QnaRuntimeError', 'SKULimitExceeded', + 'OperationNotFound', 'ServiceError', 'ValidationFailure', + 'ExtractionFailure' + :type code: str or + ~azure.cognitiveservices.knowledge.qnamaker.models.ErrorCodeType + :param message: A human-readable representation of the error. + :type message: str + :param target: The target of the error. + :type target: str + :param details: An array of details about specific errors that led to this + reported error. + :type details: + list[~azure.cognitiveservices.knowledge.qnamaker.models.Error] + :param inner_error: An object containing more specific information than + the current object about the error. + :type inner_error: + ~azure.cognitiveservices.knowledge.qnamaker.models.InnerErrorModel + """ + + _validation = { + 'code': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[Error]'}, + 'inner_error': {'key': 'innerError', 'type': 'InnerErrorModel'}, + } + + def __init__(self, **kwargs): + super(Error, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + self.inner_error = kwargs.get('inner_error', None) + + +class ErrorResponse(Model): + """Error response. As per Microsoft One API guidelines - + https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses. + + :param error: The error object. + :type error: + ~azure.cognitiveservices.knowledge.qnamaker.models.ErrorResponseError + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponseError'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class ErrorResponseError(Error): + """The error object. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. One of a server-defined set of error codes. + Possible values include: 'BadArgument', 'Forbidden', 'NotFound', + 'KbNotFound', 'Unauthorized', 'Unspecified', 'EndpointKeysError', + 'QuotaExceeded', 'QnaRuntimeError', 'SKULimitExceeded', + 'OperationNotFound', 'ServiceError', 'ValidationFailure', + 'ExtractionFailure' + :type code: str or + ~azure.cognitiveservices.knowledge.qnamaker.models.ErrorCodeType + :param message: A human-readable representation of the error. + :type message: str + :param target: The target of the error. + :type target: str + :param details: An array of details about specific errors that led to this + reported error. + :type details: + list[~azure.cognitiveservices.knowledge.qnamaker.models.Error] + :param inner_error: An object containing more specific information than + the current object about the error. + :type inner_error: + ~azure.cognitiveservices.knowledge.qnamaker.models.InnerErrorModel + """ + + _validation = { + 'code': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[Error]'}, + 'inner_error': {'key': 'innerError', 'type': 'InnerErrorModel'}, + } + + def __init__(self, **kwargs): + super(ErrorResponseError, self).__init__(**kwargs) + + +class FeedbackRecordDTO(Model): + """Active learning feedback record. + + :param user_id: Unique identifier for the user. + :type user_id: str + :param user_question: The suggested question being provided as feedback. + :type user_question: str + :param qna_id: The qnaId for which the suggested question is provided as + feedback. + :type qna_id: int + """ + + _validation = { + 'user_question': {'max_length': 1000}, + } + + _attribute_map = { + 'user_id': {'key': 'userId', 'type': 'str'}, + 'user_question': {'key': 'userQuestion', 'type': 'str'}, + 'qna_id': {'key': 'qnaId', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(FeedbackRecordDTO, self).__init__(**kwargs) + self.user_id = kwargs.get('user_id', None) + self.user_question = kwargs.get('user_question', None) + self.qna_id = kwargs.get('qna_id', None) + + +class FeedbackRecordsDTO(Model): + """Active learning feedback records. + + :param feedback_records: List of feedback records. + :type feedback_records: + list[~azure.cognitiveservices.knowledge.qnamaker.models.FeedbackRecordDTO] + """ + + _attribute_map = { + 'feedback_records': {'key': 'feedbackRecords', 'type': '[FeedbackRecordDTO]'}, + } + + def __init__(self, **kwargs): + super(FeedbackRecordsDTO, self).__init__(**kwargs) + self.feedback_records = kwargs.get('feedback_records', None) + + +class InnerErrorModel(Model): + """An object containing more specific information about the error. As per + Microsoft One API guidelines - + https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses. + + :param code: A more specific error code than was provided by the + containing error. + :type code: str + :param inner_error: An object containing more specific information than + the current object about the error. + :type inner_error: + ~azure.cognitiveservices.knowledge.qnamaker.models.InnerErrorModel + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'inner_error': {'key': 'innerError', 'type': 'InnerErrorModel'}, + } + + def __init__(self, **kwargs): + super(InnerErrorModel, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.inner_error = kwargs.get('inner_error', None) + + +class MetadataDTO(Model): + """Name - value pair of metadata. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Metadata name. + :type name: str + :param value: Required. Metadata value. + :type value: str + """ + + _validation = { + 'name': {'required': True, 'max_length': 100, 'min_length': 1}, + 'value': {'required': True, 'max_length': 500, 'min_length': 1}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MetadataDTO, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + + +class PromptDTO(Model): + """Prompt for an answer. + + :param display_order: Index of the prompt - used in ordering of the + prompts + :type display_order: int + :param qna_id: Qna id corresponding to the prompt - if QnaId is present, + QnADTO object is ignored. + :type qna_id: int + :param qna: QnADTO - Either QnaId or QnADTO needs to be present in a + PromptDTO object + :type qna: ~azure.cognitiveservices.knowledge.qnamaker.models.PromptDTOQna + :param display_text: Text displayed to represent a follow up question + prompt + :type display_text: str + """ + + _validation = { + 'display_text': {'max_length': 200}, + } + + _attribute_map = { + 'display_order': {'key': 'displayOrder', 'type': 'int'}, + 'qna_id': {'key': 'qnaId', 'type': 'int'}, + 'qna': {'key': 'qna', 'type': 'PromptDTOQna'}, + 'display_text': {'key': 'displayText', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PromptDTO, self).__init__(**kwargs) + self.display_order = kwargs.get('display_order', None) + self.qna_id = kwargs.get('qna_id', None) + self.qna = kwargs.get('qna', None) + self.display_text = kwargs.get('display_text', None) + + +class QnADTO(Model): + """Q-A object. + + All required parameters must be populated in order to send to Azure. + + :param id: Unique id for the Q-A. + :type id: int + :param answer: Required. Answer text + :type answer: str + :param source: Source from which Q-A was indexed. eg. + https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs + :type source: str + :param questions: Required. List of questions associated with the answer. + :type questions: list[str] + :param metadata: List of metadata associated with the answer. + :type metadata: + list[~azure.cognitiveservices.knowledge.qnamaker.models.MetadataDTO] + :param context: Context of a QnA + :type context: + ~azure.cognitiveservices.knowledge.qnamaker.models.QnADTOContext + """ + + _validation = { + 'answer': {'required': True, 'max_length': 25000, 'min_length': 1}, + 'source': {'max_length': 300}, + 'questions': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'answer': {'key': 'answer', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'str'}, + 'questions': {'key': 'questions', 'type': '[str]'}, + 'metadata': {'key': 'metadata', 'type': '[MetadataDTO]'}, + 'context': {'key': 'context', 'type': 'QnADTOContext'}, + } + + def __init__(self, **kwargs): + super(QnADTO, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.answer = kwargs.get('answer', None) + self.source = kwargs.get('source', None) + self.questions = kwargs.get('questions', None) + self.metadata = kwargs.get('metadata', None) + self.context = kwargs.get('context', None) + + +class PromptDTOQna(QnADTO): + """QnADTO - Either QnaId or QnADTO needs to be present in a PromptDTO object. + + All required parameters must be populated in order to send to Azure. + + :param id: Unique id for the Q-A. + :type id: int + :param answer: Required. Answer text + :type answer: str + :param source: Source from which Q-A was indexed. eg. + https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs + :type source: str + :param questions: Required. List of questions associated with the answer. + :type questions: list[str] + :param metadata: List of metadata associated with the answer. + :type metadata: + list[~azure.cognitiveservices.knowledge.qnamaker.models.MetadataDTO] + :param context: Context of a QnA + :type context: + ~azure.cognitiveservices.knowledge.qnamaker.models.QnADTOContext + """ + + _validation = { + 'answer': {'required': True, 'max_length': 25000, 'min_length': 1}, + 'source': {'max_length': 300}, + 'questions': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'answer': {'key': 'answer', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'str'}, + 'questions': {'key': 'questions', 'type': '[str]'}, + 'metadata': {'key': 'metadata', 'type': '[MetadataDTO]'}, + 'context': {'key': 'context', 'type': 'QnADTOContext'}, + } + + def __init__(self, **kwargs): + super(PromptDTOQna, self).__init__(**kwargs) + + +class QnADTOContext(ContextDTO): + """Context of a QnA. + + :param is_context_only: To mark if a prompt is relevant only with a + previous question or not. + true - Do not include this QnA as search result for queries without + context + false - ignores context and includes this QnA in search result + :type is_context_only: bool + :param prompts: List of prompts associated with the answer. + :type prompts: + list[~azure.cognitiveservices.knowledge.qnamaker.models.PromptDTO] + """ + + _validation = { + 'prompts': {'max_items': 20}, + } + + _attribute_map = { + 'is_context_only': {'key': 'isContextOnly', 'type': 'bool'}, + 'prompts': {'key': 'prompts', 'type': '[PromptDTO]'}, + } + + def __init__(self, **kwargs): + super(QnADTOContext, self).__init__(**kwargs) + + +class QnASearchResult(Model): + """Represents Search Result. + + :param questions: List of questions. + :type questions: list[str] + :param answer: Answer. + :type answer: str + :param score: Search result score. + :type score: float + :param id: Id of the QnA result. + :type id: int + :param source: Source of QnA result. + :type source: str + :param metadata: List of metadata. + :type metadata: + list[~azure.cognitiveservices.knowledge.qnamaker.models.MetadataDTO] + :param context: Context object of the QnA + :type context: + ~azure.cognitiveservices.knowledge.qnamaker.models.QnASearchResultContext + """ + + _attribute_map = { + 'questions': {'key': 'questions', 'type': '[str]'}, + 'answer': {'key': 'answer', 'type': 'str'}, + 'score': {'key': 'score', 'type': 'float'}, + 'id': {'key': 'id', 'type': 'int'}, + 'source': {'key': 'source', 'type': 'str'}, + 'metadata': {'key': 'metadata', 'type': '[MetadataDTO]'}, + 'context': {'key': 'context', 'type': 'QnASearchResultContext'}, + } + + def __init__(self, **kwargs): + super(QnASearchResult, self).__init__(**kwargs) + self.questions = kwargs.get('questions', None) + self.answer = kwargs.get('answer', None) + self.score = kwargs.get('score', None) + self.id = kwargs.get('id', None) + self.source = kwargs.get('source', None) + self.metadata = kwargs.get('metadata', None) + self.context = kwargs.get('context', None) + + +class QnASearchResultContext(ContextDTO): + """Context object of the QnA. + + :param is_context_only: To mark if a prompt is relevant only with a + previous question or not. + true - Do not include this QnA as search result for queries without + context + false - ignores context and includes this QnA in search result + :type is_context_only: bool + :param prompts: List of prompts associated with the answer. + :type prompts: + list[~azure.cognitiveservices.knowledge.qnamaker.models.PromptDTO] + """ + + _validation = { + 'prompts': {'max_items': 20}, + } + + _attribute_map = { + 'is_context_only': {'key': 'isContextOnly', 'type': 'bool'}, + 'prompts': {'key': 'prompts', 'type': '[PromptDTO]'}, + } + + def __init__(self, **kwargs): + super(QnASearchResultContext, self).__init__(**kwargs) + + +class QnASearchResultList(Model): + """Represents List of Question Answers. + + :param answers: Represents Search Result list. + :type answers: + list[~azure.cognitiveservices.knowledge.qnamaker.models.QnASearchResult] + """ + + _attribute_map = { + 'answers': {'key': 'answers', 'type': '[QnASearchResult]'}, + } + + def __init__(self, **kwargs): + super(QnASearchResultList, self).__init__(**kwargs) + self.answers = kwargs.get('answers', None) + + +class QueryContextDTO(Model): + """Context object with previous QnA's information. + + :param previous_qna_id: Previous QnA Id - qnaId of the top result. + :type previous_qna_id: str + :param previous_user_query: Previous user query. + :type previous_user_query: str + """ + + _attribute_map = { + 'previous_qna_id': {'key': 'previousQnaId', 'type': 'str'}, + 'previous_user_query': {'key': 'previousUserQuery', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(QueryContextDTO, self).__init__(**kwargs) + self.previous_qna_id = kwargs.get('previous_qna_id', None) + self.previous_user_query = kwargs.get('previous_user_query', None) + + +class QueryDTO(Model): + """POST body schema to query the knowledgebase. + + :param qna_id: Exact qnaId to fetch from the knowledgebase, this field + takes priority over question. + :type qna_id: str + :param question: User question to query against the knowledge base. + :type question: str + :param top: Max number of answers to be returned for the question. + :type top: int + :param user_id: Unique identifier for the user. + :type user_id: str + :param is_test: Query against the test index. + :type is_test: bool + :param score_threshold: Threshold for answers returned based on score. + :type score_threshold: float + :param context: Context object with previous QnA's information. + :type context: + ~azure.cognitiveservices.knowledge.qnamaker.models.QueryDTOContext + :param ranker_type: Optional field. Set to 'QuestionOnly' for using a + question only Ranker. + :type ranker_type: str + :param strict_filters: Find only answers that contain these metadata. + :type strict_filters: + list[~azure.cognitiveservices.knowledge.qnamaker.models.MetadataDTO] + """ + + _attribute_map = { + 'qna_id': {'key': 'qnaId', 'type': 'str'}, + 'question': {'key': 'question', 'type': 'str'}, + 'top': {'key': 'top', 'type': 'int'}, + 'user_id': {'key': 'userId', 'type': 'str'}, + 'is_test': {'key': 'isTest', 'type': 'bool'}, + 'score_threshold': {'key': 'scoreThreshold', 'type': 'float'}, + 'context': {'key': 'context', 'type': 'QueryDTOContext'}, + 'ranker_type': {'key': 'rankerType', 'type': 'str'}, + 'strict_filters': {'key': 'strictFilters', 'type': '[MetadataDTO]'}, + } + + def __init__(self, **kwargs): + super(QueryDTO, self).__init__(**kwargs) + self.qna_id = kwargs.get('qna_id', None) + self.question = kwargs.get('question', None) + self.top = kwargs.get('top', None) + self.user_id = kwargs.get('user_id', None) + self.is_test = kwargs.get('is_test', None) + self.score_threshold = kwargs.get('score_threshold', None) + self.context = kwargs.get('context', None) + self.ranker_type = kwargs.get('ranker_type', None) + self.strict_filters = kwargs.get('strict_filters', None) + + +class QueryDTOContext(QueryContextDTO): + """Context object with previous QnA's information. + + :param previous_qna_id: Previous QnA Id - qnaId of the top result. + :type previous_qna_id: str + :param previous_user_query: Previous user query. + :type previous_user_query: str + """ + + _attribute_map = { + 'previous_qna_id': {'key': 'previousQnaId', 'type': 'str'}, + 'previous_user_query': {'key': 'previousUserQuery', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(QueryDTOContext, self).__init__(**kwargs) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/_models_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/_models_py3.py new file mode 100644 index 000000000000..f932556eae2e --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/_models_py3.py @@ -0,0 +1,589 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class ContextDTO(Model): + """Context associated with Qna. + + :param is_context_only: To mark if a prompt is relevant only with a + previous question or not. + true - Do not include this QnA as search result for queries without + context + false - ignores context and includes this QnA in search result + :type is_context_only: bool + :param prompts: List of prompts associated with the answer. + :type prompts: + list[~azure.cognitiveservices.knowledge.qnamaker.models.PromptDTO] + """ + + _validation = { + 'prompts': {'max_items': 20}, + } + + _attribute_map = { + 'is_context_only': {'key': 'isContextOnly', 'type': 'bool'}, + 'prompts': {'key': 'prompts', 'type': '[PromptDTO]'}, + } + + def __init__(self, *, is_context_only: bool=None, prompts=None, **kwargs) -> None: + super(ContextDTO, self).__init__(**kwargs) + self.is_context_only = is_context_only + self.prompts = prompts + + +class Error(Model): + """The error object. As per Microsoft One API guidelines - + https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. One of a server-defined set of error codes. + Possible values include: 'BadArgument', 'Forbidden', 'NotFound', + 'KbNotFound', 'Unauthorized', 'Unspecified', 'EndpointKeysError', + 'QuotaExceeded', 'QnaRuntimeError', 'SKULimitExceeded', + 'OperationNotFound', 'ServiceError', 'ValidationFailure', + 'ExtractionFailure' + :type code: str or + ~azure.cognitiveservices.knowledge.qnamaker.models.ErrorCodeType + :param message: A human-readable representation of the error. + :type message: str + :param target: The target of the error. + :type target: str + :param details: An array of details about specific errors that led to this + reported error. + :type details: + list[~azure.cognitiveservices.knowledge.qnamaker.models.Error] + :param inner_error: An object containing more specific information than + the current object about the error. + :type inner_error: + ~azure.cognitiveservices.knowledge.qnamaker.models.InnerErrorModel + """ + + _validation = { + 'code': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[Error]'}, + 'inner_error': {'key': 'innerError', 'type': 'InnerErrorModel'}, + } + + def __init__(self, *, code, message: str=None, target: str=None, details=None, inner_error=None, **kwargs) -> None: + super(Error, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + self.inner_error = inner_error + + +class ErrorResponse(Model): + """Error response. As per Microsoft One API guidelines - + https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses. + + :param error: The error object. + :type error: + ~azure.cognitiveservices.knowledge.qnamaker.models.ErrorResponseError + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponseError'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class ErrorResponseError(Error): + """The error object. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. One of a server-defined set of error codes. + Possible values include: 'BadArgument', 'Forbidden', 'NotFound', + 'KbNotFound', 'Unauthorized', 'Unspecified', 'EndpointKeysError', + 'QuotaExceeded', 'QnaRuntimeError', 'SKULimitExceeded', + 'OperationNotFound', 'ServiceError', 'ValidationFailure', + 'ExtractionFailure' + :type code: str or + ~azure.cognitiveservices.knowledge.qnamaker.models.ErrorCodeType + :param message: A human-readable representation of the error. + :type message: str + :param target: The target of the error. + :type target: str + :param details: An array of details about specific errors that led to this + reported error. + :type details: + list[~azure.cognitiveservices.knowledge.qnamaker.models.Error] + :param inner_error: An object containing more specific information than + the current object about the error. + :type inner_error: + ~azure.cognitiveservices.knowledge.qnamaker.models.InnerErrorModel + """ + + _validation = { + 'code': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[Error]'}, + 'inner_error': {'key': 'innerError', 'type': 'InnerErrorModel'}, + } + + def __init__(self, *, code, message: str=None, target: str=None, details=None, inner_error=None, **kwargs) -> None: + super(ErrorResponseError, self).__init__(code=code, message=message, target=target, details=details, inner_error=inner_error, **kwargs) + + +class FeedbackRecordDTO(Model): + """Active learning feedback record. + + :param user_id: Unique identifier for the user. + :type user_id: str + :param user_question: The suggested question being provided as feedback. + :type user_question: str + :param qna_id: The qnaId for which the suggested question is provided as + feedback. + :type qna_id: int + """ + + _validation = { + 'user_question': {'max_length': 1000}, + } + + _attribute_map = { + 'user_id': {'key': 'userId', 'type': 'str'}, + 'user_question': {'key': 'userQuestion', 'type': 'str'}, + 'qna_id': {'key': 'qnaId', 'type': 'int'}, + } + + def __init__(self, *, user_id: str=None, user_question: str=None, qna_id: int=None, **kwargs) -> None: + super(FeedbackRecordDTO, self).__init__(**kwargs) + self.user_id = user_id + self.user_question = user_question + self.qna_id = qna_id + + +class FeedbackRecordsDTO(Model): + """Active learning feedback records. + + :param feedback_records: List of feedback records. + :type feedback_records: + list[~azure.cognitiveservices.knowledge.qnamaker.models.FeedbackRecordDTO] + """ + + _attribute_map = { + 'feedback_records': {'key': 'feedbackRecords', 'type': '[FeedbackRecordDTO]'}, + } + + def __init__(self, *, feedback_records=None, **kwargs) -> None: + super(FeedbackRecordsDTO, self).__init__(**kwargs) + self.feedback_records = feedback_records + + +class InnerErrorModel(Model): + """An object containing more specific information about the error. As per + Microsoft One API guidelines - + https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses. + + :param code: A more specific error code than was provided by the + containing error. + :type code: str + :param inner_error: An object containing more specific information than + the current object about the error. + :type inner_error: + ~azure.cognitiveservices.knowledge.qnamaker.models.InnerErrorModel + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'inner_error': {'key': 'innerError', 'type': 'InnerErrorModel'}, + } + + def __init__(self, *, code: str=None, inner_error=None, **kwargs) -> None: + super(InnerErrorModel, self).__init__(**kwargs) + self.code = code + self.inner_error = inner_error + + +class MetadataDTO(Model): + """Name - value pair of metadata. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Metadata name. + :type name: str + :param value: Required. Metadata value. + :type value: str + """ + + _validation = { + 'name': {'required': True, 'max_length': 100, 'min_length': 1}, + 'value': {'required': True, 'max_length': 500, 'min_length': 1}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, name: str, value: str, **kwargs) -> None: + super(MetadataDTO, self).__init__(**kwargs) + self.name = name + self.value = value + + +class PromptDTO(Model): + """Prompt for an answer. + + :param display_order: Index of the prompt - used in ordering of the + prompts + :type display_order: int + :param qna_id: Qna id corresponding to the prompt - if QnaId is present, + QnADTO object is ignored. + :type qna_id: int + :param qna: QnADTO - Either QnaId or QnADTO needs to be present in a + PromptDTO object + :type qna: ~azure.cognitiveservices.knowledge.qnamaker.models.PromptDTOQna + :param display_text: Text displayed to represent a follow up question + prompt + :type display_text: str + """ + + _validation = { + 'display_text': {'max_length': 200}, + } + + _attribute_map = { + 'display_order': {'key': 'displayOrder', 'type': 'int'}, + 'qna_id': {'key': 'qnaId', 'type': 'int'}, + 'qna': {'key': 'qna', 'type': 'PromptDTOQna'}, + 'display_text': {'key': 'displayText', 'type': 'str'}, + } + + def __init__(self, *, display_order: int=None, qna_id: int=None, qna=None, display_text: str=None, **kwargs) -> None: + super(PromptDTO, self).__init__(**kwargs) + self.display_order = display_order + self.qna_id = qna_id + self.qna = qna + self.display_text = display_text + + +class QnADTO(Model): + """Q-A object. + + All required parameters must be populated in order to send to Azure. + + :param id: Unique id for the Q-A. + :type id: int + :param answer: Required. Answer text + :type answer: str + :param source: Source from which Q-A was indexed. eg. + https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs + :type source: str + :param questions: Required. List of questions associated with the answer. + :type questions: list[str] + :param metadata: List of metadata associated with the answer. + :type metadata: + list[~azure.cognitiveservices.knowledge.qnamaker.models.MetadataDTO] + :param context: Context of a QnA + :type context: + ~azure.cognitiveservices.knowledge.qnamaker.models.QnADTOContext + """ + + _validation = { + 'answer': {'required': True, 'max_length': 25000, 'min_length': 1}, + 'source': {'max_length': 300}, + 'questions': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'answer': {'key': 'answer', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'str'}, + 'questions': {'key': 'questions', 'type': '[str]'}, + 'metadata': {'key': 'metadata', 'type': '[MetadataDTO]'}, + 'context': {'key': 'context', 'type': 'QnADTOContext'}, + } + + def __init__(self, *, answer: str, questions, id: int=None, source: str=None, metadata=None, context=None, **kwargs) -> None: + super(QnADTO, self).__init__(**kwargs) + self.id = id + self.answer = answer + self.source = source + self.questions = questions + self.metadata = metadata + self.context = context + + +class PromptDTOQna(QnADTO): + """QnADTO - Either QnaId or QnADTO needs to be present in a PromptDTO object. + + All required parameters must be populated in order to send to Azure. + + :param id: Unique id for the Q-A. + :type id: int + :param answer: Required. Answer text + :type answer: str + :param source: Source from which Q-A was indexed. eg. + https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs + :type source: str + :param questions: Required. List of questions associated with the answer. + :type questions: list[str] + :param metadata: List of metadata associated with the answer. + :type metadata: + list[~azure.cognitiveservices.knowledge.qnamaker.models.MetadataDTO] + :param context: Context of a QnA + :type context: + ~azure.cognitiveservices.knowledge.qnamaker.models.QnADTOContext + """ + + _validation = { + 'answer': {'required': True, 'max_length': 25000, 'min_length': 1}, + 'source': {'max_length': 300}, + 'questions': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'int'}, + 'answer': {'key': 'answer', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'str'}, + 'questions': {'key': 'questions', 'type': '[str]'}, + 'metadata': {'key': 'metadata', 'type': '[MetadataDTO]'}, + 'context': {'key': 'context', 'type': 'QnADTOContext'}, + } + + def __init__(self, *, answer: str, questions, id: int=None, source: str=None, metadata=None, context=None, **kwargs) -> None: + super(PromptDTOQna, self).__init__(id=id, answer=answer, source=source, questions=questions, metadata=metadata, context=context, **kwargs) + + +class QnADTOContext(ContextDTO): + """Context of a QnA. + + :param is_context_only: To mark if a prompt is relevant only with a + previous question or not. + true - Do not include this QnA as search result for queries without + context + false - ignores context and includes this QnA in search result + :type is_context_only: bool + :param prompts: List of prompts associated with the answer. + :type prompts: + list[~azure.cognitiveservices.knowledge.qnamaker.models.PromptDTO] + """ + + _validation = { + 'prompts': {'max_items': 20}, + } + + _attribute_map = { + 'is_context_only': {'key': 'isContextOnly', 'type': 'bool'}, + 'prompts': {'key': 'prompts', 'type': '[PromptDTO]'}, + } + + def __init__(self, *, is_context_only: bool=None, prompts=None, **kwargs) -> None: + super(QnADTOContext, self).__init__(is_context_only=is_context_only, prompts=prompts, **kwargs) + + +class QnASearchResult(Model): + """Represents Search Result. + + :param questions: List of questions. + :type questions: list[str] + :param answer: Answer. + :type answer: str + :param score: Search result score. + :type score: float + :param id: Id of the QnA result. + :type id: int + :param source: Source of QnA result. + :type source: str + :param metadata: List of metadata. + :type metadata: + list[~azure.cognitiveservices.knowledge.qnamaker.models.MetadataDTO] + :param context: Context object of the QnA + :type context: + ~azure.cognitiveservices.knowledge.qnamaker.models.QnASearchResultContext + """ + + _attribute_map = { + 'questions': {'key': 'questions', 'type': '[str]'}, + 'answer': {'key': 'answer', 'type': 'str'}, + 'score': {'key': 'score', 'type': 'float'}, + 'id': {'key': 'id', 'type': 'int'}, + 'source': {'key': 'source', 'type': 'str'}, + 'metadata': {'key': 'metadata', 'type': '[MetadataDTO]'}, + 'context': {'key': 'context', 'type': 'QnASearchResultContext'}, + } + + def __init__(self, *, questions=None, answer: str=None, score: float=None, id: int=None, source: str=None, metadata=None, context=None, **kwargs) -> None: + super(QnASearchResult, self).__init__(**kwargs) + self.questions = questions + self.answer = answer + self.score = score + self.id = id + self.source = source + self.metadata = metadata + self.context = context + + +class QnASearchResultContext(ContextDTO): + """Context object of the QnA. + + :param is_context_only: To mark if a prompt is relevant only with a + previous question or not. + true - Do not include this QnA as search result for queries without + context + false - ignores context and includes this QnA in search result + :type is_context_only: bool + :param prompts: List of prompts associated with the answer. + :type prompts: + list[~azure.cognitiveservices.knowledge.qnamaker.models.PromptDTO] + """ + + _validation = { + 'prompts': {'max_items': 20}, + } + + _attribute_map = { + 'is_context_only': {'key': 'isContextOnly', 'type': 'bool'}, + 'prompts': {'key': 'prompts', 'type': '[PromptDTO]'}, + } + + def __init__(self, *, is_context_only: bool=None, prompts=None, **kwargs) -> None: + super(QnASearchResultContext, self).__init__(is_context_only=is_context_only, prompts=prompts, **kwargs) + + +class QnASearchResultList(Model): + """Represents List of Question Answers. + + :param answers: Represents Search Result list. + :type answers: + list[~azure.cognitiveservices.knowledge.qnamaker.models.QnASearchResult] + """ + + _attribute_map = { + 'answers': {'key': 'answers', 'type': '[QnASearchResult]'}, + } + + def __init__(self, *, answers=None, **kwargs) -> None: + super(QnASearchResultList, self).__init__(**kwargs) + self.answers = answers + + +class QueryContextDTO(Model): + """Context object with previous QnA's information. + + :param previous_qna_id: Previous QnA Id - qnaId of the top result. + :type previous_qna_id: str + :param previous_user_query: Previous user query. + :type previous_user_query: str + """ + + _attribute_map = { + 'previous_qna_id': {'key': 'previousQnaId', 'type': 'str'}, + 'previous_user_query': {'key': 'previousUserQuery', 'type': 'str'}, + } + + def __init__(self, *, previous_qna_id: str=None, previous_user_query: str=None, **kwargs) -> None: + super(QueryContextDTO, self).__init__(**kwargs) + self.previous_qna_id = previous_qna_id + self.previous_user_query = previous_user_query + + +class QueryDTO(Model): + """POST body schema to query the knowledgebase. + + :param qna_id: Exact qnaId to fetch from the knowledgebase, this field + takes priority over question. + :type qna_id: str + :param question: User question to query against the knowledge base. + :type question: str + :param top: Max number of answers to be returned for the question. + :type top: int + :param user_id: Unique identifier for the user. + :type user_id: str + :param is_test: Query against the test index. + :type is_test: bool + :param score_threshold: Threshold for answers returned based on score. + :type score_threshold: float + :param context: Context object with previous QnA's information. + :type context: + ~azure.cognitiveservices.knowledge.qnamaker.models.QueryDTOContext + :param ranker_type: Optional field. Set to 'QuestionOnly' for using a + question only Ranker. + :type ranker_type: str + :param strict_filters: Find only answers that contain these metadata. + :type strict_filters: + list[~azure.cognitiveservices.knowledge.qnamaker.models.MetadataDTO] + """ + + _attribute_map = { + 'qna_id': {'key': 'qnaId', 'type': 'str'}, + 'question': {'key': 'question', 'type': 'str'}, + 'top': {'key': 'top', 'type': 'int'}, + 'user_id': {'key': 'userId', 'type': 'str'}, + 'is_test': {'key': 'isTest', 'type': 'bool'}, + 'score_threshold': {'key': 'scoreThreshold', 'type': 'float'}, + 'context': {'key': 'context', 'type': 'QueryDTOContext'}, + 'ranker_type': {'key': 'rankerType', 'type': 'str'}, + 'strict_filters': {'key': 'strictFilters', 'type': '[MetadataDTO]'}, + } + + def __init__(self, *, qna_id: str=None, question: str=None, top: int=None, user_id: str=None, is_test: bool=None, score_threshold: float=None, context=None, ranker_type: str=None, strict_filters=None, **kwargs) -> None: + super(QueryDTO, self).__init__(**kwargs) + self.qna_id = qna_id + self.question = question + self.top = top + self.user_id = user_id + self.is_test = is_test + self.score_threshold = score_threshold + self.context = context + self.ranker_type = ranker_type + self.strict_filters = strict_filters + + +class QueryDTOContext(QueryContextDTO): + """Context object with previous QnA's information. + + :param previous_qna_id: Previous QnA Id - qnaId of the top result. + :type previous_qna_id: str + :param previous_user_query: Previous user query. + :type previous_user_query: str + """ + + _attribute_map = { + 'previous_qna_id': {'key': 'previousQnaId', 'type': 'str'}, + 'previous_user_query': {'key': 'previousUserQuery', 'type': 'str'}, + } + + def __init__(self, *, previous_qna_id: str=None, previous_user_query: str=None, **kwargs) -> None: + super(QueryDTOContext, self).__init__(previous_qna_id=previous_qna_id, previous_user_query=previous_user_query, **kwargs) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/qn_amaker_client_enums.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/_qn_amaker_client_enums.py similarity index 93% rename from sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/qn_amaker_client_enums.py rename to sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/_qn_amaker_client_enums.py index d7ed140da72c..3d9f996b78b7 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/qn_amaker_client_enums.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/_qn_amaker_client_enums.py @@ -12,12 +12,6 @@ from enum import Enum -class KnowledgebaseEnvironmentType(str, Enum): - - prod = "Prod" - test = "Test" - - class ErrorCodeType(str, Enum): bad_argument = "BadArgument" diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/_qn_amaker_runtime_client_enums.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/_qn_amaker_runtime_client_enums.py new file mode 100644 index 000000000000..c523cb290231 --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/_qn_amaker_runtime_client_enums.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class ErrorCodeType(str, Enum): + + bad_argument = "BadArgument" + forbidden = "Forbidden" + not_found = "NotFound" + kb_not_found = "KbNotFound" + unauthorized = "Unauthorized" + unspecified = "Unspecified" + endpoint_keys_error = "EndpointKeysError" + quota_exceeded = "QuotaExceeded" + qna_runtime_error = "QnaRuntimeError" + sku_limit_exceeded = "SKULimitExceeded" + operation_not_found = "OperationNotFound" + service_error = "ServiceError" + validation_failure = "ValidationFailure" + extraction_failure = "ExtractionFailure" diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/alterations_dto.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/alterations_dto.py deleted file mode 100644 index 35562e26932a..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/alterations_dto.py +++ /dev/null @@ -1,34 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class AlterationsDTO(Model): - """Collection of words that are synonyms. - - All required parameters must be populated in order to send to Azure. - - :param alterations: Required. Words that are synonymous with each other. - :type alterations: list[str] - """ - - _validation = { - 'alterations': {'required': True}, - } - - _attribute_map = { - 'alterations': {'key': 'alterations', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(AlterationsDTO, self).__init__(**kwargs) - self.alterations = kwargs.get('alterations', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/alterations_dto_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/alterations_dto_py3.py deleted file mode 100644 index 3adbcce49bf6..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/alterations_dto_py3.py +++ /dev/null @@ -1,34 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class AlterationsDTO(Model): - """Collection of words that are synonyms. - - All required parameters must be populated in order to send to Azure. - - :param alterations: Required. Words that are synonymous with each other. - :type alterations: list[str] - """ - - _validation = { - 'alterations': {'required': True}, - } - - _attribute_map = { - 'alterations': {'key': 'alterations', 'type': '[str]'}, - } - - def __init__(self, *, alterations, **kwargs) -> None: - super(AlterationsDTO, self).__init__(**kwargs) - self.alterations = alterations diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/create_kb_dto.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/create_kb_dto.py deleted file mode 100644 index 0d0d47084fec..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/create_kb_dto.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class CreateKbDTO(Model): - """Post body schema for CreateKb operation. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Friendly name for the knowledgebase. - :type name: str - :param qna_list: List of Q-A (QnADTO) to be added to the knowledgebase. - Q-A Ids are assigned by the service and should be omitted. - :type qna_list: - list[~azure.cognitiveservices.knowledge.qnamaker.models.QnADTO] - :param urls: List of URLs to be used for extracting Q-A. - :type urls: list[str] - :param files: List of files from which to Extract Q-A. - :type files: - list[~azure.cognitiveservices.knowledge.qnamaker.models.FileDTO] - """ - - _validation = { - 'name': {'required': True, 'max_length': 100, 'min_length': 1}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'qna_list': {'key': 'qnaList', 'type': '[QnADTO]'}, - 'urls': {'key': 'urls', 'type': '[str]'}, - 'files': {'key': 'files', 'type': '[FileDTO]'}, - } - - def __init__(self, **kwargs): - super(CreateKbDTO, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.qna_list = kwargs.get('qna_list', None) - self.urls = kwargs.get('urls', None) - self.files = kwargs.get('files', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/create_kb_dto_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/create_kb_dto_py3.py deleted file mode 100644 index 21bdf5214ec3..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/create_kb_dto_py3.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class CreateKbDTO(Model): - """Post body schema for CreateKb operation. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Friendly name for the knowledgebase. - :type name: str - :param qna_list: List of Q-A (QnADTO) to be added to the knowledgebase. - Q-A Ids are assigned by the service and should be omitted. - :type qna_list: - list[~azure.cognitiveservices.knowledge.qnamaker.models.QnADTO] - :param urls: List of URLs to be used for extracting Q-A. - :type urls: list[str] - :param files: List of files from which to Extract Q-A. - :type files: - list[~azure.cognitiveservices.knowledge.qnamaker.models.FileDTO] - """ - - _validation = { - 'name': {'required': True, 'max_length': 100, 'min_length': 1}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'qna_list': {'key': 'qnaList', 'type': '[QnADTO]'}, - 'urls': {'key': 'urls', 'type': '[str]'}, - 'files': {'key': 'files', 'type': '[FileDTO]'}, - } - - def __init__(self, *, name: str, qna_list=None, urls=None, files=None, **kwargs) -> None: - super(CreateKbDTO, self).__init__(**kwargs) - self.name = name - self.qna_list = qna_list - self.urls = urls - self.files = files diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/create_kb_input_dto.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/create_kb_input_dto.py deleted file mode 100644 index 78bfdf66c66c..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/create_kb_input_dto.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class CreateKbInputDTO(Model): - """Input to create KB. - - :param qna_list: List of QNA to be added to the index. Ids are generated - by the service and should be omitted. - :type qna_list: - list[~azure.cognitiveservices.knowledge.qnamaker.models.QnADTO] - :param urls: List of URLs to be added to knowledgebase. - :type urls: list[str] - :param files: List of files to be added to knowledgebase. - :type files: - list[~azure.cognitiveservices.knowledge.qnamaker.models.FileDTO] - """ - - _attribute_map = { - 'qna_list': {'key': 'qnaList', 'type': '[QnADTO]'}, - 'urls': {'key': 'urls', 'type': '[str]'}, - 'files': {'key': 'files', 'type': '[FileDTO]'}, - } - - def __init__(self, **kwargs): - super(CreateKbInputDTO, self).__init__(**kwargs) - self.qna_list = kwargs.get('qna_list', None) - self.urls = kwargs.get('urls', None) - self.files = kwargs.get('files', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/create_kb_input_dto_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/create_kb_input_dto_py3.py deleted file mode 100644 index f052f3ba0b3b..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/create_kb_input_dto_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class CreateKbInputDTO(Model): - """Input to create KB. - - :param qna_list: List of QNA to be added to the index. Ids are generated - by the service and should be omitted. - :type qna_list: - list[~azure.cognitiveservices.knowledge.qnamaker.models.QnADTO] - :param urls: List of URLs to be added to knowledgebase. - :type urls: list[str] - :param files: List of files to be added to knowledgebase. - :type files: - list[~azure.cognitiveservices.knowledge.qnamaker.models.FileDTO] - """ - - _attribute_map = { - 'qna_list': {'key': 'qnaList', 'type': '[QnADTO]'}, - 'urls': {'key': 'urls', 'type': '[str]'}, - 'files': {'key': 'files', 'type': '[FileDTO]'}, - } - - def __init__(self, *, qna_list=None, urls=None, files=None, **kwargs) -> None: - super(CreateKbInputDTO, self).__init__(**kwargs) - self.qna_list = qna_list - self.urls = urls - self.files = files diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/delete_kb_contents_dto.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/delete_kb_contents_dto.py deleted file mode 100644 index d4563cc31a8d..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/delete_kb_contents_dto.py +++ /dev/null @@ -1,32 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class DeleteKbContentsDTO(Model): - """PATCH body schema of Delete Operation in UpdateKb. - - :param ids: List of Qna Ids to be deleted - :type ids: list[int] - :param sources: List of sources to be deleted from knowledgebase. - :type sources: list[str] - """ - - _attribute_map = { - 'ids': {'key': 'ids', 'type': '[int]'}, - 'sources': {'key': 'sources', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(DeleteKbContentsDTO, self).__init__(**kwargs) - self.ids = kwargs.get('ids', None) - self.sources = kwargs.get('sources', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/delete_kb_contents_dto_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/delete_kb_contents_dto_py3.py deleted file mode 100644 index 50532c441a7e..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/delete_kb_contents_dto_py3.py +++ /dev/null @@ -1,32 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class DeleteKbContentsDTO(Model): - """PATCH body schema of Delete Operation in UpdateKb. - - :param ids: List of Qna Ids to be deleted - :type ids: list[int] - :param sources: List of sources to be deleted from knowledgebase. - :type sources: list[str] - """ - - _attribute_map = { - 'ids': {'key': 'ids', 'type': '[int]'}, - 'sources': {'key': 'sources', 'type': '[str]'}, - } - - def __init__(self, *, ids=None, sources=None, **kwargs) -> None: - super(DeleteKbContentsDTO, self).__init__(**kwargs) - self.ids = ids - self.sources = sources diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/endpoint_keys_dto.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/endpoint_keys_dto.py deleted file mode 100644 index 1e66bd634abe..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/endpoint_keys_dto.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class EndpointKeysDTO(Model): - """Schema for EndpointKeys generate/refresh operations. - - :param primary_endpoint_key: Primary Access Key. - :type primary_endpoint_key: str - :param secondary_endpoint_key: Secondary Access Key. - :type secondary_endpoint_key: str - :param installed_version: Current version of runtime. - :type installed_version: str - :param last_stable_version: Latest version of runtime. - :type last_stable_version: str - """ - - _attribute_map = { - 'primary_endpoint_key': {'key': 'primaryEndpointKey', 'type': 'str'}, - 'secondary_endpoint_key': {'key': 'secondaryEndpointKey', 'type': 'str'}, - 'installed_version': {'key': 'installedVersion', 'type': 'str'}, - 'last_stable_version': {'key': 'lastStableVersion', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(EndpointKeysDTO, self).__init__(**kwargs) - self.primary_endpoint_key = kwargs.get('primary_endpoint_key', None) - self.secondary_endpoint_key = kwargs.get('secondary_endpoint_key', None) - self.installed_version = kwargs.get('installed_version', None) - self.last_stable_version = kwargs.get('last_stable_version', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/endpoint_keys_dto_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/endpoint_keys_dto_py3.py deleted file mode 100644 index 97422112005d..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/endpoint_keys_dto_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class EndpointKeysDTO(Model): - """Schema for EndpointKeys generate/refresh operations. - - :param primary_endpoint_key: Primary Access Key. - :type primary_endpoint_key: str - :param secondary_endpoint_key: Secondary Access Key. - :type secondary_endpoint_key: str - :param installed_version: Current version of runtime. - :type installed_version: str - :param last_stable_version: Latest version of runtime. - :type last_stable_version: str - """ - - _attribute_map = { - 'primary_endpoint_key': {'key': 'primaryEndpointKey', 'type': 'str'}, - 'secondary_endpoint_key': {'key': 'secondaryEndpointKey', 'type': 'str'}, - 'installed_version': {'key': 'installedVersion', 'type': 'str'}, - 'last_stable_version': {'key': 'lastStableVersion', 'type': 'str'}, - } - - def __init__(self, *, primary_endpoint_key: str=None, secondary_endpoint_key: str=None, installed_version: str=None, last_stable_version: str=None, **kwargs) -> None: - super(EndpointKeysDTO, self).__init__(**kwargs) - self.primary_endpoint_key = primary_endpoint_key - self.secondary_endpoint_key = secondary_endpoint_key - self.installed_version = installed_version - self.last_stable_version = last_stable_version diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/error.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/error.py deleted file mode 100644 index d54de8f71851..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/error.py +++ /dev/null @@ -1,61 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Error(Model): - """The error object. As per Microsoft One API guidelines - - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses. - - All required parameters must be populated in order to send to Azure. - - :param code: Required. One of a server-defined set of error codes. - Possible values include: 'BadArgument', 'Forbidden', 'NotFound', - 'KbNotFound', 'Unauthorized', 'Unspecified', 'EndpointKeysError', - 'QuotaExceeded', 'QnaRuntimeError', 'SKULimitExceeded', - 'OperationNotFound', 'ServiceError', 'ValidationFailure', - 'ExtractionFailure' - :type code: str or - ~azure.cognitiveservices.knowledge.qnamaker.models.ErrorCodeType - :param message: A human-readable representation of the error. - :type message: str - :param target: The target of the error. - :type target: str - :param details: An array of details about specific errors that led to this - reported error. - :type details: - list[~azure.cognitiveservices.knowledge.qnamaker.models.Error] - :param inner_error: An object containing more specific information than - the current object about the error. - :type inner_error: - ~azure.cognitiveservices.knowledge.qnamaker.models.InnerErrorModel - """ - - _validation = { - 'code': {'required': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[Error]'}, - 'inner_error': {'key': 'innerError', 'type': 'InnerErrorModel'}, - } - - def __init__(self, **kwargs): - super(Error, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - self.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - self.inner_error = kwargs.get('inner_error', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/error_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/error_py3.py deleted file mode 100644 index 81e33305a662..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/error_py3.py +++ /dev/null @@ -1,61 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Error(Model): - """The error object. As per Microsoft One API guidelines - - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses. - - All required parameters must be populated in order to send to Azure. - - :param code: Required. One of a server-defined set of error codes. - Possible values include: 'BadArgument', 'Forbidden', 'NotFound', - 'KbNotFound', 'Unauthorized', 'Unspecified', 'EndpointKeysError', - 'QuotaExceeded', 'QnaRuntimeError', 'SKULimitExceeded', - 'OperationNotFound', 'ServiceError', 'ValidationFailure', - 'ExtractionFailure' - :type code: str or - ~azure.cognitiveservices.knowledge.qnamaker.models.ErrorCodeType - :param message: A human-readable representation of the error. - :type message: str - :param target: The target of the error. - :type target: str - :param details: An array of details about specific errors that led to this - reported error. - :type details: - list[~azure.cognitiveservices.knowledge.qnamaker.models.Error] - :param inner_error: An object containing more specific information than - the current object about the error. - :type inner_error: - ~azure.cognitiveservices.knowledge.qnamaker.models.InnerErrorModel - """ - - _validation = { - 'code': {'required': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[Error]'}, - 'inner_error': {'key': 'innerError', 'type': 'InnerErrorModel'}, - } - - def __init__(self, *, code, message: str=None, target: str=None, details=None, inner_error=None, **kwargs) -> None: - super(Error, self).__init__(**kwargs) - self.code = code - self.message = message - self.target = target - self.details = details - self.inner_error = inner_error diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/error_response.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/error_response.py deleted file mode 100644 index c74df96d50e3..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/error_response.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError - - -class ErrorResponse(Model): - """Error response. As per Microsoft One API guidelines - - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses. - - :param error: The error object. - :type error: - ~azure.cognitiveservices.knowledge.qnamaker.models.ErrorResponseError - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorResponseError'}, - } - - def __init__(self, **kwargs): - super(ErrorResponse, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class ErrorResponseException(HttpOperationError): - """Server responsed with exception of type: 'ErrorResponse'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/error_response_error.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/error_response_error.py deleted file mode 100644 index 880ecffb2ed3..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/error_response_error.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .error import Error - - -class ErrorResponseError(Error): - """The error object. - - All required parameters must be populated in order to send to Azure. - - :param code: Required. One of a server-defined set of error codes. - Possible values include: 'BadArgument', 'Forbidden', 'NotFound', - 'KbNotFound', 'Unauthorized', 'Unspecified', 'EndpointKeysError', - 'QuotaExceeded', 'QnaRuntimeError', 'SKULimitExceeded', - 'OperationNotFound', 'ServiceError', 'ValidationFailure', - 'ExtractionFailure' - :type code: str or - ~azure.cognitiveservices.knowledge.qnamaker.models.ErrorCodeType - :param message: A human-readable representation of the error. - :type message: str - :param target: The target of the error. - :type target: str - :param details: An array of details about specific errors that led to this - reported error. - :type details: - list[~azure.cognitiveservices.knowledge.qnamaker.models.Error] - :param inner_error: An object containing more specific information than - the current object about the error. - :type inner_error: - ~azure.cognitiveservices.knowledge.qnamaker.models.InnerErrorModel - """ - - _validation = { - 'code': {'required': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[Error]'}, - 'inner_error': {'key': 'innerError', 'type': 'InnerErrorModel'}, - } - - def __init__(self, **kwargs): - super(ErrorResponseError, self).__init__(**kwargs) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/error_response_error_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/error_response_error_py3.py deleted file mode 100644 index d873ed36878a..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/error_response_error_py3.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .error_py3 import Error - - -class ErrorResponseError(Error): - """The error object. - - All required parameters must be populated in order to send to Azure. - - :param code: Required. One of a server-defined set of error codes. - Possible values include: 'BadArgument', 'Forbidden', 'NotFound', - 'KbNotFound', 'Unauthorized', 'Unspecified', 'EndpointKeysError', - 'QuotaExceeded', 'QnaRuntimeError', 'SKULimitExceeded', - 'OperationNotFound', 'ServiceError', 'ValidationFailure', - 'ExtractionFailure' - :type code: str or - ~azure.cognitiveservices.knowledge.qnamaker.models.ErrorCodeType - :param message: A human-readable representation of the error. - :type message: str - :param target: The target of the error. - :type target: str - :param details: An array of details about specific errors that led to this - reported error. - :type details: - list[~azure.cognitiveservices.knowledge.qnamaker.models.Error] - :param inner_error: An object containing more specific information than - the current object about the error. - :type inner_error: - ~azure.cognitiveservices.knowledge.qnamaker.models.InnerErrorModel - """ - - _validation = { - 'code': {'required': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[Error]'}, - 'inner_error': {'key': 'innerError', 'type': 'InnerErrorModel'}, - } - - def __init__(self, *, code, message: str=None, target: str=None, details=None, inner_error=None, **kwargs) -> None: - super(ErrorResponseError, self).__init__(code=code, message=message, target=target, details=details, inner_error=inner_error, **kwargs) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/error_response_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/error_response_py3.py deleted file mode 100644 index c152b5a58f70..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/error_response_py3.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError - - -class ErrorResponse(Model): - """Error response. As per Microsoft One API guidelines - - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses. - - :param error: The error object. - :type error: - ~azure.cognitiveservices.knowledge.qnamaker.models.ErrorResponseError - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorResponseError'}, - } - - def __init__(self, *, error=None, **kwargs) -> None: - super(ErrorResponse, self).__init__(**kwargs) - self.error = error - - -class ErrorResponseException(HttpOperationError): - """Server responsed with exception of type: 'ErrorResponse'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/file_dto.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/file_dto.py deleted file mode 100644 index 06b50f07d8c6..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/file_dto.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class FileDTO(Model): - """DTO to hold details of uploaded files. - - All required parameters must be populated in order to send to Azure. - - :param file_name: Required. File name. Supported file types are ".tsv", - ".pdf", ".txt", ".docx", ".xlsx". - :type file_name: str - :param file_uri: Required. Public URI of the file. - :type file_uri: str - """ - - _validation = { - 'file_name': {'required': True, 'max_length': 200, 'min_length': 1}, - 'file_uri': {'required': True}, - } - - _attribute_map = { - 'file_name': {'key': 'fileName', 'type': 'str'}, - 'file_uri': {'key': 'fileUri', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(FileDTO, self).__init__(**kwargs) - self.file_name = kwargs.get('file_name', None) - self.file_uri = kwargs.get('file_uri', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/file_dto_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/file_dto_py3.py deleted file mode 100644 index 4874c20c485e..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/file_dto_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class FileDTO(Model): - """DTO to hold details of uploaded files. - - All required parameters must be populated in order to send to Azure. - - :param file_name: Required. File name. Supported file types are ".tsv", - ".pdf", ".txt", ".docx", ".xlsx". - :type file_name: str - :param file_uri: Required. Public URI of the file. - :type file_uri: str - """ - - _validation = { - 'file_name': {'required': True, 'max_length': 200, 'min_length': 1}, - 'file_uri': {'required': True}, - } - - _attribute_map = { - 'file_name': {'key': 'fileName', 'type': 'str'}, - 'file_uri': {'key': 'fileUri', 'type': 'str'}, - } - - def __init__(self, *, file_name: str, file_uri: str, **kwargs) -> None: - super(FileDTO, self).__init__(**kwargs) - self.file_name = file_name - self.file_uri = file_uri diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/inner_error_model.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/inner_error_model.py deleted file mode 100644 index 1d269d275710..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/inner_error_model.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class InnerErrorModel(Model): - """An object containing more specific information about the error. As per - Microsoft One API guidelines - - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses. - - :param code: A more specific error code than was provided by the - containing error. - :type code: str - :param inner_error: An object containing more specific information than - the current object about the error. - :type inner_error: - ~azure.cognitiveservices.knowledge.qnamaker.models.InnerErrorModel - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'inner_error': {'key': 'innerError', 'type': 'InnerErrorModel'}, - } - - def __init__(self, **kwargs): - super(InnerErrorModel, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.inner_error = kwargs.get('inner_error', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/inner_error_model_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/inner_error_model_py3.py deleted file mode 100644 index cfcb2930b969..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/inner_error_model_py3.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class InnerErrorModel(Model): - """An object containing more specific information about the error. As per - Microsoft One API guidelines - - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses. - - :param code: A more specific error code than was provided by the - containing error. - :type code: str - :param inner_error: An object containing more specific information than - the current object about the error. - :type inner_error: - ~azure.cognitiveservices.knowledge.qnamaker.models.InnerErrorModel - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'inner_error': {'key': 'innerError', 'type': 'InnerErrorModel'}, - } - - def __init__(self, *, code: str=None, inner_error=None, **kwargs) -> None: - super(InnerErrorModel, self).__init__(**kwargs) - self.code = code - self.inner_error = inner_error diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/knowledgebase_dto.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/knowledgebase_dto.py deleted file mode 100644 index 508ee085d1b4..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/knowledgebase_dto.py +++ /dev/null @@ -1,65 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class KnowledgebaseDTO(Model): - """Response schema for CreateKb operation. - - :param id: Unique id that identifies a knowledgebase. - :type id: str - :param host_name: URL host name at which the knowledgebase is hosted. - :type host_name: str - :param last_accessed_timestamp: Time stamp at which the knowledgebase was - last accessed (UTC). - :type last_accessed_timestamp: str - :param last_changed_timestamp: Time stamp at which the knowledgebase was - last modified (UTC). - :type last_changed_timestamp: str - :param last_published_timestamp: Time stamp at which the knowledgebase was - last published (UTC). - :type last_published_timestamp: str - :param name: Friendly name of the knowledgebase. - :type name: str - :param user_id: User who created / owns the knowledgebase. - :type user_id: str - :param urls: URL sources from which Q-A were extracted and added to the - knowledgebase. - :type urls: list[str] - :param sources: Custom sources from which Q-A were extracted or explicitly - added to the knowledgebase. - :type sources: list[str] - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'host_name': {'key': 'hostName', 'type': 'str'}, - 'last_accessed_timestamp': {'key': 'lastAccessedTimestamp', 'type': 'str'}, - 'last_changed_timestamp': {'key': 'lastChangedTimestamp', 'type': 'str'}, - 'last_published_timestamp': {'key': 'lastPublishedTimestamp', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'user_id': {'key': 'userId', 'type': 'str'}, - 'urls': {'key': 'urls', 'type': '[str]'}, - 'sources': {'key': 'sources', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(KnowledgebaseDTO, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.host_name = kwargs.get('host_name', None) - self.last_accessed_timestamp = kwargs.get('last_accessed_timestamp', None) - self.last_changed_timestamp = kwargs.get('last_changed_timestamp', None) - self.last_published_timestamp = kwargs.get('last_published_timestamp', None) - self.name = kwargs.get('name', None) - self.user_id = kwargs.get('user_id', None) - self.urls = kwargs.get('urls', None) - self.sources = kwargs.get('sources', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/knowledgebase_dto_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/knowledgebase_dto_py3.py deleted file mode 100644 index 008843eb04f5..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/knowledgebase_dto_py3.py +++ /dev/null @@ -1,65 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class KnowledgebaseDTO(Model): - """Response schema for CreateKb operation. - - :param id: Unique id that identifies a knowledgebase. - :type id: str - :param host_name: URL host name at which the knowledgebase is hosted. - :type host_name: str - :param last_accessed_timestamp: Time stamp at which the knowledgebase was - last accessed (UTC). - :type last_accessed_timestamp: str - :param last_changed_timestamp: Time stamp at which the knowledgebase was - last modified (UTC). - :type last_changed_timestamp: str - :param last_published_timestamp: Time stamp at which the knowledgebase was - last published (UTC). - :type last_published_timestamp: str - :param name: Friendly name of the knowledgebase. - :type name: str - :param user_id: User who created / owns the knowledgebase. - :type user_id: str - :param urls: URL sources from which Q-A were extracted and added to the - knowledgebase. - :type urls: list[str] - :param sources: Custom sources from which Q-A were extracted or explicitly - added to the knowledgebase. - :type sources: list[str] - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'host_name': {'key': 'hostName', 'type': 'str'}, - 'last_accessed_timestamp': {'key': 'lastAccessedTimestamp', 'type': 'str'}, - 'last_changed_timestamp': {'key': 'lastChangedTimestamp', 'type': 'str'}, - 'last_published_timestamp': {'key': 'lastPublishedTimestamp', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'user_id': {'key': 'userId', 'type': 'str'}, - 'urls': {'key': 'urls', 'type': '[str]'}, - 'sources': {'key': 'sources', 'type': '[str]'}, - } - - def __init__(self, *, id: str=None, host_name: str=None, last_accessed_timestamp: str=None, last_changed_timestamp: str=None, last_published_timestamp: str=None, name: str=None, user_id: str=None, urls=None, sources=None, **kwargs) -> None: - super(KnowledgebaseDTO, self).__init__(**kwargs) - self.id = id - self.host_name = host_name - self.last_accessed_timestamp = last_accessed_timestamp - self.last_changed_timestamp = last_changed_timestamp - self.last_published_timestamp = last_published_timestamp - self.name = name - self.user_id = user_id - self.urls = urls - self.sources = sources diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/knowledgebases_dto.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/knowledgebases_dto.py deleted file mode 100644 index 3fc0f26af401..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/knowledgebases_dto.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class KnowledgebasesDTO(Model): - """Collection of knowledgebases owned by a user. - - :param knowledgebases: Collection of knowledgebase records. - :type knowledgebases: - list[~azure.cognitiveservices.knowledge.qnamaker.models.KnowledgebaseDTO] - """ - - _attribute_map = { - 'knowledgebases': {'key': 'knowledgebases', 'type': '[KnowledgebaseDTO]'}, - } - - def __init__(self, **kwargs): - super(KnowledgebasesDTO, self).__init__(**kwargs) - self.knowledgebases = kwargs.get('knowledgebases', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/knowledgebases_dto_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/knowledgebases_dto_py3.py deleted file mode 100644 index 600df122f63e..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/knowledgebases_dto_py3.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class KnowledgebasesDTO(Model): - """Collection of knowledgebases owned by a user. - - :param knowledgebases: Collection of knowledgebase records. - :type knowledgebases: - list[~azure.cognitiveservices.knowledge.qnamaker.models.KnowledgebaseDTO] - """ - - _attribute_map = { - 'knowledgebases': {'key': 'knowledgebases', 'type': '[KnowledgebaseDTO]'}, - } - - def __init__(self, *, knowledgebases=None, **kwargs) -> None: - super(KnowledgebasesDTO, self).__init__(**kwargs) - self.knowledgebases = knowledgebases diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/metadata_dto.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/metadata_dto.py deleted file mode 100644 index ad81d7a694a1..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/metadata_dto.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MetadataDTO(Model): - """Name - value pair of metadata. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Metadata name. - :type name: str - :param value: Required. Metadata value. - :type value: str - """ - - _validation = { - 'name': {'required': True, 'max_length': 100, 'min_length': 1}, - 'value': {'required': True, 'max_length': 500, 'min_length': 1}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(MetadataDTO, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.value = kwargs.get('value', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/metadata_dto_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/metadata_dto_py3.py deleted file mode 100644 index da4c1d010f8c..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/metadata_dto_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MetadataDTO(Model): - """Name - value pair of metadata. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Metadata name. - :type name: str - :param value: Required. Metadata value. - :type value: str - """ - - _validation = { - 'name': {'required': True, 'max_length': 100, 'min_length': 1}, - 'value': {'required': True, 'max_length': 500, 'min_length': 1}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, *, name: str, value: str, **kwargs) -> None: - super(MetadataDTO, self).__init__(**kwargs) - self.name = name - self.value = value diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/operation.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/operation.py deleted file mode 100644 index 2c86977bbe02..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/operation.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Operation(Model): - """Record to track long running operation. - - :param operation_state: Operation state. Possible values include: - 'Failed', 'NotStarted', 'Running', 'Succeeded' - :type operation_state: str or - ~azure.cognitiveservices.knowledge.qnamaker.models.OperationStateType - :param created_timestamp: Timestamp when the operation was created. - :type created_timestamp: str - :param last_action_timestamp: Timestamp when the current state was - entered. - :type last_action_timestamp: str - :param resource_location: Relative URI to the target resource location for - completed resources. - :type resource_location: str - :param user_id: User Id - :type user_id: str - :param operation_id: Operation Id. - :type operation_id: str - :param error_response: Error details in case of failures. - :type error_response: - ~azure.cognitiveservices.knowledge.qnamaker.models.ErrorResponse - """ - - _attribute_map = { - 'operation_state': {'key': 'operationState', 'type': 'str'}, - 'created_timestamp': {'key': 'createdTimestamp', 'type': 'str'}, - 'last_action_timestamp': {'key': 'lastActionTimestamp', 'type': 'str'}, - 'resource_location': {'key': 'resourceLocation', 'type': 'str'}, - 'user_id': {'key': 'userId', 'type': 'str'}, - 'operation_id': {'key': 'operationId', 'type': 'str'}, - 'error_response': {'key': 'errorResponse', 'type': 'ErrorResponse'}, - } - - def __init__(self, **kwargs): - super(Operation, self).__init__(**kwargs) - self.operation_state = kwargs.get('operation_state', None) - self.created_timestamp = kwargs.get('created_timestamp', None) - self.last_action_timestamp = kwargs.get('last_action_timestamp', None) - self.resource_location = kwargs.get('resource_location', None) - self.user_id = kwargs.get('user_id', None) - self.operation_id = kwargs.get('operation_id', None) - self.error_response = kwargs.get('error_response', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/operation_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/operation_py3.py deleted file mode 100644 index 2190cc96a8c9..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/operation_py3.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Operation(Model): - """Record to track long running operation. - - :param operation_state: Operation state. Possible values include: - 'Failed', 'NotStarted', 'Running', 'Succeeded' - :type operation_state: str or - ~azure.cognitiveservices.knowledge.qnamaker.models.OperationStateType - :param created_timestamp: Timestamp when the operation was created. - :type created_timestamp: str - :param last_action_timestamp: Timestamp when the current state was - entered. - :type last_action_timestamp: str - :param resource_location: Relative URI to the target resource location for - completed resources. - :type resource_location: str - :param user_id: User Id - :type user_id: str - :param operation_id: Operation Id. - :type operation_id: str - :param error_response: Error details in case of failures. - :type error_response: - ~azure.cognitiveservices.knowledge.qnamaker.models.ErrorResponse - """ - - _attribute_map = { - 'operation_state': {'key': 'operationState', 'type': 'str'}, - 'created_timestamp': {'key': 'createdTimestamp', 'type': 'str'}, - 'last_action_timestamp': {'key': 'lastActionTimestamp', 'type': 'str'}, - 'resource_location': {'key': 'resourceLocation', 'type': 'str'}, - 'user_id': {'key': 'userId', 'type': 'str'}, - 'operation_id': {'key': 'operationId', 'type': 'str'}, - 'error_response': {'key': 'errorResponse', 'type': 'ErrorResponse'}, - } - - def __init__(self, *, operation_state=None, created_timestamp: str=None, last_action_timestamp: str=None, resource_location: str=None, user_id: str=None, operation_id: str=None, error_response=None, **kwargs) -> None: - super(Operation, self).__init__(**kwargs) - self.operation_state = operation_state - self.created_timestamp = created_timestamp - self.last_action_timestamp = last_action_timestamp - self.resource_location = resource_location - self.user_id = user_id - self.operation_id = operation_id - self.error_response = error_response diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/qn_adocuments_dto.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/qn_adocuments_dto.py deleted file mode 100644 index a8a77b520f14..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/qn_adocuments_dto.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class QnADocumentsDTO(Model): - """List of QnADTO. - - :param qna_documents: List of answers. - :type qna_documents: - list[~azure.cognitiveservices.knowledge.qnamaker.models.QnADTO] - """ - - _attribute_map = { - 'qna_documents': {'key': 'qnaDocuments', 'type': '[QnADTO]'}, - } - - def __init__(self, **kwargs): - super(QnADocumentsDTO, self).__init__(**kwargs) - self.qna_documents = kwargs.get('qna_documents', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/qn_adocuments_dto_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/qn_adocuments_dto_py3.py deleted file mode 100644 index 45b0ba89a64e..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/qn_adocuments_dto_py3.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class QnADocumentsDTO(Model): - """List of QnADTO. - - :param qna_documents: List of answers. - :type qna_documents: - list[~azure.cognitiveservices.knowledge.qnamaker.models.QnADTO] - """ - - _attribute_map = { - 'qna_documents': {'key': 'qnaDocuments', 'type': '[QnADTO]'}, - } - - def __init__(self, *, qna_documents=None, **kwargs) -> None: - super(QnADocumentsDTO, self).__init__(**kwargs) - self.qna_documents = qna_documents diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/qn_adto.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/qn_adto.py deleted file mode 100644 index 41436a02cd6d..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/qn_adto.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class QnADTO(Model): - """Q-A object. - - All required parameters must be populated in order to send to Azure. - - :param id: Unique id for the Q-A. - :type id: int - :param answer: Required. Answer text - :type answer: str - :param source: Source from which Q-A was indexed. eg. - https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs - :type source: str - :param questions: Required. List of questions associated with the answer. - :type questions: list[str] - :param metadata: List of metadata associated with the answer. - :type metadata: - list[~azure.cognitiveservices.knowledge.qnamaker.models.MetadataDTO] - """ - - _validation = { - 'answer': {'required': True, 'max_length': 25000, 'min_length': 1}, - 'source': {'max_length': 300}, - 'questions': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'int'}, - 'answer': {'key': 'answer', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'str'}, - 'questions': {'key': 'questions', 'type': '[str]'}, - 'metadata': {'key': 'metadata', 'type': '[MetadataDTO]'}, - } - - def __init__(self, **kwargs): - super(QnADTO, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.answer = kwargs.get('answer', None) - self.source = kwargs.get('source', None) - self.questions = kwargs.get('questions', None) - self.metadata = kwargs.get('metadata', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/qn_adto_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/qn_adto_py3.py deleted file mode 100644 index b3e56678a49b..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/qn_adto_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class QnADTO(Model): - """Q-A object. - - All required parameters must be populated in order to send to Azure. - - :param id: Unique id for the Q-A. - :type id: int - :param answer: Required. Answer text - :type answer: str - :param source: Source from which Q-A was indexed. eg. - https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs - :type source: str - :param questions: Required. List of questions associated with the answer. - :type questions: list[str] - :param metadata: List of metadata associated with the answer. - :type metadata: - list[~azure.cognitiveservices.knowledge.qnamaker.models.MetadataDTO] - """ - - _validation = { - 'answer': {'required': True, 'max_length': 25000, 'min_length': 1}, - 'source': {'max_length': 300}, - 'questions': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'int'}, - 'answer': {'key': 'answer', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'str'}, - 'questions': {'key': 'questions', 'type': '[str]'}, - 'metadata': {'key': 'metadata', 'type': '[MetadataDTO]'}, - } - - def __init__(self, *, answer: str, questions, id: int=None, source: str=None, metadata=None, **kwargs) -> None: - super(QnADTO, self).__init__(**kwargs) - self.id = id - self.answer = answer - self.source = source - self.questions = questions - self.metadata = metadata diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/replace_kb_dto.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/replace_kb_dto.py deleted file mode 100644 index 7b8314981fc0..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/replace_kb_dto.py +++ /dev/null @@ -1,36 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ReplaceKbDTO(Model): - """Post body schema for Replace KB operation. - - All required parameters must be populated in order to send to Azure. - - :param qn_alist: Required. List of Q-A (QnADTO) to be added to the - knowledgebase. Q-A Ids are assigned by the service and should be omitted. - :type qn_alist: - list[~azure.cognitiveservices.knowledge.qnamaker.models.QnADTO] - """ - - _validation = { - 'qn_alist': {'required': True}, - } - - _attribute_map = { - 'qn_alist': {'key': 'qnAList', 'type': '[QnADTO]'}, - } - - def __init__(self, **kwargs): - super(ReplaceKbDTO, self).__init__(**kwargs) - self.qn_alist = kwargs.get('qn_alist', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/replace_kb_dto_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/replace_kb_dto_py3.py deleted file mode 100644 index 722ddc597b5c..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/replace_kb_dto_py3.py +++ /dev/null @@ -1,36 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ReplaceKbDTO(Model): - """Post body schema for Replace KB operation. - - All required parameters must be populated in order to send to Azure. - - :param qn_alist: Required. List of Q-A (QnADTO) to be added to the - knowledgebase. Q-A Ids are assigned by the service and should be omitted. - :type qn_alist: - list[~azure.cognitiveservices.knowledge.qnamaker.models.QnADTO] - """ - - _validation = { - 'qn_alist': {'required': True}, - } - - _attribute_map = { - 'qn_alist': {'key': 'qnAList', 'type': '[QnADTO]'}, - } - - def __init__(self, *, qn_alist, **kwargs) -> None: - super(ReplaceKbDTO, self).__init__(**kwargs) - self.qn_alist = qn_alist diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_kb_contents_dto.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_kb_contents_dto.py deleted file mode 100644 index b0fdfdc33775..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_kb_contents_dto.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class UpdateKbContentsDTO(Model): - """PATCH body schema for Update operation in Update Kb. - - :param name: Friendly name for the knowledgebase. - :type name: str - :param qna_list: List of Q-A (UpdateQnaDTO) to be added to the - knowledgebase. - :type qna_list: - list[~azure.cognitiveservices.knowledge.qnamaker.models.UpdateQnaDTO] - :param urls: List of existing URLs to be refreshed. The content will be - extracted again and re-indexed. - :type urls: list[str] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'qna_list': {'key': 'qnaList', 'type': '[UpdateQnaDTO]'}, - 'urls': {'key': 'urls', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(UpdateKbContentsDTO, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.qna_list = kwargs.get('qna_list', None) - self.urls = kwargs.get('urls', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_kb_contents_dto_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_kb_contents_dto_py3.py deleted file mode 100644 index 1981c3af3824..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_kb_contents_dto_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class UpdateKbContentsDTO(Model): - """PATCH body schema for Update operation in Update Kb. - - :param name: Friendly name for the knowledgebase. - :type name: str - :param qna_list: List of Q-A (UpdateQnaDTO) to be added to the - knowledgebase. - :type qna_list: - list[~azure.cognitiveservices.knowledge.qnamaker.models.UpdateQnaDTO] - :param urls: List of existing URLs to be refreshed. The content will be - extracted again and re-indexed. - :type urls: list[str] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'qna_list': {'key': 'qnaList', 'type': '[UpdateQnaDTO]'}, - 'urls': {'key': 'urls', 'type': '[str]'}, - } - - def __init__(self, *, name: str=None, qna_list=None, urls=None, **kwargs) -> None: - super(UpdateKbContentsDTO, self).__init__(**kwargs) - self.name = name - self.qna_list = qna_list - self.urls = urls diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_kb_operation_dto.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_kb_operation_dto.py deleted file mode 100644 index 747b085ed336..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_kb_operation_dto.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class UpdateKbOperationDTO(Model): - """Contains list of QnAs to be updated. - - :param add: An instance of CreateKbInputDTO for add operation - :type add: - ~azure.cognitiveservices.knowledge.qnamaker.models.UpdateKbOperationDTOAdd - :param delete: An instance of DeleteKbContentsDTO for delete Operation - :type delete: - ~azure.cognitiveservices.knowledge.qnamaker.models.UpdateKbOperationDTODelete - :param update: An instance of UpdateKbContentsDTO for Update Operation - :type update: - ~azure.cognitiveservices.knowledge.qnamaker.models.UpdateKbOperationDTOUpdate - """ - - _attribute_map = { - 'add': {'key': 'add', 'type': 'UpdateKbOperationDTOAdd'}, - 'delete': {'key': 'delete', 'type': 'UpdateKbOperationDTODelete'}, - 'update': {'key': 'update', 'type': 'UpdateKbOperationDTOUpdate'}, - } - - def __init__(self, **kwargs): - super(UpdateKbOperationDTO, self).__init__(**kwargs) - self.add = kwargs.get('add', None) - self.delete = kwargs.get('delete', None) - self.update = kwargs.get('update', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_kb_operation_dto_add.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_kb_operation_dto_add.py deleted file mode 100644 index ac8ec6f8c794..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_kb_operation_dto_add.py +++ /dev/null @@ -1,36 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .create_kb_input_dto import CreateKbInputDTO - - -class UpdateKbOperationDTOAdd(CreateKbInputDTO): - """An instance of CreateKbInputDTO for add operation. - - :param qna_list: List of QNA to be added to the index. Ids are generated - by the service and should be omitted. - :type qna_list: - list[~azure.cognitiveservices.knowledge.qnamaker.models.QnADTO] - :param urls: List of URLs to be added to knowledgebase. - :type urls: list[str] - :param files: List of files to be added to knowledgebase. - :type files: - list[~azure.cognitiveservices.knowledge.qnamaker.models.FileDTO] - """ - - _attribute_map = { - 'qna_list': {'key': 'qnaList', 'type': '[QnADTO]'}, - 'urls': {'key': 'urls', 'type': '[str]'}, - 'files': {'key': 'files', 'type': '[FileDTO]'}, - } - - def __init__(self, **kwargs): - super(UpdateKbOperationDTOAdd, self).__init__(**kwargs) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_kb_operation_dto_add_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_kb_operation_dto_add_py3.py deleted file mode 100644 index b9c135e727ba..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_kb_operation_dto_add_py3.py +++ /dev/null @@ -1,36 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .create_kb_input_dto_py3 import CreateKbInputDTO - - -class UpdateKbOperationDTOAdd(CreateKbInputDTO): - """An instance of CreateKbInputDTO for add operation. - - :param qna_list: List of QNA to be added to the index. Ids are generated - by the service and should be omitted. - :type qna_list: - list[~azure.cognitiveservices.knowledge.qnamaker.models.QnADTO] - :param urls: List of URLs to be added to knowledgebase. - :type urls: list[str] - :param files: List of files to be added to knowledgebase. - :type files: - list[~azure.cognitiveservices.knowledge.qnamaker.models.FileDTO] - """ - - _attribute_map = { - 'qna_list': {'key': 'qnaList', 'type': '[QnADTO]'}, - 'urls': {'key': 'urls', 'type': '[str]'}, - 'files': {'key': 'files', 'type': '[FileDTO]'}, - } - - def __init__(self, *, qna_list=None, urls=None, files=None, **kwargs) -> None: - super(UpdateKbOperationDTOAdd, self).__init__(qna_list=qna_list, urls=urls, files=files, **kwargs) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_kb_operation_dto_delete.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_kb_operation_dto_delete.py deleted file mode 100644 index fb62e5bf659c..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_kb_operation_dto_delete.py +++ /dev/null @@ -1,30 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .delete_kb_contents_dto import DeleteKbContentsDTO - - -class UpdateKbOperationDTODelete(DeleteKbContentsDTO): - """An instance of DeleteKbContentsDTO for delete Operation. - - :param ids: List of Qna Ids to be deleted - :type ids: list[int] - :param sources: List of sources to be deleted from knowledgebase. - :type sources: list[str] - """ - - _attribute_map = { - 'ids': {'key': 'ids', 'type': '[int]'}, - 'sources': {'key': 'sources', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(UpdateKbOperationDTODelete, self).__init__(**kwargs) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_kb_operation_dto_delete_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_kb_operation_dto_delete_py3.py deleted file mode 100644 index 67628e63b0a3..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_kb_operation_dto_delete_py3.py +++ /dev/null @@ -1,30 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .delete_kb_contents_dto_py3 import DeleteKbContentsDTO - - -class UpdateKbOperationDTODelete(DeleteKbContentsDTO): - """An instance of DeleteKbContentsDTO for delete Operation. - - :param ids: List of Qna Ids to be deleted - :type ids: list[int] - :param sources: List of sources to be deleted from knowledgebase. - :type sources: list[str] - """ - - _attribute_map = { - 'ids': {'key': 'ids', 'type': '[int]'}, - 'sources': {'key': 'sources', 'type': '[str]'}, - } - - def __init__(self, *, ids=None, sources=None, **kwargs) -> None: - super(UpdateKbOperationDTODelete, self).__init__(ids=ids, sources=sources, **kwargs) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_kb_operation_dto_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_kb_operation_dto_py3.py deleted file mode 100644 index a183b668114b..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_kb_operation_dto_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class UpdateKbOperationDTO(Model): - """Contains list of QnAs to be updated. - - :param add: An instance of CreateKbInputDTO for add operation - :type add: - ~azure.cognitiveservices.knowledge.qnamaker.models.UpdateKbOperationDTOAdd - :param delete: An instance of DeleteKbContentsDTO for delete Operation - :type delete: - ~azure.cognitiveservices.knowledge.qnamaker.models.UpdateKbOperationDTODelete - :param update: An instance of UpdateKbContentsDTO for Update Operation - :type update: - ~azure.cognitiveservices.knowledge.qnamaker.models.UpdateKbOperationDTOUpdate - """ - - _attribute_map = { - 'add': {'key': 'add', 'type': 'UpdateKbOperationDTOAdd'}, - 'delete': {'key': 'delete', 'type': 'UpdateKbOperationDTODelete'}, - 'update': {'key': 'update', 'type': 'UpdateKbOperationDTOUpdate'}, - } - - def __init__(self, *, add=None, delete=None, update=None, **kwargs) -> None: - super(UpdateKbOperationDTO, self).__init__(**kwargs) - self.add = add - self.delete = delete - self.update = update diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_kb_operation_dto_update.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_kb_operation_dto_update.py deleted file mode 100644 index 8a80527b451a..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_kb_operation_dto_update.py +++ /dev/null @@ -1,36 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .update_kb_contents_dto import UpdateKbContentsDTO - - -class UpdateKbOperationDTOUpdate(UpdateKbContentsDTO): - """An instance of UpdateKbContentsDTO for Update Operation. - - :param name: Friendly name for the knowledgebase. - :type name: str - :param qna_list: List of Q-A (UpdateQnaDTO) to be added to the - knowledgebase. - :type qna_list: - list[~azure.cognitiveservices.knowledge.qnamaker.models.UpdateQnaDTO] - :param urls: List of existing URLs to be refreshed. The content will be - extracted again and re-indexed. - :type urls: list[str] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'qna_list': {'key': 'qnaList', 'type': '[UpdateQnaDTO]'}, - 'urls': {'key': 'urls', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(UpdateKbOperationDTOUpdate, self).__init__(**kwargs) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_kb_operation_dto_update_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_kb_operation_dto_update_py3.py deleted file mode 100644 index ccb2faf4b8f9..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_kb_operation_dto_update_py3.py +++ /dev/null @@ -1,36 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .update_kb_contents_dto_py3 import UpdateKbContentsDTO - - -class UpdateKbOperationDTOUpdate(UpdateKbContentsDTO): - """An instance of UpdateKbContentsDTO for Update Operation. - - :param name: Friendly name for the knowledgebase. - :type name: str - :param qna_list: List of Q-A (UpdateQnaDTO) to be added to the - knowledgebase. - :type qna_list: - list[~azure.cognitiveservices.knowledge.qnamaker.models.UpdateQnaDTO] - :param urls: List of existing URLs to be refreshed. The content will be - extracted again and re-indexed. - :type urls: list[str] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'qna_list': {'key': 'qnaList', 'type': '[UpdateQnaDTO]'}, - 'urls': {'key': 'urls', 'type': '[str]'}, - } - - def __init__(self, *, name: str=None, qna_list=None, urls=None, **kwargs) -> None: - super(UpdateKbOperationDTOUpdate, self).__init__(name=name, qna_list=qna_list, urls=urls, **kwargs) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_metadata_dto.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_metadata_dto.py deleted file mode 100644 index de526f59d55f..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_metadata_dto.py +++ /dev/null @@ -1,34 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class UpdateMetadataDTO(Model): - """PATCH Body schema to represent list of Metadata to be updated. - - :param delete: List of Metadata associated with answer to be deleted - :type delete: - list[~azure.cognitiveservices.knowledge.qnamaker.models.MetadataDTO] - :param add: List of metadata associated with answer to be added - :type add: - list[~azure.cognitiveservices.knowledge.qnamaker.models.MetadataDTO] - """ - - _attribute_map = { - 'delete': {'key': 'delete', 'type': '[MetadataDTO]'}, - 'add': {'key': 'add', 'type': '[MetadataDTO]'}, - } - - def __init__(self, **kwargs): - super(UpdateMetadataDTO, self).__init__(**kwargs) - self.delete = kwargs.get('delete', None) - self.add = kwargs.get('add', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_metadata_dto_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_metadata_dto_py3.py deleted file mode 100644 index 50327dff6578..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_metadata_dto_py3.py +++ /dev/null @@ -1,34 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class UpdateMetadataDTO(Model): - """PATCH Body schema to represent list of Metadata to be updated. - - :param delete: List of Metadata associated with answer to be deleted - :type delete: - list[~azure.cognitiveservices.knowledge.qnamaker.models.MetadataDTO] - :param add: List of metadata associated with answer to be added - :type add: - list[~azure.cognitiveservices.knowledge.qnamaker.models.MetadataDTO] - """ - - _attribute_map = { - 'delete': {'key': 'delete', 'type': '[MetadataDTO]'}, - 'add': {'key': 'add', 'type': '[MetadataDTO]'}, - } - - def __init__(self, *, delete=None, add=None, **kwargs) -> None: - super(UpdateMetadataDTO, self).__init__(**kwargs) - self.delete = delete - self.add = add diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_qna_dto.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_qna_dto.py deleted file mode 100644 index 186d111365ae..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_qna_dto.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class UpdateQnaDTO(Model): - """PATCH Body schema for Update Qna List. - - :param id: Unique id for the Q-A - :type id: int - :param answer: Answer text - :type answer: str - :param source: Source from which Q-A was indexed. eg. - https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs - :type source: str - :param questions: List of questions associated with the answer. - :type questions: - ~azure.cognitiveservices.knowledge.qnamaker.models.UpdateQnaDTOQuestions - :param metadata: List of metadata associated with the answer to be updated - :type metadata: - ~azure.cognitiveservices.knowledge.qnamaker.models.UpdateQnaDTOMetadata - """ - - _validation = { - 'id': {'maximum': 2147483647, 'minimum': 0}, - 'source': {'max_length': 300}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'int'}, - 'answer': {'key': 'answer', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'str'}, - 'questions': {'key': 'questions', 'type': 'UpdateQnaDTOQuestions'}, - 'metadata': {'key': 'metadata', 'type': 'UpdateQnaDTOMetadata'}, - } - - def __init__(self, **kwargs): - super(UpdateQnaDTO, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.answer = kwargs.get('answer', None) - self.source = kwargs.get('source', None) - self.questions = kwargs.get('questions', None) - self.metadata = kwargs.get('metadata', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_qna_dto_metadata.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_qna_dto_metadata.py deleted file mode 100644 index ae18bff232e4..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_qna_dto_metadata.py +++ /dev/null @@ -1,32 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .update_metadata_dto import UpdateMetadataDTO - - -class UpdateQnaDTOMetadata(UpdateMetadataDTO): - """List of metadata associated with the answer to be updated. - - :param delete: List of Metadata associated with answer to be deleted - :type delete: - list[~azure.cognitiveservices.knowledge.qnamaker.models.MetadataDTO] - :param add: List of metadata associated with answer to be added - :type add: - list[~azure.cognitiveservices.knowledge.qnamaker.models.MetadataDTO] - """ - - _attribute_map = { - 'delete': {'key': 'delete', 'type': '[MetadataDTO]'}, - 'add': {'key': 'add', 'type': '[MetadataDTO]'}, - } - - def __init__(self, **kwargs): - super(UpdateQnaDTOMetadata, self).__init__(**kwargs) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_qna_dto_metadata_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_qna_dto_metadata_py3.py deleted file mode 100644 index 64d8384af6e4..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_qna_dto_metadata_py3.py +++ /dev/null @@ -1,32 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .update_metadata_dto_py3 import UpdateMetadataDTO - - -class UpdateQnaDTOMetadata(UpdateMetadataDTO): - """List of metadata associated with the answer to be updated. - - :param delete: List of Metadata associated with answer to be deleted - :type delete: - list[~azure.cognitiveservices.knowledge.qnamaker.models.MetadataDTO] - :param add: List of metadata associated with answer to be added - :type add: - list[~azure.cognitiveservices.knowledge.qnamaker.models.MetadataDTO] - """ - - _attribute_map = { - 'delete': {'key': 'delete', 'type': '[MetadataDTO]'}, - 'add': {'key': 'add', 'type': '[MetadataDTO]'}, - } - - def __init__(self, *, delete=None, add=None, **kwargs) -> None: - super(UpdateQnaDTOMetadata, self).__init__(delete=delete, add=add, **kwargs) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_qna_dto_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_qna_dto_py3.py deleted file mode 100644 index 6ccad503fd2c..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_qna_dto_py3.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class UpdateQnaDTO(Model): - """PATCH Body schema for Update Qna List. - - :param id: Unique id for the Q-A - :type id: int - :param answer: Answer text - :type answer: str - :param source: Source from which Q-A was indexed. eg. - https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs - :type source: str - :param questions: List of questions associated with the answer. - :type questions: - ~azure.cognitiveservices.knowledge.qnamaker.models.UpdateQnaDTOQuestions - :param metadata: List of metadata associated with the answer to be updated - :type metadata: - ~azure.cognitiveservices.knowledge.qnamaker.models.UpdateQnaDTOMetadata - """ - - _validation = { - 'id': {'maximum': 2147483647, 'minimum': 0}, - 'source': {'max_length': 300}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'int'}, - 'answer': {'key': 'answer', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'str'}, - 'questions': {'key': 'questions', 'type': 'UpdateQnaDTOQuestions'}, - 'metadata': {'key': 'metadata', 'type': 'UpdateQnaDTOMetadata'}, - } - - def __init__(self, *, id: int=None, answer: str=None, source: str=None, questions=None, metadata=None, **kwargs) -> None: - super(UpdateQnaDTO, self).__init__(**kwargs) - self.id = id - self.answer = answer - self.source = source - self.questions = questions - self.metadata = metadata diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_qna_dto_questions.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_qna_dto_questions.py deleted file mode 100644 index c30d3c4c3a43..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_qna_dto_questions.py +++ /dev/null @@ -1,30 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .update_questions_dto import UpdateQuestionsDTO - - -class UpdateQnaDTOQuestions(UpdateQuestionsDTO): - """List of questions associated with the answer. - - :param add: List of questions to be added - :type add: list[str] - :param delete: List of questions to be deleted. - :type delete: list[str] - """ - - _attribute_map = { - 'add': {'key': 'add', 'type': '[str]'}, - 'delete': {'key': 'delete', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(UpdateQnaDTOQuestions, self).__init__(**kwargs) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_qna_dto_questions_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_qna_dto_questions_py3.py deleted file mode 100644 index 833f6036ef74..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_qna_dto_questions_py3.py +++ /dev/null @@ -1,30 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .update_questions_dto_py3 import UpdateQuestionsDTO - - -class UpdateQnaDTOQuestions(UpdateQuestionsDTO): - """List of questions associated with the answer. - - :param add: List of questions to be added - :type add: list[str] - :param delete: List of questions to be deleted. - :type delete: list[str] - """ - - _attribute_map = { - 'add': {'key': 'add', 'type': '[str]'}, - 'delete': {'key': 'delete', 'type': '[str]'}, - } - - def __init__(self, *, add=None, delete=None, **kwargs) -> None: - super(UpdateQnaDTOQuestions, self).__init__(add=add, delete=delete, **kwargs) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_questions_dto.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_questions_dto.py deleted file mode 100644 index 66d9acf04081..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_questions_dto.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class UpdateQuestionsDTO(Model): - """PATCH Body schema for Update Kb which contains list of questions to be - added and deleted. - - :param add: List of questions to be added - :type add: list[str] - :param delete: List of questions to be deleted. - :type delete: list[str] - """ - - _attribute_map = { - 'add': {'key': 'add', 'type': '[str]'}, - 'delete': {'key': 'delete', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(UpdateQuestionsDTO, self).__init__(**kwargs) - self.add = kwargs.get('add', None) - self.delete = kwargs.get('delete', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_questions_dto_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_questions_dto_py3.py deleted file mode 100644 index bfed42c94bc6..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/update_questions_dto_py3.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class UpdateQuestionsDTO(Model): - """PATCH Body schema for Update Kb which contains list of questions to be - added and deleted. - - :param add: List of questions to be added - :type add: list[str] - :param delete: List of questions to be deleted. - :type delete: list[str] - """ - - _attribute_map = { - 'add': {'key': 'add', 'type': '[str]'}, - 'delete': {'key': 'delete', 'type': '[str]'}, - } - - def __init__(self, *, add=None, delete=None, **kwargs) -> None: - super(UpdateQuestionsDTO, self).__init__(**kwargs) - self.add = add - self.delete = delete diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/word_alterations_dto.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/word_alterations_dto.py deleted file mode 100644 index cf28a19ff53f..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/word_alterations_dto.py +++ /dev/null @@ -1,35 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class WordAlterationsDTO(Model): - """Collection of word alterations. - - All required parameters must be populated in order to send to Azure. - - :param word_alterations: Required. Collection of word alterations. - :type word_alterations: - list[~azure.cognitiveservices.knowledge.qnamaker.models.AlterationsDTO] - """ - - _validation = { - 'word_alterations': {'required': True}, - } - - _attribute_map = { - 'word_alterations': {'key': 'wordAlterations', 'type': '[AlterationsDTO]'}, - } - - def __init__(self, **kwargs): - super(WordAlterationsDTO, self).__init__(**kwargs) - self.word_alterations = kwargs.get('word_alterations', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/word_alterations_dto_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/word_alterations_dto_py3.py deleted file mode 100644 index 579706cdbbdf..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/word_alterations_dto_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class WordAlterationsDTO(Model): - """Collection of word alterations. - - All required parameters must be populated in order to send to Azure. - - :param word_alterations: Required. Collection of word alterations. - :type word_alterations: - list[~azure.cognitiveservices.knowledge.qnamaker.models.AlterationsDTO] - """ - - _validation = { - 'word_alterations': {'required': True}, - } - - _attribute_map = { - 'word_alterations': {'key': 'wordAlterations', 'type': '[AlterationsDTO]'}, - } - - def __init__(self, *, word_alterations, **kwargs) -> None: - super(WordAlterationsDTO, self).__init__(**kwargs) - self.word_alterations = word_alterations diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/operations/__init__.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/operations/__init__.py index 4302a4938a28..712a6199a8da 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/operations/__init__.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/operations/__init__.py @@ -9,14 +9,8 @@ # regenerated. # -------------------------------------------------------------------------- -from .endpoint_keys_operations import EndpointKeysOperations -from .alterations_operations import AlterationsOperations -from .knowledgebase_operations import KnowledgebaseOperations -from .operations import Operations +from ._runtime_operations import RuntimeOperations __all__ = [ - 'EndpointKeysOperations', - 'AlterationsOperations', - 'KnowledgebaseOperations', - 'Operations', + 'RuntimeOperations', ] diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/operations/alterations_operations.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/operations/_alterations_operations.py similarity index 97% rename from sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/operations/alterations_operations.py rename to sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/operations/_alterations_operations.py index 66b7a53e27c2..746b60fa0fba 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/operations/alterations_operations.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/operations/_alterations_operations.py @@ -17,6 +17,8 @@ class AlterationsOperations(object): """AlterationsOperations operations. + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -73,7 +75,6 @@ def get( raise models.ErrorResponseException(self._deserialize, response) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('WordAlterationsDTO', response) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/operations/endpoint_keys_operations.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/operations/_endpoint_keys_operations.py similarity index 97% rename from sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/operations/endpoint_keys_operations.py rename to sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/operations/_endpoint_keys_operations.py index 0112cd1b9cd2..f4a81d641161 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/operations/endpoint_keys_operations.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/operations/_endpoint_keys_operations.py @@ -17,6 +17,8 @@ class EndpointKeysOperations(object): """EndpointKeysOperations operations. + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -73,7 +75,6 @@ def get_keys( raise models.ErrorResponseException(self._deserialize, response) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('EndpointKeysDTO', response) @@ -127,7 +128,6 @@ def refresh_keys( raise models.ErrorResponseException(self._deserialize, response) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('EndpointKeysDTO', response) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/operations/_endpoint_settings_operations.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/operations/_endpoint_settings_operations.py new file mode 100644 index 000000000000..ac76218ced6d --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/operations/_endpoint_settings_operations.py @@ -0,0 +1,143 @@ +# 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 EndpointSettingsOperations(object): + """EndpointSettingsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + + self.config = config + + def get_settings( + self, custom_headers=None, raw=False, **operation_config): + """Gets endpoint settings for an endpoint. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: EndpointSettingsDTO or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.knowledge.qnamaker.models.EndpointSettingsDTO + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_settings.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True) + } + 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('EndpointSettingsDTO', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_settings.metadata = {'url': '/endpointSettings'} + + def update_settings( + self, active_learning=None, custom_headers=None, raw=False, **operation_config): + """Updates endpoint settings for an endpoint. + + :param active_learning: Active Learning settings of the endpoint. + :type active_learning: + ~azure.cognitiveservices.knowledge.qnamaker.models.EndpointSettingsDTOActiveLearning + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + endpoint_settings_payload = models.EndpointSettingsDTO(active_learning=active_learning) + + # Construct URL + url = self.update_settings.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True) + } + 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(endpoint_settings_payload, 'EndpointSettingsDTO') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_settings.metadata = {'url': '/endpointSettings'} diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/operations/knowledgebase_operations.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/operations/_knowledgebase_operations.py similarity index 99% rename from sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/operations/knowledgebase_operations.py rename to sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/operations/_knowledgebase_operations.py index 50b3ee460c40..d993687140fb 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/operations/knowledgebase_operations.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/operations/_knowledgebase_operations.py @@ -17,6 +17,8 @@ class KnowledgebaseOperations(object): """KnowledgebaseOperations operations. + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -73,7 +75,6 @@ def list_all( raise models.ErrorResponseException(self._deserialize, response) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('KnowledgebasesDTO', response) @@ -127,7 +128,6 @@ def get_details( raise models.ErrorResponseException(self._deserialize, response) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('KnowledgebaseDTO', response) @@ -330,9 +330,8 @@ def update( if response.status_code not in [202]: raise models.ErrorResponseException(self._deserialize, response) - deserialized = None header_dict = {} - + deserialized = None if response.status_code == 202: deserialized = self._deserialize('Operation', response) header_dict = { @@ -393,7 +392,6 @@ def create( raise models.ErrorResponseException(self._deserialize, response) deserialized = None - if response.status_code == 202: deserialized = self._deserialize('Operation', response) @@ -452,7 +450,6 @@ def download( raise models.ErrorResponseException(self._deserialize, response) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('QnADocumentsDTO', response) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/operations/operations.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/operations/_operations.py similarity index 96% rename from sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/operations/operations.py rename to sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/operations/_operations.py index 7fc2c8c360dc..7de5bac1fd48 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/operations/operations.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/operations/_operations.py @@ -17,6 +17,8 @@ class Operations(object): """Operations operations. + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -74,9 +76,8 @@ def get_details( if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) - deserialized = None header_dict = {} - + deserialized = None if response.status_code == 200: deserialized = self._deserialize('Operation', response) header_dict = { diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/operations/_runtime_operations.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/operations/_runtime_operations.py new file mode 100644 index 000000000000..0dc3448da41a --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/operations/_runtime_operations.py @@ -0,0 +1,149 @@ +# 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 RuntimeOperations(object): + """RuntimeOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + + self.config = config + + def generate_answer( + self, kb_id, generate_answer_payload, custom_headers=None, raw=False, **operation_config): + """GenerateAnswer call to query the knowledgebase. + + :param kb_id: Knowledgebase id. + :type kb_id: str + :param generate_answer_payload: Post body of the request. + :type generate_answer_payload: + ~azure.cognitiveservices.knowledge.qnamaker.models.QueryDTO + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: QnASearchResultList or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.knowledge.qnamaker.models.QnASearchResultList + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.generate_answer.metadata['url'] + path_format_arguments = { + 'RuntimeEndpoint': self._serialize.url("self.config.runtime_endpoint", self.config.runtime_endpoint, 'str', skip_quote=True), + 'kbId': self._serialize.url("kb_id", kb_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(generate_answer_payload, 'QueryDTO') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('QnASearchResultList', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + generate_answer.metadata = {'url': '/knowledgebases/{kbId}/generateAnswer'} + + def train( + self, kb_id, feedback_records=None, custom_headers=None, raw=False, **operation_config): + """Train call to add suggestions to the knowledgebase. + + :param kb_id: Knowledgebase id. + :type kb_id: str + :param feedback_records: List of feedback records. + :type feedback_records: + list[~azure.cognitiveservices.knowledge.qnamaker.models.FeedbackRecordDTO] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + train_payload = models.FeedbackRecordsDTO(feedback_records=feedback_records) + + # Construct URL + url = self.train.metadata['url'] + path_format_arguments = { + 'RuntimeEndpoint': self._serialize.url("self.config.runtime_endpoint", self.config.runtime_endpoint, 'str', skip_quote=True), + 'kbId': self._serialize.url("kb_id", kb_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(train_payload, 'FeedbackRecordsDTO') + + # 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 [204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + train.metadata = {'url': '/knowledgebases/{kbId}/train'} diff --git a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/setup.py b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/setup.py index 8eacf30501c9..9c4f90417222 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/setup.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/setup.py @@ -64,7 +64,6 @@ 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/__init__.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/__init__.py index 449671dcb078..a73998bffc8b 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/__init__.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/__init__.py @@ -15,15 +15,18 @@ from ._models_py3 import AzureEntityResource from ._models_py3 import Capability from ._models_py3 import CassandraKeyspaceCreateUpdateParameters + from ._models_py3 import CassandraKeyspaceGetPropertiesResource from ._models_py3 import CassandraKeyspaceGetResults from ._models_py3 import CassandraKeyspaceResource from ._models_py3 import CassandraPartitionKey from ._models_py3 import CassandraSchema from ._models_py3 import CassandraTableCreateUpdateParameters + from ._models_py3 import CassandraTableGetPropertiesResource from ._models_py3 import CassandraTableGetResults from ._models_py3 import CassandraTableResource from ._models_py3 import ClusterKey from ._models_py3 import Column + from ._models_py3 import CompositePath from ._models_py3 import ConflictResolutionPolicy from ._models_py3 import ConsistencyPolicy from ._models_py3 import ContainerPartitionKey @@ -41,9 +44,11 @@ from ._models_py3 import FailoverPolicies from ._models_py3 import FailoverPolicy from ._models_py3 import GremlinDatabaseCreateUpdateParameters + from ._models_py3 import GremlinDatabaseGetPropertiesResource from ._models_py3 import GremlinDatabaseGetResults from ._models_py3 import GremlinDatabaseResource from ._models_py3 import GremlinGraphCreateUpdateParameters + from ._models_py3 import GremlinGraphGetPropertiesResource from ._models_py3 import GremlinGraphGetResults from ._models_py3 import GremlinGraphResource from ._models_py3 import IncludedPath @@ -56,9 +61,11 @@ from ._models_py3 import MetricName from ._models_py3 import MetricValue from ._models_py3 import MongoDBCollectionCreateUpdateParameters + from ._models_py3 import MongoDBCollectionGetPropertiesResource from ._models_py3 import MongoDBCollectionGetResults from ._models_py3 import MongoDBCollectionResource from ._models_py3 import MongoDBDatabaseCreateUpdateParameters + from ._models_py3 import MongoDBDatabaseGetPropertiesResource from ._models_py3 import MongoDBDatabaseGetResults from ._models_py3 import MongoDBDatabaseResource from ._models_py3 import MongoIndex @@ -77,22 +84,29 @@ from ._models_py3 import ProxyResource from ._models_py3 import RegionForOnlineOffline from ._models_py3 import Resource + from ._models_py3 import SpatialSpec from ._models_py3 import SqlContainerCreateUpdateParameters + from ._models_py3 import SqlContainerGetPropertiesResource from ._models_py3 import SqlContainerGetResults from ._models_py3 import SqlContainerResource from ._models_py3 import SqlDatabaseCreateUpdateParameters + from ._models_py3 import SqlDatabaseGetPropertiesResource from ._models_py3 import SqlDatabaseGetResults from ._models_py3 import SqlDatabaseResource from ._models_py3 import SqlStoredProcedureCreateUpdateParameters + from ._models_py3 import SqlStoredProcedureGetPropertiesResource from ._models_py3 import SqlStoredProcedureGetResults from ._models_py3 import SqlStoredProcedureResource from ._models_py3 import SqlTriggerCreateUpdateParameters + from ._models_py3 import SqlTriggerGetPropertiesResource from ._models_py3 import SqlTriggerGetResults from ._models_py3 import SqlTriggerResource from ._models_py3 import SqlUserDefinedFunctionCreateUpdateParameters + from ._models_py3 import SqlUserDefinedFunctionGetPropertiesResource from ._models_py3 import SqlUserDefinedFunctionGetResults from ._models_py3 import SqlUserDefinedFunctionResource from ._models_py3 import TableCreateUpdateParameters + from ._models_py3 import TableGetPropertiesResource from ._models_py3 import TableGetResults from ._models_py3 import TableResource from ._models_py3 import ThroughputSettingsGetResults @@ -109,15 +123,18 @@ from ._models import AzureEntityResource from ._models import Capability from ._models import CassandraKeyspaceCreateUpdateParameters + from ._models import CassandraKeyspaceGetPropertiesResource from ._models import CassandraKeyspaceGetResults from ._models import CassandraKeyspaceResource from ._models import CassandraPartitionKey from ._models import CassandraSchema from ._models import CassandraTableCreateUpdateParameters + from ._models import CassandraTableGetPropertiesResource from ._models import CassandraTableGetResults from ._models import CassandraTableResource from ._models import ClusterKey from ._models import Column + from ._models import CompositePath from ._models import ConflictResolutionPolicy from ._models import ConsistencyPolicy from ._models import ContainerPartitionKey @@ -135,9 +152,11 @@ from ._models import FailoverPolicies from ._models import FailoverPolicy from ._models import GremlinDatabaseCreateUpdateParameters + from ._models import GremlinDatabaseGetPropertiesResource from ._models import GremlinDatabaseGetResults from ._models import GremlinDatabaseResource from ._models import GremlinGraphCreateUpdateParameters + from ._models import GremlinGraphGetPropertiesResource from ._models import GremlinGraphGetResults from ._models import GremlinGraphResource from ._models import IncludedPath @@ -150,9 +169,11 @@ from ._models import MetricName from ._models import MetricValue from ._models import MongoDBCollectionCreateUpdateParameters + from ._models import MongoDBCollectionGetPropertiesResource from ._models import MongoDBCollectionGetResults from ._models import MongoDBCollectionResource from ._models import MongoDBDatabaseCreateUpdateParameters + from ._models import MongoDBDatabaseGetPropertiesResource from ._models import MongoDBDatabaseGetResults from ._models import MongoDBDatabaseResource from ._models import MongoIndex @@ -171,22 +192,29 @@ from ._models import ProxyResource from ._models import RegionForOnlineOffline from ._models import Resource + from ._models import SpatialSpec from ._models import SqlContainerCreateUpdateParameters + from ._models import SqlContainerGetPropertiesResource from ._models import SqlContainerGetResults from ._models import SqlContainerResource from ._models import SqlDatabaseCreateUpdateParameters + from ._models import SqlDatabaseGetPropertiesResource from ._models import SqlDatabaseGetResults from ._models import SqlDatabaseResource from ._models import SqlStoredProcedureCreateUpdateParameters + from ._models import SqlStoredProcedureGetPropertiesResource from ._models import SqlStoredProcedureGetResults from ._models import SqlStoredProcedureResource from ._models import SqlTriggerCreateUpdateParameters + from ._models import SqlTriggerGetPropertiesResource from ._models import SqlTriggerGetResults from ._models import SqlTriggerResource from ._models import SqlUserDefinedFunctionCreateUpdateParameters + from ._models import SqlUserDefinedFunctionGetPropertiesResource from ._models import SqlUserDefinedFunctionGetResults from ._models import SqlUserDefinedFunctionResource from ._models import TableCreateUpdateParameters + from ._models import TableGetPropertiesResource from ._models import TableGetResults from ._models import TableResource from ._models import ThroughputSettingsGetResults @@ -227,6 +255,8 @@ IndexingMode, DataType, IndexKind, + CompositePathSortOrder, + SpatialType, PartitionKind, ConflictResolutionMode, TriggerType, @@ -242,15 +272,18 @@ 'AzureEntityResource', 'Capability', 'CassandraKeyspaceCreateUpdateParameters', + 'CassandraKeyspaceGetPropertiesResource', 'CassandraKeyspaceGetResults', 'CassandraKeyspaceResource', 'CassandraPartitionKey', 'CassandraSchema', 'CassandraTableCreateUpdateParameters', + 'CassandraTableGetPropertiesResource', 'CassandraTableGetResults', 'CassandraTableResource', 'ClusterKey', 'Column', + 'CompositePath', 'ConflictResolutionPolicy', 'ConsistencyPolicy', 'ContainerPartitionKey', @@ -268,9 +301,11 @@ 'FailoverPolicies', 'FailoverPolicy', 'GremlinDatabaseCreateUpdateParameters', + 'GremlinDatabaseGetPropertiesResource', 'GremlinDatabaseGetResults', 'GremlinDatabaseResource', 'GremlinGraphCreateUpdateParameters', + 'GremlinGraphGetPropertiesResource', 'GremlinGraphGetResults', 'GremlinGraphResource', 'IncludedPath', @@ -283,9 +318,11 @@ 'MetricName', 'MetricValue', 'MongoDBCollectionCreateUpdateParameters', + 'MongoDBCollectionGetPropertiesResource', 'MongoDBCollectionGetResults', 'MongoDBCollectionResource', 'MongoDBDatabaseCreateUpdateParameters', + 'MongoDBDatabaseGetPropertiesResource', 'MongoDBDatabaseGetResults', 'MongoDBDatabaseResource', 'MongoIndex', @@ -304,22 +341,29 @@ 'ProxyResource', 'RegionForOnlineOffline', 'Resource', + 'SpatialSpec', 'SqlContainerCreateUpdateParameters', + 'SqlContainerGetPropertiesResource', 'SqlContainerGetResults', 'SqlContainerResource', 'SqlDatabaseCreateUpdateParameters', + 'SqlDatabaseGetPropertiesResource', 'SqlDatabaseGetResults', 'SqlDatabaseResource', 'SqlStoredProcedureCreateUpdateParameters', + 'SqlStoredProcedureGetPropertiesResource', 'SqlStoredProcedureGetResults', 'SqlStoredProcedureResource', 'SqlTriggerCreateUpdateParameters', + 'SqlTriggerGetPropertiesResource', 'SqlTriggerGetResults', 'SqlTriggerResource', 'SqlUserDefinedFunctionCreateUpdateParameters', + 'SqlUserDefinedFunctionGetPropertiesResource', 'SqlUserDefinedFunctionGetResults', 'SqlUserDefinedFunctionResource', 'TableCreateUpdateParameters', + 'TableGetPropertiesResource', 'TableGetResults', 'TableResource', 'ThroughputSettingsGetResults', @@ -359,6 +403,8 @@ 'IndexingMode', 'DataType', 'IndexKind', + 'CompositePathSortOrder', + 'SpatialType', 'PartitionKind', 'ConflictResolutionMode', 'TriggerType', diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_cosmos_db_management_client_enums.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_cosmos_db_management_client_enums.py index 0386fbe056dc..f9d4a719a2dc 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_cosmos_db_management_client_enums.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_cosmos_db_management_client_enums.py @@ -62,6 +62,20 @@ class IndexKind(str, Enum): spatial = "Spatial" +class CompositePathSortOrder(str, Enum): + + ascending = "Ascending" + descending = "Descending" + + +class SpatialType(str, Enum): + + point = "Point" + line_string = "LineString" + polygon = "Polygon" + multi_polygon = "MultiPolygon" + + class PartitionKind(str, Enum): hash = "Hash" diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_models.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_models.py index 5d216069add1..d12a40cf7145 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_models.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_models.py @@ -231,14 +231,54 @@ def __init__(self, **kwargs): self.options = kwargs.get('options', None) -class CassandraKeyspaceGetResults(ARMResourceProperties): - """An Azure Cosmos DB Cassandra keyspace. +class CassandraKeyspaceGetPropertiesResource(Model): + """CassandraKeyspaceGetPropertiesResource. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. + :param id: Required. Name of the Cosmos DB Cassandra keyspace + :type id: str + :ivar _rid: A system generated property. A unique identifier. + :vartype _rid: str + :ivar _ts: A system generated property that denotes the last updated + timestamp of the resource. + :vartype _ts: object + :ivar _etag: A system generated property representing the resource etag + required for optimistic concurrency control. + :vartype _etag: str + """ + + _validation = { + 'id': {'required': True}, + '_rid': {'readonly': True}, + '_ts': {'readonly': True}, + '_etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + '_rid': {'key': '_rid', 'type': 'str'}, + '_ts': {'key': '_ts', 'type': 'object'}, + '_etag': {'key': '_etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CassandraKeyspaceGetPropertiesResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self._rid = None + self._ts = None + self._etag = None + + +class CassandraKeyspaceGetResults(ARMResourceProperties): + """An Azure Cosmos DB Cassandra keyspace. + + Variables are only populated by the server, and will be ignored when + sending a request. + :ivar id: The unique resource identifier of the ARM resource. :vartype id: str :ivar name: The name of the ARM resource. @@ -250,27 +290,15 @@ class CassandraKeyspaceGetResults(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param cassandra_keyspace_get_results_id: Required. Name of the Cosmos DB - Cassandra keyspace - :type cassandra_keyspace_get_results_id: str - :ivar _rid: A system generated property. A unique identifier. - :vartype _rid: str - :ivar _ts: A system generated property that denotes the last updated - timestamp of the resource. - :vartype _ts: object - :ivar _etag: A system generated property representing the resource etag - required for optimistic concurrency control. - :vartype _etag: str + :param resource: + :type resource: + ~azure.mgmt.cosmosdb.models.CassandraKeyspaceGetPropertiesResource """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'cassandra_keyspace_get_results_id': {'required': True}, - '_rid': {'readonly': True}, - '_ts': {'readonly': True}, - '_etag': {'readonly': True}, } _attribute_map = { @@ -279,18 +307,12 @@ class CassandraKeyspaceGetResults(ARMResourceProperties): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'cassandra_keyspace_get_results_id': {'key': 'properties.id', 'type': 'str'}, - '_rid': {'key': 'properties._rid', 'type': 'str'}, - '_ts': {'key': 'properties._ts', 'type': 'object'}, - '_etag': {'key': 'properties._etag', 'type': 'str'}, + 'resource': {'key': 'properties.resource', 'type': 'CassandraKeyspaceGetPropertiesResource'}, } def __init__(self, **kwargs): super(CassandraKeyspaceGetResults, self).__init__(**kwargs) - self.cassandra_keyspace_get_results_id = kwargs.get('cassandra_keyspace_get_results_id', None) - self._rid = None - self._ts = None - self._etag = None + self.resource = kwargs.get('resource', None) class CassandraKeyspaceResource(Model): @@ -406,28 +428,16 @@ def __init__(self, **kwargs): self.options = kwargs.get('options', None) -class CassandraTableGetResults(ARMResourceProperties): - """An Azure Cosmos DB Cassandra table. +class CassandraTableGetPropertiesResource(Model): + """CassandraTableGetPropertiesResource. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :ivar id: The unique resource identifier of the ARM resource. - :vartype id: str - :ivar name: The name of the ARM resource. - :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :param location: The location of the resource group to which the resource - belongs. - :type location: str - :param tags: - :type tags: dict[str, str] - :param cassandra_table_get_results_id: Required. Name of the Cosmos DB - Cassandra table - :type cassandra_table_get_results_id: str + :param id: Required. Name of the Cosmos DB Cassandra table + :type id: str :param default_ttl: Time to live of the Cosmos DB Cassandra table :type default_ttl: int :param schema: Schema of the Cosmos DB Cassandra table @@ -443,10 +453,7 @@ class CassandraTableGetResults(ARMResourceProperties): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'cassandra_table_get_results_id': {'required': True}, + 'id': {'required': True}, '_rid': {'readonly': True}, '_ts': {'readonly': True}, '_etag': {'readonly': True}, @@ -454,21 +461,16 @@ class CassandraTableGetResults(ARMResourceProperties): _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'cassandra_table_get_results_id': {'key': 'properties.id', 'type': 'str'}, - 'default_ttl': {'key': 'properties.defaultTtl', 'type': 'int'}, - 'schema': {'key': 'properties.schema', 'type': 'CassandraSchema'}, - '_rid': {'key': 'properties._rid', 'type': 'str'}, - '_ts': {'key': 'properties._ts', 'type': 'object'}, - '_etag': {'key': 'properties._etag', 'type': 'str'}, + 'default_ttl': {'key': 'defaultTtl', 'type': 'int'}, + 'schema': {'key': 'schema', 'type': 'CassandraSchema'}, + '_rid': {'key': '_rid', 'type': 'str'}, + '_ts': {'key': '_ts', 'type': 'object'}, + '_etag': {'key': '_etag', 'type': 'str'}, } def __init__(self, **kwargs): - super(CassandraTableGetResults, self).__init__(**kwargs) - self.cassandra_table_get_results_id = kwargs.get('cassandra_table_get_results_id', None) + super(CassandraTableGetPropertiesResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) self.default_ttl = kwargs.get('default_ttl', None) self.schema = kwargs.get('schema', None) self._rid = None @@ -476,6 +478,48 @@ def __init__(self, **kwargs): self._etag = None +class CassandraTableGetResults(ARMResourceProperties): + """An Azure Cosmos DB Cassandra table. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The unique resource identifier of the ARM resource. + :vartype id: str + :ivar name: The name of the ARM resource. + :vartype name: str + :ivar type: The type of Azure resource. + :vartype type: str + :param location: The location of the resource group to which the resource + belongs. + :type location: str + :param tags: + :type tags: dict[str, str] + :param resource: + :type resource: + ~azure.mgmt.cosmosdb.models.CassandraTableGetPropertiesResource + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'resource': {'key': 'properties.resource', 'type': 'CassandraTableGetPropertiesResource'}, + } + + def __init__(self, **kwargs): + super(CassandraTableGetResults, self).__init__(**kwargs) + self.resource = kwargs.get('resource', None) + + class CassandraTableResource(Model): """Cosmos DB Cassandra table resource object. @@ -555,6 +599,28 @@ def __init__(self, **kwargs): self.type = kwargs.get('type', None) +class CompositePath(Model): + """CompositePath. + + :param path: The path for which the indexing behavior applies to. Index + paths typically start with root and end with wildcard (/path/*) + :type path: str + :param order: Sort order for composite paths. Possible values include: + 'Ascending', 'Descending' + :type order: str or ~azure.mgmt.cosmosdb.models.CompositePathSortOrder + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'order': {'key': 'order', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CompositePath, self).__init__(**kwargs) + self.path = kwargs.get('path', None) + self.order = kwargs.get('order', None) + + class ConflictResolutionPolicy(Model): """The conflict resolution policy for the container. @@ -1320,14 +1386,54 @@ def __init__(self, **kwargs): self.options = kwargs.get('options', None) -class GremlinDatabaseGetResults(ARMResourceProperties): - """An Azure Cosmos DB Gremlin database. +class GremlinDatabaseGetPropertiesResource(Model): + """GremlinDatabaseGetPropertiesResource. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. + :param id: Required. Name of the Cosmos DB Gremlin database + :type id: str + :ivar _rid: A system generated property. A unique identifier. + :vartype _rid: str + :ivar _ts: A system generated property that denotes the last updated + timestamp of the resource. + :vartype _ts: object + :ivar _etag: A system generated property representing the resource etag + required for optimistic concurrency control. + :vartype _etag: str + """ + + _validation = { + 'id': {'required': True}, + '_rid': {'readonly': True}, + '_ts': {'readonly': True}, + '_etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + '_rid': {'key': '_rid', 'type': 'str'}, + '_ts': {'key': '_ts', 'type': 'object'}, + '_etag': {'key': '_etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(GremlinDatabaseGetPropertiesResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self._rid = None + self._ts = None + self._etag = None + + +class GremlinDatabaseGetResults(ARMResourceProperties): + """An Azure Cosmos DB Gremlin database. + + Variables are only populated by the server, and will be ignored when + sending a request. + :ivar id: The unique resource identifier of the ARM resource. :vartype id: str :ivar name: The name of the ARM resource. @@ -1339,27 +1445,15 @@ class GremlinDatabaseGetResults(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param gremlin_database_get_results_id: Required. Name of the Cosmos DB - Gremlin database - :type gremlin_database_get_results_id: str - :ivar _rid: A system generated property. A unique identifier. - :vartype _rid: str - :ivar _ts: A system generated property that denotes the last updated - timestamp of the resource. - :vartype _ts: object - :ivar _etag: A system generated property representing the resource etag - required for optimistic concurrency control. - :vartype _etag: str + :param resource: + :type resource: + ~azure.mgmt.cosmosdb.models.GremlinDatabaseGetPropertiesResource """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'gremlin_database_get_results_id': {'required': True}, - '_rid': {'readonly': True}, - '_ts': {'readonly': True}, - '_etag': {'readonly': True}, } _attribute_map = { @@ -1368,18 +1462,12 @@ class GremlinDatabaseGetResults(ARMResourceProperties): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'gremlin_database_get_results_id': {'key': 'properties.id', 'type': 'str'}, - '_rid': {'key': 'properties._rid', 'type': 'str'}, - '_ts': {'key': 'properties._ts', 'type': 'object'}, - '_etag': {'key': 'properties._etag', 'type': 'str'}, + 'resource': {'key': 'properties.resource', 'type': 'GremlinDatabaseGetPropertiesResource'}, } def __init__(self, **kwargs): super(GremlinDatabaseGetResults, self).__init__(**kwargs) - self.gremlin_database_get_results_id = kwargs.get('gremlin_database_get_results_id', None) - self._rid = None - self._ts = None - self._etag = None + self.resource = kwargs.get('resource', None) class GremlinDatabaseResource(Model): @@ -1454,28 +1542,16 @@ def __init__(self, **kwargs): self.options = kwargs.get('options', None) -class GremlinGraphGetResults(ARMResourceProperties): - """An Azure Cosmos DB Gremlin graph. +class GremlinGraphGetPropertiesResource(Model): + """GremlinGraphGetPropertiesResource. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :ivar id: The unique resource identifier of the ARM resource. - :vartype id: str - :ivar name: The name of the ARM resource. - :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :param location: The location of the resource group to which the resource - belongs. - :type location: str - :param tags: - :type tags: dict[str, str] - :param gremlin_graph_get_results_id: Required. Name of the Cosmos DB - Gremlin graph - :type gremlin_graph_get_results_id: str + :param id: Required. Name of the Cosmos DB Gremlin graph + :type id: str :param indexing_policy: The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the graph :type indexing_policy: ~azure.mgmt.cosmosdb.models.IndexingPolicy @@ -1503,10 +1579,7 @@ class GremlinGraphGetResults(ARMResourceProperties): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'gremlin_graph_get_results_id': {'required': True}, + 'id': {'required': True}, '_rid': {'readonly': True}, '_ts': {'readonly': True}, '_etag': {'readonly': True}, @@ -1514,24 +1587,19 @@ class GremlinGraphGetResults(ARMResourceProperties): _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'gremlin_graph_get_results_id': {'key': 'properties.id', 'type': 'str'}, - 'indexing_policy': {'key': 'properties.indexingPolicy', 'type': 'IndexingPolicy'}, - 'partition_key': {'key': 'properties.partitionKey', 'type': 'ContainerPartitionKey'}, - 'default_ttl': {'key': 'properties.defaultTtl', 'type': 'int'}, - 'unique_key_policy': {'key': 'properties.uniqueKeyPolicy', 'type': 'UniqueKeyPolicy'}, - 'conflict_resolution_policy': {'key': 'properties.conflictResolutionPolicy', 'type': 'ConflictResolutionPolicy'}, - '_rid': {'key': 'properties._rid', 'type': 'str'}, - '_ts': {'key': 'properties._ts', 'type': 'object'}, - '_etag': {'key': 'properties._etag', 'type': 'str'}, + 'indexing_policy': {'key': 'indexingPolicy', 'type': 'IndexingPolicy'}, + 'partition_key': {'key': 'partitionKey', 'type': 'ContainerPartitionKey'}, + 'default_ttl': {'key': 'defaultTtl', 'type': 'int'}, + 'unique_key_policy': {'key': 'uniqueKeyPolicy', 'type': 'UniqueKeyPolicy'}, + 'conflict_resolution_policy': {'key': 'conflictResolutionPolicy', 'type': 'ConflictResolutionPolicy'}, + '_rid': {'key': '_rid', 'type': 'str'}, + '_ts': {'key': '_ts', 'type': 'object'}, + '_etag': {'key': '_etag', 'type': 'str'}, } def __init__(self, **kwargs): - super(GremlinGraphGetResults, self).__init__(**kwargs) - self.gremlin_graph_get_results_id = kwargs.get('gremlin_graph_get_results_id', None) + super(GremlinGraphGetPropertiesResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) self.indexing_policy = kwargs.get('indexing_policy', None) self.partition_key = kwargs.get('partition_key', None) self.default_ttl = kwargs.get('default_ttl', None) @@ -1542,33 +1610,75 @@ def __init__(self, **kwargs): self._etag = None -class GremlinGraphResource(Model): - """Cosmos DB Gremlin graph resource object. - - All required parameters must be populated in order to send to Azure. +class GremlinGraphGetResults(ARMResourceProperties): + """An Azure Cosmos DB Gremlin graph. - :param id: Required. Name of the Cosmos DB Gremlin graph - :type id: str - :param indexing_policy: The configuration of the indexing policy. By - default, the indexing is automatic for all document paths within the graph - :type indexing_policy: ~azure.mgmt.cosmosdb.models.IndexingPolicy - :param partition_key: The configuration of the partition key to be used - for partitioning data into multiple partitions - :type partition_key: ~azure.mgmt.cosmosdb.models.ContainerPartitionKey - :param default_ttl: Default time to live - :type default_ttl: int - :param unique_key_policy: The unique key policy configuration for - specifying uniqueness constraints on documents in the collection in the - Azure Cosmos DB service. - :type unique_key_policy: ~azure.mgmt.cosmosdb.models.UniqueKeyPolicy - :param conflict_resolution_policy: The conflict resolution policy for the - graph. - :type conflict_resolution_policy: - ~azure.mgmt.cosmosdb.models.ConflictResolutionPolicy - """ + Variables are only populated by the server, and will be ignored when + sending a request. - _validation = { - 'id': {'required': True}, + :ivar id: The unique resource identifier of the ARM resource. + :vartype id: str + :ivar name: The name of the ARM resource. + :vartype name: str + :ivar type: The type of Azure resource. + :vartype type: str + :param location: The location of the resource group to which the resource + belongs. + :type location: str + :param tags: + :type tags: dict[str, str] + :param resource: + :type resource: + ~azure.mgmt.cosmosdb.models.GremlinGraphGetPropertiesResource + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'resource': {'key': 'properties.resource', 'type': 'GremlinGraphGetPropertiesResource'}, + } + + def __init__(self, **kwargs): + super(GremlinGraphGetResults, self).__init__(**kwargs) + self.resource = kwargs.get('resource', None) + + +class GremlinGraphResource(Model): + """Cosmos DB Gremlin graph resource object. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Name of the Cosmos DB Gremlin graph + :type id: str + :param indexing_policy: The configuration of the indexing policy. By + default, the indexing is automatic for all document paths within the graph + :type indexing_policy: ~azure.mgmt.cosmosdb.models.IndexingPolicy + :param partition_key: The configuration of the partition key to be used + for partitioning data into multiple partitions + :type partition_key: ~azure.mgmt.cosmosdb.models.ContainerPartitionKey + :param default_ttl: Default time to live + :type default_ttl: int + :param unique_key_policy: The unique key policy configuration for + specifying uniqueness constraints on documents in the collection in the + Azure Cosmos DB service. + :type unique_key_policy: ~azure.mgmt.cosmosdb.models.UniqueKeyPolicy + :param conflict_resolution_policy: The conflict resolution policy for the + graph. + :type conflict_resolution_policy: + ~azure.mgmt.cosmosdb.models.ConflictResolutionPolicy + """ + + _validation = { + 'id': {'required': True}, } _attribute_map = { @@ -1650,6 +1760,11 @@ class IndexingPolicy(Model): :type included_paths: list[~azure.mgmt.cosmosdb.models.IncludedPath] :param excluded_paths: List of paths to exclude from indexing :type excluded_paths: list[~azure.mgmt.cosmosdb.models.ExcludedPath] + :param composite_indexes: List of composite path list + :type composite_indexes: + list[list[~azure.mgmt.cosmosdb.models.CompositePath]] + :param spatial_indexes: List of spatial specifics + :type spatial_indexes: list[~azure.mgmt.cosmosdb.models.SpatialSpec] """ _attribute_map = { @@ -1657,6 +1772,8 @@ class IndexingPolicy(Model): 'indexing_mode': {'key': 'indexingMode', 'type': 'str'}, 'included_paths': {'key': 'includedPaths', 'type': '[IncludedPath]'}, 'excluded_paths': {'key': 'excludedPaths', 'type': '[ExcludedPath]'}, + 'composite_indexes': {'key': 'compositeIndexes', 'type': '[[CompositePath]]'}, + 'spatial_indexes': {'key': 'spatialIndexes', 'type': '[SpatialSpec]'}, } def __init__(self, **kwargs): @@ -1665,6 +1782,8 @@ def __init__(self, **kwargs): self.indexing_mode = kwargs.get('indexing_mode', "Consistent") self.included_paths = kwargs.get('included_paths', None) self.excluded_paths = kwargs.get('excluded_paths', None) + self.composite_indexes = kwargs.get('composite_indexes', None) + self.spatial_indexes = kwargs.get('spatial_indexes', None) class Location(Model): @@ -1975,28 +2094,16 @@ def __init__(self, **kwargs): self.options = kwargs.get('options', None) -class MongoDBCollectionGetResults(ARMResourceProperties): - """An Azure Cosmos DB MongoDB collection. +class MongoDBCollectionGetPropertiesResource(Model): + """MongoDBCollectionGetPropertiesResource. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :ivar id: The unique resource identifier of the ARM resource. - :vartype id: str - :ivar name: The name of the ARM resource. - :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :param location: The location of the resource group to which the resource - belongs. - :type location: str - :param tags: - :type tags: dict[str, str] - :param mongo_db_collection_get_results_id: Required. Name of the Cosmos DB - MongoDB collection - :type mongo_db_collection_get_results_id: str + :param id: Required. Name of the Cosmos DB MongoDB collection + :type id: str :param shard_key: A key-value pair of shard keys to be applied for the request. :type shard_key: dict[str, str] @@ -2013,10 +2120,7 @@ class MongoDBCollectionGetResults(ARMResourceProperties): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'mongo_db_collection_get_results_id': {'required': True}, + 'id': {'required': True}, '_rid': {'readonly': True}, '_ts': {'readonly': True}, '_etag': {'readonly': True}, @@ -2024,21 +2128,16 @@ class MongoDBCollectionGetResults(ARMResourceProperties): _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'mongo_db_collection_get_results_id': {'key': 'properties.id', 'type': 'str'}, - 'shard_key': {'key': 'properties.shardKey', 'type': '{str}'}, - 'indexes': {'key': 'properties.indexes', 'type': '[MongoIndex]'}, - '_rid': {'key': 'properties._rid', 'type': 'str'}, - '_ts': {'key': 'properties._ts', 'type': 'object'}, - '_etag': {'key': 'properties._etag', 'type': 'str'}, + 'shard_key': {'key': 'shardKey', 'type': '{str}'}, + 'indexes': {'key': 'indexes', 'type': '[MongoIndex]'}, + '_rid': {'key': '_rid', 'type': 'str'}, + '_ts': {'key': '_ts', 'type': 'object'}, + '_etag': {'key': '_etag', 'type': 'str'}, } def __init__(self, **kwargs): - super(MongoDBCollectionGetResults, self).__init__(**kwargs) - self.mongo_db_collection_get_results_id = kwargs.get('mongo_db_collection_get_results_id', None) + super(MongoDBCollectionGetPropertiesResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) self.shard_key = kwargs.get('shard_key', None) self.indexes = kwargs.get('indexes', None) self._rid = None @@ -2046,6 +2145,48 @@ def __init__(self, **kwargs): self._etag = None +class MongoDBCollectionGetResults(ARMResourceProperties): + """An Azure Cosmos DB MongoDB collection. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The unique resource identifier of the ARM resource. + :vartype id: str + :ivar name: The name of the ARM resource. + :vartype name: str + :ivar type: The type of Azure resource. + :vartype type: str + :param location: The location of the resource group to which the resource + belongs. + :type location: str + :param tags: + :type tags: dict[str, str] + :param resource: + :type resource: + ~azure.mgmt.cosmosdb.models.MongoDBCollectionGetPropertiesResource + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'resource': {'key': 'properties.resource', 'type': 'MongoDBCollectionGetPropertiesResource'}, + } + + def __init__(self, **kwargs): + super(MongoDBCollectionGetResults, self).__init__(**kwargs) + self.resource = kwargs.get('resource', None) + + class MongoDBCollectionResource(Model): """Cosmos DB MongoDB collection resource object. @@ -2127,14 +2268,54 @@ def __init__(self, **kwargs): self.options = kwargs.get('options', None) -class MongoDBDatabaseGetResults(ARMResourceProperties): - """An Azure Cosmos DB MongoDB database. +class MongoDBDatabaseGetPropertiesResource(Model): + """MongoDBDatabaseGetPropertiesResource. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. + :param id: Required. Name of the Cosmos DB MongoDB database + :type id: str + :ivar _rid: A system generated property. A unique identifier. + :vartype _rid: str + :ivar _ts: A system generated property that denotes the last updated + timestamp of the resource. + :vartype _ts: object + :ivar _etag: A system generated property representing the resource etag + required for optimistic concurrency control. + :vartype _etag: str + """ + + _validation = { + 'id': {'required': True}, + '_rid': {'readonly': True}, + '_ts': {'readonly': True}, + '_etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + '_rid': {'key': '_rid', 'type': 'str'}, + '_ts': {'key': '_ts', 'type': 'object'}, + '_etag': {'key': '_etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MongoDBDatabaseGetPropertiesResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self._rid = None + self._ts = None + self._etag = None + + +class MongoDBDatabaseGetResults(ARMResourceProperties): + """An Azure Cosmos DB MongoDB database. + + Variables are only populated by the server, and will be ignored when + sending a request. + :ivar id: The unique resource identifier of the ARM resource. :vartype id: str :ivar name: The name of the ARM resource. @@ -2146,27 +2327,15 @@ class MongoDBDatabaseGetResults(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param mongo_db_database_get_results_id: Required. Name of the Cosmos DB - MongoDB database - :type mongo_db_database_get_results_id: str - :ivar _rid: A system generated property. A unique identifier. - :vartype _rid: str - :ivar _ts: A system generated property that denotes the last updated - timestamp of the resource. - :vartype _ts: object - :ivar _etag: A system generated property representing the resource etag - required for optimistic concurrency control. - :vartype _etag: str + :param resource: + :type resource: + ~azure.mgmt.cosmosdb.models.MongoDBDatabaseGetPropertiesResource """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'mongo_db_database_get_results_id': {'required': True}, - '_rid': {'readonly': True}, - '_ts': {'readonly': True}, - '_etag': {'readonly': True}, } _attribute_map = { @@ -2175,18 +2344,12 @@ class MongoDBDatabaseGetResults(ARMResourceProperties): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'mongo_db_database_get_results_id': {'key': 'properties.id', 'type': 'str'}, - '_rid': {'key': 'properties._rid', 'type': 'str'}, - '_ts': {'key': 'properties._ts', 'type': 'object'}, - '_etag': {'key': 'properties._etag', 'type': 'str'}, + 'resource': {'key': 'properties.resource', 'type': 'MongoDBDatabaseGetPropertiesResource'}, } def __init__(self, **kwargs): super(MongoDBDatabaseGetResults, self).__init__(**kwargs) - self.mongo_db_database_get_results_id = kwargs.get('mongo_db_database_get_results_id', None) - self._rid = None - self._ts = None - self._etag = None + self.resource = kwargs.get('resource', None) class MongoDBDatabaseResource(Model): @@ -2784,6 +2947,27 @@ def __init__(self, **kwargs): self.region = kwargs.get('region', None) +class SpatialSpec(Model): + """SpatialSpec. + + :param path: The path for which the indexing behavior applies to. Index + paths typically start with root and end with wildcard (/path/*) + :type path: str + :param types: List of path's spatial type + :type types: list[str or ~azure.mgmt.cosmosdb.models.SpatialType] + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'types': {'key': 'types', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(SpatialSpec, self).__init__(**kwargs) + self.path = kwargs.get('path', None) + self.types = kwargs.get('types', None) + + class SqlContainerCreateUpdateParameters(ARMResourceProperties): """Parameters to create and update Cosmos DB container. @@ -2834,28 +3018,16 @@ def __init__(self, **kwargs): self.options = kwargs.get('options', None) -class SqlContainerGetResults(ARMResourceProperties): - """An Azure Cosmos DB container. +class SqlContainerGetPropertiesResource(Model): + """SqlContainerGetPropertiesResource. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :ivar id: The unique resource identifier of the ARM resource. - :vartype id: str - :ivar name: The name of the ARM resource. - :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :param location: The location of the resource group to which the resource - belongs. - :type location: str - :param tags: - :type tags: dict[str, str] - :param sql_container_get_results_id: Required. Name of the Cosmos DB SQL - container - :type sql_container_get_results_id: str + :param id: Required. Name of the Cosmos DB SQL container + :type id: str :param indexing_policy: The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the container @@ -2884,10 +3056,7 @@ class SqlContainerGetResults(ARMResourceProperties): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'sql_container_get_results_id': {'required': True}, + 'id': {'required': True}, '_rid': {'readonly': True}, '_ts': {'readonly': True}, '_etag': {'readonly': True}, @@ -2895,24 +3064,19 @@ class SqlContainerGetResults(ARMResourceProperties): _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sql_container_get_results_id': {'key': 'properties.id', 'type': 'str'}, - 'indexing_policy': {'key': 'properties.indexingPolicy', 'type': 'IndexingPolicy'}, - 'partition_key': {'key': 'properties.partitionKey', 'type': 'ContainerPartitionKey'}, - 'default_ttl': {'key': 'properties.defaultTtl', 'type': 'int'}, - 'unique_key_policy': {'key': 'properties.uniqueKeyPolicy', 'type': 'UniqueKeyPolicy'}, - 'conflict_resolution_policy': {'key': 'properties.conflictResolutionPolicy', 'type': 'ConflictResolutionPolicy'}, - '_rid': {'key': 'properties._rid', 'type': 'str'}, - '_ts': {'key': 'properties._ts', 'type': 'object'}, - '_etag': {'key': 'properties._etag', 'type': 'str'}, + 'indexing_policy': {'key': 'indexingPolicy', 'type': 'IndexingPolicy'}, + 'partition_key': {'key': 'partitionKey', 'type': 'ContainerPartitionKey'}, + 'default_ttl': {'key': 'defaultTtl', 'type': 'int'}, + 'unique_key_policy': {'key': 'uniqueKeyPolicy', 'type': 'UniqueKeyPolicy'}, + 'conflict_resolution_policy': {'key': 'conflictResolutionPolicy', 'type': 'ConflictResolutionPolicy'}, + '_rid': {'key': '_rid', 'type': 'str'}, + '_ts': {'key': '_ts', 'type': 'object'}, + '_etag': {'key': '_etag', 'type': 'str'}, } def __init__(self, **kwargs): - super(SqlContainerGetResults, self).__init__(**kwargs) - self.sql_container_get_results_id = kwargs.get('sql_container_get_results_id', None) + super(SqlContainerGetPropertiesResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) self.indexing_policy = kwargs.get('indexing_policy', None) self.partition_key = kwargs.get('partition_key', None) self.default_ttl = kwargs.get('default_ttl', None) @@ -2923,29 +3087,71 @@ def __init__(self, **kwargs): self._etag = None -class SqlContainerResource(Model): - """Cosmos DB SQL container resource object. +class SqlContainerGetResults(ARMResourceProperties): + """An Azure Cosmos DB container. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when + sending a request. - :param id: Required. Name of the Cosmos DB SQL container - :type id: str - :param indexing_policy: The configuration of the indexing policy. By - default, the indexing is automatic for all document paths within the - container - :type indexing_policy: ~azure.mgmt.cosmosdb.models.IndexingPolicy - :param partition_key: The configuration of the partition key to be used - for partitioning data into multiple partitions - :type partition_key: ~azure.mgmt.cosmosdb.models.ContainerPartitionKey - :param default_ttl: Default time to live - :type default_ttl: int - :param unique_key_policy: The unique key policy configuration for - specifying uniqueness constraints on documents in the collection in the - Azure Cosmos DB service. - :type unique_key_policy: ~azure.mgmt.cosmosdb.models.UniqueKeyPolicy - :param conflict_resolution_policy: The conflict resolution policy for the - container. - :type conflict_resolution_policy: + :ivar id: The unique resource identifier of the ARM resource. + :vartype id: str + :ivar name: The name of the ARM resource. + :vartype name: str + :ivar type: The type of Azure resource. + :vartype type: str + :param location: The location of the resource group to which the resource + belongs. + :type location: str + :param tags: + :type tags: dict[str, str] + :param resource: + :type resource: + ~azure.mgmt.cosmosdb.models.SqlContainerGetPropertiesResource + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'resource': {'key': 'properties.resource', 'type': 'SqlContainerGetPropertiesResource'}, + } + + def __init__(self, **kwargs): + super(SqlContainerGetResults, self).__init__(**kwargs) + self.resource = kwargs.get('resource', None) + + +class SqlContainerResource(Model): + """Cosmos DB SQL container resource object. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Name of the Cosmos DB SQL container + :type id: str + :param indexing_policy: The configuration of the indexing policy. By + default, the indexing is automatic for all document paths within the + container + :type indexing_policy: ~azure.mgmt.cosmosdb.models.IndexingPolicy + :param partition_key: The configuration of the partition key to be used + for partitioning data into multiple partitions + :type partition_key: ~azure.mgmt.cosmosdb.models.ContainerPartitionKey + :param default_ttl: Default time to live + :type default_ttl: int + :param unique_key_policy: The unique key policy configuration for + specifying uniqueness constraints on documents in the collection in the + Azure Cosmos DB service. + :type unique_key_policy: ~azure.mgmt.cosmosdb.models.UniqueKeyPolicy + :param conflict_resolution_policy: The conflict resolution policy for the + container. + :type conflict_resolution_policy: ~azure.mgmt.cosmosdb.models.ConflictResolutionPolicy """ @@ -3022,28 +3228,16 @@ def __init__(self, **kwargs): self.options = kwargs.get('options', None) -class SqlDatabaseGetResults(ARMResourceProperties): - """An Azure Cosmos DB SQL database. +class SqlDatabaseGetPropertiesResource(Model): + """SqlDatabaseGetPropertiesResource. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :ivar id: The unique resource identifier of the ARM resource. - :vartype id: str - :ivar name: The name of the ARM resource. - :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :param location: The location of the resource group to which the resource - belongs. - :type location: str - :param tags: - :type tags: dict[str, str] - :param sql_database_get_results_id: Required. Name of the Cosmos DB SQL - database - :type sql_database_get_results_id: str + :param id: Required. Name of the Cosmos DB SQL database + :type id: str :ivar _rid: A system generated property. A unique identifier. :vartype _rid: str :ivar _ts: A system generated property that denotes the last updated @@ -3061,10 +3255,7 @@ class SqlDatabaseGetResults(ARMResourceProperties): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'sql_database_get_results_id': {'required': True}, + 'id': {'required': True}, '_rid': {'readonly': True}, '_ts': {'readonly': True}, '_etag': {'readonly': True}, @@ -3072,21 +3263,16 @@ class SqlDatabaseGetResults(ARMResourceProperties): _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sql_database_get_results_id': {'key': 'properties.id', 'type': 'str'}, - '_rid': {'key': 'properties._rid', 'type': 'str'}, - '_ts': {'key': 'properties._ts', 'type': 'object'}, - '_etag': {'key': 'properties._etag', 'type': 'str'}, - '_colls': {'key': 'properties._colls', 'type': 'str'}, - '_users': {'key': 'properties._users', 'type': 'str'}, + '_rid': {'key': '_rid', 'type': 'str'}, + '_ts': {'key': '_ts', 'type': 'object'}, + '_etag': {'key': '_etag', 'type': 'str'}, + '_colls': {'key': '_colls', 'type': 'str'}, + '_users': {'key': '_users', 'type': 'str'}, } def __init__(self, **kwargs): - super(SqlDatabaseGetResults, self).__init__(**kwargs) - self.sql_database_get_results_id = kwargs.get('sql_database_get_results_id', None) + super(SqlDatabaseGetPropertiesResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) self._rid = None self._ts = None self._etag = None @@ -3094,6 +3280,48 @@ def __init__(self, **kwargs): self._users = kwargs.get('_users', None) +class SqlDatabaseGetResults(ARMResourceProperties): + """An Azure Cosmos DB SQL database. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The unique resource identifier of the ARM resource. + :vartype id: str + :ivar name: The name of the ARM resource. + :vartype name: str + :ivar type: The type of Azure resource. + :vartype type: str + :param location: The location of the resource group to which the resource + belongs. + :type location: str + :param tags: + :type tags: dict[str, str] + :param resource: + :type resource: + ~azure.mgmt.cosmosdb.models.SqlDatabaseGetPropertiesResource + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'resource': {'key': 'properties.resource', 'type': 'SqlDatabaseGetPropertiesResource'}, + } + + def __init__(self, **kwargs): + super(SqlDatabaseGetResults, self).__init__(**kwargs) + self.resource = kwargs.get('resource', None) + + class SqlDatabaseResource(Model): """Cosmos DB SQL database resource object. @@ -3166,14 +3394,58 @@ def __init__(self, **kwargs): self.options = kwargs.get('options', None) -class SqlStoredProcedureGetResults(ARMResourceProperties): - """An Azure Cosmos DB storedProcedure. +class SqlStoredProcedureGetPropertiesResource(Model): + """SqlStoredProcedureGetPropertiesResource. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. + :param id: Required. Name of the Cosmos DB SQL storedProcedure + :type id: str + :param body: Body of the Stored Procedure + :type body: str + :ivar _rid: A system generated property. A unique identifier. + :vartype _rid: str + :ivar _ts: A system generated property that denotes the last updated + timestamp of the resource. + :vartype _ts: object + :ivar _etag: A system generated property representing the resource etag + required for optimistic concurrency control. + :vartype _etag: str + """ + + _validation = { + 'id': {'required': True}, + '_rid': {'readonly': True}, + '_ts': {'readonly': True}, + '_etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'body': {'key': 'body', 'type': 'str'}, + '_rid': {'key': '_rid', 'type': 'str'}, + '_ts': {'key': '_ts', 'type': 'object'}, + '_etag': {'key': '_etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SqlStoredProcedureGetPropertiesResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.body = kwargs.get('body', None) + self._rid = None + self._ts = None + self._etag = None + + +class SqlStoredProcedureGetResults(ARMResourceProperties): + """An Azure Cosmos DB storedProcedure. + + Variables are only populated by the server, and will be ignored when + sending a request. + :ivar id: The unique resource identifier of the ARM resource. :vartype id: str :ivar name: The name of the ARM resource. @@ -3185,29 +3457,15 @@ class SqlStoredProcedureGetResults(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param sql_stored_procedure_get_results_id: Required. Name of the Cosmos - DB SQL storedProcedure - :type sql_stored_procedure_get_results_id: str - :param body: Body of the Stored Procedure - :type body: str - :ivar _rid: A system generated property. A unique identifier. - :vartype _rid: str - :ivar _ts: A system generated property that denotes the last updated - timestamp of the resource. - :vartype _ts: object - :ivar _etag: A system generated property representing the resource etag - required for optimistic concurrency control. - :vartype _etag: str + :param resource: + :type resource: + ~azure.mgmt.cosmosdb.models.SqlStoredProcedureGetPropertiesResource """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'sql_stored_procedure_get_results_id': {'required': True}, - '_rid': {'readonly': True}, - '_ts': {'readonly': True}, - '_etag': {'readonly': True}, } _attribute_map = { @@ -3216,20 +3474,12 @@ class SqlStoredProcedureGetResults(ARMResourceProperties): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'sql_stored_procedure_get_results_id': {'key': 'properties.id', 'type': 'str'}, - 'body': {'key': 'properties.body', 'type': 'str'}, - '_rid': {'key': 'properties._rid', 'type': 'str'}, - '_ts': {'key': 'properties._ts', 'type': 'object'}, - '_etag': {'key': 'properties._etag', 'type': 'str'}, + 'resource': {'key': 'properties.resource', 'type': 'SqlStoredProcedureGetPropertiesResource'}, } def __init__(self, **kwargs): super(SqlStoredProcedureGetResults, self).__init__(**kwargs) - self.sql_stored_procedure_get_results_id = kwargs.get('sql_stored_procedure_get_results_id', None) - self.body = kwargs.get('body', None) - self._rid = None - self._ts = None - self._etag = None + self.resource = kwargs.get('resource', None) class SqlStoredProcedureResource(Model): @@ -3308,28 +3558,16 @@ def __init__(self, **kwargs): self.options = kwargs.get('options', None) -class SqlTriggerGetResults(ARMResourceProperties): - """An Azure Cosmos DB trigger. +class SqlTriggerGetPropertiesResource(Model): + """SqlTriggerGetPropertiesResource. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :ivar id: The unique resource identifier of the ARM resource. - :vartype id: str - :ivar name: The name of the ARM resource. - :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :param location: The location of the resource group to which the resource - belongs. - :type location: str - :param tags: - :type tags: dict[str, str] - :param sql_trigger_get_results_id: Required. Name of the Cosmos DB SQL - trigger - :type sql_trigger_get_results_id: str + :param id: Required. Name of the Cosmos DB SQL trigger + :type id: str :param body: Body of the Trigger :type body: str :param trigger_type: Type of the Trigger. Possible values include: 'Pre', @@ -3350,10 +3588,7 @@ class SqlTriggerGetResults(ARMResourceProperties): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'sql_trigger_get_results_id': {'required': True}, + 'id': {'required': True}, '_rid': {'readonly': True}, '_ts': {'readonly': True}, '_etag': {'readonly': True}, @@ -3361,22 +3596,17 @@ class SqlTriggerGetResults(ARMResourceProperties): _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sql_trigger_get_results_id': {'key': 'properties.id', 'type': 'str'}, - 'body': {'key': 'properties.body', 'type': 'str'}, - 'trigger_type': {'key': 'properties.triggerType', 'type': 'str'}, - 'trigger_operation': {'key': 'properties.triggerOperation', 'type': 'str'}, - '_rid': {'key': 'properties._rid', 'type': 'str'}, - '_ts': {'key': 'properties._ts', 'type': 'object'}, - '_etag': {'key': 'properties._etag', 'type': 'str'}, + 'body': {'key': 'body', 'type': 'str'}, + 'trigger_type': {'key': 'triggerType', 'type': 'str'}, + 'trigger_operation': {'key': 'triggerOperation', 'type': 'str'}, + '_rid': {'key': '_rid', 'type': 'str'}, + '_ts': {'key': '_ts', 'type': 'object'}, + '_etag': {'key': '_etag', 'type': 'str'}, } def __init__(self, **kwargs): - super(SqlTriggerGetResults, self).__init__(**kwargs) - self.sql_trigger_get_results_id = kwargs.get('sql_trigger_get_results_id', None) + super(SqlTriggerGetPropertiesResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) self.body = kwargs.get('body', None) self.trigger_type = kwargs.get('trigger_type', None) self.trigger_operation = kwargs.get('trigger_operation', None) @@ -3385,6 +3615,48 @@ def __init__(self, **kwargs): self._etag = None +class SqlTriggerGetResults(ARMResourceProperties): + """An Azure Cosmos DB trigger. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The unique resource identifier of the ARM resource. + :vartype id: str + :ivar name: The name of the ARM resource. + :vartype name: str + :ivar type: The type of Azure resource. + :vartype type: str + :param location: The location of the resource group to which the resource + belongs. + :type location: str + :param tags: + :type tags: dict[str, str] + :param resource: + :type resource: + ~azure.mgmt.cosmosdb.models.SqlTriggerGetPropertiesResource + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'resource': {'key': 'properties.resource', 'type': 'SqlTriggerGetPropertiesResource'}, + } + + def __init__(self, **kwargs): + super(SqlTriggerGetResults, self).__init__(**kwargs) + self.resource = kwargs.get('resource', None) + + class SqlTriggerResource(Model): """Cosmos DB SQL trigger resource object. @@ -3473,14 +3745,58 @@ def __init__(self, **kwargs): self.options = kwargs.get('options', None) -class SqlUserDefinedFunctionGetResults(ARMResourceProperties): - """An Azure Cosmos DB userDefinedFunction. +class SqlUserDefinedFunctionGetPropertiesResource(Model): + """SqlUserDefinedFunctionGetPropertiesResource. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. + :param id: Required. Name of the Cosmos DB SQL userDefinedFunction + :type id: str + :param body: Body of the User Defined Function + :type body: str + :ivar _rid: A system generated property. A unique identifier. + :vartype _rid: str + :ivar _ts: A system generated property that denotes the last updated + timestamp of the resource. + :vartype _ts: object + :ivar _etag: A system generated property representing the resource etag + required for optimistic concurrency control. + :vartype _etag: str + """ + + _validation = { + 'id': {'required': True}, + '_rid': {'readonly': True}, + '_ts': {'readonly': True}, + '_etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'body': {'key': 'body', 'type': 'str'}, + '_rid': {'key': '_rid', 'type': 'str'}, + '_ts': {'key': '_ts', 'type': 'object'}, + '_etag': {'key': '_etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SqlUserDefinedFunctionGetPropertiesResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.body = kwargs.get('body', None) + self._rid = None + self._ts = None + self._etag = None + + +class SqlUserDefinedFunctionGetResults(ARMResourceProperties): + """An Azure Cosmos DB userDefinedFunction. + + Variables are only populated by the server, and will be ignored when + sending a request. + :ivar id: The unique resource identifier of the ARM resource. :vartype id: str :ivar name: The name of the ARM resource. @@ -3492,29 +3808,15 @@ class SqlUserDefinedFunctionGetResults(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param sql_user_defined_function_get_results_id: Required. Name of the - Cosmos DB SQL userDefinedFunction - :type sql_user_defined_function_get_results_id: str - :param body: Body of the User Defined Function - :type body: str - :ivar _rid: A system generated property. A unique identifier. - :vartype _rid: str - :ivar _ts: A system generated property that denotes the last updated - timestamp of the resource. - :vartype _ts: object - :ivar _etag: A system generated property representing the resource etag - required for optimistic concurrency control. - :vartype _etag: str + :param resource: + :type resource: + ~azure.mgmt.cosmosdb.models.SqlUserDefinedFunctionGetPropertiesResource """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'sql_user_defined_function_get_results_id': {'required': True}, - '_rid': {'readonly': True}, - '_ts': {'readonly': True}, - '_etag': {'readonly': True}, } _attribute_map = { @@ -3523,20 +3825,12 @@ class SqlUserDefinedFunctionGetResults(ARMResourceProperties): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'sql_user_defined_function_get_results_id': {'key': 'properties.id', 'type': 'str'}, - 'body': {'key': 'properties.body', 'type': 'str'}, - '_rid': {'key': 'properties._rid', 'type': 'str'}, - '_ts': {'key': 'properties._ts', 'type': 'object'}, - '_etag': {'key': 'properties._etag', 'type': 'str'}, + 'resource': {'key': 'properties.resource', 'type': 'SqlUserDefinedFunctionGetPropertiesResource'}, } def __init__(self, **kwargs): super(SqlUserDefinedFunctionGetResults, self).__init__(**kwargs) - self.sql_user_defined_function_get_results_id = kwargs.get('sql_user_defined_function_get_results_id', None) - self.body = kwargs.get('body', None) - self._rid = None - self._ts = None - self._etag = None + self.resource = kwargs.get('resource', None) class SqlUserDefinedFunctionResource(Model): @@ -3615,14 +3909,54 @@ def __init__(self, **kwargs): self.options = kwargs.get('options', None) -class TableGetResults(ARMResourceProperties): - """An Azure Cosmos DB Table. +class TableGetPropertiesResource(Model): + """TableGetPropertiesResource. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. + :param id: Required. Name of the Cosmos DB table + :type id: str + :ivar _rid: A system generated property. A unique identifier. + :vartype _rid: str + :ivar _ts: A system generated property that denotes the last updated + timestamp of the resource. + :vartype _ts: object + :ivar _etag: A system generated property representing the resource etag + required for optimistic concurrency control. + :vartype _etag: str + """ + + _validation = { + 'id': {'required': True}, + '_rid': {'readonly': True}, + '_ts': {'readonly': True}, + '_etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + '_rid': {'key': '_rid', 'type': 'str'}, + '_ts': {'key': '_ts', 'type': 'object'}, + '_etag': {'key': '_etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TableGetPropertiesResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self._rid = None + self._ts = None + self._etag = None + + +class TableGetResults(ARMResourceProperties): + """An Azure Cosmos DB Table. + + Variables are only populated by the server, and will be ignored when + sending a request. + :ivar id: The unique resource identifier of the ARM resource. :vartype id: str :ivar name: The name of the ARM resource. @@ -3634,26 +3968,14 @@ class TableGetResults(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param table_get_results_id: Required. Name of the Cosmos DB table - :type table_get_results_id: str - :ivar _rid: A system generated property. A unique identifier. - :vartype _rid: str - :ivar _ts: A system generated property that denotes the last updated - timestamp of the resource. - :vartype _ts: object - :ivar _etag: A system generated property representing the resource etag - required for optimistic concurrency control. - :vartype _etag: str + :param resource: + :type resource: ~azure.mgmt.cosmosdb.models.TableGetPropertiesResource """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'table_get_results_id': {'required': True}, - '_rid': {'readonly': True}, - '_ts': {'readonly': True}, - '_etag': {'readonly': True}, } _attribute_map = { @@ -3662,18 +3984,12 @@ class TableGetResults(ARMResourceProperties): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'table_get_results_id': {'key': 'properties.id', 'type': 'str'}, - '_rid': {'key': 'properties._rid', 'type': 'str'}, - '_ts': {'key': 'properties._ts', 'type': 'object'}, - '_etag': {'key': 'properties._etag', 'type': 'str'}, + 'resource': {'key': 'properties.resource', 'type': 'TableGetPropertiesResource'}, } def __init__(self, **kwargs): super(TableGetResults, self).__init__(**kwargs) - self.table_get_results_id = kwargs.get('table_get_results_id', None) - self._rid = None - self._ts = None - self._etag = None + self.resource = kwargs.get('resource', None) class TableResource(Model): diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_models_py3.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_models_py3.py index 901e45c34a6f..84b90c1278af 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_models_py3.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_models_py3.py @@ -231,14 +231,54 @@ def __init__(self, *, resource, options, location: str=None, tags=None, **kwargs self.options = options -class CassandraKeyspaceGetResults(ARMResourceProperties): - """An Azure Cosmos DB Cassandra keyspace. +class CassandraKeyspaceGetPropertiesResource(Model): + """CassandraKeyspaceGetPropertiesResource. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. + :param id: Required. Name of the Cosmos DB Cassandra keyspace + :type id: str + :ivar _rid: A system generated property. A unique identifier. + :vartype _rid: str + :ivar _ts: A system generated property that denotes the last updated + timestamp of the resource. + :vartype _ts: object + :ivar _etag: A system generated property representing the resource etag + required for optimistic concurrency control. + :vartype _etag: str + """ + + _validation = { + 'id': {'required': True}, + '_rid': {'readonly': True}, + '_ts': {'readonly': True}, + '_etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + '_rid': {'key': '_rid', 'type': 'str'}, + '_ts': {'key': '_ts', 'type': 'object'}, + '_etag': {'key': '_etag', 'type': 'str'}, + } + + def __init__(self, *, id: str, **kwargs) -> None: + super(CassandraKeyspaceGetPropertiesResource, self).__init__(**kwargs) + self.id = id + self._rid = None + self._ts = None + self._etag = None + + +class CassandraKeyspaceGetResults(ARMResourceProperties): + """An Azure Cosmos DB Cassandra keyspace. + + Variables are only populated by the server, and will be ignored when + sending a request. + :ivar id: The unique resource identifier of the ARM resource. :vartype id: str :ivar name: The name of the ARM resource. @@ -250,27 +290,15 @@ class CassandraKeyspaceGetResults(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param cassandra_keyspace_get_results_id: Required. Name of the Cosmos DB - Cassandra keyspace - :type cassandra_keyspace_get_results_id: str - :ivar _rid: A system generated property. A unique identifier. - :vartype _rid: str - :ivar _ts: A system generated property that denotes the last updated - timestamp of the resource. - :vartype _ts: object - :ivar _etag: A system generated property representing the resource etag - required for optimistic concurrency control. - :vartype _etag: str + :param resource: + :type resource: + ~azure.mgmt.cosmosdb.models.CassandraKeyspaceGetPropertiesResource """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'cassandra_keyspace_get_results_id': {'required': True}, - '_rid': {'readonly': True}, - '_ts': {'readonly': True}, - '_etag': {'readonly': True}, } _attribute_map = { @@ -279,18 +307,12 @@ class CassandraKeyspaceGetResults(ARMResourceProperties): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'cassandra_keyspace_get_results_id': {'key': 'properties.id', 'type': 'str'}, - '_rid': {'key': 'properties._rid', 'type': 'str'}, - '_ts': {'key': 'properties._ts', 'type': 'object'}, - '_etag': {'key': 'properties._etag', 'type': 'str'}, + 'resource': {'key': 'properties.resource', 'type': 'CassandraKeyspaceGetPropertiesResource'}, } - def __init__(self, *, cassandra_keyspace_get_results_id: str, location: str=None, tags=None, **kwargs) -> None: + def __init__(self, *, location: str=None, tags=None, resource=None, **kwargs) -> None: super(CassandraKeyspaceGetResults, self).__init__(location=location, tags=tags, **kwargs) - self.cassandra_keyspace_get_results_id = cassandra_keyspace_get_results_id - self._rid = None - self._ts = None - self._etag = None + self.resource = resource class CassandraKeyspaceResource(Model): @@ -406,28 +428,16 @@ def __init__(self, *, resource, options, location: str=None, tags=None, **kwargs self.options = options -class CassandraTableGetResults(ARMResourceProperties): - """An Azure Cosmos DB Cassandra table. +class CassandraTableGetPropertiesResource(Model): + """CassandraTableGetPropertiesResource. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :ivar id: The unique resource identifier of the ARM resource. - :vartype id: str - :ivar name: The name of the ARM resource. - :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :param location: The location of the resource group to which the resource - belongs. - :type location: str - :param tags: - :type tags: dict[str, str] - :param cassandra_table_get_results_id: Required. Name of the Cosmos DB - Cassandra table - :type cassandra_table_get_results_id: str + :param id: Required. Name of the Cosmos DB Cassandra table + :type id: str :param default_ttl: Time to live of the Cosmos DB Cassandra table :type default_ttl: int :param schema: Schema of the Cosmos DB Cassandra table @@ -443,10 +453,7 @@ class CassandraTableGetResults(ARMResourceProperties): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'cassandra_table_get_results_id': {'required': True}, + 'id': {'required': True}, '_rid': {'readonly': True}, '_ts': {'readonly': True}, '_etag': {'readonly': True}, @@ -454,21 +461,16 @@ class CassandraTableGetResults(ARMResourceProperties): _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'cassandra_table_get_results_id': {'key': 'properties.id', 'type': 'str'}, - 'default_ttl': {'key': 'properties.defaultTtl', 'type': 'int'}, - 'schema': {'key': 'properties.schema', 'type': 'CassandraSchema'}, - '_rid': {'key': 'properties._rid', 'type': 'str'}, - '_ts': {'key': 'properties._ts', 'type': 'object'}, - '_etag': {'key': 'properties._etag', 'type': 'str'}, + 'default_ttl': {'key': 'defaultTtl', 'type': 'int'}, + 'schema': {'key': 'schema', 'type': 'CassandraSchema'}, + '_rid': {'key': '_rid', 'type': 'str'}, + '_ts': {'key': '_ts', 'type': 'object'}, + '_etag': {'key': '_etag', 'type': 'str'}, } - def __init__(self, *, cassandra_table_get_results_id: str, location: str=None, tags=None, default_ttl: int=None, schema=None, **kwargs) -> None: - super(CassandraTableGetResults, self).__init__(location=location, tags=tags, **kwargs) - self.cassandra_table_get_results_id = cassandra_table_get_results_id + def __init__(self, *, id: str, default_ttl: int=None, schema=None, **kwargs) -> None: + super(CassandraTableGetPropertiesResource, self).__init__(**kwargs) + self.id = id self.default_ttl = default_ttl self.schema = schema self._rid = None @@ -476,6 +478,48 @@ def __init__(self, *, cassandra_table_get_results_id: str, location: str=None, t self._etag = None +class CassandraTableGetResults(ARMResourceProperties): + """An Azure Cosmos DB Cassandra table. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The unique resource identifier of the ARM resource. + :vartype id: str + :ivar name: The name of the ARM resource. + :vartype name: str + :ivar type: The type of Azure resource. + :vartype type: str + :param location: The location of the resource group to which the resource + belongs. + :type location: str + :param tags: + :type tags: dict[str, str] + :param resource: + :type resource: + ~azure.mgmt.cosmosdb.models.CassandraTableGetPropertiesResource + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'resource': {'key': 'properties.resource', 'type': 'CassandraTableGetPropertiesResource'}, + } + + def __init__(self, *, location: str=None, tags=None, resource=None, **kwargs) -> None: + super(CassandraTableGetResults, self).__init__(location=location, tags=tags, **kwargs) + self.resource = resource + + class CassandraTableResource(Model): """Cosmos DB Cassandra table resource object. @@ -555,6 +599,28 @@ def __init__(self, *, name: str=None, type: str=None, **kwargs) -> None: self.type = type +class CompositePath(Model): + """CompositePath. + + :param path: The path for which the indexing behavior applies to. Index + paths typically start with root and end with wildcard (/path/*) + :type path: str + :param order: Sort order for composite paths. Possible values include: + 'Ascending', 'Descending' + :type order: str or ~azure.mgmt.cosmosdb.models.CompositePathSortOrder + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'order': {'key': 'order', 'type': 'str'}, + } + + def __init__(self, *, path: str=None, order=None, **kwargs) -> None: + super(CompositePath, self).__init__(**kwargs) + self.path = path + self.order = order + + class ConflictResolutionPolicy(Model): """The conflict resolution policy for the container. @@ -1320,14 +1386,54 @@ def __init__(self, *, resource, options, location: str=None, tags=None, **kwargs self.options = options -class GremlinDatabaseGetResults(ARMResourceProperties): - """An Azure Cosmos DB Gremlin database. +class GremlinDatabaseGetPropertiesResource(Model): + """GremlinDatabaseGetPropertiesResource. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. + :param id: Required. Name of the Cosmos DB Gremlin database + :type id: str + :ivar _rid: A system generated property. A unique identifier. + :vartype _rid: str + :ivar _ts: A system generated property that denotes the last updated + timestamp of the resource. + :vartype _ts: object + :ivar _etag: A system generated property representing the resource etag + required for optimistic concurrency control. + :vartype _etag: str + """ + + _validation = { + 'id': {'required': True}, + '_rid': {'readonly': True}, + '_ts': {'readonly': True}, + '_etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + '_rid': {'key': '_rid', 'type': 'str'}, + '_ts': {'key': '_ts', 'type': 'object'}, + '_etag': {'key': '_etag', 'type': 'str'}, + } + + def __init__(self, *, id: str, **kwargs) -> None: + super(GremlinDatabaseGetPropertiesResource, self).__init__(**kwargs) + self.id = id + self._rid = None + self._ts = None + self._etag = None + + +class GremlinDatabaseGetResults(ARMResourceProperties): + """An Azure Cosmos DB Gremlin database. + + Variables are only populated by the server, and will be ignored when + sending a request. + :ivar id: The unique resource identifier of the ARM resource. :vartype id: str :ivar name: The name of the ARM resource. @@ -1339,27 +1445,15 @@ class GremlinDatabaseGetResults(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param gremlin_database_get_results_id: Required. Name of the Cosmos DB - Gremlin database - :type gremlin_database_get_results_id: str - :ivar _rid: A system generated property. A unique identifier. - :vartype _rid: str - :ivar _ts: A system generated property that denotes the last updated - timestamp of the resource. - :vartype _ts: object - :ivar _etag: A system generated property representing the resource etag - required for optimistic concurrency control. - :vartype _etag: str + :param resource: + :type resource: + ~azure.mgmt.cosmosdb.models.GremlinDatabaseGetPropertiesResource """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'gremlin_database_get_results_id': {'required': True}, - '_rid': {'readonly': True}, - '_ts': {'readonly': True}, - '_etag': {'readonly': True}, } _attribute_map = { @@ -1368,18 +1462,12 @@ class GremlinDatabaseGetResults(ARMResourceProperties): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'gremlin_database_get_results_id': {'key': 'properties.id', 'type': 'str'}, - '_rid': {'key': 'properties._rid', 'type': 'str'}, - '_ts': {'key': 'properties._ts', 'type': 'object'}, - '_etag': {'key': 'properties._etag', 'type': 'str'}, + 'resource': {'key': 'properties.resource', 'type': 'GremlinDatabaseGetPropertiesResource'}, } - def __init__(self, *, gremlin_database_get_results_id: str, location: str=None, tags=None, **kwargs) -> None: + def __init__(self, *, location: str=None, tags=None, resource=None, **kwargs) -> None: super(GremlinDatabaseGetResults, self).__init__(location=location, tags=tags, **kwargs) - self.gremlin_database_get_results_id = gremlin_database_get_results_id - self._rid = None - self._ts = None - self._etag = None + self.resource = resource class GremlinDatabaseResource(Model): @@ -1454,28 +1542,16 @@ def __init__(self, *, resource, options, location: str=None, tags=None, **kwargs self.options = options -class GremlinGraphGetResults(ARMResourceProperties): - """An Azure Cosmos DB Gremlin graph. +class GremlinGraphGetPropertiesResource(Model): + """GremlinGraphGetPropertiesResource. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :ivar id: The unique resource identifier of the ARM resource. - :vartype id: str - :ivar name: The name of the ARM resource. - :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :param location: The location of the resource group to which the resource - belongs. - :type location: str - :param tags: - :type tags: dict[str, str] - :param gremlin_graph_get_results_id: Required. Name of the Cosmos DB - Gremlin graph - :type gremlin_graph_get_results_id: str + :param id: Required. Name of the Cosmos DB Gremlin graph + :type id: str :param indexing_policy: The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the graph :type indexing_policy: ~azure.mgmt.cosmosdb.models.IndexingPolicy @@ -1503,10 +1579,7 @@ class GremlinGraphGetResults(ARMResourceProperties): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'gremlin_graph_get_results_id': {'required': True}, + 'id': {'required': True}, '_rid': {'readonly': True}, '_ts': {'readonly': True}, '_etag': {'readonly': True}, @@ -1514,24 +1587,19 @@ class GremlinGraphGetResults(ARMResourceProperties): _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'gremlin_graph_get_results_id': {'key': 'properties.id', 'type': 'str'}, - 'indexing_policy': {'key': 'properties.indexingPolicy', 'type': 'IndexingPolicy'}, - 'partition_key': {'key': 'properties.partitionKey', 'type': 'ContainerPartitionKey'}, - 'default_ttl': {'key': 'properties.defaultTtl', 'type': 'int'}, - 'unique_key_policy': {'key': 'properties.uniqueKeyPolicy', 'type': 'UniqueKeyPolicy'}, - 'conflict_resolution_policy': {'key': 'properties.conflictResolutionPolicy', 'type': 'ConflictResolutionPolicy'}, - '_rid': {'key': 'properties._rid', 'type': 'str'}, - '_ts': {'key': 'properties._ts', 'type': 'object'}, - '_etag': {'key': 'properties._etag', 'type': 'str'}, - } - - def __init__(self, *, gremlin_graph_get_results_id: str, location: str=None, tags=None, indexing_policy=None, partition_key=None, default_ttl: int=None, unique_key_policy=None, conflict_resolution_policy=None, **kwargs) -> None: - super(GremlinGraphGetResults, self).__init__(location=location, tags=tags, **kwargs) - self.gremlin_graph_get_results_id = gremlin_graph_get_results_id + 'indexing_policy': {'key': 'indexingPolicy', 'type': 'IndexingPolicy'}, + 'partition_key': {'key': 'partitionKey', 'type': 'ContainerPartitionKey'}, + 'default_ttl': {'key': 'defaultTtl', 'type': 'int'}, + 'unique_key_policy': {'key': 'uniqueKeyPolicy', 'type': 'UniqueKeyPolicy'}, + 'conflict_resolution_policy': {'key': 'conflictResolutionPolicy', 'type': 'ConflictResolutionPolicy'}, + '_rid': {'key': '_rid', 'type': 'str'}, + '_ts': {'key': '_ts', 'type': 'object'}, + '_etag': {'key': '_etag', 'type': 'str'}, + } + + def __init__(self, *, id: str, indexing_policy=None, partition_key=None, default_ttl: int=None, unique_key_policy=None, conflict_resolution_policy=None, **kwargs) -> None: + super(GremlinGraphGetPropertiesResource, self).__init__(**kwargs) + self.id = id self.indexing_policy = indexing_policy self.partition_key = partition_key self.default_ttl = default_ttl @@ -1542,30 +1610,72 @@ def __init__(self, *, gremlin_graph_get_results_id: str, location: str=None, tag self._etag = None -class GremlinGraphResource(Model): - """Cosmos DB Gremlin graph resource object. - - All required parameters must be populated in order to send to Azure. +class GremlinGraphGetResults(ARMResourceProperties): + """An Azure Cosmos DB Gremlin graph. - :param id: Required. Name of the Cosmos DB Gremlin graph - :type id: str - :param indexing_policy: The configuration of the indexing policy. By - default, the indexing is automatic for all document paths within the graph - :type indexing_policy: ~azure.mgmt.cosmosdb.models.IndexingPolicy - :param partition_key: The configuration of the partition key to be used - for partitioning data into multiple partitions - :type partition_key: ~azure.mgmt.cosmosdb.models.ContainerPartitionKey - :param default_ttl: Default time to live - :type default_ttl: int - :param unique_key_policy: The unique key policy configuration for - specifying uniqueness constraints on documents in the collection in the - Azure Cosmos DB service. - :type unique_key_policy: ~azure.mgmt.cosmosdb.models.UniqueKeyPolicy - :param conflict_resolution_policy: The conflict resolution policy for the - graph. - :type conflict_resolution_policy: - ~azure.mgmt.cosmosdb.models.ConflictResolutionPolicy - """ + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The unique resource identifier of the ARM resource. + :vartype id: str + :ivar name: The name of the ARM resource. + :vartype name: str + :ivar type: The type of Azure resource. + :vartype type: str + :param location: The location of the resource group to which the resource + belongs. + :type location: str + :param tags: + :type tags: dict[str, str] + :param resource: + :type resource: + ~azure.mgmt.cosmosdb.models.GremlinGraphGetPropertiesResource + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'resource': {'key': 'properties.resource', 'type': 'GremlinGraphGetPropertiesResource'}, + } + + def __init__(self, *, location: str=None, tags=None, resource=None, **kwargs) -> None: + super(GremlinGraphGetResults, self).__init__(location=location, tags=tags, **kwargs) + self.resource = resource + + +class GremlinGraphResource(Model): + """Cosmos DB Gremlin graph resource object. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Name of the Cosmos DB Gremlin graph + :type id: str + :param indexing_policy: The configuration of the indexing policy. By + default, the indexing is automatic for all document paths within the graph + :type indexing_policy: ~azure.mgmt.cosmosdb.models.IndexingPolicy + :param partition_key: The configuration of the partition key to be used + for partitioning data into multiple partitions + :type partition_key: ~azure.mgmt.cosmosdb.models.ContainerPartitionKey + :param default_ttl: Default time to live + :type default_ttl: int + :param unique_key_policy: The unique key policy configuration for + specifying uniqueness constraints on documents in the collection in the + Azure Cosmos DB service. + :type unique_key_policy: ~azure.mgmt.cosmosdb.models.UniqueKeyPolicy + :param conflict_resolution_policy: The conflict resolution policy for the + graph. + :type conflict_resolution_policy: + ~azure.mgmt.cosmosdb.models.ConflictResolutionPolicy + """ _validation = { 'id': {'required': True}, @@ -1650,6 +1760,11 @@ class IndexingPolicy(Model): :type included_paths: list[~azure.mgmt.cosmosdb.models.IncludedPath] :param excluded_paths: List of paths to exclude from indexing :type excluded_paths: list[~azure.mgmt.cosmosdb.models.ExcludedPath] + :param composite_indexes: List of composite path list + :type composite_indexes: + list[list[~azure.mgmt.cosmosdb.models.CompositePath]] + :param spatial_indexes: List of spatial specifics + :type spatial_indexes: list[~azure.mgmt.cosmosdb.models.SpatialSpec] """ _attribute_map = { @@ -1657,14 +1772,18 @@ class IndexingPolicy(Model): 'indexing_mode': {'key': 'indexingMode', 'type': 'str'}, 'included_paths': {'key': 'includedPaths', 'type': '[IncludedPath]'}, 'excluded_paths': {'key': 'excludedPaths', 'type': '[ExcludedPath]'}, + 'composite_indexes': {'key': 'compositeIndexes', 'type': '[[CompositePath]]'}, + 'spatial_indexes': {'key': 'spatialIndexes', 'type': '[SpatialSpec]'}, } - def __init__(self, *, automatic: bool=None, indexing_mode="Consistent", included_paths=None, excluded_paths=None, **kwargs) -> None: + def __init__(self, *, automatic: bool=None, indexing_mode="Consistent", included_paths=None, excluded_paths=None, composite_indexes=None, spatial_indexes=None, **kwargs) -> None: super(IndexingPolicy, self).__init__(**kwargs) self.automatic = automatic self.indexing_mode = indexing_mode self.included_paths = included_paths self.excluded_paths = excluded_paths + self.composite_indexes = composite_indexes + self.spatial_indexes = spatial_indexes class Location(Model): @@ -1975,28 +2094,16 @@ def __init__(self, *, resource, options, location: str=None, tags=None, **kwargs self.options = options -class MongoDBCollectionGetResults(ARMResourceProperties): - """An Azure Cosmos DB MongoDB collection. +class MongoDBCollectionGetPropertiesResource(Model): + """MongoDBCollectionGetPropertiesResource. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :ivar id: The unique resource identifier of the ARM resource. - :vartype id: str - :ivar name: The name of the ARM resource. - :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :param location: The location of the resource group to which the resource - belongs. - :type location: str - :param tags: - :type tags: dict[str, str] - :param mongo_db_collection_get_results_id: Required. Name of the Cosmos DB - MongoDB collection - :type mongo_db_collection_get_results_id: str + :param id: Required. Name of the Cosmos DB MongoDB collection + :type id: str :param shard_key: A key-value pair of shard keys to be applied for the request. :type shard_key: dict[str, str] @@ -2013,10 +2120,7 @@ class MongoDBCollectionGetResults(ARMResourceProperties): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'mongo_db_collection_get_results_id': {'required': True}, + 'id': {'required': True}, '_rid': {'readonly': True}, '_ts': {'readonly': True}, '_etag': {'readonly': True}, @@ -2024,21 +2128,16 @@ class MongoDBCollectionGetResults(ARMResourceProperties): _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'mongo_db_collection_get_results_id': {'key': 'properties.id', 'type': 'str'}, - 'shard_key': {'key': 'properties.shardKey', 'type': '{str}'}, - 'indexes': {'key': 'properties.indexes', 'type': '[MongoIndex]'}, - '_rid': {'key': 'properties._rid', 'type': 'str'}, - '_ts': {'key': 'properties._ts', 'type': 'object'}, - '_etag': {'key': 'properties._etag', 'type': 'str'}, + 'shard_key': {'key': 'shardKey', 'type': '{str}'}, + 'indexes': {'key': 'indexes', 'type': '[MongoIndex]'}, + '_rid': {'key': '_rid', 'type': 'str'}, + '_ts': {'key': '_ts', 'type': 'object'}, + '_etag': {'key': '_etag', 'type': 'str'}, } - def __init__(self, *, mongo_db_collection_get_results_id: str, location: str=None, tags=None, shard_key=None, indexes=None, **kwargs) -> None: - super(MongoDBCollectionGetResults, self).__init__(location=location, tags=tags, **kwargs) - self.mongo_db_collection_get_results_id = mongo_db_collection_get_results_id + def __init__(self, *, id: str, shard_key=None, indexes=None, **kwargs) -> None: + super(MongoDBCollectionGetPropertiesResource, self).__init__(**kwargs) + self.id = id self.shard_key = shard_key self.indexes = indexes self._rid = None @@ -2046,6 +2145,48 @@ def __init__(self, *, mongo_db_collection_get_results_id: str, location: str=Non self._etag = None +class MongoDBCollectionGetResults(ARMResourceProperties): + """An Azure Cosmos DB MongoDB collection. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The unique resource identifier of the ARM resource. + :vartype id: str + :ivar name: The name of the ARM resource. + :vartype name: str + :ivar type: The type of Azure resource. + :vartype type: str + :param location: The location of the resource group to which the resource + belongs. + :type location: str + :param tags: + :type tags: dict[str, str] + :param resource: + :type resource: + ~azure.mgmt.cosmosdb.models.MongoDBCollectionGetPropertiesResource + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'resource': {'key': 'properties.resource', 'type': 'MongoDBCollectionGetPropertiesResource'}, + } + + def __init__(self, *, location: str=None, tags=None, resource=None, **kwargs) -> None: + super(MongoDBCollectionGetResults, self).__init__(location=location, tags=tags, **kwargs) + self.resource = resource + + class MongoDBCollectionResource(Model): """Cosmos DB MongoDB collection resource object. @@ -2127,14 +2268,54 @@ def __init__(self, *, resource, options, location: str=None, tags=None, **kwargs self.options = options -class MongoDBDatabaseGetResults(ARMResourceProperties): - """An Azure Cosmos DB MongoDB database. +class MongoDBDatabaseGetPropertiesResource(Model): + """MongoDBDatabaseGetPropertiesResource. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. + :param id: Required. Name of the Cosmos DB MongoDB database + :type id: str + :ivar _rid: A system generated property. A unique identifier. + :vartype _rid: str + :ivar _ts: A system generated property that denotes the last updated + timestamp of the resource. + :vartype _ts: object + :ivar _etag: A system generated property representing the resource etag + required for optimistic concurrency control. + :vartype _etag: str + """ + + _validation = { + 'id': {'required': True}, + '_rid': {'readonly': True}, + '_ts': {'readonly': True}, + '_etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + '_rid': {'key': '_rid', 'type': 'str'}, + '_ts': {'key': '_ts', 'type': 'object'}, + '_etag': {'key': '_etag', 'type': 'str'}, + } + + def __init__(self, *, id: str, **kwargs) -> None: + super(MongoDBDatabaseGetPropertiesResource, self).__init__(**kwargs) + self.id = id + self._rid = None + self._ts = None + self._etag = None + + +class MongoDBDatabaseGetResults(ARMResourceProperties): + """An Azure Cosmos DB MongoDB database. + + Variables are only populated by the server, and will be ignored when + sending a request. + :ivar id: The unique resource identifier of the ARM resource. :vartype id: str :ivar name: The name of the ARM resource. @@ -2146,27 +2327,15 @@ class MongoDBDatabaseGetResults(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param mongo_db_database_get_results_id: Required. Name of the Cosmos DB - MongoDB database - :type mongo_db_database_get_results_id: str - :ivar _rid: A system generated property. A unique identifier. - :vartype _rid: str - :ivar _ts: A system generated property that denotes the last updated - timestamp of the resource. - :vartype _ts: object - :ivar _etag: A system generated property representing the resource etag - required for optimistic concurrency control. - :vartype _etag: str + :param resource: + :type resource: + ~azure.mgmt.cosmosdb.models.MongoDBDatabaseGetPropertiesResource """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'mongo_db_database_get_results_id': {'required': True}, - '_rid': {'readonly': True}, - '_ts': {'readonly': True}, - '_etag': {'readonly': True}, } _attribute_map = { @@ -2175,18 +2344,12 @@ class MongoDBDatabaseGetResults(ARMResourceProperties): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'mongo_db_database_get_results_id': {'key': 'properties.id', 'type': 'str'}, - '_rid': {'key': 'properties._rid', 'type': 'str'}, - '_ts': {'key': 'properties._ts', 'type': 'object'}, - '_etag': {'key': 'properties._etag', 'type': 'str'}, + 'resource': {'key': 'properties.resource', 'type': 'MongoDBDatabaseGetPropertiesResource'}, } - def __init__(self, *, mongo_db_database_get_results_id: str, location: str=None, tags=None, **kwargs) -> None: + def __init__(self, *, location: str=None, tags=None, resource=None, **kwargs) -> None: super(MongoDBDatabaseGetResults, self).__init__(location=location, tags=tags, **kwargs) - self.mongo_db_database_get_results_id = mongo_db_database_get_results_id - self._rid = None - self._ts = None - self._etag = None + self.resource = resource class MongoDBDatabaseResource(Model): @@ -2784,6 +2947,27 @@ def __init__(self, *, region: str, **kwargs) -> None: self.region = region +class SpatialSpec(Model): + """SpatialSpec. + + :param path: The path for which the indexing behavior applies to. Index + paths typically start with root and end with wildcard (/path/*) + :type path: str + :param types: List of path's spatial type + :type types: list[str or ~azure.mgmt.cosmosdb.models.SpatialType] + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'types': {'key': 'types', 'type': '[str]'}, + } + + def __init__(self, *, path: str=None, types=None, **kwargs) -> None: + super(SpatialSpec, self).__init__(**kwargs) + self.path = path + self.types = types + + class SqlContainerCreateUpdateParameters(ARMResourceProperties): """Parameters to create and update Cosmos DB container. @@ -2834,28 +3018,16 @@ def __init__(self, *, resource, options, location: str=None, tags=None, **kwargs self.options = options -class SqlContainerGetResults(ARMResourceProperties): - """An Azure Cosmos DB container. +class SqlContainerGetPropertiesResource(Model): + """SqlContainerGetPropertiesResource. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :ivar id: The unique resource identifier of the ARM resource. - :vartype id: str - :ivar name: The name of the ARM resource. - :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :param location: The location of the resource group to which the resource - belongs. - :type location: str - :param tags: - :type tags: dict[str, str] - :param sql_container_get_results_id: Required. Name of the Cosmos DB SQL - container - :type sql_container_get_results_id: str + :param id: Required. Name of the Cosmos DB SQL container + :type id: str :param indexing_policy: The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the container @@ -2884,10 +3056,7 @@ class SqlContainerGetResults(ARMResourceProperties): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'sql_container_get_results_id': {'required': True}, + 'id': {'required': True}, '_rid': {'readonly': True}, '_ts': {'readonly': True}, '_etag': {'readonly': True}, @@ -2895,24 +3064,19 @@ class SqlContainerGetResults(ARMResourceProperties): _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sql_container_get_results_id': {'key': 'properties.id', 'type': 'str'}, - 'indexing_policy': {'key': 'properties.indexingPolicy', 'type': 'IndexingPolicy'}, - 'partition_key': {'key': 'properties.partitionKey', 'type': 'ContainerPartitionKey'}, - 'default_ttl': {'key': 'properties.defaultTtl', 'type': 'int'}, - 'unique_key_policy': {'key': 'properties.uniqueKeyPolicy', 'type': 'UniqueKeyPolicy'}, - 'conflict_resolution_policy': {'key': 'properties.conflictResolutionPolicy', 'type': 'ConflictResolutionPolicy'}, - '_rid': {'key': 'properties._rid', 'type': 'str'}, - '_ts': {'key': 'properties._ts', 'type': 'object'}, - '_etag': {'key': 'properties._etag', 'type': 'str'}, - } - - def __init__(self, *, sql_container_get_results_id: str, location: str=None, tags=None, indexing_policy=None, partition_key=None, default_ttl: int=None, unique_key_policy=None, conflict_resolution_policy=None, **kwargs) -> None: - super(SqlContainerGetResults, self).__init__(location=location, tags=tags, **kwargs) - self.sql_container_get_results_id = sql_container_get_results_id + 'indexing_policy': {'key': 'indexingPolicy', 'type': 'IndexingPolicy'}, + 'partition_key': {'key': 'partitionKey', 'type': 'ContainerPartitionKey'}, + 'default_ttl': {'key': 'defaultTtl', 'type': 'int'}, + 'unique_key_policy': {'key': 'uniqueKeyPolicy', 'type': 'UniqueKeyPolicy'}, + 'conflict_resolution_policy': {'key': 'conflictResolutionPolicy', 'type': 'ConflictResolutionPolicy'}, + '_rid': {'key': '_rid', 'type': 'str'}, + '_ts': {'key': '_ts', 'type': 'object'}, + '_etag': {'key': '_etag', 'type': 'str'}, + } + + def __init__(self, *, id: str, indexing_policy=None, partition_key=None, default_ttl: int=None, unique_key_policy=None, conflict_resolution_policy=None, **kwargs) -> None: + super(SqlContainerGetPropertiesResource, self).__init__(**kwargs) + self.id = id self.indexing_policy = indexing_policy self.partition_key = partition_key self.default_ttl = default_ttl @@ -2923,30 +3087,72 @@ def __init__(self, *, sql_container_get_results_id: str, location: str=None, tag self._etag = None -class SqlContainerResource(Model): - """Cosmos DB SQL container resource object. +class SqlContainerGetResults(ARMResourceProperties): + """An Azure Cosmos DB container. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when + sending a request. - :param id: Required. Name of the Cosmos DB SQL container - :type id: str - :param indexing_policy: The configuration of the indexing policy. By - default, the indexing is automatic for all document paths within the - container - :type indexing_policy: ~azure.mgmt.cosmosdb.models.IndexingPolicy - :param partition_key: The configuration of the partition key to be used - for partitioning data into multiple partitions - :type partition_key: ~azure.mgmt.cosmosdb.models.ContainerPartitionKey - :param default_ttl: Default time to live - :type default_ttl: int - :param unique_key_policy: The unique key policy configuration for - specifying uniqueness constraints on documents in the collection in the - Azure Cosmos DB service. - :type unique_key_policy: ~azure.mgmt.cosmosdb.models.UniqueKeyPolicy - :param conflict_resolution_policy: The conflict resolution policy for the - container. - :type conflict_resolution_policy: - ~azure.mgmt.cosmosdb.models.ConflictResolutionPolicy + :ivar id: The unique resource identifier of the ARM resource. + :vartype id: str + :ivar name: The name of the ARM resource. + :vartype name: str + :ivar type: The type of Azure resource. + :vartype type: str + :param location: The location of the resource group to which the resource + belongs. + :type location: str + :param tags: + :type tags: dict[str, str] + :param resource: + :type resource: + ~azure.mgmt.cosmosdb.models.SqlContainerGetPropertiesResource + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'resource': {'key': 'properties.resource', 'type': 'SqlContainerGetPropertiesResource'}, + } + + def __init__(self, *, location: str=None, tags=None, resource=None, **kwargs) -> None: + super(SqlContainerGetResults, self).__init__(location=location, tags=tags, **kwargs) + self.resource = resource + + +class SqlContainerResource(Model): + """Cosmos DB SQL container resource object. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Name of the Cosmos DB SQL container + :type id: str + :param indexing_policy: The configuration of the indexing policy. By + default, the indexing is automatic for all document paths within the + container + :type indexing_policy: ~azure.mgmt.cosmosdb.models.IndexingPolicy + :param partition_key: The configuration of the partition key to be used + for partitioning data into multiple partitions + :type partition_key: ~azure.mgmt.cosmosdb.models.ContainerPartitionKey + :param default_ttl: Default time to live + :type default_ttl: int + :param unique_key_policy: The unique key policy configuration for + specifying uniqueness constraints on documents in the collection in the + Azure Cosmos DB service. + :type unique_key_policy: ~azure.mgmt.cosmosdb.models.UniqueKeyPolicy + :param conflict_resolution_policy: The conflict resolution policy for the + container. + :type conflict_resolution_policy: + ~azure.mgmt.cosmosdb.models.ConflictResolutionPolicy """ _validation = { @@ -3022,28 +3228,16 @@ def __init__(self, *, resource, options, location: str=None, tags=None, **kwargs self.options = options -class SqlDatabaseGetResults(ARMResourceProperties): - """An Azure Cosmos DB SQL database. +class SqlDatabaseGetPropertiesResource(Model): + """SqlDatabaseGetPropertiesResource. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :ivar id: The unique resource identifier of the ARM resource. - :vartype id: str - :ivar name: The name of the ARM resource. - :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :param location: The location of the resource group to which the resource - belongs. - :type location: str - :param tags: - :type tags: dict[str, str] - :param sql_database_get_results_id: Required. Name of the Cosmos DB SQL - database - :type sql_database_get_results_id: str + :param id: Required. Name of the Cosmos DB SQL database + :type id: str :ivar _rid: A system generated property. A unique identifier. :vartype _rid: str :ivar _ts: A system generated property that denotes the last updated @@ -3061,10 +3255,7 @@ class SqlDatabaseGetResults(ARMResourceProperties): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'sql_database_get_results_id': {'required': True}, + 'id': {'required': True}, '_rid': {'readonly': True}, '_ts': {'readonly': True}, '_etag': {'readonly': True}, @@ -3072,21 +3263,16 @@ class SqlDatabaseGetResults(ARMResourceProperties): _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sql_database_get_results_id': {'key': 'properties.id', 'type': 'str'}, - '_rid': {'key': 'properties._rid', 'type': 'str'}, - '_ts': {'key': 'properties._ts', 'type': 'object'}, - '_etag': {'key': 'properties._etag', 'type': 'str'}, - '_colls': {'key': 'properties._colls', 'type': 'str'}, - '_users': {'key': 'properties._users', 'type': 'str'}, + '_rid': {'key': '_rid', 'type': 'str'}, + '_ts': {'key': '_ts', 'type': 'object'}, + '_etag': {'key': '_etag', 'type': 'str'}, + '_colls': {'key': '_colls', 'type': 'str'}, + '_users': {'key': '_users', 'type': 'str'}, } - def __init__(self, *, sql_database_get_results_id: str, location: str=None, tags=None, _colls: str=None, _users: str=None, **kwargs) -> None: - super(SqlDatabaseGetResults, self).__init__(location=location, tags=tags, **kwargs) - self.sql_database_get_results_id = sql_database_get_results_id + def __init__(self, *, id: str, _colls: str=None, _users: str=None, **kwargs) -> None: + super(SqlDatabaseGetPropertiesResource, self).__init__(**kwargs) + self.id = id self._rid = None self._ts = None self._etag = None @@ -3094,6 +3280,48 @@ def __init__(self, *, sql_database_get_results_id: str, location: str=None, tags self._users = _users +class SqlDatabaseGetResults(ARMResourceProperties): + """An Azure Cosmos DB SQL database. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The unique resource identifier of the ARM resource. + :vartype id: str + :ivar name: The name of the ARM resource. + :vartype name: str + :ivar type: The type of Azure resource. + :vartype type: str + :param location: The location of the resource group to which the resource + belongs. + :type location: str + :param tags: + :type tags: dict[str, str] + :param resource: + :type resource: + ~azure.mgmt.cosmosdb.models.SqlDatabaseGetPropertiesResource + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'resource': {'key': 'properties.resource', 'type': 'SqlDatabaseGetPropertiesResource'}, + } + + def __init__(self, *, location: str=None, tags=None, resource=None, **kwargs) -> None: + super(SqlDatabaseGetResults, self).__init__(location=location, tags=tags, **kwargs) + self.resource = resource + + class SqlDatabaseResource(Model): """Cosmos DB SQL database resource object. @@ -3166,14 +3394,58 @@ def __init__(self, *, resource, options, location: str=None, tags=None, **kwargs self.options = options -class SqlStoredProcedureGetResults(ARMResourceProperties): - """An Azure Cosmos DB storedProcedure. +class SqlStoredProcedureGetPropertiesResource(Model): + """SqlStoredProcedureGetPropertiesResource. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. + :param id: Required. Name of the Cosmos DB SQL storedProcedure + :type id: str + :param body: Body of the Stored Procedure + :type body: str + :ivar _rid: A system generated property. A unique identifier. + :vartype _rid: str + :ivar _ts: A system generated property that denotes the last updated + timestamp of the resource. + :vartype _ts: object + :ivar _etag: A system generated property representing the resource etag + required for optimistic concurrency control. + :vartype _etag: str + """ + + _validation = { + 'id': {'required': True}, + '_rid': {'readonly': True}, + '_ts': {'readonly': True}, + '_etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'body': {'key': 'body', 'type': 'str'}, + '_rid': {'key': '_rid', 'type': 'str'}, + '_ts': {'key': '_ts', 'type': 'object'}, + '_etag': {'key': '_etag', 'type': 'str'}, + } + + def __init__(self, *, id: str, body: str=None, **kwargs) -> None: + super(SqlStoredProcedureGetPropertiesResource, self).__init__(**kwargs) + self.id = id + self.body = body + self._rid = None + self._ts = None + self._etag = None + + +class SqlStoredProcedureGetResults(ARMResourceProperties): + """An Azure Cosmos DB storedProcedure. + + Variables are only populated by the server, and will be ignored when + sending a request. + :ivar id: The unique resource identifier of the ARM resource. :vartype id: str :ivar name: The name of the ARM resource. @@ -3185,29 +3457,15 @@ class SqlStoredProcedureGetResults(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param sql_stored_procedure_get_results_id: Required. Name of the Cosmos - DB SQL storedProcedure - :type sql_stored_procedure_get_results_id: str - :param body: Body of the Stored Procedure - :type body: str - :ivar _rid: A system generated property. A unique identifier. - :vartype _rid: str - :ivar _ts: A system generated property that denotes the last updated - timestamp of the resource. - :vartype _ts: object - :ivar _etag: A system generated property representing the resource etag - required for optimistic concurrency control. - :vartype _etag: str + :param resource: + :type resource: + ~azure.mgmt.cosmosdb.models.SqlStoredProcedureGetPropertiesResource """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'sql_stored_procedure_get_results_id': {'required': True}, - '_rid': {'readonly': True}, - '_ts': {'readonly': True}, - '_etag': {'readonly': True}, } _attribute_map = { @@ -3216,20 +3474,12 @@ class SqlStoredProcedureGetResults(ARMResourceProperties): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'sql_stored_procedure_get_results_id': {'key': 'properties.id', 'type': 'str'}, - 'body': {'key': 'properties.body', 'type': 'str'}, - '_rid': {'key': 'properties._rid', 'type': 'str'}, - '_ts': {'key': 'properties._ts', 'type': 'object'}, - '_etag': {'key': 'properties._etag', 'type': 'str'}, + 'resource': {'key': 'properties.resource', 'type': 'SqlStoredProcedureGetPropertiesResource'}, } - def __init__(self, *, sql_stored_procedure_get_results_id: str, location: str=None, tags=None, body: str=None, **kwargs) -> None: + def __init__(self, *, location: str=None, tags=None, resource=None, **kwargs) -> None: super(SqlStoredProcedureGetResults, self).__init__(location=location, tags=tags, **kwargs) - self.sql_stored_procedure_get_results_id = sql_stored_procedure_get_results_id - self.body = body - self._rid = None - self._ts = None - self._etag = None + self.resource = resource class SqlStoredProcedureResource(Model): @@ -3308,28 +3558,16 @@ def __init__(self, *, resource, options, location: str=None, tags=None, **kwargs self.options = options -class SqlTriggerGetResults(ARMResourceProperties): - """An Azure Cosmos DB trigger. +class SqlTriggerGetPropertiesResource(Model): + """SqlTriggerGetPropertiesResource. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :ivar id: The unique resource identifier of the ARM resource. - :vartype id: str - :ivar name: The name of the ARM resource. - :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :param location: The location of the resource group to which the resource - belongs. - :type location: str - :param tags: - :type tags: dict[str, str] - :param sql_trigger_get_results_id: Required. Name of the Cosmos DB SQL - trigger - :type sql_trigger_get_results_id: str + :param id: Required. Name of the Cosmos DB SQL trigger + :type id: str :param body: Body of the Trigger :type body: str :param trigger_type: Type of the Trigger. Possible values include: 'Pre', @@ -3350,10 +3588,7 @@ class SqlTriggerGetResults(ARMResourceProperties): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'sql_trigger_get_results_id': {'required': True}, + 'id': {'required': True}, '_rid': {'readonly': True}, '_ts': {'readonly': True}, '_etag': {'readonly': True}, @@ -3361,22 +3596,17 @@ class SqlTriggerGetResults(ARMResourceProperties): _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sql_trigger_get_results_id': {'key': 'properties.id', 'type': 'str'}, - 'body': {'key': 'properties.body', 'type': 'str'}, - 'trigger_type': {'key': 'properties.triggerType', 'type': 'str'}, - 'trigger_operation': {'key': 'properties.triggerOperation', 'type': 'str'}, - '_rid': {'key': 'properties._rid', 'type': 'str'}, - '_ts': {'key': 'properties._ts', 'type': 'object'}, - '_etag': {'key': 'properties._etag', 'type': 'str'}, + 'body': {'key': 'body', 'type': 'str'}, + 'trigger_type': {'key': 'triggerType', 'type': 'str'}, + 'trigger_operation': {'key': 'triggerOperation', 'type': 'str'}, + '_rid': {'key': '_rid', 'type': 'str'}, + '_ts': {'key': '_ts', 'type': 'object'}, + '_etag': {'key': '_etag', 'type': 'str'}, } - def __init__(self, *, sql_trigger_get_results_id: str, location: str=None, tags=None, body: str=None, trigger_type=None, trigger_operation=None, **kwargs) -> None: - super(SqlTriggerGetResults, self).__init__(location=location, tags=tags, **kwargs) - self.sql_trigger_get_results_id = sql_trigger_get_results_id + def __init__(self, *, id: str, body: str=None, trigger_type=None, trigger_operation=None, **kwargs) -> None: + super(SqlTriggerGetPropertiesResource, self).__init__(**kwargs) + self.id = id self.body = body self.trigger_type = trigger_type self.trigger_operation = trigger_operation @@ -3385,6 +3615,48 @@ def __init__(self, *, sql_trigger_get_results_id: str, location: str=None, tags= self._etag = None +class SqlTriggerGetResults(ARMResourceProperties): + """An Azure Cosmos DB trigger. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The unique resource identifier of the ARM resource. + :vartype id: str + :ivar name: The name of the ARM resource. + :vartype name: str + :ivar type: The type of Azure resource. + :vartype type: str + :param location: The location of the resource group to which the resource + belongs. + :type location: str + :param tags: + :type tags: dict[str, str] + :param resource: + :type resource: + ~azure.mgmt.cosmosdb.models.SqlTriggerGetPropertiesResource + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'resource': {'key': 'properties.resource', 'type': 'SqlTriggerGetPropertiesResource'}, + } + + def __init__(self, *, location: str=None, tags=None, resource=None, **kwargs) -> None: + super(SqlTriggerGetResults, self).__init__(location=location, tags=tags, **kwargs) + self.resource = resource + + class SqlTriggerResource(Model): """Cosmos DB SQL trigger resource object. @@ -3473,14 +3745,58 @@ def __init__(self, *, resource, options, location: str=None, tags=None, **kwargs self.options = options -class SqlUserDefinedFunctionGetResults(ARMResourceProperties): - """An Azure Cosmos DB userDefinedFunction. +class SqlUserDefinedFunctionGetPropertiesResource(Model): + """SqlUserDefinedFunctionGetPropertiesResource. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. + :param id: Required. Name of the Cosmos DB SQL userDefinedFunction + :type id: str + :param body: Body of the User Defined Function + :type body: str + :ivar _rid: A system generated property. A unique identifier. + :vartype _rid: str + :ivar _ts: A system generated property that denotes the last updated + timestamp of the resource. + :vartype _ts: object + :ivar _etag: A system generated property representing the resource etag + required for optimistic concurrency control. + :vartype _etag: str + """ + + _validation = { + 'id': {'required': True}, + '_rid': {'readonly': True}, + '_ts': {'readonly': True}, + '_etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'body': {'key': 'body', 'type': 'str'}, + '_rid': {'key': '_rid', 'type': 'str'}, + '_ts': {'key': '_ts', 'type': 'object'}, + '_etag': {'key': '_etag', 'type': 'str'}, + } + + def __init__(self, *, id: str, body: str=None, **kwargs) -> None: + super(SqlUserDefinedFunctionGetPropertiesResource, self).__init__(**kwargs) + self.id = id + self.body = body + self._rid = None + self._ts = None + self._etag = None + + +class SqlUserDefinedFunctionGetResults(ARMResourceProperties): + """An Azure Cosmos DB userDefinedFunction. + + Variables are only populated by the server, and will be ignored when + sending a request. + :ivar id: The unique resource identifier of the ARM resource. :vartype id: str :ivar name: The name of the ARM resource. @@ -3492,29 +3808,15 @@ class SqlUserDefinedFunctionGetResults(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param sql_user_defined_function_get_results_id: Required. Name of the - Cosmos DB SQL userDefinedFunction - :type sql_user_defined_function_get_results_id: str - :param body: Body of the User Defined Function - :type body: str - :ivar _rid: A system generated property. A unique identifier. - :vartype _rid: str - :ivar _ts: A system generated property that denotes the last updated - timestamp of the resource. - :vartype _ts: object - :ivar _etag: A system generated property representing the resource etag - required for optimistic concurrency control. - :vartype _etag: str + :param resource: + :type resource: + ~azure.mgmt.cosmosdb.models.SqlUserDefinedFunctionGetPropertiesResource """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'sql_user_defined_function_get_results_id': {'required': True}, - '_rid': {'readonly': True}, - '_ts': {'readonly': True}, - '_etag': {'readonly': True}, } _attribute_map = { @@ -3523,20 +3825,12 @@ class SqlUserDefinedFunctionGetResults(ARMResourceProperties): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'sql_user_defined_function_get_results_id': {'key': 'properties.id', 'type': 'str'}, - 'body': {'key': 'properties.body', 'type': 'str'}, - '_rid': {'key': 'properties._rid', 'type': 'str'}, - '_ts': {'key': 'properties._ts', 'type': 'object'}, - '_etag': {'key': 'properties._etag', 'type': 'str'}, + 'resource': {'key': 'properties.resource', 'type': 'SqlUserDefinedFunctionGetPropertiesResource'}, } - def __init__(self, *, sql_user_defined_function_get_results_id: str, location: str=None, tags=None, body: str=None, **kwargs) -> None: + def __init__(self, *, location: str=None, tags=None, resource=None, **kwargs) -> None: super(SqlUserDefinedFunctionGetResults, self).__init__(location=location, tags=tags, **kwargs) - self.sql_user_defined_function_get_results_id = sql_user_defined_function_get_results_id - self.body = body - self._rid = None - self._ts = None - self._etag = None + self.resource = resource class SqlUserDefinedFunctionResource(Model): @@ -3615,14 +3909,54 @@ def __init__(self, *, resource, options, location: str=None, tags=None, **kwargs self.options = options -class TableGetResults(ARMResourceProperties): - """An Azure Cosmos DB Table. +class TableGetPropertiesResource(Model): + """TableGetPropertiesResource. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. + :param id: Required. Name of the Cosmos DB table + :type id: str + :ivar _rid: A system generated property. A unique identifier. + :vartype _rid: str + :ivar _ts: A system generated property that denotes the last updated + timestamp of the resource. + :vartype _ts: object + :ivar _etag: A system generated property representing the resource etag + required for optimistic concurrency control. + :vartype _etag: str + """ + + _validation = { + 'id': {'required': True}, + '_rid': {'readonly': True}, + '_ts': {'readonly': True}, + '_etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + '_rid': {'key': '_rid', 'type': 'str'}, + '_ts': {'key': '_ts', 'type': 'object'}, + '_etag': {'key': '_etag', 'type': 'str'}, + } + + def __init__(self, *, id: str, **kwargs) -> None: + super(TableGetPropertiesResource, self).__init__(**kwargs) + self.id = id + self._rid = None + self._ts = None + self._etag = None + + +class TableGetResults(ARMResourceProperties): + """An Azure Cosmos DB Table. + + Variables are only populated by the server, and will be ignored when + sending a request. + :ivar id: The unique resource identifier of the ARM resource. :vartype id: str :ivar name: The name of the ARM resource. @@ -3634,26 +3968,14 @@ class TableGetResults(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param table_get_results_id: Required. Name of the Cosmos DB table - :type table_get_results_id: str - :ivar _rid: A system generated property. A unique identifier. - :vartype _rid: str - :ivar _ts: A system generated property that denotes the last updated - timestamp of the resource. - :vartype _ts: object - :ivar _etag: A system generated property representing the resource etag - required for optimistic concurrency control. - :vartype _etag: str + :param resource: + :type resource: ~azure.mgmt.cosmosdb.models.TableGetPropertiesResource """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'table_get_results_id': {'required': True}, - '_rid': {'readonly': True}, - '_ts': {'readonly': True}, - '_etag': {'readonly': True}, } _attribute_map = { @@ -3662,18 +3984,12 @@ class TableGetResults(ARMResourceProperties): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'table_get_results_id': {'key': 'properties.id', 'type': 'str'}, - '_rid': {'key': 'properties._rid', 'type': 'str'}, - '_ts': {'key': 'properties._ts', 'type': 'object'}, - '_etag': {'key': 'properties._etag', 'type': 'str'}, + 'resource': {'key': 'properties.resource', 'type': 'TableGetPropertiesResource'}, } - def __init__(self, *, table_get_results_id: str, location: str=None, tags=None, **kwargs) -> None: + def __init__(self, *, location: str=None, tags=None, resource=None, **kwargs) -> None: super(TableGetResults, self).__init__(location=location, tags=tags, **kwargs) - self.table_get_results_id = table_get_results_id - self._rid = None - self._ts = None - self._etag = None + self.resource = resource class TableResource(Model):