-
Notifications
You must be signed in to change notification settings - Fork 240
/
message.proto
116 lines (107 loc) · 3.6 KB
/
message.proto
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
// Copyright 2021 Google LLC.
//
// 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 = "proto3";
package tests.protobuftypes.message.v1;
import "google/api/client.proto";
import "google/api/annotations.proto";
import "google/api/httpbody.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/wrappers.proto";
import "google/protobuf/timestamp.proto";
option go_package = "github.com/google/gnostic/apps/protoc-gen-openapi/examples/tests/protobuftypes/message/v1;message";
service Messaging {
option (google.api.default_host) = "foo.googleapi.com";
rpc CreateMessage(Message) returns (Message) {
option (google.api.http) = {
post : "/v1/messages/{message_id}"
body : "*"
};
}
rpc CreateMessagesFromCSV(google.api.HttpBody) returns (google.api.HttpBody) {
option (google.api.http) = {
post : "/v1/messages:csv"
body : "*"
};
}
rpc ListMessages(google.protobuf.Empty) returns (google.protobuf.Value) {
option (google.api.http) = {
get : "/v1/messages"
};
}
// OpenAPI does not allow requestBody in GET operations.
// But it should not convert it to query params either.
rpc ListMessagesCSV(google.api.HttpBody) returns (google.api.HttpBody) {
option (google.api.http) = {
get : "/v1/messages:csv"
};
}
rpc GetMessage(Message) returns (Message) {
option (google.api.http) = {
get : "/v1/messages/{message_id}"
};
}
rpc UpdateMessage(Message) returns (google.protobuf.Struct) {
option (google.api.http) = {
patch : "/v1/messages/{message_id}"
body : "body"
};
}
}
message RecursiveParent {
int32 parent_id = 1;
RecursiveChild child = 2;
}
message RecursiveChild {
int32 child_id = 1;
RecursiveParent parent = 2;
}
message SubMessage {
string message_id = 1;
SubSubMessage sub_sub_message = 2;
}
message SubSubMessage {
string message_id = 1;
repeated int32 integers = 2;
}
message Message {
message EmbMessage { string message_id = 1; }
string message_id = 1;
string string_type = 2;
RecursiveParent recursive_type = 3;
EmbMessage embedded_type = 4;
SubMessage sub_type = 5;
repeated string repeated_type = 6;
repeated SubMessage repeated_sub_type = 7;
repeated RecursiveParent repeated_recursive_type = 8;
map<string, string> map_type = 9;
google.protobuf.Struct body = 10;
repeated google.protobuf.Struct media = 11;
google.protobuf.Empty not_used = 12;
// Description of value
google.protobuf.Value value_type = 13;
// Description of repeated value
repeated google.protobuf.Value repeated_value_type = 14;
google.protobuf.BoolValue bool_value_type = 15;
google.protobuf.BytesValue bytes_value_type = 16;
google.protobuf.Int32Value int32_value_type = 17;
google.protobuf.UInt32Value uint32_value_type = 18;
google.protobuf.StringValue string_value_type = 19;
google.protobuf.Int64Value int64_value_type = 20;
google.protobuf.UInt64Value uint64_value_type = 21;
google.protobuf.FloatValue float_value_type = 22;
google.protobuf.DoubleValue double_value_type = 23;
google.protobuf.Timestamp timestamp_type = 24;
}