"""
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 pydantic import Field, StrictBool, StrictStr, field_validator
from typing import Any, List, Optional
from typing_extensions import Annotated
from uuid import UUID
from cybee_sdk.api.models.agent_lock import AgentLock
from cybee_sdk.api.models.agent_update import AgentUpdate
from cybee_sdk.api.models.page_agent_info import PageAgentInfo
from cybee_sdk.api.models.page_unregistered_agent_info import PageUnregisteredAgentInfo

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 AgentsApi:
    """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 approve_agent_agent_agent_id_approve_post(
        self,
        agent_id: UUID,
        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,
    ) -> None:
        """Approve Agent

        # Approve agent  Register a previously **unknown** (unregistered) agent into the system. Once approved, the agent becomes a fully registered agent and starts appearing in `GET /agent/`.  By default the agent is approved for the **caller's own organization**. To approve the agent on behalf of a different organization, set the `Cbe-User-Org-Id` header to the target organization id.  **Endpoint**: `POST /agent/{agent_id}/approve/`  **Auth**: requires an authenticated user.  ## Path parameter - `agent_id` (uuid, required): Identifier of the unregistered agent to approve. See `GET /agent/unregistered/`.  ## Headers - `Cbe-User-Org-Id` (string, optional): Organization the agent should be approved for. Defaults to the caller's organization when omitted.  ## Response - `204 No Content`: The agent was approved and registered.  ### Example  ```http POST /agent/c85a857f-4d70-4099-b84f-a6b74ea999de/approve/ HTTP/1.1 Authorization: Bearer <access_token> Cbe-User-Org-Id: 123456789 ```

        :param agent_id: (required)
        :type agent_id: UUID
        :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._approve_agent_agent_agent_id_approve_post_serialize(
            agent_id=agent_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]] = {
            "204": None,
            "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 approve_agent_agent_agent_id_approve_post_with_http_info(
        self,
        agent_id: UUID,
        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[None]:
        """Approve Agent

        # Approve agent  Register a previously **unknown** (unregistered) agent into the system. Once approved, the agent becomes a fully registered agent and starts appearing in `GET /agent/`.  By default the agent is approved for the **caller's own organization**. To approve the agent on behalf of a different organization, set the `Cbe-User-Org-Id` header to the target organization id.  **Endpoint**: `POST /agent/{agent_id}/approve/`  **Auth**: requires an authenticated user.  ## Path parameter - `agent_id` (uuid, required): Identifier of the unregistered agent to approve. See `GET /agent/unregistered/`.  ## Headers - `Cbe-User-Org-Id` (string, optional): Organization the agent should be approved for. Defaults to the caller's organization when omitted.  ## Response - `204 No Content`: The agent was approved and registered.  ### Example  ```http POST /agent/c85a857f-4d70-4099-b84f-a6b74ea999de/approve/ HTTP/1.1 Authorization: Bearer <access_token> Cbe-User-Org-Id: 123456789 ```

        :param agent_id: (required)
        :type agent_id: UUID
        :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._approve_agent_agent_agent_id_approve_post_serialize(
            agent_id=agent_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]] = {
            "204": None,
            "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 approve_agent_agent_agent_id_approve_post_without_preload_content(
        self,
        agent_id: UUID,
        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:
        """Approve Agent

        # Approve agent  Register a previously **unknown** (unregistered) agent into the system. Once approved, the agent becomes a fully registered agent and starts appearing in `GET /agent/`.  By default the agent is approved for the **caller's own organization**. To approve the agent on behalf of a different organization, set the `Cbe-User-Org-Id` header to the target organization id.  **Endpoint**: `POST /agent/{agent_id}/approve/`  **Auth**: requires an authenticated user.  ## Path parameter - `agent_id` (uuid, required): Identifier of the unregistered agent to approve. See `GET /agent/unregistered/`.  ## Headers - `Cbe-User-Org-Id` (string, optional): Organization the agent should be approved for. Defaults to the caller's organization when omitted.  ## Response - `204 No Content`: The agent was approved and registered.  ### Example  ```http POST /agent/c85a857f-4d70-4099-b84f-a6b74ea999de/approve/ HTTP/1.1 Authorization: Bearer <access_token> Cbe-User-Org-Id: 123456789 ```

        :param agent_id: (required)
        :type agent_id: UUID
        :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._approve_agent_agent_agent_id_approve_post_serialize(
            agent_id=agent_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]] = {
            "204": None,
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        return response_data.response

    def _approve_agent_agent_agent_id_approve_post_serialize(
        self,
        agent_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 agent_id is not None:
            _path_params["agent_id"] = agent_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="POST",
            resource_path="/agent/{agent_id}/approve/",
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth,
        )

    @validate_call
    def delete_agent_agent_agent_id_delete(
        self,
        agent_id: UUID,
        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,
    ) -> object:
        """Delete Agent


        :param agent_id: (required)
        :type agent_id: UUID
        :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._delete_agent_agent_agent_id_delete_serialize(
            agent_id=agent_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": "object",
            "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 delete_agent_agent_agent_id_delete_with_http_info(
        self,
        agent_id: UUID,
        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[object]:
        """Delete Agent


        :param agent_id: (required)
        :type agent_id: UUID
        :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._delete_agent_agent_agent_id_delete_serialize(
            agent_id=agent_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": "object",
            "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 delete_agent_agent_agent_id_delete_without_preload_content(
        self,
        agent_id: UUID,
        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:
        """Delete Agent


        :param agent_id: (required)
        :type agent_id: UUID
        :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._delete_agent_agent_agent_id_delete_serialize(
            agent_id=agent_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": "object",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        return response_data.response

    def _delete_agent_agent_agent_id_delete_serialize(
        self,
        agent_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 agent_id is not None:
            _path_params["agent_id"] = agent_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="/agent/{agent_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,
        )

    @validate_call
    def get_agent_agent_unregistered_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,
        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,
    ) -> PageUnregisteredAgentInfo:
        """Get Agent

        # List unregistered agents  Fetch a paginated list of agents that are connected to the backend but **not yet registered** - i.e. agents awaiting approval. Approve one with `POST /agent/{agent_id}/approve/` to turn it into a registered agent visible in `GET /agent/`.  **Endpoint**: `GET /agent/unregistered/`  **Auth**: requires an authenticated user.  ## Query parameters - `page` (int, default 0): Zero-based page index. - `per_page` (int, default 25, max 50): Page size. - `order_by` (list[str]): Optional sort fields forwarded to the backend.  ## Response `200 OK` with a `Page[UnregisteredAgentInfo]` body: - `page`, `per_page`, `total_items`, `total_pages`: Pagination metadata. - `items`: Array of unregistered agents with fields:   - `id` (uuid): Agent identifier. Pass this to `POST /agent/{agent_id}/approve/`.   - `machine_id` (string): Stable hardware/machine identifier.   - `host_name` (string): Reported host name.   - `os_family` (string, nullable): Operating system family (e.g. `windows`, `linux`).   - `os_details` (string, nullable): Detailed OS description.   - `version` (string, nullable): Agent software version.   - `last_seen` (datetime): Last time the agent contacted the system.  ### Example  ```http GET /agent/unregistered/?page=0&per_page=25 HTTP/1.1 Authorization: Bearer <access_token> ```  ```json {   \"page\": 0,   \"per_page\": 25,   \"total_items\": 1,   \"total_pages\": 1,   \"items\": [     {       \"id\": \"c85a857f-4d70-4099-b84f-a6b74ea999de\",       \"machine_id\": \"S-1-5-21-1004336348\",       \"host_name\": \"WIN-WORKSTATION-02\",       \"domain_name\": \"company.local\",       \"os_family\": \"windows\",       \"os_details\": \"Windows 11 Pro 23H2\",       \"version\": \"1.4.2\",       \"last_seen\": \"2024-05-06T12:00:00Z\"     }   ] } ```

        :param page:
        :type page: int
        :param per_page:
        :type per_page: int
        :param order_by:
        :type order_by: List[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._get_agent_agent_unregistered_get_serialize(
            page=page,
            per_page=per_page,
            order_by=order_by,
            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": "PageUnregisteredAgentInfo",
            "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 get_agent_agent_unregistered_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,
        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[PageUnregisteredAgentInfo]:
        """Get Agent

        # List unregistered agents  Fetch a paginated list of agents that are connected to the backend but **not yet registered** - i.e. agents awaiting approval. Approve one with `POST /agent/{agent_id}/approve/` to turn it into a registered agent visible in `GET /agent/`.  **Endpoint**: `GET /agent/unregistered/`  **Auth**: requires an authenticated user.  ## Query parameters - `page` (int, default 0): Zero-based page index. - `per_page` (int, default 25, max 50): Page size. - `order_by` (list[str]): Optional sort fields forwarded to the backend.  ## Response `200 OK` with a `Page[UnregisteredAgentInfo]` body: - `page`, `per_page`, `total_items`, `total_pages`: Pagination metadata. - `items`: Array of unregistered agents with fields:   - `id` (uuid): Agent identifier. Pass this to `POST /agent/{agent_id}/approve/`.   - `machine_id` (string): Stable hardware/machine identifier.   - `host_name` (string): Reported host name.   - `os_family` (string, nullable): Operating system family (e.g. `windows`, `linux`).   - `os_details` (string, nullable): Detailed OS description.   - `version` (string, nullable): Agent software version.   - `last_seen` (datetime): Last time the agent contacted the system.  ### Example  ```http GET /agent/unregistered/?page=0&per_page=25 HTTP/1.1 Authorization: Bearer <access_token> ```  ```json {   \"page\": 0,   \"per_page\": 25,   \"total_items\": 1,   \"total_pages\": 1,   \"items\": [     {       \"id\": \"c85a857f-4d70-4099-b84f-a6b74ea999de\",       \"machine_id\": \"S-1-5-21-1004336348\",       \"host_name\": \"WIN-WORKSTATION-02\",       \"domain_name\": \"company.local\",       \"os_family\": \"windows\",       \"os_details\": \"Windows 11 Pro 23H2\",       \"version\": \"1.4.2\",       \"last_seen\": \"2024-05-06T12:00:00Z\"     }   ] } ```

        :param page:
        :type page: int
        :param per_page:
        :type per_page: int
        :param order_by:
        :type order_by: List[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._get_agent_agent_unregistered_get_serialize(
            page=page,
            per_page=per_page,
            order_by=order_by,
            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": "PageUnregisteredAgentInfo",
            "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 get_agent_agent_unregistered_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,
        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:
        """Get Agent

        # List unregistered agents  Fetch a paginated list of agents that are connected to the backend but **not yet registered** - i.e. agents awaiting approval. Approve one with `POST /agent/{agent_id}/approve/` to turn it into a registered agent visible in `GET /agent/`.  **Endpoint**: `GET /agent/unregistered/`  **Auth**: requires an authenticated user.  ## Query parameters - `page` (int, default 0): Zero-based page index. - `per_page` (int, default 25, max 50): Page size. - `order_by` (list[str]): Optional sort fields forwarded to the backend.  ## Response `200 OK` with a `Page[UnregisteredAgentInfo]` body: - `page`, `per_page`, `total_items`, `total_pages`: Pagination metadata. - `items`: Array of unregistered agents with fields:   - `id` (uuid): Agent identifier. Pass this to `POST /agent/{agent_id}/approve/`.   - `machine_id` (string): Stable hardware/machine identifier.   - `host_name` (string): Reported host name.   - `os_family` (string, nullable): Operating system family (e.g. `windows`, `linux`).   - `os_details` (string, nullable): Detailed OS description.   - `version` (string, nullable): Agent software version.   - `last_seen` (datetime): Last time the agent contacted the system.  ### Example  ```http GET /agent/unregistered/?page=0&per_page=25 HTTP/1.1 Authorization: Bearer <access_token> ```  ```json {   \"page\": 0,   \"per_page\": 25,   \"total_items\": 1,   \"total_pages\": 1,   \"items\": [     {       \"id\": \"c85a857f-4d70-4099-b84f-a6b74ea999de\",       \"machine_id\": \"S-1-5-21-1004336348\",       \"host_name\": \"WIN-WORKSTATION-02\",       \"domain_name\": \"company.local\",       \"os_family\": \"windows\",       \"os_details\": \"Windows 11 Pro 23H2\",       \"version\": \"1.4.2\",       \"last_seen\": \"2024-05-06T12:00:00Z\"     }   ] } ```

        :param page:
        :type page: int
        :param per_page:
        :type per_page: int
        :param order_by:
        :type order_by: List[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._get_agent_agent_unregistered_get_serialize(
            page=page,
            per_page=per_page,
            order_by=order_by,
            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": "PageUnregisteredAgentInfo",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        return response_data.response

    def _get_agent_agent_unregistered_get_serialize(
        self,
        page,
        per_page,
        order_by,
        cbe_user_org_id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            "order_by": "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))

        # 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="/agent/unregistered/",
            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_agent_agent_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,
        machine_id: Optional[List[Optional[Annotated[str, Field(min_length=1, strict=True)]]]] = None,
        custom_name: Optional[List[Annotated[str, Field(min_length=1, strict=True)]]] = None,
        host_name: Optional[List[Annotated[str, Field(min_length=1, strict=True)]]] = None,
        domain_name: Optional[List[Annotated[str, Field(min_length=1, strict=True)]]] = None,
        online: Optional[StrictBool] = 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,
    ) -> PageAgentInfo:
        """List Agent

        # List agents  Fetch a paginated list of all known and **registered** agents.  Most filters accept multiple entries. Values supplied for the same field are combined with an **OR**; values supplied for different fields are combined with an **AND**.  > Unregistered (not-yet-approved) agents are not returned here. Use > `GET /agent/unregistered/` to list agents awaiting approval, then call > `POST /agent/{agent_id}/approve/` to register one.  **Endpoint**: `GET /agent/`  **Auth**: requires an authenticated user.  ## Query parameters - `page` (int, default 0): Zero-based page index. - `per_page` (int, default 25, max 50): Page size. - `order_by` (list[str]): Optional sort fields forwarded to the backend. - `id` (list[uuid]): Filter by one or more agent ids. - `machine_id` (list[string]): Filter by one or more machine ids. - `custom_name` (list[string]): Filter by one or more user-defined names. - `host_name` (list[string]): Filter by one or more host names. - `online` (bool): Filter by current connectivity state.  ## Response `200 OK` with a `Page[AgentInfo]` body: - `page`, `per_page`, `total_items`, `total_pages`: Pagination metadata. - `items`: Array of agents with fields:   - `id` (uuid): Agent identifier.   - `machine_id` (string): Stable hardware/machine identifier.   - `host_name` (string): Reported host name.   - `custom_name` (string, nullable): User-defined display name.   - `version` (string, nullable): Agent software version.   - `online` (bool, nullable): Whether the agent is currently connected.   - `approved_at` (datetime, nullable): When the agent was approved/registered. `null` while unregistered.   - `last_seen` (datetime): Last time the agent contacted the system.   - `lock_reason` (string, nullable): Reason the agent is locked. By default this reflects the keypair credentials expiration. See `POST /agent/{agent_id}/lock/`.   - `locked_at` (datetime, nullable): When the agent was locked. By default this reflects the keypair credentials expiration. A locked agent cannot perform any action until unlocked via `POST /agent/{agent_id}/unlock/`.   - `timestamps`: `created_at`, `updated_at`.  ### Example  ```http GET /agent/?page=0&per_page=25&online=true HTTP/1.1 Authorization: Bearer <access_token> ```  ```json {   \"page\": 0,   \"per_page\": 25,   \"total_items\": 1,   \"total_pages\": 1,   \"items\": [     {       \"id\": \"e33602da-cb5f-4b5f-9c49-6307b32cfac7\",       \"machine_id\": \"S-1-5-21-1004336348\",       \"host_name\": \"WIN-WORKSTATION-01\",       \"custom_name\": \"Reception desk\",       \"version\": \"1.4.2\",       \"online\": true,       \"approved_at\": \"2024-05-01T09:12:33Z\",       \"last_seen\": \"2024-05-06T12:00:00Z\",       \"lock_reason\": \"key_exp\",       \"locked_at\": \"2024-06-02T12:00:00Z\",       \"timestamps\": {         \"created_at\": \"2024-05-01T09:12:33Z\",         \"updated_at\": \"2024-05-06T12:00:00Z\"       }     }   ] } ```

        :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 machine_id:
        :type machine_id: List[Optional[str]]
        :param custom_name:
        :type custom_name: List[str]
        :param host_name:
        :type host_name: List[str]
        :param domain_name:
        :type domain_name: List[str]
        :param online:
        :type online: bool
        :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_agent_agent_get_serialize(
            page=page,
            per_page=per_page,
            order_by=order_by,
            id=id,
            machine_id=machine_id,
            custom_name=custom_name,
            host_name=host_name,
            domain_name=domain_name,
            online=online,
            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": "PageAgentInfo",
            "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_agent_agent_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,
        machine_id: Optional[List[Optional[Annotated[str, Field(min_length=1, strict=True)]]]] = None,
        custom_name: Optional[List[Annotated[str, Field(min_length=1, strict=True)]]] = None,
        host_name: Optional[List[Annotated[str, Field(min_length=1, strict=True)]]] = None,
        domain_name: Optional[List[Annotated[str, Field(min_length=1, strict=True)]]] = None,
        online: Optional[StrictBool] = 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[PageAgentInfo]:
        """List Agent

        # List agents  Fetch a paginated list of all known and **registered** agents.  Most filters accept multiple entries. Values supplied for the same field are combined with an **OR**; values supplied for different fields are combined with an **AND**.  > Unregistered (not-yet-approved) agents are not returned here. Use > `GET /agent/unregistered/` to list agents awaiting approval, then call > `POST /agent/{agent_id}/approve/` to register one.  **Endpoint**: `GET /agent/`  **Auth**: requires an authenticated user.  ## Query parameters - `page` (int, default 0): Zero-based page index. - `per_page` (int, default 25, max 50): Page size. - `order_by` (list[str]): Optional sort fields forwarded to the backend. - `id` (list[uuid]): Filter by one or more agent ids. - `machine_id` (list[string]): Filter by one or more machine ids. - `custom_name` (list[string]): Filter by one or more user-defined names. - `host_name` (list[string]): Filter by one or more host names. - `online` (bool): Filter by current connectivity state.  ## Response `200 OK` with a `Page[AgentInfo]` body: - `page`, `per_page`, `total_items`, `total_pages`: Pagination metadata. - `items`: Array of agents with fields:   - `id` (uuid): Agent identifier.   - `machine_id` (string): Stable hardware/machine identifier.   - `host_name` (string): Reported host name.   - `custom_name` (string, nullable): User-defined display name.   - `version` (string, nullable): Agent software version.   - `online` (bool, nullable): Whether the agent is currently connected.   - `approved_at` (datetime, nullable): When the agent was approved/registered. `null` while unregistered.   - `last_seen` (datetime): Last time the agent contacted the system.   - `lock_reason` (string, nullable): Reason the agent is locked. By default this reflects the keypair credentials expiration. See `POST /agent/{agent_id}/lock/`.   - `locked_at` (datetime, nullable): When the agent was locked. By default this reflects the keypair credentials expiration. A locked agent cannot perform any action until unlocked via `POST /agent/{agent_id}/unlock/`.   - `timestamps`: `created_at`, `updated_at`.  ### Example  ```http GET /agent/?page=0&per_page=25&online=true HTTP/1.1 Authorization: Bearer <access_token> ```  ```json {   \"page\": 0,   \"per_page\": 25,   \"total_items\": 1,   \"total_pages\": 1,   \"items\": [     {       \"id\": \"e33602da-cb5f-4b5f-9c49-6307b32cfac7\",       \"machine_id\": \"S-1-5-21-1004336348\",       \"host_name\": \"WIN-WORKSTATION-01\",       \"custom_name\": \"Reception desk\",       \"version\": \"1.4.2\",       \"online\": true,       \"approved_at\": \"2024-05-01T09:12:33Z\",       \"last_seen\": \"2024-05-06T12:00:00Z\",       \"lock_reason\": \"key_exp\",       \"locked_at\": \"2024-06-02T12:00:00Z\",       \"timestamps\": {         \"created_at\": \"2024-05-01T09:12:33Z\",         \"updated_at\": \"2024-05-06T12:00:00Z\"       }     }   ] } ```

        :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 machine_id:
        :type machine_id: List[Optional[str]]
        :param custom_name:
        :type custom_name: List[str]
        :param host_name:
        :type host_name: List[str]
        :param domain_name:
        :type domain_name: List[str]
        :param online:
        :type online: bool
        :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_agent_agent_get_serialize(
            page=page,
            per_page=per_page,
            order_by=order_by,
            id=id,
            machine_id=machine_id,
            custom_name=custom_name,
            host_name=host_name,
            domain_name=domain_name,
            online=online,
            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": "PageAgentInfo",
            "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_agent_agent_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,
        machine_id: Optional[List[Optional[Annotated[str, Field(min_length=1, strict=True)]]]] = None,
        custom_name: Optional[List[Annotated[str, Field(min_length=1, strict=True)]]] = None,
        host_name: Optional[List[Annotated[str, Field(min_length=1, strict=True)]]] = None,
        domain_name: Optional[List[Annotated[str, Field(min_length=1, strict=True)]]] = None,
        online: Optional[StrictBool] = 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 Agent

        # List agents  Fetch a paginated list of all known and **registered** agents.  Most filters accept multiple entries. Values supplied for the same field are combined with an **OR**; values supplied for different fields are combined with an **AND**.  > Unregistered (not-yet-approved) agents are not returned here. Use > `GET /agent/unregistered/` to list agents awaiting approval, then call > `POST /agent/{agent_id}/approve/` to register one.  **Endpoint**: `GET /agent/`  **Auth**: requires an authenticated user.  ## Query parameters - `page` (int, default 0): Zero-based page index. - `per_page` (int, default 25, max 50): Page size. - `order_by` (list[str]): Optional sort fields forwarded to the backend. - `id` (list[uuid]): Filter by one or more agent ids. - `machine_id` (list[string]): Filter by one or more machine ids. - `custom_name` (list[string]): Filter by one or more user-defined names. - `host_name` (list[string]): Filter by one or more host names. - `online` (bool): Filter by current connectivity state.  ## Response `200 OK` with a `Page[AgentInfo]` body: - `page`, `per_page`, `total_items`, `total_pages`: Pagination metadata. - `items`: Array of agents with fields:   - `id` (uuid): Agent identifier.   - `machine_id` (string): Stable hardware/machine identifier.   - `host_name` (string): Reported host name.   - `custom_name` (string, nullable): User-defined display name.   - `version` (string, nullable): Agent software version.   - `online` (bool, nullable): Whether the agent is currently connected.   - `approved_at` (datetime, nullable): When the agent was approved/registered. `null` while unregistered.   - `last_seen` (datetime): Last time the agent contacted the system.   - `lock_reason` (string, nullable): Reason the agent is locked. By default this reflects the keypair credentials expiration. See `POST /agent/{agent_id}/lock/`.   - `locked_at` (datetime, nullable): When the agent was locked. By default this reflects the keypair credentials expiration. A locked agent cannot perform any action until unlocked via `POST /agent/{agent_id}/unlock/`.   - `timestamps`: `created_at`, `updated_at`.  ### Example  ```http GET /agent/?page=0&per_page=25&online=true HTTP/1.1 Authorization: Bearer <access_token> ```  ```json {   \"page\": 0,   \"per_page\": 25,   \"total_items\": 1,   \"total_pages\": 1,   \"items\": [     {       \"id\": \"e33602da-cb5f-4b5f-9c49-6307b32cfac7\",       \"machine_id\": \"S-1-5-21-1004336348\",       \"host_name\": \"WIN-WORKSTATION-01\",       \"custom_name\": \"Reception desk\",       \"version\": \"1.4.2\",       \"online\": true,       \"approved_at\": \"2024-05-01T09:12:33Z\",       \"last_seen\": \"2024-05-06T12:00:00Z\",       \"lock_reason\": \"key_exp\",       \"locked_at\": \"2024-06-02T12:00:00Z\",       \"timestamps\": {         \"created_at\": \"2024-05-01T09:12:33Z\",         \"updated_at\": \"2024-05-06T12:00:00Z\"       }     }   ] } ```

        :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 machine_id:
        :type machine_id: List[Optional[str]]
        :param custom_name:
        :type custom_name: List[str]
        :param host_name:
        :type host_name: List[str]
        :param domain_name:
        :type domain_name: List[str]
        :param online:
        :type online: bool
        :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_agent_agent_get_serialize(
            page=page,
            per_page=per_page,
            order_by=order_by,
            id=id,
            machine_id=machine_id,
            custom_name=custom_name,
            host_name=host_name,
            domain_name=domain_name,
            online=online,
            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": "PageAgentInfo",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        return response_data.response

    def _list_agent_agent_get_serialize(
        self,
        page,
        per_page,
        order_by,
        id,
        machine_id,
        custom_name,
        host_name,
        domain_name,
        online,
        cbe_user_org_id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            "order_by": "multi",
            "id": "multi",
            "machine_id": "multi",
            "custom_name": "multi",
            "host_name": "multi",
            "domain_name": "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 machine_id is not None:
            _query_params.append(("machine_id", machine_id))

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

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

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

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

        # 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="/agent/",
            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 lock_agent_agent_agent_id_lock_post(
        self,
        agent_id: UUID,
        agent_lock: AgentLock,
        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,
    ) -> None:
        """Lock Agent

        # Lock agent  \"Block\" an agent in the system. A locked agent is forbidden from performing any action, but its data is preserved and the agent is **not** deleted; it can be re-enabled later via `POST /agent/{agent_id}/unlock/`.  Every agent carries `locked_at` and `lock_reason` properties. By default these reflect the keypair credentials expiration: the value is updated automatically when the agent detects its key is about to expire. An agent that stays offline for too long is also locked automatically, and must then be unlocked manually.  This endpoint locks the agent explicitly with a custom reason.  **Endpoint**: `POST /agent/{agent_id}/lock/`  **Auth**: requires an authenticated user.  ## Path parameter - `agent_id` (uuid, required): Identifier of the agent to lock.  ## Request body (AgentLock) - `lock_reason` (string, required): Non-empty human-readable reason for locking the agent. Stored on the agent's `lock_reason` property.  ## Response - `204 No Content`: The agent was locked.  ### Example  ```http POST /agent/e33602da-cb5f-4b5f-9c49-6307b32cfac7/lock/ HTTP/1.1 Authorization: Bearer <access_token> Content-Type: application/json  {   \"lock_reason\": \"Decommissioned workstation\" } ```

        :param agent_id: (required)
        :type agent_id: UUID
        :param agent_lock: (required)
        :type agent_lock: AgentLock
        :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._lock_agent_agent_agent_id_lock_post_serialize(
            agent_id=agent_id,
            agent_lock=agent_lock,
            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]] = {
            "204": None,
            "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 lock_agent_agent_agent_id_lock_post_with_http_info(
        self,
        agent_id: UUID,
        agent_lock: AgentLock,
        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[None]:
        """Lock Agent

        # Lock agent  \"Block\" an agent in the system. A locked agent is forbidden from performing any action, but its data is preserved and the agent is **not** deleted; it can be re-enabled later via `POST /agent/{agent_id}/unlock/`.  Every agent carries `locked_at` and `lock_reason` properties. By default these reflect the keypair credentials expiration: the value is updated automatically when the agent detects its key is about to expire. An agent that stays offline for too long is also locked automatically, and must then be unlocked manually.  This endpoint locks the agent explicitly with a custom reason.  **Endpoint**: `POST /agent/{agent_id}/lock/`  **Auth**: requires an authenticated user.  ## Path parameter - `agent_id` (uuid, required): Identifier of the agent to lock.  ## Request body (AgentLock) - `lock_reason` (string, required): Non-empty human-readable reason for locking the agent. Stored on the agent's `lock_reason` property.  ## Response - `204 No Content`: The agent was locked.  ### Example  ```http POST /agent/e33602da-cb5f-4b5f-9c49-6307b32cfac7/lock/ HTTP/1.1 Authorization: Bearer <access_token> Content-Type: application/json  {   \"lock_reason\": \"Decommissioned workstation\" } ```

        :param agent_id: (required)
        :type agent_id: UUID
        :param agent_lock: (required)
        :type agent_lock: AgentLock
        :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._lock_agent_agent_agent_id_lock_post_serialize(
            agent_id=agent_id,
            agent_lock=agent_lock,
            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]] = {
            "204": None,
            "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 lock_agent_agent_agent_id_lock_post_without_preload_content(
        self,
        agent_id: UUID,
        agent_lock: AgentLock,
        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:
        """Lock Agent

        # Lock agent  \"Block\" an agent in the system. A locked agent is forbidden from performing any action, but its data is preserved and the agent is **not** deleted; it can be re-enabled later via `POST /agent/{agent_id}/unlock/`.  Every agent carries `locked_at` and `lock_reason` properties. By default these reflect the keypair credentials expiration: the value is updated automatically when the agent detects its key is about to expire. An agent that stays offline for too long is also locked automatically, and must then be unlocked manually.  This endpoint locks the agent explicitly with a custom reason.  **Endpoint**: `POST /agent/{agent_id}/lock/`  **Auth**: requires an authenticated user.  ## Path parameter - `agent_id` (uuid, required): Identifier of the agent to lock.  ## Request body (AgentLock) - `lock_reason` (string, required): Non-empty human-readable reason for locking the agent. Stored on the agent's `lock_reason` property.  ## Response - `204 No Content`: The agent was locked.  ### Example  ```http POST /agent/e33602da-cb5f-4b5f-9c49-6307b32cfac7/lock/ HTTP/1.1 Authorization: Bearer <access_token> Content-Type: application/json  {   \"lock_reason\": \"Decommissioned workstation\" } ```

        :param agent_id: (required)
        :type agent_id: UUID
        :param agent_lock: (required)
        :type agent_lock: AgentLock
        :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._lock_agent_agent_agent_id_lock_post_serialize(
            agent_id=agent_id,
            agent_lock=agent_lock,
            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]] = {
            "204": None,
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        return response_data.response

    def _lock_agent_agent_agent_id_lock_post_serialize(
        self,
        agent_id,
        agent_lock,
        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 agent_id is not None:
            _path_params["agent_id"] = agent_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
        if agent_lock is not None:
            _body_params = agent_lock

        # 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="/agent/{agent_id}/lock/",
            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 unlock_agent_agent_agent_id_unlock_post(
        self,
        agent_id: UUID,
        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,
    ) -> None:
        """Unlock Agent

        # Unlock agent  Unlock an agent that has previously been locked, allowing it back into the system so it can perform actions again. This clears the lock set either explicitly via `POST /agent/{agent_id}/lock/` or automatically (for example when the agent has been offline for too long, or its keypair credentials were about to expire).  **Endpoint**: `POST /agent/{agent_id}/unlock/`  **Auth**: requires an authenticated user.  ## Path parameter - `agent_id` (uuid, required): Identifier of the locked agent to unlock.  ## Response - `204 No Content`: The agent was unlocked.  ### Example  ```http POST /agent/e33602da-cb5f-4b5f-9c49-6307b32cfac7/unlock/ HTTP/1.1 Authorization: Bearer <access_token> ```

        :param agent_id: (required)
        :type agent_id: UUID
        :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._unlock_agent_agent_agent_id_unlock_post_serialize(
            agent_id=agent_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]] = {
            "204": None,
            "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 unlock_agent_agent_agent_id_unlock_post_with_http_info(
        self,
        agent_id: UUID,
        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[None]:
        """Unlock Agent

        # Unlock agent  Unlock an agent that has previously been locked, allowing it back into the system so it can perform actions again. This clears the lock set either explicitly via `POST /agent/{agent_id}/lock/` or automatically (for example when the agent has been offline for too long, or its keypair credentials were about to expire).  **Endpoint**: `POST /agent/{agent_id}/unlock/`  **Auth**: requires an authenticated user.  ## Path parameter - `agent_id` (uuid, required): Identifier of the locked agent to unlock.  ## Response - `204 No Content`: The agent was unlocked.  ### Example  ```http POST /agent/e33602da-cb5f-4b5f-9c49-6307b32cfac7/unlock/ HTTP/1.1 Authorization: Bearer <access_token> ```

        :param agent_id: (required)
        :type agent_id: UUID
        :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._unlock_agent_agent_agent_id_unlock_post_serialize(
            agent_id=agent_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]] = {
            "204": None,
            "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 unlock_agent_agent_agent_id_unlock_post_without_preload_content(
        self,
        agent_id: UUID,
        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:
        """Unlock Agent

        # Unlock agent  Unlock an agent that has previously been locked, allowing it back into the system so it can perform actions again. This clears the lock set either explicitly via `POST /agent/{agent_id}/lock/` or automatically (for example when the agent has been offline for too long, or its keypair credentials were about to expire).  **Endpoint**: `POST /agent/{agent_id}/unlock/`  **Auth**: requires an authenticated user.  ## Path parameter - `agent_id` (uuid, required): Identifier of the locked agent to unlock.  ## Response - `204 No Content`: The agent was unlocked.  ### Example  ```http POST /agent/e33602da-cb5f-4b5f-9c49-6307b32cfac7/unlock/ HTTP/1.1 Authorization: Bearer <access_token> ```

        :param agent_id: (required)
        :type agent_id: UUID
        :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._unlock_agent_agent_agent_id_unlock_post_serialize(
            agent_id=agent_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]] = {
            "204": None,
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        return response_data.response

    def _unlock_agent_agent_agent_id_unlock_post_serialize(
        self,
        agent_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 agent_id is not None:
            _path_params["agent_id"] = agent_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="POST",
            resource_path="/agent/{agent_id}/unlock/",
            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_agent_agent_agent_id_put(
        self,
        agent_id: UUID,
        agent_update: AgentUpdate,
        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,
    ) -> object:
        """Update Agent


        :param agent_id: (required)
        :type agent_id: UUID
        :param agent_update: (required)
        :type agent_update: AgentUpdate
        :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._update_agent_agent_agent_id_put_serialize(
            agent_id=agent_id,
            agent_update=agent_update,
            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": "object",
            "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 update_agent_agent_agent_id_put_with_http_info(
        self,
        agent_id: UUID,
        agent_update: AgentUpdate,
        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[object]:
        """Update Agent


        :param agent_id: (required)
        :type agent_id: UUID
        :param agent_update: (required)
        :type agent_update: AgentUpdate
        :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._update_agent_agent_agent_id_put_serialize(
            agent_id=agent_id,
            agent_update=agent_update,
            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": "object",
            "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 update_agent_agent_agent_id_put_without_preload_content(
        self,
        agent_id: UUID,
        agent_update: AgentUpdate,
        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:
        """Update Agent


        :param agent_id: (required)
        :type agent_id: UUID
        :param agent_update: (required)
        :type agent_update: AgentUpdate
        :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._update_agent_agent_agent_id_put_serialize(
            agent_id=agent_id,
            agent_update=agent_update,
            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": "object",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        return response_data.response

    def _update_agent_agent_agent_id_put_serialize(
        self,
        agent_id,
        agent_update,
        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 agent_id is not None:
            _path_params["agent_id"] = agent_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
        if agent_update is not None:
            _body_params = agent_update

        # 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="PUT",
            resource_path="/agent/{agent_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,
        )
