|
| 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 .operations.custom_instance_operations import CustomInstanceOperations |
| 16 | +from . import models |
| 17 | + |
| 18 | + |
| 19 | +class CustomImageSearchAPIConfiguration(Configuration): |
| 20 | + """Configuration for CustomImageSearchAPI |
| 21 | + Note that all parameters used to create this instance are saved as instance |
| 22 | + attributes. |
| 23 | + |
| 24 | + :param credentials: Subscription credentials which uniquely identify |
| 25 | + client subscription. |
| 26 | + :type credentials: None |
| 27 | + :param str base_url: Service URL |
| 28 | + """ |
| 29 | + |
| 30 | + def __init__( |
| 31 | + self, credentials, base_url=None): |
| 32 | + |
| 33 | + if credentials is None: |
| 34 | + raise ValueError("Parameter 'credentials' must not be None.") |
| 35 | + if not base_url: |
| 36 | + base_url = 'https://api.cognitive.microsoft.com/bingcustomsearch/v7.0' |
| 37 | + |
| 38 | + super(CustomImageSearchAPIConfiguration, self).__init__(base_url) |
| 39 | + |
| 40 | + self.add_user_agent('azure-cognitiveservices-search-customimagesearch/{}'.format(VERSION)) |
| 41 | + |
| 42 | + self.credentials = credentials |
| 43 | + |
| 44 | + |
| 45 | +class CustomImageSearchAPI(SDKClient): |
| 46 | + """The Bing Custom Image Search API lets you send an image search query to Bing and get back image search results customized to meet your custom search definition. |
| 47 | + |
| 48 | + :ivar config: Configuration for client. |
| 49 | + :vartype config: CustomImageSearchAPIConfiguration |
| 50 | + |
| 51 | + :ivar custom_instance: CustomInstance operations |
| 52 | + :vartype custom_instance: azure.cognitiveservices.search.customimagesearch.operations.CustomInstanceOperations |
| 53 | + |
| 54 | + :param credentials: Subscription credentials which uniquely identify |
| 55 | + client subscription. |
| 56 | + :type credentials: None |
| 57 | + :param str base_url: Service URL |
| 58 | + """ |
| 59 | + |
| 60 | + def __init__( |
| 61 | + self, credentials, base_url=None): |
| 62 | + |
| 63 | + self.config = CustomImageSearchAPIConfiguration(credentials, base_url) |
| 64 | + super(CustomImageSearchAPI, self).__init__(self.config.credentials, self.config) |
| 65 | + |
| 66 | + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} |
| 67 | + self.api_version = '1.0' |
| 68 | + self._serialize = Serializer(client_models) |
| 69 | + self._deserialize = Deserializer(client_models) |
| 70 | + |
| 71 | + self.custom_instance = CustomInstanceOperations( |
| 72 | + self._client, self.config, self._serialize, self._deserialize) |
0 commit comments