// Copyright 2025 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.v1;

import "google/api/field_behavior.proto";
import "google/api/field_info.proto";
import "google/api/resource.proto";

option csharp_namespace = "Google.Cloud.BackupDR.V1";
option go_package = "cloud.google.com/go/backupdr/apiv1/backupdrpb;backupdrpb";
option java_multiple_files = true;
option java_outer_classname = "BackupvaultAlloyDBProto";
option java_package = "com.google.cloud.backupdr.v1";
option php_namespace = "Google\\Cloud\\BackupDR\\V1";
option ruby_package = "Google::Cloud::BackupDR::V1";
option (google.api.resource_definition) = {
  type: "alloydb.googleapis.com/Cluster"
  pattern: "projects/{project}/locations/{location}/clusters/{cluster}"
};

// AlloyDBClusterDataSourceProperties represents the properties of a
// AlloyDB cluster resource that are stored in the DataSource.
// .
message AlloyDBClusterDataSourceProperties {
  // Output only. Name of the AlloyDB cluster backed up by the datasource.
  string name = 1 [
    (google.api.field_behavior) = OUTPUT_ONLY,
    (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" }
  ];
}

// AlloyDbClusterBackupProperties represents AlloyDB cluster
// backup properties.
// .
message AlloyDbClusterBackupProperties {
  // An optional text description for the backup.
  optional string description = 1;

  // Output only. Storage usage of this particular backup
  int64 stored_bytes = 2 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The chain id of this backup. Backups belonging to the same
  // chain are sharing the same chain id. This property is calculated and
  // maintained by BackupDR.
  string chain_id = 3 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The PostgreSQL major version of the AlloyDB cluster when the
  // backup was taken.
  string database_version = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// Properties for an AlloyDB cluster backup plan association.
message AlloyDBClusterBackupPlanAssociationProperties {
  // Output only. The cluster UID of the AlloyDB cluster.
  string cluster_uid = 1 [
    (google.api.field_info).format = UUID4,
    (google.api.field_behavior) = OUTPUT_ONLY
  ];
}
