# Code generated by Lark OpenAPI.

from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.construct import init


class AppendDimension(object):
    _types = {
        "major_dimension": str,
        "length": int,
        "inherit_from_before": bool,
    }

    def __init__(self, d=None):
        self.major_dimension: Optional[str] = None
        self.length: Optional[int] = None
        self.inherit_from_before: Optional[bool] = None
        init(self, d, self._types)

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


class AppendDimensionBuilder(object):
    def __init__(self) -> None:
        self._append_dimension = AppendDimension()

    def major_dimension(self, major_dimension: str) -> "AppendDimensionBuilder":
        self._append_dimension.major_dimension = major_dimension
        return self

    def length(self, length: int) -> "AppendDimensionBuilder":
        self._append_dimension.length = length
        return self

    def inherit_from_before(self, inherit_from_before: bool) -> "AppendDimensionBuilder":
        self._append_dimension.inherit_from_before = inherit_from_before
        return self

    def build(self) -> "AppendDimension":
        return self._append_dimension
