# 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 .reject_approval_task_request_body import RejectApprovalTaskRequestBody


class RejectApprovalTaskRequest(BaseRequest):
    def __init__(self) -> None:
        super().__init__()
        self.approval_task_id: Optional[str] = None
        self.request_body: Optional[RejectApprovalTaskRequestBody] = None

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


class RejectApprovalTaskRequestBuilder(object):

    def __init__(self) -> None:
        reject_approval_task_request = RejectApprovalTaskRequest()
        reject_approval_task_request.http_method = HttpMethod.POST
        reject_approval_task_request.uri = "/open-apis/apaas/v1/approval_tasks/:approval_task_id/reject"
        reject_approval_task_request.token_types = {AccessTokenType.TENANT}
        self._reject_approval_task_request: RejectApprovalTaskRequest = reject_approval_task_request

    def approval_task_id(self, approval_task_id: str) -> "RejectApprovalTaskRequestBuilder":
        self._reject_approval_task_request.approval_task_id = approval_task_id
        self._reject_approval_task_request.paths["approval_task_id"] = str(approval_task_id)
        return self

    def request_body(self, request_body: RejectApprovalTaskRequestBody) -> "RejectApprovalTaskRequestBuilder":
        self._reject_approval_task_request.request_body = request_body
        self._reject_approval_task_request.body = request_body
        return self

    def build(self) -> RejectApprovalTaskRequest:
        return self._reject_approval_task_request
