untagResource method

Future<void> untagResource({
  1. required String resourceId,
  2. required List<String> tagKeys,
})

Removes any tags with the specified keys from the specified resource.

You can attach tags to the following resources in Organizations.

  • Amazon Web Services account
  • Organization root
  • Organizational unit (OU)
  • Policy (any type)
You can only call this operation from the management account or a member account that is a delegated administrator.

May throw AccessDeniedException. May throw AWSOrganizationsNotInUseException. May throw ConcurrentModificationException. May throw ConstraintViolationException. May throw InvalidInputException. May throw ServiceException. May throw TargetNotFoundException. May throw TooManyRequestsException.

Parameter resourceId : The ID of the resource to remove a tag from.

You can specify any of the following taggable resources.

  • Amazon Web Services account – specify the account ID number.
  • Organizational unit – specify the OU ID that begins with ou- and looks similar to: ou-1a2b-34uvwxyz
  • Root – specify the root ID that begins with r- and looks similar to: r-1a2b
  • Policy – specify the policy ID that begins with p- andlooks similar to: p-12abcdefg3

Parameter tagKeys : The list of keys for tags to remove from the specified resource.

Implementation

Future<void> untagResource({
  required String resourceId,
  required List<String> tagKeys,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSOrganizationsV20161128.UntagResource'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ResourceId': resourceId,
      'TagKeys': tagKeys,
    },
  );
}