# Code generated by Lark OpenAPI.

from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.construct import init


class FlexibleRule(object):
    _types = {
        "flexible_early_minutes": int,
        "flexible_late_minutes": int,
    }

    def __init__(self, d=None):
        self.flexible_early_minutes: Optional[int] = None
        self.flexible_late_minutes: Optional[int] = None
        init(self, d, self._types)

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


class FlexibleRuleBuilder(object):
    def __init__(self) -> None:
        self._flexible_rule = FlexibleRule()

    def flexible_early_minutes(self, flexible_early_minutes: int) -> "FlexibleRuleBuilder":
        self._flexible_rule.flexible_early_minutes = flexible_early_minutes
        return self

    def flexible_late_minutes(self, flexible_late_minutes: int) -> "FlexibleRuleBuilder":
        self._flexible_rule.flexible_late_minutes = flexible_late_minutes
        return self

    def build(self) -> "FlexibleRule":
        return self._flexible_rule
