Class: AhoSdk::Issuer::AutomationsResource Private

Inherits:
Object
  • Object
show all
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

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

Returns:

  • (Hash)


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

Returns:

  • (Hash)


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

Returns:

  • (Hash)


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

Returns:

  • (Hash)


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

Returns:

  • (Hash)


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

Returns:

  • (Hash)


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

Returns:

  • (Hash)


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

Returns:

  • (Hash)


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

Returns:

  • (Hash)


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

Returns:

  • (Hash)


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

Returns:

  • (Hash)


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