Skip to content

list_threat_models async

list_threat_models(
    agent_space_id: str,
    *,
    config_overrides: Optional[AsyncSecurityAgentClientConfig] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> ListThreatModelsOutput

Returns a paginated list of threat model summaries for the specified agent space.

Parameters:

  • max_results (Optional[MaxResults], default: None ) –

    The maximum number of results to return in a single call.

  • next_token (Optional[NextToken], default: None ) –

    A token to use for paginating results that are returned in the response.

  • agent_space_id (str) –

    The unique identifier of the agent space to list threat models for.

Raises:

Source code in docs_src/capo_securityagent/_services/async_security_agent.py
async def list_threat_models(
    self,
    agent_space_id: str,
    *,
    config_overrides: Optional[AsyncSecurityAgentClientConfig] = None,
    max_results: Optional["capo_securityagent.types.max_results.MaxResults"] = None,
    next_token: Optional["capo_securityagent.types.next_token.NextToken"] = None,
) -> "capo_securityagent.types.list_threat_models_output.ListThreatModelsOutput":
    """<p>Returns a paginated list of threat model summaries for the specified agent space.</p>

    Args:
        max_results: <p>The maximum number of results to return in a single call.</p>
        next_token: <p>A token to use for paginating results that are returned in the response.</p>
        agent_space_id: <p>The unique identifier of the agent space to list threat models for.</p>

    Raises:
        capo_securityagent.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_securityagent.types.list_threat_models_input.ListThreatModelsInput]",
    ) -> AsyncOperationResponse[
        "capo_securityagent.types.list_threat_models_output.ListThreatModelsOutput"
    ]:
        import capo_securityagent._operations.security_agent.list_threat_models

        (
            output,
            http_response,
        ) = await capo_securityagent._operations.security_agent.list_threat_models.async_list_threat_models(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListThreatModels")
    )
    input_: capo_securityagent.types.list_threat_models_input.ListThreatModelsInput = {
        "agent_space_id": agent_space_id
    }
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output