tagResource method

Future<void> tagResource({
  1. required String resourceARN,
  2. required ServiceType serviceType,
  3. required List<Tag> tags,
})

Adds metadata tags to the Amazon RDS Performance Insights resource.

May throw InternalServiceError. May throw InvalidArgumentException. May throw NotAuthorizedException.

Parameter resourceARN : The Amazon RDS Performance Insights resource that the tags are added to. This value is an Amazon Resource Name (ARN). For information about creating an ARN, see Constructing an RDS Amazon Resource Name (ARN).

Parameter serviceType : The Amazon Web Services service for which Performance Insights returns metrics. Valid value is RDS.

Parameter tags : The metadata assigned to an Amazon RDS resource consisting of a key-value pair.

Implementation

Future<void> tagResource({
  required String resourceARN,
  required ServiceType serviceType,
  required List<Tag> tags,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'PerformanceInsightsv20180227.TagResource'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ResourceARN': resourceARN,
      'ServiceType': serviceType.value,
      'Tags': tags,
    },
  );
}