Skip to content

put_table_record_expiration_configuration async

put_table_record_expiration_configuration(
    table_arn: TableARN,
    value: TableRecordExpirationConfigurationValue,
    *,
    config_overrides: Optional[AsyncS3TablesClientConfig] = None,
) -> None

Creates or updates the expiration configuration settings for records in a table, including the status of the configuration. If you enable record expiration for a table, records expire and are automatically removed from the table after the number of days that you specify.

Permissions

You must have the s3tables:PutTableRecordExpirationConfiguration permission to use this operation.

Parameters:

  • table_arn (TableARN) –

    The Amazon Resource Name (ARN) of the table.

  • value (TableRecordExpirationConfigurationValue) –

    The record expiration configuration to apply to the table, including the status (enabled or disabled) and retention period in days.

Raises:

Source code in docs_src/capo_s3tables/_services/async_s3_tables.py
async def put_table_record_expiration_configuration(
    self,
    table_arn: "capo_s3tables.types.table_arn.TableARN",
    value: "capo_s3tables.types.table_record_expiration_configuration_value.TableRecordExpirationConfigurationValue",
    *,
    config_overrides: Optional[AsyncS3TablesClientConfig] = None,
) -> None:
    """<p>Creates or updates the expiration configuration settings for records in a table, including the status of the configuration. If you enable record expiration for a table, records expire and are automatically removed from the table after the number of days that you specify.</p> <dl> <dt>Permissions</dt> <dd> <p>You must have the <code>s3tables:PutTableRecordExpirationConfiguration</code> permission to use this operation.</p> </dd> </dl>

    Args:
        table_arn: <p>The Amazon Resource Name (ARN) of the table.</p>
        value: <p>The record expiration configuration to apply to the table, including the status (<code>enabled</code> or <code>disabled</code>) and retention period in days.</p>

    Raises:
        capo_s3tables.errors.bad_request_exception.BadRequestException: <p>The request is invalid or malformed.</p>
        capo_s3tables.errors.forbidden_exception.ForbiddenException: <p>The caller isn't authorized to make the request.</p>
        capo_s3tables.errors.internal_server_error_exception.InternalServerErrorException: <p>The request failed due to an internal server error.</p>
        capo_s3tables.errors.method_not_allowed_exception.MethodNotAllowedException: <p>The requested operation is not allowed on this resource. This may occur when attempting to modify a resource that is managed by a service or has restrictions that prevent the operation.</p>
        capo_s3tables.errors.not_found_exception.NotFoundException: <p>The request was rejected because the specified resource could not be found.</p>
        capo_s3tables.errors.too_many_requests_exception.TooManyRequestsException: <p>The limit on the number of requests per second was exceeded.</p>
        capo_s3tables.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_s3tables.types.put_table_record_expiration_configuration_request.PutTableRecordExpirationConfigurationRequest]",
    ) -> AsyncOperationResponse[None]:
        import capo_s3tables._operations.s3_table_buckets.put_table_record_expiration_configuration

        (
            output,
            http_response,
        ) = await capo_s3tables._operations.s3_table_buckets.put_table_record_expiration_configuration.async_put_table_record_expiration_configuration(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutTableRecordExpirationConfiguration")
    )
    input_: capo_s3tables.types.put_table_record_expiration_configuration_request.PutTableRecordExpirationConfigurationRequest = {
        "table_arn": table_arn,
        "value": value,
    }

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