createAlias method

Future<void> createAlias({
  1. required String alias,
  2. required String entityId,
  3. required String organizationId,
})

Adds an alias to the set of a given member (user or group) of Amazon WorkMail.

May throw EmailAddressInUseException. May throw EntityNotFoundException. May throw EntityStateException. May throw InvalidParameterException. May throw MailDomainNotFoundException. May throw MailDomainStateException. May throw OrganizationNotFoundException. May throw OrganizationStateException. May throw LimitExceededException.

Parameter alias : The alias to add to the member set.

Parameter entityId : The member (user or group) to which this alias is added.

Parameter organizationId : The organization under which the member (user or group) exists.

Implementation

Future<void> createAlias({
  required String alias,
  required String entityId,
  required String organizationId,
}) async {
  ArgumentError.checkNotNull(alias, 'alias');
  _s.validateStringLength(
    'alias',
    alias,
    1,
    254,
    isRequired: true,
  );
  ArgumentError.checkNotNull(entityId, 'entityId');
  _s.validateStringLength(
    'entityId',
    entityId,
    12,
    256,
    isRequired: true,
  );
  ArgumentError.checkNotNull(organizationId, 'organizationId');
  _s.validateStringLength(
    'organizationId',
    organizationId,
    34,
    34,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'WorkMailService.CreateAlias'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Alias': alias,
      'EntityId': entityId,
      'OrganizationId': organizationId,
    },
  );
}