// 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.storage.platformlogs.v1;

import "google/rpc/status.proto";

option csharp_namespace = "Google.Cloud.Storage.PlatformLogs.V1";
option go_package = "cloud.google.com/go/storage/platformlogs/apiv1/platformlogspb;platformlogspb";
option java_multiple_files = true;
option java_outer_classname = "RelocateBucketErrorProto";
option java_package = "com.google.storage.platformlogs.v1";
option php_namespace = "Google\\Cloud\\Storage\\PlatformLogs\\V1";
option ruby_package = "Google::Cloud::Storage::PlatformLogs::V1";

// The proto payload for Relocate Bucket Cloud Logging. Only objects that
// experience errors (usually unsupported features) will be logged.
message RelocateBucketError {
  // Configuration for Custom Dual Regions. It specifies eligible regions within
  // the same Multiregion.
  message CustomPlacementConfig {
    // List of locations to use for data placement.
    repeated string data_locations = 1;
  }

  // The full resource name, following the format:
  // 'projects/_/buckets/{bucket_id}'.
  string resource = 1;

  // The object id of an object that is not supported for relocation.
  string object_id = 2;

  // The original location of the bucket. The location is a region/mutliregion,
  // such as 'us', 'us-central1', 'asia', etc.
  string source_location = 3;

  // The destination location of the bucket. The location is a
  // region/mutliregion, such as 'us', 'us-central1', 'asia', etc.
  string destination_location = 4;

  // If set, the source is a custom dual region.
  optional CustomPlacementConfig source_custom_placement_config = 5;

  // If set, the destination is a custom dual region.
  optional CustomPlacementConfig destination_custom_placement_config = 6;

  // The list of errors (originally enums) that were encountered during the
  // relocation, stringified and wrapped in google.rpc.Status details section.
  repeated google.rpc.Status relocation_errors = 7;

  // When true, validate the operation, but do not actually relocate the
  // bucket.
  bool validate_only = 8;
}
