# 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 .feed_group_rule_cond_v2 import FeedGroupRuleCondV2


class FeedGroupRuleV2(object):
    _types = {
        "condition": FeedGroupRuleCondV2,
        "action": str,
    }

    def __init__(self, d=None):
        self.condition: Optional[FeedGroupRuleCondV2] = None
        self.action: Optional[str] = None
        init(self, d, self._types)

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


class FeedGroupRuleV2Builder(object):
    def __init__(self) -> None:
        self._feed_group_rule_v2 = FeedGroupRuleV2()

    def condition(self, condition: FeedGroupRuleCondV2) -> "FeedGroupRuleV2Builder":
        self._feed_group_rule_v2.condition = condition
        return self

    def action(self, action: str) -> "FeedGroupRuleV2Builder":
        self._feed_group_rule_v2.action = action
        return self

    def build(self) -> "FeedGroupRuleV2":
        return self._feed_group_rule_v2
