This commit is contained in:
2025-04-12 12:38:00 +08:00
parent 5341dfcd1a
commit 52bfd05b80
47 changed files with 4730 additions and 2 deletions

View File

@@ -0,0 +1,371 @@
syntax = "proto3";
package einride.example.freight.v1;
import "einride/example/freight/v1/shipment.proto";
import "einride/example/freight/v1/shipper.proto";
import "einride/example/freight/v1/site.proto";
import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/field_mask.proto";
// This API represents a simple freight service.
//
// It defines the following resource model:
//
// - The API has a collection of [Shipper][einride.example.freight.v1.Shipper]
// resources, named `shippers/*`
//
// - Each Shipper has a collection of [Site][einride.example.freight.v1.Site]
// resources, named `shippers/*/sites/*`
//
// - Each Shipper has a collection of [Shipment][einride.example.freight.v1.Shipment]
// resources, named `shippers/*/shipments/*`
service FreightService {
option (google.api.default_host) = "freight-example.einride.tech";
// Get a shipper.
// See: https://google.aip.dev/131 (Standard methods: Get).
rpc GetShipper(GetShipperRequest) returns (Shipper) {
option (google.api.http) = {get: "/v1/{name=shippers/*}"};
option (google.api.method_signature) = "name";
}
// List shippers.
// See: https://google.aip.dev/132 (Standard methods: List).
rpc ListShippers(ListShippersRequest) returns (ListShippersResponse) {
option (google.api.http) = {get: "/v1/shippers"};
}
// Create a shipper.
// See: https://google.aip.dev/133 (Standard methods: Create).
rpc CreateShipper(CreateShipperRequest) returns (Shipper) {
option (google.api.http) = {
post: "/v1/shippers"
body: "shipper"
};
option (google.api.method_signature) = "shipper";
}
// Update a shipper.
// See: https://google.aip.dev/134 (Standard methods: Update).
rpc UpdateShipper(UpdateShipperRequest) returns (Shipper) {
option (google.api.http) = {
patch: "/v1/{shipper.name=shippers/*}"
body: "shipper"
};
option (google.api.method_signature) = "shipper,update_mask";
}
// Delete a shipper.
// See: https://google.aip.dev/135 (Standard methods: Delete).
// See: https://google.aip.dev/164 (Soft delete).
rpc DeleteShipper(DeleteShipperRequest) returns (Shipper) {
option (google.api.http) = {delete: "/v1/{name=shippers/*}"};
option (google.api.method_signature) = "name";
}
// Get a site.
// See: https://google.aip.dev/131 (Standard methods: Get).
rpc GetSite(GetSiteRequest) returns (Site) {
option (google.api.http) = {get: "/v1/{name=shippers/*/sites/*}"};
option (google.api.method_signature) = "name";
}
// List sites for a shipper.
// See: https://google.aip.dev/132 (Standard methods: List).
rpc ListSites(ListSitesRequest) returns (ListSitesResponse) {
option (google.api.http) = {get: "/v1/{parent=shippers/*}/sites"};
option (google.api.method_signature) = "parent";
}
// Create a site.
// See: https://google.aip.dev/133 (Standard methods: Create).
rpc CreateSite(CreateSiteRequest) returns (Site) {
option (google.api.http) = {
post: "/v1/{parent=shippers/*}/sites"
body: "site"
};
option (google.api.method_signature) = "parent,site";
}
// Update a site.
// See: https://google.aip.dev/134 (Standard methods: Update).
rpc UpdateSite(UpdateSiteRequest) returns (Site) {
option (google.api.http) = {
patch: "/v1/{site.name=shippers/*/sites/*}"
body: "site"
};
option (google.api.method_signature) = "site,update_mask";
}
// Delete a site.
// See: https://google.aip.dev/135 (Standard methods: Delete).
// See: https://google.aip.dev/164 (Soft delete).
rpc DeleteSite(DeleteSiteRequest) returns (Site) {
option (google.api.http) = {delete: "/v1/{name=shippers/*/sites/*}"};
option (google.api.method_signature) = "name";
}
// Get a shipment.
// See: https://google.aip.dev/131 (Standard methods: Get).
rpc GetShipment(GetShipmentRequest) returns (Shipment) {
option (google.api.http) = {get: "/v1/{name=shippers/*/shipments/*}"};
option (google.api.method_signature) = "name";
}
// List shipments for a shipper.
// See: https://google.aip.dev/132 (Standard methods: List).
rpc ListShipments(ListShipmentsRequest) returns (ListShipmentsResponse) {
option (google.api.http) = {get: "/v1/{parent=shippers/*}/shipments"};
option (google.api.method_signature) = "parent";
}
// Create a shipment.
// See: https://google.aip.dev/133 (Standard methods: Create).
rpc CreateShipment(CreateShipmentRequest) returns (Shipment) {
option (google.api.http) = {
post: "/v1/{parent=shippers/*}/shipments"
body: "shipment"
};
option (google.api.method_signature) = "parent,shipment";
}
// Update a shipment.
// See: https://google.aip.dev/134 (Standard methods: Update).
rpc UpdateShipment(UpdateShipmentRequest) returns (Shipment) {
option (google.api.http) = {
patch: "/v1/{shipment.name=shippers/*/shipments/*}"
body: "shipment"
};
option (google.api.method_signature) = "shipment,update_mask";
}
// Delete a shipment.
// See: https://google.aip.dev/135 (Standard methods: Delete).
// See: https://google.aip.dev/164 (Soft delete).
rpc DeleteShipment(DeleteShipmentRequest) returns (Shipment) {
option (google.api.http) = {delete: "/v1/{name=shippers/*/shipments/*}"};
option (google.api.method_signature) = "name";
}
}
// Request message for FreightService.GetShipper.
message GetShipperRequest {
// The resource name of the shipper to retrieve.
// Format: shippers/{shipper}
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference).type = "freight-example.einride.tech/Shipper"
];
}
// Request message for FreightService.ListShippers.
message ListShippersRequest {
// Requested page size. Server may return fewer shippers than requested.
// If unspecified, server will pick an appropriate default.
int32 page_size = 1;
// A token identifying a page of results the server should return.
// Typically, this is the value of
// [ListShippersResponse.next_page_token][einride.example.freight.v1.ListShippersResponse.next_page_token]
// returned from the previous call to `ListShippers` method.
string page_token = 2;
}
// Response message for FreightService.ListShippers.
message ListShippersResponse {
// The list of shippers.
repeated Shipper shippers = 1;
// A token to retrieve next page of results. Pass this value in the
// [ListShippersRequest.page_token][einride.example.freight.v1.ListShippersRequest.page_token]
// field in the subsequent call to `ListShippers` method to retrieve the next
// page of results.
string next_page_token = 2;
}
// Request message for FreightService.CreateShipper.
message CreateShipperRequest {
// The shipper to create.
Shipper shipper = 1 [(google.api.field_behavior) = REQUIRED];
}
// Request message for FreightService.UpdateShipper.
message UpdateShipperRequest {
// The shipper to update with. The name must match or be empty.
// The shipper's `name` field is used to identify the shipper to be updated.
// Format: shippers/{shipper}
Shipper shipper = 1 [(google.api.field_behavior) = REQUIRED];
// The list of fields to be updated.
google.protobuf.FieldMask update_mask = 2;
}
// Request message for FreightService.DeleteShipper.
message DeleteShipperRequest {
// The resource name of the shipper to delete.
// Format: shippers/{shipper}
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference).type = "freight-example.einride.tech/Shipper"
];
}
// Request message for FreightService.GetSite.
message GetSiteRequest {
// The resource name of the site to retrieve.
// Format: shippers/{shipper}/sites/{site}
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference).type = "freight-example.einride.tech/Site"
];
}
// Request message for FreightService.ListSites.
message ListSitesRequest {
// The resource name of the parent, which owns this collection of sites.
// Format: shippers/{shipper}
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "freight-example.einride.tech/Shipper"
child_type: "freight-example.einride.tech/Site"
}
];
// Requested page size. Server may return fewer sites than requested.
// If unspecified, server will pick an appropriate default.
int32 page_size = 2;
// A token identifying a page of results the server should return.
// Typically, this is the value of
// [ListSitesResponse.next_page_token][einride.example.freight.v1.ListSitesResponse.next_page_token]
// returned from the previous call to `ListSites` method.
string page_token = 3;
}
// Response message for FreightService.ListSites.
message ListSitesResponse {
// The list of sites.
repeated Site sites = 1;
// A token to retrieve next page of results. Pass this value in the
// [ListSitesRequest.page_token][einride.example.freight.v1.ListSitesRequest.page_token]
// field in the subsequent call to `ListSites` method to retrieve the next
// page of results.
string next_page_token = 2;
}
// Request message for FreightService.CreateSite.
message CreateSiteRequest {
// The resource name of the parent shipper for which this site will be created.
// Format: shippers/{shipper}
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {child_type: "freight-example.einride.tech/Shipper"}
];
// The site to create.
Site site = 2 [(google.api.field_behavior) = REQUIRED];
}
// Request message for FreightService.UpdateSite.
message UpdateSiteRequest {
// The site to update with. The name must match or be empty.
// The site's `name` field is used to identify the site to be updated.
// Format: shippers/{shipper}/sites/{site}
Site site = 1 [(google.api.field_behavior) = REQUIRED];
// The list of fields to be updated.
google.protobuf.FieldMask update_mask = 2;
}
// Request message for FreightService.DeleteSite.
message DeleteSiteRequest {
// The resource name of the site to delete.
// Format: shippers/{shipper}/sites/{site}
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference).type = "freight-example.einride.tech/Site"
];
}
// Request message for FreightService.GetShipment.
message GetShipmentRequest {
// The resource name of the shipment to retrieve.
// Format: shippers/{shipper}/shipments/{shipment}
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference).type = "freight-example.einride.tech/Shipment"
];
}
// Request message for FreightService.ListShipments.
message ListShipmentsRequest {
// The resource name of the parent, which owns this collection of shipments.
// Format: shippers/{shipper}
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "freight-example.einride.tech/Shipper"
child_type: "freight-example.einride.tech/Shipment"
}
];
// Requested page size. Server may return fewer shipments than requested.
// If unspecified, server will pick an appropriate default.
int32 page_size = 2;
// A token identifying a page of results the server should return.
// Typically, this is the value of
// [ListShipmentsResponse.next_page_token][einride.example.freight.v1.ListShipmentsResponse.next_page_token]
// returned from the previous call to `ListShipments` method.
string page_token = 3;
}
// Response message for FreightService.ListShipments.
message ListShipmentsResponse {
// The list of shipments.
repeated Shipment shipments = 1;
// A token to retrieve next page of results. Pass this value in the
// [ListShipmentsRequest.page_token][einride.example.freight.v1.ListShipmentsRequest.page_token]
// field in the subsequent call to `ListShipments` method to retrieve the next
// page of results.
string next_page_token = 2;
}
// Request message for FreightService.CreateShipment.
message CreateShipmentRequest {
// The resource name of the parent shipper for which this shipment will be created.
// Format: shippers/{shipper}
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {child_type: "freight-example.einride.tech/Shipper"}
];
// The shipment to create.
Shipment shipment = 2 [(google.api.field_behavior) = REQUIRED];
}
// Request message for FreightService.UpdateShipment.
message UpdateShipmentRequest {
// The shipment to update with. The name must match or be empty.
// The shipment's `name` field is used to identify the shipment to be updated.
// Format: shippers/{shipper}/shipments/{shipment}
Shipment shipment = 1 [(google.api.field_behavior) = REQUIRED];
// The list of fields to be updated.
google.protobuf.FieldMask update_mask = 2;
}
// Request message for FreightService.DeleteShipment.
message DeleteShipmentRequest {
// The resource name of the shipment to delete.
// Format: shippers/{shipper}/shipments/{shipment}
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference).type = "freight-example.einride.tech/Shipment"
];
}

