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


@attr.s
class GetAttendanceUserStatisticsSettingsReq(object):
    employee_type: GetAttendanceUserStatisticsSettingsReqEmployeeType = attr.ib(
        factory=lambda: GetAttendanceUserStatisticsSettingsReqEmployeeType(),
        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`：月度统计


@attr.s
class GetAttendanceUserStatisticsSettingsRespViewItemChildItem(object):
    code: str = attr.ib(default="", metadata={"req_type": "json"})  # 标题编号
    value: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 是否开启,      , 可选值有: `0`：关闭, `1`：开启
    title: str = attr.ib(default="", metadata={"req_type": "json"})  # 标题名称
    column_type: int = attr.ib(default=0, metadata={"req_type": "json"})  # 标题类型
    read_only: bool = attr.ib(
        factory=lambda: bool(), metadata={"req_type": "json"}
    )  # 是否只读
    min_value: str = attr.ib(default="", metadata={"req_type": "json"})  # 最小值
    max_value: str = attr.ib(default="", metadata={"req_type": "json"})  # 最大值


@attr.s
class GetAttendanceUserStatisticsSettingsRespViewItem(object):
    code: str = attr.ib(default="", metadata={"req_type": "json"})  # 标题编号
    title: str = attr.ib(default="", metadata={"req_type": "json"})  # 标题名称
    child_items: typing.List[
        GetAttendanceUserStatisticsSettingsRespViewItemChildItem
    ] = attr.ib(
        factory=lambda: [], metadata={"req_type": "json"}
    )  # 子标题


@attr.s
class GetAttendanceUserStatisticsSettingsRespView(object):
    view_id: str = attr.ib(default="", metadata={"req_type": "json"})  # 视图 ID
    stats_type: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 统计类型, 可选值有: `daily`：日度统计, `month`：月度统计
    user_id: str = attr.ib(default="", metadata={"req_type": "json"})  # 用户 ID
    items: typing.List[GetAttendanceUserStatisticsSettingsRespViewItem] = attr.ib(
        factory=lambda: [], metadata={"req_type": "json"}
    )  # 一级标题


@attr.s
class GetAttendanceUserStatisticsSettingsResp(object):
    view: GetAttendanceUserStatisticsSettingsRespView = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 统计视图


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