huaweicloudsdkimagesearch 3.1.183__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- huaweicloudsdkimagesearch/__init__.py +0 -0
- huaweicloudsdkimagesearch/v2/__init__.py +40 -0
- huaweicloudsdkimagesearch/v2/imagesearch_async_client.py +418 -0
- huaweicloudsdkimagesearch/v2/imagesearch_client.py +415 -0
- huaweicloudsdkimagesearch/v2/model/__init__.py +37 -0
- huaweicloudsdkimagesearch/v2/model/add_data_optional_param.py +195 -0
- huaweicloudsdkimagesearch/v2/model/add_data_param.py +335 -0
- huaweicloudsdkimagesearch/v2/model/add_data_rest_info.py +104 -0
- huaweicloudsdkimagesearch/v2/model/add_data_rest_info_image_info.py +108 -0
- huaweicloudsdkimagesearch/v2/model/add_data_rest_info_image_info_objects.py +166 -0
- huaweicloudsdkimagesearch/v2/model/check_info.py +162 -0
- huaweicloudsdkimagesearch/v2/model/check_param.py +220 -0
- huaweicloudsdkimagesearch/v2/model/check_rest_info.py +187 -0
- huaweicloudsdkimagesearch/v2/model/delete_info.py +137 -0
- huaweicloudsdkimagesearch/v2/model/delete_param.py +195 -0
- huaweicloudsdkimagesearch/v2/model/delete_rest_info.py +133 -0
- huaweicloudsdkimagesearch/v2/model/delete_rest_info_items.py +108 -0
- huaweicloudsdkimagesearch/v2/model/item_source.py +195 -0
- huaweicloudsdkimagesearch/v2/model/range_param.py +137 -0
- huaweicloudsdkimagesearch/v2/model/run_add_data_request.py +132 -0
- huaweicloudsdkimagesearch/v2/model/run_add_data_response.py +137 -0
- huaweicloudsdkimagesearch/v2/model/run_check_data_request.py +132 -0
- huaweicloudsdkimagesearch/v2/model/run_check_data_response.py +137 -0
- huaweicloudsdkimagesearch/v2/model/run_delete_data_request.py +132 -0
- huaweicloudsdkimagesearch/v2/model/run_delete_data_response.py +137 -0
- huaweicloudsdkimagesearch/v2/model/run_search_request.py +132 -0
- huaweicloudsdkimagesearch/v2/model/run_search_response.py +137 -0
- huaweicloudsdkimagesearch/v2/model/run_update_data_request.py +132 -0
- huaweicloudsdkimagesearch/v2/model/run_update_data_response.py +112 -0
- huaweicloudsdkimagesearch/v2/model/search_after_param.py +137 -0
- huaweicloudsdkimagesearch/v2/model/search_info.py +191 -0
- huaweicloudsdkimagesearch/v2/model/search_item.py +162 -0
- huaweicloudsdkimagesearch/v2/model/search_optional_param.py +311 -0
- huaweicloudsdkimagesearch/v2/model/search_param.py +418 -0
- huaweicloudsdkimagesearch/v2/model/search_rest_info.py +158 -0
- huaweicloudsdkimagesearch/v2/model/search_rest_info_image_info.py +195 -0
- huaweicloudsdkimagesearch/v2/model/update_param.py +194 -0
- huaweicloudsdkimagesearch/v2/region/__init__.py +0 -0
- huaweicloudsdkimagesearch/v2/region/imagesearch_region.py +32 -0
- huaweicloudsdkimagesearch-3.1.183.dist-info/METADATA +25 -0
- huaweicloudsdkimagesearch-3.1.183.dist-info/RECORD +43 -0
- huaweicloudsdkimagesearch-3.1.183.dist-info/WHEEL +4 -0
- huaweicloudsdkimagesearch-3.1.183.dist-info/licenses/LICENSE +13 -0
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class SearchParam:
|
|
7
|
+
|
|
8
|
+
"""
|
|
9
|
+
Attributes:
|
|
10
|
+
openapi_types (dict): The key is attribute name
|
|
11
|
+
and the value is attribute type.
|
|
12
|
+
attribute_map (dict): The key is attribute name
|
|
13
|
+
and the value is json key in definition.
|
|
14
|
+
"""
|
|
15
|
+
sensitive_list = []
|
|
16
|
+
|
|
17
|
+
openapi_types = {
|
|
18
|
+
'search_type': 'str',
|
|
19
|
+
'limit': 'int',
|
|
20
|
+
'offset': 'int',
|
|
21
|
+
'last_item': 'SearchAfterParam',
|
|
22
|
+
'min_score': 'float',
|
|
23
|
+
'custom_tags': 'dict(str, list[str])',
|
|
24
|
+
'custom_num_tags': 'dict(str, RangeParam)',
|
|
25
|
+
'image_base64': 'str',
|
|
26
|
+
'image_url': 'str',
|
|
27
|
+
'keywords': 'list[str]',
|
|
28
|
+
'text': 'str',
|
|
29
|
+
'optional_params': 'SearchOptionalParam'
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
attribute_map = {
|
|
33
|
+
'search_type': 'search_type',
|
|
34
|
+
'limit': 'limit',
|
|
35
|
+
'offset': 'offset',
|
|
36
|
+
'last_item': 'last_item',
|
|
37
|
+
'min_score': 'min_score',
|
|
38
|
+
'custom_tags': 'custom_tags',
|
|
39
|
+
'custom_num_tags': 'custom_num_tags',
|
|
40
|
+
'image_base64': 'image_base64',
|
|
41
|
+
'image_url': 'image_url',
|
|
42
|
+
'keywords': 'keywords',
|
|
43
|
+
'text': 'text',
|
|
44
|
+
'optional_params': 'optional_params'
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
def __init__(self, search_type=None, limit=None, offset=None, last_item=None, min_score=None, custom_tags=None, custom_num_tags=None, image_base64=None, image_url=None, keywords=None, text=None, optional_params=None):
|
|
48
|
+
r"""SearchParam
|
|
49
|
+
|
|
50
|
+
The model defined in huaweicloud sdk
|
|
51
|
+
|
|
52
|
+
:param search_type: 搜索类型,必须为服务实例支持的搜索类型。服务实例的搜索类型列表可在创建服务实例时进行配置。 > 可以使用枚举名或者枚举值(例如IMAGE/0),枚举值可能会变动,建议使用枚举名。
|
|
53
|
+
:type search_type: str
|
|
54
|
+
:param limit: 返回搜索结果的数量,默认为10,取值范围为[1, 1000]。
|
|
55
|
+
:type limit: int
|
|
56
|
+
:param offset: 返回搜索结果的偏移量,即返回序号在[offset, offset+limit]内的搜索结果。默认为0,取值范围为[0, N]。 - 默认情况下,搜索要求offset+limit <= 1000。 - 针对支持全量召回的场景,使用全量召回时,要求offset必须为0。
|
|
57
|
+
:type offset: int
|
|
58
|
+
:param last_item:
|
|
59
|
+
:type last_item: :class:`huaweicloudsdkimagesearch.v2.SearchAfterParam`
|
|
60
|
+
:param min_score: 返回搜索结果的最小得分,用于对搜索结果进行score过滤,取值范围为[0, 1]。 - 目前仅对IMAGE/CATEGORY搜索类型生效。
|
|
61
|
+
:type min_score: float
|
|
62
|
+
:param custom_tags: 自定义字符标签,用于对搜索结果进行条件过滤。格式为键值对{key:value}。 - key: 必须为服务实例custom_tags中已存在的key,可在创建服务实例时进行配置,或在更新服务实例时进行新增。 - value: 标签值列表,列表内多个标签值为“或”关系,即满足一个即可。列表长度范围为[1, 32],标签值类型为字符串,字符长度范围为[1, 64]。
|
|
63
|
+
:type custom_tags: dict(str, list[str])
|
|
64
|
+
:param custom_num_tags: 自定义数值标签,用于对搜索结果进行条件过滤。格式为键值对{key:value}。 - key: 必须为服务实例custom_num_tags中已存在的key,可在创建服务实例时进行配置,或在更新服务实例时进行新增。针对没有设置该数值标签的数据,会直接过滤。 - value: 标签值的取值范围,标签值在给定的取值范围内即视为符合条件。
|
|
65
|
+
:type custom_num_tags: dict(str, RangeParam)
|
|
66
|
+
:param image_base64: 图像文件的base64字符串,基于图像搜索时,与image_url二选一。要求如下: - 格式:目前仅支持JPEG/JPG/PNG/BMP/WEBP格式的图像。 - 大小:图像文件大小要求不超过5M。 - 尺寸:默认情况下,要求图像的最短边大于64px,最长边小于4096px。部分服务类型有特殊要求,可参见服务类型说明。 - 其他:图片中不能包含旋转信息。
|
|
67
|
+
:type image_base64: str
|
|
68
|
+
:param image_url: 图像文件的服务可访问URL,字符长度范围为[1, 4096]。基于图像搜索时,与image_base64二选一。
|
|
69
|
+
:type image_url: str
|
|
70
|
+
:param keywords: 关键词列表,搜索时关键词数量范围为[1, 10],关键词字符长度范围为[1, 64]。使用KEYWORD搜索类型进行搜索时,必须提供该参数。
|
|
71
|
+
:type keywords: list[str]
|
|
72
|
+
:param text: 文本字符串,字符长度范围为[1, 512]。
|
|
73
|
+
:type text: str
|
|
74
|
+
:param optional_params:
|
|
75
|
+
:type optional_params: :class:`huaweicloudsdkimagesearch.v2.SearchOptionalParam`
|
|
76
|
+
"""
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
self._search_type = None
|
|
81
|
+
self._limit = None
|
|
82
|
+
self._offset = None
|
|
83
|
+
self._last_item = None
|
|
84
|
+
self._min_score = None
|
|
85
|
+
self._custom_tags = None
|
|
86
|
+
self._custom_num_tags = None
|
|
87
|
+
self._image_base64 = None
|
|
88
|
+
self._image_url = None
|
|
89
|
+
self._keywords = None
|
|
90
|
+
self._text = None
|
|
91
|
+
self._optional_params = None
|
|
92
|
+
self.discriminator = None
|
|
93
|
+
|
|
94
|
+
self.search_type = search_type
|
|
95
|
+
if limit is not None:
|
|
96
|
+
self.limit = limit
|
|
97
|
+
if offset is not None:
|
|
98
|
+
self.offset = offset
|
|
99
|
+
if last_item is not None:
|
|
100
|
+
self.last_item = last_item
|
|
101
|
+
if min_score is not None:
|
|
102
|
+
self.min_score = min_score
|
|
103
|
+
if custom_tags is not None:
|
|
104
|
+
self.custom_tags = custom_tags
|
|
105
|
+
if custom_num_tags is not None:
|
|
106
|
+
self.custom_num_tags = custom_num_tags
|
|
107
|
+
if image_base64 is not None:
|
|
108
|
+
self.image_base64 = image_base64
|
|
109
|
+
if image_url is not None:
|
|
110
|
+
self.image_url = image_url
|
|
111
|
+
if keywords is not None:
|
|
112
|
+
self.keywords = keywords
|
|
113
|
+
if text is not None:
|
|
114
|
+
self.text = text
|
|
115
|
+
if optional_params is not None:
|
|
116
|
+
self.optional_params = optional_params
|
|
117
|
+
|
|
118
|
+
@property
|
|
119
|
+
def search_type(self):
|
|
120
|
+
r"""Gets the search_type of this SearchParam.
|
|
121
|
+
|
|
122
|
+
搜索类型,必须为服务实例支持的搜索类型。服务实例的搜索类型列表可在创建服务实例时进行配置。 > 可以使用枚举名或者枚举值(例如IMAGE/0),枚举值可能会变动,建议使用枚举名。
|
|
123
|
+
|
|
124
|
+
:return: The search_type of this SearchParam.
|
|
125
|
+
:rtype: str
|
|
126
|
+
"""
|
|
127
|
+
return self._search_type
|
|
128
|
+
|
|
129
|
+
@search_type.setter
|
|
130
|
+
def search_type(self, search_type):
|
|
131
|
+
r"""Sets the search_type of this SearchParam.
|
|
132
|
+
|
|
133
|
+
搜索类型,必须为服务实例支持的搜索类型。服务实例的搜索类型列表可在创建服务实例时进行配置。 > 可以使用枚举名或者枚举值(例如IMAGE/0),枚举值可能会变动,建议使用枚举名。
|
|
134
|
+
|
|
135
|
+
:param search_type: The search_type of this SearchParam.
|
|
136
|
+
:type search_type: str
|
|
137
|
+
"""
|
|
138
|
+
self._search_type = search_type
|
|
139
|
+
|
|
140
|
+
@property
|
|
141
|
+
def limit(self):
|
|
142
|
+
r"""Gets the limit of this SearchParam.
|
|
143
|
+
|
|
144
|
+
返回搜索结果的数量,默认为10,取值范围为[1, 1000]。
|
|
145
|
+
|
|
146
|
+
:return: The limit of this SearchParam.
|
|
147
|
+
:rtype: int
|
|
148
|
+
"""
|
|
149
|
+
return self._limit
|
|
150
|
+
|
|
151
|
+
@limit.setter
|
|
152
|
+
def limit(self, limit):
|
|
153
|
+
r"""Sets the limit of this SearchParam.
|
|
154
|
+
|
|
155
|
+
返回搜索结果的数量,默认为10,取值范围为[1, 1000]。
|
|
156
|
+
|
|
157
|
+
:param limit: The limit of this SearchParam.
|
|
158
|
+
:type limit: int
|
|
159
|
+
"""
|
|
160
|
+
self._limit = limit
|
|
161
|
+
|
|
162
|
+
@property
|
|
163
|
+
def offset(self):
|
|
164
|
+
r"""Gets the offset of this SearchParam.
|
|
165
|
+
|
|
166
|
+
返回搜索结果的偏移量,即返回序号在[offset, offset+limit]内的搜索结果。默认为0,取值范围为[0, N]。 - 默认情况下,搜索要求offset+limit <= 1000。 - 针对支持全量召回的场景,使用全量召回时,要求offset必须为0。
|
|
167
|
+
|
|
168
|
+
:return: The offset of this SearchParam.
|
|
169
|
+
:rtype: int
|
|
170
|
+
"""
|
|
171
|
+
return self._offset
|
|
172
|
+
|
|
173
|
+
@offset.setter
|
|
174
|
+
def offset(self, offset):
|
|
175
|
+
r"""Sets the offset of this SearchParam.
|
|
176
|
+
|
|
177
|
+
返回搜索结果的偏移量,即返回序号在[offset, offset+limit]内的搜索结果。默认为0,取值范围为[0, N]。 - 默认情况下,搜索要求offset+limit <= 1000。 - 针对支持全量召回的场景,使用全量召回时,要求offset必须为0。
|
|
178
|
+
|
|
179
|
+
:param offset: The offset of this SearchParam.
|
|
180
|
+
:type offset: int
|
|
181
|
+
"""
|
|
182
|
+
self._offset = offset
|
|
183
|
+
|
|
184
|
+
@property
|
|
185
|
+
def last_item(self):
|
|
186
|
+
r"""Gets the last_item of this SearchParam.
|
|
187
|
+
|
|
188
|
+
:return: The last_item of this SearchParam.
|
|
189
|
+
:rtype: :class:`huaweicloudsdkimagesearch.v2.SearchAfterParam`
|
|
190
|
+
"""
|
|
191
|
+
return self._last_item
|
|
192
|
+
|
|
193
|
+
@last_item.setter
|
|
194
|
+
def last_item(self, last_item):
|
|
195
|
+
r"""Sets the last_item of this SearchParam.
|
|
196
|
+
|
|
197
|
+
:param last_item: The last_item of this SearchParam.
|
|
198
|
+
:type last_item: :class:`huaweicloudsdkimagesearch.v2.SearchAfterParam`
|
|
199
|
+
"""
|
|
200
|
+
self._last_item = last_item
|
|
201
|
+
|
|
202
|
+
@property
|
|
203
|
+
def min_score(self):
|
|
204
|
+
r"""Gets the min_score of this SearchParam.
|
|
205
|
+
|
|
206
|
+
返回搜索结果的最小得分,用于对搜索结果进行score过滤,取值范围为[0, 1]。 - 目前仅对IMAGE/CATEGORY搜索类型生效。
|
|
207
|
+
|
|
208
|
+
:return: The min_score of this SearchParam.
|
|
209
|
+
:rtype: float
|
|
210
|
+
"""
|
|
211
|
+
return self._min_score
|
|
212
|
+
|
|
213
|
+
@min_score.setter
|
|
214
|
+
def min_score(self, min_score):
|
|
215
|
+
r"""Sets the min_score of this SearchParam.
|
|
216
|
+
|
|
217
|
+
返回搜索结果的最小得分,用于对搜索结果进行score过滤,取值范围为[0, 1]。 - 目前仅对IMAGE/CATEGORY搜索类型生效。
|
|
218
|
+
|
|
219
|
+
:param min_score: The min_score of this SearchParam.
|
|
220
|
+
:type min_score: float
|
|
221
|
+
"""
|
|
222
|
+
self._min_score = min_score
|
|
223
|
+
|
|
224
|
+
@property
|
|
225
|
+
def custom_tags(self):
|
|
226
|
+
r"""Gets the custom_tags of this SearchParam.
|
|
227
|
+
|
|
228
|
+
自定义字符标签,用于对搜索结果进行条件过滤。格式为键值对{key:value}。 - key: 必须为服务实例custom_tags中已存在的key,可在创建服务实例时进行配置,或在更新服务实例时进行新增。 - value: 标签值列表,列表内多个标签值为“或”关系,即满足一个即可。列表长度范围为[1, 32],标签值类型为字符串,字符长度范围为[1, 64]。
|
|
229
|
+
|
|
230
|
+
:return: The custom_tags of this SearchParam.
|
|
231
|
+
:rtype: dict(str, list[str])
|
|
232
|
+
"""
|
|
233
|
+
return self._custom_tags
|
|
234
|
+
|
|
235
|
+
@custom_tags.setter
|
|
236
|
+
def custom_tags(self, custom_tags):
|
|
237
|
+
r"""Sets the custom_tags of this SearchParam.
|
|
238
|
+
|
|
239
|
+
自定义字符标签,用于对搜索结果进行条件过滤。格式为键值对{key:value}。 - key: 必须为服务实例custom_tags中已存在的key,可在创建服务实例时进行配置,或在更新服务实例时进行新增。 - value: 标签值列表,列表内多个标签值为“或”关系,即满足一个即可。列表长度范围为[1, 32],标签值类型为字符串,字符长度范围为[1, 64]。
|
|
240
|
+
|
|
241
|
+
:param custom_tags: The custom_tags of this SearchParam.
|
|
242
|
+
:type custom_tags: dict(str, list[str])
|
|
243
|
+
"""
|
|
244
|
+
self._custom_tags = custom_tags
|
|
245
|
+
|
|
246
|
+
@property
|
|
247
|
+
def custom_num_tags(self):
|
|
248
|
+
r"""Gets the custom_num_tags of this SearchParam.
|
|
249
|
+
|
|
250
|
+
自定义数值标签,用于对搜索结果进行条件过滤。格式为键值对{key:value}。 - key: 必须为服务实例custom_num_tags中已存在的key,可在创建服务实例时进行配置,或在更新服务实例时进行新增。针对没有设置该数值标签的数据,会直接过滤。 - value: 标签值的取值范围,标签值在给定的取值范围内即视为符合条件。
|
|
251
|
+
|
|
252
|
+
:return: The custom_num_tags of this SearchParam.
|
|
253
|
+
:rtype: dict(str, RangeParam)
|
|
254
|
+
"""
|
|
255
|
+
return self._custom_num_tags
|
|
256
|
+
|
|
257
|
+
@custom_num_tags.setter
|
|
258
|
+
def custom_num_tags(self, custom_num_tags):
|
|
259
|
+
r"""Sets the custom_num_tags of this SearchParam.
|
|
260
|
+
|
|
261
|
+
自定义数值标签,用于对搜索结果进行条件过滤。格式为键值对{key:value}。 - key: 必须为服务实例custom_num_tags中已存在的key,可在创建服务实例时进行配置,或在更新服务实例时进行新增。针对没有设置该数值标签的数据,会直接过滤。 - value: 标签值的取值范围,标签值在给定的取值范围内即视为符合条件。
|
|
262
|
+
|
|
263
|
+
:param custom_num_tags: The custom_num_tags of this SearchParam.
|
|
264
|
+
:type custom_num_tags: dict(str, RangeParam)
|
|
265
|
+
"""
|
|
266
|
+
self._custom_num_tags = custom_num_tags
|
|
267
|
+
|
|
268
|
+
@property
|
|
269
|
+
def image_base64(self):
|
|
270
|
+
r"""Gets the image_base64 of this SearchParam.
|
|
271
|
+
|
|
272
|
+
图像文件的base64字符串,基于图像搜索时,与image_url二选一。要求如下: - 格式:目前仅支持JPEG/JPG/PNG/BMP/WEBP格式的图像。 - 大小:图像文件大小要求不超过5M。 - 尺寸:默认情况下,要求图像的最短边大于64px,最长边小于4096px。部分服务类型有特殊要求,可参见服务类型说明。 - 其他:图片中不能包含旋转信息。
|
|
273
|
+
|
|
274
|
+
:return: The image_base64 of this SearchParam.
|
|
275
|
+
:rtype: str
|
|
276
|
+
"""
|
|
277
|
+
return self._image_base64
|
|
278
|
+
|
|
279
|
+
@image_base64.setter
|
|
280
|
+
def image_base64(self, image_base64):
|
|
281
|
+
r"""Sets the image_base64 of this SearchParam.
|
|
282
|
+
|
|
283
|
+
图像文件的base64字符串,基于图像搜索时,与image_url二选一。要求如下: - 格式:目前仅支持JPEG/JPG/PNG/BMP/WEBP格式的图像。 - 大小:图像文件大小要求不超过5M。 - 尺寸:默认情况下,要求图像的最短边大于64px,最长边小于4096px。部分服务类型有特殊要求,可参见服务类型说明。 - 其他:图片中不能包含旋转信息。
|
|
284
|
+
|
|
285
|
+
:param image_base64: The image_base64 of this SearchParam.
|
|
286
|
+
:type image_base64: str
|
|
287
|
+
"""
|
|
288
|
+
self._image_base64 = image_base64
|
|
289
|
+
|
|
290
|
+
@property
|
|
291
|
+
def image_url(self):
|
|
292
|
+
r"""Gets the image_url of this SearchParam.
|
|
293
|
+
|
|
294
|
+
图像文件的服务可访问URL,字符长度范围为[1, 4096]。基于图像搜索时,与image_base64二选一。
|
|
295
|
+
|
|
296
|
+
:return: The image_url of this SearchParam.
|
|
297
|
+
:rtype: str
|
|
298
|
+
"""
|
|
299
|
+
return self._image_url
|
|
300
|
+
|
|
301
|
+
@image_url.setter
|
|
302
|
+
def image_url(self, image_url):
|
|
303
|
+
r"""Sets the image_url of this SearchParam.
|
|
304
|
+
|
|
305
|
+
图像文件的服务可访问URL,字符长度范围为[1, 4096]。基于图像搜索时,与image_base64二选一。
|
|
306
|
+
|
|
307
|
+
:param image_url: The image_url of this SearchParam.
|
|
308
|
+
:type image_url: str
|
|
309
|
+
"""
|
|
310
|
+
self._image_url = image_url
|
|
311
|
+
|
|
312
|
+
@property
|
|
313
|
+
def keywords(self):
|
|
314
|
+
r"""Gets the keywords of this SearchParam.
|
|
315
|
+
|
|
316
|
+
关键词列表,搜索时关键词数量范围为[1, 10],关键词字符长度范围为[1, 64]。使用KEYWORD搜索类型进行搜索时,必须提供该参数。
|
|
317
|
+
|
|
318
|
+
:return: The keywords of this SearchParam.
|
|
319
|
+
:rtype: list[str]
|
|
320
|
+
"""
|
|
321
|
+
return self._keywords
|
|
322
|
+
|
|
323
|
+
@keywords.setter
|
|
324
|
+
def keywords(self, keywords):
|
|
325
|
+
r"""Sets the keywords of this SearchParam.
|
|
326
|
+
|
|
327
|
+
关键词列表,搜索时关键词数量范围为[1, 10],关键词字符长度范围为[1, 64]。使用KEYWORD搜索类型进行搜索时,必须提供该参数。
|
|
328
|
+
|
|
329
|
+
:param keywords: The keywords of this SearchParam.
|
|
330
|
+
:type keywords: list[str]
|
|
331
|
+
"""
|
|
332
|
+
self._keywords = keywords
|
|
333
|
+
|
|
334
|
+
@property
|
|
335
|
+
def text(self):
|
|
336
|
+
r"""Gets the text of this SearchParam.
|
|
337
|
+
|
|
338
|
+
文本字符串,字符长度范围为[1, 512]。
|
|
339
|
+
|
|
340
|
+
:return: The text of this SearchParam.
|
|
341
|
+
:rtype: str
|
|
342
|
+
"""
|
|
343
|
+
return self._text
|
|
344
|
+
|
|
345
|
+
@text.setter
|
|
346
|
+
def text(self, text):
|
|
347
|
+
r"""Sets the text of this SearchParam.
|
|
348
|
+
|
|
349
|
+
文本字符串,字符长度范围为[1, 512]。
|
|
350
|
+
|
|
351
|
+
:param text: The text of this SearchParam.
|
|
352
|
+
:type text: str
|
|
353
|
+
"""
|
|
354
|
+
self._text = text
|
|
355
|
+
|
|
356
|
+
@property
|
|
357
|
+
def optional_params(self):
|
|
358
|
+
r"""Gets the optional_params of this SearchParam.
|
|
359
|
+
|
|
360
|
+
:return: The optional_params of this SearchParam.
|
|
361
|
+
:rtype: :class:`huaweicloudsdkimagesearch.v2.SearchOptionalParam`
|
|
362
|
+
"""
|
|
363
|
+
return self._optional_params
|
|
364
|
+
|
|
365
|
+
@optional_params.setter
|
|
366
|
+
def optional_params(self, optional_params):
|
|
367
|
+
r"""Sets the optional_params of this SearchParam.
|
|
368
|
+
|
|
369
|
+
:param optional_params: The optional_params of this SearchParam.
|
|
370
|
+
:type optional_params: :class:`huaweicloudsdkimagesearch.v2.SearchOptionalParam`
|
|
371
|
+
"""
|
|
372
|
+
self._optional_params = optional_params
|
|
373
|
+
|
|
374
|
+
def to_dict(self):
|
|
375
|
+
result = {}
|
|
376
|
+
|
|
377
|
+
for attr, _ in self.openapi_types.items():
|
|
378
|
+
value = getattr(self, attr)
|
|
379
|
+
if isinstance(value, list):
|
|
380
|
+
result[attr] = list(map(
|
|
381
|
+
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
|
382
|
+
value
|
|
383
|
+
))
|
|
384
|
+
elif hasattr(value, "to_dict"):
|
|
385
|
+
result[attr] = value.to_dict()
|
|
386
|
+
elif isinstance(value, dict):
|
|
387
|
+
result[attr] = dict(map(
|
|
388
|
+
lambda item: (item[0], item[1].to_dict())
|
|
389
|
+
if hasattr(item[1], "to_dict") else item,
|
|
390
|
+
value.items()
|
|
391
|
+
))
|
|
392
|
+
else:
|
|
393
|
+
if attr in self.sensitive_list:
|
|
394
|
+
result[attr] = "****"
|
|
395
|
+
else:
|
|
396
|
+
result[attr] = value
|
|
397
|
+
|
|
398
|
+
return result
|
|
399
|
+
|
|
400
|
+
def to_str(self):
|
|
401
|
+
"""Returns the string representation of the model"""
|
|
402
|
+
import simplejson as json
|
|
403
|
+
return json.dumps(sanitize_for_serialization(self), ensure_ascii=False)
|
|
404
|
+
|
|
405
|
+
def __repr__(self):
|
|
406
|
+
"""For `print`"""
|
|
407
|
+
return self.to_str()
|
|
408
|
+
|
|
409
|
+
def __eq__(self, other):
|
|
410
|
+
"""Returns true if both objects are equal"""
|
|
411
|
+
if not isinstance(other, SearchParam):
|
|
412
|
+
return False
|
|
413
|
+
|
|
414
|
+
return self.__dict__ == other.__dict__
|
|
415
|
+
|
|
416
|
+
def __ne__(self, other):
|
|
417
|
+
"""Returns true if both objects are not equal"""
|
|
418
|
+
return not self == other
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class SearchRestInfo:
|
|
7
|
+
|
|
8
|
+
"""
|
|
9
|
+
Attributes:
|
|
10
|
+
openapi_types (dict): The key is attribute name
|
|
11
|
+
and the value is attribute type.
|
|
12
|
+
attribute_map (dict): The key is attribute name
|
|
13
|
+
and the value is json key in definition.
|
|
14
|
+
"""
|
|
15
|
+
sensitive_list = []
|
|
16
|
+
|
|
17
|
+
openapi_types = {
|
|
18
|
+
'items': 'list[SearchItem]',
|
|
19
|
+
'search_info': 'SearchInfo',
|
|
20
|
+
'image_info': 'SearchRestInfoImageInfo'
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
attribute_map = {
|
|
24
|
+
'items': 'items',
|
|
25
|
+
'search_info': 'search_info',
|
|
26
|
+
'image_info': 'image_info'
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
def __init__(self, items=None, search_info=None, image_info=None):
|
|
30
|
+
r"""SearchRestInfo
|
|
31
|
+
|
|
32
|
+
The model defined in huaweicloud sdk
|
|
33
|
+
|
|
34
|
+
:param items: 搜索结果列表。
|
|
35
|
+
:type items: list[:class:`huaweicloudsdkimagesearch.v2.SearchItem`]
|
|
36
|
+
:param search_info:
|
|
37
|
+
:type search_info: :class:`huaweicloudsdkimagesearch.v2.SearchInfo`
|
|
38
|
+
:param image_info:
|
|
39
|
+
:type image_info: :class:`huaweicloudsdkimagesearch.v2.SearchRestInfoImageInfo`
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
self._items = None
|
|
45
|
+
self._search_info = None
|
|
46
|
+
self._image_info = None
|
|
47
|
+
self.discriminator = None
|
|
48
|
+
|
|
49
|
+
if items is not None:
|
|
50
|
+
self.items = items
|
|
51
|
+
if search_info is not None:
|
|
52
|
+
self.search_info = search_info
|
|
53
|
+
if image_info is not None:
|
|
54
|
+
self.image_info = image_info
|
|
55
|
+
|
|
56
|
+
@property
|
|
57
|
+
def items(self):
|
|
58
|
+
r"""Gets the items of this SearchRestInfo.
|
|
59
|
+
|
|
60
|
+
搜索结果列表。
|
|
61
|
+
|
|
62
|
+
:return: The items of this SearchRestInfo.
|
|
63
|
+
:rtype: list[:class:`huaweicloudsdkimagesearch.v2.SearchItem`]
|
|
64
|
+
"""
|
|
65
|
+
return self._items
|
|
66
|
+
|
|
67
|
+
@items.setter
|
|
68
|
+
def items(self, items):
|
|
69
|
+
r"""Sets the items of this SearchRestInfo.
|
|
70
|
+
|
|
71
|
+
搜索结果列表。
|
|
72
|
+
|
|
73
|
+
:param items: The items of this SearchRestInfo.
|
|
74
|
+
:type items: list[:class:`huaweicloudsdkimagesearch.v2.SearchItem`]
|
|
75
|
+
"""
|
|
76
|
+
self._items = items
|
|
77
|
+
|
|
78
|
+
@property
|
|
79
|
+
def search_info(self):
|
|
80
|
+
r"""Gets the search_info of this SearchRestInfo.
|
|
81
|
+
|
|
82
|
+
:return: The search_info of this SearchRestInfo.
|
|
83
|
+
:rtype: :class:`huaweicloudsdkimagesearch.v2.SearchInfo`
|
|
84
|
+
"""
|
|
85
|
+
return self._search_info
|
|
86
|
+
|
|
87
|
+
@search_info.setter
|
|
88
|
+
def search_info(self, search_info):
|
|
89
|
+
r"""Sets the search_info of this SearchRestInfo.
|
|
90
|
+
|
|
91
|
+
:param search_info: The search_info of this SearchRestInfo.
|
|
92
|
+
:type search_info: :class:`huaweicloudsdkimagesearch.v2.SearchInfo`
|
|
93
|
+
"""
|
|
94
|
+
self._search_info = search_info
|
|
95
|
+
|
|
96
|
+
@property
|
|
97
|
+
def image_info(self):
|
|
98
|
+
r"""Gets the image_info of this SearchRestInfo.
|
|
99
|
+
|
|
100
|
+
:return: The image_info of this SearchRestInfo.
|
|
101
|
+
:rtype: :class:`huaweicloudsdkimagesearch.v2.SearchRestInfoImageInfo`
|
|
102
|
+
"""
|
|
103
|
+
return self._image_info
|
|
104
|
+
|
|
105
|
+
@image_info.setter
|
|
106
|
+
def image_info(self, image_info):
|
|
107
|
+
r"""Sets the image_info of this SearchRestInfo.
|
|
108
|
+
|
|
109
|
+
:param image_info: The image_info of this SearchRestInfo.
|
|
110
|
+
:type image_info: :class:`huaweicloudsdkimagesearch.v2.SearchRestInfoImageInfo`
|
|
111
|
+
"""
|
|
112
|
+
self._image_info = image_info
|
|
113
|
+
|
|
114
|
+
def to_dict(self):
|
|
115
|
+
result = {}
|
|
116
|
+
|
|
117
|
+
for attr, _ in self.openapi_types.items():
|
|
118
|
+
value = getattr(self, attr)
|
|
119
|
+
if isinstance(value, list):
|
|
120
|
+
result[attr] = list(map(
|
|
121
|
+
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
|
122
|
+
value
|
|
123
|
+
))
|
|
124
|
+
elif hasattr(value, "to_dict"):
|
|
125
|
+
result[attr] = value.to_dict()
|
|
126
|
+
elif isinstance(value, dict):
|
|
127
|
+
result[attr] = dict(map(
|
|
128
|
+
lambda item: (item[0], item[1].to_dict())
|
|
129
|
+
if hasattr(item[1], "to_dict") else item,
|
|
130
|
+
value.items()
|
|
131
|
+
))
|
|
132
|
+
else:
|
|
133
|
+
if attr in self.sensitive_list:
|
|
134
|
+
result[attr] = "****"
|
|
135
|
+
else:
|
|
136
|
+
result[attr] = value
|
|
137
|
+
|
|
138
|
+
return result
|
|
139
|
+
|
|
140
|
+
def to_str(self):
|
|
141
|
+
"""Returns the string representation of the model"""
|
|
142
|
+
import simplejson as json
|
|
143
|
+
return json.dumps(sanitize_for_serialization(self), ensure_ascii=False)
|
|
144
|
+
|
|
145
|
+
def __repr__(self):
|
|
146
|
+
"""For `print`"""
|
|
147
|
+
return self.to_str()
|
|
148
|
+
|
|
149
|
+
def __eq__(self, other):
|
|
150
|
+
"""Returns true if both objects are equal"""
|
|
151
|
+
if not isinstance(other, SearchRestInfo):
|
|
152
|
+
return False
|
|
153
|
+
|
|
154
|
+
return self.__dict__ == other.__dict__
|
|
155
|
+
|
|
156
|
+
def __ne__(self, other):
|
|
157
|
+
"""Returns true if both objects are not equal"""
|
|
158
|
+
return not self == other
|