# Code generated by Lark OpenAPI.

import io
from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.const import UTF_8, CONTENT_TYPE, APPLICATION_JSON
from lark_oapi.core import JSON
from lark_oapi.core.token import verify
from lark_oapi.core.http import Transport
from lark_oapi.core.model import Config, RequestOption, RawResponse
from lark_oapi.core.utils import Files
from requests_toolbelt import MultipartEncoder
from ..model.add_to_folder_talent_request import AddToFolderTalentRequest
from ..model.add_to_folder_talent_response import AddToFolderTalentResponse
from ..model.batch_get_id_talent_request import BatchGetIdTalentRequest
from ..model.batch_get_id_talent_response import BatchGetIdTalentResponse
from ..model.combined_create_talent_request import CombinedCreateTalentRequest
from ..model.combined_create_talent_response import CombinedCreateTalentResponse
from ..model.combined_update_talent_request import CombinedUpdateTalentRequest
from ..model.combined_update_talent_response import CombinedUpdateTalentResponse
from ..model.get_talent_request import GetTalentRequest
from ..model.get_talent_response import GetTalentResponse
from ..model.list_talent_request import ListTalentRequest
from ..model.list_talent_response import ListTalentResponse
from ..model.onboard_status_talent_request import OnboardStatusTalentRequest
from ..model.onboard_status_talent_response import OnboardStatusTalentResponse
from ..model.remove_to_folder_talent_request import RemoveToFolderTalentRequest
from ..model.remove_to_folder_talent_response import RemoveToFolderTalentResponse
from ..model.tag_talent_request import TagTalentRequest
from ..model.tag_talent_response import TagTalentResponse


