putChannelExpirationSettings method
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-bearerrequest header is mandatory. Use the ARN of theAppInstanceUserorAppInstanceBotthat makes the API call as the value in the header.
May throw BadRequestException.
May throw ConflictException.
May throw ForbiddenException.
May throw ServiceFailureException.
May throw ServiceUnavailableException.
May throw ThrottledClientException.
May throw UnauthorizedClientException.
Parameter channelArn :
The ARN of the channel.
Parameter chimeBearer :
The ARN of the AppInstanceUser or AppInstanceBot
that makes the API call.
Parameter expirationSettings :
Settings that control the interval after which a channel is deleted.
Implementation
Future<PutChannelExpirationSettingsResponse> putChannelExpirationSettings({
required String channelArn,
String? chimeBearer,
ExpirationSettings? expirationSettings,
}) async {
final headers = <String, String>{
if (chimeBearer != null) 'x-amz-chime-bearer': chimeBearer.toString(),
};
final $payload = <String, dynamic>{
if (expirationSettings != null) 'ExpirationSettings': expirationSettings,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri:
'/channels/${Uri.encodeComponent(channelArn)}/expiration-settings',
headers: headers,
exceptionFnMap: _exceptionFns,
);
return PutChannelExpirationSettingsResponse.fromJson(response);
}