# 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 .patch_card_element_request_body import PatchCardElementRequestBody


class PatchCardElementRequest(BaseRequest):
    def __init__(self) -> None:
        super().__init__()
        self.card_id: Optional[str] = None
        self.element_id: Optional[str] = None
        self.request_body: Optional[PatchCardElementRequestBody] = None

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


class PatchCardElementRequestBuilder(object):

    def __init__(self) -> None:
        patch_card_element_request = PatchCardElementRequest()
        patch_card_element_request.http_method = HttpMethod.PATCH
        patch_card_element_request.uri = "/open-apis/cardkit/v1/cards/:card_id/elements/:element_id"
        patch_card_element_request.token_types = {AccessTokenType.TENANT}
        self._patch_card_element_request: PatchCardElementRequest = patch_card_element_request

    def card_id(self, card_id: str) -> "PatchCardElementRequestBuilder":
        self._patch_card_element_request.card_id = card_id
        self._patch_card_element_request.paths["card_id"] = str(card_id)
        return self

    def element_id(self, element_id: str) -> "PatchCardElementRequestBuilder":
        self._patch_card_element_request.element_id = element_id
        self._patch_card_element_request.paths["element_id"] = str(element_id)
        return self

    def request_body(self, request_body: PatchCardElementRequestBody) -> "PatchCardElementRequestBuilder":
        self._patch_card_element_request.request_body = request_body
        self._patch_card_element_request.body = request_body
        return self

    def build(self) -> PatchCardElementRequest:
        return self._patch_card_element_request
