# 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 TokenInfo(object):
    _types = {
        "access_token": str,
        "refresh_token": str,
        "token_type": str,
        "expires_in": int,
        "refresh_expires_in": int,
        "scope": str,
    }

    def __init__(self, d=None):
        self.access_token: Optional[str] = None
        self.refresh_token: Optional[str] = None
        self.token_type: Optional[str] = None
        self.expires_in: Optional[int] = None
        self.refresh_expires_in: Optional[int] = None
        self.scope: Optional[str] = None
        init(self, d, self._types)

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


class TokenInfoBuilder(object):
    def __init__(self) -> None:
        self._token_info = TokenInfo()

    def access_token(self, access_token: str) -> "TokenInfoBuilder":
        self._token_info.access_token = access_token
        return self

    def refresh_token(self, refresh_token: str) -> "TokenInfoBuilder":
        self._token_info.refresh_token = refresh_token
        return self

    def token_type(self, token_type: str) -> "TokenInfoBuilder":
        self._token_info.token_type = token_type
        return self

    def expires_in(self, expires_in: int) -> "TokenInfoBuilder":
        self._token_info.expires_in = expires_in
        return self

    def refresh_expires_in(self, refresh_expires_in: int) -> "TokenInfoBuilder":
        self._token_info.refresh_expires_in = refresh_expires_in
        return self

    def scope(self, scope: str) -> "TokenInfoBuilder":
        self._token_info.scope = scope
        return self

    def build(self) -> "TokenInfo":
        return self._token_info
