updateChannel method
Update a channel's attributes.
Restriction: You can't change a channel's privacy.
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 metadata :
The metadata for the update request.
Parameter mode :
The mode of the update request.
Parameter name :
The name of the channel.
Implementation
Future<UpdateChannelResponse> updateChannel({
required String channelArn,
required String chimeBearer,
String? metadata,
ChannelMode? mode,
String? name,
}) async {
final headers = <String, String>{
'x-amz-chime-bearer': chimeBearer.toString(),
};
final $payload = <String, dynamic>{
if (metadata != null) 'Metadata': metadata,
if (mode != null) 'Mode': mode.value,
if (name != null) 'Name': name,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri: '/channels/${Uri.encodeComponent(channelArn)}',
headers: headers,
exceptionFnMap: _exceptionFns,
);
return UpdateChannelResponse.fromJson(response);
}