public static class AdWordsSession.Builder extends Object implements Builder<AdWordsSession>
Implementation is not thread-safe.
DEFAULT_CONFIGURATION_FILENAME| Constructor and Description |
|---|
AdWordsSession.Builder()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
AdWordsSession |
build()
Builds the
AdWordsSession. |
AdWordsSession.Builder |
enablePartialFailure()
Enables partial failure.
|
AdWordsSession.Builder |
enableReportMoneyInMicros()
Enable downloading of money values in reports in micros.
|
AdWordsSession.Builder |
from(org.apache.commons.configuration.Configuration config)
Reads properties from the provided
Configuration object.Known properties: api.adwords.clientLoginToken api.adwords.clientCustomerId api.adwords.userAgent api.adwords.developerToken api.adwords.isPartialFailure api.adwords.environment - e.g. |
AdWordsSession.Builder |
fromFile()
Loads credentials from "ads.properties" file in one of the following
locations according to the following order: in the current directory, in
the user home directory, in the classpath
|
AdWordsSession.Builder |
fromFile(File path)
Populates this builder from a properties file from a specified path.
|
AdWordsSession.Builder |
fromFile(String path)
Populates this builder from a properties file from a specified path.
|
AdWordsSession.Builder |
fromFile(URL path)
Populates this builder from a properties file from a specified path.
|
AdWordsSession.Builder |
withClientCustomerId(String clientCustomerId)
Includes a clientCustomerId.
|
AdWordsSession.Builder |
withClientLoginToken(String clientLoginToken)
Includes hard-coded ClientLogin token that will be used instead of
fetching a new one.
|
AdWordsSession.Builder |
withDeveloperToken(String developerToken)
Includes a developer token.
|
AdWordsSession.Builder |
withEndpoint(String endpoint)
Override the endpoint server.
|
AdWordsSession.Builder |
withEnvironment(AdWordsSession.Environment environment)
Includes the specified environment, e.g.
|
AdWordsSession.Builder |
withOAuth2Credential(com.google.api.client.auth.oauth2.Credential oAuth2Credential)
Includes OAuth2 credential to be used for OAuth2 authentication.
|
AdWordsSession.Builder |
withOAuthParameters(com.google.api.client.auth.oauth.OAuthParameters oAuthParameters)
Deprecated.
It is encouraged that you switch to OAuth2 at your earliest
convenience. Beginning in 1.9.0, the GoogleOAuth
authorization flow will no longer be supported, making it
substantially more difficult to create OAuth1.0a tokens.
|
AdWordsSession.Builder |
withUserAgent(String userAgent)
Includes user agent.
|
public AdWordsSession.Builder fromFile() throws com.google.api.ads.common.lib.conf.ConfigurationLoadException
BuilderfromFile in interface Builder<AdWordsSession>com.google.api.ads.common.lib.conf.ConfigurationLoadException - if the configuration could not be
loaded.public AdWordsSession.Builder fromFile(String path) throws com.google.api.ads.common.lib.conf.ConfigurationLoadException
BuilderfromFile in interface Builder<AdWordsSession>path - the path to try first as a resource, then as a filecom.google.api.ads.common.lib.conf.ConfigurationLoadException - if the configuration could not be
loaded.public AdWordsSession.Builder fromFile(File path) throws com.google.api.ads.common.lib.conf.ConfigurationLoadException
BuilderfromFile in interface Builder<AdWordsSession>path - the path to load properties fromcom.google.api.ads.common.lib.conf.ConfigurationLoadException - if the configuration could not be
loaded.public AdWordsSession.Builder fromFile(URL path) throws com.google.api.ads.common.lib.conf.ConfigurationLoadException
BuilderfromFile in interface Builder<AdWordsSession>path - the path to try first as a resource, then as a filecom.google.api.ads.common.lib.conf.ConfigurationLoadException - if the configuration could not be
loaded.public AdWordsSession.Builder from(org.apache.commons.configuration.Configuration config)
Configuration object.from in interface Builder<AdWordsSession>config - public AdWordsSession.Builder withClientLoginToken(String clientLoginToken)
public AdWordsSession.Builder withDeveloperToken(String developerToken)
@Deprecated public AdWordsSession.Builder withOAuthParameters(com.google.api.client.auth.oauth.OAuthParameters oAuthParameters)
public AdWordsSession.Builder withOAuth2Credential(com.google.api.client.auth.oauth2.Credential oAuth2Credential)
public AdWordsSession.Builder withUserAgent(String userAgent)
public AdWordsSession.Builder withEnvironment(AdWordsSession.Environment environment)
AdWordsSession.Environment.SANDBOX
The environment and endpoint in AdWords are currently synonymous. Setting
an environment will clear out any endpoint you have previously set.public AdWordsSession.Builder withEndpoint(String endpoint)
public AdWordsSession.Builder withClientCustomerId(String clientCustomerId)
public AdWordsSession.Builder enablePartialFailure()
public AdWordsSession.Builder enableReportMoneyInMicros()
public AdWordsSession build() throws ValidationException
AdWordsSession.build in interface Builder<AdWordsSession>AdWordsSessionValidationException - if the AdWordsSession did not validateCopyright © 2012. All Rights Reserved.