removeTagsFromResource method
Future<void>
removeTagsFromResource({
- required String resourceId,
- required ResourceTypeForTagging resourceType,
- required List<
String> tagKeys,
Removes tag keys from the specified resource.
May throw InvalidResourceType. May throw InvalidResourceId. May throw InternalServerError. May throw TooManyUpdates.
Parameter resourceId
:
The ID of the resource from which you want to remove tags. For example:
ManagedInstance: mi-012345abcde
MaintenanceWindow: mw-012345abcde
PatchBaseline: pb-012345abcde
For the Document and Parameter values, use the name of the resource.
Parameter resourceType
:
The type of resource from which you want to remove a tag.
Parameter tagKeys
:
Tag keys that you want to remove from the specified resource.
Implementation
Future<void> removeTagsFromResource({
required String resourceId,
required ResourceTypeForTagging resourceType,
required List<String> tagKeys,
}) async {
ArgumentError.checkNotNull(resourceId, 'resourceId');
ArgumentError.checkNotNull(resourceType, 'resourceType');
ArgumentError.checkNotNull(tagKeys, 'tagKeys');
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AmazonSSM.RemoveTagsFromResource'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'ResourceId': resourceId,
'ResourceType': resourceType.toValue(),
'TagKeys': tagKeys,
},
);
}