forked from Azure/azure-sdk-for-python
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generated from 771a3b26df8ce4602832c92223eda0cf71129355
Update from latest master
- Loading branch information
SDK Automation
committed
Oct 29, 2019
1 parent
b42ad27
commit be3bad6
Showing
72 changed files
with
1,677 additions
and
2,423 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
...eservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/_configuration.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
...nowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/_qn_amaker_runtime_client.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.