// Copyright 2026 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.bigquery.v2;

import "google/api/field_behavior.proto";

option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb";
option java_outer_classname = "DataFormatOptionsProto";
option java_package = "com.google.cloud.bigquery.v2";

// Options for data format adjustments.
message DataFormatOptions {
  // The API output format for a timestamp.
  enum TimestampOutputFormat {
    // Corresponds to default API output behavior, which is FLOAT64.
    TIMESTAMP_OUTPUT_FORMAT_UNSPECIFIED = 0;

    // Timestamp is output as float64 seconds since Unix epoch.
    FLOAT64 = 1;

    // Timestamp is output as int64 microseconds since Unix epoch.
    INT64 = 2;

    // Timestamp is output as ISO 8601 String
    // ("YYYY-MM-DDTHH:MM:SS.FFFFFFFFFFFFZ").
    ISO8601_STRING = 3;
  }

  // Optional. Output timestamp as usec int64. Default is false.
  bool use_int64_timestamp = 1 [(google.api.field_behavior) = OPTIONAL];

  // Optional. The API output format for a timestamp.
  // This offers more explicit control over the timestamp output format
  // as compared to the existing `use_int64_timestamp` option.
  TimestampOutputFormat timestamp_output_format = 3
      [(google.api.field_behavior) = OPTIONAL];
}
