# Code generated by Lark OpenAPI.

from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.model import BaseRequest
from lark_oapi.core.enum import HttpMethod, AccessTokenType
from .save_datasource_record_request_body import SaveDatasourceRecordRequestBody


class SaveDatasourceRecordRequest(BaseRequest):
    def __init__(self) -> None:
        super().__init__()
        self.request_body: Optional[SaveDatasourceRecordRequestBody] = None

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


class SaveDatasourceRecordRequestBuilder(object):

    def __init__(self) -> None:
        save_datasource_record_request = SaveDatasourceRecordRequest()
        save_datasource_record_request.http_method = HttpMethod.POST
        save_datasource_record_request.uri = "/open-apis/payroll/v1/datasource_records/save"
        save_datasource_record_request.token_types = {AccessTokenType.USER, AccessTokenType.TENANT}
        self._save_datasource_record_request: SaveDatasourceRecordRequest = save_datasource_record_request

    def request_body(self, request_body: SaveDatasourceRecordRequestBody) -> "SaveDatasourceRecordRequestBuilder":
        self._save_datasource_record_request.request_body = request_body
        self._save_datasource_record_request.body = request_body
        return self

    def build(self) -> SaveDatasourceRecordRequest:
        return self._save_datasource_record_request
