"""
Cybee API

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

The version of the OpenAPI document: 0.42.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 datetime import datetime
from pydantic import Field, StrictStr, field_validator
from typing import List, Optional
from typing_extensions import Annotated
from uuid import UUID
from cybee_sdk.api.models.generate_key_request import GenerateKeyRequest
from cybee_sdk.api.models.generated_api_key import GeneratedApiKey
from cybee_sdk.api.models.page_api_key import PageApiKey
from cybee_sdk.api.models.page_organization import PageOrganization
from cybee_sdk.api.models.pyd_generic_message import PydGenericMessage

from cybee_sdk.api.api_client import ApiClient, RequestSerialized
from cybee_sdk.api.api_response import ApiResponse
from cybee_sdk.api.rest import RESTResponseType


class IdentityApi:
    """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_api_key_identity_keys_post(
        self,
        generate_key_request: GenerateKeyRequest,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = 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,
    ) -> GeneratedApiKey:
        """Create Api Key


        :param generate_key_request: (required)
        :type generate_key_request: GenerateKeyRequest
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_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._create_api_key_identity_keys_post_serialize(
            generate_key_request=generate_key_request,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "GeneratedApiKey",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _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_api_key_identity_keys_post_with_http_info(
        self,
        generate_key_request: GenerateKeyRequest,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = 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[GeneratedApiKey]:
        """Create Api Key


        :param generate_key_request: (required)
        :type generate_key_request: GenerateKeyRequest
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_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._create_api_key_identity_keys_post_serialize(
            generate_key_request=generate_key_request,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "GeneratedApiKey",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _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_api_key_identity_keys_post_without_preload_content(
        self,
        generate_key_request: GenerateKeyRequest,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = 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:
        """Create Api Key


        :param generate_key_request: (required)
        :type generate_key_request: GenerateKeyRequest
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_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._create_api_key_identity_keys_post_serialize(
            generate_key_request=generate_key_request,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "GeneratedApiKey",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        return response_data.response

    def _create_api_key_identity_keys_post_serialize(
        self,
        generate_key_request,
        cbe_user_org_id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _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 cbe_user_org_id is not None:
            _header_params["cbe-user-org-id"] = cbe_user_org_id
        # process the form parameters
        # process the body parameter
        if generate_key_request is not None:
            _body_params = generate_key_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] = ["ZitadelWebAuthorizationBearer", "BearerToken"]

        return self.api_client.param_serialize(
            method="POST",
            resource_path="/identity/keys/",
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth,
        )

    @validate_call
    def list_all_api_keys_identity_keys_get(
        self,
        page: Optional[Annotated[int, Field(strict=True, ge=0)]] = None,
        per_page: Optional[Annotated[int, Field(le=50, strict=True, ge=1)]] = None,
        order_by: Optional[List[Optional[StrictStr]]] = None,
        id: Optional[List[UUID]] = None,
        name: Optional[StrictStr] = None,
        expiration_at_gt: Optional[datetime] = None,
        expiration_at_lt: Optional[datetime] = None,
        created_at_gt: Optional[datetime] = None,
        created_at_lt: Optional[datetime] = None,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = 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,
    ) -> PageApiKey:
        """List All Api Keys


        :param page:
        :type page: int
        :param per_page:
        :type per_page: int
        :param order_by:
        :type order_by: List[Optional[str]]
        :param id:
        :type id: List[UUID]
        :param name:
        :type name: str
        :param expiration_at_gt:
        :type expiration_at_gt: datetime
        :param expiration_at_lt:
        :type expiration_at_lt: datetime
        :param created_at_gt:
        :type created_at_gt: datetime
        :param created_at_lt:
        :type created_at_lt: datetime
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._list_all_api_keys_identity_keys_get_serialize(
            page=page,
            per_page=per_page,
            order_by=order_by,
            id=id,
            name=name,
            expiration_at_gt=expiration_at_gt,
            expiration_at_lt=expiration_at_lt,
            created_at_gt=created_at_gt,
            created_at_lt=created_at_lt,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "PageApiKey",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data

    @validate_call
    def list_all_api_keys_identity_keys_get_with_http_info(
        self,
        page: Optional[Annotated[int, Field(strict=True, ge=0)]] = None,
        per_page: Optional[Annotated[int, Field(le=50, strict=True, ge=1)]] = None,
        order_by: Optional[List[Optional[StrictStr]]] = None,
        id: Optional[List[UUID]] = None,
        name: Optional[StrictStr] = None,
        expiration_at_gt: Optional[datetime] = None,
        expiration_at_lt: Optional[datetime] = None,
        created_at_gt: Optional[datetime] = None,
        created_at_lt: Optional[datetime] = None,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = 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[PageApiKey]:
        """List All Api Keys


        :param page:
        :type page: int
        :param per_page:
        :type per_page: int
        :param order_by:
        :type order_by: List[Optional[str]]
        :param id:
        :type id: List[UUID]
        :param name:
        :type name: str
        :param expiration_at_gt:
        :type expiration_at_gt: datetime
        :param expiration_at_lt:
        :type expiration_at_lt: datetime
        :param created_at_gt:
        :type created_at_gt: datetime
        :param created_at_lt:
        :type created_at_lt: datetime
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._list_all_api_keys_identity_keys_get_serialize(
            page=page,
            per_page=per_page,
            order_by=order_by,
            id=id,
            name=name,
            expiration_at_gt=expiration_at_gt,
            expiration_at_lt=expiration_at_lt,
            created_at_gt=created_at_gt,
            created_at_lt=created_at_lt,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "PageApiKey",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    @validate_call
    def list_all_api_keys_identity_keys_get_without_preload_content(
        self,
        page: Optional[Annotated[int, Field(strict=True, ge=0)]] = None,
        per_page: Optional[Annotated[int, Field(le=50, strict=True, ge=1)]] = None,
        order_by: Optional[List[Optional[StrictStr]]] = None,
        id: Optional[List[UUID]] = None,
        name: Optional[StrictStr] = None,
        expiration_at_gt: Optional[datetime] = None,
        expiration_at_lt: Optional[datetime] = None,
        created_at_gt: Optional[datetime] = None,
        created_at_lt: Optional[datetime] = None,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = 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:
        """List All Api Keys


        :param page:
        :type page: int
        :param per_page:
        :type per_page: int
        :param order_by:
        :type order_by: List[Optional[str]]
        :param id:
        :type id: List[UUID]
        :param name:
        :type name: str
        :param expiration_at_gt:
        :type expiration_at_gt: datetime
        :param expiration_at_lt:
        :type expiration_at_lt: datetime
        :param created_at_gt:
        :type created_at_gt: datetime
        :param created_at_lt:
        :type created_at_lt: datetime
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._list_all_api_keys_identity_keys_get_serialize(
            page=page,
            per_page=per_page,
            order_by=order_by,
            id=id,
            name=name,
            expiration_at_gt=expiration_at_gt,
            expiration_at_lt=expiration_at_lt,
            created_at_gt=created_at_gt,
            created_at_lt=created_at_lt,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "PageApiKey",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        return response_data.response

    def _list_all_api_keys_identity_keys_get_serialize(
        self,
        page,
        per_page,
        order_by,
        id,
        name,
        expiration_at_gt,
        expiration_at_lt,
        created_at_gt,
        created_at_lt,
        cbe_user_org_id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            "order_by": "multi",
            "id": "multi",
        }

        _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 is not None:
            _query_params.append(("page", page))

        if per_page is not None:
            _query_params.append(("per_page", per_page))

        if order_by is not None:
            _query_params.append(("order_by", order_by))

        if id is not None:
            _query_params.append(("id", id))

        if name is not None:
            _query_params.append(("name", name))

        if expiration_at_gt is not None:
            if isinstance(expiration_at_gt, datetime):
                _query_params.append(
                    ("expiration_at_gt", expiration_at_gt.strftime(self.api_client.configuration.datetime_format))
                )
            else:
                _query_params.append(("expiration_at_gt", expiration_at_gt))

        if expiration_at_lt is not None:
            if isinstance(expiration_at_lt, datetime):
                _query_params.append(
                    ("expiration_at_lt", expiration_at_lt.strftime(self.api_client.configuration.datetime_format))
                )
            else:
                _query_params.append(("expiration_at_lt", expiration_at_lt))

        if created_at_gt is not None:
            if isinstance(created_at_gt, datetime):
                _query_params.append(
                    ("created_at_gt", created_at_gt.strftime(self.api_client.configuration.datetime_format))
                )
            else:
                _query_params.append(("created_at_gt", created_at_gt))

        if created_at_lt is not None:
            if isinstance(created_at_lt, datetime):
                _query_params.append(
                    ("created_at_lt", created_at_lt.strftime(self.api_client.configuration.datetime_format))
                )
            else:
                _query_params.append(("created_at_lt", created_at_lt))

        # process the header parameters
        if cbe_user_org_id is not None:
            _header_params["cbe-user-org-id"] = cbe_user_org_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] = ["ZitadelWebAuthorizationBearer", "BearerToken"]

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

    @validate_call
    def list_all_organization_identity_organization_get(
        self,
        page: Optional[Annotated[int, Field(strict=True, ge=0)]] = None,
        per_page: Optional[Annotated[int, Field(le=50, strict=True, ge=1)]] = None,
        order_by: Optional[List[StrictStr]] = None,
        id: Optional[List[UUID]] = None,
        display_name: Optional[StrictStr] = None,
        created_at_gt: Optional[datetime] = None,
        created_at_lt: Optional[datetime] = None,
        updated_at_gt: Optional[datetime] = None,
        updated_at_lt: Optional[datetime] = None,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = 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,
    ) -> PageOrganization:
        """List All Organization


        :param page:
        :type page: int
        :param per_page:
        :type per_page: int
        :param order_by:
        :type order_by: List[str]
        :param id:
        :type id: List[UUID]
        :param display_name:
        :type display_name: str
        :param created_at_gt:
        :type created_at_gt: datetime
        :param created_at_lt:
        :type created_at_lt: datetime
        :param updated_at_gt:
        :type updated_at_gt: datetime
        :param updated_at_lt:
        :type updated_at_lt: datetime
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._list_all_organization_identity_organization_get_serialize(
            page=page,
            per_page=per_page,
            order_by=order_by,
            id=id,
            display_name=display_name,
            created_at_gt=created_at_gt,
            created_at_lt=created_at_lt,
            updated_at_gt=updated_at_gt,
            updated_at_lt=updated_at_lt,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "PageOrganization",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data

    @validate_call
    def list_all_organization_identity_organization_get_with_http_info(
        self,
        page: Optional[Annotated[int, Field(strict=True, ge=0)]] = None,
        per_page: Optional[Annotated[int, Field(le=50, strict=True, ge=1)]] = None,
        order_by: Optional[List[StrictStr]] = None,
        id: Optional[List[UUID]] = None,
        display_name: Optional[StrictStr] = None,
        created_at_gt: Optional[datetime] = None,
        created_at_lt: Optional[datetime] = None,
        updated_at_gt: Optional[datetime] = None,
        updated_at_lt: Optional[datetime] = None,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = 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[PageOrganization]:
        """List All Organization


        :param page:
        :type page: int
        :param per_page:
        :type per_page: int
        :param order_by:
        :type order_by: List[str]
        :param id:
        :type id: List[UUID]
        :param display_name:
        :type display_name: str
        :param created_at_gt:
        :type created_at_gt: datetime
        :param created_at_lt:
        :type created_at_lt: datetime
        :param updated_at_gt:
        :type updated_at_gt: datetime
        :param updated_at_lt:
        :type updated_at_lt: datetime
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._list_all_organization_identity_organization_get_serialize(
            page=page,
            per_page=per_page,
            order_by=order_by,
            id=id,
            display_name=display_name,
            created_at_gt=created_at_gt,
            created_at_lt=created_at_lt,
            updated_at_gt=updated_at_gt,
            updated_at_lt=updated_at_lt,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "PageOrganization",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    @validate_call
    def list_all_organization_identity_organization_get_without_preload_content(
        self,
        page: Optional[Annotated[int, Field(strict=True, ge=0)]] = None,
        per_page: Optional[Annotated[int, Field(le=50, strict=True, ge=1)]] = None,
        order_by: Optional[List[StrictStr]] = None,
        id: Optional[List[UUID]] = None,
        display_name: Optional[StrictStr] = None,
        created_at_gt: Optional[datetime] = None,
        created_at_lt: Optional[datetime] = None,
        updated_at_gt: Optional[datetime] = None,
        updated_at_lt: Optional[datetime] = None,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = 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:
        """List All Organization


        :param page:
        :type page: int
        :param per_page:
        :type per_page: int
        :param order_by:
        :type order_by: List[str]
        :param id:
        :type id: List[UUID]
        :param display_name:
        :type display_name: str
        :param created_at_gt:
        :type created_at_gt: datetime
        :param created_at_lt:
        :type created_at_lt: datetime
        :param updated_at_gt:
        :type updated_at_gt: datetime
        :param updated_at_lt:
        :type updated_at_lt: datetime
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._list_all_organization_identity_organization_get_serialize(
            page=page,
            per_page=per_page,
            order_by=order_by,
            id=id,
            display_name=display_name,
            created_at_gt=created_at_gt,
            created_at_lt=created_at_lt,
            updated_at_gt=updated_at_gt,
            updated_at_lt=updated_at_lt,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "PageOrganization",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        return response_data.response

    def _list_all_organization_identity_organization_get_serialize(
        self,
        page,
        per_page,
        order_by,
        id,
        display_name,
        created_at_gt,
        created_at_lt,
        updated_at_gt,
        updated_at_lt,
        cbe_user_org_id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            "order_by": "multi",
            "id": "multi",
        }

        _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 is not None:
            _query_params.append(("page", page))

        if per_page is not None:
            _query_params.append(("per_page", per_page))

        if order_by is not None:
            _query_params.append(("order_by", order_by))

        if id is not None:
            _query_params.append(("id", id))

        if display_name is not None:
            _query_params.append(("display_name", display_name))

        if created_at_gt is not None:
            if isinstance(created_at_gt, datetime):
                _query_params.append(
                    ("created_at_gt", created_at_gt.strftime(self.api_client.configuration.datetime_format))
                )
            else:
                _query_params.append(("created_at_gt", created_at_gt))

        if created_at_lt is not None:
            if isinstance(created_at_lt, datetime):
                _query_params.append(
                    ("created_at_lt", created_at_lt.strftime(self.api_client.configuration.datetime_format))
                )
            else:
                _query_params.append(("created_at_lt", created_at_lt))

        if updated_at_gt is not None:
            if isinstance(updated_at_gt, datetime):
                _query_params.append(
                    ("updated_at_gt", updated_at_gt.strftime(self.api_client.configuration.datetime_format))
                )
            else:
                _query_params.append(("updated_at_gt", updated_at_gt))

        if updated_at_lt is not None:
            if isinstance(updated_at_lt, datetime):
                _query_params.append(
                    ("updated_at_lt", updated_at_lt.strftime(self.api_client.configuration.datetime_format))
                )
            else:
                _query_params.append(("updated_at_lt", updated_at_lt))

        # process the header parameters
        if cbe_user_org_id is not None:
            _header_params["cbe-user-org-id"] = cbe_user_org_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] = ["ZitadelWebAuthorizationBearer", "BearerToken"]

        return self.api_client.param_serialize(
            method="GET",
            resource_path="/identity/organization/",
            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 revoke_api_key_identity_keys_key_id_delete(
        self,
        key_id: StrictStr,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = 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,
    ) -> PydGenericMessage:
        """Revoke Api Key


        :param key_id: (required)
        :type key_id: str
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_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._revoke_api_key_identity_keys_key_id_delete_serialize(
            key_id=key_id,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "PydGenericMessage",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _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 revoke_api_key_identity_keys_key_id_delete_with_http_info(
        self,
        key_id: StrictStr,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = 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[PydGenericMessage]:
        """Revoke Api Key


        :param key_id: (required)
        :type key_id: str
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_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._revoke_api_key_identity_keys_key_id_delete_serialize(
            key_id=key_id,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "PydGenericMessage",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _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 revoke_api_key_identity_keys_key_id_delete_without_preload_content(
        self,
        key_id: StrictStr,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = 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:
        """Revoke Api Key


        :param key_id: (required)
        :type key_id: str
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_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._revoke_api_key_identity_keys_key_id_delete_serialize(
            key_id=key_id,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "PydGenericMessage",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        return response_data.response

    def _revoke_api_key_identity_keys_key_id_delete_serialize(
        self,
        key_id,
        cbe_user_org_id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _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 key_id is not None:
            _path_params["key_id"] = key_id
        # process the query parameters
        # process the header parameters
        if cbe_user_org_id is not None:
            _header_params["cbe-user-org-id"] = cbe_user_org_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] = ["ZitadelWebAuthorizationBearer", "BearerToken"]

        return self.api_client.param_serialize(
            method="DELETE",
            resource_path="/identity/keys/{key_id}/",
            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,
        )
