deleteTrust method

Future<DeleteTrustResult> deleteTrust({
  1. required String trustId,
  2. bool? deleteAssociatedConditionalForwarder,
})

Deletes an existing trust relationship between your AWS Managed Microsoft AD directory and an external domain.

May throw EntityDoesNotExistException. May throw InvalidParameterException. May throw ClientException. May throw ServiceException. May throw UnsupportedOperationException.

Parameter trustId : The Trust ID of the trust relationship to be deleted.

Parameter deleteAssociatedConditionalForwarder : Delete a conditional forwarder as part of a DeleteTrustRequest.

Implementation

Future<DeleteTrustResult> deleteTrust({
  required String trustId,
  bool? deleteAssociatedConditionalForwarder,
}) async {
  ArgumentError.checkNotNull(trustId, 'trustId');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'DirectoryService_20150416.DeleteTrust'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'TrustId': trustId,
      if (deleteAssociatedConditionalForwarder != null)
        'DeleteAssociatedConditionalForwarder':
            deleteAssociatedConditionalForwarder,
    },
  );

  return DeleteTrustResult.fromJson(jsonResponse.body);
}