Skip to content

Commit

Permalink
regenerated image search (#8980)
Browse files Browse the repository at this point in the history
* regenerated image search

* Packaging update of azure-cognitiveservices-search-imagesearch

* history and version
  • Loading branch information
Zim Kalinowski authored Dec 4, 2019
1 parent 50aa90c commit e3d9eab
Show file tree
Hide file tree
Showing 101 changed files with 5,645 additions and 6,618 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,28 @@
Release History
===============

2.0.0 (2019-12-04)
++++++++++++++++++

**Features**

- Minor changes accumulated since last release

**Breaking Changes**

- ImageSearchAPI has been renamed to ImageSearchClient
- ImageSearchAPIConfiguration has been renamed to ImageSearchClientConfiguration

**General Breaking changes**

This version uses a next-generation code generator that might introduce breaking changes if from some import. In summary, some modules were incorrectly visible/importable and have been renamed. This fixed several issues caused by usage of classes that were not supposed to be used in the first place.
AdvisorManagementClient cannot be imported from azure.cognitiveservices.search.image_search_api anymore (import from azure.cognitiveservices.search.imagesearch works like before)
ImageSearchClientConfiguration import has been moved from azure.cognitiveservices.search.image_search_api to azure.cognitiveservices.search.imagesearch
A model MyClass from a "models" sub-module cannot be imported anymore using azure.cognitiveservices.search.imagesearch.models.my_class (import from azure.cognitiveservices.search.imagesearch.models works like before)
An operation class MyClassOperations from an operations sub-module cannot be imported anymore using azure.cognitiveservices.search.imagesearch.operations.my_class_operations (import from azure.cognitiveservices.search.imagesearch.operations works like before)
Last but not least, HTTP connection pooling is now enabled by default. You should always use a client as a context manager, or call close(), or use no more than one client per process.


1.0.0 (2018-05-02)
++++++++++++++++++

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Microsoft Azure SDK for Python

This is the Microsoft Azure Cognitive Services Image Search 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 <https://pypi.python.org/pypi/azure>`__ bundle package.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
# regenerated.
# --------------------------------------------------------------------------

from .image_search_api import ImageSearchAPI
from .version import VERSION
from ._configuration import ImageSearchClientConfiguration
from ._image_search_client import ImageSearchClient
__all__ = ['ImageSearchClient', 'ImageSearchClientConfiguration']

__all__ = ['ImageSearchAPI']
from .version import VERSION

__version__ = VERSION

Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# 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 ImageSearchClientConfiguration(Configuration):
"""Configuration for ImageSearchClient
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",
"https://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}/bing/v7.0'

super(ImageSearchClientConfiguration, 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-search-imagesearch/{}'.format(VERSION))

self.endpoint = endpoint
self.credentials = credentials
Original file line number Diff line number Diff line change
Expand Up @@ -10,58 +10,36 @@
# --------------------------------------------------------------------------

from msrest.service_client import SDKClient
from msrest import Configuration, Serializer, Deserializer
from .version import VERSION
from .operations.images_operations import ImagesOperations
from . import models


class ImageSearchAPIConfiguration(Configuration):
"""Configuration for ImageSearchAPI
Note that all parameters used to create this instance are saved as instance
attributes.
:param credentials: Subscription credentials which uniquely identify
client subscription.
:type credentials: None
:param str base_url: Service URL
"""

def __init__(
self, credentials, base_url=None):

if credentials is None:
raise ValueError("Parameter 'credentials' must not be None.")
if not base_url:
base_url = 'https://api.cognitive.microsoft.com/bing/v7.0'
from msrest import Serializer, Deserializer

super(ImageSearchAPIConfiguration, self).__init__(base_url)

self.add_user_agent('azure-cognitiveservices-search-imagesearch/{}'.format(VERSION))

self.credentials = credentials
from ._configuration import ImageSearchClientConfiguration
from .operations import ImagesOperations
from . import models


class ImageSearchAPI(SDKClient):
class ImageSearchClient(SDKClient):
"""The Image Search API lets you send a search query to Bing and get back a list of relevant images. This section provides technical details about the query parameters and headers that you use to request images and the JSON response objects that contain them. For examples that show how to make requests, see [Searching the Web for Images](https://docs.microsoft.com/azure/cognitive-services/bing-image-search/search-the-web).
:ivar config: Configuration for client.
:vartype config: ImageSearchAPIConfiguration
:vartype config: ImageSearchClientConfiguration
:ivar images: Images operations
:vartype images: azure.cognitiveservices.search.imagesearch.operations.ImagesOperations
:param endpoint: Supported Cognitive Services endpoints (protocol and
hostname, for example: "https://westus.api.cognitive.microsoft.com",
"https://api.cognitive.microsoft.com").
:type endpoint: str
:param credentials: Subscription credentials which uniquely identify
client subscription.
:type credentials: None
:param str base_url: Service URL
"""

def __init__(
self, credentials, base_url=None):
self, endpoint, credentials):

self.config = ImageSearchAPIConfiguration(credentials, base_url)
super(ImageSearchAPI, self).__init__(self.config.credentials, self.config)
self.config = ImageSearchClientConfiguration(endpoint, credentials)
super(ImageSearchClient, 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 = '1.0'
Expand Down
Loading

0 comments on commit e3d9eab

Please sign in to comment.