Class: PlatformAPI::AppWebhook

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) ⇒ AppWebhook

Returns a new instance of AppWebhook.



1267
1268
1269
# File 'lib/platform-api/client.rb', line 1267

def initialize(client)
  @client = client
end

Instance Method Details

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

Create an app webhook subscription.

Parameters:

  • app_id_or_app_name:

    unique identifier of app or unique name of app

  • body:

    the object to pass as the request payload



1275
1276
1277
# File 'lib/platform-api/client.rb', line 1275

def create(app_id_or_app_name, body = {})
  @client.app_webhook.create(app_id_or_app_name, body)
end

#delete(app_id_or_app_name, app_webhook_id) ⇒ Object

Removes an app webhook subscription.

Parameters:

  • app_id_or_app_name:

    unique identifier of app or unique name of app

  • app_webhook_id:

    the webhook's unique identifier



1283
1284
1285
# File 'lib/platform-api/client.rb', line 1283

def delete(app_id_or_app_name, app_webhook_id)
  @client.app_webhook.delete(app_id_or_app_name, app_webhook_id)
end

#info(app_id_or_app_name, app_webhook_id) ⇒ Object

Returns the info for an app webhook subscription.

Parameters:

  • app_id_or_app_name:

    unique identifier of app or unique name of app

  • app_webhook_id:

    the webhook's unique identifier



1291
1292
1293
# File 'lib/platform-api/client.rb', line 1291

def info(app_id_or_app_name, app_webhook_id)
  @client.app_webhook.info(app_id_or_app_name, app_webhook_id)
end

#list(app_id_or_app_name) ⇒ Object

List all webhook subscriptions for a particular app.

Parameters:

  • app_id_or_app_name:

    unique identifier of app or unique name of app



1298
1299
1300
# File 'lib/platform-api/client.rb', line 1298

def list(app_id_or_app_name)
  @client.app_webhook.list(app_id_or_app_name)
end

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

Updates the details of an app webhook subscription.

Parameters:

  • app_id_or_app_name:

    unique identifier of app or unique name of app

  • app_webhook_id:

    the webhook's unique identifier

  • body:

    the object to pass as the request payload



1307
1308
1309
# File 'lib/platform-api/client.rb', line 1307

def update(app_id_or_app_name, app_webhook_id, body = {})
  @client.app_webhook.update(app_id_or_app_name, app_webhook_id, body)
end