huaweicloudsdkimagesearch 3.1.160__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.

Potentially problematic release.


This version of huaweicloudsdkimagesearch might be problematic. Click here for more details.

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