updateChannel method
Future<void>
updateChannel({
- required String channelName,
- ChannelStorage? channelStorage,
- RetentionPeriod? retentionPeriod,
Updates the settings of a channel.
May throw InvalidRequestException. May throw ResourceNotFoundException. May throw InternalFailureException. May throw ServiceUnavailableException. May throw ThrottlingException.
Parameter channelName :
The name of the channel to be updated.
Parameter channelStorage :
Where channel data is stored. You can choose one of
serviceManagedS3 or customerManagedS3 storage.
If not specified, the default is serviceManagedS3. You cannot
change this storage option after the channel is created.
Parameter retentionPeriod :
How long, in days, message data is kept for the channel. The retention
period cannot be updated if the channel's S3 storage is customer-managed.
Implementation
Future<void> updateChannel({
required String channelName,
ChannelStorage? channelStorage,
RetentionPeriod? retentionPeriod,
}) async {
ArgumentError.checkNotNull(channelName, 'channelName');
_s.validateStringLength(
'channelName',
channelName,
1,
128,
isRequired: true,
);
final $payload = <String, dynamic>{
if (channelStorage != null) 'channelStorage': channelStorage,
if (retentionPeriod != null) 'retentionPeriod': retentionPeriod,
};
await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri: '/channels/${Uri.encodeComponent(channelName)}',
exceptionFnMap: _exceptionFns,
);
}