# 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 .social_plan_condition import SocialPlanCondition


class SocialPlanScope(object):
    _types = {
        "is_all": bool,
        "rules": List[list],
    }

    def __init__(self, d=None):
        self.is_all: Optional[bool] = None
        self.rules: Optional[List[list]] = None
        init(self, d, self._types)

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


class SocialPlanScopeBuilder(object):
    def __init__(self) -> None:
        self._social_plan_scope = SocialPlanScope()

    def is_all(self, is_all: bool) -> "SocialPlanScopeBuilder":
        self._social_plan_scope.is_all = is_all
        return self

    def rules(self, rules: List[list]) -> "SocialPlanScopeBuilder":
        self._social_plan_scope.rules = rules
        return self

    def build(self) -> "SocialPlanScope":
        return self._social_plan_scope
