# Code generated by Lark OpenAPI.

from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.model import BaseRequest
from lark_oapi.core.enum import HttpMethod, AccessTokenType


class ListCostAllocationDetailRequest(BaseRequest):
    def __init__(self) -> None:
        super().__init__()
        self.page_size: Optional[int] = None
        self.page_token: Optional[str] = None
        self.cost_allocation_plan_id: Optional[str] = None
        self.pay_period: Optional[str] = None
        self.report_type: Optional[int] = None

    @staticmethod
    def builder() -> "ListCostAllocationDetailRequestBuilder":
        return ListCostAllocationDetailRequestBuilder()


class ListCostAllocationDetailRequestBuilder(object):

    def __init__(self) -> None:
        list_cost_allocation_detail_request = ListCostAllocationDetailRequest()
        list_cost_allocation_detail_request.http_method = HttpMethod.GET
        list_cost_allocation_detail_request.uri = "/open-apis/payroll/v1/cost_allocation_details"
        list_cost_allocation_detail_request.token_types = {AccessTokenType.USER, AccessTokenType.TENANT}
        self._list_cost_allocation_detail_request: ListCostAllocationDetailRequest = list_cost_allocation_detail_request

    def page_size(self, page_size: int) -> "ListCostAllocationDetailRequestBuilder":
        self._list_cost_allocation_detail_request.page_size = page_size
        self._list_cost_allocation_detail_request.add_query("page_size", page_size)
        return self

    def page_token(self, page_token: str) -> "ListCostAllocationDetailRequestBuilder":
        self._list_cost_allocation_detail_request.page_token = page_token
        self._list_cost_allocation_detail_request.add_query("page_token", page_token)
        return self

    def cost_allocation_plan_id(self, cost_allocation_plan_id: str) -> "ListCostAllocationDetailRequestBuilder":
        self._list_cost_allocation_detail_request.cost_allocation_plan_id = cost_allocation_plan_id
        self._list_cost_allocation_detail_request.add_query("cost_allocation_plan_id", cost_allocation_plan_id)
        return self

    def pay_period(self, pay_period: str) -> "ListCostAllocationDetailRequestBuilder":
        self._list_cost_allocation_detail_request.pay_period = pay_period
        self._list_cost_allocation_detail_request.add_query("pay_period", pay_period)
        return self

    def report_type(self, report_type: int) -> "ListCostAllocationDetailRequestBuilder":
        self._list_cost_allocation_detail_request.report_type = report_type
        self._list_cost_allocation_detail_request.add_query("report_type", report_type)
        return self

    def build(self) -> ListCostAllocationDetailRequest:
        return self._list_cost_allocation_detail_request
