// Protocol Buffers - Google's data interchange format
// Copyright 2023 Google LLC.  All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd

syntax = "proto2";

package hpb_unittest;

import "google/protobuf/compiler/hpb/tests/child_model.proto";

message TestModelContainer {
  repeated TestModel models = 1;
  optional ChildModel3 proto_3_child = 2;
  extensions 10000 to max
  [verification = UNVERIFIED];
}

message TestModel {
  optional int32 value = 1;
  repeated int32 value_array = 2;  // _UPB_MODE_ARRAY
  repeated int32 value_packed_array = 3
      [packed = true];  // _UPB_MODE_ARRAY | _UPB_MODE_IS_PACKED
  repeated int32 value_deprec = 4 [deprecated = true];
  optional string str1 = 115;
  optional bool b1 = 9;
  optional bool b2 = 10;
  optional string str2 = 50;
  optional string str3 = 11;
  optional float optional_float = 14;
  optional double optional_double = 15;
  optional int64 optional_int64 = 16;
  optional uint32 optional_uint32 = 17;
  optional uint64 optional_uint64 = 18;
  optional sint32 optional_sint32 = 19;
  optional sint64 optional_sint64 = 20;
  optional fixed32 optional_fixed32 = 21;
  optional fixed64 optional_fixed64 = 22;
  optional sfixed32 optional_sfixed32 = 23;
  optional sfixed64 optional_sfixed64 = 24;
  repeated int64 repeated_int64 = 25;
  repeated uint64 repeated_uint64 = 26;
  repeated fixed64 repeated_fixed64 = 27;
  repeated sfixed64 repeated_sfixed64 = 28;
  repeated bool repeated_bool = 29;
  repeated string repeated_string = 35;
  optional bytes optional_bytes = 36;
  message NestedChild {
    optional string nested_child_name = 211;
  }
  optional NestedChild nested_child_1 = 212;
  optional ChildModel1 child_model_1 = 222;
  repeated ChildModel1 child_models = 223;
  optional ChildModel1 bar = 224;
  oneof child_oneof1 {
    string oneof_member1 = 98;
    bool oneof_member2 = 99;
  }
  optional int32 int_value_with_default = 31
      [default = 65];  // Not supported yet
  optional string string_value_with_default = 32
      [default = "hello"];  // Not supported yet
  optional float float_value_with_default = 33 [default = inf];
  optional float double_value_with_default = 34 [default = -inf];

  map<int32, ChildModel1> child_map = 225;
  optional TestModel recursive_child = 226;
  map<string, ChildModel1> child_str_map = 227;
  map<string, int32> str_to_int_map = 228;
  map<string, string> str_to_str_map = 229;

  extend TestAnnotation {
    optional OtherExtension in_message_ext = 15000;
  }

  enum Category {
    IMAGES = 5;
    NEWS = 6;
    VIDEO = 7;
    RADIO = 8 [deprecated = true];
  }
  optional Category category = 37;

  // keyword collisions (double, template, ...)
  oneof type {
    string string = 230;
    int64 int64 = 231;
    double double = 232;
  }
  optional string template = 233;
  optional string msg = 234;
  optional string arena = 235;

  // Tests publicly imported enum.
  optional TestEnum imported_enum = 238;

  optional string phase = 239;
  optional bool clear_phase = 240;

  optional string doc_id = 241;
  optional bool set_doc_id = 242;

  extensions 10000 to max
  [verification = UNVERIFIED];
}

// Old version with fewer fields to test backward/forward compatibility.
message TestModelContainerV1 {
  repeated TestModelV1 models = 1;
}

message TestModelV1 {
  optional int32 value = 1;
  repeated int32 value2 = 2;
  repeated int32 value3 = 3 [packed = true];
  repeated int32 value4 = 4 [deprecated = true];
  optional bool b1 = 9;
  optional bool b2 = 10;
  optional string str2 = 50;
}

enum PrimaryColors {
  RED = 1;
  GREEN = 2;
  BLUE = 3;
}

// TestModel extension.
message ThemeExtension {
  extend TestModel {
    optional ThemeExtension theme_extension = 12003;
  }
  optional string ext_name = 1;
  optional bool ext_bool = 2;
}

extend TestModel {
  optional ThemeExtension theme = 12001;
}

message ContainerExtension {
  extend TestModelContainer {
    optional ContainerExtension container_extension = 12004;
  }
  optional string ext_container_name = 1;
}

extend TestModelContainer {
  optional ContainerExtension container_ext = 12005;
}

message OtherExtension {
  optional string ext2_name = 1;
}

extend TestModel {
  optional OtherExtension other_ext = 12002;
}

message TestAnnotation {
  extensions 10000 to max
  [verification = UNVERIFIED];
}

message TestMessageHasEnum {
  optional EnumDeclaredAfterMessage enum_declared_after_message = 1;
}

enum EnumDeclaredAfterMessage {
  ZERO = 0;
  ONE = 1;
  TWO = 2;
  THREE = 3;
}
