# 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, StrictStr
from typing import Optional
from typing_extensions import Annotated
from teambition_oapi_sdk.model.aggregate_user_plan_time_request import AggregateUserPlanTimeRequest
from teambition_oapi_sdk.model.aggregate_user_plan_time_response import AggregateUserPlanTimeResponse
from teambition_oapi_sdk.model.aggregate_user_work_time_response import AggregateUserWorkTimeResponse
from teambition_oapi_sdk.model.create_plan_time_request import CreatePlanTimeRequest
from teambition_oapi_sdk.model.create_plan_time_response import CreatePlanTimeResponse
from teambition_oapi_sdk.model.create_work_time_approval_request import CreateWorkTimeApprovalRequest
from teambition_oapi_sdk.model.create_work_time_approval_response import CreateWorkTimeApprovalResponse
from teambition_oapi_sdk.model.create_work_time_request import CreateWorkTimeRequest
from teambition_oapi_sdk.model.create_work_time_response import CreateWorkTimeResponse
from teambition_oapi_sdk.model.delete_plan_time_request import DeletePlanTimeRequest
from teambition_oapi_sdk.model.delete_plan_time_response import DeletePlanTimeResponse
from teambition_oapi_sdk.model.delete_work_time_response import DeleteWorkTimeResponse
from teambition_oapi_sdk.model.get_plan_time_detail_response import GetPlanTimeDetailResponse
from teambition_oapi_sdk.model.get_work_time_detail_response import GetWorkTimeDetailResponse
from teambition_oapi_sdk.model.list_plan_times_response import ListPlanTimesResponse
from teambition_oapi_sdk.model.list_task_plan_times_response import ListTaskPlanTimesResponse
from teambition_oapi_sdk.model.list_task_work_times_response import ListTaskWorkTimesResponse
from teambition_oapi_sdk.model.list_work_times_response import ListWorkTimesResponse
from teambition_oapi_sdk.model.sum_task_plan_time_response import SumTaskPlanTimeResponse
from teambition_oapi_sdk.model.sum_task_work_time_response import SumTaskWorkTimeResponse
from teambition_oapi_sdk.model.update_plan_time_request import UpdatePlanTimeRequest
from teambition_oapi_sdk.model.update_plan_time_response import UpdatePlanTimeResponse
from teambition_oapi_sdk.model.update_work_time_approval_request import UpdateWorkTimeApprovalRequest
from teambition_oapi_sdk.model.update_work_time_approval_response import UpdateWorkTimeApprovalResponse
from teambition_oapi_sdk.model.update_work_time_limit_request import UpdateWorkTimeLimitRequest
from teambition_oapi_sdk.model.update_work_time_limit_response import UpdateWorkTimeLimitResponse
from teambition_oapi_sdk.model.update_work_time_request import UpdateWorkTimeRequest
from teambition_oapi_sdk.model.update_work_time_response import UpdateWorkTimeResponse

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 WorktimeApi:
    """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 aggregate_user_plan_time(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        aggregate_user_plan_time_request: Optional[AggregateUserPlanTimeRequest] = 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,
    ) -> AggregateUserPlanTimeResponse:
        """获取一定时间内订阅的指定用户的计划工时聚合数

        该接口用于查询一定时间内指定用户的计划工时聚合数

        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param aggregate_user_plan_time_request: 
        :type aggregate_user_plan_time_request: AggregateUserPlanTimeRequest
        :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._aggregate_user_plan_time_serialize(
            x_tenant_id=x_tenant_id,
            aggregate_user_plan_time_request=aggregate_user_plan_time_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 aggregate_user_plan_time_with_http_info(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        aggregate_user_plan_time_request: Optional[AggregateUserPlanTimeRequest] = 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[AggregateUserPlanTimeResponse]:
        """获取一定时间内订阅的指定用户的计划工时聚合数

        该接口用于查询一定时间内指定用户的计划工时聚合数

        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param aggregate_user_plan_time_request: 
        :type aggregate_user_plan_time_request: AggregateUserPlanTimeRequest
        :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._aggregate_user_plan_time_serialize(
            x_tenant_id=x_tenant_id,
            aggregate_user_plan_time_request=aggregate_user_plan_time_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 aggregate_user_plan_time_without_preload_content(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        aggregate_user_plan_time_request: Optional[AggregateUserPlanTimeRequest] = 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 aggregate_user_plan_time_request: 
        :type aggregate_user_plan_time_request: AggregateUserPlanTimeRequest
        :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._aggregate_user_plan_time_serialize(
            x_tenant_id=x_tenant_id,
            aggregate_user_plan_time_request=aggregate_user_plan_time_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 _aggregate_user_plan_time_serialize(
        self,
        x_tenant_id,
        aggregate_user_plan_time_request,
        _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
        if aggregate_user_plan_time_request is not None:
            _body_params = aggregate_user_plan_time_request


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

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/json'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

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

        # Build the full URL
        url = _host + "/plantime/aggregation/datesUsers"

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/plantime/aggregation/datesUsers',
            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 aggregate_user_work_time(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        aggregate_user_plan_time_request: Optional[AggregateUserPlanTimeRequest] = 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,
    ) -> AggregateUserWorkTimeResponse:
        """获取一定时间内订阅的指定用户的实际工时聚合数据

        该接口用于查询一定时间内指定用户的实际工时聚合数

        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param aggregate_user_plan_time_request: 
        :type aggregate_user_plan_time_request: AggregateUserPlanTimeRequest
        :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._aggregate_user_work_time_serialize(
            x_tenant_id=x_tenant_id,
            aggregate_user_plan_time_request=aggregate_user_plan_time_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 aggregate_user_work_time_with_http_info(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        aggregate_user_plan_time_request: Optional[AggregateUserPlanTimeRequest] = 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[AggregateUserWorkTimeResponse]:
        """获取一定时间内订阅的指定用户的实际工时聚合数据

        该接口用于查询一定时间内指定用户的实际工时聚合数

        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param aggregate_user_plan_time_request: 
        :type aggregate_user_plan_time_request: AggregateUserPlanTimeRequest
        :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._aggregate_user_work_time_serialize(
            x_tenant_id=x_tenant_id,
            aggregate_user_plan_time_request=aggregate_user_plan_time_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 aggregate_user_work_time_without_preload_content(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        aggregate_user_plan_time_request: Optional[AggregateUserPlanTimeRequest] = 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 aggregate_user_plan_time_request: 
        :type aggregate_user_plan_time_request: AggregateUserPlanTimeRequest
        :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._aggregate_user_work_time_serialize(
            x_tenant_id=x_tenant_id,
            aggregate_user_plan_time_request=aggregate_user_plan_time_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 _aggregate_user_work_time_serialize(
        self,
        x_tenant_id,
        aggregate_user_plan_time_request,
        _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
        if aggregate_user_plan_time_request is not None:
            _body_params = aggregate_user_plan_time_request


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

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/json'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

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

        # Build the full URL
        url = _host + "/worktime/aggregation/datesUsers"

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/worktime/aggregation/datesUsers',
            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 create_plan_time(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        create_plan_time_request: Optional[CreatePlanTimeRequest] = 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,
    ) -> CreatePlanTimeResponse:
        """创建计划工时

        本接口可用于创建计划工时  注意： 项目归档或回收站 是不能填报工时的，接口会报 「项目已被归档，无法更新工时」或 「项目已在回收站，无法更新工时」错误。

        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param create_plan_time_request: 
        :type create_plan_time_request: CreatePlanTimeRequest
        :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._create_plan_time_serialize(
            x_tenant_id=x_tenant_id,
            create_plan_time_request=create_plan_time_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 create_plan_time_with_http_info(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        create_plan_time_request: Optional[CreatePlanTimeRequest] = 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[CreatePlanTimeResponse]:
        """创建计划工时

        本接口可用于创建计划工时  注意： 项目归档或回收站 是不能填报工时的，接口会报 「项目已被归档，无法更新工时」或 「项目已在回收站，无法更新工时」错误。

        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param create_plan_time_request: 
        :type create_plan_time_request: CreatePlanTimeRequest
        :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._create_plan_time_serialize(
            x_tenant_id=x_tenant_id,
            create_plan_time_request=create_plan_time_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 create_plan_time_without_preload_content(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        create_plan_time_request: Optional[CreatePlanTimeRequest] = 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 create_plan_time_request: 
        :type create_plan_time_request: CreatePlanTimeRequest
        :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._create_plan_time_serialize(
            x_tenant_id=x_tenant_id,
            create_plan_time_request=create_plan_time_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 _create_plan_time_serialize(
        self,
        x_tenant_id,
        create_plan_time_request,
        _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
        if create_plan_time_request is not None:
            _body_params = create_plan_time_request


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

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/json'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

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

        # Build the full URL
        url = _host + "/plantime/create"

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/plantime/create',
            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 create_work_time(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        create_work_time_request: Optional[CreateWorkTimeRequest] = 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,
    ) -> CreateWorkTimeResponse:
        """创建实际工时

        该接口用于创建实际工时  注意： 项目归档或回收站 是不能填报工时的，接口会报 「项目已被归档，无法更新工时」或 「项目已在回收站，无法更新工时」错误。

        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param create_work_time_request: 
        :type create_work_time_request: CreateWorkTimeRequest
        :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._create_work_time_serialize(
            x_tenant_id=x_tenant_id,
            create_work_time_request=create_work_time_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 create_work_time_with_http_info(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        create_work_time_request: Optional[CreateWorkTimeRequest] = 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[CreateWorkTimeResponse]:
        """创建实际工时

        该接口用于创建实际工时  注意： 项目归档或回收站 是不能填报工时的，接口会报 「项目已被归档，无法更新工时」或 「项目已在回收站，无法更新工时」错误。

        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param create_work_time_request: 
        :type create_work_time_request: CreateWorkTimeRequest
        :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._create_work_time_serialize(
            x_tenant_id=x_tenant_id,
            create_work_time_request=create_work_time_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 create_work_time_without_preload_content(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        create_work_time_request: Optional[CreateWorkTimeRequest] = 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 create_work_time_request: 
        :type create_work_time_request: CreateWorkTimeRequest
        :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._create_work_time_serialize(
            x_tenant_id=x_tenant_id,
            create_work_time_request=create_work_time_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 _create_work_time_serialize(
        self,
        x_tenant_id,
        create_work_time_request,
        _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
        if create_work_time_request is not None:
            _body_params = create_work_time_request


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

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/json'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

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

        # Build the full URL
        url = _host + "/worktime/create"

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/worktime/create',
            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 create_work_time_approval(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        x_operator_id: Annotated[Optional[StrictStr], Field(description="创建者 ID")] = None,
        create_work_time_approval_request: Optional[CreateWorkTimeApprovalRequest] = 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,
    ) -> CreateWorkTimeApprovalResponse:
        """创建实际工时审批对象

        

        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param x_operator_id: 创建者 ID
        :type x_operator_id: str
        :param create_work_time_approval_request: 
        :type create_work_time_approval_request: CreateWorkTimeApprovalRequest
        :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._create_work_time_approval_serialize(
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            create_work_time_approval_request=create_work_time_approval_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 create_work_time_approval_with_http_info(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        x_operator_id: Annotated[Optional[StrictStr], Field(description="创建者 ID")] = None,
        create_work_time_approval_request: Optional[CreateWorkTimeApprovalRequest] = 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[CreateWorkTimeApprovalResponse]:
        """创建实际工时审批对象

        

        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param x_operator_id: 创建者 ID
        :type x_operator_id: str
        :param create_work_time_approval_request: 
        :type create_work_time_approval_request: CreateWorkTimeApprovalRequest
        :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._create_work_time_approval_serialize(
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            create_work_time_approval_request=create_work_time_approval_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 create_work_time_approval_without_preload_content(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        x_operator_id: Annotated[Optional[StrictStr], Field(description="创建者 ID")] = None,
        create_work_time_approval_request: Optional[CreateWorkTimeApprovalRequest] = 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 x_operator_id: 创建者 ID
        :type x_operator_id: str
        :param create_work_time_approval_request: 
        :type create_work_time_approval_request: CreateWorkTimeApprovalRequest
        :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._create_work_time_approval_serialize(
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            create_work_time_approval_request=create_work_time_approval_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 _create_work_time_approval_serialize(
        self,
        x_tenant_id,
        x_operator_id,
        create_work_time_approval_request,
        _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
        if x_operator_id is not None:
            _header_params['X-Operator-Id'] = x_operator_id
        # process the form parameters
        # process the body parameter
        if create_work_time_approval_request is not None:
            _body_params = create_work_time_approval_request


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

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/json'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

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

        # Build the full URL
        url = _host + "/worktime/approve/submit"

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/worktime/approve/submit',
            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 delete_plan_time(
        self,
        plantime_id: StrictStr,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="租户 ID")] = None,
        x_operator_id: Annotated[Optional[StrictStr], Field(description="操作人id")] = None,
        delete_plan_time_request: Optional[DeletePlanTimeRequest] = 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,
    ) -> DeletePlanTimeResponse:
        """删除计划工时单条记录

        该接口用于删除指定的单条计划工时记录

        :param plantime_id:  (required)
        :type plantime_id: str
        :param x_tenant_id: 租户 ID
        :type x_tenant_id: str
        :param x_operator_id: 操作人id
        :type x_operator_id: str
        :param delete_plan_time_request: 
        :type delete_plan_time_request: DeletePlanTimeRequest
        :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._delete_plan_time_serialize(
            plantime_id=plantime_id,
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            delete_plan_time_request=delete_plan_time_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 delete_plan_time_with_http_info(
        self,
        plantime_id: StrictStr,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="租户 ID")] = None,
        x_operator_id: Annotated[Optional[StrictStr], Field(description="操作人id")] = None,
        delete_plan_time_request: Optional[DeletePlanTimeRequest] = 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[DeletePlanTimeResponse]:
        """删除计划工时单条记录

        该接口用于删除指定的单条计划工时记录

        :param plantime_id:  (required)
        :type plantime_id: str
        :param x_tenant_id: 租户 ID
        :type x_tenant_id: str
        :param x_operator_id: 操作人id
        :type x_operator_id: str
        :param delete_plan_time_request: 
        :type delete_plan_time_request: DeletePlanTimeRequest
        :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._delete_plan_time_serialize(
            plantime_id=plantime_id,
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            delete_plan_time_request=delete_plan_time_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 delete_plan_time_without_preload_content(
        self,
        plantime_id: StrictStr,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="租户 ID")] = None,
        x_operator_id: Annotated[Optional[StrictStr], Field(description="操作人id")] = None,
        delete_plan_time_request: Optional[DeletePlanTimeRequest] = 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 plantime_id:  (required)
        :type plantime_id: str
        :param x_tenant_id: 租户 ID
        :type x_tenant_id: str
        :param x_operator_id: 操作人id
        :type x_operator_id: str
        :param delete_plan_time_request: 
        :type delete_plan_time_request: DeletePlanTimeRequest
        :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._delete_plan_time_serialize(
            plantime_id=plantime_id,
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            delete_plan_time_request=delete_plan_time_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 _delete_plan_time_serialize(
        self,
        plantime_id,
        x_tenant_id,
        x_operator_id,
        delete_plan_time_request,
        _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
        if plantime_id is not None:
            _path_params['plantimeId'] = plantime_id
        # process the query parameters
        # process the header parameters
        if x_tenant_id is not None:
            _header_params['X-Tenant-Id'] = x_tenant_id
        if x_operator_id is not None:
            _header_params['X-Operator-Id'] = x_operator_id
        # process the form parameters
        # process the body parameter
        if delete_plan_time_request is not None:
            _body_params = delete_plan_time_request


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

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/json'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

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

        # Build the full URL
        url = _host + "/plantime/{plantimeId}"
        url = url.replace('{' + 'plantimeId' + '}', str(plantime_id))

        return self.api_client.param_serialize(
            method='DELETE',
            resource_path='/plantime/{plantimeId}',
            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 delete_work_time(
        self,
        worktime_id: StrictStr,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="租户 ID")] = None,
        x_operator_id: Annotated[Optional[StrictStr], Field(description="操作人id")] = None,
        delete_plan_time_request: Optional[DeletePlanTimeRequest] = 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,
    ) -> DeleteWorkTimeResponse:
        """删除实际工时单条记录

        该接口用于删除指定的单条实际工时记录

        :param worktime_id:  (required)
        :type worktime_id: str
        :param x_tenant_id: 租户 ID
        :type x_tenant_id: str
        :param x_operator_id: 操作人id
        :type x_operator_id: str
        :param delete_plan_time_request: 
        :type delete_plan_time_request: DeletePlanTimeRequest
        :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._delete_work_time_serialize(
            worktime_id=worktime_id,
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            delete_plan_time_request=delete_plan_time_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 delete_work_time_with_http_info(
        self,
        worktime_id: StrictStr,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="租户 ID")] = None,
        x_operator_id: Annotated[Optional[StrictStr], Field(description="操作人id")] = None,
        delete_plan_time_request: Optional[DeletePlanTimeRequest] = 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[DeleteWorkTimeResponse]:
        """删除实际工时单条记录

        该接口用于删除指定的单条实际工时记录

        :param worktime_id:  (required)
        :type worktime_id: str
        :param x_tenant_id: 租户 ID
        :type x_tenant_id: str
        :param x_operator_id: 操作人id
        :type x_operator_id: str
        :param delete_plan_time_request: 
        :type delete_plan_time_request: DeletePlanTimeRequest
        :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._delete_work_time_serialize(
            worktime_id=worktime_id,
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            delete_plan_time_request=delete_plan_time_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 delete_work_time_without_preload_content(
        self,
        worktime_id: StrictStr,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="租户 ID")] = None,
        x_operator_id: Annotated[Optional[StrictStr], Field(description="操作人id")] = None,
        delete_plan_time_request: Optional[DeletePlanTimeRequest] = 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 worktime_id:  (required)
        :type worktime_id: str
        :param x_tenant_id: 租户 ID
        :type x_tenant_id: str
        :param x_operator_id: 操作人id
        :type x_operator_id: str
        :param delete_plan_time_request: 
        :type delete_plan_time_request: DeletePlanTimeRequest
        :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._delete_work_time_serialize(
            worktime_id=worktime_id,
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            delete_plan_time_request=delete_plan_time_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 _delete_work_time_serialize(
        self,
        worktime_id,
        x_tenant_id,
        x_operator_id,
        delete_plan_time_request,
        _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
        if worktime_id is not None:
            _path_params['worktimeId'] = worktime_id
        # process the query parameters
        # process the header parameters
        if x_tenant_id is not None:
            _header_params['X-Tenant-Id'] = x_tenant_id
        if x_operator_id is not None:
            _header_params['X-Operator-Id'] = x_operator_id
        # process the form parameters
        # process the body parameter
        if delete_plan_time_request is not None:
            _body_params = delete_plan_time_request


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

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/json'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

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

        # Build the full URL
        url = _host + "/worktime/{worktimeId}"
        url = url.replace('{' + 'worktimeId' + '}', str(worktime_id))

        return self.api_client.param_serialize(
            method='DELETE',
            resource_path='/worktime/{worktimeId}',
            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_plan_time_detail(
        self,
        plantime_id: Annotated[StrictStr, Field(description="计划工时 ID")],
        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,
    ) -> GetPlanTimeDetailResponse:
        """获取单个计划工时详情

        该接口用于根据计划工时 ID 查询计划工时详情

        :param plantime_id: 计划工时 ID (required)
        :type plantime_id: str
        :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_plan_time_detail_serialize(
            plantime_id=plantime_id,
            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': "GetPlanTimeDetailResponse",
        }

        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_plan_time_detail_with_http_info(
        self,
        plantime_id: Annotated[StrictStr, Field(description="计划工时 ID")],
        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[GetPlanTimeDetailResponse]:
        """获取单个计划工时详情

        该接口用于根据计划工时 ID 查询计划工时详情

        :param plantime_id: 计划工时 ID (required)
        :type plantime_id: str
        :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_plan_time_detail_serialize(
            plantime_id=plantime_id,
            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': "GetPlanTimeDetailResponse",
        }

        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_plan_time_detail_without_preload_content(
        self,
        plantime_id: Annotated[StrictStr, Field(description="计划工时 ID")],
        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:
        """获取单个计划工时详情

        该接口用于根据计划工时 ID 查询计划工时详情

        :param plantime_id: 计划工时 ID (required)
        :type plantime_id: str
        :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_plan_time_detail_serialize(
            plantime_id=plantime_id,
            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': "GetPlanTimeDetailResponse",
        }

        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_plan_time_detail_serialize(
        self,
        plantime_id,
        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
        if plantime_id is not None:
            _path_params['plantimeId'] = plantime_id
        # 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 + "/plantime/{plantimeId}"
        url = url.replace('{' + 'plantimeId' + '}', str(plantime_id))

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/plantime/{plantimeId}',
            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_work_time_detail(
        self,
        worktime_id: Annotated[StrictStr, Field(description="实际工时 ID")],
        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,
    ) -> GetWorkTimeDetailResponse:
        """获取单个实际工时详情

        该接口用于根据实际工时 ID 查询实际工时详情

        :param worktime_id: 实际工时 ID (required)
        :type worktime_id: str
        :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_work_time_detail_serialize(
            worktime_id=worktime_id,
            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': "GetWorkTimeDetailResponse",
        }

        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_work_time_detail_with_http_info(
        self,
        worktime_id: Annotated[StrictStr, Field(description="实际工时 ID")],
        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[GetWorkTimeDetailResponse]:
        """获取单个实际工时详情

        该接口用于根据实际工时 ID 查询实际工时详情

        :param worktime_id: 实际工时 ID (required)
        :type worktime_id: str
        :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_work_time_detail_serialize(
            worktime_id=worktime_id,
            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': "GetWorkTimeDetailResponse",
        }

        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_work_time_detail_without_preload_content(
        self,
        worktime_id: Annotated[StrictStr, Field(description="实际工时 ID")],
        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:
        """获取单个实际工时详情

        该接口用于根据实际工时 ID 查询实际工时详情

        :param worktime_id: 实际工时 ID (required)
        :type worktime_id: str
        :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_work_time_detail_serialize(
            worktime_id=worktime_id,
            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': "GetWorkTimeDetailResponse",
        }

        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_work_time_detail_serialize(
        self,
        worktime_id,
        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
        if worktime_id is not None:
            _path_params['worktimeId'] = worktime_id
        # 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 + "/worktime/{worktimeId}"
        url = url.replace('{' + 'worktimeId' + '}', str(worktime_id))

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/worktime/{worktimeId}',
            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_plan_times(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        user_id: Annotated[Optional[StrictStr], Field(description="用户idID集合,使用逗号分隔，最大数据100")] = None,
        page_token: Annotated[Optional[StrictStr], Field(description="分页标记，第一次请求不填或者空字符串，表示从头开始遍历；分页查询结果还有更多项时返回 nextPageToken，下次遍历可采用该 nextPageToken 入参 pageToken 获取查询结果，示例值：\"cfcb90voe9jct71bqkfg\"")] = None,
        page_size: Annotated[Optional[StrictStr], Field(description="分页大小, 示例值：10")] = None,
        start_date: Annotated[Optional[StrictStr], Field(description="查询起始时间，格式 “2022-08-01”")] = None,
        end_date: Annotated[Optional[StrictStr], Field(description="查询结束时间，格式 “2022-08-01”，与起始时间间隔90天内")] = 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,
    ) -> ListPlanTimesResponse:
        """获取用户所有计划工时详情数据

        获取用户所有计划工时详情数据

        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param user_id: 用户idID集合,使用逗号分隔，最大数据100
        :type user_id: str
        :param page_token: 分页标记，第一次请求不填或者空字符串，表示从头开始遍历；分页查询结果还有更多项时返回 nextPageToken，下次遍历可采用该 nextPageToken 入参 pageToken 获取查询结果，示例值：\"cfcb90voe9jct71bqkfg\"
        :type page_token: str
        :param page_size: 分页大小, 示例值：10
        :type page_size: str
        :param start_date: 查询起始时间，格式 “2022-08-01”
        :type start_date: str
        :param end_date: 查询结束时间，格式 “2022-08-01”，与起始时间间隔90天内
        :type end_date: 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_plan_times_serialize(
            x_tenant_id=x_tenant_id,
            user_id=user_id,
            page_token=page_token,
            page_size=page_size,
            start_date=start_date,
            end_date=end_date,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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_plan_times_with_http_info(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        user_id: Annotated[Optional[StrictStr], Field(description="用户idID集合,使用逗号分隔，最大数据100")] = None,
        page_token: Annotated[Optional[StrictStr], Field(description="分页标记，第一次请求不填或者空字符串，表示从头开始遍历；分页查询结果还有更多项时返回 nextPageToken，下次遍历可采用该 nextPageToken 入参 pageToken 获取查询结果，示例值：\"cfcb90voe9jct71bqkfg\"")] = None,
        page_size: Annotated[Optional[StrictStr], Field(description="分页大小, 示例值：10")] = None,
        start_date: Annotated[Optional[StrictStr], Field(description="查询起始时间，格式 “2022-08-01”")] = None,
        end_date: Annotated[Optional[StrictStr], Field(description="查询结束时间，格式 “2022-08-01”，与起始时间间隔90天内")] = 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[ListPlanTimesResponse]:
        """获取用户所有计划工时详情数据

        获取用户所有计划工时详情数据

        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param user_id: 用户idID集合,使用逗号分隔，最大数据100
        :type user_id: str
        :param page_token: 分页标记，第一次请求不填或者空字符串，表示从头开始遍历；分页查询结果还有更多项时返回 nextPageToken，下次遍历可采用该 nextPageToken 入参 pageToken 获取查询结果，示例值：\"cfcb90voe9jct71bqkfg\"
        :type page_token: str
        :param page_size: 分页大小, 示例值：10
        :type page_size: str
        :param start_date: 查询起始时间，格式 “2022-08-01”
        :type start_date: str
        :param end_date: 查询结束时间，格式 “2022-08-01”，与起始时间间隔90天内
        :type end_date: 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_plan_times_serialize(
            x_tenant_id=x_tenant_id,
            user_id=user_id,
            page_token=page_token,
            page_size=page_size,
            start_date=start_date,
            end_date=end_date,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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_plan_times_without_preload_content(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        user_id: Annotated[Optional[StrictStr], Field(description="用户idID集合,使用逗号分隔，最大数据100")] = None,
        page_token: Annotated[Optional[StrictStr], Field(description="分页标记，第一次请求不填或者空字符串，表示从头开始遍历；分页查询结果还有更多项时返回 nextPageToken，下次遍历可采用该 nextPageToken 入参 pageToken 获取查询结果，示例值：\"cfcb90voe9jct71bqkfg\"")] = None,
        page_size: Annotated[Optional[StrictStr], Field(description="分页大小, 示例值：10")] = None,
        start_date: Annotated[Optional[StrictStr], Field(description="查询起始时间，格式 “2022-08-01”")] = None,
        end_date: Annotated[Optional[StrictStr], Field(description="查询结束时间，格式 “2022-08-01”，与起始时间间隔90天内")] = 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 user_id: 用户idID集合,使用逗号分隔，最大数据100
        :type user_id: str
        :param page_token: 分页标记，第一次请求不填或者空字符串，表示从头开始遍历；分页查询结果还有更多项时返回 nextPageToken，下次遍历可采用该 nextPageToken 入参 pageToken 获取查询结果，示例值：\"cfcb90voe9jct71bqkfg\"
        :type page_token: str
        :param page_size: 分页大小, 示例值：10
        :type page_size: str
        :param start_date: 查询起始时间，格式 “2022-08-01”
        :type start_date: str
        :param end_date: 查询结束时间，格式 “2022-08-01”，与起始时间间隔90天内
        :type end_date: 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_plan_times_serialize(
            x_tenant_id=x_tenant_id,
            user_id=user_id,
            page_token=page_token,
            page_size=page_size,
            start_date=start_date,
            end_date=end_date,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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_plan_times_serialize(
        self,
        x_tenant_id,
        user_id,
        page_token,
        page_size,
        start_date,
        end_date,
        _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 user_id is not None:
            
            _query_params.append(('userId', user_id))
            
        if page_token is not None:
            
            _query_params.append(('pageToken', page_token))
            
        if page_size is not None:
            
            _query_params.append(('pageSize', page_size))
            
        if start_date is not None:
            
            _query_params.append(('startDate', start_date))
            
        if end_date is not None:
            
            _query_params.append(('endDate', end_date))
            
        # 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 + "/plantime/query"

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/plantime/query',
            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_task_plan_times(
        self,
        task_id: Annotated[StrictStr, Field(description="任务 ID")],
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        x_operator_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,
    ) -> ListTaskPlanTimesResponse:
        """获取单个任务的计划工时列表

        该接口用于根据任务 ID 查询单个任务的计划工时列表

        :param task_id: 任务 ID (required)
        :type task_id: str
        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param x_operator_id: 操作人 ID，如果入参了会检查操作人是否对任务可见
        :type x_operator_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._list_task_plan_times_serialize(
            task_id=task_id,
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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_task_plan_times_with_http_info(
        self,
        task_id: Annotated[StrictStr, Field(description="任务 ID")],
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        x_operator_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[ListTaskPlanTimesResponse]:
        """获取单个任务的计划工时列表

        该接口用于根据任务 ID 查询单个任务的计划工时列表

        :param task_id: 任务 ID (required)
        :type task_id: str
        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param x_operator_id: 操作人 ID，如果入参了会检查操作人是否对任务可见
        :type x_operator_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._list_task_plan_times_serialize(
            task_id=task_id,
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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_task_plan_times_without_preload_content(
        self,
        task_id: Annotated[StrictStr, Field(description="任务 ID")],
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        x_operator_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:
        """获取单个任务的计划工时列表

        该接口用于根据任务 ID 查询单个任务的计划工时列表

        :param task_id: 任务 ID (required)
        :type task_id: str
        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param x_operator_id: 操作人 ID，如果入参了会检查操作人是否对任务可见
        :type x_operator_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._list_task_plan_times_serialize(
            task_id=task_id,
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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_task_plan_times_serialize(
        self,
        task_id,
        x_tenant_id,
        x_operator_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
        if task_id is not None:
            _path_params['taskId'] = task_id
        # process the query parameters
        # process the header parameters
        if x_tenant_id is not None:
            _header_params['X-Tenant-Id'] = x_tenant_id
        if x_operator_id is not None:
            _header_params['X-Operator-Id'] = x_operator_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 + "/plantime/list/task/{taskId}"
        url = url.replace('{' + 'taskId' + '}', str(task_id))

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/plantime/list/task/{taskId}',
            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_task_work_times(
        self,
        task_id: Annotated[StrictStr, Field(description="任务 ID")],
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        x_operator_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,
    ) -> ListTaskWorkTimesResponse:
        """获取单个任务的实际工时列表

        该接口用于根据任务 ID 查询单个任务的实际工时列表

        :param task_id: 任务 ID (required)
        :type task_id: str
        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param x_operator_id: 操作人 ID，如果入参了会检查操作人是否对任务可见
        :type x_operator_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._list_task_work_times_serialize(
            task_id=task_id,
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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_task_work_times_with_http_info(
        self,
        task_id: Annotated[StrictStr, Field(description="任务 ID")],
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        x_operator_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[ListTaskWorkTimesResponse]:
        """获取单个任务的实际工时列表

        该接口用于根据任务 ID 查询单个任务的实际工时列表

        :param task_id: 任务 ID (required)
        :type task_id: str
        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param x_operator_id: 操作人 ID，如果入参了会检查操作人是否对任务可见
        :type x_operator_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._list_task_work_times_serialize(
            task_id=task_id,
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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_task_work_times_without_preload_content(
        self,
        task_id: Annotated[StrictStr, Field(description="任务 ID")],
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        x_operator_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:
        """获取单个任务的实际工时列表

        该接口用于根据任务 ID 查询单个任务的实际工时列表

        :param task_id: 任务 ID (required)
        :type task_id: str
        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param x_operator_id: 操作人 ID，如果入参了会检查操作人是否对任务可见
        :type x_operator_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._list_task_work_times_serialize(
            task_id=task_id,
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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_task_work_times_serialize(
        self,
        task_id,
        x_tenant_id,
        x_operator_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
        if task_id is not None:
            _path_params['taskId'] = task_id
        # process the query parameters
        # process the header parameters
        if x_tenant_id is not None:
            _header_params['X-Tenant-Id'] = x_tenant_id
        if x_operator_id is not None:
            _header_params['X-Operator-Id'] = x_operator_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 + "/worktime/list/task/{taskId}"
        url = url.replace('{' + 'taskId' + '}', str(task_id))

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/worktime/list/task/{taskId}',
            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_work_times(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        user_id: Annotated[Optional[StrictStr], Field(description="用户idID集合,使用逗号分隔，最大数据为100")] = None,
        page_token: Annotated[Optional[StrictStr], Field(description="分页标记，第一次请求不填或者空字符串，表示从头开始遍历；分页查询结果还有更多项时返回 nextPageToken，下次遍历可采用该 nextPageToken 入参 pageToken 获取查询结果，示例值：\"cfcb90voe9jct71bqkfg\"")] = None,
        page_size: Annotated[Optional[StrictStr], Field(description="分页大小, 示例值：10")] = None,
        start_date: Annotated[Optional[StrictStr], Field(description="查询起始时间，格式 “2022-08-01”")] = None,
        end_date: Annotated[Optional[StrictStr], Field(description="查询结束时间，格式 “2022-08-01”，与起始时间间隔90天内")] = 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,
    ) -> ListWorkTimesResponse:
        """获取用户所有实际工时详情数据

        获取用户所有实际工时详情数据。（含回收站任务）

        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param user_id: 用户idID集合,使用逗号分隔，最大数据为100
        :type user_id: str
        :param page_token: 分页标记，第一次请求不填或者空字符串，表示从头开始遍历；分页查询结果还有更多项时返回 nextPageToken，下次遍历可采用该 nextPageToken 入参 pageToken 获取查询结果，示例值：\"cfcb90voe9jct71bqkfg\"
        :type page_token: str
        :param page_size: 分页大小, 示例值：10
        :type page_size: str
        :param start_date: 查询起始时间，格式 “2022-08-01”
        :type start_date: str
        :param end_date: 查询结束时间，格式 “2022-08-01”，与起始时间间隔90天内
        :type end_date: 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_work_times_serialize(
            x_tenant_id=x_tenant_id,
            user_id=user_id,
            page_token=page_token,
            page_size=page_size,
            start_date=start_date,
            end_date=end_date,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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_work_times_with_http_info(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        user_id: Annotated[Optional[StrictStr], Field(description="用户idID集合,使用逗号分隔，最大数据为100")] = None,
        page_token: Annotated[Optional[StrictStr], Field(description="分页标记，第一次请求不填或者空字符串，表示从头开始遍历；分页查询结果还有更多项时返回 nextPageToken，下次遍历可采用该 nextPageToken 入参 pageToken 获取查询结果，示例值：\"cfcb90voe9jct71bqkfg\"")] = None,
        page_size: Annotated[Optional[StrictStr], Field(description="分页大小, 示例值：10")] = None,
        start_date: Annotated[Optional[StrictStr], Field(description="查询起始时间，格式 “2022-08-01”")] = None,
        end_date: Annotated[Optional[StrictStr], Field(description="查询结束时间，格式 “2022-08-01”，与起始时间间隔90天内")] = 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[ListWorkTimesResponse]:
        """获取用户所有实际工时详情数据

        获取用户所有实际工时详情数据。（含回收站任务）

        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param user_id: 用户idID集合,使用逗号分隔，最大数据为100
        :type user_id: str
        :param page_token: 分页标记，第一次请求不填或者空字符串，表示从头开始遍历；分页查询结果还有更多项时返回 nextPageToken，下次遍历可采用该 nextPageToken 入参 pageToken 获取查询结果，示例值：\"cfcb90voe9jct71bqkfg\"
        :type page_token: str
        :param page_size: 分页大小, 示例值：10
        :type page_size: str
        :param start_date: 查询起始时间，格式 “2022-08-01”
        :type start_date: str
        :param end_date: 查询结束时间，格式 “2022-08-01”，与起始时间间隔90天内
        :type end_date: 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_work_times_serialize(
            x_tenant_id=x_tenant_id,
            user_id=user_id,
            page_token=page_token,
            page_size=page_size,
            start_date=start_date,
            end_date=end_date,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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_work_times_without_preload_content(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        user_id: Annotated[Optional[StrictStr], Field(description="用户idID集合,使用逗号分隔，最大数据为100")] = None,
        page_token: Annotated[Optional[StrictStr], Field(description="分页标记，第一次请求不填或者空字符串，表示从头开始遍历；分页查询结果还有更多项时返回 nextPageToken，下次遍历可采用该 nextPageToken 入参 pageToken 获取查询结果，示例值：\"cfcb90voe9jct71bqkfg\"")] = None,
        page_size: Annotated[Optional[StrictStr], Field(description="分页大小, 示例值：10")] = None,
        start_date: Annotated[Optional[StrictStr], Field(description="查询起始时间，格式 “2022-08-01”")] = None,
        end_date: Annotated[Optional[StrictStr], Field(description="查询结束时间，格式 “2022-08-01”，与起始时间间隔90天内")] = 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 user_id: 用户idID集合,使用逗号分隔，最大数据为100
        :type user_id: str
        :param page_token: 分页标记，第一次请求不填或者空字符串，表示从头开始遍历；分页查询结果还有更多项时返回 nextPageToken，下次遍历可采用该 nextPageToken 入参 pageToken 获取查询结果，示例值：\"cfcb90voe9jct71bqkfg\"
        :type page_token: str
        :param page_size: 分页大小, 示例值：10
        :type page_size: str
        :param start_date: 查询起始时间，格式 “2022-08-01”
        :type start_date: str
        :param end_date: 查询结束时间，格式 “2022-08-01”，与起始时间间隔90天内
        :type end_date: 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_work_times_serialize(
            x_tenant_id=x_tenant_id,
            user_id=user_id,
            page_token=page_token,
            page_size=page_size,
            start_date=start_date,
            end_date=end_date,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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_work_times_serialize(
        self,
        x_tenant_id,
        user_id,
        page_token,
        page_size,
        start_date,
        end_date,
        _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 user_id is not None:
            
            _query_params.append(('userId', user_id))
            
        if page_token is not None:
            
            _query_params.append(('pageToken', page_token))
            
        if page_size is not None:
            
            _query_params.append(('pageSize', page_size))
            
        if start_date is not None:
            
            _query_params.append(('startDate', start_date))
            
        if end_date is not None:
            
            _query_params.append(('endDate', end_date))
            
        # 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 + "/worktime/query"

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/worktime/query',
            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 sum_task_plan_time(
        self,
        task_id: Annotated[StrictStr, Field(description="任务 ID")],
        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,
    ) -> SumTaskPlanTimeResponse:
        """获取单个任务的计划工时总和

        该接口用于根据任务 ID 查询单个任务的计划工时总和

        :param task_id: 任务 ID (required)
        :type task_id: str
        :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._sum_task_plan_time_serialize(
            task_id=task_id,
            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': "SumTaskPlanTimeResponse",
        }

        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 sum_task_plan_time_with_http_info(
        self,
        task_id: Annotated[StrictStr, Field(description="任务 ID")],
        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[SumTaskPlanTimeResponse]:
        """获取单个任务的计划工时总和

        该接口用于根据任务 ID 查询单个任务的计划工时总和

        :param task_id: 任务 ID (required)
        :type task_id: str
        :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._sum_task_plan_time_serialize(
            task_id=task_id,
            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': "SumTaskPlanTimeResponse",
        }

        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 sum_task_plan_time_without_preload_content(
        self,
        task_id: Annotated[StrictStr, Field(description="任务 ID")],
        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:
        """获取单个任务的计划工时总和

        该接口用于根据任务 ID 查询单个任务的计划工时总和

        :param task_id: 任务 ID (required)
        :type task_id: str
        :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._sum_task_plan_time_serialize(
            task_id=task_id,
            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': "SumTaskPlanTimeResponse",
        }

        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 _sum_task_plan_time_serialize(
        self,
        task_id,
        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
        if task_id is not None:
            _path_params['taskId'] = task_id
        # 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 + "/plantime/aggregation/task/{taskId}"
        url = url.replace('{' + 'taskId' + '}', str(task_id))

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/plantime/aggregation/task/{taskId}',
            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 sum_task_work_time(
        self,
        task_id: Annotated[StrictStr, Field(description="任务 ID")],
        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,
    ) -> SumTaskWorkTimeResponse:
        """获取单个任务的实际工时总和

        该接口用于根据任务 ID 查询单个任务的实际工时总和

        :param task_id: 任务 ID (required)
        :type task_id: str
        :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._sum_task_work_time_serialize(
            task_id=task_id,
            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': "SumTaskWorkTimeResponse",
        }

        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 sum_task_work_time_with_http_info(
        self,
        task_id: Annotated[StrictStr, Field(description="任务 ID")],
        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[SumTaskWorkTimeResponse]:
        """获取单个任务的实际工时总和

        该接口用于根据任务 ID 查询单个任务的实际工时总和

        :param task_id: 任务 ID (required)
        :type task_id: str
        :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._sum_task_work_time_serialize(
            task_id=task_id,
            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': "SumTaskWorkTimeResponse",
        }

        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 sum_task_work_time_without_preload_content(
        self,
        task_id: Annotated[StrictStr, Field(description="任务 ID")],
        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:
        """获取单个任务的实际工时总和

        该接口用于根据任务 ID 查询单个任务的实际工时总和

        :param task_id: 任务 ID (required)
        :type task_id: str
        :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._sum_task_work_time_serialize(
            task_id=task_id,
            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': "SumTaskWorkTimeResponse",
        }

        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 _sum_task_work_time_serialize(
        self,
        task_id,
        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
        if task_id is not None:
            _path_params['taskId'] = task_id
        # 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 + "/worktime/aggregation/task/{taskId}"
        url = url.replace('{' + 'taskId' + '}', str(task_id))

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/worktime/aggregation/task/{taskId}',
            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 update_plan_time(
        self,
        plantime_id: StrictStr,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="租户 ID")] = None,
        x_operator_id: Annotated[Optional[StrictStr], Field(description="操作人id")] = None,
        update_plan_time_request: Optional[UpdatePlanTimeRequest] = 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,
    ) -> UpdatePlanTimeResponse:
        """更新计划工时单条记录

        该接口用于更新指定的单条计划工时记录

        :param plantime_id:  (required)
        :type plantime_id: str
        :param x_tenant_id: 租户 ID
        :type x_tenant_id: str
        :param x_operator_id: 操作人id
        :type x_operator_id: str
        :param update_plan_time_request: 
        :type update_plan_time_request: UpdatePlanTimeRequest
        :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._update_plan_time_serialize(
            plantime_id=plantime_id,
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            update_plan_time_request=update_plan_time_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 update_plan_time_with_http_info(
        self,
        plantime_id: StrictStr,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="租户 ID")] = None,
        x_operator_id: Annotated[Optional[StrictStr], Field(description="操作人id")] = None,
        update_plan_time_request: Optional[UpdatePlanTimeRequest] = 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[UpdatePlanTimeResponse]:
        """更新计划工时单条记录

        该接口用于更新指定的单条计划工时记录

        :param plantime_id:  (required)
        :type plantime_id: str
        :param x_tenant_id: 租户 ID
        :type x_tenant_id: str
        :param x_operator_id: 操作人id
        :type x_operator_id: str
        :param update_plan_time_request: 
        :type update_plan_time_request: UpdatePlanTimeRequest
        :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._update_plan_time_serialize(
            plantime_id=plantime_id,
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            update_plan_time_request=update_plan_time_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 update_plan_time_without_preload_content(
        self,
        plantime_id: StrictStr,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="租户 ID")] = None,
        x_operator_id: Annotated[Optional[StrictStr], Field(description="操作人id")] = None,
        update_plan_time_request: Optional[UpdatePlanTimeRequest] = 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 plantime_id:  (required)
        :type plantime_id: str
        :param x_tenant_id: 租户 ID
        :type x_tenant_id: str
        :param x_operator_id: 操作人id
        :type x_operator_id: str
        :param update_plan_time_request: 
        :type update_plan_time_request: UpdatePlanTimeRequest
        :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._update_plan_time_serialize(
            plantime_id=plantime_id,
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            update_plan_time_request=update_plan_time_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 _update_plan_time_serialize(
        self,
        plantime_id,
        x_tenant_id,
        x_operator_id,
        update_plan_time_request,
        _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
        if plantime_id is not None:
            _path_params['plantimeId'] = plantime_id
        # process the query parameters
        # process the header parameters
        if x_tenant_id is not None:
            _header_params['X-Tenant-Id'] = x_tenant_id
        if x_operator_id is not None:
            _header_params['X-Operator-Id'] = x_operator_id
        # process the form parameters
        # process the body parameter
        if update_plan_time_request is not None:
            _body_params = update_plan_time_request


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

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/json'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

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

        # Build the full URL
        url = _host + "/plantime/{plantimeId}"
        url = url.replace('{' + 'plantimeId' + '}', str(plantime_id))

        return self.api_client.param_serialize(
            method='PUT',
            resource_path='/plantime/{plantimeId}',
            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 update_work_time(
        self,
        worktime_id: StrictStr,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="租户 ID")] = None,
        x_operator_id: Annotated[Optional[StrictStr], Field(description="操作人id")] = None,
        update_work_time_request: Optional[UpdateWorkTimeRequest] = 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,
    ) -> UpdateWorkTimeResponse:
        """更新实际工时单条记录

        该接口用于更新指定的单条实际工时记录

        :param worktime_id:  (required)
        :type worktime_id: str
        :param x_tenant_id: 租户 ID
        :type x_tenant_id: str
        :param x_operator_id: 操作人id
        :type x_operator_id: str
        :param update_work_time_request: 
        :type update_work_time_request: UpdateWorkTimeRequest
        :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._update_work_time_serialize(
            worktime_id=worktime_id,
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            update_work_time_request=update_work_time_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 update_work_time_with_http_info(
        self,
        worktime_id: StrictStr,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="租户 ID")] = None,
        x_operator_id: Annotated[Optional[StrictStr], Field(description="操作人id")] = None,
        update_work_time_request: Optional[UpdateWorkTimeRequest] = 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[UpdateWorkTimeResponse]:
        """更新实际工时单条记录

        该接口用于更新指定的单条实际工时记录

        :param worktime_id:  (required)
        :type worktime_id: str
        :param x_tenant_id: 租户 ID
        :type x_tenant_id: str
        :param x_operator_id: 操作人id
        :type x_operator_id: str
        :param update_work_time_request: 
        :type update_work_time_request: UpdateWorkTimeRequest
        :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._update_work_time_serialize(
            worktime_id=worktime_id,
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            update_work_time_request=update_work_time_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 update_work_time_without_preload_content(
        self,
        worktime_id: StrictStr,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="租户 ID")] = None,
        x_operator_id: Annotated[Optional[StrictStr], Field(description="操作人id")] = None,
        update_work_time_request: Optional[UpdateWorkTimeRequest] = 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 worktime_id:  (required)
        :type worktime_id: str
        :param x_tenant_id: 租户 ID
        :type x_tenant_id: str
        :param x_operator_id: 操作人id
        :type x_operator_id: str
        :param update_work_time_request: 
        :type update_work_time_request: UpdateWorkTimeRequest
        :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._update_work_time_serialize(
            worktime_id=worktime_id,
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            update_work_time_request=update_work_time_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 _update_work_time_serialize(
        self,
        worktime_id,
        x_tenant_id,
        x_operator_id,
        update_work_time_request,
        _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
        if worktime_id is not None:
            _path_params['worktimeId'] = worktime_id
        # process the query parameters
        # process the header parameters
        if x_tenant_id is not None:
            _header_params['X-Tenant-Id'] = x_tenant_id
        if x_operator_id is not None:
            _header_params['X-Operator-Id'] = x_operator_id
        # process the form parameters
        # process the body parameter
        if update_work_time_request is not None:
            _body_params = update_work_time_request


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

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/json'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

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

        # Build the full URL
        url = _host + "/worktime/{worktimeId}"
        url = url.replace('{' + 'worktimeId' + '}', str(worktime_id))

        return self.api_client.param_serialize(
            method='PUT',
            resource_path='/worktime/{worktimeId}',
            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 update_work_time_approval(
        self,
        open_id: Annotated[StrictStr, Field(description="审批对象ID")],
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        x_operator_id: Annotated[Optional[StrictStr], Field(description="操作人 ID")] = None,
        update_work_time_approval_request: Optional[UpdateWorkTimeApprovalRequest] = 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,
    ) -> UpdateWorkTimeApprovalResponse:
        """更新工时审批对象

        

        :param open_id: 审批对象ID (required)
        :type open_id: str
        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param x_operator_id: 操作人 ID
        :type x_operator_id: str
        :param update_work_time_approval_request: 
        :type update_work_time_approval_request: UpdateWorkTimeApprovalRequest
        :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._update_work_time_approval_serialize(
            open_id=open_id,
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            update_work_time_approval_request=update_work_time_approval_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 update_work_time_approval_with_http_info(
        self,
        open_id: Annotated[StrictStr, Field(description="审批对象ID")],
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        x_operator_id: Annotated[Optional[StrictStr], Field(description="操作人 ID")] = None,
        update_work_time_approval_request: Optional[UpdateWorkTimeApprovalRequest] = 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[UpdateWorkTimeApprovalResponse]:
        """更新工时审批对象

        

        :param open_id: 审批对象ID (required)
        :type open_id: str
        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param x_operator_id: 操作人 ID
        :type x_operator_id: str
        :param update_work_time_approval_request: 
        :type update_work_time_approval_request: UpdateWorkTimeApprovalRequest
        :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._update_work_time_approval_serialize(
            open_id=open_id,
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            update_work_time_approval_request=update_work_time_approval_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 update_work_time_approval_without_preload_content(
        self,
        open_id: Annotated[StrictStr, Field(description="审批对象ID")],
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        x_operator_id: Annotated[Optional[StrictStr], Field(description="操作人 ID")] = None,
        update_work_time_approval_request: Optional[UpdateWorkTimeApprovalRequest] = 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 open_id: 审批对象ID (required)
        :type open_id: str
        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param x_operator_id: 操作人 ID
        :type x_operator_id: str
        :param update_work_time_approval_request: 
        :type update_work_time_approval_request: UpdateWorkTimeApprovalRequest
        :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._update_work_time_approval_serialize(
            open_id=open_id,
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            update_work_time_approval_request=update_work_time_approval_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 _update_work_time_approval_serialize(
        self,
        open_id,
        x_tenant_id,
        x_operator_id,
        update_work_time_approval_request,
        _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
        if open_id is not None:
            _path_params['openId'] = open_id
        # process the query parameters
        # process the header parameters
        if x_tenant_id is not None:
            _header_params['X-Tenant-Id'] = x_tenant_id
        if x_operator_id is not None:
            _header_params['X-Operator-Id'] = x_operator_id
        # process the form parameters
        # process the body parameter
        if update_work_time_approval_request is not None:
            _body_params = update_work_time_approval_request


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

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/json'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

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

        # Build the full URL
        url = _host + "/worktime/approve/{openId}"
        url = url.replace('{' + 'openId' + '}', str(open_id))

        return self.api_client.param_serialize(
            method='PUT',
            resource_path='/worktime/approve/{openId}',
            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 update_work_time_limit(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        x_operator_id: Annotated[Optional[StrictStr], Field(description="操作人 ID")] = None,
        update_work_time_limit_request: Optional[UpdateWorkTimeLimitRequest] = 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,
    ) -> UpdateWorkTimeLimitResponse:
        """更新工时企业人天的最大填报时间限制

        填报限制优先匹配 当前成员 那天有没有限制，否则会看 企业层面有没有限制，然后才是取24小时，  如果少传了 userId 或者  date 不会做 更新当前成员人天限制，而是 更新了企业所有成员人天限制（企业层面的限制）。请慎重判断入参是否为空。  例：  1. 入参了 userId 、date、 maxTime， 效果：更新当前成员人天限制  2. 只参了 userId 和 maxTime， 效果：更新企业所有成员人天限制，userId 是无效入参  3. 只参了 date 和 maxTime， 效果：更新企业所有成员人天限制，date 是无效入参，不支持企业层面在某一天做限制  4. 只参了 maxTime， 效果：更新企业所有成员人天限制  

        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param x_operator_id: 操作人 ID
        :type x_operator_id: str
        :param update_work_time_limit_request: 
        :type update_work_time_limit_request: UpdateWorkTimeLimitRequest
        :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._update_work_time_limit_serialize(
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            update_work_time_limit_request=update_work_time_limit_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 update_work_time_limit_with_http_info(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        x_operator_id: Annotated[Optional[StrictStr], Field(description="操作人 ID")] = None,
        update_work_time_limit_request: Optional[UpdateWorkTimeLimitRequest] = 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[UpdateWorkTimeLimitResponse]:
        """更新工时企业人天的最大填报时间限制

        填报限制优先匹配 当前成员 那天有没有限制，否则会看 企业层面有没有限制，然后才是取24小时，  如果少传了 userId 或者  date 不会做 更新当前成员人天限制，而是 更新了企业所有成员人天限制（企业层面的限制）。请慎重判断入参是否为空。  例：  1. 入参了 userId 、date、 maxTime， 效果：更新当前成员人天限制  2. 只参了 userId 和 maxTime， 效果：更新企业所有成员人天限制，userId 是无效入参  3. 只参了 date 和 maxTime， 效果：更新企业所有成员人天限制，date 是无效入参，不支持企业层面在某一天做限制  4. 只参了 maxTime， 效果：更新企业所有成员人天限制  

        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param x_operator_id: 操作人 ID
        :type x_operator_id: str
        :param update_work_time_limit_request: 
        :type update_work_time_limit_request: UpdateWorkTimeLimitRequest
        :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._update_work_time_limit_serialize(
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            update_work_time_limit_request=update_work_time_limit_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 update_work_time_limit_without_preload_content(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        x_operator_id: Annotated[Optional[StrictStr], Field(description="操作人 ID")] = None,
        update_work_time_limit_request: Optional[UpdateWorkTimeLimitRequest] = 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:
        """更新工时企业人天的最大填报时间限制

        填报限制优先匹配 当前成员 那天有没有限制，否则会看 企业层面有没有限制，然后才是取24小时，  如果少传了 userId 或者  date 不会做 更新当前成员人天限制，而是 更新了企业所有成员人天限制（企业层面的限制）。请慎重判断入参是否为空。  例：  1. 入参了 userId 、date、 maxTime， 效果：更新当前成员人天限制  2. 只参了 userId 和 maxTime， 效果：更新企业所有成员人天限制，userId 是无效入参  3. 只参了 date 和 maxTime， 效果：更新企业所有成员人天限制，date 是无效入参，不支持企业层面在某一天做限制  4. 只参了 maxTime， 效果：更新企业所有成员人天限制  

        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param x_operator_id: 操作人 ID
        :type x_operator_id: str
        :param update_work_time_limit_request: 
        :type update_work_time_limit_request: UpdateWorkTimeLimitRequest
        :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._update_work_time_limit_serialize(
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            update_work_time_limit_request=update_work_time_limit_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 _update_work_time_limit_serialize(
        self,
        x_tenant_id,
        x_operator_id,
        update_work_time_limit_request,
        _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
        if x_operator_id is not None:
            _header_params['X-Operator-Id'] = x_operator_id
        # process the form parameters
        # process the body parameter
        if update_work_time_limit_request is not None:
            _body_params = update_work_time_limit_request


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

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/json'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

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

        # Build the full URL
        url = _host + "/worktime/restriction"

        return self.api_client.param_serialize(
            method='PUT',
            resource_path='/worktime/restriction',
            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
        )

