# 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 .id_with_name import IdWithName


class VerifDatasourceItem(object):
    _types = {
        "name": IdWithName,
        "field_id": str,
        "field_type": int,
        "object_api_name": str,
        "field_api_name": str,
        "decimal_places": int,
        "object_type": int,
        "source_type": int,
    }

    def __init__(self, d=None):
        self.name: Optional[IdWithName] = None
        self.field_id: Optional[str] = None
        self.field_type: Optional[int] = None
        self.object_api_name: Optional[str] = None
        self.field_api_name: Optional[str] = None
        self.decimal_places: Optional[int] = None
        self.object_type: Optional[int] = None
        self.source_type: Optional[int] = None
        init(self, d, self._types)

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


class VerifDatasourceItemBuilder(object):
    def __init__(self) -> None:
        self._verif_datasource_item = VerifDatasourceItem()

    def name(self, name: IdWithName) -> "VerifDatasourceItemBuilder":
        self._verif_datasource_item.name = name
        return self

    def field_id(self, field_id: str) -> "VerifDatasourceItemBuilder":
        self._verif_datasource_item.field_id = field_id
        return self

    def field_type(self, field_type: int) -> "VerifDatasourceItemBuilder":
        self._verif_datasource_item.field_type = field_type
        return self

    def object_api_name(self, object_api_name: str) -> "VerifDatasourceItemBuilder":
        self._verif_datasource_item.object_api_name = object_api_name
        return self

    def field_api_name(self, field_api_name: str) -> "VerifDatasourceItemBuilder":
        self._verif_datasource_item.field_api_name = field_api_name
        return self

    def decimal_places(self, decimal_places: int) -> "VerifDatasourceItemBuilder":
        self._verif_datasource_item.decimal_places = decimal_places
        return self

    def object_type(self, object_type: int) -> "VerifDatasourceItemBuilder":
        self._verif_datasource_item.object_type = object_type
        return self

    def source_type(self, source_type: int) -> "VerifDatasourceItemBuilder":
        self._verif_datasource_item.source_type = source_type
        return self

    def build(self) -> "VerifDatasourceItem":
        return self._verif_datasource_item
