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.



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

Returns:

  • (Hash)


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

Returns:

  • (Hash)


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

Returns:

  • (Hash)


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

Returns:

  • (Hash)


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

Returns:

  • (Hash)


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

Returns:

  • (Hash)


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

Returns:

  • (Hash)


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

Returns:

  • (Hash)


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

Returns:

  • (Hash)


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

Returns:

  • (Hash)


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

Returns:

  • (Hash)


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