View File

@@ -0,0 +1,77 @@
syntax = "proto3";
package einride.example.freight.v1;
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/timestamp.proto";
// A shipment represents transportation of goods between an origin
// [site][einride.example.freight.v1.Site] and a destination
// [site][einride.example.freight.v1.Site].
message Shipment {
option (google.api.resource) = {
type: "freight-example.einride.tech/Shipment"
pattern: "shippers/{shipper}/shipments/{shipment}"
singular: "shipment"
plural: "shipments"
};
// The resource name of the shipment.
string name = 1;
// The creation timestamp of the shipment.
google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
// The last update timestamp of the shipment.
//
// Updated when create/update/delete operation is shipment.
google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
// The deletion timestamp of the shipment.
google.protobuf.Timestamp delete_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
// The resource name of the origin site of the shipment.
// Format: shippers/{shipper}/sites/{site}
string origin_site = 5 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference).type = "freight-example.einride.tech/Site"
];
// The resource name of the destination site of the shipment.
// Format: shippers/{shipper}/sites/{site}
string destination_site = 6 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference).type = "freight-example.einride.tech/Site"
];
// The earliest pickup time of the shipment at the origin site.
google.protobuf.Timestamp pickup_earliest_time = 7 [(google.api.field_behavior) = REQUIRED];
// The latest pickup time of the shipment at the origin site.
google.protobuf.Timestamp pickup_latest_time = 8 [(google.api.field_behavior) = REQUIRED];
// The earliest delivery time of the shipment at the destination site.
google.protobuf.Timestamp delivery_earliest_time = 9 [(google.api.field_behavior) = REQUIRED];
// The latest delivery time of the shipment at the destination site.
google.protobuf.Timestamp delivery_latest_time = 10 [(google.api.field_behavior) = REQUIRED];
// The line items of the shipment.
repeated LineItem line_items = 11;
// Annotations of the shipment.
map<string, string> annotations = 12;
}
// A shipment line item.
message LineItem {
// The title of the line item.
string title = 1;
// The quantity of the line item.
float quantity = 2;
// The weight of the line item in kilograms.
float weight_kg = 3;
// The volume of the line item in cubic meters.
float volume_m3 = 4;
}

