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

Examples of com.google.api.ads.adwords.lib.client.AdWordsSession.Builder


   * @param adWordsSession to copy from
   * @param userAgent the new User Agent for the session
   * @return a new copy of the AdWordsSession
   */
  public static AdWordsSession copy(AdWordsSession adWordsSession, String userAgent) {
    AdWordsSession.Builder builder = new Builder();
    if (adWordsSession.getEndpoint() != null) {
      builder = builder.withEndpoint(adWordsSession.getEndpoint());
    }
    if (userAgent != null) {
      builder = builder.withUserAgent(userAgent);
    } else {
      builder = builder.withUserAgent(USER_AGENT);
    }
    if (adWordsSession.getDeveloperToken() != null) {
      builder = builder.withDeveloperToken(adWordsSession.getDeveloperToken());
    }
    if (adWordsSession.getClientCustomerId() != null) {
      builder = builder.withClientCustomerId(adWordsSession.getClientCustomerId());
    }
    if (adWordsSession.getOAuth2Credential() != null) {
      builder = builder.withOAuth2Credential(adWordsSession.getOAuth2Credential());
    }

    try {
      AdWordsSession newAdWordsSession;
      newAdWordsSession = builder.build();
      newAdWordsSession.setPartialFailure(adWordsSession.isPartialFailure());
      newAdWordsSession.setValidateOnly(adWordsSession.isValidateOnly());
      newAdWordsSession.setReportMoneyInMicros(adWordsSession.isReportMoneyInMicros());
      return newAdWordsSession;
    } catch (ValidationException e) {
View Full Code Here

TOP

Related Classes of com.google.api.ads.adwords.lib.client.AdWordsSession.Builder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.