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.



1073
1074
1075
# File 'lib/platform-api/client.rb', line 1073

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



1081
1082
1083
# File 'lib/platform-api/client.rb', line 1081

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



1089
1090
1091
# File 'lib/platform-api/client.rb', line 1089

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



1097
1098
1099
# File 'lib/platform-api/client.rb', line 1097

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



1104
1105
1106
# File 'lib/platform-api/client.rb', line 1104

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



1113
1114
1115
# File 'lib/platform-api/client.rb', line 1113

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