# 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 .rollback_points_user_task_request_body import RollbackPointsUserTaskRequestBody


class RollbackPointsUserTaskRequest(BaseRequest):
    def __init__(self) -> None:
        super().__init__()
        self.task_id: Optional[str] = None
        self.request_body: Optional[RollbackPointsUserTaskRequestBody] = None

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


class RollbackPointsUserTaskRequestBuilder(object):

    def __init__(self) -> None:
        rollback_points_user_task_request = RollbackPointsUserTaskRequest()
        rollback_points_user_task_request.http_method = HttpMethod.POST
        rollback_points_user_task_request.uri = "/open-apis/apaas/v1/user_tasks/:task_id/rollback_points"
        rollback_points_user_task_request.token_types = {AccessTokenType.TENANT}
        self._rollback_points_user_task_request: RollbackPointsUserTaskRequest = rollback_points_user_task_request

    def task_id(self, task_id: str) -> "RollbackPointsUserTaskRequestBuilder":
        self._rollback_points_user_task_request.task_id = task_id
        self._rollback_points_user_task_request.paths["task_id"] = str(task_id)
        return self

    def request_body(self, request_body: RollbackPointsUserTaskRequestBody) -> "RollbackPointsUserTaskRequestBuilder":
        self._rollback_points_user_task_request.request_body = request_body
        self._rollback_points_user_task_request.body = request_body
        return self

    def build(self) -> RollbackPointsUserTaskRequest:
        return self._rollback_points_user_task_request
