huaweicloud-sdk-python-v3/huaweicloud-sdk-frs/huaweicloudsdkfrs/v1/model/add_faces_base64_req.py

168 lines
5.6 KiB
Python
Raw Normal View History

2021-08-10 12:26:18 +00:00
# coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class AddFacesBase64Req:
"""
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.
"""
sensitive_list = []
openapi_types = {
'image_base64': 'str',
'external_fields': 'object',
'external_image_id': 'str'
}
attribute_map = {
'image_base64': 'image_base64',
'external_fields': 'external_fields',
'external_image_id': 'external_image_id'
}
def __init__(self, image_base64=None, external_fields=None, external_image_id=None):
"""AddFacesBase64Req - a model defined in huaweicloud sdk"""
self._image_base64 = None
self._external_fields = None
self._external_image_id = None
self.discriminator = None
self.image_base64 = image_base64
if external_fields is not None:
self.external_fields = external_fields
if external_image_id is not None:
self.external_image_id = external_image_id
@property
def image_base64(self):
"""Gets the image_base64 of this AddFacesBase64Req.
图像数据Base64编码要求 Base64编码后大小不超过8MB建议小于1MB 图片为JPG/JPEG/BMP/PNG格式
:return: The image_base64 of this AddFacesBase64Req.
:rtype: str
"""
return self._image_base64
@image_base64.setter
def image_base64(self, image_base64):
"""Sets the image_base64 of this AddFacesBase64Req.
图像数据Base64编码要求 Base64编码后大小不超过8MB建议小于1MB 图片为JPG/JPEG/BMP/PNG格式
:param image_base64: The image_base64 of this AddFacesBase64Req.
:type: str
"""
self._image_base64 = image_base64
@property
def external_fields(self):
"""Gets the external_fields of this AddFacesBase64Req.
根据用户自定义数据类型填入相应的数值 创建faceset时定义该字段Json字符串不校验重复性参考[自定义字段](zh-cn_topic_0130807044.xml)
:return: The external_fields of this AddFacesBase64Req.
:rtype: object
"""
return self._external_fields
@external_fields.setter
def external_fields(self, external_fields):
"""Sets the external_fields of this AddFacesBase64Req.
根据用户自定义数据类型填入相应的数值 创建faceset时定义该字段Json字符串不校验重复性参考[自定义字段](zh-cn_topic_0130807044.xml)
:param external_fields: The external_fields of this AddFacesBase64Req.
:type: object
"""
self._external_fields = external_fields
@property
def external_image_id(self):
"""Gets the external_image_id of this AddFacesBase64Req.
用户指定的图片外部ID与当前图像绑定用户没提供系统会生成一个 该ID长度范围为136可以包含字母数字中划线或者下划线不包含其他的特殊字符
:return: The external_image_id of this AddFacesBase64Req.
:rtype: str
"""
return self._external_image_id
@external_image_id.setter
def external_image_id(self, external_image_id):
"""Sets the external_image_id of this AddFacesBase64Req.
用户指定的图片外部ID与当前图像绑定用户没提供系统会生成一个 该ID长度范围为136可以包含字母数字中划线或者下划线不包含其他的特殊字符
:param external_image_id: The external_image_id of this AddFacesBase64Req.
:type: str
"""
self._external_image_id = external_image_id
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:
if attr in self.sensitive_list:
result[attr] = "****"
else:
result[attr] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
import simplejson as json
if six.PY2:
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
return json.dumps(sanitize_for_serialization(self), ensure_ascii=False)
def __repr__(self):
"""For `print`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, AddFacesBase64Req):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other