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.
-
#info_by_app(app_id_or_app_name, 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_team(team_name_or_team_id) ⇒ Object
List add-ons used across all Team apps.
-
#list_by_user(account_email_or_account_id_or_account_self) ⇒ Object
List all existing add-ons a user has access to.
-
#resolution(body = {}) ⇒ Object
Resolve an add-on from a name, optionally passing an app name.
-
#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.
1106 1107 1108 |
# File 'lib/platform-api/client.rb', line 1106 def initialize(client) @client = client end |
Instance Method Details
#create(app_id_or_app_name, body = {}) ⇒ Object
Create a new add-on.
1126 1127 1128 |
# File 'lib/platform-api/client.rb', line 1126 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.
1134 1135 1136 |
# File 'lib/platform-api/client.rb', line 1134 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.
1118 1119 1120 |
# File 'lib/platform-api/client.rb', line 1118 def info(addon_id_or_addon_name) @client.addon.info(addon_id_or_addon_name) end |
#info_by_app(app_id_or_app_name, addon_id_or_addon_name) ⇒ Object
Info for an existing add-on.
1142 1143 1144 |
# File 'lib/platform-api/client.rb', line 1142 def info_by_app(app_id_or_app_name, addon_id_or_addon_name) @client.addon.info_by_app(app_id_or_app_name, addon_id_or_addon_name) end |
#list ⇒ Object
List all existing add-ons.
1111 1112 1113 |
# File 'lib/platform-api/client.rb', line 1111 def list() @client.addon.list() end |
#list_by_app(app_id_or_app_name) ⇒ Object
List existing add-ons for an app.
1149 1150 1151 |
# File 'lib/platform-api/client.rb', line 1149 def list_by_app(app_id_or_app_name) @client.addon.list_by_app(app_id_or_app_name) end |
#list_by_team(team_name_or_team_id) ⇒ Object
List add-ons used across all Team apps
1172 1173 1174 |
# File 'lib/platform-api/client.rb', line 1172 def list_by_team(team_name_or_team_id) @client.addon.list_by_team(team_name_or_team_id) end |
#list_by_user(account_email_or_account_id_or_account_self) ⇒ Object
List all existing add-ons a user has access to
1165 1166 1167 |
# File 'lib/platform-api/client.rb', line 1165 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 |
#resolution(body = {}) ⇒ Object
Resolve an add-on from a name, optionally passing an app name. If there are matches it returns at least one add-on (exact match) or many.
1179 1180 1181 |
# File 'lib/platform-api/client.rb', line 1179 def resolution(body = {}) @client.addon.resolution(body) 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.
1158 1159 1160 |
# File 'lib/platform-api/client.rb', line 1158 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 |