From e588c24e3ddeabf1ef62bd69e4bacbe9797904c1 Mon Sep 17 00:00:00 2001 From: Peter Krull Date: Fri, 21 Jun 2024 11:05:30 -0600 Subject: [PATCH 1/3] Add service definition for adding a material --- ansys/api/additive/VERSION | 2 +- ansys/api/additive/v0/additive_materials.proto | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ansys/api/additive/VERSION b/ansys/api/additive/VERSION index 85b2c0a..b38f36d 100644 --- a/ansys/api/additive/VERSION +++ b/ansys/api/additive/VERSION @@ -1 +1 @@ -1.7.0-dev4 \ No newline at end of file +1.7.0-dev5 \ No newline at end of file diff --git a/ansys/api/additive/v0/additive_materials.proto b/ansys/api/additive/v0/additive_materials.proto index 7675948..7425979 100644 --- a/ansys/api/additive/v0/additive_materials.proto +++ b/ansys/api/additive/v0/additive_materials.proto @@ -10,6 +10,8 @@ import "google/protobuf/empty.proto"; service MaterialsService { + rpc AddMaterial(AddMaterialRequest) return (AdditiveMaterial); + rpc GetMaterialsList (google.protobuf.Empty) returns (GetMaterialsListResponse); rpc GetMaterial (GetMaterialRequest) returns (AdditiveMaterial); @@ -17,6 +19,10 @@ service MaterialsService { rpc TuneMaterial (TuneMaterialRequest) returns (stream TuneMaterialResponse); } +message AddMaterialRequest { + AdditiveMaterial material = 1; +} + message GetMaterialRequest { string name = 1; } From f6f59d01d85c154ff2ac643d8470441657db14ac Mon Sep 17 00:00:00 2001 From: Peter Krull Date: Fri, 21 Jun 2024 11:11:56 -0600 Subject: [PATCH 2/3] Robustify add material messages --- ansys/api/additive/v0/additive_materials.proto | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ansys/api/additive/v0/additive_materials.proto b/ansys/api/additive/v0/additive_materials.proto index 7425979..ddde186 100644 --- a/ansys/api/additive/v0/additive_materials.proto +++ b/ansys/api/additive/v0/additive_materials.proto @@ -10,7 +10,7 @@ import "google/protobuf/empty.proto"; service MaterialsService { - rpc AddMaterial(AddMaterialRequest) return (AdditiveMaterial); + rpc AddMaterial(AddMaterialRequest) return (AddMaterialResponse); rpc GetMaterialsList (google.protobuf.Empty) returns (GetMaterialsListResponse); @@ -20,7 +20,16 @@ service MaterialsService { } message AddMaterialRequest { - AdditiveMaterial material = 1; + string id = 1; + AdditiveMaterial material = 2; +} + +message AddMaterialResponse { + string id = 1; + oneof ResponseType { + string error = 2; + AdditiveMaterial material = 3; + } } message GetMaterialRequest { From 3b2de292a08647f3b27aaf2ee1899808a27bfef6 Mon Sep 17 00:00:00 2001 From: Peter Krull Date: Fri, 21 Jun 2024 11:54:22 -0600 Subject: [PATCH 3/3] Fix syntax error --- ansys/api/additive/v0/additive_materials.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansys/api/additive/v0/additive_materials.proto b/ansys/api/additive/v0/additive_materials.proto index ddde186..b5d42a1 100644 --- a/ansys/api/additive/v0/additive_materials.proto +++ b/ansys/api/additive/v0/additive_materials.proto @@ -10,7 +10,7 @@ import "google/protobuf/empty.proto"; service MaterialsService { - rpc AddMaterial(AddMaterialRequest) return (AddMaterialResponse); + rpc AddMaterial(AddMaterialRequest) returns (AddMaterialResponse); rpc GetMaterialsList (google.protobuf.Empty) returns (GetMaterialsListResponse);