putRetentionConfiguration method

Future<PutRetentionConfigurationResponse> putRetentionConfiguration({
  1. required int retentionPeriodInDays,
})

Creates and updates the retention configuration with details about retention period (number of days) that AWS Config stores your historical information. The API creates the RetentionConfiguration object and names the object as default. When you have a RetentionConfiguration object named default, calling the API modifies the default object.

May throw InvalidParameterValueException. May throw MaxNumberOfRetentionConfigurationsExceededException.

Parameter retentionPeriodInDays : Number of days AWS Config stores your historical information.

Implementation

Future<PutRetentionConfigurationResponse> putRetentionConfiguration({
  required int retentionPeriodInDays,
}) async {
  ArgumentError.checkNotNull(retentionPeriodInDays, 'retentionPeriodInDays');
  _s.validateNumRange(
    'retentionPeriodInDays',
    retentionPeriodInDays,
    30,
    2557,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'StarlingDoveService.PutRetentionConfiguration'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'RetentionPeriodInDays': retentionPeriodInDays,
    },
  );

  return PutRetentionConfigurationResponse.fromJson(jsonResponse.body);
}