xref: /aosp_15_r20/external/federated-compute/fcp/client/http/java/jni.proto (revision 14675a029014e728ec732f129a32e299b2da0601)
1*14675a02SAndroid Build Coastguard Worker// Copyright 2022 Google LLC
2*14675a02SAndroid Build Coastguard Worker//
3*14675a02SAndroid Build Coastguard Worker// Licensed under the Apache License, Version 2.0 (the "License");
4*14675a02SAndroid Build Coastguard Worker// you may not use this file except in compliance with the License.
5*14675a02SAndroid Build Coastguard Worker// You may obtain a copy of the License at
6*14675a02SAndroid Build Coastguard Worker//
7*14675a02SAndroid Build Coastguard Worker//      http://www.apache.org/licenses/LICENSE-2.0
8*14675a02SAndroid Build Coastguard Worker//
9*14675a02SAndroid Build Coastguard Worker// Unless required by applicable law or agreed to in writing, software
10*14675a02SAndroid Build Coastguard Worker// distributed under the License is distributed on an "AS IS" BASIS,
11*14675a02SAndroid Build Coastguard Worker// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12*14675a02SAndroid Build Coastguard Worker// See the License for the specific language governing permissions and
13*14675a02SAndroid Build Coastguard Worker// limitations under the License.
14*14675a02SAndroid Build Coastguard Worker
15*14675a02SAndroid Build Coastguard Workersyntax = "proto3";
16*14675a02SAndroid Build Coastguard Worker
17*14675a02SAndroid Build Coastguard Workerpackage fcp.client.http.java;
18*14675a02SAndroid Build Coastguard Worker
19*14675a02SAndroid Build Coastguard Workeroption java_package = "com.google.fcp.client.http";
20*14675a02SAndroid Build Coastguard Workeroption java_multiple_files = true;
21*14675a02SAndroid Build Coastguard Workeroption java_outer_classname = "JniProto";
22*14675a02SAndroid Build Coastguard Worker
23*14675a02SAndroid Build Coastguard Worker// This file defines protos that are used to serialize data across the JNI
24*14675a02SAndroid Build Coastguard Worker// boundary, for use by `fcp::client::http::java::JavaHttpClient`.
25*14675a02SAndroid Build Coastguard Worker
26*14675a02SAndroid Build Coastguard Worker// Represents a serialized `fcp::client::http::HttpRequest` object.
27*14675a02SAndroid Build Coastguard Workermessage JniHttpRequest {
28*14675a02SAndroid Build Coastguard Worker  string uri = 1;
29*14675a02SAndroid Build Coastguard Worker  JniHttpMethod method = 2;
30*14675a02SAndroid Build Coastguard Worker  repeated JniHttpHeader extra_headers = 3;
31*14675a02SAndroid Build Coastguard Worker  bool has_body = 4;
32*14675a02SAndroid Build Coastguard Worker}
33*14675a02SAndroid Build Coastguard Worker
34*14675a02SAndroid Build Coastguard Worker// Represents a serialized `fcp::client::http::Header` object.
35*14675a02SAndroid Build Coastguard Workermessage JniHttpHeader {
36*14675a02SAndroid Build Coastguard Worker  string name = 1;
37*14675a02SAndroid Build Coastguard Worker  string value = 2;
38*14675a02SAndroid Build Coastguard Worker}
39*14675a02SAndroid Build Coastguard Worker
40*14675a02SAndroid Build Coastguard Worker// Represents a serialized `fcp::client::http::HttpRequest::Method` enum.
41*14675a02SAndroid Build Coastguard Workerenum JniHttpMethod {
42*14675a02SAndroid Build Coastguard Worker  HTTP_METHOD_UNKNOWN = 0;
43*14675a02SAndroid Build Coastguard Worker  HTTP_METHOD_HEAD = 1;
44*14675a02SAndroid Build Coastguard Worker  HTTP_METHOD_GET = 2;
45*14675a02SAndroid Build Coastguard Worker  HTTP_METHOD_POST = 3;
46*14675a02SAndroid Build Coastguard Worker  HTTP_METHOD_PUT = 4;
47*14675a02SAndroid Build Coastguard Worker  HTTP_METHOD_PATCH = 5;
48*14675a02SAndroid Build Coastguard Worker  HTTP_METHOD_DELETE = 6;
49*14675a02SAndroid Build Coastguard Worker}
50*14675a02SAndroid Build Coastguard Worker
51*14675a02SAndroid Build Coastguard Worker// Represents a serialized `fcp::client::http::HttpResponse` object.
52*14675a02SAndroid Build Coastguard Workermessage JniHttpResponse {
53*14675a02SAndroid Build Coastguard Worker  int32 code = 1;
54*14675a02SAndroid Build Coastguard Worker  repeated JniHttpHeader headers = 2;
55*14675a02SAndroid Build Coastguard Worker}
56*14675a02SAndroid Build Coastguard Worker
57*14675a02SAndroid Build Coastguard Worker// Represents a serialized
58*14675a02SAndroid Build Coastguard Worker// `fcp::client::http::HttpRequestHandle::SentReceivesBytes` object.
59*14675a02SAndroid Build Coastguard Workermessage JniHttpSentReceivedBytes {
60*14675a02SAndroid Build Coastguard Worker  int64 sent_bytes = 1;
61*14675a02SAndroid Build Coastguard Worker  int64 received_bytes = 2;
62*14675a02SAndroid Build Coastguard Worker}
63