Skip to content

Commit 6df4d95

Browse files
AutorestCIlmazuel
authored andcommitted
[AutoPR] cognitiveservices/data-plane/VisualSearch (#2535)
* Generated from 6db68a36da1b2d166a48943d455d4cf067e19e08 (#2534) [Visual Search API] Remove read-only property on input parameters * VisualSearch 0.1.1
1 parent 9723d1b commit 6df4d95

File tree

10 files changed

+54
-111
lines changed

10 files changed

+54
-111
lines changed

azure-cognitiveservices-search-visualsearch/HISTORY.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
Release History
44
===============
55

6+
0.1.1 (2018-05-04)
7+
++++++++++++++++++
8+
9+
**Bugfixes**
10+
11+
- Fix knowledge_request parameter (was ignored by the SDK)
12+
613
0.1.0 (2018-05-02)
714
++++++++++++++++++
815

azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/filters.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,15 @@ class Filters(Model):
1616
"""A key-value object consisting of filters that may be specified to limit the
1717
results returned by the API. Current available filters: site.
1818
19-
Variables are only populated by the server, and will be ignored when
20-
sending a request.
21-
22-
:ivar site: The URL of the site to return similar images and similar
19+
:param site: The URL of the site to return similar images and similar
2320
products from. (e.g., "www.bing.com", "bing.com").
24-
:vartype site: str
21+
:type site: str
2522
"""
2623

27-
_validation = {
28-
'site': {'readonly': True},
29-
}
30-
3124
_attribute_map = {
3225
'site': {'key': 'site', 'type': 'str'},
3326
}
3427

3528
def __init__(self, **kwargs):
3629
super(Filters, self).__init__(**kwargs)
37-
self.site = None
30+
self.site = kwargs.get('site', None)

azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/filters_py3.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,15 @@ class Filters(Model):
1616
"""A key-value object consisting of filters that may be specified to limit the
1717
results returned by the API. Current available filters: site.
1818
19-
Variables are only populated by the server, and will be ignored when
20-
sending a request.
21-
22-
:ivar site: The URL of the site to return similar images and similar
19+
:param site: The URL of the site to return similar images and similar
2320
products from. (e.g., "www.bing.com", "bing.com").
24-
:vartype site: str
21+
:type site: str
2522
"""
2623

27-
_validation = {
28-
'site': {'readonly': True},
29-
}
30-
3124
_attribute_map = {
3225
'site': {'key': 'site', 'type': 'str'},
3326
}
3427

35-
def __init__(self, **kwargs) -> None:
28+
def __init__(self, *, site: str=None, **kwargs) -> None:
3629
super(Filters, self).__init__(**kwargs)
37-
self.site = None
30+
self.site = site

azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_info.py

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@ class ImageInfo(Model):
1717
includes the optional crop area that you use to identify the region of
1818
interest in the image.
1919
20-
Variables are only populated by the server, and will be ignored when
21-
sending a request.
22-
23-
:ivar image_insights_token: An image insights token. To get the insights
20+
:param image_insights_token: An image insights token. To get the insights
2421
token, call one of the Image Search APIs (for example, /images/search). In
2522
the search results, the
2623
[Image](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#image)
@@ -29,26 +26,20 @@ class ImageInfo(Model):
2926
field contains the token. The imageInsightsToken and url fields mutually
3027
exclusive; do not specify both. Do not specify an insights token if the
3128
request includes the image form data.
32-
:vartype image_insights_token: str
33-
:ivar url: The URL of the input image. The imageInsightsToken and url
29+
:type image_insights_token: str
30+
:param url: The URL of the input image. The imageInsightsToken and url
3431
fields are mutually exclusive; do not specify both. Do not specify the URL
3532
if the request includes the image form data.
36-
:vartype url: str
37-
:ivar crop_area: A JSON object consisting of coordinates specifying the
33+
:type url: str
34+
:param crop_area: A JSON object consisting of coordinates specifying the
3835
four corners of a cropped rectangle within the input image. Use the crop
3936
area to identify the region of interest in the image. You can apply the
4037
crop area to the images specified using the imageInsightsToken or url
4138
fields, or an image binary specified in an image form data.
42-
:vartype crop_area:
39+
:type crop_area:
4340
~azure.cognitiveservices.search.visualsearch.models.CropArea
4441
"""
4542

46-
_validation = {
47-
'image_insights_token': {'readonly': True},
48-
'url': {'readonly': True},
49-
'crop_area': {'readonly': True},
50-
}
51-
5243
_attribute_map = {
5344
'image_insights_token': {'key': 'imageInsightsToken', 'type': 'str'},
5445
'url': {'key': 'url', 'type': 'str'},
@@ -57,6 +48,6 @@ class ImageInfo(Model):
5748

5849
def __init__(self, **kwargs):
5950
super(ImageInfo, self).__init__(**kwargs)
60-
self.image_insights_token = None
61-
self.url = None
62-
self.crop_area = None
51+
self.image_insights_token = kwargs.get('image_insights_token', None)
52+
self.url = kwargs.get('url', None)
53+
self.crop_area = kwargs.get('crop_area', None)

azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_info_py3.py

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@ class ImageInfo(Model):
1717
includes the optional crop area that you use to identify the region of
1818
interest in the image.
1919
20-
Variables are only populated by the server, and will be ignored when
21-
sending a request.
22-
23-
:ivar image_insights_token: An image insights token. To get the insights
20+
:param image_insights_token: An image insights token. To get the insights
2421
token, call one of the Image Search APIs (for example, /images/search). In
2522
the search results, the
2623
[Image](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#image)
@@ -29,34 +26,28 @@ class ImageInfo(Model):
2926
field contains the token. The imageInsightsToken and url fields mutually
3027
exclusive; do not specify both. Do not specify an insights token if the
3128
request includes the image form data.
32-
:vartype image_insights_token: str
33-
:ivar url: The URL of the input image. The imageInsightsToken and url
29+
:type image_insights_token: str
30+
:param url: The URL of the input image. The imageInsightsToken and url
3431
fields are mutually exclusive; do not specify both. Do not specify the URL
3532
if the request includes the image form data.
36-
:vartype url: str
37-
:ivar crop_area: A JSON object consisting of coordinates specifying the
33+
:type url: str
34+
:param crop_area: A JSON object consisting of coordinates specifying the
3835
four corners of a cropped rectangle within the input image. Use the crop
3936
area to identify the region of interest in the image. You can apply the
4037
crop area to the images specified using the imageInsightsToken or url
4138
fields, or an image binary specified in an image form data.
42-
:vartype crop_area:
39+
:type crop_area:
4340
~azure.cognitiveservices.search.visualsearch.models.CropArea
4441
"""
4542

46-
_validation = {
47-
'image_insights_token': {'readonly': True},
48-
'url': {'readonly': True},
49-
'crop_area': {'readonly': True},
50-
}
51-
5243
_attribute_map = {
5344
'image_insights_token': {'key': 'imageInsightsToken', 'type': 'str'},
5445
'url': {'key': 'url', 'type': 'str'},
5546
'crop_area': {'key': 'cropArea', 'type': 'CropArea'},
5647
}
5748

58-
def __init__(self, **kwargs) -> None:
49+
def __init__(self, *, image_insights_token: str=None, url: str=None, crop_area=None, **kwargs) -> None:
5950
super(ImageInfo, self).__init__(**kwargs)
60-
self.image_insights_token = None
61-
self.url = None
62-
self.crop_area = None
51+
self.image_insights_token = image_insights_token
52+
self.url = url
53+
self.crop_area = crop_area

azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/knowledge_request.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,15 @@ class KnowledgeRequest(Model):
1616
"""A JSON object containing information about the request, such as filters for
1717
the resulting actions.
1818
19-
Variables are only populated by the server, and will be ignored when
20-
sending a request.
21-
22-
:ivar filters: A key-value object consisting of filters that may be
19+
:param filters: A key-value object consisting of filters that may be
2320
specified to limit the results returned by the API.
24-
:vartype filters:
25-
~azure.cognitiveservices.search.visualsearch.models.Filters
21+
:type filters: ~azure.cognitiveservices.search.visualsearch.models.Filters
2622
"""
2723

28-
_validation = {
29-
'filters': {'readonly': True},
30-
}
31-
3224
_attribute_map = {
3325
'filters': {'key': 'filters', 'type': 'Filters'},
3426
}
3527

3628
def __init__(self, **kwargs):
3729
super(KnowledgeRequest, self).__init__(**kwargs)
38-
self.filters = None
30+
self.filters = kwargs.get('filters', None)

azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/knowledge_request_py3.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,15 @@ class KnowledgeRequest(Model):
1616
"""A JSON object containing information about the request, such as filters for
1717
the resulting actions.
1818
19-
Variables are only populated by the server, and will be ignored when
20-
sending a request.
21-
22-
:ivar filters: A key-value object consisting of filters that may be
19+
:param filters: A key-value object consisting of filters that may be
2320
specified to limit the results returned by the API.
24-
:vartype filters:
25-
~azure.cognitiveservices.search.visualsearch.models.Filters
21+
:type filters: ~azure.cognitiveservices.search.visualsearch.models.Filters
2622
"""
2723

28-
_validation = {
29-
'filters': {'readonly': True},
30-
}
31-
3224
_attribute_map = {
3325
'filters': {'key': 'filters', 'type': 'Filters'},
3426
}
3527

36-
def __init__(self, **kwargs) -> None:
28+
def __init__(self, *, filters=None, **kwargs) -> None:
3729
super(KnowledgeRequest, self).__init__(**kwargs)
38-
self.filters = None
30+
self.filters = filters

azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/visual_search_request.py

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,22 @@ class VisualSearchRequest(Model):
1616
"""A JSON object that contains information about the image to get insights of.
1717
Specify this object only in a knowledgeRequest form data.
1818
19-
Variables are only populated by the server, and will be ignored when
20-
sending a request.
21-
22-
:ivar image_info: A JSON object that identities the image to get insights
19+
:param image_info: A JSON object that identities the image to get insights
2320
of.
24-
:vartype image_info:
21+
:type image_info:
2522
~azure.cognitiveservices.search.visualsearch.models.ImageInfo
26-
:ivar knowledge_request: A JSON object containing information about the
23+
:param knowledge_request: A JSON object containing information about the
2724
request, such as filters, or a description.
28-
:vartype knowledge_request:
25+
:type knowledge_request:
2926
~azure.cognitiveservices.search.visualsearch.models.KnowledgeRequest
3027
"""
3128

32-
_validation = {
33-
'image_info': {'readonly': True},
34-
'knowledge_request': {'readonly': True},
35-
}
36-
3729
_attribute_map = {
3830
'image_info': {'key': 'imageInfo', 'type': 'ImageInfo'},
3931
'knowledge_request': {'key': 'knowledgeRequest', 'type': 'KnowledgeRequest'},
4032
}
4133

4234
def __init__(self, **kwargs):
4335
super(VisualSearchRequest, self).__init__(**kwargs)
44-
self.image_info = None
45-
self.knowledge_request = None
36+
self.image_info = kwargs.get('image_info', None)
37+
self.knowledge_request = kwargs.get('knowledge_request', None)

azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/visual_search_request_py3.py

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,22 @@ class VisualSearchRequest(Model):
1616
"""A JSON object that contains information about the image to get insights of.
1717
Specify this object only in a knowledgeRequest form data.
1818
19-
Variables are only populated by the server, and will be ignored when
20-
sending a request.
21-
22-
:ivar image_info: A JSON object that identities the image to get insights
19+
:param image_info: A JSON object that identities the image to get insights
2320
of.
24-
:vartype image_info:
21+
:type image_info:
2522
~azure.cognitiveservices.search.visualsearch.models.ImageInfo
26-
:ivar knowledge_request: A JSON object containing information about the
23+
:param knowledge_request: A JSON object containing information about the
2724
request, such as filters, or a description.
28-
:vartype knowledge_request:
25+
:type knowledge_request:
2926
~azure.cognitiveservices.search.visualsearch.models.KnowledgeRequest
3027
"""
3128

32-
_validation = {
33-
'image_info': {'readonly': True},
34-
'knowledge_request': {'readonly': True},
35-
}
36-
3729
_attribute_map = {
3830
'image_info': {'key': 'imageInfo', 'type': 'ImageInfo'},
3931
'knowledge_request': {'key': 'knowledgeRequest', 'type': 'KnowledgeRequest'},
4032
}
4133

42-
def __init__(self, **kwargs) -> None:
34+
def __init__(self, *, image_info=None, knowledge_request=None, **kwargs) -> None:
4335
super(VisualSearchRequest, self).__init__(**kwargs)
44-
self.image_info = None
45-
self.knowledge_request = None
36+
self.image_info = image_info
37+
self.knowledge_request = knowledge_request

azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
# regenerated.
1010
# --------------------------------------------------------------------------
1111

12-
VERSION = "0.1.0"
12+
VERSION = "0.1.1"
1313

0 commit comments

Comments
 (0)