Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR azure-cognitiveservices-knowledge-qnamaker] Fix QnAMaker Python conf #625

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from ._configuration import QnAMakerClientConfiguration
from ._qn_amaker_client import QnAMakerClient
__all__ = ['QnAMakerClient', 'QnAMakerClientConfiguration']

from .version import VERSION

__version__ = VERSION

Original file line number Diff line number Diff line change
@@ -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 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)

# 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.endpoint = endpoint
self.credentials = credentials
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# 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 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 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.authoring.operations.EndpointSettingsOperations
:ivar endpoint_keys: EndpointKeys operations
:vartype endpoint_keys: azure.cognitiveservices.knowledge.qnamaker.authoring.operations.EndpointKeysOperations
:ivar alterations: Alterations operations
:vartype alterations: azure.cognitiveservices.knowledge.qnamaker.authoring.operations.AlterationsOperations
:ivar knowledgebase: Knowledgebase operations
:vartype knowledgebase: azure.cognitiveservices.knowledge.qnamaker.authoring.operations.KnowledgebaseOperations
:ivar operations: Operations operations
:vartype operations: azure.cognitiveservices.knowledge.qnamaker.authoring.operations.Operations

:param endpoint: Supported Cognitive Services endpoints (protocol and
hostname, for example: https://westus.api.cognitive.microsoft.com).
:type endpoint: str
:param credentials: Subscription credentials which uniquely identify
client subscription.
:type credentials: None
"""

def __init__(
self, endpoint, credentials):

self.config = QnAMakerClientConfiguration(endpoint, credentials)
super(QnAMakerClient, 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.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(
self._client, self.config, self._serialize, self._deserialize)
self.knowledgebase = KnowledgebaseOperations(
self._client, self.config, self._serialize, self._deserialize)
self.operations = Operations(
self._client, self.config, self._serialize, self._deserialize)
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

try:
from ._models_py3 import ActiveLearningSettingsDTO
from ._models_py3 import AlterationsDTO
from ._models_py3 import ContextDTO
from ._models_py3 import CreateKbDTO
from ._models_py3 import CreateKbInputDTO
from ._models_py3 import DeleteKbContentsDTO
from ._models_py3 import EndpointKeysDTO
from ._models_py3 import EndpointSettingsDTO
from ._models_py3 import EndpointSettingsDTOActiveLearning
from ._models_py3 import Error
from ._models_py3 import ErrorResponse, ErrorResponseException
from ._models_py3 import ErrorResponseError
from ._models_py3 import FileDTO
from ._models_py3 import InnerErrorModel
from ._models_py3 import KnowledgebaseDTO
from ._models_py3 import KnowledgebasesDTO
from ._models_py3 import MetadataDTO
from ._models_py3 import Operation
from ._models_py3 import PromptDTO
from ._models_py3 import PromptDTOQna
from ._models_py3 import QnADocumentsDTO
from ._models_py3 import QnADTO
from ._models_py3 import QnADTOContext
from ._models_py3 import ReplaceKbDTO
from ._models_py3 import UpdateContextDTO
from ._models_py3 import UpdateKbContentsDTO
from ._models_py3 import UpdateKbOperationDTO
from ._models_py3 import UpdateKbOperationDTOAdd
from ._models_py3 import UpdateKbOperationDTODelete
from ._models_py3 import UpdateKbOperationDTOUpdate
from ._models_py3 import UpdateMetadataDTO
from ._models_py3 import UpdateQnaDTO
from ._models_py3 import UpdateQnaDTOContext
from ._models_py3 import UpdateQnaDTOMetadata
from ._models_py3 import UpdateQnaDTOQuestions
from ._models_py3 import UpdateQuestionsDTO
from ._models_py3 import WordAlterationsDTO
except (SyntaxError, ImportError):
from ._models import ActiveLearningSettingsDTO
from ._models import AlterationsDTO
from ._models import ContextDTO
from ._models import CreateKbDTO
from ._models import CreateKbInputDTO
from ._models import DeleteKbContentsDTO
from ._models import EndpointKeysDTO
from ._models import EndpointSettingsDTO
from ._models import EndpointSettingsDTOActiveLearning
from ._models import Error
from ._models import ErrorResponse, ErrorResponseException
from ._models import ErrorResponseError
from ._models import FileDTO
from ._models import InnerErrorModel
from ._models import KnowledgebaseDTO
from ._models import KnowledgebasesDTO
from ._models import MetadataDTO
from ._models import Operation
from ._models import PromptDTO
from ._models import PromptDTOQna
from ._models import QnADocumentsDTO
from ._models import QnADTO
from ._models import QnADTOContext
from ._models import ReplaceKbDTO
from ._models import UpdateContextDTO
from ._models import UpdateKbContentsDTO
from ._models import UpdateKbOperationDTO
from ._models import UpdateKbOperationDTOAdd
from ._models import UpdateKbOperationDTODelete
from ._models import UpdateKbOperationDTOUpdate
from ._models import UpdateMetadataDTO
from ._models import UpdateQnaDTO
from ._models import UpdateQnaDTOContext
from ._models import UpdateQnaDTOMetadata
from ._models import UpdateQnaDTOQuestions
from ._models import UpdateQuestionsDTO
from ._models import WordAlterationsDTO
from ._qn_amaker_client_enums import (
EnvironmentType,
ErrorCodeType,
OperationStateType,
)

__all__ = [
'ActiveLearningSettingsDTO',
'AlterationsDTO',
'ContextDTO',
'CreateKbDTO',
'CreateKbInputDTO',
'DeleteKbContentsDTO',
'EndpointKeysDTO',
'EndpointSettingsDTO',
'EndpointSettingsDTOActiveLearning',
'Error',
'ErrorResponse', 'ErrorResponseException',
'ErrorResponseError',
'FileDTO',
'InnerErrorModel',
'KnowledgebaseDTO',
'KnowledgebasesDTO',
'MetadataDTO',
'Operation',
'PromptDTO',
'PromptDTOQna',
'QnADocumentsDTO',
'QnADTO',
'QnADTOContext',
'ReplaceKbDTO',
'UpdateContextDTO',
'UpdateKbContentsDTO',
'UpdateKbOperationDTO',
'UpdateKbOperationDTOAdd',
'UpdateKbOperationDTODelete',
'UpdateKbOperationDTOUpdate',
'UpdateMetadataDTO',
'UpdateQnaDTO',
'UpdateQnaDTOContext',
'UpdateQnaDTOMetadata',
'UpdateQnaDTOQuestions',
'UpdateQuestionsDTO',
'WordAlterationsDTO',
'ErrorCodeType',
'OperationStateType',
'EnvironmentType',
]
Loading