Class: PlatformAPI::OauthAuthorization

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

Overview

OAuth authorizations represent clients that a Heroku user has authorized to automate, customize or extend their usage of the platform. For more information please refer to the Heroku OAuth documentation

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ OauthAuthorization

Returns a new instance of OauthAuthorization.



2132
2133
2134
# File 'lib/platform-api/client.rb', line 2132

def initialize(client)
  @client = client
end

Instance Method Details

#create(body = {}) ⇒ Object

Create a new OAuth authorization.

Parameters:

  • body:

    the object to pass as the request payload



2139
2140
2141
# File 'lib/platform-api/client.rb', line 2139

def create(body = {})
  @client.oauth_authorization.create(body)
end

#delete(oauth_authorization_id) ⇒ Object

Delete OAuth authorization.

Parameters:

  • oauth_authorization_id:

    unique identifier of OAuth authorization



2146
2147
2148
# File 'lib/platform-api/client.rb', line 2146

def delete(oauth_authorization_id)
  @client.oauth_authorization.delete(oauth_authorization_id)
end

#info(oauth_authorization_id) ⇒ Object

Info for an OAuth authorization.

Parameters:

  • oauth_authorization_id:

    unique identifier of OAuth authorization



2153
2154
2155
# File 'lib/platform-api/client.rb', line 2153

def info(oauth_authorization_id)
  @client.oauth_authorization.info(oauth_authorization_id)
end

#listObject

List OAuth authorizations.



2158
2159
2160
# File 'lib/platform-api/client.rb', line 2158

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

#regenerate(oauth_authorization_id) ⇒ Object

Regenerate OAuth tokens. This endpoint is only available to direct authorizations or privileged OAuth clients.

Parameters:

  • oauth_authorization_id:

    unique identifier of OAuth authorization



2165
2166
2167
# File 'lib/platform-api/client.rb', line 2165

def regenerate(oauth_authorization_id)
  @client.oauth_authorization.regenerate(oauth_authorization_id)
end