# 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 .publish_advertisement_request_body import PublishAdvertisementRequestBody


class PublishAdvertisementRequest(BaseRequest):
    def __init__(self) -> None:
        super().__init__()
        self.advertisement_id: Optional[str] = None
        self.request_body: Optional[PublishAdvertisementRequestBody] = None

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


class PublishAdvertisementRequestBuilder(object):

    def __init__(self) -> None:
        publish_advertisement_request = PublishAdvertisementRequest()
        publish_advertisement_request.http_method = HttpMethod.POST
        publish_advertisement_request.uri = "/open-apis/hire/v1/advertisements/:advertisement_id/publish"
        publish_advertisement_request.token_types = {AccessTokenType.TENANT}
        self._publish_advertisement_request: PublishAdvertisementRequest = publish_advertisement_request

    def advertisement_id(self, advertisement_id: str) -> "PublishAdvertisementRequestBuilder":
        self._publish_advertisement_request.advertisement_id = advertisement_id
        self._publish_advertisement_request.paths["advertisement_id"] = str(advertisement_id)
        return self

    def request_body(self, request_body: PublishAdvertisementRequestBody) -> "PublishAdvertisementRequestBuilder":
        self._publish_advertisement_request.request_body = request_body
        self._publish_advertisement_request.body = request_body
        return self

    def build(self) -> PublishAdvertisementRequest:
        return self._publish_advertisement_request
