com.google.api.adwords.lib
Class AdWordsUser

java.lang.Object
  extended by com.google.api.adwords.lib.AdWordsUser
All Implemented Interfaces:
Credentials

public final class AdWordsUser
extends java.lang.Object

An immutable object representing a single AdWords user. The user can act on his/her own behalf, or as an MCC user on behalf of a client.


Field Summary
static int ACCOUNT_SERVICE
           
static int AD_GROUP_SERVICE
           
static int AD_SERVICE
           
static int CAMPAIGN_SERVICE
           
static int CRITERION_SERVICE
           
static int INFO_SERVICE
           
static int KEYWORDTOOL_SERVICE
           
static int REPORT_SERVICE
           
static int SITE_SUGGESTION_SERVICE
           
static int TRAFFIC_ESTIMATOR_SERVICE
           
protected  java.lang.String version
           
 
Constructor Summary
AdWordsUser()
          Create an an AdWordsUser with the default properties file name "~/.adwords-api.properties"
AdWordsUser(java.util.Map creds)
          Create an an AdWordsUser with the given Map keys that can be specified are email, password, token, useragent, clientEmail and alternateUrl.
AdWordsUser(java.lang.String filename)
          Create an an AdWordsUser with the given properties file name properties that can be specified are email, password, token, useragent, clientEmail and alternateUrl.
AdWordsUser(java.lang.String email, java.lang.String password, java.lang.String developerToken, java.lang.String applicationToken, java.lang.String useragent)
          Create an an AdWordsUser with the given email, password, developer token, and useragent.
AdWordsUser(java.lang.String email, java.lang.String password, java.lang.String developerToken, java.lang.String applicationToken, java.lang.String useragent, java.lang.String clientEmail)
          Create an an AdWordsUser with the given email, password, developer token, useragent, and clientEmail.
AdWordsUser(java.lang.String email, java.lang.String password, java.lang.String developerToken, java.lang.String applicationToken, java.lang.String useragent, java.lang.String clientEmail, java.net.URL alternateUrl, java.lang.String version)
          Create an an AdWordsUser with the given email, password, developer token, useragent, clientEmail, and alternate base URL.
AdWordsUser(java.lang.String email, java.lang.String password, java.lang.String developerToken, java.lang.String applicationToken, java.lang.String useragent, java.net.URL url)
          Create an an AdWordsUser with the given email, password, developer token, and useragent.
 
Method Summary
 java.net.URL getAlternateUrl()
          Returns the alternate URL associated with this AdWordsUser, or null if the default URL is to be used.
 java.lang.String getApplicationToken()
          Returns the user's application token.
 java.lang.String getClientEmail()
          Returns the client's email address, or null if this user acts on his/her own behalf.
 java.lang.String getDeveloperToken()
          Returns the user's developer token.
 java.lang.String getEmail()
          Returns the user's email address.
static java.util.Map getMap(java.lang.String filename)
           
 java.lang.String getPassword()
          Returns the user's password.
 java.lang.Object getService(int service)
          Create a new Axis Service object.
 java.lang.String getUseragent()
          Returns the user's useragent.
 java.lang.String toString()
          Returns a String describing this user.
 java.lang.String toString(boolean hidePassword, boolean hideTokens)
          Returns a String describing this user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ACCOUNT_SERVICE

public static final int ACCOUNT_SERVICE
See Also:
Constant Field Values

AD_SERVICE

public static final int AD_SERVICE
See Also:
Constant Field Values

AD_GROUP_SERVICE

public static final int AD_GROUP_SERVICE
See Also:
Constant Field Values

CAMPAIGN_SERVICE

public static final int CAMPAIGN_SERVICE
See Also:
Constant Field Values

CRITERION_SERVICE

public static final int CRITERION_SERVICE
See Also:
Constant Field Values

INFO_SERVICE

public static final int INFO_SERVICE
See Also:
Constant Field Values

KEYWORDTOOL_SERVICE

public static final int KEYWORDTOOL_SERVICE
See Also:
Constant Field Values

REPORT_SERVICE

public static final int REPORT_SERVICE
See Also:
Constant Field Values

SITE_SUGGESTION_SERVICE

public static final int SITE_SUGGESTION_SERVICE
See Also:
Constant Field Values

TRAFFIC_ESTIMATOR_SERVICE

public static final int TRAFFIC_ESTIMATOR_SERVICE
See Also:
Constant Field Values

version

protected final java.lang.String version
Constructor Detail

AdWordsUser

public AdWordsUser()
            throws java.io.IOException
Create an an AdWordsUser with the default properties file name "~/.adwords-api.properties"

Throws:
java.io.IOException

AdWordsUser

public AdWordsUser(java.lang.String filename)
            throws java.io.IOException
Create an an AdWordsUser with the given properties file name properties that can be specified are email, password, token, useragent, clientEmail and alternateUrl.

Parameters:
filename - the path to the properties file it needs to follow the java.util.Properties file format
Throws:
java.io.IOException

