# 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 DocumentCover(object):
    _types = {
        "token": str,
        "offset_ratio_x": float,
        "offset_ratio_y": float,
    }

    def __init__(self, d=None):
        self.token: Optional[str] = None
        self.offset_ratio_x: Optional[float] = None
        self.offset_ratio_y: Optional[float] = None
        init(self, d, self._types)

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


class DocumentCoverBuilder(object):
    def __init__(self) -> None:
        self._document_cover = DocumentCover()

    def token(self, token: str) -> "DocumentCoverBuilder":
        self._document_cover.token = token
        return self

    def offset_ratio_x(self, offset_ratio_x: float) -> "DocumentCoverBuilder":
        self._document_cover.offset_ratio_x = offset_ratio_x
        return self

    def offset_ratio_y(self, offset_ratio_y: float) -> "DocumentCoverBuilder":
        self._document_cover.offset_ratio_y = offset_ratio_y
        return self

    def build(self) -> "DocumentCover":
        return self._document_cover
