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