From 5b3e4d9afdd3c5b0e828365cd044919f1cd48ce2 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 4 May 2018 19:11:29 +0000 Subject: [PATCH] Generated from 6db68a36da1b2d166a48943d455d4cf067e19e08 [Visual Search API] Remove read-only property on input parameters --- .../search/visualsearch/models/filters.py | 13 ++------- .../search/visualsearch/models/filters_py3.py | 15 +++------- .../search/visualsearch/models/image_info.py | 27 ++++++----------- .../visualsearch/models/image_info_py3.py | 29 +++++++------------ .../visualsearch/models/knowledge_request.py | 14 ++------- .../models/knowledge_request_py3.py | 16 +++------- .../models/visual_search_request.py | 20 ++++--------- .../models/visual_search_request_py3.py | 22 +++++--------- .../search/visualsearch/version.py | 2 +- 9 files changed, 47 insertions(+), 111 deletions(-) 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 index ef2dccb97dff..ff1daf4064e8 100644 --- a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/filters.py +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/filters.py @@ -16,22 +16,15 @@ 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 + :param site: The URL of the site to return similar images and similar products from. (e.g., "www.bing.com", "bing.com"). - :vartype site: str + :type 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 + self.site = kwargs.get('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 index f7557011909d..6894fdfbd14e 100644 --- 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 @@ -16,22 +16,15 @@ 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 + :param site: The URL of the site to return similar images and similar products from. (e.g., "www.bing.com", "bing.com"). - :vartype site: str + :type site: str """ - _validation = { - 'site': {'readonly': True}, - } - _attribute_map = { 'site': {'key': 'site', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__(self, *, site: str=None, **kwargs) -> None: super(Filters, self).__init__(**kwargs) - self.site = None + self.site = site 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 index 4b0bdd363ccd..64875b87c168 100644 --- 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 @@ -17,10 +17,7 @@ class ImageInfo(Model): 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 + :param 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) @@ -29,26 +26,20 @@ class ImageInfo(Model): 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 + :type image_insights_token: str + :param 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 + :type url: str + :param 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: + :type 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'}, @@ -57,6 +48,6 @@ class ImageInfo(Model): def __init__(self, **kwargs): super(ImageInfo, self).__init__(**kwargs) - self.image_insights_token = None - self.url = None - self.crop_area = None + self.image_insights_token = kwargs.get('image_insights_token', None) + self.url = kwargs.get('url', None) + self.crop_area = kwargs.get('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 index 507a5e706b6d..8f3f52302e84 100644 --- 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 @@ -17,10 +17,7 @@ class ImageInfo(Model): 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 + :param 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) @@ -29,34 +26,28 @@ class ImageInfo(Model): 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 + :type image_insights_token: str + :param 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 + :type url: str + :param 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: + :type 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: + def __init__(self, *, image_insights_token: str=None, url: str=None, crop_area=None, **kwargs) -> None: super(ImageInfo, self).__init__(**kwargs) - self.image_insights_token = None - self.url = None - self.crop_area = None + self.image_insights_token = image_insights_token + self.url = url + self.crop_area = crop_area 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 index 2b9ac602a6ca..ef7dc4749016 100644 --- 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 @@ -16,23 +16,15 @@ 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 + :param 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 + :type 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 + self.filters = kwargs.get('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 index a5df1f33bf82..2f5aee6d0a54 100644 --- 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 @@ -16,23 +16,15 @@ 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 + :param 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 + :type filters: ~azure.cognitiveservices.search.visualsearch.models.Filters """ - _validation = { - 'filters': {'readonly': True}, - } - _attribute_map = { 'filters': {'key': 'filters', 'type': 'Filters'}, } - def __init__(self, **kwargs) -> None: + def __init__(self, *, filters=None, **kwargs) -> None: super(KnowledgeRequest, self).__init__(**kwargs) - self.filters = None + self.filters = filters 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 index 30e1dff81030..a6b139a4daa3 100644 --- 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 @@ -16,24 +16,16 @@ 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 + :param image_info: A JSON object that identities the image to get insights of. - :vartype image_info: + :type image_info: ~azure.cognitiveservices.search.visualsearch.models.ImageInfo - :ivar knowledge_request: A JSON object containing information about the + :param knowledge_request: A JSON object containing information about the request, such as filters, or a description. - :vartype knowledge_request: + :type 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'}, @@ -41,5 +33,5 @@ class VisualSearchRequest(Model): def __init__(self, **kwargs): super(VisualSearchRequest, self).__init__(**kwargs) - self.image_info = None - self.knowledge_request = None + self.image_info = kwargs.get('image_info', None) + self.knowledge_request = kwargs.get('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 index 81e8034f744f..fc1dd53108c8 100644 --- 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 @@ -16,30 +16,22 @@ 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 + :param image_info: A JSON object that identities the image to get insights of. - :vartype image_info: + :type image_info: ~azure.cognitiveservices.search.visualsearch.models.ImageInfo - :ivar knowledge_request: A JSON object containing information about the + :param knowledge_request: A JSON object containing information about the request, such as filters, or a description. - :vartype knowledge_request: + :type 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: + def __init__(self, *, image_info=None, knowledge_request=None, **kwargs) -> None: super(VisualSearchRequest, self).__init__(**kwargs) - self.image_info = None - self.knowledge_request = None + self.image_info = image_info + self.knowledge_request = knowledge_request diff --git a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/version.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/version.py index e0ec669828cb..63d89bfb54fa 100644 --- a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/version.py +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.1.0" +VERSION = "1.0"