diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/__init__.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/__init__.py new file mode 100644 index 000000000000..5e80d0a867cd --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/__init__.py @@ -0,0 +1,18 @@ +# 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 .visual_search_api import VisualSearchAPI +from .version import VERSION + +__all__ = ['VisualSearchAPI'] + +__version__ = VERSION + diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/__init__.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/__init__.py new file mode 100644 index 000000000000..88988b385b6b --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/__init__.py @@ -0,0 +1,149 @@ +# 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. +# -------------------------------------------------------------------------- + +try: + from .point2_d_py3 import Point2D + from .normalized_quadrilateral_py3 import NormalizedQuadrilateral + from .image_tag_region_py3 import ImageTagRegion + from .image_action_py3 import ImageAction + from .image_tag_py3 import ImageTag + from .organization_py3 import Organization + from .aggregate_rating_py3 import AggregateRating + from .offer_py3 import Offer + from .aggregate_offer_py3 import AggregateOffer + from .images_image_metadata_py3 import ImagesImageMetadata + from .image_object_py3 import ImageObject + from .image_knowledge_py3 import ImageKnowledge + from .response_py3 import Response + from .identifiable_py3 import Identifiable + from .error_py3 import Error + from .error_response_py3 import ErrorResponse, ErrorResponseException + from .thing_py3 import Thing + from .action_py3 import Action + from .media_object_py3 import MediaObject + from .response_base_py3 import ResponseBase + from .creative_work_py3 import CreativeWork + from .person_py3 import Person + from .intangible_py3 import Intangible + from .image_entity_action_py3 import ImageEntityAction + from .images_module_py3 import ImagesModule + from .image_module_action_py3 import ImageModuleAction + from .recipe_py3 import Recipe + from .recipes_module_py3 import RecipesModule + from .image_recipes_action_py3 import ImageRecipesAction + from .query_py3 import Query + from .related_searches_module_py3 import RelatedSearchesModule + from .image_related_searches_action_py3 import ImageRelatedSearchesAction + from .image_shopping_sources_action_py3 import ImageShoppingSourcesAction + from .structured_value_py3 import StructuredValue + from .properties_item_py3 import PropertiesItem + from .rating_py3 import Rating + from .crop_area_py3 import CropArea + from .image_info_py3 import ImageInfo + from .filters_py3 import Filters + from .knowledge_request_py3 import KnowledgeRequest + from .visual_search_request_py3 import VisualSearchRequest +except (SyntaxError, ImportError): + from .point2_d import Point2D + from .normalized_quadrilateral import NormalizedQuadrilateral + from .image_tag_region import ImageTagRegion + from .image_action import ImageAction + from .image_tag import ImageTag + from .organization import Organization + from .aggregate_rating import AggregateRating + from .offer import Offer + from .aggregate_offer import AggregateOffer + from .images_image_metadata import ImagesImageMetadata + from .image_object import ImageObject + from .image_knowledge import ImageKnowledge + from .response import Response + from .identifiable import Identifiable + from .error import Error + from .error_response import ErrorResponse, ErrorResponseException + from .thing import Thing + from .action import Action + from .media_object import MediaObject + from .response_base import ResponseBase + from .creative_work import CreativeWork + from .person import Person + from .intangible import Intangible + from .image_entity_action import ImageEntityAction + from .images_module import ImagesModule + from .image_module_action import ImageModuleAction + from .recipe import Recipe + from .recipes_module import RecipesModule + from .image_recipes_action import ImageRecipesAction + from .query import Query + from .related_searches_module import RelatedSearchesModule + from .image_related_searches_action import ImageRelatedSearchesAction + from .image_shopping_sources_action import ImageShoppingSourcesAction + from .structured_value import StructuredValue + from .properties_item import PropertiesItem + from .rating import Rating + from .crop_area import CropArea + from .image_info import ImageInfo + from .filters import Filters + from .knowledge_request import KnowledgeRequest + from .visual_search_request import VisualSearchRequest +from .visual_search_api_enums import ( + Currency, + ItemAvailability, + ErrorCode, + ErrorSubCode, +) + +__all__ = [ + 'Point2D', + 'NormalizedQuadrilateral', + 'ImageTagRegion', + 'ImageAction', + 'ImageTag', + 'Organization', + 'AggregateRating', + 'Offer', + 'AggregateOffer', + 'ImagesImageMetadata', + 'ImageObject', + 'ImageKnowledge', + 'Response', + 'Identifiable', + 'Error', + 'ErrorResponse', 'ErrorResponseException', + 'Thing', + 'Action', + 'MediaObject', + 'ResponseBase', + 'CreativeWork', + 'Person', + 'Intangible', + 'ImageEntityAction', + 'ImagesModule', + 'ImageModuleAction', + 'Recipe', + 'RecipesModule', + 'ImageRecipesAction', + 'Query', + 'RelatedSearchesModule', + 'ImageRelatedSearchesAction', + 'ImageShoppingSourcesAction', + 'StructuredValue', + 'PropertiesItem', + 'Rating', + 'CropArea', + 'ImageInfo', + 'Filters', + 'KnowledgeRequest', + 'VisualSearchRequest', + 'Currency', + 'ItemAvailability', + 'ErrorCode', + 'ErrorSubCode', +] diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/action.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/action.py new file mode 100644 index 000000000000..b92cf4fe2fd1 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/action.py @@ -0,0 +1,125 @@ +# 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 .creative_work import CreativeWork + + +class Action(CreativeWork): + """Action. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ImageAction + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item. + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.visualsearch.models.Thing] + :ivar date_published: The date on which the CreativeWork was published. + :vartype date_published: str + :ivar text: Text content of this creative work. + :vartype text: str + :ivar result: The result produced in the action. + :vartype result: + list[~azure.cognitiveservices.search.visualsearch.models.Thing] + :ivar display_name: A display name for the action. + :vartype display_name: str + :ivar is_top_action: A Boolean representing whether this result is the top + action. + :vartype is_top_action: bool + :ivar service_url: Use this URL to get additional data to determine how to + take the appropriate action. For example, the serviceUrl might return JSON + along with an image URL. + :vartype service_url: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'provider': {'readonly': True}, + 'date_published': {'readonly': True}, + 'text': {'readonly': True}, + 'result': {'readonly': True}, + 'display_name': {'readonly': True}, + 'is_top_action': {'readonly': True}, + 'service_url': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'date_published': {'key': 'datePublished', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + 'result': {'key': 'result', 'type': '[Thing]'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'is_top_action': {'key': 'isTopAction', 'type': 'bool'}, + 'service_url': {'key': 'serviceUrl', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'ImageAction': 'ImageAction'} + } + + def __init__(self, **kwargs): + super(Action, self).__init__(**kwargs) + self.result = None + self.display_name = None + self.is_top_action = None + self.service_url = None + self._type = 'Action' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/action_py3.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/action_py3.py new file mode 100644 index 000000000000..00069c4f2626 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/action_py3.py @@ -0,0 +1,125 @@ +# 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 .creative_work import CreativeWork + + +class Action(CreativeWork): + """Action. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ImageAction + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item. + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.visualsearch.models.Thing] + :ivar date_published: The date on which the CreativeWork was published. + :vartype date_published: str + :ivar text: Text content of this creative work. + :vartype text: str + :ivar result: The result produced in the action. + :vartype result: + list[~azure.cognitiveservices.search.visualsearch.models.Thing] + :ivar display_name: A display name for the action. + :vartype display_name: str + :ivar is_top_action: A Boolean representing whether this result is the top + action. + :vartype is_top_action: bool + :ivar service_url: Use this URL to get additional data to determine how to + take the appropriate action. For example, the serviceUrl might return JSON + along with an image URL. + :vartype service_url: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'provider': {'readonly': True}, + 'date_published': {'readonly': True}, + 'text': {'readonly': True}, + 'result': {'readonly': True}, + 'display_name': {'readonly': True}, + 'is_top_action': {'readonly': True}, + 'service_url': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'date_published': {'key': 'datePublished', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + 'result': {'key': 'result', 'type': '[Thing]'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'is_top_action': {'key': 'isTopAction', 'type': 'bool'}, + 'service_url': {'key': 'serviceUrl', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'ImageAction': 'ImageAction'} + } + + def __init__(self, **kwargs) -> None: + super(Action, self).__init__(**kwargs) + self.result = None + self.display_name = None + self.is_top_action = None + self.service_url = None + self._type = 'Action' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/aggregate_offer.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/aggregate_offer.py new file mode 100644 index 000000000000..2d929c19dfef --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/aggregate_offer.py @@ -0,0 +1,135 @@ +# 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 .offer import Offer + + +class AggregateOffer(Offer): + """Defines a list of offers from merchants that are related to the image. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item. + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar seller: Seller for this offer. + :vartype seller: + ~azure.cognitiveservices.search.visualsearch.models.Organization + :ivar price: The item's price. + :vartype price: float + :ivar price_currency: The monetary currency. For example, USD. Possible + values include: 'USD', 'CAD', 'GBP', 'EUR', 'COP', 'JPY', 'CNY', 'AUD', + 'INR', 'AED', 'AFN', 'ALL', 'AMD', 'ANG', 'AOA', 'ARS', 'AWG', 'AZN', + 'BAM', 'BBD', 'BDT', 'BGN', 'BHD', 'BIF', 'BMD', 'BND', 'BOB', 'BOV', + 'BRL', 'BSD', 'BTN', 'BWP', 'BYR', 'BZD', 'CDF', 'CHE', 'CHF', 'CHW', + 'CLF', 'CLP', 'COU', 'CRC', 'CUC', 'CUP', 'CVE', 'CZK', 'DJF', 'DKK', + 'DOP', 'DZD', 'EGP', 'ERN', 'ETB', 'FJD', 'FKP', 'GEL', 'GHS', 'GIP', + 'GMD', 'GNF', 'GTQ', 'GYD', 'HKD', 'HNL', 'HRK', 'HTG', 'HUF', 'IDR', + 'ILS', 'IQD', 'IRR', 'ISK', 'JMD', 'JOD', 'KES', 'KGS', 'KHR', 'KMF', + 'KPW', 'KRW', 'KWD', 'KYD', 'KZT', 'LAK', 'LBP', 'LKR', 'LRD', 'LSL', + 'LYD', 'MAD', 'MDL', 'MGA', 'MKD', 'MMK', 'MNT', 'MOP', 'MRO', 'MUR', + 'MVR', 'MWK', 'MXN', 'MXV', 'MYR', 'MZN', 'NAD', 'NGN', 'NIO', 'NOK', + 'NPR', 'NZD', 'OMR', 'PAB', 'PEN', 'PGK', 'PHP', 'PKR', 'PLN', 'PYG', + 'QAR', 'RON', 'RSD', 'RUB', 'RWF', 'SAR', 'SBD', 'SCR', 'SDG', 'SEK', + 'SGD', 'SHP', 'SLL', 'SOS', 'SRD', 'SSP', 'STD', 'SYP', 'SZL', 'THB', + 'TJS', 'TMT', 'TND', 'TOP', 'TRY', 'TTD', 'TWD', 'TZS', 'UAH', 'UGX', + 'UYU', 'UZS', 'VEF', 'VND', 'VUV', 'WST', 'XAF', 'XCD', 'XOF', 'XPF', + 'YER', 'ZAR', 'ZMW'. Default value: "USD" . + :vartype price_currency: str or + ~azure.cognitiveservices.search.visualsearch.models.Currency + :ivar availability: The item's availability. The following are the + possible values: Discontinued, InStock, InStoreOnly, LimitedAvailability, + OnlineOnly, OutOfStock, PreOrder, SoldOut. Possible values include: + 'Discontinued', 'InStock', 'InStoreOnly', 'LimitedAvailability', + 'OnlineOnly', 'OutOfStock', 'PreOrder', 'SoldOut' + :vartype availability: str or + ~azure.cognitiveservices.search.visualsearch.models.ItemAvailability + :ivar aggregate_rating: An aggregated rating that indicates how well the + product has been rated by others. + :vartype aggregate_rating: + ~azure.cognitiveservices.search.visualsearch.models.AggregateRating + :ivar last_updated: The last date that the offer was updated. The date is + in the form YYYY-MM-DD. + :vartype last_updated: str + :ivar offers: A list of offers from merchants that have offerings related + to the image. + :vartype offers: + list[~azure.cognitiveservices.search.visualsearch.models.Offer] + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'seller': {'readonly': True}, + 'price': {'readonly': True}, + 'price_currency': {'readonly': True}, + 'availability': {'readonly': True}, + 'aggregate_rating': {'readonly': True}, + 'last_updated': {'readonly': True}, + 'offers': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'seller': {'key': 'seller', 'type': 'Organization'}, + 'price': {'key': 'price', 'type': 'float'}, + 'price_currency': {'key': 'priceCurrency', 'type': 'str'}, + 'availability': {'key': 'availability', 'type': 'str'}, + 'aggregate_rating': {'key': 'aggregateRating', 'type': 'AggregateRating'}, + 'last_updated': {'key': 'lastUpdated', 'type': 'str'}, + 'offers': {'key': 'offers', 'type': '[Offer]'}, + } + + def __init__(self, **kwargs): + super(AggregateOffer, self).__init__(**kwargs) + self.offers = None + self._type = 'AggregateOffer' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/aggregate_offer_py3.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/aggregate_offer_py3.py new file mode 100644 index 000000000000..5565960ea1b5 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/aggregate_offer_py3.py @@ -0,0 +1,135 @@ +# 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 .offer import Offer + + +class AggregateOffer(Offer): + """Defines a list of offers from merchants that are related to the image. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item. + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar seller: Seller for this offer. + :vartype seller: + ~azure.cognitiveservices.search.visualsearch.models.Organization + :ivar price: The item's price. + :vartype price: float + :ivar price_currency: The monetary currency. For example, USD. Possible + values include: 'USD', 'CAD', 'GBP', 'EUR', 'COP', 'JPY', 'CNY', 'AUD', + 'INR', 'AED', 'AFN', 'ALL', 'AMD', 'ANG', 'AOA', 'ARS', 'AWG', 'AZN', + 'BAM', 'BBD', 'BDT', 'BGN', 'BHD', 'BIF', 'BMD', 'BND', 'BOB', 'BOV', + 'BRL', 'BSD', 'BTN', 'BWP', 'BYR', 'BZD', 'CDF', 'CHE', 'CHF', 'CHW', + 'CLF', 'CLP', 'COU', 'CRC', 'CUC', 'CUP', 'CVE', 'CZK', 'DJF', 'DKK', + 'DOP', 'DZD', 'EGP', 'ERN', 'ETB', 'FJD', 'FKP', 'GEL', 'GHS', 'GIP', + 'GMD', 'GNF', 'GTQ', 'GYD', 'HKD', 'HNL', 'HRK', 'HTG', 'HUF', 'IDR', + 'ILS', 'IQD', 'IRR', 'ISK', 'JMD', 'JOD', 'KES', 'KGS', 'KHR', 'KMF', + 'KPW', 'KRW', 'KWD', 'KYD', 'KZT', 'LAK', 'LBP', 'LKR', 'LRD', 'LSL', + 'LYD', 'MAD', 'MDL', 'MGA', 'MKD', 'MMK', 'MNT', 'MOP', 'MRO', 'MUR', + 'MVR', 'MWK', 'MXN', 'MXV', 'MYR', 'MZN', 'NAD', 'NGN', 'NIO', 'NOK', + 'NPR', 'NZD', 'OMR', 'PAB', 'PEN', 'PGK', 'PHP', 'PKR', 'PLN', 'PYG', + 'QAR', 'RON', 'RSD', 'RUB', 'RWF', 'SAR', 'SBD', 'SCR', 'SDG', 'SEK', + 'SGD', 'SHP', 'SLL', 'SOS', 'SRD', 'SSP', 'STD', 'SYP', 'SZL', 'THB', + 'TJS', 'TMT', 'TND', 'TOP', 'TRY', 'TTD', 'TWD', 'TZS', 'UAH', 'UGX', + 'UYU', 'UZS', 'VEF', 'VND', 'VUV', 'WST', 'XAF', 'XCD', 'XOF', 'XPF', + 'YER', 'ZAR', 'ZMW'. Default value: "USD" . + :vartype price_currency: str or + ~azure.cognitiveservices.search.visualsearch.models.Currency + :ivar availability: The item's availability. The following are the + possible values: Discontinued, InStock, InStoreOnly, LimitedAvailability, + OnlineOnly, OutOfStock, PreOrder, SoldOut. Possible values include: + 'Discontinued', 'InStock', 'InStoreOnly', 'LimitedAvailability', + 'OnlineOnly', 'OutOfStock', 'PreOrder', 'SoldOut' + :vartype availability: str or + ~azure.cognitiveservices.search.visualsearch.models.ItemAvailability + :ivar aggregate_rating: An aggregated rating that indicates how well the + product has been rated by others. + :vartype aggregate_rating: + ~azure.cognitiveservices.search.visualsearch.models.AggregateRating + :ivar last_updated: The last date that the offer was updated. The date is + in the form YYYY-MM-DD. + :vartype last_updated: str + :ivar offers: A list of offers from merchants that have offerings related + to the image. + :vartype offers: + list[~azure.cognitiveservices.search.visualsearch.models.Offer] + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'seller': {'readonly': True}, + 'price': {'readonly': True}, + 'price_currency': {'readonly': True}, + 'availability': {'readonly': True}, + 'aggregate_rating': {'readonly': True}, + 'last_updated': {'readonly': True}, + 'offers': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'seller': {'key': 'seller', 'type': 'Organization'}, + 'price': {'key': 'price', 'type': 'float'}, + 'price_currency': {'key': 'priceCurrency', 'type': 'str'}, + 'availability': {'key': 'availability', 'type': 'str'}, + 'aggregate_rating': {'key': 'aggregateRating', 'type': 'AggregateRating'}, + 'last_updated': {'key': 'lastUpdated', 'type': 'str'}, + 'offers': {'key': 'offers', 'type': '[Offer]'}, + } + + def __init__(self, **kwargs) -> None: + super(AggregateOffer, self).__init__(**kwargs) + self.offers = None + self._type = 'AggregateOffer' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/aggregate_rating.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/aggregate_rating.py new file mode 100644 index 000000000000..288a2a2d0ea4 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/aggregate_rating.py @@ -0,0 +1,57 @@ +# 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 .rating import Rating + + +class AggregateRating(Rating): + """Defines the metrics that indicate how well an item was rated by others. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar text: Text representation of an item. + :vartype text: str + :param _type: Required. Constant filled by server. + :type _type: str + :param rating_value: Required. The mean (average) rating. The possible + values are 1.0 through 5.0. + :type rating_value: float + :ivar best_rating: The highest rated review. The possible values are 1.0 + through 5.0. + :vartype best_rating: float + :ivar review_count: The number of times the recipe has been rated or + reviewed. + :vartype review_count: int + """ + + _validation = { + 'text': {'readonly': True}, + '_type': {'required': True}, + 'rating_value': {'required': True}, + 'best_rating': {'readonly': True}, + 'review_count': {'readonly': True}, + } + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'}, + '_type': {'key': '_type', 'type': 'str'}, + 'rating_value': {'key': 'ratingValue', 'type': 'float'}, + 'best_rating': {'key': 'bestRating', 'type': 'float'}, + 'review_count': {'key': 'reviewCount', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(AggregateRating, self).__init__(**kwargs) + self.review_count = None + self._type = 'AggregateRating' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/aggregate_rating_py3.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/aggregate_rating_py3.py new file mode 100644 index 000000000000..ec4fe8aec9f7 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/aggregate_rating_py3.py @@ -0,0 +1,57 @@ +# 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 .rating import Rating + + +class AggregateRating(Rating): + """Defines the metrics that indicate how well an item was rated by others. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar text: Text representation of an item. + :vartype text: str + :param _type: Required. Constant filled by server. + :type _type: str + :param rating_value: Required. The mean (average) rating. The possible + values are 1.0 through 5.0. + :type rating_value: float + :ivar best_rating: The highest rated review. The possible values are 1.0 + through 5.0. + :vartype best_rating: float + :ivar review_count: The number of times the recipe has been rated or + reviewed. + :vartype review_count: int + """ + + _validation = { + 'text': {'readonly': True}, + '_type': {'required': True}, + 'rating_value': {'required': True}, + 'best_rating': {'readonly': True}, + 'review_count': {'readonly': True}, + } + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'}, + '_type': {'key': '_type', 'type': 'str'}, + 'rating_value': {'key': 'ratingValue', 'type': 'float'}, + 'best_rating': {'key': 'bestRating', 'type': 'float'}, + 'review_count': {'key': 'reviewCount', 'type': 'int'}, + } + + def __init__(self, *, rating_value: float, **kwargs) -> None: + super(AggregateRating, self).__init__(rating_value=rating_value, **kwargs) + self.review_count = None + self._type = 'AggregateRating' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/creative_work.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/creative_work.py new file mode 100644 index 000000000000..52904ea0f672 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/creative_work.py @@ -0,0 +1,106 @@ +# 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 .thing import Thing + + +class CreativeWork(Thing): + """The most generic kind of creative work, including books, movies, + photographs, software programs, etc. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Action, MediaObject, Recipe + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item. + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.visualsearch.models.Thing] + :ivar date_published: The date on which the CreativeWork was published. + :vartype date_published: str + :ivar text: Text content of this creative work. + :vartype text: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'provider': {'readonly': True}, + 'date_published': {'readonly': True}, + 'text': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'date_published': {'key': 'datePublished', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'Action': 'Action', 'MediaObject': 'MediaObject', 'Recipe': 'Recipe'} + } + + def __init__(self, **kwargs): + super(CreativeWork, self).__init__(**kwargs) + self.thumbnail_url = None + self.provider = None + self.date_published = None + self.text = None + self._type = 'CreativeWork' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/creative_work_py3.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/creative_work_py3.py new file mode 100644 index 000000000000..791ce86983b5 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/creative_work_py3.py @@ -0,0 +1,106 @@ +# 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 .thing import Thing + + +class CreativeWork(Thing): + """The most generic kind of creative work, including books, movies, + photographs, software programs, etc. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Action, MediaObject, Recipe + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item. + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.visualsearch.models.Thing] + :ivar date_published: The date on which the CreativeWork was published. + :vartype date_published: str + :ivar text: Text content of this creative work. + :vartype text: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'provider': {'readonly': True}, + 'date_published': {'readonly': True}, + 'text': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'date_published': {'key': 'datePublished', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'Action': 'Action', 'MediaObject': 'MediaObject', 'Recipe': 'Recipe'} + } + + def __init__(self, **kwargs) -> None: + super(CreativeWork, self).__init__(**kwargs) + self.thumbnail_url = None + self.provider = None + self.date_published = None + self.text = None + self._type = 'CreativeWork' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/crop_area.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/crop_area.py new file mode 100644 index 000000000000..79bd5454ec0c --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/crop_area.py @@ -0,0 +1,62 @@ +# 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.serialization import Model + + +class CropArea(Model): + """A JSON object consisting of coordinates specifying the four corners of a + cropped rectangle within the input image. + + All required parameters must be populated in order to send to Azure. + + :param top: Required. The top coordinate of the region to be cropped. The + coordinate is a fractional value of the original image's height and is + measured from the top edge of the image. Specify the coordinate as a value + from 0.0 through 1.0. + :type top: float + :param bottom: Required. The bottom coordinate of the region to be + cropped. The coordinate is a fractional value of the original image's + height and is measured from the top edge of the image. Specify the + coordinate as a value from 0.0 through 1.0. + :type bottom: float + :param left: Required. The left coordinate of the region to be cropped. + The coordinate is a fractional value of the original image's width and is + measured from the left edge of the image. Specify the coordinate as a + value from 0.0 through 1.0. + :type left: float + :param right: Required. The right coordinate of the region to be cropped. + The coordinate is a fractional value of the original image's width and is + measured from the left edge of the image. Specify the coordinate as a + value from 0.0 through 1.0. + :type right: float + """ + + _validation = { + 'top': {'required': True}, + 'bottom': {'required': True}, + 'left': {'required': True}, + 'right': {'required': True}, + } + + _attribute_map = { + 'top': {'key': 'top', 'type': 'float'}, + 'bottom': {'key': 'bottom', 'type': 'float'}, + 'left': {'key': 'left', 'type': 'float'}, + 'right': {'key': 'right', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(CropArea, self).__init__(**kwargs) + self.top = kwargs.get('top', None) + self.bottom = kwargs.get('bottom', None) + self.left = kwargs.get('left', None) + self.right = kwargs.get('right', None) diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/crop_area_py3.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/crop_area_py3.py new file mode 100644 index 000000000000..36386c7d6cbf --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/crop_area_py3.py @@ -0,0 +1,62 @@ +# 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.serialization import Model + + +class CropArea(Model): + """A JSON object consisting of coordinates specifying the four corners of a + cropped rectangle within the input image. + + All required parameters must be populated in order to send to Azure. + + :param top: Required. The top coordinate of the region to be cropped. The + coordinate is a fractional value of the original image's height and is + measured from the top edge of the image. Specify the coordinate as a value + from 0.0 through 1.0. + :type top: float + :param bottom: Required. The bottom coordinate of the region to be + cropped. The coordinate is a fractional value of the original image's + height and is measured from the top edge of the image. Specify the + coordinate as a value from 0.0 through 1.0. + :type bottom: float + :param left: Required. The left coordinate of the region to be cropped. + The coordinate is a fractional value of the original image's width and is + measured from the left edge of the image. Specify the coordinate as a + value from 0.0 through 1.0. + :type left: float + :param right: Required. The right coordinate of the region to be cropped. + The coordinate is a fractional value of the original image's width and is + measured from the left edge of the image. Specify the coordinate as a + value from 0.0 through 1.0. + :type right: float + """ + + _validation = { + 'top': {'required': True}, + 'bottom': {'required': True}, + 'left': {'required': True}, + 'right': {'required': True}, + } + + _attribute_map = { + 'top': {'key': 'top', 'type': 'float'}, + 'bottom': {'key': 'bottom', 'type': 'float'}, + 'left': {'key': 'left', 'type': 'float'}, + 'right': {'key': 'right', 'type': 'float'}, + } + + def __init__(self, *, top: float, bottom: float, left: float, right: float, **kwargs) -> None: + super(CropArea, self).__init__(**kwargs) + self.top = top + self.bottom = bottom + self.left = left + self.right = right diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/error.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/error.py new file mode 100644 index 000000000000..f28e2d243a5d --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/error.py @@ -0,0 +1,72 @@ +# 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.serialization import Model + + +class Error(Model): + """Defines the error that occurred. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. The error code that identifies the category of + error. Possible values include: 'None', 'ServerError', 'InvalidRequest', + 'RateLimitExceeded', 'InvalidAuthorization', 'InsufficientAuthorization'. + Default value: "None" . + :type code: str or + ~azure.cognitiveservices.search.visualsearch.models.ErrorCode + :ivar sub_code: The error code that further helps to identify the error. + Possible values include: 'UnexpectedError', 'ResourceError', + 'NotImplemented', 'ParameterMissing', 'ParameterInvalidValue', + 'HttpNotAllowed', 'Blocked', 'AuthorizationMissing', + 'AuthorizationRedundancy', 'AuthorizationDisabled', 'AuthorizationExpired' + :vartype sub_code: str or + ~azure.cognitiveservices.search.visualsearch.models.ErrorSubCode + :param message: Required. A description of the error. + :type message: str + :ivar more_details: A description that provides additional information + about the error. + :vartype more_details: str + :ivar parameter: The parameter in the request that caused the error. + :vartype parameter: str + :ivar value: The parameter's value in the request that was not valid. + :vartype value: str + """ + + _validation = { + 'code': {'required': True}, + 'sub_code': {'readonly': True}, + 'message': {'required': True}, + 'more_details': {'readonly': True}, + 'parameter': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'sub_code': {'key': 'subCode', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'more_details': {'key': 'moreDetails', 'type': 'str'}, + 'parameter': {'key': 'parameter', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Error, self).__init__(**kwargs) + self.code = kwargs.get('code', "None") + self.sub_code = None + self.message = kwargs.get('message', None) + self.more_details = None + self.parameter = None + self.value = None diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/error_py3.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/error_py3.py new file mode 100644 index 000000000000..1369eb2e470a --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/error_py3.py @@ -0,0 +1,72 @@ +# 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.serialization import Model + + +class Error(Model): + """Defines the error that occurred. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. The error code that identifies the category of + error. Possible values include: 'None', 'ServerError', 'InvalidRequest', + 'RateLimitExceeded', 'InvalidAuthorization', 'InsufficientAuthorization'. + Default value: "None" . + :type code: str or + ~azure.cognitiveservices.search.visualsearch.models.ErrorCode + :ivar sub_code: The error code that further helps to identify the error. + Possible values include: 'UnexpectedError', 'ResourceError', + 'NotImplemented', 'ParameterMissing', 'ParameterInvalidValue', + 'HttpNotAllowed', 'Blocked', 'AuthorizationMissing', + 'AuthorizationRedundancy', 'AuthorizationDisabled', 'AuthorizationExpired' + :vartype sub_code: str or + ~azure.cognitiveservices.search.visualsearch.models.ErrorSubCode + :param message: Required. A description of the error. + :type message: str + :ivar more_details: A description that provides additional information + about the error. + :vartype more_details: str + :ivar parameter: The parameter in the request that caused the error. + :vartype parameter: str + :ivar value: The parameter's value in the request that was not valid. + :vartype value: str + """ + + _validation = { + 'code': {'required': True}, + 'sub_code': {'readonly': True}, + 'message': {'required': True}, + 'more_details': {'readonly': True}, + 'parameter': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'sub_code': {'key': 'subCode', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'more_details': {'key': 'moreDetails', 'type': 'str'}, + 'parameter': {'key': 'parameter', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, message: str, code="None", **kwargs) -> None: + super(Error, self).__init__(**kwargs) + self.code = code + self.sub_code = None + self.message = message + self.more_details = None + self.parameter = None + self.value = None diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/error_response.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/error_response.py new file mode 100644 index 000000000000..0b12131a6227 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/error_response.py @@ -0,0 +1,71 @@ +# 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 .response import Response +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(Response): + """The top-level response that represents a failed request. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :param errors: Required. A list of errors that describe the reasons why + the request failed. + :type errors: + list[~azure.cognitiveservices.search.visualsearch.models.Error] + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'errors': {'required': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'errors': {'key': 'errors', 'type': '[Error]'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.errors = kwargs.get('errors', None) + self._type = 'ErrorResponse' + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/error_response_py3.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/error_response_py3.py new file mode 100644 index 000000000000..ae22ba3899d1 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/error_response_py3.py @@ -0,0 +1,71 @@ +# 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 .response import Response +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(Response): + """The top-level response that represents a failed request. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :param errors: Required. A list of errors that describe the reasons why + the request failed. + :type errors: + list[~azure.cognitiveservices.search.visualsearch.models.Error] + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'errors': {'required': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'errors': {'key': 'errors', 'type': '[Error]'}, + } + + def __init__(self, *, errors, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.errors = errors + self._type = 'ErrorResponse' + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/filters.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/filters.py new file mode 100644 index 000000000000..ef2dccb97dff --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/filters.py @@ -0,0 +1,37 @@ +# 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.serialization import Model + + +class Filters(Model): + """A key-value object consisting of filters that may be specified to limit the + results returned by the API. Current available filters: site. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar site: The URL of the site to return similar images and similar + products from. (e.g., "www.bing.com", "bing.com"). + :vartype site: str + """ + + _validation = { + 'site': {'readonly': True}, + } + + _attribute_map = { + 'site': {'key': 'site', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Filters, self).__init__(**kwargs) + self.site = None diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/filters_py3.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/filters_py3.py new file mode 100644 index 000000000000..f7557011909d --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/filters_py3.py @@ -0,0 +1,37 @@ +# 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.serialization import Model + + +class Filters(Model): + """A key-value object consisting of filters that may be specified to limit the + results returned by the API. Current available filters: site. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar site: The URL of the site to return similar images and similar + products from. (e.g., "www.bing.com", "bing.com"). + :vartype site: str + """ + + _validation = { + 'site': {'readonly': True}, + } + + _attribute_map = { + 'site': {'key': 'site', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Filters, self).__init__(**kwargs) + self.site = None diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/identifiable.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/identifiable.py new file mode 100644 index 000000000000..513e53d238bb --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/identifiable.py @@ -0,0 +1,49 @@ +# 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 .response_base import ResponseBase + + +class Identifiable(ResponseBase): + """Defines the identity of a resource. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Response + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'Response': 'Response'} + } + + def __init__(self, **kwargs): + super(Identifiable, self).__init__(**kwargs) + self.id = None + self._type = 'Identifiable' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/identifiable_py3.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/identifiable_py3.py new file mode 100644 index 000000000000..c87dc0347e3d --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/identifiable_py3.py @@ -0,0 +1,49 @@ +# 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 .response_base import ResponseBase + + +class Identifiable(ResponseBase): + """Defines the identity of a resource. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Response + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'Response': 'Response'} + } + + def __init__(self, **kwargs) -> None: + super(Identifiable, self).__init__(**kwargs) + self.id = None + self._type = 'Identifiable' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_action.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_action.py new file mode 100644 index 000000000000..6cefee2ed482 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_action.py @@ -0,0 +1,127 @@ +# 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 .action import Action + + +class ImageAction(Action): + """ImageAction. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ImageEntityAction, ImageModuleAction, ImageRecipesAction, + ImageRelatedSearchesAction, ImageShoppingSourcesAction + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item. + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.visualsearch.models.Thing] + :ivar date_published: The date on which the CreativeWork was published. + :vartype date_published: str + :ivar text: Text content of this creative work. + :vartype text: str + :ivar result: The result produced in the action. + :vartype result: + list[~azure.cognitiveservices.search.visualsearch.models.Thing] + :ivar display_name: A display name for the action. + :vartype display_name: str + :ivar is_top_action: A Boolean representing whether this result is the top + action. + :vartype is_top_action: bool + :ivar service_url: Use this URL to get additional data to determine how to + take the appropriate action. For example, the serviceUrl might return JSON + along with an image URL. + :vartype service_url: str + :ivar action_type: A string representing the type of action. + :vartype action_type: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'provider': {'readonly': True}, + 'date_published': {'readonly': True}, + 'text': {'readonly': True}, + 'result': {'readonly': True}, + 'display_name': {'readonly': True}, + 'is_top_action': {'readonly': True}, + 'service_url': {'readonly': True}, + 'action_type': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'date_published': {'key': 'datePublished', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + 'result': {'key': 'result', 'type': '[Thing]'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'is_top_action': {'key': 'isTopAction', 'type': 'bool'}, + 'service_url': {'key': 'serviceUrl', 'type': 'str'}, + 'action_type': {'key': 'actionType', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'ImageEntityAction': 'ImageEntityAction', 'ImageModuleAction': 'ImageModuleAction', 'ImageRecipesAction': 'ImageRecipesAction', 'ImageRelatedSearchesAction': 'ImageRelatedSearchesAction', 'ImageShoppingSourcesAction': 'ImageShoppingSourcesAction'} + } + + def __init__(self, **kwargs): + super(ImageAction, self).__init__(**kwargs) + self.action_type = None + self._type = 'ImageAction' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_action_py3.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_action_py3.py new file mode 100644 index 000000000000..0ff2485500aa --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_action_py3.py @@ -0,0 +1,127 @@ +# 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 .action import Action + + +class ImageAction(Action): + """ImageAction. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ImageEntityAction, ImageModuleAction, ImageRecipesAction, + ImageRelatedSearchesAction, ImageShoppingSourcesAction + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item. + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.visualsearch.models.Thing] + :ivar date_published: The date on which the CreativeWork was published. + :vartype date_published: str + :ivar text: Text content of this creative work. + :vartype text: str + :ivar result: The result produced in the action. + :vartype result: + list[~azure.cognitiveservices.search.visualsearch.models.Thing] + :ivar display_name: A display name for the action. + :vartype display_name: str + :ivar is_top_action: A Boolean representing whether this result is the top + action. + :vartype is_top_action: bool + :ivar service_url: Use this URL to get additional data to determine how to + take the appropriate action. For example, the serviceUrl might return JSON + along with an image URL. + :vartype service_url: str + :ivar action_type: A string representing the type of action. + :vartype action_type: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'provider': {'readonly': True}, + 'date_published': {'readonly': True}, + 'text': {'readonly': True}, + 'result': {'readonly': True}, + 'display_name': {'readonly': True}, + 'is_top_action': {'readonly': True}, + 'service_url': {'readonly': True}, + 'action_type': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'date_published': {'key': 'datePublished', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + 'result': {'key': 'result', 'type': '[Thing]'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'is_top_action': {'key': 'isTopAction', 'type': 'bool'}, + 'service_url': {'key': 'serviceUrl', 'type': 'str'}, + 'action_type': {'key': 'actionType', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'ImageEntityAction': 'ImageEntityAction', 'ImageModuleAction': 'ImageModuleAction', 'ImageRecipesAction': 'ImageRecipesAction', 'ImageRelatedSearchesAction': 'ImageRelatedSearchesAction', 'ImageShoppingSourcesAction': 'ImageShoppingSourcesAction'} + } + + def __init__(self, **kwargs) -> None: + super(ImageAction, self).__init__(**kwargs) + self.action_type = None + self._type = 'ImageAction' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_entity_action.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_entity_action.py new file mode 100644 index 000000000000..1cb297790789 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_entity_action.py @@ -0,0 +1,123 @@ +# 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 .image_action import ImageAction + + +class ImageEntityAction(ImageAction): + """ImageEntityAction. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item. + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.visualsearch.models.Thing] + :ivar date_published: The date on which the CreativeWork was published. + :vartype date_published: str + :ivar text: Text content of this creative work. + :vartype text: str + :ivar result: The result produced in the action. + :vartype result: + list[~azure.cognitiveservices.search.visualsearch.models.Thing] + :ivar display_name: A display name for the action. + :vartype display_name: str + :ivar is_top_action: A Boolean representing whether this result is the top + action. + :vartype is_top_action: bool + :ivar service_url: Use this URL to get additional data to determine how to + take the appropriate action. For example, the serviceUrl might return JSON + along with an image URL. + :vartype service_url: str + :ivar action_type: A string representing the type of action. + :vartype action_type: str + :ivar data: Information about the entity. + :vartype data: ~azure.cognitiveservices.search.visualsearch.models.Thing + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'provider': {'readonly': True}, + 'date_published': {'readonly': True}, + 'text': {'readonly': True}, + 'result': {'readonly': True}, + 'display_name': {'readonly': True}, + 'is_top_action': {'readonly': True}, + 'service_url': {'readonly': True}, + 'action_type': {'readonly': True}, + 'data': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'date_published': {'key': 'datePublished', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + 'result': {'key': 'result', 'type': '[Thing]'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'is_top_action': {'key': 'isTopAction', 'type': 'bool'}, + 'service_url': {'key': 'serviceUrl', 'type': 'str'}, + 'action_type': {'key': 'actionType', 'type': 'str'}, + 'data': {'key': 'data', 'type': 'Thing'}, + } + + def __init__(self, **kwargs): + super(ImageEntityAction, self).__init__(**kwargs) + self.data = None + self._type = 'ImageEntityAction' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_entity_action_py3.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_entity_action_py3.py new file mode 100644 index 000000000000..88ad26e6db15 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_entity_action_py3.py @@ -0,0 +1,123 @@ +# 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 .image_action import ImageAction + + +class ImageEntityAction(ImageAction): + """ImageEntityAction. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item. + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.visualsearch.models.Thing] + :ivar date_published: The date on which the CreativeWork was published. + :vartype date_published: str + :ivar text: Text content of this creative work. + :vartype text: str + :ivar result: The result produced in the action. + :vartype result: + list[~azure.cognitiveservices.search.visualsearch.models.Thing] + :ivar display_name: A display name for the action. + :vartype display_name: str + :ivar is_top_action: A Boolean representing whether this result is the top + action. + :vartype is_top_action: bool + :ivar service_url: Use this URL to get additional data to determine how to + take the appropriate action. For example, the serviceUrl might return JSON + along with an image URL. + :vartype service_url: str + :ivar action_type: A string representing the type of action. + :vartype action_type: str + :ivar data: Information about the entity. + :vartype data: ~azure.cognitiveservices.search.visualsearch.models.Thing + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'provider': {'readonly': True}, + 'date_published': {'readonly': True}, + 'text': {'readonly': True}, + 'result': {'readonly': True}, + 'display_name': {'readonly': True}, + 'is_top_action': {'readonly': True}, + 'service_url': {'readonly': True}, + 'action_type': {'readonly': True}, + 'data': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'date_published': {'key': 'datePublished', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + 'result': {'key': 'result', 'type': '[Thing]'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'is_top_action': {'key': 'isTopAction', 'type': 'bool'}, + 'service_url': {'key': 'serviceUrl', 'type': 'str'}, + 'action_type': {'key': 'actionType', 'type': 'str'}, + 'data': {'key': 'data', 'type': 'Thing'}, + } + + def __init__(self, **kwargs) -> None: + super(ImageEntityAction, self).__init__(**kwargs) + self.data = None + self._type = 'ImageEntityAction' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_info.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_info.py new file mode 100644 index 000000000000..4b0bdd363ccd --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_info.py @@ -0,0 +1,62 @@ +# 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.serialization import Model + + +class ImageInfo(Model): + """A JSON object that identities the image to get insights of . It also + includes the optional crop area that you use to identify the region of + interest in the image. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar image_insights_token: An image insights token. To get the insights + token, call one of the Image Search APIs (for example, /images/search). In + the search results, the + [Image](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#image) + object's + [imageInsightsToken](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#image-imageinsightstoken) + field contains the token. The imageInsightsToken and url fields mutually + exclusive; do not specify both. Do not specify an insights token if the + request includes the image form data. + :vartype image_insights_token: str + :ivar url: The URL of the input image. The imageInsightsToken and url + fields are mutually exclusive; do not specify both. Do not specify the URL + if the request includes the image form data. + :vartype url: str + :ivar crop_area: A JSON object consisting of coordinates specifying the + four corners of a cropped rectangle within the input image. Use the crop + area to identify the region of interest in the image. You can apply the + crop area to the images specified using the imageInsightsToken or url + fields, or an image binary specified in an image form data. + :vartype crop_area: + ~azure.cognitiveservices.search.visualsearch.models.CropArea + """ + + _validation = { + 'image_insights_token': {'readonly': True}, + 'url': {'readonly': True}, + 'crop_area': {'readonly': True}, + } + + _attribute_map = { + 'image_insights_token': {'key': 'imageInsightsToken', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'crop_area': {'key': 'cropArea', 'type': 'CropArea'}, + } + + def __init__(self, **kwargs): + super(ImageInfo, self).__init__(**kwargs) + self.image_insights_token = None + self.url = None + self.crop_area = None diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_info_py3.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_info_py3.py new file mode 100644 index 000000000000..507a5e706b6d --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_info_py3.py @@ -0,0 +1,62 @@ +# 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.serialization import Model + + +class ImageInfo(Model): + """A JSON object that identities the image to get insights of . It also + includes the optional crop area that you use to identify the region of + interest in the image. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar image_insights_token: An image insights token. To get the insights + token, call one of the Image Search APIs (for example, /images/search). In + the search results, the + [Image](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#image) + object's + [imageInsightsToken](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#image-imageinsightstoken) + field contains the token. The imageInsightsToken and url fields mutually + exclusive; do not specify both. Do not specify an insights token if the + request includes the image form data. + :vartype image_insights_token: str + :ivar url: The URL of the input image. The imageInsightsToken and url + fields are mutually exclusive; do not specify both. Do not specify the URL + if the request includes the image form data. + :vartype url: str + :ivar crop_area: A JSON object consisting of coordinates specifying the + four corners of a cropped rectangle within the input image. Use the crop + area to identify the region of interest in the image. You can apply the + crop area to the images specified using the imageInsightsToken or url + fields, or an image binary specified in an image form data. + :vartype crop_area: + ~azure.cognitiveservices.search.visualsearch.models.CropArea + """ + + _validation = { + 'image_insights_token': {'readonly': True}, + 'url': {'readonly': True}, + 'crop_area': {'readonly': True}, + } + + _attribute_map = { + 'image_insights_token': {'key': 'imageInsightsToken', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'crop_area': {'key': 'cropArea', 'type': 'CropArea'}, + } + + def __init__(self, **kwargs) -> None: + super(ImageInfo, self).__init__(**kwargs) + self.image_insights_token = None + self.url = None + self.crop_area = None diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_knowledge.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_knowledge.py new file mode 100644 index 000000000000..18ec46ba7eaf --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_knowledge.py @@ -0,0 +1,63 @@ +# 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 .response import Response + + +class ImageKnowledge(Response): + """ImageKnowledge. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :ivar tags: A list of visual search tags. + :vartype tags: + list[~azure.cognitiveservices.search.visualsearch.models.ImageTag] + :ivar image: Image object containing metadata about the requested image. + :vartype image: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'tags': {'readonly': True}, + 'image': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '[ImageTag]'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + } + + def __init__(self, **kwargs): + super(ImageKnowledge, self).__init__(**kwargs) + self.tags = None + self.image = None + self._type = 'ImageKnowledge' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_knowledge_py3.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_knowledge_py3.py new file mode 100644 index 000000000000..637dc7e91a51 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_knowledge_py3.py @@ -0,0 +1,63 @@ +# 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 .response import Response + + +class ImageKnowledge(Response): + """ImageKnowledge. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :ivar tags: A list of visual search tags. + :vartype tags: + list[~azure.cognitiveservices.search.visualsearch.models.ImageTag] + :ivar image: Image object containing metadata about the requested image. + :vartype image: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'tags': {'readonly': True}, + 'image': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '[ImageTag]'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + } + + def __init__(self, **kwargs) -> None: + super(ImageKnowledge, self).__init__(**kwargs) + self.tags = None + self.image = None + self._type = 'ImageKnowledge' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_module_action.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_module_action.py new file mode 100644 index 000000000000..7c4103aaedc2 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_module_action.py @@ -0,0 +1,124 @@ +# 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 .image_action import ImageAction + + +class ImageModuleAction(ImageAction): + """ImageModuleAction. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item. + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.visualsearch.models.Thing] + :ivar date_published: The date on which the CreativeWork was published. + :vartype date_published: str + :ivar text: Text content of this creative work. + :vartype text: str + :ivar result: The result produced in the action. + :vartype result: + list[~azure.cognitiveservices.search.visualsearch.models.Thing] + :ivar display_name: A display name for the action. + :vartype display_name: str + :ivar is_top_action: A Boolean representing whether this result is the top + action. + :vartype is_top_action: bool + :ivar service_url: Use this URL to get additional data to determine how to + take the appropriate action. For example, the serviceUrl might return JSON + along with an image URL. + :vartype service_url: str + :ivar action_type: A string representing the type of action. + :vartype action_type: str + :ivar data: A list of images. + :vartype data: + ~azure.cognitiveservices.search.visualsearch.models.ImagesModule + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'provider': {'readonly': True}, + 'date_published': {'readonly': True}, + 'text': {'readonly': True}, + 'result': {'readonly': True}, + 'display_name': {'readonly': True}, + 'is_top_action': {'readonly': True}, + 'service_url': {'readonly': True}, + 'action_type': {'readonly': True}, + 'data': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'date_published': {'key': 'datePublished', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + 'result': {'key': 'result', 'type': '[Thing]'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'is_top_action': {'key': 'isTopAction', 'type': 'bool'}, + 'service_url': {'key': 'serviceUrl', 'type': 'str'}, + 'action_type': {'key': 'actionType', 'type': 'str'}, + 'data': {'key': 'data', 'type': 'ImagesModule'}, + } + + def __init__(self, **kwargs): + super(ImageModuleAction, self).__init__(**kwargs) + self.data = None + self._type = 'ImageModuleAction' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_module_action_py3.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_module_action_py3.py new file mode 100644 index 000000000000..2b258fc7f593 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_module_action_py3.py @@ -0,0 +1,124 @@ +# 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 .image_action import ImageAction + + +class ImageModuleAction(ImageAction): + """ImageModuleAction. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item. + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.visualsearch.models.Thing] + :ivar date_published: The date on which the CreativeWork was published. + :vartype date_published: str + :ivar text: Text content of this creative work. + :vartype text: str + :ivar result: The result produced in the action. + :vartype result: + list[~azure.cognitiveservices.search.visualsearch.models.Thing] + :ivar display_name: A display name for the action. + :vartype display_name: str + :ivar is_top_action: A Boolean representing whether this result is the top + action. + :vartype is_top_action: bool + :ivar service_url: Use this URL to get additional data to determine how to + take the appropriate action. For example, the serviceUrl might return JSON + along with an image URL. + :vartype service_url: str + :ivar action_type: A string representing the type of action. + :vartype action_type: str + :ivar data: A list of images. + :vartype data: + ~azure.cognitiveservices.search.visualsearch.models.ImagesModule + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'provider': {'readonly': True}, + 'date_published': {'readonly': True}, + 'text': {'readonly': True}, + 'result': {'readonly': True}, + 'display_name': {'readonly': True}, + 'is_top_action': {'readonly': True}, + 'service_url': {'readonly': True}, + 'action_type': {'readonly': True}, + 'data': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'date_published': {'key': 'datePublished', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + 'result': {'key': 'result', 'type': '[Thing]'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'is_top_action': {'key': 'isTopAction', 'type': 'bool'}, + 'service_url': {'key': 'serviceUrl', 'type': 'str'}, + 'action_type': {'key': 'actionType', 'type': 'str'}, + 'data': {'key': 'data', 'type': 'ImagesModule'}, + } + + def __init__(self, **kwargs) -> None: + super(ImageModuleAction, self).__init__(**kwargs) + self.data = None + self._type = 'ImageModuleAction' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_object.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_object.py new file mode 100644 index 000000000000..eb930bba284a --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_object.py @@ -0,0 +1,168 @@ +# 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 .media_object import MediaObject + + +class ImageObject(MediaObject): + """Defines an image. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item. + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.visualsearch.models.Thing] + :ivar date_published: The date on which the CreativeWork was published. + :vartype date_published: str + :ivar text: Text content of this creative work. + :vartype text: str + :ivar content_url: Original URL to retrieve the source (file) for the + media object (e.g., the source URL for the image). + :vartype content_url: str + :ivar host_page_url: URL of the page that hosts the media object. + :vartype host_page_url: str + :ivar content_size: Size of the media object content. Use format "value + unit" (e.g., "1024 B"). + :vartype content_size: str + :ivar encoding_format: Encoding format (e.g., mp3, mp4, jpeg, etc). + :vartype encoding_format: str + :ivar host_page_display_url: Display URL of the page that hosts the media + object. + :vartype host_page_display_url: str + :ivar width: The width of the media object, in pixels. + :vartype width: int + :ivar height: The height of the media object, in pixels. + :vartype height: int + :ivar thumbnail: The URL to a thumbnail of the image. + :vartype thumbnail: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + :ivar image_insights_token: The token that you use in a subsequent call to + Visual Search API to get additional information about the image. For + information about using this token, see the imageInsightsToken field + inside the knowledgeRequest request parameter. + :vartype image_insights_token: str + :ivar insights_metadata: A count of the number of websites where you can + shop or perform other actions related to the image. For example, if the + 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 in a + subsequent Visual Search API call to get the list of shopping websites. + :vartype insights_metadata: + ~azure.cognitiveservices.search.visualsearch.models.ImagesImageMetadata + :ivar image_id: Unique Id for the image. + :vartype image_id: str + :ivar accent_color: A three-byte hexadecimal number that represents the + color that dominates the image. Use the color as the temporary background + in your client until the image is loaded. + :vartype accent_color: str + :ivar visual_words: For interal use only. + :vartype visual_words: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'provider': {'readonly': True}, + 'date_published': {'readonly': True}, + 'text': {'readonly': True}, + 'content_url': {'readonly': True}, + 'host_page_url': {'readonly': True}, + 'content_size': {'readonly': True}, + 'encoding_format': {'readonly': True}, + 'host_page_display_url': {'readonly': True}, + 'width': {'readonly': True}, + 'height': {'readonly': True}, + 'thumbnail': {'readonly': True}, + 'image_insights_token': {'readonly': True}, + 'insights_metadata': {'readonly': True}, + 'image_id': {'readonly': True}, + 'accent_color': {'readonly': True}, + 'visual_words': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'date_published': {'key': 'datePublished', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + 'content_url': {'key': 'contentUrl', 'type': 'str'}, + 'host_page_url': {'key': 'hostPageUrl', 'type': 'str'}, + 'content_size': {'key': 'contentSize', 'type': 'str'}, + 'encoding_format': {'key': 'encodingFormat', 'type': 'str'}, + 'host_page_display_url': {'key': 'hostPageDisplayUrl', 'type': 'str'}, + 'width': {'key': 'width', 'type': 'int'}, + 'height': {'key': 'height', 'type': 'int'}, + 'thumbnail': {'key': 'thumbnail', 'type': 'ImageObject'}, + 'image_insights_token': {'key': 'imageInsightsToken', 'type': 'str'}, + 'insights_metadata': {'key': 'insightsMetadata', 'type': 'ImagesImageMetadata'}, + 'image_id': {'key': 'imageId', 'type': 'str'}, + 'accent_color': {'key': 'accentColor', 'type': 'str'}, + 'visual_words': {'key': 'visualWords', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ImageObject, self).__init__(**kwargs) + self.thumbnail = None + self.image_insights_token = None + self.insights_metadata = None + self.image_id = None + self.accent_color = None + self.visual_words = None + self._type = 'ImageObject' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_object_py3.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_object_py3.py new file mode 100644 index 000000000000..7f9ea4eb226a --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_object_py3.py @@ -0,0 +1,168 @@ +# 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 .media_object import MediaObject + + +class ImageObject(MediaObject): + """Defines an image. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item. + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.visualsearch.models.Thing] + :ivar date_published: The date on which the CreativeWork was published. + :vartype date_published: str + :ivar text: Text content of this creative work. + :vartype text: str + :ivar content_url: Original URL to retrieve the source (file) for the + media object (e.g., the source URL for the image). + :vartype content_url: str + :ivar host_page_url: URL of the page that hosts the media object. + :vartype host_page_url: str + :ivar content_size: Size of the media object content. Use format "value + unit" (e.g., "1024 B"). + :vartype content_size: str + :ivar encoding_format: Encoding format (e.g., mp3, mp4, jpeg, etc). + :vartype encoding_format: str + :ivar host_page_display_url: Display URL of the page that hosts the media + object. + :vartype host_page_display_url: str + :ivar width: The width of the media object, in pixels. + :vartype width: int + :ivar height: The height of the media object, in pixels. + :vartype height: int + :ivar thumbnail: The URL to a thumbnail of the image. + :vartype thumbnail: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + :ivar image_insights_token: The token that you use in a subsequent call to + Visual Search API to get additional information about the image. For + information about using this token, see the imageInsightsToken field + inside the knowledgeRequest request parameter. + :vartype image_insights_token: str + :ivar insights_metadata: A count of the number of websites where you can + shop or perform other actions related to the image. For example, if the + 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 in a + subsequent Visual Search API call to get the list of shopping websites. + :vartype insights_metadata: + ~azure.cognitiveservices.search.visualsearch.models.ImagesImageMetadata + :ivar image_id: Unique Id for the image. + :vartype image_id: str + :ivar accent_color: A three-byte hexadecimal number that represents the + color that dominates the image. Use the color as the temporary background + in your client until the image is loaded. + :vartype accent_color: str + :ivar visual_words: For interal use only. + :vartype visual_words: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'provider': {'readonly': True}, + 'date_published': {'readonly': True}, + 'text': {'readonly': True}, + 'content_url': {'readonly': True}, + 'host_page_url': {'readonly': True}, + 'content_size': {'readonly': True}, + 'encoding_format': {'readonly': True}, + 'host_page_display_url': {'readonly': True}, + 'width': {'readonly': True}, + 'height': {'readonly': True}, + 'thumbnail': {'readonly': True}, + 'image_insights_token': {'readonly': True}, + 'insights_metadata': {'readonly': True}, + 'image_id': {'readonly': True}, + 'accent_color': {'readonly': True}, + 'visual_words': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'date_published': {'key': 'datePublished', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + 'content_url': {'key': 'contentUrl', 'type': 'str'}, + 'host_page_url': {'key': 'hostPageUrl', 'type': 'str'}, + 'content_size': {'key': 'contentSize', 'type': 'str'}, + 'encoding_format': {'key': 'encodingFormat', 'type': 'str'}, + 'host_page_display_url': {'key': 'hostPageDisplayUrl', 'type': 'str'}, + 'width': {'key': 'width', 'type': 'int'}, + 'height': {'key': 'height', 'type': 'int'}, + 'thumbnail': {'key': 'thumbnail', 'type': 'ImageObject'}, + 'image_insights_token': {'key': 'imageInsightsToken', 'type': 'str'}, + 'insights_metadata': {'key': 'insightsMetadata', 'type': 'ImagesImageMetadata'}, + 'image_id': {'key': 'imageId', 'type': 'str'}, + 'accent_color': {'key': 'accentColor', 'type': 'str'}, + 'visual_words': {'key': 'visualWords', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ImageObject, self).__init__(**kwargs) + self.thumbnail = None + self.image_insights_token = None + self.insights_metadata = None + self.image_id = None + self.accent_color = None + self.visual_words = None + self._type = 'ImageObject' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_recipes_action.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_recipes_action.py new file mode 100644 index 000000000000..360fccbcf6e2 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_recipes_action.py @@ -0,0 +1,124 @@ +# 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 .image_action import ImageAction + + +class ImageRecipesAction(ImageAction): + """ImageRecipesAction. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item. + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.visualsearch.models.Thing] + :ivar date_published: The date on which the CreativeWork was published. + :vartype date_published: str + :ivar text: Text content of this creative work. + :vartype text: str + :ivar result: The result produced in the action. + :vartype result: + list[~azure.cognitiveservices.search.visualsearch.models.Thing] + :ivar display_name: A display name for the action. + :vartype display_name: str + :ivar is_top_action: A Boolean representing whether this result is the top + action. + :vartype is_top_action: bool + :ivar service_url: Use this URL to get additional data to determine how to + take the appropriate action. For example, the serviceUrl might return JSON + along with an image URL. + :vartype service_url: str + :ivar action_type: A string representing the type of action. + :vartype action_type: str + :ivar data: A list of recipes related to the image. + :vartype data: + ~azure.cognitiveservices.search.visualsearch.models.RecipesModule + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'provider': {'readonly': True}, + 'date_published': {'readonly': True}, + 'text': {'readonly': True}, + 'result': {'readonly': True}, + 'display_name': {'readonly': True}, + 'is_top_action': {'readonly': True}, + 'service_url': {'readonly': True}, + 'action_type': {'readonly': True}, + 'data': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'date_published': {'key': 'datePublished', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + 'result': {'key': 'result', 'type': '[Thing]'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'is_top_action': {'key': 'isTopAction', 'type': 'bool'}, + 'service_url': {'key': 'serviceUrl', 'type': 'str'}, + 'action_type': {'key': 'actionType', 'type': 'str'}, + 'data': {'key': 'data', 'type': 'RecipesModule'}, + } + + def __init__(self, **kwargs): + super(ImageRecipesAction, self).__init__(**kwargs) + self.data = None + self._type = 'ImageRecipesAction' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_recipes_action_py3.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_recipes_action_py3.py new file mode 100644 index 000000000000..42b4b87cc25d --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_recipes_action_py3.py @@ -0,0 +1,124 @@ +# 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 .image_action import ImageAction + + +class ImageRecipesAction(ImageAction): + """ImageRecipesAction. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item. + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.visualsearch.models.Thing] + :ivar date_published: The date on which the CreativeWork was published. + :vartype date_published: str + :ivar text: Text content of this creative work. + :vartype text: str + :ivar result: The result produced in the action. + :vartype result: + list[~azure.cognitiveservices.search.visualsearch.models.Thing] + :ivar display_name: A display name for the action. + :vartype display_name: str + :ivar is_top_action: A Boolean representing whether this result is the top + action. + :vartype is_top_action: bool + :ivar service_url: Use this URL to get additional data to determine how to + take the appropriate action. For example, the serviceUrl might return JSON + along with an image URL. + :vartype service_url: str + :ivar action_type: A string representing the type of action. + :vartype action_type: str + :ivar data: A list of recipes related to the image. + :vartype data: + ~azure.cognitiveservices.search.visualsearch.models.RecipesModule + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'provider': {'readonly': True}, + 'date_published': {'readonly': True}, + 'text': {'readonly': True}, + 'result': {'readonly': True}, + 'display_name': {'readonly': True}, + 'is_top_action': {'readonly': True}, + 'service_url': {'readonly': True}, + 'action_type': {'readonly': True}, + 'data': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'date_published': {'key': 'datePublished', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + 'result': {'key': 'result', 'type': '[Thing]'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'is_top_action': {'key': 'isTopAction', 'type': 'bool'}, + 'service_url': {'key': 'serviceUrl', 'type': 'str'}, + 'action_type': {'key': 'actionType', 'type': 'str'}, + 'data': {'key': 'data', 'type': 'RecipesModule'}, + } + + def __init__(self, **kwargs) -> None: + super(ImageRecipesAction, self).__init__(**kwargs) + self.data = None + self._type = 'ImageRecipesAction' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_related_searches_action.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_related_searches_action.py new file mode 100644 index 000000000000..53ff3dc895d6 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_related_searches_action.py @@ -0,0 +1,124 @@ +# 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 .image_action import ImageAction + + +class ImageRelatedSearchesAction(ImageAction): + """ImageRelatedSearchesAction. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item. + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.visualsearch.models.Thing] + :ivar date_published: The date on which the CreativeWork was published. + :vartype date_published: str + :ivar text: Text content of this creative work. + :vartype text: str + :ivar result: The result produced in the action. + :vartype result: + list[~azure.cognitiveservices.search.visualsearch.models.Thing] + :ivar display_name: A display name for the action. + :vartype display_name: str + :ivar is_top_action: A Boolean representing whether this result is the top + action. + :vartype is_top_action: bool + :ivar service_url: Use this URL to get additional data to determine how to + take the appropriate action. For example, the serviceUrl might return JSON + along with an image URL. + :vartype service_url: str + :ivar action_type: A string representing the type of action. + :vartype action_type: str + :ivar data: A list of queries related to the image. + :vartype data: + ~azure.cognitiveservices.search.visualsearch.models.RelatedSearchesModule + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'provider': {'readonly': True}, + 'date_published': {'readonly': True}, + 'text': {'readonly': True}, + 'result': {'readonly': True}, + 'display_name': {'readonly': True}, + 'is_top_action': {'readonly': True}, + 'service_url': {'readonly': True}, + 'action_type': {'readonly': True}, + 'data': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'date_published': {'key': 'datePublished', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + 'result': {'key': 'result', 'type': '[Thing]'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'is_top_action': {'key': 'isTopAction', 'type': 'bool'}, + 'service_url': {'key': 'serviceUrl', 'type': 'str'}, + 'action_type': {'key': 'actionType', 'type': 'str'}, + 'data': {'key': 'data', 'type': 'RelatedSearchesModule'}, + } + + def __init__(self, **kwargs): + super(ImageRelatedSearchesAction, self).__init__(**kwargs) + self.data = None + self._type = 'ImageRelatedSearchesAction' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_related_searches_action_py3.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_related_searches_action_py3.py new file mode 100644 index 000000000000..83c2a527a509 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_related_searches_action_py3.py @@ -0,0 +1,124 @@ +# 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 .image_action import ImageAction + + +class ImageRelatedSearchesAction(ImageAction): + """ImageRelatedSearchesAction. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item. + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.visualsearch.models.Thing] + :ivar date_published: The date on which the CreativeWork was published. + :vartype date_published: str + :ivar text: Text content of this creative work. + :vartype text: str + :ivar result: The result produced in the action. + :vartype result: + list[~azure.cognitiveservices.search.visualsearch.models.Thing] + :ivar display_name: A display name for the action. + :vartype display_name: str + :ivar is_top_action: A Boolean representing whether this result is the top + action. + :vartype is_top_action: bool + :ivar service_url: Use this URL to get additional data to determine how to + take the appropriate action. For example, the serviceUrl might return JSON + along with an image URL. + :vartype service_url: str + :ivar action_type: A string representing the type of action. + :vartype action_type: str + :ivar data: A list of queries related to the image. + :vartype data: + ~azure.cognitiveservices.search.visualsearch.models.RelatedSearchesModule + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'provider': {'readonly': True}, + 'date_published': {'readonly': True}, + 'text': {'readonly': True}, + 'result': {'readonly': True}, + 'display_name': {'readonly': True}, + 'is_top_action': {'readonly': True}, + 'service_url': {'readonly': True}, + 'action_type': {'readonly': True}, + 'data': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'date_published': {'key': 'datePublished', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + 'result': {'key': 'result', 'type': '[Thing]'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'is_top_action': {'key': 'isTopAction', 'type': 'bool'}, + 'service_url': {'key': 'serviceUrl', 'type': 'str'}, + 'action_type': {'key': 'actionType', 'type': 'str'}, + 'data': {'key': 'data', 'type': 'RelatedSearchesModule'}, + } + + def __init__(self, **kwargs) -> None: + super(ImageRelatedSearchesAction, self).__init__(**kwargs) + self.data = None + self._type = 'ImageRelatedSearchesAction' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_shopping_sources_action.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_shopping_sources_action.py new file mode 100644 index 000000000000..14e101a740c4 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_shopping_sources_action.py @@ -0,0 +1,124 @@ +# 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 .image_action import ImageAction + + +class ImageShoppingSourcesAction(ImageAction): + """ImageShoppingSourcesAction. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item. + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.visualsearch.models.Thing] + :ivar date_published: The date on which the CreativeWork was published. + :vartype date_published: str + :ivar text: Text content of this creative work. + :vartype text: str + :ivar result: The result produced in the action. + :vartype result: + list[~azure.cognitiveservices.search.visualsearch.models.Thing] + :ivar display_name: A display name for the action. + :vartype display_name: str + :ivar is_top_action: A Boolean representing whether this result is the top + action. + :vartype is_top_action: bool + :ivar service_url: Use this URL to get additional data to determine how to + take the appropriate action. For example, the serviceUrl might return JSON + along with an image URL. + :vartype service_url: str + :ivar action_type: A string representing the type of action. + :vartype action_type: str + :ivar data: A list of merchants that offer items related to the image. + :vartype data: + ~azure.cognitiveservices.search.visualsearch.models.AggregateOffer + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'provider': {'readonly': True}, + 'date_published': {'readonly': True}, + 'text': {'readonly': True}, + 'result': {'readonly': True}, + 'display_name': {'readonly': True}, + 'is_top_action': {'readonly': True}, + 'service_url': {'readonly': True}, + 'action_type': {'readonly': True}, + 'data': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'date_published': {'key': 'datePublished', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + 'result': {'key': 'result', 'type': '[Thing]'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'is_top_action': {'key': 'isTopAction', 'type': 'bool'}, + 'service_url': {'key': 'serviceUrl', 'type': 'str'}, + 'action_type': {'key': 'actionType', 'type': 'str'}, + 'data': {'key': 'data', 'type': 'AggregateOffer'}, + } + + def __init__(self, **kwargs): + super(ImageShoppingSourcesAction, self).__init__(**kwargs) + self.data = None + self._type = 'ImageShoppingSourcesAction' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_shopping_sources_action_py3.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_shopping_sources_action_py3.py new file mode 100644 index 000000000000..0647c7ca9c35 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_shopping_sources_action_py3.py @@ -0,0 +1,124 @@ +# 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 .image_action import ImageAction + + +class ImageShoppingSourcesAction(ImageAction): + """ImageShoppingSourcesAction. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item. + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.visualsearch.models.Thing] + :ivar date_published: The date on which the CreativeWork was published. + :vartype date_published: str + :ivar text: Text content of this creative work. + :vartype text: str + :ivar result: The result produced in the action. + :vartype result: + list[~azure.cognitiveservices.search.visualsearch.models.Thing] + :ivar display_name: A display name for the action. + :vartype display_name: str + :ivar is_top_action: A Boolean representing whether this result is the top + action. + :vartype is_top_action: bool + :ivar service_url: Use this URL to get additional data to determine how to + take the appropriate action. For example, the serviceUrl might return JSON + along with an image URL. + :vartype service_url: str + :ivar action_type: A string representing the type of action. + :vartype action_type: str + :ivar data: A list of merchants that offer items related to the image. + :vartype data: + ~azure.cognitiveservices.search.visualsearch.models.AggregateOffer + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'provider': {'readonly': True}, + 'date_published': {'readonly': True}, + 'text': {'readonly': True}, + 'result': {'readonly': True}, + 'display_name': {'readonly': True}, + 'is_top_action': {'readonly': True}, + 'service_url': {'readonly': True}, + 'action_type': {'readonly': True}, + 'data': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'date_published': {'key': 'datePublished', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + 'result': {'key': 'result', 'type': '[Thing]'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'is_top_action': {'key': 'isTopAction', 'type': 'bool'}, + 'service_url': {'key': 'serviceUrl', 'type': 'str'}, + 'action_type': {'key': 'actionType', 'type': 'str'}, + 'data': {'key': 'data', 'type': 'AggregateOffer'}, + } + + def __init__(self, **kwargs) -> None: + super(ImageShoppingSourcesAction, self).__init__(**kwargs) + self.data = None + self._type = 'ImageShoppingSourcesAction' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_tag.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_tag.py new file mode 100644 index 000000000000..93cc9dff48a2 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_tag.py @@ -0,0 +1,98 @@ +# 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 .thing import Thing + + +class ImageTag(Thing): + """ImageTag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item. + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar display_name: Display name for this tag. For the default tag, the + display name is empty. + :vartype display_name: str + :ivar bounding_box: The bounding box for this tag. For the default tag, + there is no bounding box. + :vartype bounding_box: + ~azure.cognitiveservices.search.visualsearch.models.ImageTagRegion + :ivar actions: Actions within this tag. The order of the items denotes the + default ranking order of these actions, with the first action being the + most likely user intent. + :vartype actions: + list[~azure.cognitiveservices.search.visualsearch.models.ImageAction] + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'display_name': {'readonly': True}, + 'bounding_box': {'readonly': True}, + 'actions': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'bounding_box': {'key': 'boundingBox', 'type': 'ImageTagRegion'}, + 'actions': {'key': 'actions', 'type': '[ImageAction]'}, + } + + def __init__(self, **kwargs): + super(ImageTag, self).__init__(**kwargs) + self.display_name = None + self.bounding_box = None + self.actions = None + self._type = 'ImageTag' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_tag_py3.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_tag_py3.py new file mode 100644 index 000000000000..c23391843572 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_tag_py3.py @@ -0,0 +1,98 @@ +# 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 .thing import Thing + + +class ImageTag(Thing): + """ImageTag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item. + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar display_name: Display name for this tag. For the default tag, the + display name is empty. + :vartype display_name: str + :ivar bounding_box: The bounding box for this tag. For the default tag, + there is no bounding box. + :vartype bounding_box: + ~azure.cognitiveservices.search.visualsearch.models.ImageTagRegion + :ivar actions: Actions within this tag. The order of the items denotes the + default ranking order of these actions, with the first action being the + most likely user intent. + :vartype actions: + list[~azure.cognitiveservices.search.visualsearch.models.ImageAction] + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'display_name': {'readonly': True}, + 'bounding_box': {'readonly': True}, + 'actions': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'bounding_box': {'key': 'boundingBox', 'type': 'ImageTagRegion'}, + 'actions': {'key': 'actions', 'type': '[ImageAction]'}, + } + + def __init__(self, **kwargs) -> None: + super(ImageTag, self).__init__(**kwargs) + self.display_name = None + self.bounding_box = None + self.actions = None + self._type = 'ImageTag' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_tag_region.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_tag_region.py new file mode 100644 index 000000000000..5f2e6b9f6fd8 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_tag_region.py @@ -0,0 +1,43 @@ +# 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.serialization import Model + + +class ImageTagRegion(Model): + """ImageTagRegion. + + All required parameters must be populated in order to send to Azure. + + :param query_rectangle: Required. A rectangle that outlines the area of + interest for this tag. + :type query_rectangle: + ~azure.cognitiveservices.search.visualsearch.models.NormalizedQuadrilateral + :param display_rectangle: Required. A recommended rectangle to show to the + user. + :type display_rectangle: + ~azure.cognitiveservices.search.visualsearch.models.NormalizedQuadrilateral + """ + + _validation = { + 'query_rectangle': {'required': True}, + 'display_rectangle': {'required': True}, + } + + _attribute_map = { + 'query_rectangle': {'key': 'queryRectangle', 'type': 'NormalizedQuadrilateral'}, + 'display_rectangle': {'key': 'displayRectangle', 'type': 'NormalizedQuadrilateral'}, + } + + def __init__(self, **kwargs): + super(ImageTagRegion, self).__init__(**kwargs) + self.query_rectangle = kwargs.get('query_rectangle', None) + self.display_rectangle = kwargs.get('display_rectangle', None) diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_tag_region_py3.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_tag_region_py3.py new file mode 100644 index 000000000000..3e77b58e698d --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_tag_region_py3.py @@ -0,0 +1,43 @@ +# 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.serialization import Model + + +class ImageTagRegion(Model): + """ImageTagRegion. + + All required parameters must be populated in order to send to Azure. + + :param query_rectangle: Required. A rectangle that outlines the area of + interest for this tag. + :type query_rectangle: + ~azure.cognitiveservices.search.visualsearch.models.NormalizedQuadrilateral + :param display_rectangle: Required. A recommended rectangle to show to the + user. + :type display_rectangle: + ~azure.cognitiveservices.search.visualsearch.models.NormalizedQuadrilateral + """ + + _validation = { + 'query_rectangle': {'required': True}, + 'display_rectangle': {'required': True}, + } + + _attribute_map = { + 'query_rectangle': {'key': 'queryRectangle', 'type': 'NormalizedQuadrilateral'}, + 'display_rectangle': {'key': 'displayRectangle', 'type': 'NormalizedQuadrilateral'}, + } + + def __init__(self, *, query_rectangle, display_rectangle, **kwargs) -> None: + super(ImageTagRegion, self).__init__(**kwargs) + self.query_rectangle = query_rectangle + self.display_rectangle = display_rectangle diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/images_image_metadata.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/images_image_metadata.py new file mode 100644 index 000000000000..96d255ffc8d5 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/images_image_metadata.py @@ -0,0 +1,53 @@ +# 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.serialization import Model + + +class ImagesImageMetadata(Model): + """Defines a count of the number of websites where you can shop or perform + other actions related to the image. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar shopping_sources_count: The number of websites that sell the + products seen in the image. + :vartype shopping_sources_count: int + :ivar recipe_sources_count: The number of websites that offer recipes of + the food seen in the image. + :vartype recipe_sources_count: int + :ivar aggregate_offer: A summary of the online offers of products found in + the image. For example, if the image is of a dress, the offer might + identify the lowest price and the number of offers found. Only visually + similar products insights include this field. The offer includes the + following fields: Name, AggregateRating, OfferCount, and LowPrice. + :vartype aggregate_offer: + ~azure.cognitiveservices.search.visualsearch.models.AggregateOffer + """ + + _validation = { + 'shopping_sources_count': {'readonly': True}, + 'recipe_sources_count': {'readonly': True}, + 'aggregate_offer': {'readonly': True}, + } + + _attribute_map = { + 'shopping_sources_count': {'key': 'shoppingSourcesCount', 'type': 'int'}, + 'recipe_sources_count': {'key': 'recipeSourcesCount', 'type': 'int'}, + 'aggregate_offer': {'key': 'aggregateOffer', 'type': 'AggregateOffer'}, + } + + def __init__(self, **kwargs): + super(ImagesImageMetadata, self).__init__(**kwargs) + self.shopping_sources_count = None + self.recipe_sources_count = None + self.aggregate_offer = None diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/images_image_metadata_py3.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/images_image_metadata_py3.py new file mode 100644 index 000000000000..0ba88c41b358 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/images_image_metadata_py3.py @@ -0,0 +1,53 @@ +# 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.serialization import Model + + +class ImagesImageMetadata(Model): + """Defines a count of the number of websites where you can shop or perform + other actions related to the image. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar shopping_sources_count: The number of websites that sell the + products seen in the image. + :vartype shopping_sources_count: int + :ivar recipe_sources_count: The number of websites that offer recipes of + the food seen in the image. + :vartype recipe_sources_count: int + :ivar aggregate_offer: A summary of the online offers of products found in + the image. For example, if the image is of a dress, the offer might + identify the lowest price and the number of offers found. Only visually + similar products insights include this field. The offer includes the + following fields: Name, AggregateRating, OfferCount, and LowPrice. + :vartype aggregate_offer: + ~azure.cognitiveservices.search.visualsearch.models.AggregateOffer + """ + + _validation = { + 'shopping_sources_count': {'readonly': True}, + 'recipe_sources_count': {'readonly': True}, + 'aggregate_offer': {'readonly': True}, + } + + _attribute_map = { + 'shopping_sources_count': {'key': 'shoppingSourcesCount', 'type': 'int'}, + 'recipe_sources_count': {'key': 'recipeSourcesCount', 'type': 'int'}, + 'aggregate_offer': {'key': 'aggregateOffer', 'type': 'AggregateOffer'}, + } + + def __init__(self, **kwargs) -> None: + super(ImagesImageMetadata, self).__init__(**kwargs) + self.shopping_sources_count = None + self.recipe_sources_count = None + self.aggregate_offer = None diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/images_module.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/images_module.py new file mode 100644 index 000000000000..d7bc800c4e69 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/images_module.py @@ -0,0 +1,36 @@ +# 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.serialization import Model + + +class ImagesModule(Model): + """Defines a list of images. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: A list of images. + :vartype value: + list[~azure.cognitiveservices.search.visualsearch.models.ImageObject] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ImageObject]'}, + } + + def __init__(self, **kwargs): + super(ImagesModule, self).__init__(**kwargs) + self.value = None diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/images_module_py3.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/images_module_py3.py new file mode 100644 index 000000000000..2fea5770f20d --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/images_module_py3.py @@ -0,0 +1,36 @@ +# 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.serialization import Model + + +class ImagesModule(Model): + """Defines a list of images. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: A list of images. + :vartype value: + list[~azure.cognitiveservices.search.visualsearch.models.ImageObject] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ImageObject]'}, + } + + def __init__(self, **kwargs) -> None: + super(ImagesModule, self).__init__(**kwargs) + self.value = None diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/intangible.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/intangible.py new file mode 100644 index 000000000000..df7e3dce1cbd --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/intangible.py @@ -0,0 +1,85 @@ +# 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 .thing import Thing + + +class Intangible(Thing): + """A utility class that serves as the umbrella for a number of 'intangible' + things such as quantities, structured values, etc. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: StructuredValue + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item. + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'StructuredValue': 'StructuredValue'} + } + + def __init__(self, **kwargs): + super(Intangible, self).__init__(**kwargs) + self._type = 'Intangible' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/intangible_py3.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/intangible_py3.py new file mode 100644 index 000000000000..7c09fc43e1ea --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/intangible_py3.py @@ -0,0 +1,85 @@ +# 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 .thing import Thing + + +class Intangible(Thing): + """A utility class that serves as the umbrella for a number of 'intangible' + things such as quantities, structured values, etc. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: StructuredValue + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item. + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'StructuredValue': 'StructuredValue'} + } + + def __init__(self, **kwargs) -> None: + super(Intangible, self).__init__(**kwargs) + self._type = 'Intangible' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/knowledge_request.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/knowledge_request.py new file mode 100644 index 000000000000..2b9ac602a6ca --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/knowledge_request.py @@ -0,0 +1,38 @@ +# 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.serialization import Model + + +class KnowledgeRequest(Model): + """A JSON object containing information about the request, such as filters for + the resulting actions. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar filters: A key-value object consisting of filters that may be + specified to limit the results returned by the API. + :vartype filters: + ~azure.cognitiveservices.search.visualsearch.models.Filters + """ + + _validation = { + 'filters': {'readonly': True}, + } + + _attribute_map = { + 'filters': {'key': 'filters', 'type': 'Filters'}, + } + + def __init__(self, **kwargs): + super(KnowledgeRequest, self).__init__(**kwargs) + self.filters = None diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/knowledge_request_py3.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/knowledge_request_py3.py new file mode 100644 index 000000000000..a5df1f33bf82 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/knowledge_request_py3.py @@ -0,0 +1,38 @@ +# 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.serialization import Model + + +class KnowledgeRequest(Model): + """A JSON object containing information about the request, such as filters for + the resulting actions. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar filters: A key-value object consisting of filters that may be + specified to limit the results returned by the API. + :vartype filters: + ~azure.cognitiveservices.search.visualsearch.models.Filters + """ + + _validation = { + 'filters': {'readonly': True}, + } + + _attribute_map = { + 'filters': {'key': 'filters', 'type': 'Filters'}, + } + + def __init__(self, **kwargs) -> None: + super(KnowledgeRequest, self).__init__(**kwargs) + self.filters = None diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/media_object.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/media_object.py new file mode 100644 index 000000000000..ec58382e5f65 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/media_object.py @@ -0,0 +1,139 @@ +# 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 .creative_work import CreativeWork + + +class MediaObject(CreativeWork): + """Defines a media object. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ImageObject + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item. + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.visualsearch.models.Thing] + :ivar date_published: The date on which the CreativeWork was published. + :vartype date_published: str + :ivar text: Text content of this creative work. + :vartype text: str + :ivar content_url: Original URL to retrieve the source (file) for the + media object (e.g., the source URL for the image). + :vartype content_url: str + :ivar host_page_url: URL of the page that hosts the media object. + :vartype host_page_url: str + :ivar content_size: Size of the media object content. Use format "value + unit" (e.g., "1024 B"). + :vartype content_size: str + :ivar encoding_format: Encoding format (e.g., mp3, mp4, jpeg, etc). + :vartype encoding_format: str + :ivar host_page_display_url: Display URL of the page that hosts the media + object. + :vartype host_page_display_url: str + :ivar width: The width of the media object, in pixels. + :vartype width: int + :ivar height: The height of the media object, in pixels. + :vartype height: int + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'provider': {'readonly': True}, + 'date_published': {'readonly': True}, + 'text': {'readonly': True}, + 'content_url': {'readonly': True}, + 'host_page_url': {'readonly': True}, + 'content_size': {'readonly': True}, + 'encoding_format': {'readonly': True}, + 'host_page_display_url': {'readonly': True}, + 'width': {'readonly': True}, + 'height': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'date_published': {'key': 'datePublished', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + 'content_url': {'key': 'contentUrl', 'type': 'str'}, + 'host_page_url': {'key': 'hostPageUrl', 'type': 'str'}, + 'content_size': {'key': 'contentSize', 'type': 'str'}, + 'encoding_format': {'key': 'encodingFormat', 'type': 'str'}, + 'host_page_display_url': {'key': 'hostPageDisplayUrl', 'type': 'str'}, + 'width': {'key': 'width', 'type': 'int'}, + 'height': {'key': 'height', 'type': 'int'}, + } + + _subtype_map = { + '_type': {'ImageObject': 'ImageObject'} + } + + def __init__(self, **kwargs): + super(MediaObject, self).__init__(**kwargs) + self.content_url = None + self.host_page_url = None + self.content_size = None + self.encoding_format = None + self.host_page_display_url = None + self.width = None + self.height = None + self._type = 'MediaObject' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/media_object_py3.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/media_object_py3.py new file mode 100644 index 000000000000..2cdec85cd450 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/media_object_py3.py @@ -0,0 +1,139 @@ +# 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 .creative_work import CreativeWork + + +class MediaObject(CreativeWork): + """Defines a media object. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ImageObject + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item. + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.visualsearch.models.Thing] + :ivar date_published: The date on which the CreativeWork was published. + :vartype date_published: str + :ivar text: Text content of this creative work. + :vartype text: str + :ivar content_url: Original URL to retrieve the source (file) for the + media object (e.g., the source URL for the image). + :vartype content_url: str + :ivar host_page_url: URL of the page that hosts the media object. + :vartype host_page_url: str + :ivar content_size: Size of the media object content. Use format "value + unit" (e.g., "1024 B"). + :vartype content_size: str + :ivar encoding_format: Encoding format (e.g., mp3, mp4, jpeg, etc). + :vartype encoding_format: str + :ivar host_page_display_url: Display URL of the page that hosts the media + object. + :vartype host_page_display_url: str + :ivar width: The width of the media object, in pixels. + :vartype width: int + :ivar height: The height of the media object, in pixels. + :vartype height: int + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'provider': {'readonly': True}, + 'date_published': {'readonly': True}, + 'text': {'readonly': True}, + 'content_url': {'readonly': True}, + 'host_page_url': {'readonly': True}, + 'content_size': {'readonly': True}, + 'encoding_format': {'readonly': True}, + 'host_page_display_url': {'readonly': True}, + 'width': {'readonly': True}, + 'height': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'date_published': {'key': 'datePublished', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + 'content_url': {'key': 'contentUrl', 'type': 'str'}, + 'host_page_url': {'key': 'hostPageUrl', 'type': 'str'}, + 'content_size': {'key': 'contentSize', 'type': 'str'}, + 'encoding_format': {'key': 'encodingFormat', 'type': 'str'}, + 'host_page_display_url': {'key': 'hostPageDisplayUrl', 'type': 'str'}, + 'width': {'key': 'width', 'type': 'int'}, + 'height': {'key': 'height', 'type': 'int'}, + } + + _subtype_map = { + '_type': {'ImageObject': 'ImageObject'} + } + + def __init__(self, **kwargs) -> None: + super(MediaObject, self).__init__(**kwargs) + self.content_url = None + self.host_page_url = None + self.content_size = None + self.encoding_format = None + self.host_page_display_url = None + self.width = None + self.height = None + self._type = 'MediaObject' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/normalized_quadrilateral.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/normalized_quadrilateral.py new file mode 100644 index 000000000000..c6af84a50235 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/normalized_quadrilateral.py @@ -0,0 +1,104 @@ +# 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 .structured_value import StructuredValue + + +class NormalizedQuadrilateral(StructuredValue): + """Defines a region of an image. The region is a convex quadrilateral defined + by coordinates of its top left, top right, bottom left, and bottom right + points. The coordinates are fractional values of the original image's width + and height in the range 0.0 through 1.0. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item. + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :param top_left: Required. The top left corner coordinate. + :type top_left: + ~azure.cognitiveservices.search.visualsearch.models.Point2D + :param top_right: Required. The top right corner coordinate. + :type top_right: + ~azure.cognitiveservices.search.visualsearch.models.Point2D + :param bottom_right: Required. The bottom right corner coordinate. + :type bottom_right: + ~azure.cognitiveservices.search.visualsearch.models.Point2D + :param bottom_left: Required. The bottom left corner coordinate. + :type bottom_left: + ~azure.cognitiveservices.search.visualsearch.models.Point2D + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'top_left': {'required': True}, + 'top_right': {'required': True}, + 'bottom_right': {'required': True}, + 'bottom_left': {'required': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'top_left': {'key': 'topLeft', 'type': 'Point2D'}, + 'top_right': {'key': 'topRight', 'type': 'Point2D'}, + 'bottom_right': {'key': 'bottomRight', 'type': 'Point2D'}, + 'bottom_left': {'key': 'bottomLeft', 'type': 'Point2D'}, + } + + def __init__(self, **kwargs): + super(NormalizedQuadrilateral, self).__init__(**kwargs) + self.top_left = kwargs.get('top_left', None) + self.top_right = kwargs.get('top_right', None) + self.bottom_right = kwargs.get('bottom_right', None) + self.bottom_left = kwargs.get('bottom_left', None) + self._type = 'NormalizedQuadrilateral' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/normalized_quadrilateral_py3.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/normalized_quadrilateral_py3.py new file mode 100644 index 000000000000..fadb4501ee22 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/normalized_quadrilateral_py3.py @@ -0,0 +1,104 @@ +# 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 .structured_value import StructuredValue + + +class NormalizedQuadrilateral(StructuredValue): + """Defines a region of an image. The region is a convex quadrilateral defined + by coordinates of its top left, top right, bottom left, and bottom right + points. The coordinates are fractional values of the original image's width + and height in the range 0.0 through 1.0. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item. + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :param top_left: Required. The top left corner coordinate. + :type top_left: + ~azure.cognitiveservices.search.visualsearch.models.Point2D + :param top_right: Required. The top right corner coordinate. + :type top_right: + ~azure.cognitiveservices.search.visualsearch.models.Point2D + :param bottom_right: Required. The bottom right corner coordinate. + :type bottom_right: + ~azure.cognitiveservices.search.visualsearch.models.Point2D + :param bottom_left: Required. The bottom left corner coordinate. + :type bottom_left: + ~azure.cognitiveservices.search.visualsearch.models.Point2D + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'top_left': {'required': True}, + 'top_right': {'required': True}, + 'bottom_right': {'required': True}, + 'bottom_left': {'required': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'top_left': {'key': 'topLeft', 'type': 'Point2D'}, + 'top_right': {'key': 'topRight', 'type': 'Point2D'}, + 'bottom_right': {'key': 'bottomRight', 'type': 'Point2D'}, + 'bottom_left': {'key': 'bottomLeft', 'type': 'Point2D'}, + } + + def __init__(self, *, top_left, top_right, bottom_right, bottom_left, **kwargs) -> None: + super(NormalizedQuadrilateral, self).__init__(**kwargs) + self.top_left = top_left + self.top_right = top_right + self.bottom_right = bottom_right + self.bottom_left = bottom_left + self._type = 'NormalizedQuadrilateral' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/offer.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/offer.py new file mode 100644 index 000000000000..bcb9f81f0496 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/offer.py @@ -0,0 +1,141 @@ +# 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 .thing import Thing + + +class Offer(Thing): + """Defines a merchant's offer. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AggregateOffer + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item. + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar seller: Seller for this offer. + :vartype seller: + ~azure.cognitiveservices.search.visualsearch.models.Organization + :ivar price: The item's price. + :vartype price: float + :ivar price_currency: The monetary currency. For example, USD. Possible + values include: 'USD', 'CAD', 'GBP', 'EUR', 'COP', 'JPY', 'CNY', 'AUD', + 'INR', 'AED', 'AFN', 'ALL', 'AMD', 'ANG', 'AOA', 'ARS', 'AWG', 'AZN', + 'BAM', 'BBD', 'BDT', 'BGN', 'BHD', 'BIF', 'BMD', 'BND', 'BOB', 'BOV', + 'BRL', 'BSD', 'BTN', 'BWP', 'BYR', 'BZD', 'CDF', 'CHE', 'CHF', 'CHW', + 'CLF', 'CLP', 'COU', 'CRC', 'CUC', 'CUP', 'CVE', 'CZK', 'DJF', 'DKK', + 'DOP', 'DZD', 'EGP', 'ERN', 'ETB', 'FJD', 'FKP', 'GEL', 'GHS', 'GIP', + 'GMD', 'GNF', 'GTQ', 'GYD', 'HKD', 'HNL', 'HRK', 'HTG', 'HUF', 'IDR', + 'ILS', 'IQD', 'IRR', 'ISK', 'JMD', 'JOD', 'KES', 'KGS', 'KHR', 'KMF', + 'KPW', 'KRW', 'KWD', 'KYD', 'KZT', 'LAK', 'LBP', 'LKR', 'LRD', 'LSL', + 'LYD', 'MAD', 'MDL', 'MGA', 'MKD', 'MMK', 'MNT', 'MOP', 'MRO', 'MUR', + 'MVR', 'MWK', 'MXN', 'MXV', 'MYR', 'MZN', 'NAD', 'NGN', 'NIO', 'NOK', + 'NPR', 'NZD', 'OMR', 'PAB', 'PEN', 'PGK', 'PHP', 'PKR', 'PLN', 'PYG', + 'QAR', 'RON', 'RSD', 'RUB', 'RWF', 'SAR', 'SBD', 'SCR', 'SDG', 'SEK', + 'SGD', 'SHP', 'SLL', 'SOS', 'SRD', 'SSP', 'STD', 'SYP', 'SZL', 'THB', + 'TJS', 'TMT', 'TND', 'TOP', 'TRY', 'TTD', 'TWD', 'TZS', 'UAH', 'UGX', + 'UYU', 'UZS', 'VEF', 'VND', 'VUV', 'WST', 'XAF', 'XCD', 'XOF', 'XPF', + 'YER', 'ZAR', 'ZMW'. Default value: "USD" . + :vartype price_currency: str or + ~azure.cognitiveservices.search.visualsearch.models.Currency + :ivar availability: The item's availability. The following are the + possible values: Discontinued, InStock, InStoreOnly, LimitedAvailability, + OnlineOnly, OutOfStock, PreOrder, SoldOut. Possible values include: + 'Discontinued', 'InStock', 'InStoreOnly', 'LimitedAvailability', + 'OnlineOnly', 'OutOfStock', 'PreOrder', 'SoldOut' + :vartype availability: str or + ~azure.cognitiveservices.search.visualsearch.models.ItemAvailability + :ivar aggregate_rating: An aggregated rating that indicates how well the + product has been rated by others. + :vartype aggregate_rating: + ~azure.cognitiveservices.search.visualsearch.models.AggregateRating + :ivar last_updated: The last date that the offer was updated. The date is + in the form YYYY-MM-DD. + :vartype last_updated: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'seller': {'readonly': True}, + 'price': {'readonly': True}, + 'price_currency': {'readonly': True}, + 'availability': {'readonly': True}, + 'aggregate_rating': {'readonly': True}, + 'last_updated': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'seller': {'key': 'seller', 'type': 'Organization'}, + 'price': {'key': 'price', 'type': 'float'}, + 'price_currency': {'key': 'priceCurrency', 'type': 'str'}, + 'availability': {'key': 'availability', 'type': 'str'}, + 'aggregate_rating': {'key': 'aggregateRating', 'type': 'AggregateRating'}, + 'last_updated': {'key': 'lastUpdated', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'AggregateOffer': 'AggregateOffer'} + } + + def __init__(self, **kwargs): + super(Offer, self).__init__(**kwargs) + self.seller = None + self.price = None + self.price_currency = None + self.availability = None + self.aggregate_rating = None + self.last_updated = None + self._type = 'Offer' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/offer_py3.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/offer_py3.py new file mode 100644 index 000000000000..ef3da614f4df --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/offer_py3.py @@ -0,0 +1,141 @@ +# 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 .thing import Thing + + +class Offer(Thing): + """Defines a merchant's offer. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AggregateOffer + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item. + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar seller: Seller for this offer. + :vartype seller: + ~azure.cognitiveservices.search.visualsearch.models.Organization + :ivar price: The item's price. + :vartype price: float + :ivar price_currency: The monetary currency. For example, USD. Possible + values include: 'USD', 'CAD', 'GBP', 'EUR', 'COP', 'JPY', 'CNY', 'AUD', + 'INR', 'AED', 'AFN', 'ALL', 'AMD', 'ANG', 'AOA', 'ARS', 'AWG', 'AZN', + 'BAM', 'BBD', 'BDT', 'BGN', 'BHD', 'BIF', 'BMD', 'BND', 'BOB', 'BOV', + 'BRL', 'BSD', 'BTN', 'BWP', 'BYR', 'BZD', 'CDF', 'CHE', 'CHF', 'CHW', + 'CLF', 'CLP', 'COU', 'CRC', 'CUC', 'CUP', 'CVE', 'CZK', 'DJF', 'DKK', + 'DOP', 'DZD', 'EGP', 'ERN', 'ETB', 'FJD', 'FKP', 'GEL', 'GHS', 'GIP', + 'GMD', 'GNF', 'GTQ', 'GYD', 'HKD', 'HNL', 'HRK', 'HTG', 'HUF', 'IDR', + 'ILS', 'IQD', 'IRR', 'ISK', 'JMD', 'JOD', 'KES', 'KGS', 'KHR', 'KMF', + 'KPW', 'KRW', 'KWD', 'KYD', 'KZT', 'LAK', 'LBP', 'LKR', 'LRD', 'LSL', + 'LYD', 'MAD', 'MDL', 'MGA', 'MKD', 'MMK', 'MNT', 'MOP', 'MRO', 'MUR', + 'MVR', 'MWK', 'MXN', 'MXV', 'MYR', 'MZN', 'NAD', 'NGN', 'NIO', 'NOK', + 'NPR', 'NZD', 'OMR', 'PAB', 'PEN', 'PGK', 'PHP', 'PKR', 'PLN', 'PYG', + 'QAR', 'RON', 'RSD', 'RUB', 'RWF', 'SAR', 'SBD', 'SCR', 'SDG', 'SEK', + 'SGD', 'SHP', 'SLL', 'SOS', 'SRD', 'SSP', 'STD', 'SYP', 'SZL', 'THB', + 'TJS', 'TMT', 'TND', 'TOP', 'TRY', 'TTD', 'TWD', 'TZS', 'UAH', 'UGX', + 'UYU', 'UZS', 'VEF', 'VND', 'VUV', 'WST', 'XAF', 'XCD', 'XOF', 'XPF', + 'YER', 'ZAR', 'ZMW'. Default value: "USD" . + :vartype price_currency: str or + ~azure.cognitiveservices.search.visualsearch.models.Currency + :ivar availability: The item's availability. The following are the + possible values: Discontinued, InStock, InStoreOnly, LimitedAvailability, + OnlineOnly, OutOfStock, PreOrder, SoldOut. Possible values include: + 'Discontinued', 'InStock', 'InStoreOnly', 'LimitedAvailability', + 'OnlineOnly', 'OutOfStock', 'PreOrder', 'SoldOut' + :vartype availability: str or + ~azure.cognitiveservices.search.visualsearch.models.ItemAvailability + :ivar aggregate_rating: An aggregated rating that indicates how well the + product has been rated by others. + :vartype aggregate_rating: + ~azure.cognitiveservices.search.visualsearch.models.AggregateRating + :ivar last_updated: The last date that the offer was updated. The date is + in the form YYYY-MM-DD. + :vartype last_updated: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'seller': {'readonly': True}, + 'price': {'readonly': True}, + 'price_currency': {'readonly': True}, + 'availability': {'readonly': True}, + 'aggregate_rating': {'readonly': True}, + 'last_updated': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'seller': {'key': 'seller', 'type': 'Organization'}, + 'price': {'key': 'price', 'type': 'float'}, + 'price_currency': {'key': 'priceCurrency', 'type': 'str'}, + 'availability': {'key': 'availability', 'type': 'str'}, + 'aggregate_rating': {'key': 'aggregateRating', 'type': 'AggregateRating'}, + 'last_updated': {'key': 'lastUpdated', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'AggregateOffer': 'AggregateOffer'} + } + + def __init__(self, **kwargs) -> None: + super(Offer, self).__init__(**kwargs) + self.seller = None + self.price = None + self.price_currency = None + self.availability = None + self.aggregate_rating = None + self.last_updated = None + self._type = 'Offer' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/organization.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/organization.py new file mode 100644 index 000000000000..105e3f425e8e --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/organization.py @@ -0,0 +1,77 @@ +# 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 .thing import Thing + + +class Organization(Thing): + """Defines an organization. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item. + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Organization, self).__init__(**kwargs) + self._type = 'Organization' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/organization_py3.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/organization_py3.py new file mode 100644 index 000000000000..5e4a71a21be6 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/organization_py3.py @@ -0,0 +1,77 @@ +# 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 .thing import Thing + + +class Organization(Thing): + """Defines an organization. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item. + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Organization, self).__init__(**kwargs) + self._type = 'Organization' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/person.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/person.py new file mode 100644 index 000000000000..da6fb850eebe --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/person.py @@ -0,0 +1,87 @@ +# 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 .thing import Thing + + +class Person(Thing): + """Defines a person. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item. + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar job_title: The person's job title. + :vartype job_title: str + :ivar twitter_profile: The URL of the person's twitter profile. + :vartype twitter_profile: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'job_title': {'readonly': True}, + 'twitter_profile': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'job_title': {'key': 'jobTitle', 'type': 'str'}, + 'twitter_profile': {'key': 'twitterProfile', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Person, self).__init__(**kwargs) + self.job_title = None + self.twitter_profile = None + self._type = 'Person' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/person_py3.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/person_py3.py new file mode 100644 index 000000000000..edbfcd02eba4 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/person_py3.py @@ -0,0 +1,87 @@ +# 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 .thing import Thing + + +class Person(Thing): + """Defines a person. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item. + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar job_title: The person's job title. + :vartype job_title: str + :ivar twitter_profile: The URL of the person's twitter profile. + :vartype twitter_profile: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'job_title': {'readonly': True}, + 'twitter_profile': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'job_title': {'key': 'jobTitle', 'type': 'str'}, + 'twitter_profile': {'key': 'twitterProfile', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Person, self).__init__(**kwargs) + self.job_title = None + self.twitter_profile = None + self._type = 'Person' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/point2_d.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/point2_d.py new file mode 100644 index 000000000000..81e055b8b859 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/point2_d.py @@ -0,0 +1,87 @@ +# 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 .structured_value import StructuredValue + + +class Point2D(StructuredValue): + """Point2D. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item. + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :param x: Required. The x-coordinate of the point. + :type x: float + :param y: Required. The y-coordinate of the point. + :type y: float + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'x': {'required': True}, + 'y': {'required': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'x': {'key': 'x', 'type': 'float'}, + 'y': {'key': 'y', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(Point2D, self).__init__(**kwargs) + self.x = kwargs.get('x', None) + self.y = kwargs.get('y', None) + self._type = 'Point2D' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/point2_d_py3.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/point2_d_py3.py new file mode 100644 index 000000000000..31e9b2bdcb97 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/point2_d_py3.py @@ -0,0 +1,87 @@ +# 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 .structured_value import StructuredValue + + +class Point2D(StructuredValue): + """Point2D. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item. + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :param x: Required. The x-coordinate of the point. + :type x: float + :param y: Required. The y-coordinate of the point. + :type y: float + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'x': {'required': True}, + 'y': {'required': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'x': {'key': 'x', 'type': 'float'}, + 'y': {'key': 'y', 'type': 'float'}, + } + + def __init__(self, *, x: float, y: float, **kwargs) -> None: + super(Point2D, self).__init__(**kwargs) + self.x = x + self.y = y + self._type = 'Point2D' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/properties_item.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/properties_item.py new file mode 100644 index 000000000000..0826a1c9d662 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/properties_item.py @@ -0,0 +1,49 @@ +# 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.serialization import Model + + +class PropertiesItem(Model): + """Defines an item. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Rating + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar text: Text representation of an item. + :vartype text: str + :param _type: Required. Constant filled by server. + :type _type: str + """ + + _validation = { + 'text': {'readonly': True}, + '_type': {'required': True}, + } + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'}, + '_type': {'key': '_type', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'Rating': 'Rating'} + } + + def __init__(self, **kwargs): + super(PropertiesItem, self).__init__(**kwargs) + self.text = None + self._type = None diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/properties_item_py3.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/properties_item_py3.py new file mode 100644 index 000000000000..17ca93eba774 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/properties_item_py3.py @@ -0,0 +1,49 @@ +# 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.serialization import Model + + +class PropertiesItem(Model): + """Defines an item. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Rating + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar text: Text representation of an item. + :vartype text: str + :param _type: Required. Constant filled by server. + :type _type: str + """ + + _validation = { + 'text': {'readonly': True}, + '_type': {'required': True}, + } + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'}, + '_type': {'key': '_type', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'Rating': 'Rating'} + } + + def __init__(self, **kwargs) -> None: + super(PropertiesItem, self).__init__(**kwargs) + self.text = None + self._type = None diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/query.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/query.py new file mode 100644 index 000000000000..0f031a8592d2 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/query.py @@ -0,0 +1,64 @@ +# 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.serialization import Model + + +class Query(Model): + """Defines a search query. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param text: Required. The query string. Use this string as the query term + in a new search request. + :type text: str + :ivar display_text: The display version of the query term. + :vartype display_text: str + :ivar web_search_url: The URL that takes the user to the Bing search + results page for the query. + :vartype web_search_url: str + :ivar search_link: The URL that you use to get the results of the related + search. Before using the URL, you must append query parameters as + appropriate and include the Ocp-Apim-Subscription-Key header. Use this URL + if you're displaying the results in your own user interface. Otherwise, + use the webSearchUrl URL. + :vartype search_link: str + :ivar thumbnail: The URL to a thumbnail of a related image. + :vartype thumbnail: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + """ + + _validation = { + 'text': {'required': True}, + 'display_text': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'search_link': {'readonly': True}, + 'thumbnail': {'readonly': True}, + } + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'}, + 'display_text': {'key': 'displayText', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'search_link': {'key': 'searchLink', 'type': 'str'}, + 'thumbnail': {'key': 'thumbnail', 'type': 'ImageObject'}, + } + + def __init__(self, **kwargs): + super(Query, self).__init__(**kwargs) + self.text = kwargs.get('text', None) + self.display_text = None + self.web_search_url = None + self.search_link = None + self.thumbnail = None diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/query_py3.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/query_py3.py new file mode 100644 index 000000000000..62a0b42cd4ec --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/query_py3.py @@ -0,0 +1,64 @@ +# 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.serialization import Model + + +class Query(Model): + """Defines a search query. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param text: Required. The query string. Use this string as the query term + in a new search request. + :type text: str + :ivar display_text: The display version of the query term. + :vartype display_text: str + :ivar web_search_url: The URL that takes the user to the Bing search + results page for the query. + :vartype web_search_url: str + :ivar search_link: The URL that you use to get the results of the related + search. Before using the URL, you must append query parameters as + appropriate and include the Ocp-Apim-Subscription-Key header. Use this URL + if you're displaying the results in your own user interface. Otherwise, + use the webSearchUrl URL. + :vartype search_link: str + :ivar thumbnail: The URL to a thumbnail of a related image. + :vartype thumbnail: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + """ + + _validation = { + 'text': {'required': True}, + 'display_text': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'search_link': {'readonly': True}, + 'thumbnail': {'readonly': True}, + } + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'}, + 'display_text': {'key': 'displayText', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'search_link': {'key': 'searchLink', 'type': 'str'}, + 'thumbnail': {'key': 'thumbnail', 'type': 'ImageObject'}, + } + + def __init__(self, *, text: str, **kwargs) -> None: + super(Query, self).__init__(**kwargs) + self.text = text + self.display_text = None + self.web_search_url = None + self.search_link = None + self.thumbnail = None diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/rating.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/rating.py new file mode 100644 index 000000000000..a749cf2f7c0b --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/rating.py @@ -0,0 +1,60 @@ +# 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 .properties_item import PropertiesItem + + +class Rating(PropertiesItem): + """Defines a rating. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AggregateRating + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar text: Text representation of an item. + :vartype text: str + :param _type: Required. Constant filled by server. + :type _type: str + :param rating_value: Required. The mean (average) rating. The possible + values are 1.0 through 5.0. + :type rating_value: float + :ivar best_rating: The highest rated review. The possible values are 1.0 + through 5.0. + :vartype best_rating: float + """ + + _validation = { + 'text': {'readonly': True}, + '_type': {'required': True}, + 'rating_value': {'required': True}, + 'best_rating': {'readonly': True}, + } + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'}, + '_type': {'key': '_type', 'type': 'str'}, + 'rating_value': {'key': 'ratingValue', 'type': 'float'}, + 'best_rating': {'key': 'bestRating', 'type': 'float'}, + } + + _subtype_map = { + '_type': {'AggregateRating': 'AggregateRating'} + } + + def __init__(self, **kwargs): + super(Rating, self).__init__(**kwargs) + self.rating_value = kwargs.get('rating_value', None) + self.best_rating = None + self._type = 'Rating' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/rating_py3.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/rating_py3.py new file mode 100644 index 000000000000..cf4b1a32eec8 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/rating_py3.py @@ -0,0 +1,60 @@ +# 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 .properties_item import PropertiesItem + + +class Rating(PropertiesItem): + """Defines a rating. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AggregateRating + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar text: Text representation of an item. + :vartype text: str + :param _type: Required. Constant filled by server. + :type _type: str + :param rating_value: Required. The mean (average) rating. The possible + values are 1.0 through 5.0. + :type rating_value: float + :ivar best_rating: The highest rated review. The possible values are 1.0 + through 5.0. + :vartype best_rating: float + """ + + _validation = { + 'text': {'readonly': True}, + '_type': {'required': True}, + 'rating_value': {'required': True}, + 'best_rating': {'readonly': True}, + } + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'}, + '_type': {'key': '_type', 'type': 'str'}, + 'rating_value': {'key': 'ratingValue', 'type': 'float'}, + 'best_rating': {'key': 'bestRating', 'type': 'float'}, + } + + _subtype_map = { + '_type': {'AggregateRating': 'AggregateRating'} + } + + def __init__(self, *, rating_value: float, **kwargs) -> None: + super(Rating, self).__init__(**kwargs) + self.rating_value = rating_value + self.best_rating = None + self._type = 'Rating' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/recipe.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/recipe.py new file mode 100644 index 000000000000..aa3fe9bca3a4 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/recipe.py @@ -0,0 +1,115 @@ +# 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 .creative_work import CreativeWork + + +class Recipe(CreativeWork): + """Defines a cooking recipe. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item. + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.visualsearch.models.Thing] + :ivar date_published: The date on which the CreativeWork was published. + :vartype date_published: str + :ivar text: Text content of this creative work. + :vartype text: str + :ivar cook_time: The amount of time the food takes to cook. For example, + PT25M. For information about the time format, see + http://en.wikipedia.org/wiki/ISO_8601#Durations. + :vartype cook_time: str + :ivar prep_time: The amount of time required to prepare the ingredients. + For example, PT15M. For information about the time format, see + http://en.wikipedia.org/wiki/ISO_8601#Durations. + :vartype prep_time: str + :ivar total_time: The total amount of time it takes to prepare and cook + the recipe. For example, PT45M. For information about the time format, see + http://en.wikipedia.org/wiki/ISO_8601#Durations. + :vartype total_time: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'provider': {'readonly': True}, + 'date_published': {'readonly': True}, + 'text': {'readonly': True}, + 'cook_time': {'readonly': True}, + 'prep_time': {'readonly': True}, + 'total_time': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'date_published': {'key': 'datePublished', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + 'cook_time': {'key': 'cookTime', 'type': 'str'}, + 'prep_time': {'key': 'prepTime', 'type': 'str'}, + 'total_time': {'key': 'totalTime', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Recipe, self).__init__(**kwargs) + self.cook_time = None + self.prep_time = None + self.total_time = None + self._type = 'Recipe' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/recipe_py3.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/recipe_py3.py new file mode 100644 index 000000000000..1c2472adb1a6 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/recipe_py3.py @@ -0,0 +1,115 @@ +# 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 .creative_work import CreativeWork + + +class Recipe(CreativeWork): + """Defines a cooking recipe. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item. + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.visualsearch.models.Thing] + :ivar date_published: The date on which the CreativeWork was published. + :vartype date_published: str + :ivar text: Text content of this creative work. + :vartype text: str + :ivar cook_time: The amount of time the food takes to cook. For example, + PT25M. For information about the time format, see + http://en.wikipedia.org/wiki/ISO_8601#Durations. + :vartype cook_time: str + :ivar prep_time: The amount of time required to prepare the ingredients. + For example, PT15M. For information about the time format, see + http://en.wikipedia.org/wiki/ISO_8601#Durations. + :vartype prep_time: str + :ivar total_time: The total amount of time it takes to prepare and cook + the recipe. For example, PT45M. For information about the time format, see + http://en.wikipedia.org/wiki/ISO_8601#Durations. + :vartype total_time: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'provider': {'readonly': True}, + 'date_published': {'readonly': True}, + 'text': {'readonly': True}, + 'cook_time': {'readonly': True}, + 'prep_time': {'readonly': True}, + 'total_time': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'date_published': {'key': 'datePublished', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + 'cook_time': {'key': 'cookTime', 'type': 'str'}, + 'prep_time': {'key': 'prepTime', 'type': 'str'}, + 'total_time': {'key': 'totalTime', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Recipe, self).__init__(**kwargs) + self.cook_time = None + self.prep_time = None + self.total_time = None + self._type = 'Recipe' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/recipes_module.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/recipes_module.py new file mode 100644 index 000000000000..8be39eb209e1 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/recipes_module.py @@ -0,0 +1,36 @@ +# 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.serialization import Model + + +class RecipesModule(Model): + """Defines a list of recipes. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: A list of recipes. + :vartype value: + list[~azure.cognitiveservices.search.visualsearch.models.Recipe] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Recipe]'}, + } + + def __init__(self, **kwargs): + super(RecipesModule, self).__init__(**kwargs) + self.value = None diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/recipes_module_py3.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/recipes_module_py3.py new file mode 100644 index 000000000000..bab50bb98a85 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/recipes_module_py3.py @@ -0,0 +1,36 @@ +# 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.serialization import Model + + +class RecipesModule(Model): + """Defines a list of recipes. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: A list of recipes. + :vartype value: + list[~azure.cognitiveservices.search.visualsearch.models.Recipe] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Recipe]'}, + } + + def __init__(self, **kwargs) -> None: + super(RecipesModule, self).__init__(**kwargs) + self.value = None diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/related_searches_module.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/related_searches_module.py new file mode 100644 index 000000000000..87d288d4494c --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/related_searches_module.py @@ -0,0 +1,36 @@ +# 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.serialization import Model + + +class RelatedSearchesModule(Model): + """Defines a list of related searches. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: A list of related searches. + :vartype value: + list[~azure.cognitiveservices.search.visualsearch.models.Query] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Query]'}, + } + + def __init__(self, **kwargs): + super(RelatedSearchesModule, self).__init__(**kwargs) + self.value = None diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/related_searches_module_py3.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/related_searches_module_py3.py new file mode 100644 index 000000000000..ca2c318d271b --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/related_searches_module_py3.py @@ -0,0 +1,36 @@ +# 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.serialization import Model + + +class RelatedSearchesModule(Model): + """Defines a list of related searches. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: A list of related searches. + :vartype value: + list[~azure.cognitiveservices.search.visualsearch.models.Query] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Query]'}, + } + + def __init__(self, **kwargs) -> None: + super(RelatedSearchesModule, self).__init__(**kwargs) + self.value = None diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/response.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/response.py new file mode 100644 index 000000000000..194070083cbf --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/response.py @@ -0,0 +1,61 @@ +# 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 .identifiable import Identifiable + + +class Response(Identifiable): + """Defines a response. All schemas that return at the root of the response + must inherit from this object. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ImageKnowledge, ErrorResponse, Thing + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'ImageKnowledge': 'ImageKnowledge', 'ErrorResponse': 'ErrorResponse', 'Thing': 'Thing'} + } + + def __init__(self, **kwargs): + super(Response, self).__init__(**kwargs) + self.read_link = None + self.web_search_url = None + self._type = 'Response' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/response_base.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/response_base.py new file mode 100644 index 000000000000..fd44632cfc0a --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/response_base.py @@ -0,0 +1,41 @@ +# 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.serialization import Model + + +class ResponseBase(Model): + """Response base. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Identifiable + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + """ + + _validation = { + '_type': {'required': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'Identifiable': 'Identifiable'} + } + + def __init__(self, **kwargs): + super(ResponseBase, self).__init__(**kwargs) + self._type = None diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/response_base_py3.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/response_base_py3.py new file mode 100644 index 000000000000..680e0fe98ab4 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/response_base_py3.py @@ -0,0 +1,41 @@ +# 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.serialization import Model + + +class ResponseBase(Model): + """Response base. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Identifiable + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + """ + + _validation = { + '_type': {'required': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'Identifiable': 'Identifiable'} + } + + def __init__(self, **kwargs) -> None: + super(ResponseBase, self).__init__(**kwargs) + self._type = None diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/response_py3.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/response_py3.py new file mode 100644 index 000000000000..e202a78acf5b --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/response_py3.py @@ -0,0 +1,61 @@ +# 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 .identifiable import Identifiable + + +class Response(Identifiable): + """Defines a response. All schemas that return at the root of the response + must inherit from this object. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ImageKnowledge, ErrorResponse, Thing + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'ImageKnowledge': 'ImageKnowledge', 'ErrorResponse': 'ErrorResponse', 'Thing': 'Thing'} + } + + def __init__(self, **kwargs) -> None: + super(Response, self).__init__(**kwargs) + self.read_link = None + self.web_search_url = None + self._type = 'Response' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/structured_value.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/structured_value.py new file mode 100644 index 000000000000..7bbe5856b20c --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/structured_value.py @@ -0,0 +1,84 @@ +# 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 .intangible import Intangible + + +class StructuredValue(Intangible): + """StructuredValue. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Point2D, NormalizedQuadrilateral + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item. + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'Point2D': 'Point2D', 'NormalizedQuadrilateral': 'NormalizedQuadrilateral'} + } + + def __init__(self, **kwargs): + super(StructuredValue, self).__init__(**kwargs) + self._type = 'StructuredValue' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/structured_value_py3.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/structured_value_py3.py new file mode 100644 index 000000000000..f1eaf66ea44e --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/structured_value_py3.py @@ -0,0 +1,84 @@ +# 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 .intangible import Intangible + + +class StructuredValue(Intangible): + """StructuredValue. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Point2D, NormalizedQuadrilateral + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item. + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'Point2D': 'Point2D', 'NormalizedQuadrilateral': 'NormalizedQuadrilateral'} + } + + def __init__(self, **kwargs) -> None: + super(StructuredValue, self).__init__(**kwargs) + self._type = 'StructuredValue' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/thing.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/thing.py new file mode 100644 index 000000000000..7fe2a1a8cc16 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/thing.py @@ -0,0 +1,91 @@ +# 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 .response import Response + + +class Thing(Response): + """Defines a thing. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ImageTag, Organization, Offer, CreativeWork, Person, + Intangible + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item. + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'ImageTag': 'ImageTag', 'Organization': 'Organization', 'Offer': 'Offer', 'CreativeWork': 'CreativeWork', 'Person': 'Person', 'Intangible': 'Intangible'} + } + + def __init__(self, **kwargs): + super(Thing, self).__init__(**kwargs) + self.name = None + self.url = None + self.image = None + self.description = None + self.alternate_name = None + self.bing_id = None + self._type = 'Thing' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/thing_py3.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/thing_py3.py new file mode 100644 index 000000000000..e09fc32c6394 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/thing_py3.py @@ -0,0 +1,91 @@ +# 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 .response import Response + + +class Thing(Response): + """Defines a thing. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ImageTag, Organization, Offer, CreativeWork, Person, + Intangible + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. To use the URL, + append query parameters as appropriate and include the + Ocp-Apim-Subscription-Key header. + :vartype read_link: str + :ivar web_search_url: The URL to Bing's search result for this item. + :vartype web_search_url: str + :ivar name: The name of the thing represented by this object. + :vartype name: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar image: An image of the item. + :vartype image: + ~azure.cognitiveservices.search.visualsearch.models.ImageObject + :ivar description: A short description of the item. + :vartype description: str + :ivar alternate_name: An alias for the item. + :vartype alternate_name: str + :ivar bing_id: An ID that uniquely identifies this item. + :vartype bing_id: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'name': {'readonly': True}, + 'url': {'readonly': True}, + 'image': {'readonly': True}, + 'description': {'readonly': True}, + 'alternate_name': {'readonly': True}, + 'bing_id': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'ImageObject'}, + 'description': {'key': 'description', 'type': 'str'}, + 'alternate_name': {'key': 'alternateName', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'ImageTag': 'ImageTag', 'Organization': 'Organization', 'Offer': 'Offer', 'CreativeWork': 'CreativeWork', 'Person': 'Person', 'Intangible': 'Intangible'} + } + + def __init__(self, **kwargs) -> None: + super(Thing, self).__init__(**kwargs) + self.name = None + self.url = None + self.image = None + self.description = None + self.alternate_name = None + self.bing_id = None + self._type = 'Thing' diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/visual_search_api_enums.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/visual_search_api_enums.py new file mode 100644 index 000000000000..5ed4dbcca26b --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/visual_search_api_enums.py @@ -0,0 +1,214 @@ +# 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 enum import Enum + + +class Currency(str, Enum): + + usd = "USD" + cad = "CAD" + gbp = "GBP" + eur = "EUR" + cop = "COP" + jpy = "JPY" + cny = "CNY" + aud = "AUD" + inr = "INR" + aed = "AED" + afn = "AFN" + all = "ALL" + amd = "AMD" + ang = "ANG" + aoa = "AOA" + ars = "ARS" + awg = "AWG" + azn = "AZN" + bam = "BAM" + bbd = "BBD" + bdt = "BDT" + bgn = "BGN" + bhd = "BHD" + bif = "BIF" + bmd = "BMD" + bnd = "BND" + bob = "BOB" + bov = "BOV" + brl = "BRL" + bsd = "BSD" + btn = "BTN" + bwp = "BWP" + byr = "BYR" + bzd = "BZD" + cdf = "CDF" + che = "CHE" + chf = "CHF" + chw = "CHW" + clf = "CLF" + clp = "CLP" + cou = "COU" + crc = "CRC" + cuc = "CUC" + cup = "CUP" + cve = "CVE" + czk = "CZK" + djf = "DJF" + dkk = "DKK" + dop = "DOP" + dzd = "DZD" + egp = "EGP" + ern = "ERN" + etb = "ETB" + fjd = "FJD" + fkp = "FKP" + gel = "GEL" + ghs = "GHS" + gip = "GIP" + gmd = "GMD" + gnf = "GNF" + gtq = "GTQ" + gyd = "GYD" + hkd = "HKD" + hnl = "HNL" + hrk = "HRK" + htg = "HTG" + huf = "HUF" + idr = "IDR" + ils = "ILS" + iqd = "IQD" + irr = "IRR" + isk = "ISK" + jmd = "JMD" + jod = "JOD" + kes = "KES" + kgs = "KGS" + khr = "KHR" + kmf = "KMF" + kpw = "KPW" + krw = "KRW" + kwd = "KWD" + kyd = "KYD" + kzt = "KZT" + lak = "LAK" + lbp = "LBP" + lkr = "LKR" + lrd = "LRD" + lsl = "LSL" + lyd = "LYD" + mad = "MAD" + mdl = "MDL" + mga = "MGA" + mkd = "MKD" + mmk = "MMK" + mnt = "MNT" + mop = "MOP" + mro_enum = "MRO" + mur = "MUR" + mvr = "MVR" + mwk = "MWK" + mxn = "MXN" + mxv = "MXV" + myr = "MYR" + mzn = "MZN" + nad = "NAD" + ngn = "NGN" + nio = "NIO" + nok = "NOK" + npr = "NPR" + nzd = "NZD" + omr = "OMR" + pab = "PAB" + pen = "PEN" + pgk = "PGK" + php = "PHP" + pkr = "PKR" + pln = "PLN" + pyg = "PYG" + qar = "QAR" + ron = "RON" + rsd = "RSD" + rub = "RUB" + rwf = "RWF" + sar = "SAR" + sbd = "SBD" + scr = "SCR" + sdg = "SDG" + sek = "SEK" + sgd = "SGD" + shp = "SHP" + sll = "SLL" + sos = "SOS" + srd = "SRD" + ssp = "SSP" + std = "STD" + syp = "SYP" + szl = "SZL" + thb = "THB" + tjs = "TJS" + tmt = "TMT" + tnd = "TND" + top = "TOP" + try_enum = "TRY" + ttd = "TTD" + twd = "TWD" + tzs = "TZS" + uah = "UAH" + ugx = "UGX" + uyu = "UYU" + uzs = "UZS" + vef = "VEF" + vnd = "VND" + vuv = "VUV" + wst = "WST" + xaf = "XAF" + xcd = "XCD" + xof = "XOF" + xpf = "XPF" + yer = "YER" + zar = "ZAR" + zmw = "ZMW" + + +class ItemAvailability(str, Enum): + + discontinued = "Discontinued" + in_stock = "InStock" + in_store_only = "InStoreOnly" + limited_availability = "LimitedAvailability" + online_only = "OnlineOnly" + out_of_stock = "OutOfStock" + pre_order = "PreOrder" + sold_out = "SoldOut" + + +class ErrorCode(str, Enum): + + none = "None" + server_error = "ServerError" + invalid_request = "InvalidRequest" + rate_limit_exceeded = "RateLimitExceeded" + invalid_authorization = "InvalidAuthorization" + insufficient_authorization = "InsufficientAuthorization" + + +class ErrorSubCode(str, Enum): + + unexpected_error = "UnexpectedError" + resource_error = "ResourceError" + not_implemented = "NotImplemented" + parameter_missing = "ParameterMissing" + parameter_invalid_value = "ParameterInvalidValue" + http_not_allowed = "HttpNotAllowed" + blocked = "Blocked" + authorization_missing = "AuthorizationMissing" + authorization_redundancy = "AuthorizationRedundancy" + authorization_disabled = "AuthorizationDisabled" + authorization_expired = "AuthorizationExpired" diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/visual_search_request.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/visual_search_request.py new file mode 100644 index 000000000000..30e1dff81030 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/visual_search_request.py @@ -0,0 +1,45 @@ +# 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.serialization import Model + + +class VisualSearchRequest(Model): + """A JSON object that contains information about the image to get insights of. + Specify this object only in a knowledgeRequest form data. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar image_info: A JSON object that identities the image to get insights + of. + :vartype image_info: + ~azure.cognitiveservices.search.visualsearch.models.ImageInfo + :ivar knowledge_request: A JSON object containing information about the + request, such as filters, or a description. + :vartype knowledge_request: + ~azure.cognitiveservices.search.visualsearch.models.KnowledgeRequest + """ + + _validation = { + 'image_info': {'readonly': True}, + 'knowledge_request': {'readonly': True}, + } + + _attribute_map = { + 'image_info': {'key': 'imageInfo', 'type': 'ImageInfo'}, + 'knowledge_request': {'key': 'knowledgeRequest', 'type': 'KnowledgeRequest'}, + } + + def __init__(self, **kwargs): + super(VisualSearchRequest, self).__init__(**kwargs) + self.image_info = None + self.knowledge_request = None diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/visual_search_request_py3.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/visual_search_request_py3.py new file mode 100644 index 000000000000..81e8034f744f --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/visual_search_request_py3.py @@ -0,0 +1,45 @@ +# 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.serialization import Model + + +class VisualSearchRequest(Model): + """A JSON object that contains information about the image to get insights of. + Specify this object only in a knowledgeRequest form data. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar image_info: A JSON object that identities the image to get insights + of. + :vartype image_info: + ~azure.cognitiveservices.search.visualsearch.models.ImageInfo + :ivar knowledge_request: A JSON object containing information about the + request, such as filters, or a description. + :vartype knowledge_request: + ~azure.cognitiveservices.search.visualsearch.models.KnowledgeRequest + """ + + _validation = { + 'image_info': {'readonly': True}, + 'knowledge_request': {'readonly': True}, + } + + _attribute_map = { + 'image_info': {'key': 'imageInfo', 'type': 'ImageInfo'}, + 'knowledge_request': {'key': 'knowledgeRequest', 'type': 'KnowledgeRequest'}, + } + + def __init__(self, **kwargs) -> None: + super(VisualSearchRequest, self).__init__(**kwargs) + self.image_info = None + self.knowledge_request = None diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/operations/__init__.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/operations/__init__.py new file mode 100644 index 000000000000..5dbea237465e --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/operations/__init__.py @@ -0,0 +1,16 @@ +# 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 .images_operations import ImagesOperations + +__all__ = [ + 'ImagesOperations', +] diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/operations/images_operations.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/operations/images_operations.py new file mode 100644 index 000000000000..b1afdf230891 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/operations/images_operations.py @@ -0,0 +1,258 @@ +# 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.pipeline import ClientRawResponse + +from .. import models + + +class ImagesOperations(object): + """ImagesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar x_bing_apis_sdk: Activate swagger compliance. Constant value: "true". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + + self.config = config + self.x_bing_apis_sdk = "true" + + def visual_search( + self, accept_language=None, content_type=None, user_agent=None, client_id=None, client_ip=None, location=None, knowledge_request=None, image=None, custom_headers=None, raw=False, **operation_config): + """Visual Search API lets you discover insights about an image such as + visually similar images, shopping sources, and related searches. The + API can also perform text recognition, identify entities (people, + places, things), return other topical content for the user to explore, + and more. For more information, see [Visual Search + Overview](https://docs.microsoft.com/azure/cognitive-services/bing-visual-search/overview). + + :param accept_language: A comma-delimited list of one or more + languages to use for user interface strings. The list is in decreasing + order of preference. For additional information, including expected + format, see + [RFC2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). + This header and the + [setLang](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-visual-search-api-v7-reference#setlang) + query parameter are mutually exclusive; do not specify both. If you + set this header, you must also specify the + [cc](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-visual-search-api-v7-reference#cc) + query parameter. To determine the market to return results for, Bing + uses the first supported language it finds from the list and combines + it with the cc parameter value. If the list does not include a + supported language, Bing finds the closest language and market that + supports the request or it uses an aggregated or default market for + the results. To determine the market that Bing used, see the + BingAPIs-Market header. Use this header and the cc query parameter + only if you specify multiple languages. Otherwise, use the + [mkt](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-visual-search-api-v7-reference#mkt) + and + [setLang](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-visual-search-api-v7-reference#setlang) + query parameters. A user interface string is a string that's used as a + label in a user interface. There are few user interface strings in the + JSON response objects. Any links to Bing.com properties in the + response objects apply the specified language. + :type accept_language: str + :param content_type: Must be set to multipart/form-data and include a + boundary parameter (for example, multipart/form-data; + boundary=). For more details, see [Content form + types]( + https://docs.microsoft.com/en-us/azure/cognitive-services/bing-visual-search/overview#content-form-types). + :type content_type: str + :param user_agent: The user agent originating the request. Bing uses + the user agent to provide mobile users with an optimized experience. + Although optional, you are encouraged to always specify this header. + The user-agent should be the same string that any commonly used + browser sends. For information about user agents, see [RFC + 2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). The + following are examples of user-agent strings. Windows Phone: + Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; + IEMobile/10.0; ARM; Touch; NOKIA; Lumia 822). Android: Mozilla / 5.0 + (Linux; U; Android 2.3.5; en - us; SCH - I500 Build / GINGERBREAD) + AppleWebKit / 533.1 (KHTML; like Gecko) Version / 4.0 Mobile Safari / + 533.1. iPhone: Mozilla / 5.0 (iPhone; CPU iPhone OS 6_1 like Mac OS X) + AppleWebKit / 536.26 (KHTML; like Gecko) Mobile / 10B142 iPhone4; 1 + BingWeb / 3.03.1428.20120423. PC: Mozilla / 5.0 (Windows NT 6.3; + WOW64; Trident / 7.0; Touch; rv:11.0) like Gecko. iPad: Mozilla / 5.0 + (iPad; CPU OS 7_0 like Mac OS X) AppleWebKit / 537.51.1 (KHTML, like + Gecko) Version / 7.0 Mobile / 11A465 Safari / 9537.53. + :type user_agent: str + :param client_id: Bing uses this header to provide users with + consistent behavior across Bing API calls. Bing often flights new + features and improvements, and it uses the client ID as a key for + assigning traffic on different flights. If you do not use the same + client ID for a user across multiple requests, then Bing may assign + the user to multiple conflicting flights. Being assigned to multiple + conflicting flights can lead to an inconsistent user experience. For + example, if the second request has a different flight assignment than + the first, the experience may be unexpected. Also, Bing can use the + client ID to tailor web results to that client ID’s search history, + providing a richer experience for the user. Bing also uses this header + to help improve result rankings by analyzing the activity generated by + a client ID. The relevance improvements help with better quality of + results delivered by Bing APIs and in turn enables higher + click-through rates for the API consumer. IMPORTANT: Although + optional, you should consider this header required. Persisting the + client ID across multiple requests for the same end user and device + combination enables 1) the API consumer to receive a consistent user + experience, and 2) higher click-through rates via better quality of + results from the Bing APIs. Each user that uses your application on + the device must have a unique, Bing generated client ID. If you do not + include this header in the request, Bing generates an ID and returns + it in the X-MSEdge-ClientID response header. The only time that you + should NOT include this header in a request is the first time the user + uses your app on that device. Use the client ID for each Bing API + request that your app makes for this user on the device. Persist the + client ID. To persist the ID in a browser app, use a persistent HTTP + cookie to ensure the ID is used across all sessions. Do not use a + session cookie. For other apps such as mobile apps, use the device's + persistent storage to persist the ID. The next time the user uses your + app on that device, get the client ID that you persisted. Bing + responses may or may not include this header. If the response includes + this header, capture the client ID and use it for all subsequent Bing + requests for the user on that device. ATTENTION: You must ensure that + this Client ID is not linkable to any authenticatable user account + information. If you include the X-MSEdge-ClientID, you must not + include cookies in the request. + :type client_id: str + :param client_ip: The IPv4 or IPv6 address of the client device. The + IP address is used to discover the user's location. Bing uses the + location information to determine safe search behavior. Although + optional, you are encouraged to always specify this header and the + X-Search-Location header. Do not obfuscate the address (for example, + by changing the last octet to 0). Obfuscating the address results in + the location not being anywhere near the device's actual location, + which may result in Bing serving erroneous results. + :type client_ip: str + :param location: A semicolon-delimited list of key/value pairs that + describe the client's geographical location. Bing uses the location + information to determine safe search behavior and to return relevant + local content. Specify the key/value pair as :. The + following are the keys that you use to specify the user's location. + lat (required): The latitude of the client's location, in degrees. The + latitude must be greater than or equal to -90.0 and less than or equal + to +90.0. Negative values indicate southern latitudes and positive + values indicate northern latitudes. long (required): The longitude of + the client's location, in degrees. The longitude must be greater than + or equal to -180.0 and less than or equal to +180.0. Negative values + indicate western longitudes and positive values indicate eastern + longitudes. re (required): The radius, in meters, which specifies the + horizontal accuracy of the coordinates. Pass the value returned by the + device's location service. Typical values might be 22m for GPS/Wi-Fi, + 380m for cell tower triangulation, and 18,000m for reverse IP lookup. + ts (optional): The UTC UNIX timestamp of when the client was at the + location. (The UNIX timestamp is the number of seconds since January + 1, 1970.) head (optional): The client's relative heading or direction + of travel. Specify the direction of travel as degrees from 0 through + 360, counting clockwise relative to true north. Specify this key only + if the sp key is nonzero. sp (optional): The horizontal velocity + (speed), in meters per second, that the client device is traveling. + alt (optional): The altitude of the client device, in meters. are + (optional): The radius, in meters, that specifies the vertical + accuracy of the coordinates. Specify this key only if you specify the + alt key. Although many of the keys are optional, the more information + that you provide, the more accurate the location results are. Although + optional, you are encouraged to always specify the user's geographical + location. Providing the location is especially important if the + client's IP address does not accurately reflect the user's physical + location (for example, if the client uses VPN). For optimal results, + you should include this header and the X-MSEdge-ClientIP header, but + at a minimum, you should include this header. + :type location: str + :param knowledge_request: The form data is a JSON object that + identifies the image using an insights token or URL to the image. The + object may also include an optional crop area that identifies an area + of interest in the image. The insights token and URL are mutually + exclusive – do not specify both. You may specify knowledgeRequest form + data and image form data in the same request only if knowledgeRequest + form data specifies the cropArea field only (it must not include an + insights token or URL). + :type knowledge_request: str + :param image: The form data is an image binary. The + Content-Disposition header's filename parameter must be set to + "image". You must specify an image binary if you do not use + knowledgeRequest form data to specify the image; you may not use both + forms to specify an image. You may specify knowledgeRequest form data + and image form data in the same request only if knowledgeRequest form + data specifies the cropArea field only (it must not include an + insights token or URL). + :type image: Generator + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ImageKnowledge or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.search.visualsearch.models.ImageKnowledge or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.visual_search.metadata['url'] + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'multipart/form-data' + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['X-BingApis-SDK'] = self._serialize.header("self.x_bing_apis_sdk", self.x_bing_apis_sdk, 'str') + if accept_language is not None: + header_parameters['Accept-Language'] = self._serialize.header("accept_language", accept_language, 'str') + if content_type is not None: + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + if user_agent is not None: + header_parameters['User-Agent'] = self._serialize.header("user_agent", user_agent, 'str') + if client_id is not None: + header_parameters['X-MSEdge-ClientID'] = self._serialize.header("client_id", client_id, 'str') + if client_ip is not None: + header_parameters['X-MSEdge-ClientIP'] = self._serialize.header("client_ip", client_ip, 'str') + if location is not None: + header_parameters['X-Search-Location'] = self._serialize.header("location", location, 'str') + + # Construct form data + form_data_content = { + 'knowledgeRequest': knowledge_request, + 'image': image, + } + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send_formdata( + request, header_parameters, form_data_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ImageKnowledge', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + visual_search.metadata = {'url': '/images/visualsearch'} diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/version.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/version.py new file mode 100644 index 000000000000..63d89bfb54fa --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/version.py @@ -0,0 +1,13 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "1.0" + diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/visual_search_api.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/visual_search_api.py new file mode 100644 index 000000000000..fcdeafdf97fa --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/visual_search_api.py @@ -0,0 +1,72 @@ +# 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.service_client import SDKClient +from msrest import Configuration, Serializer, Deserializer +from .version import VERSION +from .operations.images_operations import ImagesOperations +from . import models + + +class VisualSearchAPIConfiguration(Configuration): + """Configuration for VisualSearchAPI + 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' + + super(VisualSearchAPIConfiguration, self).__init__(base_url) + + self.add_user_agent('azure-cognitiveservices-search-visualsearch/{}'.format(VERSION)) + + self.credentials = credentials + + +class VisualSearchAPI(SDKClient): + """Visual Search API lets you discover insights about an image such as visually similar images, shopping sources, and related searches. The API can also perform text recognition, identify entities (people, places, things), return other topical content for the user to explore, and more. For more information, see [Visual Search Overview](https://docs.microsoft.com/azure/cognitive-services/bing-visual-search/overview). + + :ivar config: Configuration for client. + :vartype config: VisualSearchAPIConfiguration + + :ivar images: Images operations + :vartype images: azure.cognitiveservices.search.visualsearch.operations.ImagesOperations + + :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.config = VisualSearchAPIConfiguration(credentials, base_url) + super(VisualSearchAPI, 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' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.images = ImagesOperations( + self._client, self.config, self._serialize, self._deserialize)