public class OfflineCredentials extends Object
Credential credential = new OfflineCredentials.Builder()
.forApi(OfflineCredentials.Api.ADWORDS)
.fromFile()
.build()
.generateCredential();
Generate a refresh token or service account key file and place
it in your ads.properties file to be read by this utility.| Modifier and Type | Class and Description |
|---|---|
static class |
OfflineCredentials.Api
Enum representing the API that OfflineCredentials can be used for.
|
static class |
OfflineCredentials.Builder
Pre-builder for OfflineCredentials.
|
static class |
OfflineCredentials.CustomOAuthConfig
A class defining a custom OAuth config.
|
static class |
OfflineCredentials.ForApiBuilder
Builder for OfflineCredentials.
|
static interface |
OfflineCredentials.OAuthConfig
Interface outlining the values required for OAuth configuration.
|
| Modifier and Type | Method and Description |
|---|---|
com.google.api.client.auth.oauth2.Credential |
generateCredential()
Generates a new offline credential and immediately refreshes it.
|
String |
getClientId()
Gets the client ID that will be used to
generate a
Credential. |
String |
getClientSecret()
Gets the client secret that will be used to
generate a
Credential. |
com.google.api.client.http.HttpTransport |
getHttpTransport()
Gets the
HttpTransport that will be used when
generating a Credential. |
String |
getJsonKeyFilePath()
Gets the file path to a JSON key file that will be used to
generate a service account
Credential. |
String |
getRefreshToken()
Gets the refresh token that will be used to
generate a
Credential. |
public com.google.api.client.http.HttpTransport getHttpTransport()
HttpTransport that will be used when
generating a Credential.public String getRefreshToken()
Credential.public String getClientId()
Credential.public String getClientSecret()
Credential.public String getJsonKeyFilePath()
Credential.public com.google.api.client.auth.oauth2.Credential generateCredential()
throws OAuthException
OAuthException - if the credential could not be refreshed.Copyright © 2020. All Rights Reserved.