inviteOrganizationToTransferResponsibility method

Future<InviteOrganizationToTransferResponsibilityResponse> inviteOrganizationToTransferResponsibility({
  1. required String sourceName,
  2. required DateTime startTimestamp,
  3. required HandshakeParty target,
  4. required ResponsibilityTransferType type,
  5. String? notes,
  6. List<Tag>? tags,
})

Sends an invitation to another organization's management account to designate your account with the specified responsibilities for their organization. The invitation is implemented as a Handshake whose details are in the response.

You can only call this operation from the management account.

May throw AccessDeniedException. May throw AWSOrganizationsNotInUseException. May throw ConcurrentModificationException. May throw ConstraintViolationException. May throw DuplicateHandshakeException. May throw HandshakeConstraintViolationException. May throw InvalidInputException. May throw ServiceException. May throw TooManyRequestsException. May throw UnsupportedAPIEndpointException.

Parameter sourceName : Name you want to assign to the transfer.

Parameter startTimestamp : Timestamp when the recipient will begin managing the specified responsibilities.

Parameter target : A HandshakeParty object. Contains details for the account you want to invite. Currently, only ACCOUNT and EMAIL are supported.

Parameter type : The type of responsibility you want to designate to your organization. Currently, only BILLING is supported.

Parameter notes : Additional information that you want to include in the invitation.

Parameter tags : A list of tags that you want to attach to the transfer. For each tag in the list, you must specify both a tag key and a value. You can set the value to an empty string, but you can't set it to null. For more information about tagging, see Tagging Organizations resources in the Organizations User Guide.

Implementation

Future<InviteOrganizationToTransferResponsibilityResponse>
    inviteOrganizationToTransferResponsibility({
  required String sourceName,
  required DateTime startTimestamp,
  required HandshakeParty target,
  required ResponsibilityTransferType type,
  String? notes,
  List<Tag>? tags,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target':
        'AWSOrganizationsV20161128.InviteOrganizationToTransferResponsibility'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'SourceName': sourceName,
      'StartTimestamp': unixTimestampToJson(startTimestamp),
      'Target': target,
      'Type': type.value,
      if (notes != null) 'Notes': notes,
      if (tags != null) 'Tags': tags,
    },
  );

  return InviteOrganizationToTransferResponsibilityResponse.fromJson(
      jsonResponse.body);
}