Class: AhoSdk::Issuer::AutomationsResource Private
- Inherits:
-
Object
- Object
- AhoSdk::Issuer::AutomationsResource
- Defined in:
- lib/aho_sdk/issuer.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Automations resource operations
Instance Method Summary collapse
-
#create(body: nil, idempotency_key: nil) ⇒ Hash
private
Create an automation.
-
#create_webhook(automation_id:, idempotency_key: nil) ⇒ Hash
private
Generate webhook token.
-
#delete(id:) ⇒ Hash
private
Delete an automation.
-
#delete_webhook(automation_id:) ⇒ Hash
private
Revoke webhook token.
-
#get(id:) ⇒ Hash
private
Get automation details.
-
#get_webhook(automation_id:) ⇒ Hash
private
Get webhook configuration.
-
#initialize(client) ⇒ AutomationsResource
constructor
private
A new instance of AutomationsResource.
-
#list(status: nil, trigger_mode: nil, page: nil, per_page: nil) ⇒ Hash
private
List automations.
-
#pause(id:, idempotency_key: nil) ⇒ Hash
private
Pause an automation.
-
#resume(id:, idempotency_key: nil) ⇒ Hash
private
Resume an automation.
-
#trigger(id:, idempotency_key: nil) ⇒ Hash
private
Trigger an automation.
-
#update(id:, body: nil, idempotency_key: nil) ⇒ Hash
private
Update an automation.
Constructor Details
#initialize(client) ⇒ AutomationsResource
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of AutomationsResource.
58 59 60 |
# File 'lib/aho_sdk/issuer.rb', line 58 def initialize(client) @client = client end |
Instance Method Details
#create(body: nil, idempotency_key: nil) ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Create an automation
86 87 88 |
# File 'lib/aho_sdk/issuer.rb', line 86 def create(body: nil, idempotency_key: nil) @client.post("/v1/issuer/automations", body: body, idempotency_key: idempotency_key) end |
#create_webhook(automation_id:, idempotency_key: nil) ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Generate webhook token
72 73 74 |
# File 'lib/aho_sdk/issuer.rb', line 72 def create_webhook(automation_id:, idempotency_key: nil) @client.post("/v1/issuer/automations/#{automation_id}/webhook", idempotency_key: idempotency_key) end |
#delete(id:) ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Delete an automation
118 119 120 |
# File 'lib/aho_sdk/issuer.rb', line 118 def delete(id:) @client.delete("/v1/issuer/automations/#{id}") end |
#delete_webhook(automation_id:) ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Revoke webhook token
79 80 81 |
# File 'lib/aho_sdk/issuer.rb', line 79 def delete_webhook(automation_id:) @client.delete("/v1/issuer/automations/#{automation_id}/webhook") end |
#get(id:) ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Get automation details
104 105 106 |
# File 'lib/aho_sdk/issuer.rb', line 104 def get(id:) @client.get("/v1/issuer/automations/#{id}") end |
#get_webhook(automation_id:) ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Get webhook configuration
65 66 67 |
# File 'lib/aho_sdk/issuer.rb', line 65 def get_webhook(automation_id:) @client.get("/v1/issuer/automations/#{automation_id}/webhook") end |
#list(status: nil, trigger_mode: nil, page: nil, per_page: nil) ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
List automations
93 94 95 96 97 98 99 |
# File 'lib/aho_sdk/issuer.rb', line 93 def list(status: nil, trigger_mode: nil, page: nil, per_page: nil) fetch_page = ->(p) { response = @client.get("/v1/issuer/automations", params: { status: status, trigger_mode: trigger_mode, page: p, per_page: per_page }) Page.new(data: response[:data], meta: response[:meta], fetch_next: fetch_page) } fetch_page.call(page) end |
#pause(id:, idempotency_key: nil) ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Pause an automation
132 133 134 |
# File 'lib/aho_sdk/issuer.rb', line 132 def pause(id:, idempotency_key: nil) @client.post("/v1/issuer/automations/#{id}/pause", idempotency_key: idempotency_key) end |
#resume(id:, idempotency_key: nil) ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Resume an automation
139 140 141 |
# File 'lib/aho_sdk/issuer.rb', line 139 def resume(id:, idempotency_key: nil) @client.post("/v1/issuer/automations/#{id}/resume", idempotency_key: idempotency_key) end |
#trigger(id:, idempotency_key: nil) ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Trigger an automation
125 126 127 |
# File 'lib/aho_sdk/issuer.rb', line 125 def trigger(id:, idempotency_key: nil) @client.post("/v1/issuer/automations/#{id}/trigger", idempotency_key: idempotency_key) end |
#update(id:, body: nil, idempotency_key: nil) ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Update an automation
111 112 113 |
# File 'lib/aho_sdk/issuer.rb', line 111 def update(id:, body: nil, idempotency_key: nil) @client.patch("/v1/issuer/automations/#{id}", body: body, idempotency_key: idempotency_key) end |