AdWordsUser

public AdWordsUser(java.util.Map creds)
            throws java.net.MalformedURLException
Create an an AdWordsUser with the given Map keys that can be specified are email, password, token, useragent, clientEmail and alternateUrl.

Parameters:
properties - the Map object containing the constructor parameters
Throws:
java.net.MalformedURLException

AdWordsUser

public AdWordsUser(java.lang.String email,
                   java.lang.String password,
                   java.lang.String developerToken,
                   java.lang.String applicationToken,
                   java.lang.String useragent,
                   java.lang.String clientEmail)
Create an an AdWordsUser with the given email, password, developer token, useragent, and clientEmail.

Parameters:
email - the email address for the MCC account.
password - the password for the MCC account.
token - the developer token for the MCC account.
useragent - the useragent for the application.
clientEmail - the email address for the client.

AdWordsUser

public AdWordsUser(java.lang.String email,
                   java.lang.String password,
                   java.lang.String developerToken,
                   java.lang.String applicationToken,
                   java.lang.String useragent)
Create an an AdWordsUser with the given email, password, developer token, and useragent.

Parameters:
email - the email address for the account.
password - the password for the account.
token - the developer token for the account.
useragent - the useragent for the application.

AdWordsUser

public AdWordsUser(java.lang.String email,
                   java.lang.String password,
                   java.lang.String developerToken,
                   java.lang.String applicationToken,
                   java.lang.String useragent,
                   java.lang.String clientEmail,
                   java.net.URL alternateUrl,
                   java.lang.String version)
            throws java.net.MalformedURLException
Create an an AdWordsUser with the given email, password, developer token, useragent, clientEmail, and alternate base URL.

Parameters:
email - the email address for the MCC account.
password - the password for the MCC account.
token - the developer token for the MCC account.
useragent - the useragent for the application.
clientEmail - the email address for the client.
alternateUrl - the URL to use instead of the default when connecting to the web service.
Throws:
java.net.MalformedURLException - if the provided URL concatenated with the standard service names produces an invalid URL

AdWordsUser

public AdWordsUser(java.lang.String email,
                   java.lang.String password,
                   java.lang.String developerToken,
                   java.lang.String applicationToken,
                   java.lang.String useragent,
                   java.net.URL url)
            throws java.net.MalformedURLException
Create an an AdWordsUser with the given email, password, developer token, and useragent.

Parameters:
email - the email address for the account.
password - the password for the account.
token - the developer token for the account.
useragent - the useragent for the application.
alternateUrl - the URL to use instead of the default when connecting to the web service.
Throws:
java.net.MalformedURLException - if the provided URL concatenated with the standard service names produces an invalid URL
Method Detail

getMap

public static java.util.Map getMap(java.lang.String filename)
                            throws java.io.IOException
Throws:
java.io.IOException

getEmail

public java.lang.String getEmail()
Returns the user's email address.

Returns:
the user's email address.

getPassword

public java.lang.String getPassword()
Returns the user's password.

Returns:
the user's password.

getDeveloperToken

public java.lang.String getDeveloperToken()
Returns the user's developer token.

Returns:
the user's developer token.

getApplicationToken

public java.lang.String getApplicationToken()
Returns the user's application token.

Returns:
the user's application token.

getUseragent

public java.lang.String getUseragent()
Returns the user's useragent.

Returns:
the user's useragent.

getClientEmail

public java.lang.String getClientEmail()
Returns the client's email address, or null if this user acts on his/her own behalf.

Returns:
the client's email address, or null if this user acts on his/her own behalf.

toString

public java.lang.String toString()
Returns a String describing this user. The exact format is unspecified and subject to change. A reasonable description might be: "[AdWordsUser email='user@company.com' clientEmail='someone@client.com']"

Specified by:
toString in interface Credentials
Overrides:
toString in class java.lang.Object
Returns:
short description of this AdWordsUser.

toString

public java.lang.String toString(boolean hidePassword,
                                 boolean hideTokens)
Returns a String describing this user. Parameters control whether password and developer token are displayed. The exact format is unspecified and subject to change. A reasonable description might be: "[AdWordsUser email='user@company.com' token='difjwlkdi-fienw']"

Parameters:
hidePassword - false iff the password may appear in the result.
hideTokens - false iff the developer and application token may appear in the result.
Returns:
a short description of this AdWordsUser.

getAlternateUrl

public java.net.URL getAlternateUrl()
Returns the alternate URL associated with this AdWordsUser, or null if the default URL is to be used.

Returns:
the alternate URL associated with this AdWordsUser, or null if the default URL is to be used.

getService

public final java.lang.Object getService(int service)
                                  throws javax.xml.rpc.ServiceException
Create a new Axis Service object.

Specified by:
getService in interface Credentials
Returns:
the new Axis Service object.
Throws:
javax.xml.rpc.ServiceException - if the underlying Axis implementation cannot be correctly instantiated.


Copyright © 2005 Google Corp. All Rights Reserved.