describeConfigurationRecorders method

Future<DescribeConfigurationRecordersResponse> describeConfigurationRecorders({
  1. String? arn,
  2. List<String>? configurationRecorderNames,
  3. String? servicePrincipal,
})

Returns details for the configuration recorder you specify.

If a configuration recorder is not specified, this operation returns details for the customer managed configuration recorder configured for the account, if applicable.

May throw NoSuchConfigurationRecorderException. May throw ValidationException.

Parameter arn : The Amazon Resource Name (ARN) of the configuration recorder that you want to specify.

Parameter configurationRecorderNames : A list of names of the configuration recorders that you want to specify.

Parameter servicePrincipal : For service-linked configuration recorders, you can use the service principal of the linked Amazon Web Services service to specify the configuration recorder.

Implementation

Future<DescribeConfigurationRecordersResponse>
    describeConfigurationRecorders({
  String? arn,
  List<String>? configurationRecorderNames,
  String? servicePrincipal,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'StarlingDoveService.DescribeConfigurationRecorders'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (arn != null) 'Arn': arn,
      if (configurationRecorderNames != null)
        'ConfigurationRecorderNames': configurationRecorderNames,
      if (servicePrincipal != null) 'ServicePrincipal': servicePrincipal,
    },
  );

  return DescribeConfigurationRecordersResponse.fromJson(jsonResponse.body);
}