Skip to content

add_attributes_to_findings async

add_attributes_to_findings(
    finding_arns: AddRemoveAttributesFindingArnList,
    attributes: UserAttributeList,
    *,
    config_overrides: Optional[AsyncInspectorClientConfig] = None,
) -> AddAttributesToFindingsResponse

Assigns attributes (key and value pairs) to the findings that are specified by the ARNs of the findings.

Parameters:

Raises:

Examples:

Add attributes to findings Assigns attributes (key and value pairs) to the findings that are specified by the ARNs of the findings.

>>> await client.add_attributes_to_findings(finding_arns=['arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-8l1VIE0D/run/0-Z02cjjug/finding/0-T8yM9mEU'], attributes=[{'key': 'Example', 'value': 'example'}])
Source code in docs_src/capo_inspector/_services/async_inspector.py
async def add_attributes_to_findings(
    self,
    finding_arns: "capo_inspector.types.add_remove_attributes_finding_arn_list.AddRemoveAttributesFindingArnList",
    attributes: "capo_inspector.types.user_attribute_list.UserAttributeList",
    *,
    config_overrides: Optional[AsyncInspectorClientConfig] = None,
) -> "capo_inspector.types.add_attributes_to_findings_response.AddAttributesToFindingsResponse":
    """<p>Assigns attributes (key and value pairs) to the findings that are specified by the ARNs of the findings.</p>

    Args:
        finding_arns: <p>The ARNs that specify the findings that you want to assign attributes to.</p>
        attributes: <p>The array of attributes that you want to assign to specified findings.</p>

    Raises:
        capo_inspector.errors.access_denied_exception.AccessDeniedException: <p>You do not have required permissions to access the requested resource.</p>
        capo_inspector.errors.internal_exception.InternalException: <p>Internal server error.</p>
        capo_inspector.errors.invalid_input_exception.InvalidInputException: <p>The request was rejected because an invalid or out-of-range value was supplied for an input parameter.</p>
        capo_inspector.errors.no_such_entity_exception.NoSuchEntityException: <p>The request was rejected because it referenced an entity that does not exist. The error code describes the entity.</p>
        capo_inspector.errors.service_temporarily_unavailable_exception.ServiceTemporarilyUnavailableException: <p>The serice is temporary unavailable.</p>
        capo_inspector.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Add attributes to findings
        Assigns attributes (key and value pairs) to the findings that are specified by the ARNs of the findings.

        >>> await client.add_attributes_to_findings(finding_arns=['arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-8l1VIE0D/run/0-Z02cjjug/finding/0-T8yM9mEU'], attributes=[{'key': 'Example', 'value': 'example'}])
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_inspector.types.add_attributes_to_findings_request.AddAttributesToFindingsRequest]",
    ) -> AsyncOperationResponse[
        "capo_inspector.types.add_attributes_to_findings_response.AddAttributesToFindingsResponse"
    ]:
        import capo_inspector._operations.inspector_service.add_attributes_to_findings

        (
            output,
            http_response,
        ) = await capo_inspector._operations.inspector_service.add_attributes_to_findings.async_add_attributes_to_findings(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("AddAttributesToFindings")
    )
    input_: capo_inspector.types.add_attributes_to_findings_request.AddAttributesToFindingsRequest = {
        "finding_arns": finding_arns,
        "attributes": attributes,
    }

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