# 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_item import FeedGroupItem


class GroupItemFailedReason(object):
    _types = {
        "item": FeedGroupItem,
        "error_code": int,
        "error_message": str,
    }

    def __init__(self, d=None):
        self.item: Optional[FeedGroupItem] = None
        self.error_code: Optional[int] = None
        self.error_message: Optional[str] = None
        init(self, d, self._types)

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


class GroupItemFailedReasonBuilder(object):
    def __init__(self) -> None:
        self._group_item_failed_reason = GroupItemFailedReason()

    def item(self, item: FeedGroupItem) -> "GroupItemFailedReasonBuilder":
        self._group_item_failed_reason.item = item
        return self

    def error_code(self, error_code: int) -> "GroupItemFailedReasonBuilder":
        self._group_item_failed_reason.error_code = error_code
        return self

    def error_message(self, error_message: str) -> "GroupItemFailedReasonBuilder":
        self._group_item_failed_reason.error_message = error_message
        return self

    def build(self) -> "GroupItemFailedReason":
        return self._group_item_failed_reason
