// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.cloud.backupdr.logging.v1;

import "google/protobuf/timestamp.proto";

option go_package =
    "cloud.google.com/go/backupdr/logging/apiv1/loggingpb;loggingpb";
option java_multiple_files = true;

// Log entry for Backup and Restore Job for resources using BackupPlan based
// protection.
message BDRBackupRestoreJobLog {
  // The job_id field displays the identifier of the job being logged.
  optional string job_id = 1;

  // The category field displays the category of the job.
  optional string job_category = 2;

  // The status field displays the status of the job.
  optional string job_status = 3;

  // Full resource name of the protected resource.
  optional string source_resource_name = 4;

  // The source resource ID.
  optional string source_resource_id = 5;

  // Full resource name of the restore resource. Only populated in
  // restore jobs.
  optional string restore_resource_name = 6;

  // Full resource name of the backup created in backup jobs and used in restore
  // jobs.
  optional string backup_name = 7;

  // The resource_type field displays the type of the protected resource.
  optional string resource_type = 8;

  // Start time of the job.
  optional google.protobuf.Timestamp start_time = 9;

  // End time of the job.
  optional google.protobuf.Timestamp end_time = 10;

  // Full resource name for Backup Plan of the job. Only populated for Scheduled
  // Backup and Adhoc Backup.
  optional string backup_plan_name = 11;

  // Name of the backup rule. Only populated for Scheduled Backup and Adhoc
  // Backup.
  optional string backup_rule = 12;

  // Full resource name backup vault name
  optional string backup_vault_name = 13;

  // The amount of incremental backup data copied.
  optional double incremental_backup_size_gib = 14;

  // The error code. Only populated in error scenarios.
  optional int32 error_code = 15;

  // The name of the error type eg. PERMISSION_DENIED. Only populated in error
  // scenarios.
  optional string error_type = 16;

  // The user readable error message. Only populated in error scenarios.
  optional string error_message = 17;
}
