createAlias method
Creates an alias for a directory and assigns the alias to the directory.
The alias is used to construct the access URL for the directory, such as
http://.
May throw ClientException.
May throw EntityAlreadyExistsException.
May throw EntityDoesNotExistException.
May throw InvalidParameterException.
May throw ServiceException.
Parameter alias :
The requested alias.
The alias must be unique amongst all aliases in Amazon Web Services. This
operation throws an EntityAlreadyExistsException error if the
alias already exists.
Parameter directoryId :
The identifier of the directory for which to create the alias.
Implementation
Future<CreateAliasResult> createAlias({
required String alias,
required String directoryId,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'DirectoryService_20150416.CreateAlias'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'Alias': alias,
'DirectoryId': directoryId,
},
);
return CreateAliasResult.fromJson(jsonResponse.body);
}