syntax = "proto3";

package google.expr.proto3.test;

option go_package = "github.com/google/cel-go/test/proto3pb";

import "google/protobuf/any.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/wrappers.proto";

// Imported message dependency test.
import "test/proto3pb/test_import.proto";

// This proto includes every type of field in both singular and repeated
// forms.
message TestAllTypes {
  message NestedMessage {
    // The field name "b" fails to compile in proto1 because it conflicts with
    // a local variable named "b" in one of the generated methods.
    // This file needs to compile in proto1 to test backwards-compatibility.
    int32 bb = 1;
  }

  enum NestedEnum {
    FOO = 0;
    BAR = 1;
    BAZ = 2;
  }

  // Singular
  int32 single_int32 = 1;
  int64 single_int64 = 2;
  uint32 single_uint32 = 3;
  uint64 single_uint64 = 4;
  sint32 single_sint32 = 5;
  sint64 single_sint64 = 6;
  fixed32 single_fixed32 = 7;
  fixed64 single_fixed64 = 8;
  sfixed32 single_sfixed32 = 9;
  sfixed64 single_sfixed64 = 10;
  float single_float = 11;
  double single_double = 12;
  bool single_bool = 13;
  string single_string = 14;
  bytes single_bytes = 15;
  NestedEnum standalone_enum = 22;

  // Wellknown.
  google.protobuf.Any single_any = 100;
  google.protobuf.Duration single_duration = 101;
  google.protobuf.Timestamp single_timestamp = 102;
  google.protobuf.Struct single_struct = 103;
  google.protobuf.Value single_value = 104;
  google.protobuf.Int64Value single_int64_wrapper = 105;
  google.protobuf.Int32Value single_int32_wrapper = 106;
  google.protobuf.DoubleValue single_double_wrapper = 107;
  google.protobuf.FloatValue single_float_wrapper = 108;
  google.protobuf.UInt64Value single_uint64_wrapper = 109;
  google.protobuf.UInt32Value single_uint32_wrapper = 110;
  google.protobuf.StringValue single_string_wrapper = 111;
  google.protobuf.BoolValue single_bool_wrapper = 112;
  google.protobuf.BytesValue single_bytes_wrapper = 113;

  // Nested messages
  oneof nested_type {
    NestedMessage single_nested_message = 18;
    NestedEnum single_nested_enum = 21;
  }

  // Repeated
  repeated int32 repeated_int32 = 31;
  repeated int64 repeated_int64 = 32;
  repeated uint32 repeated_uint32 = 33;
  repeated uint64 repeated_uint64 = 34;
  repeated sint32 repeated_sint32 = 35;
  repeated sint64 repeated_sint64 = 36;
  repeated fixed32 repeated_fixed32 = 37;
  repeated fixed64 repeated_fixed64 = 38;
  repeated sfixed32 repeated_sfixed32 = 39;
  repeated sfixed64 repeated_sfixed64 = 40;
  repeated float repeated_float = 41;
  repeated double repeated_double = 42;
  repeated bool repeated_bool = 43;
  repeated string repeated_string = 44;
  repeated bytes repeated_bytes = 45;

  repeated NestedMessage repeated_nested_message = 48;

  repeated NestedEnum repeated_nested_enum = 51;

  repeated string repeated_string_piece = 54 [ctype = STRING_PIECE];
  repeated string repeated_cord = 55 [ctype = CORD];

  repeated NestedMessage repeated_lazy_message = 57;

  // Map
  map<string, string> map_string_string = 58;
  map<int64, NestedTestAllTypes> map_int64_nested_type = 59;

  // Imports
  repeated ImportedGlobalEnum imported_enums = 60;
}

// This proto includes a recursively nested message.
message NestedTestAllTypes {
  NestedTestAllTypes child = 1;
  TestAllTypes payload = 2;
}

// This proto tests that global enums are resolved correctly.
enum GlobalEnum {
  GOO = 0;
  GAR = 1;
  GAZ = 2;
}

// This proto tests json_name options
message TestJsonNames {
  int32 int32_snake_case_json_name = 1
      [json_name = "int32_snake_case_json_name"];
  int64 int64_camel_case_json_name = 2 [json_name = "int64CamelCaseJsonName"];
  uint32 uint32_default_json_name = 3;
  uint64 uint64_custom_json_name = 4 [json_name = "uint64-custom-json-name"];

  // Collides with normal field name.
  string string_json_name_shadows = 5 [json_name = "single_string"];
  string single_string = 6;

  // protoc should fail on cases like these
  // double double_json_shadow_default = 7 [json_name = "doubleJsonDefault"]
  // double double_json_default = 8;
  // double double_json_swapped_a = 7 [json_name = "double_json_swapped_b"];
  // double double_json_swapped_b = 8 [json_name = "double_json_swapped_a"];
}