Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR cognitiveservices/data-plane/VisualSearch] [Visual Search API] Remove read-only property on input parameters #2534

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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'},
Expand All @@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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):
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)
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
# regenerated.
# --------------------------------------------------------------------------

VERSION = "0.1.0"
VERSION = "1.0"