@@ -732,7 +732,7 @@ impl ContainerProcessDefinition {
732732/// Represents the definition of a script evaluation process
733733#[ derive( Debug , Default , Clone , PartialEq , Serialize , Deserialize ) ]
734734pub struct ScriptProcessDefinition {
735-
735+
736736 /// Gets/sets the language of the script to run
737737 #[ serde( rename = "language" ) ]
738738 pub language : String ,
@@ -745,9 +745,13 @@ pub struct ScriptProcessDefinition{
745745 #[ serde( rename = "source" , skip_serializing_if = "Option::is_none" ) ]
746746 pub source : Option < ExternalResourceDefinition > ,
747747
748- /// Gets/sets a key/value mapping of the arguments, if any, to pass to the script to run
748+ /// Gets/sets the data to pass to the process via stdin
749+ #[ serde( rename = "stdin" , skip_serializing_if = "Option::is_none" ) ]
750+ pub stdin : Option < String > ,
751+
752+ /// Gets/sets a list of arguments, if any, to pass to the script (argv)
749753 #[ serde( rename = "arguments" , skip_serializing_if = "Option::is_none" ) ]
750- pub arguments : Option < HashMap < String , String > > ,
754+ pub arguments : Option < Vec < String > > ,
751755
752756 /// Gets/sets a key/value mapping of the environment variables, if any, to use when running the configured process
753757 #[ serde( rename = "environment" , skip_serializing_if = "Option::is_none" ) ]
@@ -757,23 +761,25 @@ pub struct ScriptProcessDefinition{
757761impl ScriptProcessDefinition {
758762
759763 /// Initializes a new script from code
760- pub fn from_code ( language : & str , code : String , arguments : Option < HashMap < String , String > > , environment : Option < HashMap < String , String > > ) -> Self {
761- Self {
762- language : language. to_string ( ) ,
763- code : Some ( code) ,
764- source : None ,
765- arguments,
764+ pub fn from_code ( language : & str , code : String , stdin : Option < String > , arguments : Option < Vec < String > > , environment : Option < HashMap < String , String > > ) -> Self {
765+ Self {
766+ language : language. to_string ( ) ,
767+ code : Some ( code) ,
768+ source : None ,
769+ stdin,
770+ arguments,
766771 environment
767772 }
768773 }
769774
770775 /// Initializes a new script from an external resource
771- pub fn from_source ( language : & str , source : ExternalResourceDefinition , arguments : Option < HashMap < String , String > > , environment : Option < HashMap < String , String > > ) -> Self {
772- Self {
773- language : language. to_string ( ) ,
774- code : None ,
775- source : Some ( source) ,
776- arguments,
776+ pub fn from_source ( language : & str , source : ExternalResourceDefinition , stdin : Option < String > , arguments : Option < Vec < String > > , environment : Option < HashMap < String , String > > ) -> Self {
777+ Self {
778+ language : language. to_string ( ) ,
779+ code : None ,
780+ source : Some ( source) ,
781+ stdin,
782+ arguments,
777783 environment
778784 }
779785 }
@@ -838,13 +844,29 @@ impl WorkflowProcessDefinition {
838844 }
839845}
840846
847+ /// Represents the value that can be set in a Set task - either a map or a runtime expression string
848+ #[ derive( Debug , Clone , PartialEq , Serialize , Deserialize ) ]
849+ #[ serde( untagged) ]
850+ pub enum SetValue {
851+ /// A map of key-value pairs to set
852+ Map ( HashMap < String , Value > ) ,
853+ /// A runtime expression string that evaluates to the data to set
854+ Expression ( String ) ,
855+ }
856+
857+ impl Default for SetValue {
858+ fn default ( ) -> Self {
859+ SetValue :: Map ( HashMap :: new ( ) )
860+ }
861+ }
862+
841863/// Represents the definition of a task used to set data
842864#[ derive( Debug , Default , Clone , PartialEq , Serialize , Deserialize ) ]
843865pub struct SetTaskDefinition {
844866
845867 /// Gets/sets the data to set
846868 #[ serde( rename = "set" ) ]
847- pub set : HashMap < String , Value > ,
869+ pub set : SetValue ,
848870
849871 /// Gets/sets the task's common fields
850872 #[ serde( flatten) ]
@@ -859,8 +881,8 @@ impl TaskDefinitionBase for SetTaskDefinition {
859881impl SetTaskDefinition {
860882 /// Initializes a new SetTaskDefinition
861883 pub fn new ( ) -> Self {
862- Self {
863- set : HashMap :: new ( ) ,
884+ Self {
885+ set : SetValue :: Map ( HashMap :: new ( ) ) ,
864886 common : TaskDefinitionFields :: new ( )
865887 }
866888 }
@@ -988,8 +1010,8 @@ pub struct ErrorFilterDefinition{
9881010pub struct WaitTaskDefinition {
9891011
9901012 /// Gets/sets the amount of time to wait before resuming workflow
991- #[ serde( rename = "duration " ) ]
992- pub duration : OneOfDurationOrIso8601Expression ,
1013+ #[ serde( rename = "wait " ) ]
1014+ pub wait : OneOfDurationOrIso8601Expression ,
9931015
9941016 /// Gets/sets the task's common fields
9951017 #[ serde( flatten) ]
@@ -1002,11 +1024,11 @@ impl TaskDefinitionBase for WaitTaskDefinition {
10021024 }
10031025}
10041026impl WaitTaskDefinition {
1005-
1027+
10061028 /// Initializes a new WaitTaskDefinition
1007- pub fn new ( duration : OneOfDurationOrIso8601Expression ) -> Self {
1008- Self {
1009- duration ,
1029+ pub fn new ( wait : OneOfDurationOrIso8601Expression ) -> Self {
1030+ Self {
1031+ wait ,
10101032 common : TaskDefinitionFields :: new ( )
10111033 }
10121034 }
0 commit comments