Declare an Automation target. An exact source excerpt. Inspect the complete file to see its imports, surrounding types, and error handling.
guest/go-module/product/automation.goExcerpt begins at line 35 File SHA-256 da971374d812a3d677914e2b5694c4634ccba36399f039fd034646bdcd11d3a5
Declare an Automation target go 35 // ActionTarget selects one governed operation. A targeted Action declares its 36 // subject with the same literal/occurrence source type as every other argument. 37 func ActionTarget(name string, subject ...Argument) AutomationTarget { 38 target := AutomationTarget{Kind: TargetAction, Name: name} 39 if len(subject) > 1 { 40 panic("ActionTarget accepts at most one subject") 41 } 42 if len(subject) == 1 { 43 copy := cloneArgument(subject[0]) 44 target.Subject = © 45 } 46 return target 47 } 48 func WorkflowTarget(name string) AutomationTarget { 49 return AutomationTarget{Kind: TargetWorkflow, Name: name} 50 } 51 func AgentTarget(name string) AutomationTarget { 52 return AutomationTarget{Kind: TargetAgent, Name: name} Run it in its product environment. This source depends on its surrounding product, generated libraries, and platform runtime. The website demonstrations run locally in your browser and do not execute this source against a workspace.