createAppInstanceUser method

Future<CreateAppInstanceUserResponse> createAppInstanceUser({
  1. required String appInstanceArn,
  2. required String appInstanceUserId,
  3. required String name,
  4. String? clientRequestToken,
  5. String? metadata,
})

Creates a user under an Amazon Chime AppInstance. The request consists of a unique appInstanceUserId and Name for that user.

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 appInstanceArn : The ARN of the app instance request.

Parameter appInstanceUserId : The user ID of the app instance.

Parameter name : The user's name.

Parameter clientRequestToken : The token assigned to the user requesting an app instance.

Parameter metadata : The request's metadata. Limited to a 1KB string in UTF-8.

Implementation

Future<CreateAppInstanceUserResponse> createAppInstanceUser({
  required String appInstanceArn,
  required String appInstanceUserId,
  required String name,
  String? clientRequestToken,
  String? metadata,
}) async {
  ArgumentError.checkNotNull(appInstanceArn, 'appInstanceArn');
  _s.validateStringLength(
    'appInstanceArn',
    appInstanceArn,
    5,
    1600,
    isRequired: true,
  );
  ArgumentError.checkNotNull(appInstanceUserId, 'appInstanceUserId');
  _s.validateStringLength(
    'appInstanceUserId',
    appInstanceUserId,
    1,
    50,
    isRequired: true,
  );
  ArgumentError.checkNotNull(name, 'name');
  _s.validateStringLength(
    'name',
    name,
    1,
    100,
    isRequired: true,
  );
  _s.validateStringLength(
    'clientRequestToken',
    clientRequestToken,
    2,
    64,
  );
  _s.validateStringLength(
    'metadata',
    metadata,
    0,
    1024,
  );
  final $payload = <String, dynamic>{
    'AppInstanceArn': appInstanceArn,
    'AppInstanceUserId': appInstanceUserId,
    'Name': name,
    'ClientRequestToken': clientRequestToken ?? _s.generateIdempotencyToken(),
    if (metadata != null) 'Metadata': metadata,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/app-instance-users',
    exceptionFnMap: _exceptionFns,
  );
  return CreateAppInstanceUserResponse.fromJson(response);
}