//% descriptor: true
//% symtab: true
edition = "2024";

package Buf.Test; // Package must be lower_snake_case or dot.delimited.lower_snake_case

message my_message {
  string myField = 1;     // camelCase field name
  int32 AnotherField = 2; // PascalCase field name
  string field_1 = 3;     // lower_snake_case or dot.delimited.lower_snake_case
  string _field = 4;      // Leading underscore
  string field_ = 5;      // Trailing underscore
  string field__name = 6; // Consecutive underscores
  oneof TestChoice {      // PascalCase oneof
    string choice_a = 7;
    string badChoice = 8; // camelCase field name
  }
}

enum my_enum {
  unspecified = 0; // lowercase enum value
  valueOne = 1;    // camelCase enum value
  _VALUE = 2;      // Leading underscore
  VALUE_ = 3;      // Trailing underscore
  VALUE_1 = 4;     // Underscore followed by number
}

service My_Service { // Snake_Case service name
  rpc test_method(my_message) returns (my_message); // snake_case RPC method names
}

// Feature settings on different schema elements have different scopes.
message LegacyStyleMessage {
  option features.enforce_naming_style = STYLE_LEGACY;

  string _allowed = 1;
  string BadField = 2 [features.enforce_naming_style = STYLE2024];
  message bad_nested {
    option features.enforce_naming_style = STYLE2024;

    string _bad_field = 1;
    string _another_field = 2 [features.enforce_naming_style = STYLE_LEGACY];
  }
}
