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

regenerated image search #8980

Merged
merged 3 commits into from
Dec 4, 2019
Merged
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
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