View File

@@ -0,0 +1,29 @@
syntax = "proto3";
package einride.example.freight.v1;
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/timestamp.proto";
// A shipper is a supplier or owner of goods to be transported.
message Shipper {
option (google.api.resource) = {
type: "freight-example.einride.tech/Shipper"
pattern: "shippers/{shipper}"
singular: "shipper"
plural: "shippers"
};
// The resource name of the shipper.
string name = 1;
// The creation timestamp of the shipper.
google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
// The last update timestamp of the shipper.
//
// Updated when create/update/delete operation is performed.
google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
// The deletion timestamp of the shipper.
google.protobuf.Timestamp delete_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
// The display name of the shipper.
string display_name = 5 [(google.api.field_behavior) = REQUIRED];
}

View File

@@ -0,0 +1,33 @@
syntax = "proto3";
package einride.example.freight.v1;
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/timestamp.proto";
import "google/type/latlng.proto";
// A site is a node in a [shipper][einride.example.freight.v1.Shipper]'s
// transport network.
message Site {
option (google.api.resource) = {
type: "freight-example.einride.tech/Site"
pattern: "shippers/{shipper}/sites/{site}"
singular: "site"
plural: "sites"
};
// The resource name of the site.
string name = 1;
// The creation timestamp of the site.
google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
// The last update timestamp of the site.
//
// Updated when create/update/delete operation is performed.
google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
// The deletion timestamp of the site.
google.protobuf.Timestamp delete_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
// The display name of the site.
string display_name = 5 [(google.api.field_behavior) = REQUIRED];
// The geographic location of the site.
google.type.LatLng lat_lng = 6;
}

