Skip to content

update_finding async

update_finding(
    finding_id: str,
    agent_space_id: str,
    *,
    config_overrides: Optional[AsyncSecurityAgentClientConfig] = None,
    name: Optional[str] = None,
    description: Optional[str] = None,
    risk_type: Optional[str] = None,
    risk_level: Optional[RiskLevel] = None,
    risk_score: Optional[str] = None,
    attack_script: Optional[str] = None,
    reasoning: Optional[str] = None,
    status: Optional[FindingStatus] = None,
    customer_note: Optional[str] = None,
) -> UpdateFindingOutput

Updates the status or risk level of a security finding.

Parameters:

  • finding_id (str) –

    The unique identifier of the finding to update.

  • agent_space_id (str) –

    The unique identifier of the agent space that contains the finding.

  • name (Optional[str], default: None ) –

    The updated name for the finding.

  • description (Optional[str], default: None ) –

    The updated description for the finding.

  • risk_type (Optional[str], default: None ) –

    The updated risk type for the finding.

  • risk_level (Optional[RiskLevel], default: None ) –

    The updated risk level for the finding.

  • risk_score (Optional[str], default: None ) –

    The updated numerical risk score for the finding.

  • attack_script (Optional[str], default: None ) –

    The updated attack script for the finding.

  • reasoning (Optional[str], default: None ) –

    The updated reasoning for the finding.

  • status (Optional[FindingStatus], default: None ) –

    The updated status for the finding.

  • customer_note (Optional[str], default: None ) –

    A customer-provided note on the finding.

Raises:

Source code in docs_src/capo_securityagent/_services/async_security_agent.py
async def update_finding(
    self,
    finding_id: str,
    agent_space_id: str,
    *,
    config_overrides: Optional[AsyncSecurityAgentClientConfig] = None,
    name: Optional[str] = None,
    description: Optional[str] = None,
    risk_type: Optional[str] = None,
    risk_level: Optional["capo_securityagent.types.risk_level.RiskLevel"] = None,
    risk_score: Optional[str] = None,
    attack_script: Optional[str] = None,
    reasoning: Optional[str] = None,
    status: Optional[
        "capo_securityagent.types.finding_status.FindingStatus"
    ] = None,
    customer_note: Optional[str] = None,
) -> "capo_securityagent.types.update_finding_output.UpdateFindingOutput":
    """<p>Updates the status or risk level of a security finding.</p>

    Args:
        finding_id: <p>The unique identifier of the finding to update.</p>
        agent_space_id: <p>The unique identifier of the agent space that contains the finding.</p>
        name: <p>The updated name for the finding.</p>
        description: <p>The updated description for the finding.</p>
        risk_type: <p>The updated risk type for the finding.</p>
        risk_level: <p>The updated risk level for the finding.</p>
        risk_score: <p>The updated numerical risk score for the finding.</p>
        attack_script: <p>The updated attack script for the finding.</p>
        reasoning: <p>The updated reasoning for the finding.</p>
        status: <p>The updated status for the finding.</p>
        customer_note: <p>A customer-provided note on the finding.</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.update_finding_input.UpdateFindingInput]",
    ) -> AsyncOperationResponse[
        "capo_securityagent.types.update_finding_output.UpdateFindingOutput"
    ]:
        import capo_securityagent._operations.security_agent.update_finding

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateFinding")
    )
    input_: capo_securityagent.types.update_finding_input.UpdateFindingInput = {
        "finding_id": finding_id,
        "agent_space_id": agent_space_id,
    }
    if name is not None:
        input_["name"] = name
    if description is not None:
        input_["description"] = description
    if risk_type is not None:
        input_["risk_type"] = risk_type
    if risk_level is not None:
        input_["risk_level"] = risk_level
    if risk_score is not None:
        input_["risk_score"] = risk_score
    if attack_script is not None:
        input_["attack_script"] = attack_script
    if reasoning is not None:
        input_["reasoning"] = reasoning
    if status is not None:
        input_["status"] = status
    if customer_note is not None:
        input_["customer_note"] = customer_note

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