untagResource method

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

This API works with the following fleet types: EC2, Anywhere, Container

Removes a tag assigned to a Amazon GameLift Servers resource. You can use resource tags to organize Amazon Web Services resources for a range of purposes. This operation handles the permissions necessary to manage tags for Amazon GameLift Servers resources that support tagging.

To remove a tag from a resource, specify the unique ARN value for the resource and provide a string list containing one or more tags to remove. This operation succeeds even if the list includes tags that aren't assigned to the resource.

Learn more

Tagging Amazon Web Services Resources in the Amazon Web Services General Reference

Amazon Web Services Tagging Strategies

Related actions

All APIs by task

May throw InternalServiceException. May throw InvalidRequestException. May throw NotFoundException. May throw TaggingFailedException. May throw UnsupportedRegionException.

Parameter resourceARN : The Amazon Resource Name (ARN) that uniquely identifies the Amazon GameLift Servers resource that you want to remove tags from. Amazon GameLift Servers includes resource ARNs in the data object for the resource. You can retrieve the ARN by calling a List or Describe operation for the resource type.

Parameter tagKeys : A list of one or more tag keys to remove from the specified Amazon GameLift Servers resource.

Implementation

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