Skip to content
This repository was archived by the owner on Mar 23, 2023. It is now read-only.

Commit c214cbc

Browse files
author
Raphael Santo Domingo
committed
Add rust native implementation of protobufs
Signed-off-by: Raphael Santo Domingo <[email protected]>
1 parent b7ec9a4 commit c214cbc

File tree

5 files changed

+1147
-15
lines changed

5 files changed

+1147
-15
lines changed

sdk/protos/product_payload.proto

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,36 +37,24 @@ message ProductPayload {
3737
}
3838

3939
message ProductCreateAction {
40-
enum ProductType {
41-
UNSET_TYPE = 0;
42-
GS1 = 1;
43-
}
4440
// product_type and identifier are used in deriving the state address
45-
ProductType product_type = 1;
41+
Product.ProductType product_type = 1;
4642
string identifier = 2;
4743
string owner = 3;
4844
repeated PropertyValue properties = 4;
4945
}
5046

5147
message ProductUpdateAction {
52-
enum ProductType {
53-
UNSET_TYPE = 0;
54-
GS1 = 1;
55-
}
5648
// product_type and identifier are used in deriving the state address
57-
ProductType product_type = 1;
49+
Product.ProductType product_type = 1;
5850
string identifier = 2;
5951
// this will replace all properties currently defined
6052
repeated PropertyValue properties = 4;
6153
}
6254

6355
message ProductDeleteAction {
64-
enum ProductType {
65-
UNSET_TYPE = 0;
66-
GS1 = 1;
67-
}
6856
// product_type and identifier are used in deriving the state address
69-
ProductType product_type = 1;
57+
Product.ProductType product_type = 1;
7058
string identifier = 2;
7159
}
7260

sdk/src/protocol/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414

1515
pub mod errors;
1616
pub mod pike;
17+
pub mod product;
1718
pub mod schema;
1819
pub mod track_and_trace;

sdk/src/protocol/product/mod.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright (c) 2019 Target Brands, Inc.
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+
15+
use super::errors;
16+
17+
pub mod payload;
18+
pub mod state;

0 commit comments

Comments
 (0)