variants.proto 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. syntax = "proto2";
  2. // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto {
  3. // `Struct` represents a structured data value, consisting of fields
  4. // which map to dynamically typed values. In some languages, `Struct`
  5. // might be supported by a native representation. For example, in
  6. // scripting languages like JS a struct is represented as an
  7. // object. The details of that representation are described together
  8. // with the proto support for the language.
  9. //
  10. // The JSON representation for `Struct` is JSON object.
  11. message Struct {
  12. // Unordered map of dynamically typed values.
  13. map<string, Value> fields = 1;
  14. }
  15. // `Value` represents a dynamically typed value which can be either
  16. // null, a number, a string, a boolean, a recursive struct value, or a
  17. // list of values. A producer of value is expected to set one of these
  18. // variants. Absence of any variant indicates an error.
  19. //
  20. // The JSON representation for `Value` is JSON value.
  21. message Value {
  22. // The kind of value.
  23. oneof kind {
  24. // Represents a null value.
  25. NullValue null_value = 1;
  26. // Represents a double value.
  27. double number_value = 2;
  28. // Represents a string value.
  29. string string_value = 3;
  30. // Represents a boolean value.
  31. bool bool_value = 4;
  32. // Represents a integer value.
  33. uint64 varint_value = 5;
  34. // Represents a repeated `Value`.
  35. ListValue list_value = 6;
  36. }
  37. }
  38. // `NullValue` is a singleton enumeration to represent the null value for the
  39. // `Value` type union.
  40. //
  41. // The JSON representation for `NullValue` is JSON `null`.
  42. enum NullValue {
  43. // Null value.
  44. NULL_VALUE = 0;
  45. }
  46. // `ListValue` is a wrapper around a repeated field of values.
  47. //
  48. // The JSON representation for `ListValue` is JSON array.
  49. message ListValue {
  50. // Repeated field of dynamically typed values.
  51. repeated Value values = 1;
  52. }
  53. // } https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto
  54. message FeatureResponse_Params {
  55. required string name = 1;
  56. optional bool value = 2;
  57. optional Struct values = 3;
  58. }
  59. message FeatureResponse {
  60. repeated FeatureResponse_Params variants = 1;
  61. }
  62. message FeatureRequest_Params {
  63. repeated string param = 1;
  64. }
  65. message FeatureRequest {
  66. repeated FeatureRequest_Params params = 1;
  67. optional string str_player_id = 2;
  68. map<string, string> user_attrs = 3;
  69. }