# Code generated by lark_sdk_gen. DO NOT EDIT.

from pylark.lark_request import RawRequestReq, _new_method_option
import attr
import typing
import io


@attr.s
class CropFaceVerifyImageReqRawImage(object):
    pass


@attr.s
class CropFaceVerifyImageReq(object):
    raw_image: typing.Union[str, bytes, io.BytesIO] = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 带有头像的人脸照片文件名称


@attr.s
class CropFaceVerifyImageResp(object):
    face_image: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # BASE64(裁剪后的人脸基准图片)，code为0时返回


def _gen_crop_face_verify_image_req(request, options) -> RawRequestReq:
    return RawRequestReq(
        dataclass=CropFaceVerifyImageResp,
        scope="HumanAuth",
        api="CropFaceVerifyImage",
        method="POST",
        url="https://open.feishu.cn/open-apis/face_verify/v1/crop_face_image",
        body=request,
        method_option=_new_method_option(options),
        need_tenant_access_token=True,
        is_file=True,
    )
