Module: SnapDeploy::Provider::Heroku::API
- Defined in:
- lib/snap_deploy/provider/heroku/api.rb
Defined Under Namespace
Classes: Account, AccountFeature, Addon, AddonService, App, AppFeature, AppSetup, AppTransfer, Build, BuildResult, BuildpackInstallation, Client, Collaborator, ConfigVar, Credit, Domain, Dyno, Formation, Invoice, Key, LogDrain, LogSession, OauthAuthorization, OauthClient, OauthGrant, OauthToken, Organization, OrganizationApp, OrganizationAppCollaborator, OrganizationMember, OtpSecret, Payment, PaymentMethod, Plan, RateLimit, RecoveryCode, Region, Release, SSLEndpoint, Slug, Source, Stack
Class Method Summary collapse
-
.connect(api_key, options = nil) ⇒ Client
Get a Client configured to use HTTP Basic authentication.
-
.connect_oauth(oauth_token, options = nil) ⇒ Client
Get a Client configured to use OAuth authentication.
-
.connect_token(token, options = nil) ⇒ Client
Get a Client configured to use Token authentication.
Class Method Details
.connect(api_key, options = nil) ⇒ Client
Get a Client configured to use HTTP Basic authentication.
21 22 23 24 25 26 27 28 |
# File 'lib/snap_deploy/provider/heroku/api.rb', line 21 def self.connect(api_key, =nil) = () uri = URI.parse([:url]) uri.user = .fetch(:user, 'user').gsub('@', '%40') uri.password = api_key client = Heroics.client_from_schema(SCHEMA, uri.to_s, ) Client.new(client) end |
.connect_oauth(oauth_token, options = nil) ⇒ Client
Get a Client configured to use OAuth authentication.
38 39 40 41 42 43 |
# File 'lib/snap_deploy/provider/heroku/api.rb', line 38 def self.connect_oauth(oauth_token, =nil) = () url = [:url] client = Heroics.oauth_client_from_schema(oauth_token, SCHEMA, url, ) Client.new(client) end |
.connect_token(token, options = nil) ⇒ Client
Get a Client configured to use Token authentication.
53 54 55 56 57 58 |
# File 'lib/snap_deploy/provider/heroku/api.rb', line 53 def self.connect_token(token, =nil) = () url = [:url] client = Heroics.token_client_from_schema(token, SCHEMA, url, ) Client.new(client) end |