# 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_content import I18nContent
from .dimension import Dimension
from .cost_item import CostItem


class CostAllocationPlan(object):
    _types = {
        "id": int,
        "names": List[I18nContent],
        "applicable_country_region": str,
        "dimensions": List[Dimension],
        "cost_items": List[CostItem],
    }

    def __init__(self, d=None):
        self.id: Optional[int] = None
        self.names: Optional[List[I18nContent]] = None
        self.applicable_country_region: Optional[str] = None
        self.dimensions: Optional[List[Dimension]] = None
        self.cost_items: Optional[List[CostItem]] = None
        init(self, d, self._types)

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


class CostAllocationPlanBuilder(object):
    def __init__(self) -> None:
        self._cost_allocation_plan = CostAllocationPlan()

    def id(self, id: int) -> "CostAllocationPlanBuilder":
        self._cost_allocation_plan.id = id
        return self

    def names(self, names: List[I18nContent]) -> "CostAllocationPlanBuilder":
        self._cost_allocation_plan.names = names
        return self

    def applicable_country_region(self, applicable_country_region: str) -> "CostAllocationPlanBuilder":
        self._cost_allocation_plan.applicable_country_region = applicable_country_region
        return self

    def dimensions(self, dimensions: List[Dimension]) -> "CostAllocationPlanBuilder":
        self._cost_allocation_plan.dimensions = dimensions
        return self

    def cost_items(self, cost_items: List[CostItem]) -> "CostAllocationPlanBuilder":
        self._cost_allocation_plan.cost_items = cost_items
        return self

    def build(self) -> "CostAllocationPlan":
        return self._cost_allocation_plan
