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.



1120
1121
1122
# File 'lib/platform-api/client.rb', line 1120

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



1140
1141
1142
# File 'lib/platform-api/client.rb', line 1140

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



1148
1149
1150
# File 'lib/platform-api/client.rb', line 1148

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



1132
1133
1134
# File 'lib/platform-api/client.rb', line 1132

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.

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



1156
1157
1158
# File 'lib/platform-api/client.rb', line 1156

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

#listObject

List all existing add-ons.



1125
1126
1127
# File 'lib/platform-api/client.rb', line 1125

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



1163
1164
1165
# File 'lib/platform-api/client.rb', line 1163

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

Parameters:

  • team_name_or_team_id:

    unique name of team or unique identifier of team



1186
1187
1188
# File 'lib/platform-api/client.rb', line 1186

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

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



1179
1180
1181
# File 'lib/platform-api/client.rb', line 1179

def list_by_user()
  @client.addon.list_by_user()
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.

Parameters:

  • body:

    the object to pass as the request payload



1193
1194
1195
# File 'lib/platform-api/client.rb', line 1193

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.

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



1172
1173
1174
# File 'lib/platform-api/client.rb', line 1172

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