# coding: utf-8

"""
    Teambition Open API

    Teambition Open API

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

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


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

from pydantic import Field, StrictInt, StrictStr
from typing import Optional
from typing_extensions import Annotated
from teambition_oapi_sdk.model.create_test_case_v3_request import CreateTestCaseV3Request
from teambition_oapi_sdk.model.create_test_case_v3_response import CreateTestCaseV3Response
from teambition_oapi_sdk.model.get_project_test_hub_v3_response import GetProjectTestHubV3Response
from teambition_oapi_sdk.model.plan_test_case_v3_request import PlanTestCaseV3Request
from teambition_oapi_sdk.model.plan_test_case_v3_response import PlanTestCaseV3Response
from teambition_oapi_sdk.model.query_org_test_hubs_v3_response import QueryOrgTestHubsV3Response
from teambition_oapi_sdk.model.query_org_user_cases_v3_response import QueryOrgUserCasesV3Response
from teambition_oapi_sdk.model.query_project_test_hub_cases_v3_response import QueryProjectTestHubCasesV3Response
from teambition_oapi_sdk.model.query_test_cases_v3_response import QueryTestCasesV3Response
from teambition_oapi_sdk.model.query_test_groups_v3_request import QueryTestGroupsV3Request
from teambition_oapi_sdk.model.query_test_groups_v3_response import QueryTestGroupsV3Response
from teambition_oapi_sdk.model.update_test_case_flow_status_v3_request import UpdateTestCaseFlowStatusV3Request
from teambition_oapi_sdk.model.update_test_case_flow_status_v3_response import UpdateTestCaseFlowStatusV3Response

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 TestcaseApi:
    """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 create_test_case_v3(
        self,
        project_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,
        create_test_case_v3_request: Optional[CreateTestCaseV3Request] = 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,
    ) -> CreateTestCaseV3Response:
        """创建测试用例

        创建测试用例

        :param project_id: 项目 ID (required)
        :type project_id: str
        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param x_operator_id: 操作人 ID
        :type x_operator_id: str
        :param create_test_case_v3_request: 
        :type create_test_case_v3_request: CreateTestCaseV3Request
        :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_test_case_v3_serialize(
            project_id=project_id,
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            create_test_case_v3_request=create_test_case_v3_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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_test_case_v3_with_http_info(
        self,
        project_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,
        create_test_case_v3_request: Optional[CreateTestCaseV3Request] = 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[CreateTestCaseV3Response]:
        """创建测试用例

        创建测试用例

        :param project_id: 项目 ID (required)
        :type project_id: str
        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param x_operator_id: 操作人 ID
        :type x_operator_id: str
        :param create_test_case_v3_request: 
        :type create_test_case_v3_request: CreateTestCaseV3Request
        :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_test_case_v3_serialize(
            project_id=project_id,
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            create_test_case_v3_request=create_test_case_v3_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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_test_case_v3_without_preload_content(
        self,
        project_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,
        create_test_case_v3_request: Optional[CreateTestCaseV3Request] = 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 project_id: 项目 ID (required)
        :type project_id: str
        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param x_operator_id: 操作人 ID
        :type x_operator_id: str
        :param create_test_case_v3_request: 
        :type create_test_case_v3_request: CreateTestCaseV3Request
        :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_test_case_v3_serialize(
            project_id=project_id,
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            create_test_case_v3_request=create_test_case_v3_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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_test_case_v3_serialize(
        self,
        project_id,
        x_tenant_id,
        x_operator_id,
        create_test_case_v3_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 project_id is not None:
            _path_params['projectId'] = project_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 create_test_case_v3_request is not None:
            _body_params = create_test_case_v3_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 + "/v3/project/{projectId}/testcase/create"
        url = url.replace('{' + 'projectId' + '}', str(project_id))

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/v3/project/{projectId}/testcase/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 get_project_test_hub_v3(
        self,
        project_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,
    ) -> GetProjectTestHubV3Response:
        """查询项目用例库

        查询项目用例库

        :param project_id: 项目 ID (required)
        :type project_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._get_project_test_hub_v3_serialize(
            project_id=project_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': "GetProjectTestHubV3Response",
        }

        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_project_test_hub_v3_with_http_info(
        self,
        project_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[GetProjectTestHubV3Response]:
        """查询项目用例库

        查询项目用例库

        :param project_id: 项目 ID (required)
        :type project_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._get_project_test_hub_v3_serialize(
            project_id=project_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': "GetProjectTestHubV3Response",
        }

        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_project_test_hub_v3_without_preload_content(
        self,
        project_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:
        """查询项目用例库

        查询项目用例库

        :param project_id: 项目 ID (required)
        :type project_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._get_project_test_hub_v3_serialize(
            project_id=project_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': "GetProjectTestHubV3Response",
        }

        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_project_test_hub_v3_serialize(
        self,
        project_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 project_id is not None:
            _path_params['projectId'] = project_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 + "/v3/project/{projectId}/testhub"
        url = url.replace('{' + 'projectId' + '}', str(project_id))

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/v3/project/{projectId}/testhub',
            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 plan_test_case_v3(
        self,
        project_id: Annotated[StrictStr, Field(description="项目 ID")],
        testplan_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,
        plan_test_case_v3_request: Optional[PlanTestCaseV3Request] = 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,
    ) -> PlanTestCaseV3Response:
        """规划测试用例

        将用例库的基础用例规划至测试计划中，异步接口直接返回。

        :param project_id: 项目 ID (required)
        :type project_id: str
        :param testplan_id: 测试计划 ID (required)
        :type testplan_id: str
        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param x_operator_id: 操作人 ID
        :type x_operator_id: str
        :param plan_test_case_v3_request: 
        :type plan_test_case_v3_request: PlanTestCaseV3Request
        :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._plan_test_case_v3_serialize(
            project_id=project_id,
            testplan_id=testplan_id,
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            plan_test_case_v3_request=plan_test_case_v3_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 plan_test_case_v3_with_http_info(
        self,
        project_id: Annotated[StrictStr, Field(description="项目 ID")],
        testplan_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,
        plan_test_case_v3_request: Optional[PlanTestCaseV3Request] = 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[PlanTestCaseV3Response]:
        """规划测试用例

        将用例库的基础用例规划至测试计划中，异步接口直接返回。

        :param project_id: 项目 ID (required)
        :type project_id: str
        :param testplan_id: 测试计划 ID (required)
        :type testplan_id: str
        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param x_operator_id: 操作人 ID
        :type x_operator_id: str
        :param plan_test_case_v3_request: 
        :type plan_test_case_v3_request: PlanTestCaseV3Request
        :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._plan_test_case_v3_serialize(
            project_id=project_id,
            testplan_id=testplan_id,
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            plan_test_case_v3_request=plan_test_case_v3_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 plan_test_case_v3_without_preload_content(
        self,
        project_id: Annotated[StrictStr, Field(description="项目 ID")],
        testplan_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,
        plan_test_case_v3_request: Optional[PlanTestCaseV3Request] = 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 project_id: 项目 ID (required)
        :type project_id: str
        :param testplan_id: 测试计划 ID (required)
        :type testplan_id: str
        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param x_operator_id: 操作人 ID
        :type x_operator_id: str
        :param plan_test_case_v3_request: 
        :type plan_test_case_v3_request: PlanTestCaseV3Request
        :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._plan_test_case_v3_serialize(
            project_id=project_id,
            testplan_id=testplan_id,
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            plan_test_case_v3_request=plan_test_case_v3_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 _plan_test_case_v3_serialize(
        self,
        project_id,
        testplan_id,
        x_tenant_id,
        x_operator_id,
        plan_test_case_v3_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 project_id is not None:
            _path_params['projectId'] = project_id
        if testplan_id is not None:
            _path_params['testplanId'] = testplan_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 plan_test_case_v3_request is not None:
            _body_params = plan_test_case_v3_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 + "/v3/project/{projectId}/testplan/{testplanId}/planning"
        url = url.replace('{' + 'projectId' + '}', str(project_id))
        url = url.replace('{' + 'testplanId' + '}', str(testplan_id))

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/v3/project/{projectId}/testplan/{testplanId}/planning',
            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 query_org_test_hubs_v3(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        x_operator_id: Annotated[Optional[StrictStr], Field(description="操作人 ID")] = None,
        page_size: Annotated[Optional[StrictInt], Field(description="返回数量")] = None,
        page_token: Annotated[Optional[StrictStr], Field(description="下一页开始")] = 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,
    ) -> QueryOrgTestHubsV3Response:
        """查询企业用例库列表

        查询企业用例库列表

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

        _param = self._query_org_test_hubs_v3_serialize(
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            page_size=page_size,
            page_token=page_token,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 query_org_test_hubs_v3_with_http_info(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        x_operator_id: Annotated[Optional[StrictStr], Field(description="操作人 ID")] = None,
        page_size: Annotated[Optional[StrictInt], Field(description="返回数量")] = None,
        page_token: Annotated[Optional[StrictStr], Field(description="下一页开始")] = 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[QueryOrgTestHubsV3Response]:
        """查询企业用例库列表

        查询企业用例库列表

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

        _param = self._query_org_test_hubs_v3_serialize(
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            page_size=page_size,
            page_token=page_token,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 query_org_test_hubs_v3_without_preload_content(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        x_operator_id: Annotated[Optional[StrictStr], Field(description="操作人 ID")] = None,
        page_size: Annotated[Optional[StrictInt], Field(description="返回数量")] = None,
        page_token: Annotated[Optional[StrictStr], Field(description="下一页开始")] = 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 page_size: 返回数量
        :type page_size: int
        :param page_token: 下一页开始
        :type page_token: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._query_org_test_hubs_v3_serialize(
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            page_size=page_size,
            page_token=page_token,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 _query_org_test_hubs_v3_serialize(
        self,
        x_tenant_id,
        x_operator_id,
        page_size,
        page_token,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

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

        _collection_formats: Dict[str, str] = {
        }

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

        # process the path parameters
        # process the query parameters
        if page_size is not None:
            
            _query_params.append(('pageSize', page_size))
            
        if page_token is not None:
            
            _query_params.append(('pageToken', page_token))
            
        # process the header parameters
        if x_tenant_id is not None:
            _header_params['X-Tenant-Id'] = x_tenant_id
        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 + "/v3/testhub/query"

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/v3/testhub/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 query_org_user_cases_v3(
        self,
        testhub_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,
        page_size: Annotated[Optional[StrictInt], Field(description="返回数量，最大值为1000")] = None,
        page_token: Annotated[Optional[StrictStr], Field(description="下一页开始")] = None,
        keyword: Annotated[Optional[StrictStr], Field(description="关键词")] = 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,
    ) -> QueryOrgUserCasesV3Response:
        """查询企业用例库用例列表V2

        查询企业用例库用例列表V2

        :param testhub_id: 用例库ID (required)
        :type testhub_id: str
        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param x_operator_id: 操作人 ID
        :type x_operator_id: str
        :param page_size: 返回数量，最大值为1000
        :type page_size: int
        :param page_token: 下一页开始
        :type page_token: str
        :param keyword: 关键词
        :type keyword: 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._query_org_user_cases_v3_serialize(
            testhub_id=testhub_id,
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            page_size=page_size,
            page_token=page_token,
            keyword=keyword,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 query_org_user_cases_v3_with_http_info(
        self,
        testhub_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,
        page_size: Annotated[Optional[StrictInt], Field(description="返回数量，最大值为1000")] = None,
        page_token: Annotated[Optional[StrictStr], Field(description="下一页开始")] = None,
        keyword: Annotated[Optional[StrictStr], Field(description="关键词")] = 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[QueryOrgUserCasesV3Response]:
        """查询企业用例库用例列表V2

        查询企业用例库用例列表V2

        :param testhub_id: 用例库ID (required)
        :type testhub_id: str
        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param x_operator_id: 操作人 ID
        :type x_operator_id: str
        :param page_size: 返回数量，最大值为1000
        :type page_size: int
        :param page_token: 下一页开始
        :type page_token: str
        :param keyword: 关键词
        :type keyword: 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._query_org_user_cases_v3_serialize(
            testhub_id=testhub_id,
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            page_size=page_size,
            page_token=page_token,
            keyword=keyword,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 query_org_user_cases_v3_without_preload_content(
        self,
        testhub_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,
        page_size: Annotated[Optional[StrictInt], Field(description="返回数量，最大值为1000")] = None,
        page_token: Annotated[Optional[StrictStr], Field(description="下一页开始")] = None,
        keyword: Annotated[Optional[StrictStr], Field(description="关键词")] = 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:
        """查询企业用例库用例列表V2

        查询企业用例库用例列表V2

        :param testhub_id: 用例库ID (required)
        :type testhub_id: str
        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param x_operator_id: 操作人 ID
        :type x_operator_id: str
        :param page_size: 返回数量，最大值为1000
        :type page_size: int
        :param page_token: 下一页开始
        :type page_token: str
        :param keyword: 关键词
        :type keyword: 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._query_org_user_cases_v3_serialize(
            testhub_id=testhub_id,
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            page_size=page_size,
            page_token=page_token,
            keyword=keyword,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 _query_org_user_cases_v3_serialize(
        self,
        testhub_id,
        x_tenant_id,
        x_operator_id,
        page_size,
        page_token,
        keyword,
        _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 testhub_id is not None:
            _path_params['testhubId'] = testhub_id
        # process the query parameters
        if page_size is not None:
            
            _query_params.append(('pageSize', page_size))
            
        if page_token is not None:
            
            _query_params.append(('pageToken', page_token))
            
        if keyword is not None:
            
            _query_params.append(('keyword', keyword))
            
        # 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 + "/v3/testhub/{testhubId}/usercase/query"
        url = url.replace('{' + 'testhubId' + '}', str(testhub_id))

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/v3/testhub/{testhubId}/usercase/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 query_project_test_hub_cases_v3(
        self,
        project_id: Annotated[StrictStr, Field(description="企业ID")],
        testhub_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,
        page_size: Annotated[Optional[StrictInt], Field(description="返回数量，最大值为1000")] = None,
        page_token: Annotated[Optional[StrictStr], Field(description="下一页开始")] = None,
        keyword: Annotated[Optional[StrictStr], Field(description="关键词")] = 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,
    ) -> QueryProjectTestHubCasesV3Response:
        """查询项目用例库用例列表

        查询项目用例库用例列表

        :param project_id: 企业ID (required)
        :type project_id: str
        :param testhub_id: 用例库ID (required)
        :type testhub_id: str
        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param x_operator_id: 操作人 ID
        :type x_operator_id: str
        :param page_size: 返回数量，最大值为1000
        :type page_size: int
        :param page_token: 下一页开始
        :type page_token: str
        :param keyword: 关键词
        :type keyword: 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._query_project_test_hub_cases_v3_serialize(
            project_id=project_id,
            testhub_id=testhub_id,
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            page_size=page_size,
            page_token=page_token,
            keyword=keyword,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 query_project_test_hub_cases_v3_with_http_info(
        self,
        project_id: Annotated[StrictStr, Field(description="企业ID")],
        testhub_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,
        page_size: Annotated[Optional[StrictInt], Field(description="返回数量，最大值为1000")] = None,
        page_token: Annotated[Optional[StrictStr], Field(description="下一页开始")] = None,
        keyword: Annotated[Optional[StrictStr], Field(description="关键词")] = 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[QueryProjectTestHubCasesV3Response]:
        """查询项目用例库用例列表

        查询项目用例库用例列表

        :param project_id: 企业ID (required)
        :type project_id: str
        :param testhub_id: 用例库ID (required)
        :type testhub_id: str
        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param x_operator_id: 操作人 ID
        :type x_operator_id: str
        :param page_size: 返回数量，最大值为1000
        :type page_size: int
        :param page_token: 下一页开始
        :type page_token: str
        :param keyword: 关键词
        :type keyword: 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._query_project_test_hub_cases_v3_serialize(
            project_id=project_id,
            testhub_id=testhub_id,
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            page_size=page_size,
            page_token=page_token,
            keyword=keyword,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 query_project_test_hub_cases_v3_without_preload_content(
        self,
        project_id: Annotated[StrictStr, Field(description="企业ID")],
        testhub_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,
        page_size: Annotated[Optional[StrictInt], Field(description="返回数量，最大值为1000")] = None,
        page_token: Annotated[Optional[StrictStr], Field(description="下一页开始")] = None,
        keyword: Annotated[Optional[StrictStr], Field(description="关键词")] = 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 project_id: 企业ID (required)
        :type project_id: str
        :param testhub_id: 用例库ID (required)
        :type testhub_id: str
        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param x_operator_id: 操作人 ID
        :type x_operator_id: str
        :param page_size: 返回数量，最大值为1000
        :type page_size: int
        :param page_token: 下一页开始
        :type page_token: str
        :param keyword: 关键词
        :type keyword: 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._query_project_test_hub_cases_v3_serialize(
            project_id=project_id,
            testhub_id=testhub_id,
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            page_size=page_size,
            page_token=page_token,
            keyword=keyword,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 _query_project_test_hub_cases_v3_serialize(
        self,
        project_id,
        testhub_id,
        x_tenant_id,
        x_operator_id,
        page_size,
        page_token,
        keyword,
        _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 project_id is not None:
            _path_params['projectId'] = project_id
        if testhub_id is not None:
            _path_params['testhubId'] = testhub_id
        # process the query parameters
        if page_size is not None:
            
            _query_params.append(('pageSize', page_size))
            
        if page_token is not None:
            
            _query_params.append(('pageToken', page_token))
            
        if keyword is not None:
            
            _query_params.append(('keyword', keyword))
            
        # 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 + "/v3/project/{projectId}/testhub/{testhubId}/usercase/query"
        url = url.replace('{' + 'projectId' + '}', str(project_id))
        url = url.replace('{' + 'testhubId' + '}', str(testhub_id))

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/v3/project/{projectId}/testhub/{testhubId}/usercase/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 query_test_cases_v3(
        self,
        project_id: Annotated[StrictStr, Field(description="项目 ID")],
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        testplan_id: Annotated[Optional[StrictStr], Field(description="测试计划 ID")] = None,
        group_id: Annotated[Optional[StrictStr], Field(description="分组 ID")] = None,
        page_size: Annotated[Optional[StrictInt], Field(description="返回数量，最大值为1000")] = None,
        page_token: Annotated[Optional[StrictStr], Field(description="下一页开始")] = None,
        keyword: Annotated[Optional[StrictStr], Field(description="关键词")] = None,
        testcase_ids: Annotated[Optional[StrictStr], Field(description="测试用例 ID 列表，以逗号分隔，最多传100个ID，根据pageSize决定获取的数量")] = 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,
    ) -> QueryTestCasesV3Response:
        """查询测试用例列表

        查询测试用例列表

        :param project_id: 项目 ID (required)
        :type project_id: str
        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param testplan_id: 测试计划 ID
        :type testplan_id: str
        :param group_id: 分组 ID
        :type group_id: str
        :param page_size: 返回数量，最大值为1000
        :type page_size: int
        :param page_token: 下一页开始
        :type page_token: str
        :param keyword: 关键词
        :type keyword: str
        :param testcase_ids: 测试用例 ID 列表，以逗号分隔，最多传100个ID，根据pageSize决定获取的数量
        :type testcase_ids: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._query_test_cases_v3_serialize(
            project_id=project_id,
            x_tenant_id=x_tenant_id,
            testplan_id=testplan_id,
            group_id=group_id,
            page_size=page_size,
            page_token=page_token,
            keyword=keyword,
            testcase_ids=testcase_ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 query_test_cases_v3_with_http_info(
        self,
        project_id: Annotated[StrictStr, Field(description="项目 ID")],
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        testplan_id: Annotated[Optional[StrictStr], Field(description="测试计划 ID")] = None,
        group_id: Annotated[Optional[StrictStr], Field(description="分组 ID")] = None,
        page_size: Annotated[Optional[StrictInt], Field(description="返回数量，最大值为1000")] = None,
        page_token: Annotated[Optional[StrictStr], Field(description="下一页开始")] = None,
        keyword: Annotated[Optional[StrictStr], Field(description="关键词")] = None,
        testcase_ids: Annotated[Optional[StrictStr], Field(description="测试用例 ID 列表，以逗号分隔，最多传100个ID，根据pageSize决定获取的数量")] = 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[QueryTestCasesV3Response]:
        """查询测试用例列表

        查询测试用例列表

        :param project_id: 项目 ID (required)
        :type project_id: str
        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param testplan_id: 测试计划 ID
        :type testplan_id: str
        :param group_id: 分组 ID
        :type group_id: str
        :param page_size: 返回数量，最大值为1000
        :type page_size: int
        :param page_token: 下一页开始
        :type page_token: str
        :param keyword: 关键词
        :type keyword: str
        :param testcase_ids: 测试用例 ID 列表，以逗号分隔，最多传100个ID，根据pageSize决定获取的数量
        :type testcase_ids: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._query_test_cases_v3_serialize(
            project_id=project_id,
            x_tenant_id=x_tenant_id,
            testplan_id=testplan_id,
            group_id=group_id,
            page_size=page_size,
            page_token=page_token,
            keyword=keyword,
            testcase_ids=testcase_ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 query_test_cases_v3_without_preload_content(
        self,
        project_id: Annotated[StrictStr, Field(description="项目 ID")],
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        testplan_id: Annotated[Optional[StrictStr], Field(description="测试计划 ID")] = None,
        group_id: Annotated[Optional[StrictStr], Field(description="分组 ID")] = None,
        page_size: Annotated[Optional[StrictInt], Field(description="返回数量，最大值为1000")] = None,
        page_token: Annotated[Optional[StrictStr], Field(description="下一页开始")] = None,
        keyword: Annotated[Optional[StrictStr], Field(description="关键词")] = None,
        testcase_ids: Annotated[Optional[StrictStr], Field(description="测试用例 ID 列表，以逗号分隔，最多传100个ID，根据pageSize决定获取的数量")] = 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 project_id: 项目 ID (required)
        :type project_id: str
        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param testplan_id: 测试计划 ID
        :type testplan_id: str
        :param group_id: 分组 ID
        :type group_id: str
        :param page_size: 返回数量，最大值为1000
        :type page_size: int
        :param page_token: 下一页开始
        :type page_token: str
        :param keyword: 关键词
        :type keyword: str
        :param testcase_ids: 测试用例 ID 列表，以逗号分隔，最多传100个ID，根据pageSize决定获取的数量
        :type testcase_ids: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._query_test_cases_v3_serialize(
            project_id=project_id,
            x_tenant_id=x_tenant_id,
            testplan_id=testplan_id,
            group_id=group_id,
            page_size=page_size,
            page_token=page_token,
            keyword=keyword,
            testcase_ids=testcase_ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 _query_test_cases_v3_serialize(
        self,
        project_id,
        x_tenant_id,
        testplan_id,
        group_id,
        page_size,
        page_token,
        keyword,
        testcase_ids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

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

        _collection_formats: Dict[str, str] = {
        }

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

        # process the path parameters
        if project_id is not None:
            _path_params['projectId'] = project_id
        # process the query parameters
        if testplan_id is not None:
            
            _query_params.append(('testplanId', testplan_id))
            
        if group_id is not None:
            
            _query_params.append(('groupId', group_id))
            
        if page_size is not None:
            
            _query_params.append(('pageSize', page_size))
            
        if page_token is not None:
            
            _query_params.append(('pageToken', page_token))
            
        if keyword is not None:
            
            _query_params.append(('keyword', keyword))
            
        if testcase_ids is not None:
            
            _query_params.append(('testcaseIds', testcase_ids))
            
        # process the header parameters
        if x_tenant_id is not None:
            _header_params['X-Tenant-Id'] = x_tenant_id
        # process the form parameters
        # process the body parameter


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


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

        # Build the full URL
        url = _host + "/v3/project/{projectId}/testcase/query"
        url = url.replace('{' + 'projectId' + '}', str(project_id))

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/v3/project/{projectId}/testcase/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 query_test_groups_v3(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        x_operator_id: Annotated[Optional[StrictStr], Field(description="操作人 ID")] = None,
        query_test_groups_v3_request: Optional[QueryTestGroupsV3Request] = 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,
    ) -> QueryTestGroupsV3Response:
        """批量查询用例分组

        批量查询用例分组

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

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

        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 query_test_groups_v3_with_http_info(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        x_operator_id: Annotated[Optional[StrictStr], Field(description="操作人 ID")] = None,
        query_test_groups_v3_request: Optional[QueryTestGroupsV3Request] = 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[QueryTestGroupsV3Response]:
        """批量查询用例分组

        批量查询用例分组

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

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

        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 query_test_groups_v3_without_preload_content(
        self,
        x_tenant_id: Annotated[Optional[StrictStr], Field(description="企业 ID")] = None,
        x_operator_id: Annotated[Optional[StrictStr], Field(description="操作人 ID")] = None,
        query_test_groups_v3_request: Optional[QueryTestGroupsV3Request] = 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 query_test_groups_v3_request: 
        :type query_test_groups_v3_request: QueryTestGroupsV3Request
        :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._query_test_groups_v3_serialize(
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            query_test_groups_v3_request=query_test_groups_v3_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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 _query_test_groups_v3_serialize(
        self,
        x_tenant_id,
        x_operator_id,
        query_test_groups_v3_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 query_test_groups_v3_request is not None:
            _body_params = query_test_groups_v3_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 + "/v3/group/query"

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/v3/group/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 update_test_case_flow_status_v3(
        self,
        project_id: Annotated[StrictStr, Field(description="项目 ID")],
        testplan_id: Annotated[StrictStr, Field(description="测试计划 ID")],
        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_test_case_flow_status_v3_request: Optional[UpdateTestCaseFlowStatusV3Request] = 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,
    ) -> UpdateTestCaseFlowStatusV3Response:
        """更新测试用例状态

        更新测试用例状态

        :param project_id: 项目 ID (required)
        :type project_id: str
        :param testplan_id: 测试计划 ID (required)
        :type testplan_id: str
        :param id: 测试用例 ID (required)
        :type id: str
        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param x_operator_id: 操作人 ID
        :type x_operator_id: str
        :param update_test_case_flow_status_v3_request: 
        :type update_test_case_flow_status_v3_request: UpdateTestCaseFlowStatusV3Request
        :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_test_case_flow_status_v3_serialize(
            project_id=project_id,
            testplan_id=testplan_id,
            id=id,
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            update_test_case_flow_status_v3_request=update_test_case_flow_status_v3_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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_test_case_flow_status_v3_with_http_info(
        self,
        project_id: Annotated[StrictStr, Field(description="项目 ID")],
        testplan_id: Annotated[StrictStr, Field(description="测试计划 ID")],
        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_test_case_flow_status_v3_request: Optional[UpdateTestCaseFlowStatusV3Request] = 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[UpdateTestCaseFlowStatusV3Response]:
        """更新测试用例状态

        更新测试用例状态

        :param project_id: 项目 ID (required)
        :type project_id: str
        :param testplan_id: 测试计划 ID (required)
        :type testplan_id: str
        :param id: 测试用例 ID (required)
        :type id: str
        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param x_operator_id: 操作人 ID
        :type x_operator_id: str
        :param update_test_case_flow_status_v3_request: 
        :type update_test_case_flow_status_v3_request: UpdateTestCaseFlowStatusV3Request
        :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_test_case_flow_status_v3_serialize(
            project_id=project_id,
            testplan_id=testplan_id,
            id=id,
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            update_test_case_flow_status_v3_request=update_test_case_flow_status_v3_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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_test_case_flow_status_v3_without_preload_content(
        self,
        project_id: Annotated[StrictStr, Field(description="项目 ID")],
        testplan_id: Annotated[StrictStr, Field(description="测试计划 ID")],
        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_test_case_flow_status_v3_request: Optional[UpdateTestCaseFlowStatusV3Request] = 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 project_id: 项目 ID (required)
        :type project_id: str
        :param testplan_id: 测试计划 ID (required)
        :type testplan_id: str
        :param id: 测试用例 ID (required)
        :type id: str
        :param x_tenant_id: 企业 ID
        :type x_tenant_id: str
        :param x_operator_id: 操作人 ID
        :type x_operator_id: str
        :param update_test_case_flow_status_v3_request: 
        :type update_test_case_flow_status_v3_request: UpdateTestCaseFlowStatusV3Request
        :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_test_case_flow_status_v3_serialize(
            project_id=project_id,
            testplan_id=testplan_id,
            id=id,
            x_tenant_id=x_tenant_id,
            x_operator_id=x_operator_id,
            update_test_case_flow_status_v3_request=update_test_case_flow_status_v3_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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

        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_test_case_flow_status_v3_serialize(
        self,
        project_id,
        testplan_id,
        id,
        x_tenant_id,
        x_operator_id,
        update_test_case_flow_status_v3_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 project_id is not None:
            _path_params['projectId'] = project_id
        if testplan_id is not None:
            _path_params['testplanId'] = testplan_id
        if id is not None:
            _path_params['id'] = 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_test_case_flow_status_v3_request is not None:
            _body_params = update_test_case_flow_status_v3_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 + "/v3/project/{projectId}/testplan/{testplanId}/testcase/{id}/flowStatusId"
        url = url.replace('{' + 'projectId' + '}', str(project_id))
        url = url.replace('{' + 'testplanId' + '}', str(testplan_id))
        url = url.replace('{' + 'id' + '}', str(id))

        return self.api_client.param_serialize(
            method='PUT',
            resource_path='/v3/project/{projectId}/testplan/{testplanId}/testcase/{id}/flowStatusId',
            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
        )

