# coding: utf-8

"""
    Teambition Open API

    Teambition Open API

    The version of the OpenAPI document: 1.0.0
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501


import warnings
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Any, Dict, List, Optional, Tuple, Union
from typing_extensions import Annotated

from pydantic import Field, StrictInt, StrictStr
from typing import Optional
from typing_extensions import Annotated
from teambition_oapi_sdk.model.get_audit_logs_response import GetAuditLogsResponse
from teambition_oapi_sdk.model.get_ding_corp_id_response import GetDingCorpIdResponse
from teambition_oapi_sdk.model.get_org_info_response import GetOrgInfoResponse
from teambition_oapi_sdk.model.get_tb_user_id_by_ding_user_id_response import GetTbUserIdByDingUserIdResponse
from teambition_oapi_sdk.model.list_license_allocations_response import ListLicenseAllocationsResponse

from teambition_oapi_sdk.api_client import ApiClient, RequestSerialized
from teambition_oapi_sdk.api_response import ApiResponse
from teambition_oapi_sdk.rest import RESTResponseType

class OrgApi:
    """NOTE: This class is auto generated by OpenAPI Generator
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    def __init__(self, api_client=None) -> None:
        if api_client is None:
            api_client = ApiClient.get_default()
        self.api_client = api_client

    @validate_call
    def get_audit_logs(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        language: Annotated[Optional[StrictStr], Field(description="语言")] = None,
        action_types: Annotated[Optional[StrictStr], Field(description="审计日志的行为类型集合，逗号分隔；默认为空，表示全部行为类型")] = None,
        actions: Annotated[Optional[StrictStr], Field(description="审计日志的行为集合，逗号分隔；默认为空，表示全部行为")] = None,
        user_ids: Annotated[Optional[StrictStr], Field(description="审计日志的用户ID集合，逗号分隔；默认为空，表示全部用户")] = None,
        start_time: Annotated[Optional[StrictStr], Field(description="筛选日志的开始时间，默认为过去1年")] = None,
        end_time: Annotated[Optional[StrictStr], Field(description="筛选日志的结束时间，默认为当前时间")] = None,
        page_token: Annotated[Optional[StrictStr], Field(description="分页标")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="分页大小, 默认为100, 最大10000")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> GetAuditLogsResponse:
        """获取企业审计日志

        获取企业审计日志

        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param language: 语言
        :type language: str
        :param action_types: 审计日志的行为类型集合，逗号分隔；默认为空，表示全部行为类型
        :type action_types: str
        :param actions: 审计日志的行为集合，逗号分隔；默认为空，表示全部行为
        :type actions: str
        :param user_ids: 审计日志的用户ID集合，逗号分隔；默认为空，表示全部用户
        :type user_ids: str
        :param start_time: 筛选日志的开始时间，默认为过去1年
        :type start_time: str
        :param end_time: 筛选日志的结束时间，默认为当前时间
        :type end_time: str
        :param page_token: 分页标
        :type page_token: str
        :param limit: 分页大小, 默认为100, 最大10000
        :type limit: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_audit_logs_serialize(
            x_tenant_id=x_tenant_id,
            language=language,
            action_types=action_types,
            actions=actions,
            user_ids=user_ids,
            start_time=start_time,
            end_time=end_time,
            page_token=page_token,
            limit=limit,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GetAuditLogsResponse",
        }

        method, url, header_params, body, post_params = _param
        response_data = self.api_client.call_api(
            method=method,
            url=url,
            header_params=header_params,
            body=body,
            post_params=post_params,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data

    @validate_call
    def get_audit_logs_with_http_info(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        language: Annotated[Optional[StrictStr], Field(description="语言")] = None,
        action_types: Annotated[Optional[StrictStr], Field(description="审计日志的行为类型集合，逗号分隔；默认为空，表示全部行为类型")] = None,
        actions: Annotated[Optional[StrictStr], Field(description="审计日志的行为集合，逗号分隔；默认为空，表示全部行为")] = None,
        user_ids: Annotated[Optional[StrictStr], Field(description="审计日志的用户ID集合，逗号分隔；默认为空，表示全部用户")] = None,
        start_time: Annotated[Optional[StrictStr], Field(description="筛选日志的开始时间，默认为过去1年")] = None,
        end_time: Annotated[Optional[StrictStr], Field(description="筛选日志的结束时间，默认为当前时间")] = None,
        page_token: Annotated[Optional[StrictStr], Field(description="分页标")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="分页大小, 默认为100, 最大10000")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[GetAuditLogsResponse]:
        """获取企业审计日志

        获取企业审计日志

        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param language: 语言
        :type language: str
        :param action_types: 审计日志的行为类型集合，逗号分隔；默认为空，表示全部行为类型
        :type action_types: str
        :param actions: 审计日志的行为集合，逗号分隔；默认为空，表示全部行为
        :type actions: str
        :param user_ids: 审计日志的用户ID集合，逗号分隔；默认为空，表示全部用户
        :type user_ids: str
        :param start_time: 筛选日志的开始时间，默认为过去1年
        :type start_time: str
        :param end_time: 筛选日志的结束时间，默认为当前时间
        :type end_time: str
        :param page_token: 分页标
        :type page_token: str
        :param limit: 分页大小, 默认为100, 最大10000
        :type limit: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_audit_logs_serialize(
            x_tenant_id=x_tenant_id,
            language=language,
            action_types=action_types,
            actions=actions,
            user_ids=user_ids,
            start_time=start_time,
            end_time=end_time,
            page_token=page_token,
            limit=limit,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GetAuditLogsResponse",
        }

        method, url, header_params, body, post_params = _param
        response_data = self.api_client.call_api(
            method=method,
            url=url,
            header_params=header_params,
            body=body,
            post_params=post_params,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    @validate_call
    def get_audit_logs_without_preload_content(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        language: Annotated[Optional[StrictStr], Field(description="语言")] = None,
        action_types: Annotated[Optional[StrictStr], Field(description="审计日志的行为类型集合，逗号分隔；默认为空，表示全部行为类型")] = None,
        actions: Annotated[Optional[StrictStr], Field(description="审计日志的行为集合，逗号分隔；默认为空，表示全部行为")] = None,
        user_ids: Annotated[Optional[StrictStr], Field(description="审计日志的用户ID集合，逗号分隔；默认为空，表示全部用户")] = None,
        start_time: Annotated[Optional[StrictStr], Field(description="筛选日志的开始时间，默认为过去1年")] = None,
        end_time: Annotated[Optional[StrictStr], Field(description="筛选日志的结束时间，默认为当前时间")] = None,
        page_token: Annotated[Optional[StrictStr], Field(description="分页标")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="分页大小, 默认为100, 最大10000")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """获取企业审计日志

        获取企业审计日志

        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param language: 语言
        :type language: str
        :param action_types: 审计日志的行为类型集合，逗号分隔；默认为空，表示全部行为类型
        :type action_types: str
        :param actions: 审计日志的行为集合，逗号分隔；默认为空，表示全部行为
        :type actions: str
        :param user_ids: 审计日志的用户ID集合，逗号分隔；默认为空，表示全部用户
        :type user_ids: str
        :param start_time: 筛选日志的开始时间，默认为过去1年
        :type start_time: str
        :param end_time: 筛选日志的结束时间，默认为当前时间
        :type end_time: str
        :param page_token: 分页标
        :type page_token: str
        :param limit: 分页大小, 默认为100, 最大10000
        :type limit: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_audit_logs_serialize(
            x_tenant_id=x_tenant_id,
            language=language,
            action_types=action_types,
            actions=actions,
            user_ids=user_ids,
            start_time=start_time,
            end_time=end_time,
            page_token=page_token,
            limit=limit,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GetAuditLogsResponse",
        }

        method, url, header_params, body, post_params = _param
        response_data = self.api_client.call_api(
            method=method,
            url=url,
            header_params=header_params,
            body=body,
            post_params=post_params,
            _request_timeout=_request_timeout
        )
        return response_data.response

    def _get_audit_logs_serialize(
        self,
        x_tenant_id,
        language,
        action_types,
        actions,
        user_ids,
        start_time,
        end_time,
        page_token,
        limit,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = 'https://open.teambition.com/api'  

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if language is not None:
            
            _query_params.append(('language', language))
            
        if action_types is not None:
            
            _query_params.append(('actionTypes', action_types))
            
        if actions is not None:
            
            _query_params.append(('actions', actions))
            
        if user_ids is not None:
            
            _query_params.append(('userIds', user_ids))
            
        if start_time is not None:
            
            _query_params.append(('startTime', start_time))
            
        if end_time is not None:
            
            _query_params.append(('endTime', end_time))
            
        if page_token is not None:
            
            _query_params.append(('pageToken', page_token))
            
        if limit is not None:
            
            _query_params.append(('limit', limit))
            
        # process the header parameters
        if x_tenant_id is not None:
            _header_params['X-Tenant-Id'] = x_tenant_id
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'appToken'
        ]

        # Build the full URL
        url = _host + "/audit-log/list"

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/audit-log/list',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )


    @validate_call
    def get_ding_corp_id(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> GetDingCorpIdResponse:
        """查询企业绑定的钉钉 CorpId

        该接口用于查询企业绑定的钉钉 CorpId

        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_ding_corp_id_serialize(
            x_tenant_id=x_tenant_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GetDingCorpIdResponse",
        }

        method, url, header_params, body, post_params = _param
        response_data = self.api_client.call_api(
            method=method,
            url=url,
            header_params=header_params,
            body=body,
            post_params=post_params,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data

    @validate_call
    def get_ding_corp_id_with_http_info(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[GetDingCorpIdResponse]:
        """查询企业绑定的钉钉 CorpId

        该接口用于查询企业绑定的钉钉 CorpId

        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_ding_corp_id_serialize(
            x_tenant_id=x_tenant_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GetDingCorpIdResponse",
        }

        method, url, header_params, body, post_params = _param
        response_data = self.api_client.call_api(
            method=method,
            url=url,
            header_params=header_params,
            body=body,
            post_params=post_params,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    @validate_call
    def get_ding_corp_id_without_preload_content(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """查询企业绑定的钉钉 CorpId

        该接口用于查询企业绑定的钉钉 CorpId

        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_ding_corp_id_serialize(
            x_tenant_id=x_tenant_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GetDingCorpIdResponse",
        }

        method, url, header_params, body, post_params = _param
        response_data = self.api_client.call_api(
            method=method,
            url=url,
            header_params=header_params,
            body=body,
            post_params=post_params,
            _request_timeout=_request_timeout
        )
        return response_data.response

    def _get_ding_corp_id_serialize(
        self,
        x_tenant_id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = 'https://open.teambition.com/api'  

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        # process the header parameters
        if x_tenant_id is not None:
            _header_params['X-Tenant-Id'] = x_tenant_id
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'appToken'
        ]

        # Build the full URL
        url = _host + "/idmap/dingtalk/getCorpId"

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/idmap/dingtalk/getCorpId',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )


    @validate_call
    def get_ding_user_id_by_tb_user_id(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        tb_user_ids: Annotated[Optional[StrictStr], Field(description="Teambition 用户 ID,多个用逗号分隔, 例如 6167f4ac4b820f143f852123,6167f4ac4b820f143f852456")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> GetTbUserIdByDingUserIdResponse:
        """Teambition userId 查询钉钉 userId

        该接口用于 Teambition userId 查询钉钉 userId, 如果需要通过钉钉 userId 查询 Teambition userId,查看[钉钉 userId 查询 Teambition userId](api.operationId=GetTbUserIdByDingUserId)

        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param tb_user_ids: Teambition 用户 ID,多个用逗号分隔, 例如 6167f4ac4b820f143f852123,6167f4ac4b820f143f852456
        :type tb_user_ids: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_ding_user_id_by_tb_user_id_serialize(
            x_tenant_id=x_tenant_id,
            tb_user_ids=tb_user_ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GetTbUserIdByDingUserIdResponse",
        }

        method, url, header_params, body, post_params = _param
        response_data = self.api_client.call_api(
            method=method,
            url=url,
            header_params=header_params,
            body=body,
            post_params=post_params,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data

    @validate_call
    def get_ding_user_id_by_tb_user_id_with_http_info(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        tb_user_ids: Annotated[Optional[StrictStr], Field(description="Teambition 用户 ID,多个用逗号分隔, 例如 6167f4ac4b820f143f852123,6167f4ac4b820f143f852456")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[GetTbUserIdByDingUserIdResponse]:
        """Teambition userId 查询钉钉 userId

        该接口用于 Teambition userId 查询钉钉 userId, 如果需要通过钉钉 userId 查询 Teambition userId,查看[钉钉 userId 查询 Teambition userId](api.operationId=GetTbUserIdByDingUserId)

        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param tb_user_ids: Teambition 用户 ID,多个用逗号分隔, 例如 6167f4ac4b820f143f852123,6167f4ac4b820f143f852456
        :type tb_user_ids: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_ding_user_id_by_tb_user_id_serialize(
            x_tenant_id=x_tenant_id,
            tb_user_ids=tb_user_ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GetTbUserIdByDingUserIdResponse",
        }

        method, url, header_params, body, post_params = _param
        response_data = self.api_client.call_api(
            method=method,
            url=url,
            header_params=header_params,
            body=body,
            post_params=post_params,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    @validate_call
    def get_ding_user_id_by_tb_user_id_without_preload_content(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        tb_user_ids: Annotated[Optional[StrictStr], Field(description="Teambition 用户 ID,多个用逗号分隔, 例如 6167f4ac4b820f143f852123,6167f4ac4b820f143f852456")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Teambition userId 查询钉钉 userId

        该接口用于 Teambition userId 查询钉钉 userId, 如果需要通过钉钉 userId 查询 Teambition userId,查看[钉钉 userId 查询 Teambition userId](api.operationId=GetTbUserIdByDingUserId)

        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param tb_user_ids: Teambition 用户 ID,多个用逗号分隔, 例如 6167f4ac4b820f143f852123,6167f4ac4b820f143f852456
        :type tb_user_ids: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_ding_user_id_by_tb_user_id_serialize(
            x_tenant_id=x_tenant_id,
            tb_user_ids=tb_user_ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GetTbUserIdByDingUserIdResponse",
        }

        method, url, header_params, body, post_params = _param
        response_data = self.api_client.call_api(
            method=method,
            url=url,
            header_params=header_params,
            body=body,
            post_params=post_params,
            _request_timeout=_request_timeout
        )
        return response_data.response

    def _get_ding_user_id_by_tb_user_id_serialize(
        self,
        x_tenant_id,
        tb_user_ids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = 'https://open.teambition.com/api'  

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if tb_user_ids is not None:
            
            _query_params.append(('tbUserIds', tb_user_ids))
            
        # process the header parameters
        if x_tenant_id is not None:
            _header_params['X-Tenant-Id'] = x_tenant_id
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'appToken'
        ]

        # Build the full URL
        url = _host + "/idmap/dingtalk/getDingUserId"

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/idmap/dingtalk/getDingUserId',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )


    @validate_call
    def get_org_info(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> GetOrgInfoResponse:
        """获取企业信息

        该接口用于获取企业的信息

        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_org_info_serialize(
            x_tenant_id=x_tenant_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GetOrgInfoResponse",
        }

        method, url, header_params, body, post_params = _param
        response_data = self.api_client.call_api(
            method=method,
            url=url,
            header_params=header_params,
            body=body,
            post_params=post_params,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data

    @validate_call
    def get_org_info_with_http_info(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[GetOrgInfoResponse]:
        """获取企业信息

        该接口用于获取企业的信息

        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_org_info_serialize(
            x_tenant_id=x_tenant_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GetOrgInfoResponse",
        }

        method, url, header_params, body, post_params = _param
        response_data = self.api_client.call_api(
            method=method,
            url=url,
            header_params=header_params,
            body=body,
            post_params=post_params,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    @validate_call
    def get_org_info_without_preload_content(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """获取企业信息

        该接口用于获取企业的信息

        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_org_info_serialize(
            x_tenant_id=x_tenant_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GetOrgInfoResponse",
        }

        method, url, header_params, body, post_params = _param
        response_data = self.api_client.call_api(
            method=method,
            url=url,
            header_params=header_params,
            body=body,
            post_params=post_params,
            _request_timeout=_request_timeout
        )
        return response_data.response

    def _get_org_info_serialize(
        self,
        x_tenant_id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = 'https://open.teambition.com/api'  

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        # process the header parameters
        if x_tenant_id is not None:
            _header_params['X-Tenant-Id'] = x_tenant_id
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'appToken'
        ]

        # Build the full URL
        url = _host + "/org/info"

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/org/info',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )


    @validate_call
    def get_tb_user_id_by_ding_user_id(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        ding_user_ids: Annotated[Optional[StrictStr], Field(description="钉钉用户 ID,多个用逗号分隔, 批量最多不超过 50 个, 例如 manager4221,manager4222")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> GetTbUserIdByDingUserIdResponse:
        """钉钉 userId 查询 Teambition userId

        该接口用于钉钉 userId 查询 Teambition userId, 如果需要通过 Teambition userId 查询钉钉 userId,查看[Teambition userId 查询钉钉 userId](api.operationId=GetDingUserIdByTbUserId)

        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param ding_user_ids: 钉钉用户 ID,多个用逗号分隔, 批量最多不超过 50 个, 例如 manager4221,manager4222
        :type ding_user_ids: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_tb_user_id_by_ding_user_id_serialize(
            x_tenant_id=x_tenant_id,
            ding_user_ids=ding_user_ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GetTbUserIdByDingUserIdResponse",
        }

        method, url, header_params, body, post_params = _param
        response_data = self.api_client.call_api(
            method=method,
            url=url,
            header_params=header_params,
            body=body,
            post_params=post_params,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data

    @validate_call
    def get_tb_user_id_by_ding_user_id_with_http_info(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        ding_user_ids: Annotated[Optional[StrictStr], Field(description="钉钉用户 ID,多个用逗号分隔, 批量最多不超过 50 个, 例如 manager4221,manager4222")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[GetTbUserIdByDingUserIdResponse]:
        """钉钉 userId 查询 Teambition userId

        该接口用于钉钉 userId 查询 Teambition userId, 如果需要通过 Teambition userId 查询钉钉 userId,查看[Teambition userId 查询钉钉 userId](api.operationId=GetDingUserIdByTbUserId)

        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param ding_user_ids: 钉钉用户 ID,多个用逗号分隔, 批量最多不超过 50 个, 例如 manager4221,manager4222
        :type ding_user_ids: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_tb_user_id_by_ding_user_id_serialize(
            x_tenant_id=x_tenant_id,
            ding_user_ids=ding_user_ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GetTbUserIdByDingUserIdResponse",
        }

        method, url, header_params, body, post_params = _param
        response_data = self.api_client.call_api(
            method=method,
            url=url,
            header_params=header_params,
            body=body,
            post_params=post_params,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    @validate_call
    def get_tb_user_id_by_ding_user_id_without_preload_content(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        ding_user_ids: Annotated[Optional[StrictStr], Field(description="钉钉用户 ID,多个用逗号分隔, 批量最多不超过 50 个, 例如 manager4221,manager4222")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """钉钉 userId 查询 Teambition userId

        该接口用于钉钉 userId 查询 Teambition userId, 如果需要通过 Teambition userId 查询钉钉 userId,查看[Teambition userId 查询钉钉 userId](api.operationId=GetDingUserIdByTbUserId)

        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param ding_user_ids: 钉钉用户 ID,多个用逗号分隔, 批量最多不超过 50 个, 例如 manager4221,manager4222
        :type ding_user_ids: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_tb_user_id_by_ding_user_id_serialize(
            x_tenant_id=x_tenant_id,
            ding_user_ids=ding_user_ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GetTbUserIdByDingUserIdResponse",
        }

        method, url, header_params, body, post_params = _param
        response_data = self.api_client.call_api(
            method=method,
            url=url,
            header_params=header_params,
            body=body,
            post_params=post_params,
            _request_timeout=_request_timeout
        )
        return response_data.response

    def _get_tb_user_id_by_ding_user_id_serialize(
        self,
        x_tenant_id,
        ding_user_ids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = 'https://open.teambition.com/api'  

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if ding_user_ids is not None:
            
            _query_params.append(('dingUserIds', ding_user_ids))
            
        # process the header parameters
        if x_tenant_id is not None:
            _header_params['X-Tenant-Id'] = x_tenant_id
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'appToken'
        ]

        # Build the full URL
        url = _host + "/idmap/dingtalk/getTbUserId"

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/idmap/dingtalk/getTbUserId',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )


    @validate_call
    def list_license_allocations(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        org_id: Annotated[Optional[StrictStr], Field(description="企业ID")] = None,
        page_size: Annotated[Optional[StrictStr], Field(description="分页大小, 示例值：10")] = None,
        page_token: Annotated[Optional[StrictStr], Field(description="分页标记，第一次请求不填或者空字符串，表示从头开始遍历；分页查询结果还有更多项时返回 nextPageToken，下次遍历可采用该 nextPageToken 入参 pageToken 获取查询结果，示例值：\"cfcb90voe9jct71bqkfg\"")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ListLicenseAllocationsResponse:
        """获取License名额分配列表

        获取License名额分配列表

        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param org_id: 企业ID
        :type org_id: str
        :param page_size: 分页大小, 示例值：10
        :type page_size: str
        :param page_token: 分页标记，第一次请求不填或者空字符串，表示从头开始遍历；分页查询结果还有更多项时返回 nextPageToken，下次遍历可采用该 nextPageToken 入参 pageToken 获取查询结果，示例值：\"cfcb90voe9jct71bqkfg\"
        :type page_token: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._list_license_allocations_serialize(
            x_tenant_id=x_tenant_id,
            org_id=org_id,
            page_size=page_size,
            page_token=page_token,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ListLicenseAllocationsResponse",
        }

        method, url, header_params, body, post_params = _param
        response_data = self.api_client.call_api(
            method=method,
            url=url,
            header_params=header_params,
            body=body,
            post_params=post_params,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data

    @validate_call
    def list_license_allocations_with_http_info(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        org_id: Annotated[Optional[StrictStr], Field(description="企业ID")] = None,
        page_size: Annotated[Optional[StrictStr], Field(description="分页大小, 示例值：10")] = None,
        page_token: Annotated[Optional[StrictStr], Field(description="分页标记，第一次请求不填或者空字符串，表示从头开始遍历；分页查询结果还有更多项时返回 nextPageToken，下次遍历可采用该 nextPageToken 入参 pageToken 获取查询结果，示例值：\"cfcb90voe9jct71bqkfg\"")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ListLicenseAllocationsResponse]:
        """获取License名额分配列表

        获取License名额分配列表

        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param org_id: 企业ID
        :type org_id: str
        :param page_size: 分页大小, 示例值：10
        :type page_size: str
        :param page_token: 分页标记，第一次请求不填或者空字符串，表示从头开始遍历；分页查询结果还有更多项时返回 nextPageToken，下次遍历可采用该 nextPageToken 入参 pageToken 获取查询结果，示例值：\"cfcb90voe9jct71bqkfg\"
        :type page_token: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._list_license_allocations_serialize(
            x_tenant_id=x_tenant_id,
            org_id=org_id,
            page_size=page_size,
            page_token=page_token,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ListLicenseAllocationsResponse",
        }

        method, url, header_params, body, post_params = _param
        response_data = self.api_client.call_api(
            method=method,
            url=url,
            header_params=header_params,
            body=body,
            post_params=post_params,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    @validate_call
    def list_license_allocations_without_preload_content(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        org_id: Annotated[Optional[StrictStr], Field(description="企业ID")] = None,
        page_size: Annotated[Optional[StrictStr], Field(description="分页大小, 示例值：10")] = None,
        page_token: Annotated[Optional[StrictStr], Field(description="分页标记，第一次请求不填或者空字符串，表示从头开始遍历；分页查询结果还有更多项时返回 nextPageToken，下次遍历可采用该 nextPageToken 入参 pageToken 获取查询结果，示例值：\"cfcb90voe9jct71bqkfg\"")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """获取License名额分配列表

        获取License名额分配列表

        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param org_id: 企业ID
        :type org_id: str
        :param page_size: 分页大小, 示例值：10
        :type page_size: str
        :param page_token: 分页标记，第一次请求不填或者空字符串，表示从头开始遍历；分页查询结果还有更多项时返回 nextPageToken，下次遍历可采用该 nextPageToken 入参 pageToken 获取查询结果，示例值：\"cfcb90voe9jct71bqkfg\"
        :type page_token: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._list_license_allocations_serialize(
            x_tenant_id=x_tenant_id,
            org_id=org_id,
            page_size=page_size,
            page_token=page_token,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ListLicenseAllocationsResponse",
        }

        method, url, header_params, body, post_params = _param
        response_data = self.api_client.call_api(
            method=method,
            url=url,
            header_params=header_params,
            body=body,
            post_params=post_params,
            _request_timeout=_request_timeout
        )
        return response_data.response

    def _list_license_allocations_serialize(
        self,
        x_tenant_id,
        org_id,
        page_size,
        page_token,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = 'https://open.teambition.com/api'  

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if org_id is not None:
            
            _query_params.append(('orgId', org_id))
            
        if page_size is not None:
            
            _query_params.append(('pageSize', page_size))
            
        if page_token is not None:
            
            _query_params.append(('pageToken', page_token))
            
        # process the header parameters
        if x_tenant_id is not None:
            _header_params['X-Tenant-Id'] = x_tenant_id
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'appToken'
        ]

        # Build the full URL
        url = _host + "/seat/member/allocated"

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/seat/member/allocated',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )

