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.
1043 1044 1045 |
# File 'lib/platform-api/client.rb', line 1043 def initialize(client) @client = client end |
Instance Method Details
#create(app_id_or_app_name, body = {}) ⇒ Object
Create a new add-on.
1063 1064 1065 |
# File 'lib/platform-api/client.rb', line 1063 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.
1071 1072 1073 |
# File 'lib/platform-api/client.rb', line 1071 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.
1055 1056 1057 |
# File 'lib/platform-api/client.rb', line 1055 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.
1079 1080 1081 |
# File 'lib/platform-api/client.rb', line 1079 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.
1048 1049 1050 |
# File 'lib/platform-api/client.rb', line 1048 def list() @client.addon.list() end |
#list_by_app(app_id_or_app_name) ⇒ Object
List existing add-ons for an app.
1086 1087 1088 |
# File 'lib/platform-api/client.rb', line 1086 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
1109 1110 1111 |
# File 'lib/platform-api/client.rb', line 1109 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
1102 1103 1104 |
# File 'lib/platform-api/client.rb', line 1102 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.
1116 1117 1118 |
# File 'lib/platform-api/client.rb', line 1116 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.
1095 1096 1097 |
# File 'lib/platform-api/client.rb', line 1095 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 |