# 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 .reorder_user_mailbox_rule_request_body import ReorderUserMailboxRuleRequestBody


class ReorderUserMailboxRuleRequest(BaseRequest):
    def __init__(self) -> None:
        super().__init__()
        self.user_mailbox_id: Optional[str] = None
        self.request_body: Optional[ReorderUserMailboxRuleRequestBody] = None

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


class ReorderUserMailboxRuleRequestBuilder(object):

    def __init__(self) -> None:
        reorder_user_mailbox_rule_request = ReorderUserMailboxRuleRequest()
        reorder_user_mailbox_rule_request.http_method = HttpMethod.POST
        reorder_user_mailbox_rule_request.uri = "/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules/reorder"
        reorder_user_mailbox_rule_request.token_types = {AccessTokenType.TENANT, AccessTokenType.USER}
        self._reorder_user_mailbox_rule_request: ReorderUserMailboxRuleRequest = reorder_user_mailbox_rule_request

    def user_mailbox_id(self, user_mailbox_id: str) -> "ReorderUserMailboxRuleRequestBuilder":
        self._reorder_user_mailbox_rule_request.user_mailbox_id = user_mailbox_id
        self._reorder_user_mailbox_rule_request.paths["user_mailbox_id"] = str(user_mailbox_id)
        return self

    def request_body(self, request_body: ReorderUserMailboxRuleRequestBody) -> "ReorderUserMailboxRuleRequestBuilder":
        self._reorder_user_mailbox_rule_request.request_body = request_body
        self._reorder_user_mailbox_rule_request.body = request_body
        return self

    def build(self) -> ReorderUserMailboxRuleRequest:
        return self._reorder_user_mailbox_rule_request
