createAppInstanceAdmin method

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

Promotes an AppInstanceUser to an AppInstanceAdmin. The promoted user can perform the following actions.

  • ChannelModerator actions across all channels in the app instance.
  • DeleteChannelMessage actions.
Only an AppInstanceUser can be promoted to an AppInstanceAdmin role.

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

Parameter appInstanceAdminArn : The ARN of the administrator of the current app instance.

Parameter appInstanceArn : The ARN of the app instance.

Implementation

Future<CreateAppInstanceAdminResponse> createAppInstanceAdmin({
  required String appInstanceAdminArn,
  required String appInstanceArn,
}) async {
  ArgumentError.checkNotNull(appInstanceAdminArn, 'appInstanceAdminArn');
  _s.validateStringLength(
    'appInstanceAdminArn',
    appInstanceAdminArn,
    5,
    1600,
    isRequired: true,
  );
  ArgumentError.checkNotNull(appInstanceArn, 'appInstanceArn');
  _s.validateStringLength(
    'appInstanceArn',
    appInstanceArn,
    5,
    1600,
    isRequired: true,
  );
  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);
}