2020-05-18 07:34:40 +00:00
|
|
|
|
# coding: utf-8
|
|
|
|
|
|
|
|
|
|
import re
|
|
|
|
|
import six
|
|
|
|
|
|
|
|
|
|
|
2020-07-15 09:30:15 +00:00
|
|
|
|
|
2021-07-26 11:24:08 +00:00
|
|
|
|
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
|
2020-07-15 09:30:15 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TaskSumbitReq:
|
2020-05-18 07:34:40 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
Attributes:
|
|
|
|
|
openapi_types (dict): The key is attribute name
|
|
|
|
|
and the value is attribute type.
|
|
|
|
|
attribute_map (dict): The key is attribute name
|
|
|
|
|
and the value is json key in definition.
|
|
|
|
|
"""
|
|
|
|
|
|
2020-06-15 07:04:23 +00:00
|
|
|
|
sensitive_list = []
|
|
|
|
|
|
2020-05-18 07:34:40 +00:00
|
|
|
|
openapi_types = {
|
|
|
|
|
'urls': 'list[str]',
|
|
|
|
|
'categories': 'list[str]'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
attribute_map = {
|
|
|
|
|
'urls': 'urls',
|
|
|
|
|
'categories': 'categories'
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-15 09:30:15 +00:00
|
|
|
|
def __init__(self, urls=None, categories=None):
|
2020-05-18 07:34:40 +00:00
|
|
|
|
"""TaskSumbitReq - a model defined in huaweicloud sdk"""
|
2020-07-15 09:30:15 +00:00
|
|
|
|
|
|
|
|
|
|
2020-05-18 07:34:40 +00:00
|
|
|
|
|
|
|
|
|
self._urls = None
|
|
|
|
|
self._categories = None
|
|
|
|
|
self.discriminator = None
|
|
|
|
|
|
|
|
|
|
self.urls = urls
|
|
|
|
|
if categories is not None:
|
|
|
|
|
self.categories = categories
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
|
def urls(self):
|
|
|
|
|
"""Gets the urls of this TaskSumbitReq.
|
|
|
|
|
|
|
|
|
|
图片的URL路径,目前支持: - 公网HTTP/HTTPS URL - 华为云OBS提供的URL,使用OBS数据需要进行授权。包括对服务授权、临时授权、匿名公开授权。详请参见[配置OBS访问权限](https://support.huaweicloud.com/api-moderation/moderation_03_0020.html)。 > 说明:图片的URL路径列表最多支持500个URL地址。接口响应时间依赖图片的下载时间,如果图片下载时间过长,会返回接口调用失败。请保证被检测图片所在的存储服务稳定可靠,建议您使用华为云OBS存储。
|
|
|
|
|
|
|
|
|
|
:return: The urls of this TaskSumbitReq.
|
|
|
|
|
:rtype: list[str]
|
|
|
|
|
"""
|
|
|
|
|
return self._urls
|
|
|
|
|
|
|
|
|
|
@urls.setter
|
|
|
|
|
def urls(self, urls):
|
|
|
|
|
"""Sets the urls of this TaskSumbitReq.
|
|
|
|
|
|
|
|
|
|
图片的URL路径,目前支持: - 公网HTTP/HTTPS URL - 华为云OBS提供的URL,使用OBS数据需要进行授权。包括对服务授权、临时授权、匿名公开授权。详请参见[配置OBS访问权限](https://support.huaweicloud.com/api-moderation/moderation_03_0020.html)。 > 说明:图片的URL路径列表最多支持500个URL地址。接口响应时间依赖图片的下载时间,如果图片下载时间过长,会返回接口调用失败。请保证被检测图片所在的存储服务稳定可靠,建议您使用华为云OBS存储。
|
|
|
|
|
|
|
|
|
|
:param urls: The urls of this TaskSumbitReq.
|
|
|
|
|
:type: list[str]
|
|
|
|
|
"""
|
|
|
|
|
self._urls = urls
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
|
def categories(self):
|
|
|
|
|
"""Gets the categories of this TaskSumbitReq.
|
|
|
|
|
|
|
|
|
|
检测场景。 - politics:是否涉及政治人物的检测。 - terrorism:是否包含涉政敏感人物、涉政暴恐元素的检测。 - porn:是否包含涉黄内容元素的检测。 可通过配置上述场景,来完成对应场景元素的检测。 为空或无此参数时默认检测politics和terrorism(不包含porn)。
|
|
|
|
|
|
|
|
|
|
:return: The categories of this TaskSumbitReq.
|
|
|
|
|
:rtype: list[str]
|
|
|
|
|
"""
|
|
|
|
|
return self._categories
|
|
|
|
|
|
|
|
|
|
@categories.setter
|
|
|
|
|
def categories(self, categories):
|
|
|
|
|
"""Sets the categories of this TaskSumbitReq.
|
|
|
|
|
|
|
|
|
|
检测场景。 - politics:是否涉及政治人物的检测。 - terrorism:是否包含涉政敏感人物、涉政暴恐元素的检测。 - porn:是否包含涉黄内容元素的检测。 可通过配置上述场景,来完成对应场景元素的检测。 为空或无此参数时默认检测politics和terrorism(不包含porn)。
|
|
|
|
|
|
|
|
|
|
:param categories: The categories of this TaskSumbitReq.
|
|
|
|
|
:type: list[str]
|
|
|
|
|
"""
|
|
|
|
|
self._categories = categories
|
|
|
|
|
|
|
|
|
|
def to_dict(self):
|
|
|
|
|
"""Returns the model properties as a dict"""
|
|
|
|
|
result = {}
|
|
|
|
|
|
|
|
|
|
for attr, _ in six.iteritems(self.openapi_types):
|
|
|
|
|
value = getattr(self, attr)
|
|
|
|
|
if isinstance(value, list):
|
|
|
|
|
result[attr] = list(map(
|
|
|
|
|
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
|
|
|
|
value
|
|
|
|
|
))
|
|
|
|
|
elif hasattr(value, "to_dict"):
|
|
|
|
|
result[attr] = value.to_dict()
|
|
|
|
|
elif isinstance(value, dict):
|
|
|
|
|
result[attr] = dict(map(
|
|
|
|
|
lambda item: (item[0], item[1].to_dict())
|
|
|
|
|
if hasattr(item[1], "to_dict") else item,
|
|
|
|
|
value.items()
|
|
|
|
|
))
|
|
|
|
|
else:
|
2020-06-15 07:04:23 +00:00
|
|
|
|
if attr in self.sensitive_list:
|
|
|
|
|
result[attr] = "****"
|
|
|
|
|
else:
|
|
|
|
|
result[attr] = value
|
2020-05-18 07:34:40 +00:00
|
|
|
|
|
|
|
|
|
return result
|
|
|
|
|
|
|
|
|
|
def to_str(self):
|
2021-07-09 10:57:08 +00:00
|
|
|
|
import simplejson as json
|
2021-07-26 11:24:08 +00:00
|
|
|
|
return json.dumps(sanitize_for_serialization(self))
|
2020-05-18 07:34:40 +00:00
|
|
|
|
|
|
|
|
|
def __repr__(self):
|
|
|
|
|
"""For `print` and `pprint`"""
|
|
|
|
|
return self.to_str()
|
|
|
|
|
|
|
|
|
|
def __eq__(self, other):
|
|
|
|
|
"""Returns true if both objects are equal"""
|
|
|
|
|
if not isinstance(other, TaskSumbitReq):
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
return self.__dict__ == other.__dict__
|
|
|
|
|
|
|
|
|
|
def __ne__(self, other):
|
|
|
|
|
"""Returns true if both objects are not equal"""
|
|
|
|
|
return not self == other
|