Skip to content

update_resource_profile async

update_resource_profile(
    *,
    config_overrides: Optional[AsyncMacie2ClientConfig] = None,
    resource_arn: Optional[__string] = None,
    sensitivity_score_override: Optional[__integer] = None,
) -> UpdateResourceProfileResponse

Updates the sensitivity score for an S3 bucket.

Parameters:

  • resource_arn (Optional[__string], default: None ) –

    The Amazon Resource Name (ARN) of the S3 bucket that the request applies to.

  • sensitivity_score_override (Optional[__integer], default: None ) –

    The new sensitivity score for the bucket. Valid values are: 100, assign the maximum score and apply the Sensitive label to the bucket; and, null (empty), assign a score that Amazon Macie calculates automatically after you submit the request.

Raises:

  • AccessDeniedException –

    Provides information about an error that occurred due to insufficient access to a specified resource.

  • InternalServerException –

    Provides information about an error that occurred due to an unknown internal server error, exception, or failure.

  • ResourceNotFoundException –

    Provides information about an error that occurred because a specified resource wasn't found.

  • ServiceQuotaExceededException –

    Provides information about an error that occurred due to one or more service quotas for an account.

  • ThrottlingException –

    Provides information about an error that occurred because too many requests were sent during a certain amount of time.

  • ValidationException –

    Provides information about an error that occurred due to a syntax error in a request.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_macie2/_services/async_macie2.py
async def update_resource_profile(
    self,
    *,
    config_overrides: Optional[AsyncMacie2ClientConfig] = None,
    resource_arn: Optional["capo_macie2.types.__string.__string"] = None,
    sensitivity_score_override: Optional[
        "capo_macie2.types.__integer.__integer"
    ] = None,
) -> "capo_macie2.types.update_resource_profile_response.UpdateResourceProfileResponse":
    """<p>Updates the sensitivity score for an S3 bucket.</p>

    Args:
        resource_arn: <p>The Amazon Resource Name (ARN) of the S3 bucket that the request applies to.</p>
        sensitivity_score_override: <p>The new sensitivity score for the bucket. Valid values are: 100, assign the maximum score and apply the <i>Sensitive</i> label to the bucket; and, null (empty), assign a score that Amazon Macie calculates automatically after you submit the request.</p>

    Raises:
        capo_macie2.errors.access_denied_exception.AccessDeniedException: <p>Provides information about an error that occurred due to insufficient access to a specified resource.</p>
        capo_macie2.errors.internal_server_exception.InternalServerException: <p>Provides information about an error that occurred due to an unknown internal server error, exception, or failure.</p>
        capo_macie2.errors.resource_not_found_exception.ResourceNotFoundException: <p>Provides information about an error that occurred because a specified resource wasn't found.</p>
        capo_macie2.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>Provides information about an error that occurred due to one or more service quotas for an account.</p>
        capo_macie2.errors.throttling_exception.ThrottlingException: <p>Provides information about an error that occurred because too many requests were sent during a certain amount of time.</p>
        capo_macie2.errors.validation_exception.ValidationException: <p>Provides information about an error that occurred due to a syntax error in a request.</p>
        capo_macie2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_macie2.types.update_resource_profile_request.UpdateResourceProfileRequest]",
    ) -> AsyncOperationResponse[
        "capo_macie2.types.update_resource_profile_response.UpdateResourceProfileResponse"
    ]:
        import capo_macie2._operations.macie2.update_resource_profile

        (
            output,
            http_response,
        ) = await capo_macie2._operations.macie2.update_resource_profile.async_update_resource_profile(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateResourceProfile")
    )
    input_: capo_macie2.types.update_resource_profile_request.UpdateResourceProfileRequest = {}
    if resource_arn is not None:
        input_["resource_arn"] = resource_arn
    if sensitivity_score_override is not None:
        input_["sensitivity_score_override"] = sensitivity_score_override

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