# Code generated by Lark OpenAPI.

from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.construct import init
from .id_with_name import IdWithName
from .id_with_name import IdWithName
from .verif_pay_calendar import VerifPayCalendar
from .id_with_name import IdWithName
from .verif_filter_rule import VerifFilterRule
from .verif_item import VerifItem
from .verif_data_source_rule import VerifDataSourceRule


class VerifPlanSnapshot(object):
    _types = {
        "is_retro": bool,
        "is_collect": bool,
        "is_proration": bool,
        "country_region": IdWithName,
        "currency": IdWithName,
        "calendar_type": int,
        "pay_calendars": List[VerifPayCalendar],
        "scope_type": int,
        "pay_groups": List[IdWithName],
        "filter_type": int,
        "filter_rule": VerifFilterRule,
        "approval_type": int,
        "items": List[VerifItem],
        "data_source_rule": VerifDataSourceRule,
    }

    def __init__(self, d=None):
        self.is_retro: Optional[bool] = None
        self.is_collect: Optional[bool] = None
        self.is_proration: Optional[bool] = None
        self.country_region: Optional[IdWithName] = None
        self.currency: Optional[IdWithName] = None
        self.calendar_type: Optional[int] = None
        self.pay_calendars: Optional[List[VerifPayCalendar]] = None
        self.scope_type: Optional[int] = None
        self.pay_groups: Optional[List[IdWithName]] = None
        self.filter_type: Optional[int] = None
        self.filter_rule: Optional[VerifFilterRule] = None
        self.approval_type: Optional[int] = None
        self.items: Optional[List[VerifItem]] = None
        self.data_source_rule: Optional[VerifDataSourceRule] = None
        init(self, d, self._types)

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


class VerifPlanSnapshotBuilder(object):
    def __init__(self) -> None:
        self._verif_plan_snapshot = VerifPlanSnapshot()

    def is_retro(self, is_retro: bool) -> "VerifPlanSnapshotBuilder":
        self._verif_plan_snapshot.is_retro = is_retro
        return self

    def is_collect(self, is_collect: bool) -> "VerifPlanSnapshotBuilder":
        self._verif_plan_snapshot.is_collect = is_collect
        return self

    def is_proration(self, is_proration: bool) -> "VerifPlanSnapshotBuilder":
        self._verif_plan_snapshot.is_proration = is_proration
        return self

    def country_region(self, country_region: IdWithName) -> "VerifPlanSnapshotBuilder":
        self._verif_plan_snapshot.country_region = country_region
        return self

    def currency(self, currency: IdWithName) -> "VerifPlanSnapshotBuilder":
        self._verif_plan_snapshot.currency = currency
        return self

    def calendar_type(self, calendar_type: int) -> "VerifPlanSnapshotBuilder":
        self._verif_plan_snapshot.calendar_type = calendar_type
        return self

    def pay_calendars(self, pay_calendars: List[VerifPayCalendar]) -> "VerifPlanSnapshotBuilder":
        self._verif_plan_snapshot.pay_calendars = pay_calendars
        return self

    def scope_type(self, scope_type: int) -> "VerifPlanSnapshotBuilder":
        self._verif_plan_snapshot.scope_type = scope_type
        return self

    def pay_groups(self, pay_groups: List[IdWithName]) -> "VerifPlanSnapshotBuilder":
        self._verif_plan_snapshot.pay_groups = pay_groups
        return self

    def filter_type(self, filter_type: int) -> "VerifPlanSnapshotBuilder":
        self._verif_plan_snapshot.filter_type = filter_type
        return self

    def filter_rule(self, filter_rule: VerifFilterRule) -> "VerifPlanSnapshotBuilder":
        self._verif_plan_snapshot.filter_rule = filter_rule
        return self

    def approval_type(self, approval_type: int) -> "VerifPlanSnapshotBuilder":
        self._verif_plan_snapshot.approval_type = approval_type
        return self

    def items(self, items: List[VerifItem]) -> "VerifPlanSnapshotBuilder":
        self._verif_plan_snapshot.items = items
        return self

    def data_source_rule(self, data_source_rule: VerifDataSourceRule) -> "VerifPlanSnapshotBuilder":
        self._verif_plan_snapshot.data_source_rule = data_source_rule
        return self

    def build(self) -> "VerifPlanSnapshot":
        return self._verif_plan_snapshot
