Module: Auth0::Api::V2::Actions
Overview
Methods to use the actions endpoints
Instance Method Summary collapse
-
#action(action_id) ⇒ json
(also: #get_action)
Get an action by id.
-
#action_by_version(action_id, version_id) ⇒ json
(also: #get_action_by_version)
Retrieve a specific version of an action.
-
#actions(trigger_id = nil, action_name = nil, deployed: nil, per_page: nil, page: nil, installed: nil) ⇒ json
(also: #get_actions)
Get all actions.
-
#actions_triggers ⇒ json
Retrieve the set of triggers currently available within actions.
-
#actions_versions(action_id, page: nil, per_page: nil) ⇒ json
(also: #get_actions_versions)
Retrieve all of an action’s versions.
-
#create_action(body = {}) ⇒ json
Create a new action.
-
#delete_action(action_id, force = false) ⇒ Object
Deletes a single action given its id.
-
#deploy_action(action_id) ⇒ json
Deploy an action.
-
#execution(execution_id) ⇒ json
(also: #get_execution)
Retrieve information about a specific execution of a trigger.
-
#patch_action(action_id, body) ⇒ json
(also: #update_action)
Update an existing action.
-
#patch_trigger_bindings(trigger_id, body = nil) ⇒ json
(also: #update_trigger_bindings)
Update the actions that are bound (i.e. attached) to a trigger.
-
#rollback_action(action_id, version_id) ⇒ json
Performs the equivalent of a roll-back of an action to an earlier, specified version.
-
#test_action(action_id, body = {}) ⇒ json
Test an action.
-
#trigger_bindings(trigger_id, page: nil, per_page: nil) ⇒ json
(also: #get_trigger_bindings)
Retrieve the actions that are bound to a trigger.
Methods included from Mixins::Validation
#validate_permissions_array, #validate_strings_array
Instance Method Details
#action(action_id) ⇒ json Also known as: get_action
Get an action by id.
57 58 59 60 61 |
# File 'lib/auth0/api/v2/actions.rb', line 57 def action(action_id) raise Auth0::MissingActionId, 'Must supply a valid action_id' if action_id.to_s.empty? path = "#{actions_path}/actions/#{action_id}" get(path) end |
#action_by_version(action_id, version_id) ⇒ json Also known as: get_action_by_version
Retrieve a specific version of an action
159 160 161 162 163 164 |
# File 'lib/auth0/api/v2/actions.rb', line 159 def action_by_version(action_id, version_id) raise Auth0::MissingActionId, 'Must supply a valid action_id' if action_id.to_s.empty? raise Auth0::MissingVersionId, 'Must supply a valid version_id' if version_id.to_s.empty? path = "#{actions_path}/actions/#{action_id}/versions/#{version_id}" get(path) end |
#actions(trigger_id = nil, action_name = nil, deployed: nil, per_page: nil, page: nil, installed: nil) ⇒ json Also known as: get_actions
Get all actions.
19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/auth0/api/v2/actions.rb', line 19 def actions(trigger_id = nil, action_name = nil, deployed: nil, per_page: nil, page: nil, installed: nil) request_params = { triggerId: trigger_id, actionName: action_name, deployed: deployed, per_page: per_page, page: page, installed: installed } path = "#{actions_path}/actions" get(path, request_params) end |
#actions_triggers ⇒ json
Retrieve the set of triggers currently available within actions. A trigger is an extensibility point to which actions can be bound.
47 48 49 50 |
# File 'lib/auth0/api/v2/actions.rb', line 47 def actions_triggers path = "#{actions_path}/triggers" get(path) end |
#actions_versions(action_id, page: nil, per_page: nil) ⇒ json Also known as: get_actions_versions
Retrieve all of an action’s versions.
108 109 110 111 112 113 114 115 116 117 |
# File 'lib/auth0/api/v2/actions.rb', line 108 def actions_versions(action_id, page: nil, per_page: nil) raise Auth0::MissingActionId, 'Must supply a valid action_id' if action_id.to_s.empty? path = "#{actions_path}/actions/#{action_id}/versions" request_params = { per_page: per_page, page: page } get(path, request_params) end |
#create_action(body = {}) ⇒ json
Create a new action.
38 39 40 41 |
# File 'lib/auth0/api/v2/actions.rb', line 38 def create_action(body = {}) path = "#{actions_path}/actions" post(path, body) end |
#delete_action(action_id, force = false) ⇒ Object
Deletes a single action given its id
69 70 71 72 73 |
# File 'lib/auth0/api/v2/actions.rb', line 69 def delete_action(action_id, force=false) raise Auth0::MissingActionId, 'Must supply a valid action_id' if action_id.to_s.empty? path = "#{actions_path}/actions/#{action_id}" delete(path, { force: force }) end |
#deploy_action(action_id) ⇒ json
Deploy an action.
171 172 173 174 175 |
# File 'lib/auth0/api/v2/actions.rb', line 171 def deploy_action(action_id) raise Auth0::MissingActionId, 'Must supply a valid action_id' if action_id.to_s.empty? path = "#{actions_path}/actions/#{action_id}/deploy" post(path) end |
#execution(execution_id) ⇒ json Also known as: get_execution
Retrieve information about a specific execution of a trigger.
94 95 96 97 98 |
# File 'lib/auth0/api/v2/actions.rb', line 94 def execution(execution_id) raise Auth0::MissingExecutionId, 'Must supply a valid execution_id' if execution_id.to_s.empty? path = "#{actions_path}/executions/#{execution_id}" get(path) end |
#patch_action(action_id, body) ⇒ json Also known as: update_action
Update an existing action.
81 82 83 84 85 86 |
# File 'lib/auth0/api/v2/actions.rb', line 81 def patch_action(action_id, body) raise Auth0::MissingActionId, 'Must supply a valid action_id' if action_id.to_s.empty? raise Auth0::InvalidParameter, 'Must supply a valid body' if body.to_s.empty? || body.empty? path = "#{actions_path}/actions/#{action_id}" patch(path, body) end |
#patch_trigger_bindings(trigger_id, body = nil) ⇒ json Also known as: update_trigger_bindings
Update the actions that are bound (i.e. attached) to a trigger.
145 146 147 148 149 150 |
# File 'lib/auth0/api/v2/actions.rb', line 145 def patch_trigger_bindings(trigger_id, body = nil) raise Auth0::MissingTriggerId, 'Must supply a valid trigger_id' if trigger_id.to_s.empty? raise Auth0::InvalidParameter, 'Must supply a valid body' if body.to_s.empty? || body.empty? path = "#{actions_path}/triggers/#{trigger_id}/bindings" patch(path, body) end |
#rollback_action(action_id, version_id) ⇒ json
Performs the equivalent of a roll-back of an action to an earlier, specified version.
194 195 196 197 198 199 |
# File 'lib/auth0/api/v2/actions.rb', line 194 def rollback_action(action_id, version_id) raise Auth0::MissingActionId, 'Must supply a valid action_id' if action_id.to_s.empty? raise Auth0::MissingVersionId, 'Must supply a valid version_id' if version_id.to_s.empty? path = "#{actions_path}/actions/#{action_id}/versions/#{version_id}/deploy" post(path) end |
#test_action(action_id, body = {}) ⇒ json
Test an action.
182 183 184 185 186 187 |
# File 'lib/auth0/api/v2/actions.rb', line 182 def test_action(action_id, body = {}) raise Auth0::MissingActionId, 'Must supply a valid action_id' if action_id.to_s.empty? raise Auth0::InvalidParameter, 'Must supply a valid body' if body.to_s.empty? || body.empty? path = "#{actions_path}/actions/#{action_id}/test" post(path, body) end |
#trigger_bindings(trigger_id, page: nil, per_page: nil) ⇒ json Also known as: get_trigger_bindings
Retrieve the actions that are bound to a trigger.
127 128 129 130 131 132 133 134 135 136 |
# File 'lib/auth0/api/v2/actions.rb', line 127 def trigger_bindings(trigger_id, page: nil, per_page: nil) raise Auth0::MissingTriggerId, 'Must supply a valid trigger_id' if trigger_id.to_s.empty? path = "#{actions_path}/triggers/#{trigger_id}/bindings" request_params = { per_page: per_page, page: page } get(path, request_params) end |