associateConnectionAlias method

Future<AssociateConnectionAliasResult> associateConnectionAlias({
  1. required String aliasId,
  2. required String resourceId,
})

Associates the specified connection alias with the specified directory to enable cross-Region redirection. For more information, see Cross-Region Redirection for Amazon WorkSpaces.

May throw ResourceAssociatedException. May throw AccessDeniedException. May throw ResourceNotFoundException. May throw InvalidParameterValuesException. May throw InvalidResourceStateException. May throw OperationNotSupportedException.

Parameter aliasId : The identifier of the connection alias.

Parameter resourceId : The identifier of the directory to associate the connection alias with.

Implementation

Future<AssociateConnectionAliasResult> associateConnectionAlias({
  required String aliasId,
  required String resourceId,
}) async {
  ArgumentError.checkNotNull(aliasId, 'aliasId');
  _s.validateStringLength(
    'aliasId',
    aliasId,
    13,
    68,
    isRequired: true,
  );
  ArgumentError.checkNotNull(resourceId, 'resourceId');
  _s.validateStringLength(
    'resourceId',
    resourceId,
    1,
    1152921504606846976,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'WorkspacesService.AssociateConnectionAlias'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'AliasId': aliasId,
      'ResourceId': resourceId,
    },
  );

  return AssociateConnectionAliasResult.fromJson(jsonResponse.body);
}