Skip to content
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
4 changes: 4 additions & 0 deletions azure-cognitiveservices-search-imagesearch/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
include *.rst
include azure/__init__.py
include azure/cognitiveservices/__init__.py
include azure/cognitiveservices/search/__init__.py

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

from .image_search_api import ImageSearchAPI
from .image_search_client import ImageSearchClient
from .version import VERSION

__all__ = ['ImageSearchAPI']
__all__ = ['ImageSearchClient']

__version__ = VERSION

Original file line number Diff line number Diff line change
Expand Up @@ -16,52 +16,60 @@
from . import models


class ImageSearchAPIConfiguration(Configuration):
"""Configuration for ImageSearchAPI
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
:param str base_url: Service URL
"""

def __init__(
self, credentials, base_url=None):
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.")
if not base_url:
base_url = 'https://api.cognitive.microsoft.com/bing/v7.0'
base_url = '{Endpoint}/bing/v7.0'

super(ImageSearchAPIConfiguration, self).__init__(base_url)
super(ImageSearchClientConfiguration, self).__init__(base_url)

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

self.endpoint = endpoint
self.credentials = credentials


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
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
from .rating import Rating
from .collection_page import CollectionPage
from .structured_value import StructuredValue
from .image_search_api_enums import (
from .image_search_client_enums import (
Currency,
ItemAvailability,
ErrorCode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .offer import Offer
from .offer_py3 import Offer


class AggregateOffer(Offer):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .rating import Rating
from .rating_py3 import Rating


class AggregateRating(Rating):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .response import Response
from .response_py3 import Response


class Answer(Response):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .web_page import WebPage
from .web_page_py3 import WebPage


class CollectionPage(WebPage):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .thing import Thing
from .thing_py3 import Thing


class CreativeWork(Thing):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .response import Response
from .response_py3 import Response
from msrest.exceptions import HttpOperationError


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

from .response_base import ResponseBase
from .response_base_py3 import ResponseBase


class Identifiable(ResponseBase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .collection_page import CollectionPage
from .collection_page_py3 import CollectionPage


class ImageGallery(CollectionPage):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .response import Response
from .response_py3 import Response


class ImageInsights(Response):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class ImageObject(MediaObject):
image is of an apple pie, this object includes a count of the number of
websites where you can buy an apple pie. To indicate the number of offers
in your UX, include badging such as a shopping cart icon that contains the
count. When the user clicks on the icon, use imageInisghtsToken to get the
count. When the user clicks on the icon, use imageInsightsToken to get the
list of websites.
:vartype insights_metadata:
~azure.cognitiveservices.search.imagesearch.models.ImagesImageMetadata
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .media_object import MediaObject
from .media_object_py3 import MediaObject


class ImageObject(MediaObject):
Expand Down Expand Up @@ -80,7 +80,7 @@ class ImageObject(MediaObject):
image is of an apple pie, this object includes a count of the number of
websites where you can buy an apple pie. To indicate the number of offers
in your UX, include badging such as a shopping cart icon that contains the
count. When the user clicks on the icon, use imageInisghtsToken to get the
count. When the user clicks on the icon, use imageInsightsToken to get the
list of websites.
:vartype insights_metadata:
~azure.cognitiveservices.search.imagesearch.models.ImagesImageMetadata
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .search_results_answer import SearchResultsAnswer
from .search_results_answer_py3 import SearchResultsAnswer


class Images(SearchResultsAnswer):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .thing import Thing
from .thing_py3 import Thing


class Intangible(Thing):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .creative_work import CreativeWork
from .creative_work_py3 import CreativeWork


class MediaObject(CreativeWork):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .structured_value import StructuredValue
from .structured_value_py3 import StructuredValue


class NormalizedRectangle(StructuredValue):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .thing import Thing
from .thing_py3 import Thing


class Offer(Thing):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .thing import Thing
from .thing_py3 import Thing


class Organization(Thing):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .thing import Thing
from .thing_py3 import Thing


class Person(Thing):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .properties_item import PropertiesItem
from .properties_item_py3 import PropertiesItem


class Rating(PropertiesItem):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .creative_work import CreativeWork
from .creative_work_py3 import CreativeWork


class Recipe(CreativeWork):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .response import Response
from .response_py3 import Response


class RecognizedEntity(Response):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .response import Response
from .response_py3 import Response


class RecognizedEntityRegion(Response):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .identifiable import Identifiable
from .identifiable_py3 import Identifiable


class Response(Identifiable):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .answer import Answer
from .answer_py3 import Answer


class SearchResultsAnswer(Answer):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .intangible import Intangible
from .intangible_py3 import Intangible


class StructuredValue(Intangible):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .response import Response
from .response_py3 import Response


class Thing(Response):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .response import Response
from .response_py3 import Response


class TrendingImages(Response):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .creative_work import CreativeWork
from .creative_work_py3 import CreativeWork


class WebPage(CreativeWork):
Expand Down
Loading