# 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 .i18n import I18n
from .standard_scope import StandardScope
from .standard_dimension import StandardDimension
from .standard_reference_object import StandardReferenceObject


class Standard(object):
    _types = {
        "id": str,
        "name": I18n,
        "updated_by": str,
        "updated_at": str,
        "created_by": str,
        "created_at": str,
        "automatic_backfill_standard_value": bool,
        "scope": StandardScope,
        "dimensions": List[StandardDimension],
        "reference_objects": List[StandardReferenceObject],
    }

    def __init__(self, d=None):
        self.id: Optional[str] = None
        self.name: Optional[I18n] = None
        self.updated_by: Optional[str] = None
        self.updated_at: Optional[str] = None
        self.created_by: Optional[str] = None
        self.created_at: Optional[str] = None
        self.automatic_backfill_standard_value: Optional[bool] = None
        self.scope: Optional[StandardScope] = None
        self.dimensions: Optional[List[StandardDimension]] = None
        self.reference_objects: Optional[List[StandardReferenceObject]] = None
        init(self, d, self._types)

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


class StandardBuilder(object):
    def __init__(self) -> None:
        self._standard = Standard()

    def id(self, id: str) -> "StandardBuilder":
        self._standard.id = id
        return self

    def name(self, name: I18n) -> "StandardBuilder":
        self._standard.name = name
        return self

    def updated_by(self, updated_by: str) -> "StandardBuilder":
        self._standard.updated_by = updated_by
        return self

    def updated_at(self, updated_at: str) -> "StandardBuilder":
        self._standard.updated_at = updated_at
        return self

    def created_by(self, created_by: str) -> "StandardBuilder":
        self._standard.created_by = created_by
        return self

    def created_at(self, created_at: str) -> "StandardBuilder":
        self._standard.created_at = created_at
        return self

    def automatic_backfill_standard_value(self, automatic_backfill_standard_value: bool) -> "StandardBuilder":
        self._standard.automatic_backfill_standard_value = automatic_backfill_standard_value
        return self

    def scope(self, scope: StandardScope) -> "StandardBuilder":
        self._standard.scope = scope
        return self

    def dimensions(self, dimensions: List[StandardDimension]) -> "StandardBuilder":
        self._standard.dimensions = dimensions
        return self

    def reference_objects(self, reference_objects: List[StandardReferenceObject]) -> "StandardBuilder":
        self._standard.reference_objects = reference_objects
        return self

    def build(self) -> "Standard":
        return self._standard
