setTagsForResource method

Future<void> setTagsForResource({
  1. required String resourceArn,
  2. List<Tag>? tags,
})

Sets tags (key and value pairs) to the assessment template that is specified by the ARN of the assessment template.

May throw InternalException. May throw InvalidInputException. May throw AccessDeniedException. May throw NoSuchEntityException. May throw ServiceTemporarilyUnavailableException.

Parameter resourceArn : The ARN of the assessment template that you want to set tags to.

Parameter tags : A collection of key and value pairs that you want to set to the assessment template.

Implementation

Future<void> setTagsForResource({
  required String resourceArn,
  List<Tag>? tags,
}) async {
  ArgumentError.checkNotNull(resourceArn, 'resourceArn');
  _s.validateStringLength(
    'resourceArn',
    resourceArn,
    1,
    300,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'InspectorService.SetTagsForResource'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'resourceArn': resourceArn,
      if (tags != null) 'tags': tags,
    },
  );
}