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

import "google/api/field_behavior.proto";

option csharp_namespace = "Google.Cloud.FinancialServices.V1";
option go_package = "cloud.google.com/go/financialservices/apiv1/financialservicespb;financialservicespb";
option java_multiple_files = true;
option java_outer_classname = "BigQueryDestinationProto";
option java_package = "com.google.cloud.financialservices.v1";
option php_namespace = "Google\\Cloud\\FinancialServices\\V1";
option ruby_package = "Google::Cloud::FinancialServices::V1";

// BigQueryDestination is a wrapper for BigQuery output information.
message BigQueryDestination {
  // WriteDisposition controls the behavior when the destination table already
  // exists.
  enum WriteDisposition {
    // Default behavior is the same as WRITE_EMPTY.
    WRITE_DISPOSITION_UNSPECIFIED = 0;

    // If the table already exists and contains data, an error is returned.
    WRITE_EMPTY = 1;

    // If the table already exists, the data will be overwritten.
    WRITE_TRUNCATE = 2;
  }

  // Optional. BigQuery URI to a table, must be of the form
  // bq://projectId.bqDatasetId.tableId.
  // Note that the BigQuery dataset must already exist.
  // VPC-SC restrictions apply.
  string table_uri = 1 [(google.api.field_behavior) = OPTIONAL];

  // Required. Whether or not to overwrite the destination table. By default the
  // table won't be overwritten and an error will be returned if the table
  // exists and contains data.
  WriteDisposition write_disposition = 2
      [(google.api.field_behavior) = REQUIRED];
}
