Skip to content

batch_get_threat_models

batch_get_threat_models(
    threat_model_ids: ThreatModelIdList,
    agent_space_id: str,
    *,
    config_overrides: Optional[SecurityAgentClientConfig] = None,
) -> BatchGetThreatModelsOutput

Retrieves information about one or more threat models in an agent space.

Parameters:

  • threat_model_ids (ThreatModelIdList) –

    The list of threat model identifiers to retrieve.

  • agent_space_id (str) –

    The unique identifier of the agent space that contains the threat models.

Raises:

Source code in docs_src/capo_securityagent/_services/security_agent.py
def batch_get_threat_models(
    self,
    threat_model_ids: "capo_securityagent.types.threat_model_id_list.ThreatModelIdList",
    agent_space_id: str,
    *,
    config_overrides: Optional[SecurityAgentClientConfig] = None,
) -> "capo_securityagent.types.batch_get_threat_models_output.BatchGetThreatModelsOutput":
    """<p>Retrieves information about one or more threat models in an agent space.</p>

    Args:
        threat_model_ids: <p>The list of threat model identifiers to retrieve.</p>
        agent_space_id: <p>The unique identifier of the agent space that contains the threat models.</p>

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

    def _handler(
        req: "OperationRequest[capo_securityagent.types.batch_get_threat_models_input.BatchGetThreatModelsInput]",
    ) -> OperationResponse[
        "capo_securityagent.types.batch_get_threat_models_output.BatchGetThreatModelsOutput"
    ]:
        import capo_securityagent._operations.security_agent.batch_get_threat_models

        output, http_response = (
            capo_securityagent._operations.security_agent.batch_get_threat_models.batch_get_threat_models(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_securityagent.types.batch_get_threat_models_output.BatchGetThreatModelsOutput",
    ) -> dict[str, Any]:
        import capo_securityagent.types.batch_get_threat_models_output

        return capo_securityagent.types.batch_get_threat_models_output.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("BatchGetThreatModels", redact_output=_redact_output),
    )
    input_: capo_securityagent.types.batch_get_threat_models_input.BatchGetThreatModelsInput = {
        "threat_model_ids": threat_model_ids,
        "agent_space_id": agent_space_id,
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output