class Talent(object):
    def __init__(self, config: Config) -> None:
        self.config: Config = config

    def add_to_folder(self, request: AddToFolderTalentRequest,
                      option: Optional[RequestOption] = None) -> AddToFolderTalentResponse:
        if option is None:
            option = RequestOption()

        # 鉴权、获取 token
        verify(self.config, request, option)

        # 添加 content-type
        if request.body is not None:
            option.headers[CONTENT_TYPE] = f"{APPLICATION_JSON}; charset=utf-8"

        # 发起请求
        resp: RawResponse = Transport.execute(self.config, request, option)

        # 反序列化
        response: AddToFolderTalentResponse = JSON.unmarshal(str(resp.content, UTF_8), AddToFolderTalentResponse)
        response.raw = resp

        return response

    async def aadd_to_folder(self, request: AddToFolderTalentRequest,
                             option: Optional[RequestOption] = None) -> AddToFolderTalentResponse:
        if option is None:
            option = RequestOption()

        # 鉴权、获取 token
        verify(self.config, request, option)

        # 发起请求
        resp: RawResponse = await Transport.aexecute(self.config, request, option)

        # 反序列化
        response: AddToFolderTalentResponse = JSON.unmarshal(str(resp.content, UTF_8), AddToFolderTalentResponse)
        response.raw = resp

        return response

    def batch_get_id(self, request: BatchGetIdTalentRequest,
                     option: Optional[RequestOption] = None) -> BatchGetIdTalentResponse:
        if option is None:
            option = RequestOption()

        # 鉴权、获取 token
        verify(self.config, request, option)

        # 添加 content-type
        if request.body is not None:
            option.headers[CONTENT_TYPE] = f"{APPLICATION_JSON}; charset=utf-8"

        # 发起请求
        resp: RawResponse = Transport.execute(self.config, request, option)

        # 反序列化
        response: BatchGetIdTalentResponse = JSON.unmarshal(str(resp.content, UTF_8), BatchGetIdTalentResponse)
        response.raw = resp

        return response

    async def abatch_get_id(self, request: BatchGetIdTalentRequest,
                            option: Optional[RequestOption] = None) -> BatchGetIdTalentResponse:
        if option is None:
            option = RequestOption()

        # 鉴权、获取 token
        verify(self.config, request, option)

        # 发起请求
        resp: RawResponse = await Transport.aexecute(self.config, request, option)

        # 反序列化
        response: BatchGetIdTalentResponse = JSON.unmarshal(str(resp.content, UTF_8), BatchGetIdTalentResponse)
        response.raw = resp

        return response

    def combined_create(self, request: CombinedCreateTalentRequest,
                        option: Optional[RequestOption] = None) -> CombinedCreateTalentResponse:
        if option is None:
            option = RequestOption()

        # 鉴权、获取 token
        verify(self.config, request, option)

        # 添加 content-type
        if request.body is not None:
            option.headers[CONTENT_TYPE] = f"{APPLICATION_JSON}; charset=utf-8"

        # 发起请求
        resp: RawResponse = Transport.execute(self.config, request, option)

        # 反序列化
        response: CombinedCreateTalentResponse = JSON.unmarshal(str(resp.content, UTF_8), CombinedCreateTalentResponse)
        response.raw = resp

        return response

    async def acombined_create(self, request: CombinedCreateTalentRequest,
                               option: Optional[RequestOption] = None) -> CombinedCreateTalentResponse:
        if option is None:
            option = RequestOption()

        # 鉴权、获取 token
        verify(self.config, request, option)

        # 发起请求
        resp: RawResponse = await Transport.aexecute(self.config, request, option)

        # 反序列化
        response: CombinedCreateTalentResponse = JSON.unmarshal(str(resp.content, UTF_8), CombinedCreateTalentResponse)
        response.raw = resp

        return response

    def combined_update(self, request: CombinedUpdateTalentRequest,
                        option: Optional[RequestOption] = None) -> CombinedUpdateTalentResponse:
        if option is None:
            option = RequestOption()

        # 鉴权、获取 token
        verify(self.config, request, option)

        # 添加 content-type
        if request.body is not None:
            option.headers[CONTENT_TYPE] = f"{APPLICATION_JSON}; charset=utf-8"

        # 发起请求
        resp: RawResponse = Transport.execute(self.config, request, option)

        # 反序列化
        response: CombinedUpdateTalentResponse = JSON.unmarshal(str(resp.content, UTF_8), CombinedUpdateTalentResponse)
        response.raw = resp

        return response

    async def acombined_update(self, request: CombinedUpdateTalentRequest,
                               option: Optional[RequestOption] = None) -> CombinedUpdateTalentResponse:
        if option is None:
            option = RequestOption()

        # 鉴权、获取 token
        verify(self.config, request, option)

        # 发起请求
        resp: RawResponse = await Transport.aexecute(self.config, request, option)

        # 反序列化
        response: CombinedUpdateTalentResponse = JSON.unmarshal(str(resp.content, UTF_8), CombinedUpdateTalentResponse)
        response.raw = resp

        return response

    def get(self, request: GetTalentRequest, option: Optional[RequestOption] = None) -> GetTalentResponse:
        if option is None:
            option = RequestOption()

        # 鉴权、获取 token
        verify(self.config, request, option)

        # 添加 content-type
        if request.body is not None:
            option.headers[CONTENT_TYPE] = f"{APPLICATION_JSON}; charset=utf-8"

        # 发起请求
        resp: RawResponse = Transport.execute(self.config, request, option)

        # 反序列化
        response: GetTalentResponse = JSON.unmarshal(str(resp.content, UTF_8), GetTalentResponse)
        response.raw = resp

        return response

    async def aget(self, request: GetTalentRequest, option: Optional[RequestOption] = None) -> GetTalentResponse:
        if option is None:
            option = RequestOption()

        # 鉴权、获取 token
        verify(self.config, request, option)

        # 发起请求
        resp: RawResponse = await Transport.aexecute(self.config, request, option)

        # 反序列化
        response: GetTalentResponse = JSON.unmarshal(str(resp.content, UTF_8), GetTalentResponse)
        response.raw = resp

        return response

    def list(self, request: ListTalentRequest, option: Optional[RequestOption] = None) -> ListTalentResponse:
        if option is None:
            option = RequestOption()

        # 鉴权、获取 token
        verify(self.config, request, option)

        # 添加 content-type
        if request.body is not None:
            option.headers[CONTENT_TYPE] = f"{APPLICATION_JSON}; charset=utf-8"

        # 发起请求
        resp: RawResponse = Transport.execute(self.config, request, option)

        # 反序列化
        response: ListTalentResponse = JSON.unmarshal(str(resp.content, UTF_8), ListTalentResponse)
        response.raw = resp

        return response

    async def alist(self, request: ListTalentRequest, option: Optional[RequestOption] = None) -> ListTalentResponse:
        if option is None:
            option = RequestOption()

        # 鉴权、获取 token
        verify(self.config, request, option)

        # 发起请求
        resp: RawResponse = await Transport.aexecute(self.config, request, option)

        # 反序列化
        response: ListTalentResponse = JSON.unmarshal(str(resp.content, UTF_8), ListTalentResponse)
        response.raw = resp

        return response

    def onboard_status(self, request: OnboardStatusTalentRequest,
                       option: Optional[RequestOption] = None) -> OnboardStatusTalentResponse:
        if option is None:
            option = RequestOption()

        # 鉴权、获取 token
        verify(self.config, request, option)

        # 添加 content-type
        if request.body is not None:
            option.headers[CONTENT_TYPE] = f"{APPLICATION_JSON}; charset=utf-8"

        # 发起请求
        resp: RawResponse = Transport.execute(self.config, request, option)

        # 反序列化
        response: OnboardStatusTalentResponse = JSON.unmarshal(str(resp.content, UTF_8), OnboardStatusTalentResponse)
        response.raw = resp

        return response

    async def aonboard_status(self, request: OnboardStatusTalentRequest,
                              option: Optional[RequestOption] = None) -> OnboardStatusTalentResponse:
        if option is None:
            option = RequestOption()

        # 鉴权、获取 token
        verify(self.config, request, option)

        # 发起请求
        resp: RawResponse = await Transport.aexecute(self.config, request, option)

        # 反序列化
        response: OnboardStatusTalentResponse = JSON.unmarshal(str(resp.content, UTF_8), OnboardStatusTalentResponse)
        response.raw = resp

        return response

    def remove_to_folder(self, request: RemoveToFolderTalentRequest,
                         option: Optional[RequestOption] = None) -> RemoveToFolderTalentResponse:
        if option is None:
            option = RequestOption()

        # 鉴权、获取 token
        verify(self.config, request, option)

        # 添加 content-type
        if request.body is not None:
            option.headers[CONTENT_TYPE] = f"{APPLICATION_JSON}; charset=utf-8"

        # 发起请求
        resp: RawResponse = Transport.execute(self.config, request, option)

        # 反序列化
        response: RemoveToFolderTalentResponse = JSON.unmarshal(str(resp.content, UTF_8), RemoveToFolderTalentResponse)
        response.raw = resp

        return response

    async def aremove_to_folder(self, request: RemoveToFolderTalentRequest,
                                option: Optional[RequestOption] = None) -> RemoveToFolderTalentResponse:
        if option is None:
            option = RequestOption()

        # 鉴权、获取 token
        verify(self.config, request, option)

        # 发起请求
        resp: RawResponse = await Transport.aexecute(self.config, request, option)

        # 反序列化
        response: RemoveToFolderTalentResponse = JSON.unmarshal(str(resp.content, UTF_8), RemoveToFolderTalentResponse)
        response.raw = resp

        return response

    def tag(self, request: TagTalentRequest, option: Optional[RequestOption] = None) -> TagTalentResponse:
        if option is None:
            option = RequestOption()

        # 鉴权、获取 token
        verify(self.config, request, option)

        # 添加 content-type
        if request.body is not None:
            option.headers[CONTENT_TYPE] = f"{APPLICATION_JSON}; charset=utf-8"

        # 发起请求
        resp: RawResponse = Transport.execute(self.config, request, option)

        # 反序列化
        response: TagTalentResponse = JSON.unmarshal(str(resp.content, UTF_8), TagTalentResponse)
        response.raw = resp

        return response

    async def atag(self, request: TagTalentRequest, option: Optional[RequestOption] = None) -> TagTalentResponse:
        if option is None:
            option = RequestOption()

        # 鉴权、获取 token
        verify(self.config, request, option)

        # 发起请求
        resp: RawResponse = await Transport.aexecute(self.config, request, option)

        # 反序列化
        response: TagTalentResponse = JSON.unmarshal(str(resp.content, UTF_8), TagTalentResponse)
        response.raw = resp

        return response
