createAccountLinkInvitation method

Future<CreateAccountLinkInvitationResult> createAccountLinkInvitation({
  1. required String targetAccountId,
  2. String? clientToken,
})

Creates the account link invitation.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ValidationException.

Parameter targetAccountId : The identifier of the target account.

Parameter clientToken : A string of up to 64 ASCII characters that Amazon WorkSpaces uses to ensure idempotent creation.

Implementation

Future<CreateAccountLinkInvitationResult> createAccountLinkInvitation({
  required String targetAccountId,
  String? clientToken,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'WorkspacesService.CreateAccountLinkInvitation'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'TargetAccountId': targetAccountId,
      if (clientToken != null) 'ClientToken': clientToken,
    },
  );

  return CreateAccountLinkInvitationResult.fromJson(jsonResponse.body);
}