@@ -48,20 +48,33 @@ const (
4848)
4949
5050type Action struct {
51- ID * string `json:"id,omitempty"`
51+ // ID of the action
52+ ID * string `json:"id,omitempty"`
53+ // The name of an action
5254 Name * string `json:"name"`
53- Code * string `json:"code,omitempty"` // nil in embedded Action in ActionVersion
54-
55- SupportedTriggers []ActionTrigger `json:"supported_triggers"`
56- Dependencies []ActionDependency `json:"dependencies,omitempty"`
57- Secrets []ActionSecret `json:"secrets,omitempty"`
58-
59- DeployedVersion * ActionVersion `json:"deployed_version,omitempty"`
60- Status * string `json:"status,omitempty"`
61- AllChangesDeployed bool `json:"all_changes_deployed,omitempty"`
62-
63- BuiltAt * time.Time `json:"built_at,omitempty"`
55+ // List of triggers that this action supports. At this time, an action can
56+ // only target a single trigger at a time.
57+ SupportedTriggers []* ActionTrigger `json:"supported_triggers"`
58+ // The source code of the action.
59+ Code * string `json:"code,omitempty"`
60+ // List of third party npm modules, and their versions, that this action
61+ // depends on.
62+ Dependencies []* ActionDependency `json:"dependencies,omitempty"`
63+ // The Node runtime. For example `node16`, defaults to `node12`
64+ Runtime * string `json:"runtime,omitempty"`
65+ // List of secrets that are included in an action or a version of an action.
66+ Secrets []* ActionSecret `json:"secrets,omitempty"`
67+ // Version of the action that is currently deployed.
68+ DeployedVersion * ActionVersion `json:"deployed_version,omitempty"`
69+ // The build status of this action.
70+ Status * string `json:"status,omitempty"`
71+ // True if all of an Action's contents have been deployed.
72+ AllChangesDeployed bool `json:"all_changes_deployed,omitempty"`
73+ // The time when this action was built successfully.
74+ BuiltAt * time.Time `json:"built_at,omitempty"`
75+ // The time when this action was created.
6476 CreatedAt * time.Time `json:"created_at,omitempty"`
77+ // The time when this action was updated.
6578 UpdatedAt * time.Time `json:"updated_at,omitempty"`
6679}
6780
@@ -71,15 +84,15 @@ type ActionList struct {
7184}
7285
7386type ActionVersion struct {
74- ID * string `json:"id,omitempty"`
75- Code * string `json:"code"`
76- Dependencies []ActionDependency `json:"dependencies,omitempty"`
77- Deployed bool `json:"deployed"`
78- Status * string `json:"status,omitempty"`
79- Number int `json:"number,omitempty"`
87+ ID * string `json:"id,omitempty"`
88+ Code * string `json:"code"`
89+ Dependencies []* ActionDependency `json:"dependencies,omitempty"`
90+ Deployed bool `json:"deployed"`
91+ Status * string `json:"status,omitempty"`
92+ Number int `json:"number,omitempty"`
8093
81- Errors []ActionVersionError `json:"errors,omitempty"`
82- Action * Action `json:"action,omitempty"`
94+ Errors []* ActionVersionError `json:"errors,omitempty"`
95+ Action * Action `json:"action,omitempty"`
8396
8497 BuiltAt * time.Time `json:"built_at,omitempty"`
8598 CreatedAt * time.Time `json:"created_at,omitempty"`
@@ -108,7 +121,7 @@ type ActionBinding struct {
108121
109122 Ref * ActionBindingReference `json:"ref,omitempty"`
110123 Action * Action `json:"action,omitempty"`
111- Secrets []ActionSecret `json:"secrets,omitempty"`
124+ Secrets []* ActionSecret `json:"secrets,omitempty"`
112125
113126 CreatedAt * time.Time `json:"created_at,omitempty"`
114127 UpdatedAt * time.Time `json:"updated_at,omitempty"`
@@ -125,13 +138,13 @@ type actionBindingsPerTrigger struct {
125138
126139type ActionTestPayload map [string ]interface {}
127140
128- type ActionTestRequest struct {
141+ type actionTestRequest struct {
129142 Payload * ActionTestPayload `json:"payload"`
130143}
131144
132145type ActionExecutionResult struct {
133- ActionName * string `json:"action_name,omitempty"`
134- Error * map [string ]string `json:"error,omitempty"`
146+ ActionName * string `json:"action_name,omitempty"`
147+ Error map [string ]interface {} `json:"error,omitempty"`
135148
136149 StartedAt * time.Time `json:"started_at,omitempty"`
137150 EndedAt * time.Time `json:"ended_at,omitempty"`
@@ -164,14 +177,21 @@ func applyActionsListDefaults(options []RequestOption) RequestOption {
164177 })
165178}
166179
167- // ListTriggers available.
180+ // Triggers lists the available triggers .
168181//
169182// https://auth0.com/docs/api/management/v2/#!/Actions/get_triggers
170- func (m * ActionManager ) ListTriggers (opts ... RequestOption ) (l * ActionTriggerList , err error ) {
183+ func (m * ActionManager ) Triggers (opts ... RequestOption ) (l * ActionTriggerList , err error ) {
171184 err = m .Request ("GET" , m .URI ("actions" , "triggers" ), & l , opts ... )
172185 return
173186}
174187
188+ // ListTriggers lists the available triggers.
189+ //
190+ // Deprecated: use Triggers() instead
191+ func (m * ActionManager ) ListTriggers (opts ... RequestOption ) (l * ActionTriggerList , err error ) {
192+ return m .Triggers (opts ... )
193+ }
194+
175195// Create a new action.
176196//
177197// See: https://auth0.com/docs/api/management/v2#!/Actions/post_action
@@ -209,23 +229,37 @@ func (m *ActionManager) List(opts ...RequestOption) (l *ActionList, err error) {
209229 return
210230}
211231
212- // ReadVersion of an action.
232+ // Version retrieves the version of an action.
213233//
214234// See: https://auth0.com/docs/api/management/v2/#!/Actions/get_action_version
215- func (m * ActionManager ) ReadVersion (id string , versionId string , opts ... RequestOption ) (v * ActionVersion , err error ) {
235+ func (m * ActionManager ) Version (id string , versionId string , opts ... RequestOption ) (v * ActionVersion , err error ) {
216236 err = m .Request ("GET" , m .URI ("actions" , "actions" , id , "versions" , versionId ), & v , opts ... )
217237 return
218238}
219239
220- // ListVersions of an action.
240+ // ReadVersion retrieves the version of an action.
241+ //
242+ // Deprecated: use Version() instead.
243+ func (m * ActionManager ) ReadVersion (id string , versionId string , opts ... RequestOption ) (v * ActionVersion , err error ) {
244+ return m .Version (id , versionId , opts ... )
245+ }
246+
247+ // Versions lists all versions of an action.
221248//
222249// See: https://auth0.com/docs/api/management/v2/#!/Actions/get_action_versions
223- func (m * ActionManager ) ListVersions (id string , opts ... RequestOption ) (c * ActionVersionList , err error ) {
250+ func (m * ActionManager ) Versions (id string , opts ... RequestOption ) (c * ActionVersionList , err error ) {
224251 err = m .Request ("GET" , m .URI ("actions" , "actions" , id , "versions" ), & c , applyActionsListDefaults (opts ))
225252 return
226253}
227254
228- // UpdateBindings of a trigger
255+ // ListVersions of an action.
256+ //
257+ // Deprecated: use Versions() instead.
258+ func (m * ActionManager ) ListVersions (id string , opts ... RequestOption ) (c * ActionVersionList , err error ) {
259+ return m .Versions (id , opts ... )
260+ }
261+
262+ // UpdateBindings of a trigger.
229263//
230264// See: https://auth0.com/docs/api/management/v2/#!/Actions/patch_bindings
231265func (m * ActionManager ) UpdateBindings (triggerID string , b []* ActionBinding , opts ... RequestOption ) error {
@@ -235,14 +269,21 @@ func (m *ActionManager) UpdateBindings(triggerID string, b []*ActionBinding, opt
235269 return m .Request ("PATCH" , m .URI ("actions" , "triggers" , triggerID , "bindings" ), & bl , opts ... )
236270}
237271
238- // ListBindings of a trigger
272+ // Bindings lists the bindings of a trigger.
239273//
240274// See: https://auth0.com/docs/api/management/v2/#!/Actions/get_bindings
241- func (m * ActionManager ) ListBindings (triggerID string , opts ... RequestOption ) (bl * ActionBindingList , err error ) {
275+ func (m * ActionManager ) Bindings (triggerID string , opts ... RequestOption ) (bl * ActionBindingList , err error ) {
242276 err = m .Request ("GET" , m .URI ("actions" , "triggers" , triggerID , "bindings" ), & bl , applyActionsListDefaults (opts ))
243277 return
244278}
245279
280+ // ListBindings lists the bindings of a trigger.
281+ //
282+ // Deprecated: use Bindings() instead.
283+ func (m * ActionManager ) ListBindings (triggerID string , opts ... RequestOption ) (bl * ActionBindingList , err error ) {
284+ return m .Bindings (triggerID , opts ... )
285+ }
286+
246287// Deploy an action
247288//
248289// See: https://auth0.com/docs/api/management/v2/#!/Actions/post_deploy_action
@@ -263,17 +304,24 @@ func (m *ActionManager) DeployVersion(id string, versionId string, opts ...Reque
263304//
264305// See: https://auth0.com/docs/api/management/v2/#!/Actions/post_test_action
265306func (m * ActionManager ) Test (id string , payload * ActionTestPayload , opts ... RequestOption ) (err error ) {
266- r := & ActionTestRequest {
307+ r := & actionTestRequest {
267308 Payload : payload ,
268309 }
269310 err = m .Request ("POST" , m .URI ("actions" , "actions" , id , "test" ), & r , opts ... )
270311 return
271312}
272313
273- // ReadExecution of an action
314+ // Execution retrieves the details of an action execution
274315//
275316// See: https://auth0.com/docs/api/management/v2/#!/Actions/get_execution
276- func (m * ActionManager ) ReadExecution (executionId string , opts ... RequestOption ) (v * ActionExecution , err error ) {
317+ func (m * ActionManager ) Execution (executionId string , opts ... RequestOption ) (v * ActionExecution , err error ) {
277318 err = m .Request ("GET" , m .URI ("actions" , "executions" , executionId ), & v , opts ... )
278319 return
279320}
321+
322+ // ReadExecution retrieves the details of an action execution
323+ //
324+ // Deprecated: use Execution() instead
325+ func (m * ActionManager ) ReadExecution (executionId string , opts ... RequestOption ) (v * ActionExecution , err error ) {
326+ return m .Execution (executionId , opts ... )
327+ }
0 commit comments