untagResource method

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

Removes one or more tags from the specified resource.

May throw InvalidParameterValueException. May throw ResourceNotFoundException. May throw ConcurrentModificationException. May throw InternalServiceFault.

Parameter resourceARN : The ARN of the CloudWatch resource that you're removing tags from.

The ARN format of an alarm is arn:aws:cloudwatch:Region:account-id:alarm:alarm-name

The ARN format of a Contributor Insights rule is arn:aws:cloudwatch:Region:account-id:insight-rule:insight-rule-name

For more information about ARN format, see Resource Types Defined by Amazon CloudWatch in the Amazon Web Services General Reference.

Parameter tagKeys : The list of tag keys to remove from the resource.

Implementation

Future<void> untagResource({
  required String resourceARN,
  required List<String> tagKeys,
}) async {
  ArgumentError.checkNotNull(resourceARN, 'resourceARN');
  _s.validateStringLength(
    'resourceARN',
    resourceARN,
    1,
    1024,
    isRequired: true,
  );
  ArgumentError.checkNotNull(tagKeys, 'tagKeys');
  final $request = <String, dynamic>{};
  $request['ResourceARN'] = resourceARN;
  $request['TagKeys'] = tagKeys;
  await _protocol.send(
    $request,
    action: 'UntagResource',
    version: '2010-08-01',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['UntagResourceInput'],
    shapes: shapes,
    resultWrapper: 'UntagResourceResult',
  );
}