Class: PlatformAPI::AddonWebhook

Inherits:
Object
  • Object
show all
Defined in:
lib/platform-api/client.rb

Overview

Represents the details of a webhook subscription

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ AddonWebhook

Returns a new instance of AddonWebhook.



1078
1079
1080
# File 'lib/platform-api/client.rb', line 1078

def initialize(client)
  @client = client
end

Instance Method Details

#create(addon_id_or_addon_name, body = {}) ⇒ Object

Create an add-on webhook subscription. Can only be accessed by the add-on partner providing this add-on.

Parameters:

  • addon_id_or_addon_name:

    unique identifier of add-on or globally unique name of the add-on

  • body:

    the object to pass as the request payload



1086
1087
1088
# File 'lib/platform-api/client.rb', line 1086

def create(addon_id_or_addon_name, body = {})
  @client.addon_webhook.create(addon_id_or_addon_name, body)
end

#delete(addon_id_or_addon_name, app_webhook_id) ⇒ Object

Removes an add-on webhook subscription. Can only be accessed by the add-on partner providing this add-on.

Parameters:

  • addon_id_or_addon_name:

    unique identifier of add-on or globally unique name of the add-on

  • app_webhook_id:

    the webhook's unique identifier



1094
1095
1096
# File 'lib/platform-api/client.rb', line 1094

def delete(addon_id_or_addon_name, app_webhook_id)
  @client.addon_webhook.delete(addon_id_or_addon_name, app_webhook_id)
end

#info(addon_id_or_addon_name, app_webhook_id) ⇒ Object

Returns the info for an add-on webhook subscription. Can only be accessed by the add-on partner providing this add-on.

Parameters:

  • addon_id_or_addon_name:

    unique identifier of add-on or globally unique name of the add-on

  • app_webhook_id:

    the webhook's unique identifier



1102
1103
1104
# File 'lib/platform-api/client.rb', line 1102

def info(addon_id_or_addon_name, app_webhook_id)
  @client.addon_webhook.info(addon_id_or_addon_name, app_webhook_id)
end

#list(addon_id_or_addon_name) ⇒ Object

List all webhook subscriptions for a particular add-on. Can only be accessed by the add-on partner providing this add-on.

Parameters:

  • addon_id_or_addon_name:

    unique identifier of add-on or globally unique name of the add-on



1109
1110
1111
# File 'lib/platform-api/client.rb', line 1109

def list(addon_id_or_addon_name)
  @client.addon_webhook.list(addon_id_or_addon_name)
end

#update(addon_id_or_addon_name, app_webhook_id, body = {}) ⇒ Object

Updates the details of an add-on webhook subscription. Can only be accessed by the add-on partner providing this add-on.

Parameters:

  • addon_id_or_addon_name:

    unique identifier of add-on or globally unique name of the add-on

  • app_webhook_id:

    the webhook's unique identifier

  • body:

    the object to pass as the request payload



1118
1119
1120
# File 'lib/platform-api/client.rb', line 1118

def update(addon_id_or_addon_name, app_webhook_id, body = {})
  @client.addon_webhook.update(addon_id_or_addon_name, app_webhook_id, body)
end