# 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 GetAttendanceStatisticsDataReqEmployeeType(object):
    pass


@attr.s
class GetAttendanceStatisticsDataReq(object):
    employee_type: GetAttendanceStatisticsDataReqEmployeeType = attr.ib(
        factory=lambda: GetAttendanceStatisticsDataReqEmployeeType(),
        metadata={"req_type": "query"},
    )  # 用户 ID 类型, 可选值有: `employee_id`, `employee_no`
    locale: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 语言类型, 可选值有: `en`：英文, `ja`：日文, `zh`：中文
    stats_type: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 统计类型,      , 可选值有: `daily`：日度统计, `month`：月度统计
    start_date: int = attr.ib(
        default=0, metadata={"req_type": "json"}
    )  # 开始时间, 示例值：20210316
    end_date: int = attr.ib(
        default=0, metadata={"req_type": "json"}
    )  # 结束时间, 示例值：20210323,      ,      （时间间隔不超过 40 天）
    user_ids: typing.List[str] = attr.ib(
        factory=lambda: [], metadata={"req_type": "json"}
    )  # 查询的用户 ID 列表,      ,      （用户数量不超过 20）
    need_history: bool = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 是否包含历史数据, 示例值：true
    current_group_only: bool = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 是否只包含当前考勤组, 示例值：true


@attr.s
class GetAttendanceStatisticsDataRespUserDataDataFeature(object):
    key: str = attr.ib(default="", metadata={"req_type": "json"})  # 属性名
    value: str = attr.ib(default="", metadata={"req_type": "json"})  # 属性值


@attr.s
class GetAttendanceStatisticsDataRespUserDataData(object):
    code: str = attr.ib(default="", metadata={"req_type": "json"})  # 字段编号
    value: str = attr.ib(default="", metadata={"req_type": "json"})  # 数据值
    features: typing.List[GetAttendanceStatisticsDataRespUserDataDataFeature] = attr.ib(
        factory=lambda: [], metadata={"req_type": "json"}
    )  # 数据属性


@attr.s
class GetAttendanceStatisticsDataRespUserData(object):
    name: str = attr.ib(default="", metadata={"req_type": "json"})  # 姓名
    user_id: str = attr.ib(default="", metadata={"req_type": "json"})  # 用户 ID
    datas: typing.List[GetAttendanceStatisticsDataRespUserDataData] = attr.ib(
        factory=lambda: [], metadata={"req_type": "json"}
    )  # 数据


@attr.s
class GetAttendanceStatisticsDataResp(object):
    user_datas: typing.List[GetAttendanceStatisticsDataRespUserData] = attr.ib(
        factory=lambda: [], metadata={"req_type": "json"}
    )  # 用户统计数据


def _gen_get_attendance_statistics_data_req(request, options) -> RawRequestReq:
    return RawRequestReq(
        dataclass=GetAttendanceStatisticsDataResp,
        scope="Attendance",
        api="GetAttendanceStatisticsData",
        method="POST",
        url="https://open.feishu.cn/open-apis/attendance/v1/user_stats_datas/query",
        body=request,
        method_option=_new_method_option(options),
        need_tenant_access_token=True,
    )
