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.



1066
1067
1068
# File 'lib/platform-api/client.rb', line 1066

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



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

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



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

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



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

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



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

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



1106
1107
1108
# File 'lib/platform-api/client.rb', line 1106

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