2
// Copyright 2015, Google Inc.
3
// All rights reserved.
5
// Redistribution and use in source and binary forms, with or without
6
// modification, are permitted provided that the following conditions are
9
// * Redistributions of source code must retain the above copyright
10
// notice, this list of conditions and the following disclaimer.
11
// * Redistributions in binary form must reproduce the above
12
// copyright notice, this list of conditions and the following disclaimer
13
// in the documentation and/or other materials provided with the
15
// * Neither the name of Google Inc. nor the names of its
16
// contributors may be used to endorse or promote products derived from
17
// this software without specific prior written permission.
19
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
// Message definitions to be used by integration test service definitions.
37
// The type of payload that should be returned.
39
// Compressable text format.
42
// Uncompressable binary format.
45
// Randomly chosen from all other formats defined in this enum.
49
// Compression algorithms
50
enum CompressionType {
57
// A block of data, to simply increase gRPC message size.
59
// The type of data in body.
60
optional PayloadType type = 1;
61
// Primary contents of payload.
62
optional bytes body = 2;
65
// A protobuf representation for grpc status. This is used by test
66
// clients to specify a status that the server should attempt to return.
68
optional int32 code = 1;
69
optional string message = 2;
73
message SimpleRequest {
74
// Desired payload type in the response from the server.
75
// If response_type is RANDOM, server randomly chooses one from other formats.
76
optional PayloadType response_type = 1;
78
// Desired payload size in the response from the server.
79
// If response_type is COMPRESSABLE, this denotes the size before compression.
80
optional int32 response_size = 2;
82
// Optional input payload sent along with the request.
83
optional Payload payload = 3;
85
// Whether SimpleResponse should include username.
86
optional bool fill_username = 4;
88
// Whether SimpleResponse should include OAuth scope.
89
optional bool fill_oauth_scope = 5;
91
// Compression algorithm to be used by the server for the response (stream)
92
optional CompressionType response_compression = 6;
94
// Whether server should return a given status
95
optional EchoStatus response_status = 7;
98
// Unary response, as configured by the request.
99
message SimpleResponse {
100
// Payload to increase message size.
101
optional Payload payload = 1;
102
// The user the request came from, for verifying authentication was
103
// successful when the client expected it.
104
optional string username = 2;
106
optional string oauth_scope = 3;
109
// Client-streaming request.
110
message StreamingInputCallRequest {
111
// Optional input payload sent along with the request.
112
optional Payload payload = 1;
114
// Not expecting any payload from the response.
117
// Client-streaming response.
118
message StreamingInputCallResponse {
119
// Aggregated size of payloads received from the client.
120
optional int32 aggregated_payload_size = 1;
123
// Configuration for a particular response.
124
message ResponseParameters {
125
// Desired payload sizes in responses from the server.
126
// If response_type is COMPRESSABLE, this denotes the size before compression.
127
optional int32 size = 1;
129
// Desired interval between consecutive responses in the response stream in
131
optional int32 interval_us = 2;
134
// Server-streaming request.
135
message StreamingOutputCallRequest {
136
// Desired payload type in the response from the server.
137
// If response_type is RANDOM, the payload from each response in the stream
138
// might be of different types. This is to simulate a mixed type of payload
140
optional PayloadType response_type = 1;
142
// Configuration for each expected response message.
143
repeated ResponseParameters response_parameters = 2;
145
// Optional input payload sent along with the request.
146
optional Payload payload = 3;
148
// Compression algorithm to be used by the server for the response (stream)
149
optional CompressionType response_compression = 6;
151
// Whether server should return a given status
152
optional EchoStatus response_status = 7;
155
// Server-streaming response, as configured by the request and parameters.
156
message StreamingOutputCallResponse {
157
// Payload to increase response size.
158
optional Payload payload = 1;