createConnectionAlias method
Creates the specified connection alias for use with cross-Region redirection. For more information, see Cross-Region Redirection for Amazon WorkSpaces.
May throw ResourceAlreadyExistsException. May throw AccessDeniedException. May throw InvalidParameterValuesException. May throw ResourceLimitExceededException. May throw InvalidResourceStateException. May throw OperationNotSupportedException.
Parameter connectionString
:
A connection string in the form of a fully qualified domain name (FQDN),
such as www.example.com
.
Parameter tags
:
The tags to associate with the connection alias.
Implementation
Future<CreateConnectionAliasResult> createConnectionAlias({
required String connectionString,
List<Tag>? tags,
}) async {
ArgumentError.checkNotNull(connectionString, 'connectionString');
_s.validateStringLength(
'connectionString',
connectionString,
1,
255,
isRequired: true,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'WorkspacesService.CreateConnectionAlias'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'ConnectionString': connectionString,
if (tags != null) 'Tags': tags,
},
);
return CreateConnectionAliasResult.fromJson(jsonResponse.body);
}