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.
70 71 72 |
# File 'lib/aho_sdk/issuer.rb', line 70 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
98 99 100 |
# File 'lib/aho_sdk/issuer.rb', line 98 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
84 85 86 |
# File 'lib/aho_sdk/issuer.rb', line 84 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
130 131 132 |
# File 'lib/aho_sdk/issuer.rb', line 130 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
91 92 93 |
# File 'lib/aho_sdk/issuer.rb', line 91 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
116 117 118 |
# File 'lib/aho_sdk/issuer.rb', line 116 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
77 78 79 |
# File 'lib/aho_sdk/issuer.rb', line 77 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
105 106 107 108 109 110 111 |
# File 'lib/aho_sdk/issuer.rb', line 105 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
144 145 146 |
# File 'lib/aho_sdk/issuer.rb', line 144 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
151 152 153 |
# File 'lib/aho_sdk/issuer.rb', line 151 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
137 138 139 |
# File 'lib/aho_sdk/issuer.rb', line 137 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
123 124 125 |
# File 'lib/aho_sdk/issuer.rb', line 123 def update(id:, body: nil, idempotency_key: nil) @client.patch("/v1/issuer/automations/#{id}", body: body, idempotency_key: idempotency_key) end |