edition = "UNSTABLE";

package proto2_unittest;

import "google/protobuf/cpp_features.proto";
import "google/protobuf/test_protos/repeated_field_proxy_import_message.proto";

message RepeatedFieldProxyTestSimpleMessage {
  int32 value = 1;

  RepeatedFieldProxyTestSimpleMessage nested = 2;
}

message TestRepeatedMessageProxy {
  message NestedMessage {
    int32 value = 1;
  }

  repeated NestedMessage nested_messages = 1
      [features.(pb.cpp).repeated_type = LEGACY];

  repeated NestedMessage nested_messages_proxy = 2
      [features.(pb.cpp).repeated_type = PROXY];
}

message TestRepeatedImportMessageProxy {
  repeated proto2_unittest.RepeatedFieldProxyTestImportMessage
      import_messages_proxy = 1 [features.(pb.cpp).repeated_type = PROXY];
}

message TestRepeatedIntProxy {
  repeated int32 ints = 1 [features.(pb.cpp).repeated_type = LEGACY];

  repeated int32 ints_proxy = 2 [features.(pb.cpp).repeated_type = PROXY];
}

message TestRepeatedEnumProxy {
  enum Enum {
    UNKNOWN = 0;
    FOO = 1;
    BAR = 2;
    BAZ = 3;
  }

  repeated Enum enums = 1 [features.(pb.cpp).repeated_type = LEGACY];

  repeated Enum enums_proxy = 2 [features.(pb.cpp).repeated_type = PROXY];
}

// Exercises having an incomplete enum type in the generated .proto.h.
message TestRepeatedImportEnumProxy {
  repeated proto2_unittest.RepeatedFieldProxyTestImportEnum enums_proxy = 1
      [features.(pb.cpp).repeated_type = PROXY];
}

message TestRepeatedStdStringProxy {
  repeated string strings = 1 [
    features.(pb.cpp).string_type = STRING,
    features.(pb.cpp).repeated_type = LEGACY
  ];

  repeated string strings_proxy = 2 [
    features.(pb.cpp).string_type = STRING,
    features.(pb.cpp).repeated_type = PROXY
  ];
}

message TestRepeatedStringViewProxy {
  repeated string string_views = 1 [
    features.(pb.cpp).string_type = VIEW,
    features.(pb.cpp).repeated_type = LEGACY
  ];

  repeated string string_views_proxy = 2 [
    features.(pb.cpp).string_type = VIEW,
    features.(pb.cpp).repeated_type = PROXY
  ];
}
