Class: PlatformAPI::Addon

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

Overview

Add-ons represent add-ons that have been provisioned and attached to one or more apps.

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Addon

Returns a new instance of Addon.



796
797
798
# File 'lib/platform-api/client.rb', line 796

def initialize(client)
  @client = client
end

Instance Method Details

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

Create a new add-on.

Parameters:

  • app_id_or_app_name:

    unique identifier of app or unique name of app

  • body:

    the object to pass as the request payload



804
805
806
# File 'lib/platform-api/client.rb', line 804

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

#delete(app_id_or_app_name, addon_id_or_addon_name) ⇒ Object

Delete an existing add-on.

Parameters:

  • app_id_or_app_name:

    unique identifier of app or unique name of app

  • addon_id_or_addon_name:

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



812
813
814
# File 'lib/platform-api/client.rb', line 812

def delete(app_id_or_app_name, addon_id_or_addon_name)
  @client.addon.delete(app_id_or_app_name, addon_id_or_addon_name)
end

#info(addon_id_or_addon_name) ⇒ Object

Info for an existing add-on.

Parameters:

  • addon_id_or_addon_name:

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



819
820
821
# File 'lib/platform-api/client.rb', line 819

def info(addon_id_or_addon_name)
  @client.addon.info(addon_id_or_addon_name)
end

#listObject

List all existing add-ons.



824
825
826
# File 'lib/platform-api/client.rb', line 824

def list()
  @client.addon.list()
end

#list_by_app(app_id_or_app_name) ⇒ Object

List existing add-ons for an app.

Parameters:

  • app_id_or_app_name:

    unique identifier of app or unique name of app



838
839
840
# File 'lib/platform-api/client.rb', line 838

def list_by_app(app_id_or_app_name)
  @client.addon.list_by_app(app_id_or_app_name)
end

#list_by_user(account_email_or_account_id_or_account_self) ⇒ Object

List all existing add-ons a user has access to

Parameters:

  • account_email_or_account_id_or_account_self:

    unique email address of account or unique identifier of an account or Implicit reference to currently authorized user



831
832
833
# File 'lib/platform-api/client.rb', line 831

def list_by_user()
  @client.addon.list_by_user()
end

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

Change add-on plan. Some add-ons may not support changing plans. In that case, an error will be returned.

Parameters:

  • app_id_or_app_name:

    unique identifier of app or unique name of app

  • 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



847
848
849
# File 'lib/platform-api/client.rb', line 847

def update(app_id_or_app_name, addon_id_or_addon_name, body = {})
  @client.addon.update(app_id_or_app_name, addon_id_or_addon_name, body)
end