createAutonomousDatabaseBackup method

Future<CreateAutonomousDatabaseBackupOutput> createAutonomousDatabaseBackup({
  1. required String autonomousDatabaseId,
  2. String? clientToken,
  3. String? displayName,
  4. int? retentionPeriodInDays,
  5. Map<String, String>? tags,
})

Creates a new backup of the specified Autonomous Database.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter autonomousDatabaseId : The unique identifier of the Autonomous Database to back up.

Parameter clientToken : A client-provided token to ensure the idempotency of the request.

Parameter displayName : The user-friendly name for the Autonomous Database backup.

Parameter retentionPeriodInDays : The retention period, in days, for the Autonomous Database backup.

Parameter tags : The list of resource tags to apply to the Autonomous Database backup. Each tag is a key-value pair with no predefined name, type, or namespace.

Implementation

Future<CreateAutonomousDatabaseBackupOutput> createAutonomousDatabaseBackup({
  required String autonomousDatabaseId,
  String? clientToken,
  String? displayName,
  int? retentionPeriodInDays,
  Map<String, String>? tags,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'Odb.CreateAutonomousDatabaseBackup'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'autonomousDatabaseId': autonomousDatabaseId,
      'clientToken': clientToken ?? _s.generateIdempotencyToken(),
      if (displayName != null) 'displayName': displayName,
      if (retentionPeriodInDays != null)
        'retentionPeriodInDays': retentionPeriodInDays,
      if (tags != null) 'tags': tags,
    },
  );

  return CreateAutonomousDatabaseBackupOutput.fromJson(jsonResponse.body);
}