# Code generated by Lark OpenAPI.

from typing import Optional

from lark_oapi.core.construct import init


class FailedMetricItem(object):
    _types = {
        "metric_item_id": str,
        "reason": str,
    }

    def __init__(self, d=None):
        self.metric_item_id: Optional[str] = None
        self.reason: Optional[str] = None
        init(self, d, self._types)

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


class FailedMetricItemBuilder(object):
    def __init__(self) -> None:
        self._failed_metric_item = FailedMetricItem()

    def metric_item_id(self, metric_item_id: str) -> "FailedMetricItemBuilder":
        self._failed_metric_item.metric_item_id = metric_item_id
        return self

    def reason(self, reason: str) -> "FailedMetricItemBuilder":
        self._failed_metric_item.reason = reason
        return self

    def build(self) -> "FailedMetricItem":
        return self._failed_metric_item
