mirror of
https://gitlab.com/fabinfra/fabaccess/fabaccess-api.git
synced 2025-03-11 22:31:47 +01:00
return Optional value for searches
This commit is contained in:
parent
049b183f96
commit
aa006507c4
@ -25,4 +25,11 @@ struct UUID {
|
|||||||
struct KeyValuePair {
|
struct KeyValuePair {
|
||||||
key @0 :Text;
|
key @0 :Text;
|
||||||
value @1 :Text;
|
value @1 :Text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct Optional(T) {
|
||||||
|
union {
|
||||||
|
nothing @0 :Void;
|
||||||
|
just @1 :T;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -7,6 +7,7 @@ using CSharp = import "programming_language/csharp.capnp";
|
|||||||
$CSharp.namespace("FabAccessAPI.Schema");
|
$CSharp.namespace("FabAccessAPI.Schema");
|
||||||
|
|
||||||
using General = import "general.capnp";
|
using General = import "general.capnp";
|
||||||
|
using Optional = General.Optional;
|
||||||
using Machine = import "machine.capnp".Machine;
|
using Machine = import "machine.capnp".Machine;
|
||||||
|
|
||||||
struct MachineSystem
|
struct MachineSystem
|
||||||
@ -15,7 +16,7 @@ struct MachineSystem
|
|||||||
interface Info $CSharp.name("InfoInterface") {
|
interface Info $CSharp.name("InfoInterface") {
|
||||||
getMachineList @0 () -> ( machine_list :List(Machine) );
|
getMachineList @0 () -> ( machine_list :List(Machine) );
|
||||||
|
|
||||||
getMachine @1 ( id :Text ) -> Machine;
|
getMachine @1 ( id :Text ) -> Optional(Machine);
|
||||||
getMachineURN @2 ( urn :Text ) -> Machine;
|
getMachineURN @2 ( urn :Text ) -> Optional(Machine);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user