File: example.proto

package info (click to toggle)
golang-github-grpc-ecosystem-grpc-gateway 2.20.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 7,236 kB
  • sloc: javascript: 357; makefile: 147; sh: 26
file content (138 lines) | stat: -rw-r--r-- 3,458 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
syntax = "proto3";

package grpc.gateway.runtime.internal.examplepb;

import "google/protobuf/any.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";

option go_package = "github.com/grpc-ecosystem/grpc-gateway/v2/runtime/internal/examplepb";

// SimpleMessage represents a simple message sent to the Echo service.
message SimpleMessage {
  string id = 1;
}

message ABitOfEverything {
  // Nested is nested type.
  message Nested {
    // name is nested field.
    string name = 1;
    uint32 amount = 2;
    // DeepEnum is one or zero.
    enum DeepEnum {
      // FALSE is false.
      FALSE = 0;
      // TRUE is true.
      TRUE = 1;
    }
    // DeepEnum comment.
    DeepEnum ok = 3;
  }
  Nested single_nested = 25;
  string uuid = 1;
  repeated Nested nested = 2;
  float float_value = 3;
  double double_value = 4;
  int64 int64_value = 5;
  uint64 uint64_value = 6;
  int32 int32_value = 7;
  fixed64 fixed64_value = 8;
  fixed32 fixed32_value = 9;
  bool bool_value = 10;
  string string_value = 11;
  bytes bytes_value = 29;
  uint32 uint32_value = 13;
  NumericEnum enum_value = 14;
  sfixed32 sfixed32_value = 15;
  sfixed64 sfixed64_value = 16;
  sint32 sint32_value = 17;
  sint64 sint64_value = 18;
  repeated string repeated_string_value = 19;
  oneof oneof_value {
    google.protobuf.Empty oneof_empty = 20;
    string oneof_string = 21;
  }
  map<string, NumericEnum> map_value = 22;
  map<string, string> mapped_string_value = 23;
  map<string, Nested> mapped_nested_value = 24;
  string nonConventionalNameValue = 26;
  google.protobuf.Timestamp timestamp_value = 27;
  // repeated enum value. it is comma-separated in query
  repeated NumericEnum repeated_enum_value = 28;
  // repeated numeric enum comment (This comment is overridden by the field
  // annotation)
  repeated NumericEnum repeated_enum_annotation = 32;
  // numeric enum comment (This comment is overridden by the field annotation)
  NumericEnum enum_value_annotation = 33;
  // repeated string comment (This comment is overridden by the field
  // annotation)
  repeated string repeated_string_annotation = 34;
  // repeated nested object comment (This comment is overridden by the field
  // annotation)
  repeated Nested repeated_nested_annotation = 35;
  // nested object comments (This comment is overridden by the field annotation)
  Nested nested_annotation = 36;
  int64 int64_override_type = 37;
  google.protobuf.Any anytype = 38;
  repeated google.protobuf.Any repeated_anytype = 39;
}

// NumericEnum is one or zero.
enum NumericEnum {
  // ZERO means 0
  ZERO = 0;
  // ONE means 1
  ONE = 1;
}

message ResponseBodyOut {
  message Response {
    string data = 1;
  }
  Response response = 2;
}

message RepeatedResponseBodyOut {
  message Response {
    string data = 1;
    enum ResponseType {
      // UNKNOWN
      UNKNOWN = 0;
      // A is 1
      A = 1;
      // B is 2
      B = 2;
    }
    ResponseType type = 3;
  }
  repeated Response response = 2;
}

message UpdateMessage {
  google.protobuf.FieldMask update_mask = 1;
  ABitOfEverything a_bit_of_everything = 2;
}

message NestedOuter {
  NestedOne one = 1;
}

message NestedOne {
  NestedTwo two = 1;
}

message NestedTwo {
  NestedThree three = 1;
}

message NestedThree {
  bool a = 1;
  bool b = 2;
}

message UpdateNestedRequest {
  NestedOuter nested = 1;
  google.protobuf.FieldMask update_mask = 2;
}