View File

@@ -0,0 +1,240 @@
syntax = "proto3";
package einride.example.syntax.v1;
import "google/protobuf/any.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/wrappers.proto";
// Message
message Message {
// NestedMessage
message NestedMessage {
// nested_message.string
string string = 1;
}
// NestedEnum
enum NestedEnum {
// NESTEDENUM_UNSPECIFIED
NESTEDENUM_UNSPECIFIED = 0;
}
// double
double double = 1;
// float
float float = 2;
// int32
int32 int32 = 3;
// int64
int64 int64 = 4;
// uint32
uint32 uint32 = 5;
// uint64
uint64 uint64 = 6;
// sint32
sint32 sint32 = 7;
// sint64
sint64 sint64 = 8;
// fixed32
fixed32 fixed32 = 9;
// fixed64
fixed64 fixed64 = 10;
// sfixed32
sfixed32 sfixed32 = 11;
// sfixed64
sfixed64 sfixed64 = 12;
// bool
bool bool = 13;
// string
string string = 14;
// bytes
bytes bytes = 15;
// enum
Enum enum = 16;
// message
Message message = 17;
// optional double
optional double optional_double = 81;
// optional float
optional float optional_float = 82;
// optional int32
optional int32 optional_int32 = 83;
// optional int64
optional int64 optional_int64 = 84;
// optional uint32
optional uint32 optional_uint32 = 85;
// optional uint64
optional uint64 optional_uint64 = 86;
// optional sint32
optional sint32 optional_sint32 = 87;
// optional sint64
optional sint64 optional_sint64 = 88;
// optional fixed32
optional fixed32 optional_fixed32 = 89;
// optional fixed64
optional fixed64 optional_fixed64 = 90;
// optional sfixed32
optional sfixed32 optional_sfixed32 = 91;
// optional sfixed64
optional sfixed64 optional_sfixed64 = 92;
// optional bool
optional bool optional_bool = 93;
// optional string
optional string optional_string = 94;
// optional bytes
optional bytes optional_bytes = 95;
// optional enum
optional Enum optional_enum = 96;
// optional message
optional Message optional_message = 97;
// repeated_double
repeated double repeated_double = 18;
// repeated_float
repeated float repeated_float = 19;
// repeated_int32
repeated int32 repeated_int32 = 20;
// repeated_int64
repeated int64 repeated_int64 = 21;
// repeated_uint32
repeated uint32 repeated_uint32 = 22;
// repeated_uint64
repeated uint64 repeated_uint64 = 23;
// repeated_sint32
repeated sint32 repeated_sint32 = 24;
// repeated_sint64
repeated sint64 repeated_sint64 = 25;
// repeated_fixed32
repeated fixed32 repeated_fixed32 = 26;
// repeated_fixed64
repeated fixed64 repeated_fixed64 = 27;
// repeated_sfixed32
repeated sfixed32 repeated_sfixed32 = 28;
// repeated_sfixed64
repeated sfixed64 repeated_sfixed64 = 29;
// repeated_bool
repeated bool repeated_bool = 30;
// repeated_string
repeated string repeated_string = 31;
// repeated_bytes
repeated bytes repeated_bytes = 32;
// repeated_enum
repeated Enum repeated_enum = 33;
// repeated_message
repeated Message repeated_message = 34;
// map_string_string
map<string, string> map_string_string = 35;
// map_string_message
map<string, Message> map_string_message = 36;
// oneof
oneof oneof {
// oneof_string
string oneof_string = 37;
// oneof_enum
Enum oneof_enum = 38;
// oneof_message1
Message oneof_message1 = 39;
// oneof_message2
Message oneof_message2 = 40;
}
// any
google.protobuf.Any any = 41;
// repeated_any
repeated google.protobuf.Any repeated_any = 42;
// duration
google.protobuf.Duration duration = 43;
// repeated_duration
repeated google.protobuf.Duration repeated_duration = 44;
// empty
google.protobuf.Empty empty = 45;
// repeated_empty
repeated google.protobuf.Empty repeated_empty = 46;
// field_mask
google.protobuf.FieldMask field_mask = 47;
// repeated_field_mask
repeated google.protobuf.FieldMask repeated_field_mask = 48;
// struct
google.protobuf.Struct struct = 49;
// repeated_struct
repeated google.protobuf.Struct repeated_struct = 50;
// value
google.protobuf.Value value = 51;
// repeated_value
repeated google.protobuf.Value repeated_value = 52;
// null_value
google.protobuf.NullValue null_value = 53;
// repeated_null_value
repeated google.protobuf.NullValue repeated_null_value = 54;
// list_value
google.protobuf.ListValue list_value = 55;
// repeated_list_value
repeated google.protobuf.ListValue repeated_list_value = 56;
// bool_value
google.protobuf.BoolValue bool_value = 57;
// repeated_bool_value
repeated google.protobuf.BoolValue repeated_bool_value = 58;
// bytes_value
google.protobuf.BytesValue bytes_value = 59;
// repeated_bytes_value
repeated google.protobuf.BytesValue repeated_bytes_value = 60;
// double_value
google.protobuf.DoubleValue double_value = 61;
// repeated_double_value
repeated google.protobuf.DoubleValue repeated_double_value = 62;
// float_value
google.protobuf.FloatValue float_value = 63;
// repeated_float_value
repeated google.protobuf.FloatValue repeated_float_value = 64;
// int32_value
google.protobuf.Int32Value int32_value = 65;
// repeated_int32_value
repeated google.protobuf.Int32Value repeated_int32_value = 66;
// int64_value
google.protobuf.Int64Value int64_value = 67;
// repeated_int64_value
repeated google.protobuf.Int64Value repeated_int64_value = 68;
// uint32_value
google.protobuf.UInt32Value uint32_value = 69;
// repeated_uint32_value
repeated google.protobuf.UInt32Value repeated_uint32_value = 70;
// uint64_value
google.protobuf.UInt64Value uint64_value = 71;
// repeated_uint64_value
repeated google.protobuf.UInt64Value repeated_uint64_value = 72;
// string_value
google.protobuf.UInt64Value string_value = 73;
// repeated_string_value
repeated google.protobuf.StringValue repeated_string_value = 74;
}
// Enum
enum Enum {
// ENUM_UNSPECIFIED
ENUM_UNSPECIFIED = 0;
// ENUM_ONE
ENUM_ONE = 1;
// ENUM_TWO
ENUM_TWO = 2;
}

