deleteChannelMembership method
Removes a member from a channel.
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 from which you want to remove the user.
Parameter chimeBearer :
The ARN of the AppInstanceUser or AppInstanceBot
that makes the API call.
Parameter memberArn :
The AppInstanceUserArn of the member that you're removing
from the channel.
Parameter subChannelId :
The ID of the SubChannel in the request.
Implementation
Future<void> deleteChannelMembership({
required String channelArn,
required String chimeBearer,
required String memberArn,
String? subChannelId,
}) async {
final headers = <String, String>{
'x-amz-chime-bearer': chimeBearer.toString(),
};
final $query = <String, List<String>>{
if (subChannelId != null) 'sub-channel-id': [subChannelId],
};
await _protocol.send(
payload: null,
method: 'DELETE',
requestUri:
'/channels/${Uri.encodeComponent(channelArn)}/memberships/${Uri.encodeComponent(memberArn)}',
queryParams: $query,
headers: headers,
exceptionFnMap: _exceptionFns,
);
}