putChannelPolicy method

Future<void> putChannelPolicy({
  1. required String channelGroupName,
  2. required String channelName,
  3. required String policy,
})

Attaches an IAM policy to the specified channel. With policies, you can specify who has access to AWS resources and what actions they can perform on those resources. You can attach only one policy with each request.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter channelGroupName : The name that describes the channel group. The name is the primary identifier for the channel group, and must be unique for your account in the AWS Region.

Parameter channelName : The name that describes the channel. The name is the primary identifier for the channel, and must be unique for your account in the AWS Region and channel group.

Parameter policy : The policy to attach to the specified channel.

Implementation

Future<void> putChannelPolicy({
  required String channelGroupName,
  required String channelName,
  required String policy,
}) async {
  final $payload = <String, dynamic>{
    'Policy': policy,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri:
        '/channelGroup/${Uri.encodeComponent(channelGroupName)}/channel/${Uri.encodeComponent(channelName)}/policy',
    exceptionFnMap: _exceptionFns,
  );
}