# 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 .update_card_request_body import UpdateCardRequestBody


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

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


class UpdateCardRequestBuilder(object):

    def __init__(self) -> None:
        update_card_request = UpdateCardRequest()
        update_card_request.http_method = HttpMethod.PUT
        update_card_request.uri = "/open-apis/cardkit/v1/cards/:card_id"
        update_card_request.token_types = {AccessTokenType.TENANT}
        self._update_card_request: UpdateCardRequest = update_card_request

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

    def request_body(self, request_body: UpdateCardRequestBody) -> "UpdateCardRequestBuilder":
        self._update_card_request.request_body = request_body
        self._update_card_request.body = request_body
        return self

    def build(self) -> UpdateCardRequest:
        return self._update_card_request
