Skip to content

Commit

Permalink
fix(proto): lint and fix annotation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
odsod committed Jul 29, 2022
1 parent 01136b0 commit 85cdb70
Show file tree
Hide file tree
Showing 5 changed files with 290 additions and 251 deletions.
2 changes: 1 addition & 1 deletion .sage/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module sage

go 1.17

require go.einride.tech/sage v0.137.0
require go.einride.tech/sage v0.142.0
4 changes: 2 additions & 2 deletions .sage/go.sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
go.einride.tech/sage v0.137.0 h1:WJXxslYuM6wrVLN90f5gqlL0pTKDKjt3PxRwhyNAAfU=
go.einride.tech/sage v0.137.0/go.mod h1:EzV5uciFX7/2ho8EKB5K9JghOfXIxlzs694b+Tkl5GQ=
go.einride.tech/sage v0.142.0 h1:nycRhZPf32EGN8fAgIFRqgjISXREy6UYiNLS8q7wN2Y=
go.einride.tech/sage v0.142.0/go.mod h1:EzV5uciFX7/2ho8EKB5K9JghOfXIxlzs694b+Tkl5GQ=
31 changes: 21 additions & 10 deletions proto/einride/example/freight/v1/freight_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,16 @@ import "google/protobuf/field_mask.proto";
//
// It defines the following resource model:
//
// - The API has a collection of [Shipper][einride.example.freight.v1.Shipper]
// resources, named `shippers/*`
// - The API has a collection of Shipper resources.
//
// - Each Shipper has a collection of [Site][einride.example.freight.v1.Site]
// resources, named `shippers/*/sites/*`
// - Each Shipper has a collection of Site resources.
//
// - Each Shipper has a collection of [Shipment][einride.example.freight.v1.Shipment]
// resources, named `shippers/*/shipments/*`
// - Each Shipper has a collection of Shipment resources.
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) = {
Expand All @@ -36,6 +34,7 @@ service FreightService {
}

// List shippers.
//
// See: https://google.aip.dev/132 (Standard methods: List).
rpc ListShippers(ListShippersRequest) returns (ListShippersResponse) {
option (google.api.http) = {
Expand All @@ -44,6 +43,7 @@ service FreightService {
}

// Create a shipper.
//
// See: https://google.aip.dev/133 (Standard methods: Create).
rpc CreateShipper(CreateShipperRequest) returns (Shipper) {
option (google.api.http) = {
Expand All @@ -54,6 +54,7 @@ service FreightService {
}

// Update a shipper.
//
// See: https://google.aip.dev/134 (Standard methods: Update).
rpc UpdateShipper(UpdateShipperRequest) returns (Shipper) {
option (google.api.http) = {
Expand All @@ -64,6 +65,7 @@ service FreightService {
}

// 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) {
Expand All @@ -74,6 +76,7 @@ service FreightService {
}

// Get a site.
//
// See: https://google.aip.dev/131 (Standard methods: Get).
rpc GetSite(GetSiteRequest) returns (Site) {
option (google.api.http) = {
Expand All @@ -83,6 +86,7 @@ service FreightService {
}

// List sites for a shipper.
//
// See: https://google.aip.dev/132 (Standard methods: List).
rpc ListSites(ListSitesRequest) returns (ListSitesResponse) {
option (google.api.http) = {
Expand All @@ -92,6 +96,7 @@ service FreightService {
}

// Create a site.
//
// See: https://google.aip.dev/133 (Standard methods: Create).
rpc CreateSite(CreateSiteRequest) returns (Site) {
option (google.api.http) = {
Expand All @@ -102,6 +107,7 @@ service FreightService {
}

// Update a site.
//
// See: https://google.aip.dev/134 (Standard methods: Update).
rpc UpdateSite(UpdateSiteRequest) returns (Site) {
option (google.api.http) = {
Expand All @@ -112,6 +118,7 @@ service FreightService {
}

// 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) {
Expand All @@ -122,6 +129,7 @@ service FreightService {
}

// Batch get sites.
//
// See: https://google.aip.dev/231 (Batch methods: Get).
rpc BatchGetSites(BatchGetSitesRequest) returns (BatchGetSitesResponse) {
option (google.api.http) = {
Expand All @@ -130,6 +138,7 @@ service FreightService {
}

// Get a shipment.
//
// See: https://google.aip.dev/131 (Standard methods: Get).
rpc GetShipment(GetShipmentRequest) returns (Shipment) {
option (google.api.http) = {
Expand All @@ -139,6 +148,7 @@ service FreightService {
}

// List shipments for a shipper.
//
// See: https://google.aip.dev/132 (Standard methods: List).
rpc ListShipments(ListShipmentsRequest) returns (ListShipmentsResponse) {
option (google.api.http) = {
Expand All @@ -148,6 +158,7 @@ service FreightService {
}

// Create a shipment.
//
// See: https://google.aip.dev/133 (Standard methods: Create).
rpc CreateShipment(CreateShipmentRequest) returns (Shipment) {
option (google.api.http) = {
Expand All @@ -158,6 +169,7 @@ service FreightService {
}

// Update a shipment.
//
// See: https://google.aip.dev/134 (Standard methods: Update).
rpc UpdateShipment(UpdateShipmentRequest) returns (Shipment) {
option (google.api.http) = {
Expand All @@ -168,6 +180,7 @@ service FreightService {
}

// 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) {
Expand Down Expand Up @@ -258,7 +271,6 @@ message ListSitesRequest {
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "freight-example.einride.tech/Shipper"
child_type: "freight-example.einride.tech/Site"
}
];

Expand Down Expand Up @@ -300,7 +312,7 @@ message CreateSiteRequest {
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "freight-example.einride.tech/Site"
type: "freight-example.einride.tech/Shipper"
}
];
// The site to create.
Expand Down Expand Up @@ -373,7 +385,6 @@ message ListShipmentsRequest {
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "freight-example.einride.tech/Shipper"
child_type: "freight-example.einride.tech/Shipment"
}
];

Expand Down Expand Up @@ -407,7 +418,7 @@ message CreateShipmentRequest {
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "freight-example.einride.tech/Shipment"
type: "freight-example.einride.tech/Shipper"
}
];
// The shipment to create.
Expand Down
Loading

0 comments on commit 85cdb70

Please sign in to comment.