Skip to content

put_channel_expiration_settings async

put_channel_expiration_settings(
    channel_arn: ChimeArn,
    *,
    config_overrides: Optional[AsyncChimeSDKMessagingClientConfig] = None,
    chime_bearer: Optional[ChimeArn] = None,
    expiration_settings: Optional[ExpirationSettings] = None,
) -> PutChannelExpirationSettingsResponse

Sets the number of days before the channel is automatically deleted.

  • A background process deletes expired channels within 6 hours of expiration. Actual deletion times may vary.

  • Expired channels that have not yet been deleted appear as active, and you can update their expiration settings. The system honors the new settings.

  • The x-amz-chime-bearer request header is mandatory. Use the ARN of the AppInstanceUser or AppInstanceBot that makes the API call as the value in the header.

Parameters:

  • channel_arn (ChimeArn) –

    The ARN of the channel.

  • chime_bearer (Optional[ChimeArn], default: None ) –

    The ARN of the AppInstanceUser or AppInstanceBot that makes the API call.

  • expiration_settings (Optional[ExpirationSettings], default: None ) –

    Settings that control the interval after which a channel is deleted.

Raises:

Source code in docs_src/capo_chime_sdk_messaging/_services/async_chime_sdk_messaging.py
async def put_channel_expiration_settings(
    self,
    channel_arn: "capo_chime_sdk_messaging.types.chime_arn.ChimeArn",
    *,
    config_overrides: Optional[AsyncChimeSDKMessagingClientConfig] = None,
    chime_bearer: Optional[
        "capo_chime_sdk_messaging.types.chime_arn.ChimeArn"
    ] = None,
    expiration_settings: Optional[
        "capo_chime_sdk_messaging.types.expiration_settings.ExpirationSettings"
    ] = None,
) -> "capo_chime_sdk_messaging.types.put_channel_expiration_settings_response.PutChannelExpirationSettingsResponse":
    """<p>Sets the number of days before the channel is automatically deleted.</p> <note> <ul> <li> <p>A background process deletes expired channels within 6 hours of expiration. Actual deletion times may vary.</p> </li> <li> <p>Expired channels that have not yet been deleted appear as active, and you can update their expiration settings. The system honors the new settings.</p> </li> <li> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call as the value in the header.</p> </li> </ul> </note>

    Args:
        channel_arn: <p>The ARN of the channel.</p>
        chime_bearer: <p>The ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call.</p>
        expiration_settings: <p>Settings that control the interval after which a channel is deleted.</p>

    Raises:
        capo_chime_sdk_messaging.errors.bad_request_exception.BadRequestException: <p>The input parameters don't match the service's restrictions.</p>
        capo_chime_sdk_messaging.errors.conflict_exception.ConflictException: <p>The request could not be processed because of conflict in the current state of the resource.</p>
        capo_chime_sdk_messaging.errors.forbidden_exception.ForbiddenException: <p>The client is permanently forbidden from making the request.</p>
        capo_chime_sdk_messaging.errors.service_failure_exception.ServiceFailureException: <p>The service encountered an unexpected error.</p>
        capo_chime_sdk_messaging.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service is currently unavailable.</p>
        capo_chime_sdk_messaging.errors.throttled_client_exception.ThrottledClientException: <p>The client exceeded its request rate limit.</p>
        capo_chime_sdk_messaging.errors.unauthorized_client_exception.UnauthorizedClientException: <p>The client is not currently authorized to make the request.</p>
        capo_chime_sdk_messaging.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_chime_sdk_messaging.types.put_channel_expiration_settings_request.PutChannelExpirationSettingsRequest]",
    ) -> AsyncOperationResponse[
        "capo_chime_sdk_messaging.types.put_channel_expiration_settings_response.PutChannelExpirationSettingsResponse"
    ]:
        import capo_chime_sdk_messaging._operations.chime_messaging_service.put_channel_expiration_settings

        (
            output,
            http_response,
        ) = await capo_chime_sdk_messaging._operations.chime_messaging_service.put_channel_expiration_settings.async_put_channel_expiration_settings(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutChannelExpirationSettings")
    )
    input_: capo_chime_sdk_messaging.types.put_channel_expiration_settings_request.PutChannelExpirationSettingsRequest = {
        "channel_arn": channel_arn
    }
    if chime_bearer is not None:
        input_["chime_bearer"] = chime_bearer
    if expiration_settings is not None:
        input_["expiration_settings"] = expiration_settings

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