Class: Fizzy::Services::WebhooksService

Inherits:
BaseService show all
Defined in:
lib/fizzy/generated/services/webhooks_service.rb

Overview

Service for Webhooks operations

Instance Method Summary collapse

Methods inherited from BaseService

#initialize

Constructor Details

This class inherits a constructor from Fizzy::Services::BaseService

Instance Method Details

#activate(account_id:, board_id:, webhook_id:) ⇒ void

This method returns an undefined value.

activate operation

Parameters:

  • account_id (String)

    account id ID

  • board_id (String)

    board id ID

  • webhook_id (String)

    webhook id ID



75
76
77
78
79
80
# File 'lib/fizzy/generated/services/webhooks_service.rb', line 75

def activate(account_id:, board_id:, webhook_id:)
  with_operation(service: "webhooks", operation: "ActivateWebhook", is_mutation: true, resource_id: webhook_id) do
    http_post("/#{}/boards/#{board_id}/webhooks/#{webhook_id}/activation.json", retryable: true)
    nil
  end
end

#create(account_id:, board_id:, name:, url:, subscribed_actions: nil) ⇒ Hash

create operation

Parameters:

  • account_id (String)

    account id ID

  • board_id (String)

    board id ID

  • name (String)

    name

  • url (String)

    url

  • subscribed_actions (Array, nil) (defaults to: nil)

    subscribed actions

Returns:

  • (Hash)

    response data



27
28
29
30
31
# File 'lib/fizzy/generated/services/webhooks_service.rb', line 27

def create(account_id:, board_id:, name:, url:, subscribed_actions: nil)
  with_operation(service: "webhooks", operation: "CreateWebhook", is_mutation: true, resource_id: board_id) do
    http_post("/#{}/boards/#{board_id}/webhooks.json", body: compact_params(name: name, url: url, subscribed_actions: subscribed_actions)).json
  end
end

#delete(account_id:, board_id:, webhook_id:) ⇒ void

This method returns an undefined value.

delete operation

Parameters:

  • account_id (String)

    account id ID

  • board_id (String)

    board id ID

  • webhook_id (String)

    webhook id ID



63
64
65
66
67
68
# File 'lib/fizzy/generated/services/webhooks_service.rb', line 63

def delete(account_id:, board_id:, webhook_id:)
  with_operation(service: "webhooks", operation: "DeleteWebhook", is_mutation: true, resource_id: webhook_id) do
    http_delete("/#{}/boards/#{board_id}/webhooks/#{webhook_id}")
    nil
  end
end

#get(account_id:, board_id:, webhook_id:) ⇒ Hash

get operation

Parameters:

  • account_id (String)

    account id ID

  • board_id (String)

    board id ID

  • webhook_id (String)

    webhook id ID

Returns:

  • (Hash)

    response data



38
39
40
41
42
# File 'lib/fizzy/generated/services/webhooks_service.rb', line 38

def get(account_id:, board_id:, webhook_id:)
  with_operation(service: "webhooks", operation: "GetWebhook", is_mutation: false, resource_id: webhook_id) do
    http_get("/#{}/boards/#{board_id}/webhooks/#{webhook_id}").json
  end
end

#list(account_id:, board_id:) ⇒ Hash

list operation

Parameters:

  • account_id (String)

    account id ID

  • board_id (String)

    board id ID

Returns:

  • (Hash)

    response data



14
15
16
17
18
# File 'lib/fizzy/generated/services/webhooks_service.rb', line 14

def list(account_id:, board_id:)
  with_operation(service: "webhooks", operation: "ListWebhooks", is_mutation: false, resource_id: board_id) do
    http_get("/#{}/boards/#{board_id}/webhooks.json").json
  end
end

#list_webhook_deliveries(account_id:, board_id:, webhook_id:) ⇒ Enumerator<Hash>

list_webhook_deliveries operation

Parameters:

  • account_id (String)

    account id ID

  • board_id (String)

    board id ID

  • webhook_id (String)

    webhook id ID

Returns:

  • (Enumerator<Hash>)

    paginated results



87
88
89
90
91
# File 'lib/fizzy/generated/services/webhooks_service.rb', line 87

def list_webhook_deliveries(account_id:, board_id:, webhook_id:)
  wrap_paginated(service: "webhooks", operation: "ListWebhookDeliveries", is_mutation: false, resource_id: webhook_id) do
    paginate("/#{}/boards/#{board_id}/webhooks/#{webhook_id}/deliveries.json")
  end
end

#update(account_id:, board_id:, webhook_id:, name: nil, url: nil, subscribed_actions: nil) ⇒ Hash

update operation

Parameters:

  • account_id (String)

    account id ID

  • board_id (String)

    board id ID

  • webhook_id (String)

    webhook id ID

  • name (String, nil) (defaults to: nil)

    name

  • url (String, nil) (defaults to: nil)

    url

  • subscribed_actions (Array, nil) (defaults to: nil)

    subscribed actions

Returns:

  • (Hash)

    response data



52
53
54
55
56
# File 'lib/fizzy/generated/services/webhooks_service.rb', line 52

def update(account_id:, board_id:, webhook_id:, name: nil, url: nil, subscribed_actions: nil)
  with_operation(service: "webhooks", operation: "UpdateWebhook", is_mutation: true, resource_id: webhook_id) do
    http_patch("/#{}/boards/#{board_id}/webhooks/#{webhook_id}", body: compact_params(name: name, url: url, subscribed_actions: subscribed_actions)).json
  end
end