/*
 * Copyright 2016 The Error Prone Authors.
 *
 * 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 = "proto2";

package com.google.errorprone.bugpatterns;

option java_package = "com.google.errorprone.bugpatterns.proto";

message TestFieldProtoMessage {
  optional TestFieldProtoMessage field = 1;
}

message TestProtoMessage {
  optional TestFieldProtoMessage message = 1;
  repeated TestFieldProtoMessage multi_field = 2;
  optional int32 test_field_named_count = 3;
  optional bool boolean_field = 4;
  map<int32, int32> weight = 5;
  /* Named ending in "builder" to check the Java builder API */
  optional TestFieldProtoMessage foo_builder = 6;

  optional string string_field = 7;

  extensions 100 to 199;
}

message TestOneOfMessage {
  oneof OneOf {
    string foo = 1;
    string bar = 2;
    string baz = 3;
    TestEnum enum_field = 6;
  }
  oneof AnotherOneOf {
    string quux = 4;
    string frobber = 5;
  }
}

message TestProtoWithConfusingNames {
  optional TestEnum foo = 1;
  optional int32 foo_value = 2;

  // Fields that both collide, and are named in camelcase.
  optional TestEnum barField = 3;
  optional int32 barFieldValue = 4;
}

message TestMessageContainingOneOfMessage {
  optional TestOneOfMessage message = 1;
}

enum TestEnum {
  UNSPECIFIED = 0;
  TEST_ENUM_VAL = 1;
}
