com.google.api.ads.adwords.lib.client
Class AdWordsSession

java.lang.Object
  extended by com.google.api.ads.adwords.lib.client.AdWordsSession
All Implemented Interfaces:
OAuth2Compatible, OAuthCompatible, AdsSession

public class AdWordsSession
extends Object
implements AdsSession, OAuthCompatible, OAuth2Compatible

A AdWordsSession represents a single session of AdWords use.

Author:
Adam Rogal

Nested Class Summary
static class AdWordsSession.Builder
          Builder for AdWordsSession.
static class AdWordsSession.Environment
          Enum representing the endpoint server, aka environment.
 
Method Summary
 String getClientCustomerId()
          Gets the client customer ID.
 String getClientLoginToken()
          Gets the client login token.
 String getDeveloperToken()
           
 String getEndpoint()
          Returns the server endpoint to make requests against.
 com.google.api.client.auth.oauth2.Credential getOAuth2Credential()
          Gets the OAuth2 credentials.
 com.google.api.client.auth.oauth.OAuthParameters getOAuthParameters()
          Gets the OAuth parameters.
 String getUserAgent()
           
 boolean isEnvironment(Endpoint environment)
          Determines if the session is for the supplied AdWordsSession.Environment.
 Boolean isPartialFailure()
           
 Boolean isReportMoneyInMicros()
           
 Boolean isValidateOnly()
          Returns true if the session should only validate the request.
 void setClientCustomerId(String clientCustomerId)
          Sets the client customer ID.
 void setClientLoginToken(String clientLoginToken)
          Sets the ClientLogin Token.
 void setOAuth2Credential(com.google.api.client.auth.oauth2.Credential oAuth2Credential)
          Sets the OAuth2 credential.
 void setOAuthParameters(com.google.api.client.auth.oauth.OAuthParameters oAuthParameters)
          Sets the OAuth parameters.
 void setPartialFailure(Boolean isPartialFailure)
          Sets whether this session should allow partial failure.
 void setReportMoneyInMicros(Boolean reportMoneyInMicros)
           
 void setValidateOnly(Boolean isValidateOnly)
          Sets whether this session should only validate the request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getClientCustomerId

public String getClientCustomerId()
Gets the client customer ID.


setClientCustomerId

public void setClientCustomerId(String clientCustomerId)
Sets the client customer ID.


isValidateOnly

public Boolean isValidateOnly()
Returns true if the session should only validate the request.


setValidateOnly

public void setValidateOnly(Boolean isValidateOnly)
Sets whether this session should only validate the request.


setPartialFailure

public void setPartialFailure(Boolean isPartialFailure)
Sets whether this session should allow partial failure.


getUserAgent

public String getUserAgent()
Returns:
the userAgent

getDeveloperToken

public String getDeveloperToken()
Returns:
the developerToken

isPartialFailure

public Boolean isPartialFailure()
Returns:
the isPartialFailure

getOAuthParameters

public com.google.api.client.auth.oauth.OAuthParameters getOAuthParameters()
Description copied from interface: OAuthCompatible
Gets the OAuth parameters.

Specified by:
getOAuthParameters in interface OAuthCompatible
Returns:
the oAuthParameters

setOAuthParameters

public void setOAuthParameters(com.google.api.client.auth.oauth.OAuthParameters oAuthParameters)
Sets the OAuth parameters. Any other authentication credentials on the session will be removed.


getOAuth2Credential

public com.google.api.client.auth.oauth2.Credential getOAuth2Credential()
Gets the OAuth2 credentials.

Specified by:
getOAuth2Credential in interface OAuth2Compatible

setOAuth2Credential

public void setOAuth2Credential(com.google.api.client.auth.oauth2.Credential oAuth2Credential)
Sets the OAuth2 credential. Any other authentication credentials on the session will be removed.


getClientLoginToken

public String getClientLoginToken()
Gets the client login token.


setClientLoginToken

public void setClientLoginToken(String clientLoginToken)
Sets the ClientLogin Token. Any other authentication credentials on the session will be removed.


getEndpoint

public String getEndpoint()
Description copied from interface: AdsSession
Returns the server endpoint to make requests against.

Specified by:
getEndpoint in interface AdsSession
Returns:
the endpoint

setReportMoneyInMicros

public void setReportMoneyInMicros(Boolean reportMoneyInMicros)
Parameters:
reportMoneyInMicros - the reportMoneyInMicros to set

isReportMoneyInMicros

public Boolean isReportMoneyInMicros()
Returns:
the reportMoneyInMicros

isEnvironment

public boolean isEnvironment(Endpoint environment)
Determines if the session is for the supplied AdWordsSession.Environment.

Specified by:
isEnvironment in interface AdsSession
Parameters:
environment - the environment to check


Copyright © 2012. All Rights Reserved.