createAppInstanceAdmin method

Future<CreateAppInstanceAdminResponse> createAppInstanceAdmin({
  1. required String appInstanceAdminArn,
  2. required String appInstanceArn,
})

Promotes an AppInstanceUser or AppInstanceBot to an AppInstanceAdmin. The promoted entity can perform the following actions.

  • ChannelModerator actions across all channels in the AppInstance.
  • DeleteChannelMessage actions.
Only an AppInstanceUser and AppInstanceBot can be promoted to an AppInstanceAdmin role.

May throw BadRequestException. May throw ConflictException. May throw ForbiddenException. May throw ResourceLimitExceededException. May throw ServiceFailureException. May throw ServiceUnavailableException. May throw ThrottledClientException. May throw UnauthorizedClientException.

Parameter appInstanceAdminArn : The ARN of the administrator of the current AppInstance.

Parameter appInstanceArn : The ARN of the AppInstance.

Implementation

Future<CreateAppInstanceAdminResponse> createAppInstanceAdmin({
  required String appInstanceAdminArn,
  required String appInstanceArn,
}) async {
  final $payload = <String, dynamic>{
    'AppInstanceAdminArn': appInstanceAdminArn,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/app-instances/${Uri.encodeComponent(appInstanceArn)}/admins',
    exceptionFnMap: _exceptionFns,
  );
  return CreateAppInstanceAdminResponse.fromJson(response);
}