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, action_name, 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.
58 59 60 61 62 |
# File 'lib/auth0/api/v2/actions.rb', line 58 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
160 161 162 163 164 165 |
# File 'lib/auth0/api/v2/actions.rb', line 160 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, action_name, 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 32 33 |
# File 'lib/auth0/api/v2/actions.rb', line 19 def actions(trigger_id, action_name, deployed: nil, per_page: nil, page: nil, installed: nil) raise Auth0::MissingTriggerId, 'Must supply a valid trigger_id' if trigger_id.to_s.empty? raise Auth0::MissingActionName, 'Must supply a valid action_name' if action_name.to_s.empty? request_params = { trigger_id: trigger_id, action_name: 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.
48 49 50 51 |
# File 'lib/auth0/api/v2/actions.rb', line 48 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.
109 110 111 112 113 114 115 116 117 118 |
# File 'lib/auth0/api/v2/actions.rb', line 109 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.
40 41 42 |
# File 'lib/auth0/api/v2/actions.rb', line 40 def create_action(body = {}) post(actions_path, body) end |
#delete_action(action_id, force = false) ⇒ Object
Deletes a single action given its id
70 71 72 73 74 |
# File 'lib/auth0/api/v2/actions.rb', line 70 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.
172 173 174 175 176 |
# File 'lib/auth0/api/v2/actions.rb', line 172 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.
95 96 97 98 99 |
# File 'lib/auth0/api/v2/actions.rb', line 95 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.
82 83 84 85 86 87 |
# File 'lib/auth0/api/v2/actions.rb', line 82 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.
146 147 148 149 150 151 |
# File 'lib/auth0/api/v2/actions.rb', line 146 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.
195 196 197 198 199 200 |
# File 'lib/auth0/api/v2/actions.rb', line 195 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.
183 184 185 186 187 188 |
# File 'lib/auth0/api/v2/actions.rb', line 183 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.
128 129 130 131 132 133 134 135 136 137 |
# File 'lib/auth0/api/v2/actions.rb', line 128 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 |