Class: PlatformAPI::Addon
- Inherits:
-
Object
- Object
- PlatformAPI::Addon
- 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
-
#create(app_id_or_app_name, body = {}) ⇒ Object
Create a new add-on.
-
#delete(app_id_or_app_name, addon_id_or_addon_name) ⇒ Object
Delete an existing add-on.
-
#info(addon_id_or_addon_name) ⇒ Object
Info for an existing add-on.
-
#initialize(client) ⇒ Addon
constructor
A new instance of Addon.
-
#list ⇒ Object
List all existing add-ons.
-
#list_by_app(app_id_or_app_name) ⇒ Object
List existing add-ons for an app.
-
#list_by_user(account_email_or_account_id_or_account_self) ⇒ Object
List all existing add-ons a user has access to.
-
#update(app_id_or_app_name, addon_id_or_addon_name, body = {}) ⇒ Object
Change add-on plan.
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.
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.
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.
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 |
#list ⇒ Object
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.
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
831 832 833 |
# File 'lib/platform-api/client.rb', line 831 def list_by_user(account_email_or_account_id_or_account_self) @client.addon.list_by_user(account_email_or_account_id_or_account_self) 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.
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 |