# 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 .execute_application_flow_request_body import ExecuteApplicationFlowRequestBody


class ExecuteApplicationFlowRequest(BaseRequest):
    def __init__(self) -> None:
        super().__init__()
        self.namespace: Optional[str] = None
        self.flow_id: Optional[str] = None
        self.request_body: Optional[ExecuteApplicationFlowRequestBody] = None

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


class ExecuteApplicationFlowRequestBuilder(object):

    def __init__(self) -> None:
        execute_application_flow_request = ExecuteApplicationFlowRequest()
        execute_application_flow_request.http_method = HttpMethod.POST
        execute_application_flow_request.uri = "/open-apis/apaas/v1/applications/:namespace/flows/:flow_id/execute"
        execute_application_flow_request.token_types = {AccessTokenType.TENANT}
        self._execute_application_flow_request: ExecuteApplicationFlowRequest = execute_application_flow_request

    def namespace(self, namespace: str) -> "ExecuteApplicationFlowRequestBuilder":
        self._execute_application_flow_request.namespace = namespace
        self._execute_application_flow_request.paths["namespace"] = str(namespace)
        return self

    def flow_id(self, flow_id: str) -> "ExecuteApplicationFlowRequestBuilder":
        self._execute_application_flow_request.flow_id = flow_id
        self._execute_application_flow_request.paths["flow_id"] = str(flow_id)
        return self

    def request_body(self, request_body: ExecuteApplicationFlowRequestBody) -> "ExecuteApplicationFlowRequestBuilder":
        self._execute_application_flow_request.request_body = request_body
        self._execute_application_flow_request.body = request_body
        return self

    def build(self) -> ExecuteApplicationFlowRequest:
        return self._execute_application_flow_request