View File

@@ -0,0 +1,51 @@
syntax = "proto3";
package einride.example.syntax.v1;
import "einride/example/syntax/v1/syntax.proto";
import "google/api/annotations.proto";
import "google/protobuf/empty.proto";
service SyntaxService {
rpc QueryOnly(Request) returns (Message) {
option (google.api.http) = {get: "/v1"};
}
rpc EmptyVerb(google.protobuf.Empty) returns (google.protobuf.Empty) {
option (google.api.http) = {get: "/v1:emptyVerb"};
}
rpc StarBody(Request) returns (Message) {
option (google.api.http) = {
post: "/v1:starBody"
body: "*"
};
}
rpc Body(Request) returns (Message) {
option (google.api.http) = {
post: "/v1:body"
body: "nested"
};
}
rpc Path(Request) returns (Message) {
option (google.api.http) = {post: "/v1/{string}:path"};
}
rpc PathBody(Request) returns (Message) {
option (google.api.http) = {
post: "/v1/{string}:pathBody"
body: "nested"
};
}
}
message Request {
string string = 1;
repeated string repeated_string = 2;
message Nested {
string string = 1;
}
Nested nested = 3;
}

View File

@@ -0,0 +1,11 @@
syntax = "proto3";
package einride.example.syntax.v2;
import "einride/example/syntax/v1/syntax.proto";
// Message
message Message {
einride.example.syntax.v1.Message forwarded_message = 1;
einride.example.syntax.v1.Enum forwarded_enum = 2;
}