|
| 1 | +# coding=utf-8 |
| 2 | +# -------------------------------------------------------------------------- |
| 3 | +# Copyright (c) Microsoft Corporation. All rights reserved. |
| 4 | +# Licensed under the MIT License. See License.txt in the project root for |
| 5 | +# license information. |
| 6 | +# |
| 7 | +# Code generated by Microsoft (R) AutoRest Code Generator. |
| 8 | +# Changes may cause incorrect behavior and will be lost if the code is |
| 9 | +# regenerated. |
| 10 | +# -------------------------------------------------------------------------- |
| 11 | + |
| 12 | +from msrest.service_client import SDKClient |
| 13 | +from msrest import Configuration, Serializer, Deserializer |
| 14 | +from .version import VERSION |
| 15 | +from msrest.exceptions import HttpOperationError |
| 16 | +from .operations.features_operations import FeaturesOperations |
| 17 | +from .operations.examples_operations import ExamplesOperations |
| 18 | +from .operations.model_operations import ModelOperations |
| 19 | +from .operations.apps_operations import AppsOperations |
| 20 | +from .operations.versions_operations import VersionsOperations |
| 21 | +from .operations.train_operations import TrainOperations |
| 22 | +from .operations.permissions_operations import PermissionsOperations |
| 23 | +from .operations.pattern_operations import PatternOperations |
| 24 | +from . import models |
| 25 | + |
| 26 | + |
| 27 | +class LUISAuthoringClientConfiguration(Configuration): |
| 28 | + """Configuration for LUISAuthoringClient |
| 29 | + Note that all parameters used to create this instance are saved as instance |
| 30 | + attributes. |
| 31 | +
|
| 32 | + :param endpoint: Supported Cognitive Services endpoints (protocol and |
| 33 | + hostname, for example: https://westus.api.cognitive.microsoft.com). |
| 34 | + :type endpoint: str |
| 35 | + :param credentials: Subscription credentials which uniquely identify |
| 36 | + client subscription. |
| 37 | + :type credentials: None |
| 38 | + """ |
| 39 | + |
| 40 | + def __init__( |
| 41 | + self, endpoint, credentials): |
| 42 | + |
| 43 | + if endpoint is None: |
| 44 | + raise ValueError("Parameter 'endpoint' must not be None.") |
| 45 | + if credentials is None: |
| 46 | + raise ValueError("Parameter 'credentials' must not be None.") |
| 47 | + base_url = '{Endpoint}/luis/api/v2.0' |
| 48 | + |
| 49 | + super(LUISAuthoringClientConfiguration, self).__init__(base_url) |
| 50 | + |
| 51 | + self.add_user_agent('azure-cognitiveservices-language-luis/{}'.format(VERSION)) |
| 52 | + |
| 53 | + self.endpoint = endpoint |
| 54 | + self.credentials = credentials |
| 55 | + |
| 56 | + |
| 57 | +class LUISAuthoringClient(SDKClient): |
| 58 | + """LUISAuthoringClient |
| 59 | +
|
| 60 | + :ivar config: Configuration for client. |
| 61 | + :vartype config: LUISAuthoringClientConfiguration |
| 62 | +
|
| 63 | + :ivar features: Features operations |
| 64 | + :vartype features: azure.cognitiveservices.language.luis.authoring.operations.FeaturesOperations |
| 65 | + :ivar examples: Examples operations |
| 66 | + :vartype examples: azure.cognitiveservices.language.luis.authoring.operations.ExamplesOperations |
| 67 | + :ivar model: Model operations |
| 68 | + :vartype model: azure.cognitiveservices.language.luis.authoring.operations.ModelOperations |
| 69 | + :ivar apps: Apps operations |
| 70 | + :vartype apps: azure.cognitiveservices.language.luis.authoring.operations.AppsOperations |
| 71 | + :ivar versions: Versions operations |
| 72 | + :vartype versions: azure.cognitiveservices.language.luis.authoring.operations.VersionsOperations |
| 73 | + :ivar train: Train operations |
| 74 | + :vartype train: azure.cognitiveservices.language.luis.authoring.operations.TrainOperations |
| 75 | + :ivar permissions: Permissions operations |
| 76 | + :vartype permissions: azure.cognitiveservices.language.luis.authoring.operations.PermissionsOperations |
| 77 | + :ivar pattern: Pattern operations |
| 78 | + :vartype pattern: azure.cognitiveservices.language.luis.authoring.operations.PatternOperations |
| 79 | +
|
| 80 | + :param endpoint: Supported Cognitive Services endpoints (protocol and |
| 81 | + hostname, for example: https://westus.api.cognitive.microsoft.com). |
| 82 | + :type endpoint: str |
| 83 | + :param credentials: Subscription credentials which uniquely identify |
| 84 | + client subscription. |
| 85 | + :type credentials: None |
| 86 | + """ |
| 87 | + |
| 88 | + def __init__( |
| 89 | + self, endpoint, credentials): |
| 90 | + |
| 91 | + self.config = LUISAuthoringClientConfiguration(endpoint, credentials) |
| 92 | + super(LUISAuthoringClient, self).__init__(self.config.credentials, self.config) |
| 93 | + |
| 94 | + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} |
| 95 | + self.api_version = '2.0' |
| 96 | + self._serialize = Serializer(client_models) |
| 97 | + self._deserialize = Deserializer(client_models) |
| 98 | + |
| 99 | + self.features = FeaturesOperations( |
| 100 | + self._client, self.config, self._serialize, self._deserialize) |
| 101 | + self.examples = ExamplesOperations( |
| 102 | + self._client, self.config, self._serialize, self._deserialize) |
| 103 | + self.model = ModelOperations( |
| 104 | + self._client, self.config, self._serialize, self._deserialize) |
| 105 | + self.apps = AppsOperations( |
| 106 | + self._client, self.config, self._serialize, self._deserialize) |
| 107 | + self.versions = VersionsOperations( |
| 108 | + self._client, self.config, self._serialize, self._deserialize) |
| 109 | + self.train = TrainOperations( |
| 110 | + self._client, self.config, self._serialize, self._deserialize) |
| 111 | + self.permissions = PermissionsOperations( |
| 112 | + self._client, self.config, self._serialize, self._deserialize) |
| 113 | + self.pattern = PatternOperations( |
| 114 | + self._client, self.config, self._serialize, self._deserialize) |
0 commit comments