Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  // Copyright 2012 Google Inc. All Rights Reserved.
  //
  // Licensed under the Apache License, Version 2.0 (the "License");
  // you may not use this file except in compliance with the License.
  // You may obtain a copy of the License at
  //
  //       http://www.apache.org/licenses/LICENSE-2.0
  //
  // Unless required by applicable law or agreed to in writing, software
 // distributed under the License is distributed on an "AS IS" BASIS,
 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
 package com.google.api.ads.adwords.axis.utility.extension;
 
 
 import java.util.Date;
 import java.util.List;

ExtendedCampaign, encapsulates the com.google.api.ads.adwords.axis.v201306.cm.Campaign level operations.

Author(s):
Julian Toledo
 
 public final class ExtendedCampaign {
 
   private final DelegateLocator delegateLocator;
 
   private final Campaign campaign;

  
Default Constructor.

Parameters:
campaign the Campaign to encapsulate
delegateLocator the DelegateLocator for the Account (ManagedCustomer)
 
   public ExtendedCampaign(Campaign campaignDelegateLocator delegateLocator) {
     this. = campaign;
     this. = delegateLocator;
   }

  
Transforms a regular list of Campaigns into a list of ExtendedCampaigns.

Parameters:
campaigns a list of Campaigns to convert
delegateLocator the DelegateLocator for the Account (ManagedCustomer)
Returns:
the converted list of ExtendedCampaigns
 
   public static List<ExtendedCampaignas(List<Campaigncampaigns,
       final DelegateLocator delegateLocator) {
     if (campaigns == null || campaigns.isEmpty()) {
      return Lists.newArrayList(); 
     }
     return Lists.transform(campaignsnew Function<CampaignExtendedCampaign>() {
       public ExtendedCampaign apply(Campaign campaign) {
         return new ExtendedCampaign(campaigndelegateLocator);
       }
     });
   }

  
Retrieves the DelegateLocator for the Account (ManagedCustomer).

Returns:
the DelegateLocator for the Account (ManagedCustomer)
 
     return ;
   }

  
Retrieves the encapsulated Campaign

Returns:
the encapsulated Campaign
 
   public Campaign getCampaign() {
     return ;
   }

  
Updates the ExtendedCampaign's Campaign.

Note: remove is not supported, instead, set its status to DELETED and then update(). See com.google.api.ads.adwords.axis.v201306.cm.CampaignServiceInterface.

Returns:
the updated ExtendedCampaign
Throws:
java.rmi.RemoteException for communication-related exceptions
  public ExtendedCampaign update() throws RemoteException {
        );
  }

  
Gets the ExtendedAdGroups for the ExtendedCampaign's Campaign.

Returns:
all the ExtendedAdGroups for the ExtendedCampaign's Campaign
Throws:
java.rmi.RemoteException for communication-related exceptions
    return ExtendedAdGroup.as(
  }

  
Gets the AdGroups for the ExtendedCampaign's Campaign.

Returns:
all the AdGroups for the ExtendedCampaign's Campaign
Throws:
java.rmi.RemoteException for communication-related exceptions
  public List<AdGroupgetAdGroups() throws RemoteException {
  }

  
Inserts the AdGroups into the ExtendedCampaign's Campaign.

Parameters:
adGroups the list of AdGroups to insert
Returns:
the updated List of ExtendedAdGroups
Throws:
java.rmi.RemoteException for communication-related exceptions
  public List<ExtendedAdGroupinsertAdGroups(List<AdGroupadGroupsthrows RemoteException {
    for (AdGroup adGroup : adGroups) {
      if (adGroup.getCampaignId() == null) {
        adGroup.setCampaignId(.getId());
      }
    }
    return ExtendedAdGroup.as(.getAdGroupDelegate().insert(adGroups),
        );
  }

  
Inserts the AdGroup into the ExtendedCampaign's Campaign.

Parameters:
adGroup the AdGroup to insert
Returns:
the updated ExtendedAdGroup
Throws:
java.rmi.RemoteException for communication-related exceptions
  public ExtendedAdGroup insertAdGroup(AdGroup adGroupthrows RemoteException {
    if (adGroup.getCampaignId() == null) {
      adGroup.setCampaignId(.getId());
    }
    return new ExtendedAdGroup(
  }

  
Uptades the AdGroups for the ExtendedCampaign's Campaign.

Parameters:
adGroups the list of AdGroups to update
Returns:
the updated list of ExtendedAdGroups
Throws:
java.rmi.RemoteException for communication-related exceptions
  public List<ExtendedAdGroupupdateAdGroups(List<AdGroupadGroupsthrows RemoteException {
    for (AdGroup adGroup : adGroups) {
      if (adGroup.getCampaignId() == null) {
        adGroup.setCampaignId(.getId());
      }
    }
    return ExtendedAdGroup.as(.getAdGroupDelegate().update(adGroups),
        );
  }

  
Gets the CampaignCriterions for the ExtendedCampaign's Campaign.

Returns:
all the CampaignCriterions for the ExtendedCampaign's Campaign
Throws:
java.rmi.RemoteException for communication-related exceptions
  }

  
Inserts the CampaignCriterions into the ExtendedCampaign's Campaign.

Parameters:
campaignCriterions the list of CampaignCriterions to insert
Returns:
the updated list of CampaignCriterions
Throws:
java.rmi.RemoteException for communication-related exceptions
      List<CampaignCriterioncampaignCriterionsthrows RemoteException {
    return .getCampaignCriterionDelegate().insert(campaignCriterions);
  }

  
Inserts the CampaignCriterion into the ExtendedCampaign's Campaign.

Parameters:
campaignCriterion the CampaignCriterion to insert
Returns:
the updated CampaignCriterion
Throws:
java.rmi.RemoteException for communication-related exceptions
      throws RemoteException {
    return .getCampaignCriterionDelegate().insert(campaignCriterion);
  }

  
Inserts the Criterion into the ExtendedCampaign's Campaign.

Note: this method creates the necessary CampaignCriterion implicitly.

Parameters:
criterion the Criterion to insert
Returns:
the updated CampaignCriterion
Throws:
java.rmi.RemoteException for communication-related exceptions
    CampaignCriterion campaignCriterion = new CampaignCriterion();
    campaignCriterion.setCampaignId(getCampaign().getId());
    campaignCriterion.setCriterion(criterion);
    return .getCampaignCriterionDelegate().insert(campaignCriterion);
  }
  
  
Inserts the Criterion as negative into the ExtendedCampaign's Campaign.

Note: this method creates the necessary NegativeCampaignCriterion implicitly.

Parameters:
criterion the Criterion to insert
Returns:
the updated CampaignCriterion
Throws:
java.rmi.RemoteException for communication-related exceptions
      throws RemoteException {
    NegativeCampaignCriterion negativeCampaignCriterion = new NegativeCampaignCriterion();
    negativeCampaignCriterion.setCampaignId(getCampaign().getId());
    negativeCampaignCriterion.setCriterion(criterion);
    return .getCampaignCriterionDelegate().insert(negativeCampaignCriterion);
  }

  
Updates the CampaignCriterions for the ExtendedCampaign's Campaign.

Parameters:
campaignCriterions the list of CampaignCriterions to update
Returns:
the updated list of CampaignCriterions
Throws:
java.rmi.RemoteException for communication-related exceptions
      List<CampaignCriterioncampaignCriterionsthrows RemoteException {
    return .getCampaignCriterionDelegate().update(campaignCriterions);
  }

  
Updates the CampaignCriterion for the ExtendedCampaign's Campaign.

Parameters:
campaignCriterion the CampaignCriterion to update
Returns:
the updated CampaignCriterion
Throws:
java.rmi.RemoteException for communication-related exceptions
      throws RemoteException {
    return .getCampaignCriterionDelegate().update(campaignCriterion);
  }

  
Removes the CampaignCriterions from the ExtendedCampaign's Campaign.

Parameters:
campaignCriterions the list of CampaignCriterions to remove
Returns:
the updated list of CampaignCriterions
Throws:
java.rmi.RemoteException for communication-related exceptions
      List<CampaignCriterioncampaignCriterionsthrows RemoteException {
    return .getCampaignCriterionDelegate().remove(campaignCriterions);
  }

  
Removes the CampaignCriterion from the ExtendedCampaign's Campaign.

Parameters:
campaignCriterion the CampaignCriterion to remove
Returns:
the updated CampaignCriterion
Throws:
java.rmi.RemoteException for communication-related exceptions
      throws RemoteException {
    return .getCampaignCriterionDelegate().remove(campaignCriterion);
  }

  
Gets the CampaignAdExtensions for the ExtendedCampaign's Campaign.

Returns:
all the CampaignAdExtensions for the ExtendedCampaign's Campaign
Throws:
java.rmi.RemoteException for communication-related exceptions
  }

  
Inserts the CampaignAdExtensions into the ExtendedCampaign's Campaign.

Parameters:
campaignAdExtensions the list of CampaignAdExtension to insert
Returns:
the updated list of CampaignAdExtensions
Throws:
java.rmi.RemoteException for communication-related exceptions
      List<CampaignAdExtensioncampaignAdExtensionsthrows RemoteException {
    return .getCampaignAdExtensionDelegate().insert(campaignAdExtensions);
  }

  
Inserts the CampaignAdExtension into the ExtendedCampaign's Campaign.

Parameters:
campaignAdExtension the CampaignAdExtension to insert
Returns:
the updated CampaignAdExtension
Throws:
java.rmi.RemoteException for communication-related exceptions
      throws RemoteException {
    return .getCampaignAdExtensionDelegate().insert(campaignAdExtension);
  }
  
  
Inserts the AdExtension into the ExtendedCampaign's Campaign.

Note: this method creates the necessary CampaignAdExtension implicitly.

Parameters:
adExtension the AdExtension to insert
Returns:
the updated CampaignAdExtension
Throws:
java.rmi.RemoteException for communication-related exceptions
      throws RemoteException {
    CampaignAdExtension campaignAdExtension = new CampaignAdExtension();
    campaignAdExtension.setCampaignId(getCampaign().getId());
    campaignAdExtension.setAdExtension(adExtension);
    return .getCampaignAdExtensionDelegate().insert(campaignAdExtension);
  }

  
Removes the CampaignAdExtensions from the ExtendedCampaign's Campaign.

Parameters:
campaignAdExtensions the list of CampaignAdExtensions to remove
Returns:
the updated list of CampaignAdExtensions
Throws:
java.rmi.RemoteException for communication-related exceptions
      List<CampaignAdExtensioncampaignAdExtensionsthrows RemoteException {
    return .getCampaignAdExtensionDelegate().remove(campaignAdExtensions);
  }

  
Removes the CampaignAdExtension from the ExtendedCampaign's Campaign.

Parameters:
campaignAdExtension the CampaignAdExtension to remove
Returns:
the updated CampaignAdExtension
Throws:
java.rmi.RemoteException for communication-related exceptions
      throws RemoteException {
    return .getCampaignAdExtensionDelegate().remove(campaignAdExtension);
  }

  
Gets the AdExtensionOverrides for the ExtendedCampaign's Campaign.

Returns:
all the AdExtensionOverrides for the ExtendedCampaign's Campaign
Throws:
java.rmi.RemoteException for communication-related exceptions
  }

  
Inserts the AdExtensionOverrides into the ExtendedCampaign's Campaign.

Parameters:
adExtensionOverrides the list of AdExtensionOverride to insert
Returns:
the updated list of AdExtensionOverrides
Throws:
java.rmi.RemoteException for communication-related exceptions
      List<AdExtensionOverrideadExtensionOverridesthrows RemoteException {
    return .getAdExtensionOverrideDelegate().insert(adExtensionOverrides);
  }

  
Inserts the AdExtensionOverride into the ExtendedCampaign's Campaign.

Parameters:
adExtensionOverride the AdExtensionOverride to insert
Returns:
the updated AdExtensionOverride
Throws:
java.rmi.RemoteException for communication-related exceptions
      throws RemoteException {
    return .getAdExtensionOverrideDelegate().insert(adExtensionOverride);
  }

  
Removes the AdExtensionOverrides from the ExtendedCampaign's Campaign.

Parameters:
adExtensionOverrides the list of AdExtensionOverrides to remove
Returns:
the updated list of AdExtensionOverrides
Throws:
java.rmi.RemoteException for communication-related exceptions
      List<AdExtensionOverrideadExtensionOverridesthrows RemoteException {
    return .getAdExtensionOverrideDelegate().remove(adExtensionOverrides);
  }

  
Removes the AdExtensionOverride from the ExtendedCampaign's Campaign.

Parameters:
adExtensionOverride the AdExtensionOverride to remove
Returns:
the updated AdExtensionOverride
Throws:
java.rmi.RemoteException for communication-related exceptions
      throws RemoteException {
    return .getAdExtensionOverrideDelegate().remove(adExtensionOverride);
  }

  
Gets the Experiments for the ExtendedCampaign's Campaign.

Returns:
all the Experiments for the ExtendedCampaign's Campaign
Throws:
java.rmi.RemoteException for communication-related exceptions
  public List<ExperimentgetExperiments() throws RemoteException {
  }

  
Inserts the Experiments into the ExtendedCampaign's Campaign.

Parameters:
experiments the list of Experiments to insert
Returns:
the updated list of Experiments
Throws:
java.rmi.RemoteException for communication-related exceptions
  public List<ExperimentinsertExperiments(List<Experimentexperimentsthrows RemoteException {
    return .getExperimentDelegate().insert(experiments);
  }

  
Inserts the Experiment into the ExtendedCampaign's Campaign.

Parameters:
experiment the Experiment to insert
Returns:
the updated Experiment
Throws:
java.rmi.RemoteException for communication-related exceptions
  public Experiment insertExperiment(Experiment experimentthrows RemoteException {
    return .getExperimentDelegate().insert(experiment);
  }

  
Updates the Experiments into the ExtendedCampaign's Campaign.

Note: removeExperiments is not supported, instead, set its status to DELETED and then update(). See com.google.api.ads.adwords.axis.v201306.cm.ExperimentServiceInterface.

Parameters:
experiments the list of Experiments to update
Returns:
the updated list of Experiments
Throws:
java.rmi.RemoteException for communication-related exceptions
  public List<ExperimentupdateExperiments(List<Experimentexperimentsthrows RemoteException {
    return .getExperimentDelegate().update(experiments);
  }

  
Updates the Experiment into the ExtendedCampaign's Campaign.

Note: removeExperiments is not supported, instead, set its status to DELETED and then update(). See com.google.api.ads.adwords.axis.v201306.cm.ExperimentServiceInterface.

Parameters:
experiment the Experiment to update
Returns:
the updated Experiment
Throws:
java.rmi.RemoteException for communication-related exceptions
  public Experiment updateExperiment(Experiment experimentthrows RemoteException {
    return .getExperimentDelegate().update(experiment);
  }

  
Gets the AdGroupBidLandscapes for the ExtendedCampaign's Campaign.

Returns:
all the AdGroupBidLandscapes for the ExtendedCampaign's Campaign
Throws:
java.rmi.RemoteException for communication-related exceptions
  }

  
Gets the CriterionBidLandscapes for the ExtendedCampaign's Campaign.

Returns:
all the CriterionBidLandscapes for the ExtendedCampaign's Campaign
Throws:
java.rmi.RemoteException for communication-related exceptions
  }

  
Gets the CampaignChangeDatas for the ExtendedCampaign's Campaign.

Returns:
all the CampaignChangeData for the ExtendedCampaign's Campaign
Throws:
java.rmi.RemoteException for communication-related exceptions
  public List<CampaignChangeDatagetCampaignChangeData(Date dateStartDate dateEnd)
      throws RemoteException {
        dateStartdateEnd);
  }

  
Gets the CampaignFeeds for the ExtendedCampaign's Campaign.

Returns:
all the CampaignFeeds for the ExtendedManagedCustomer's ManagedCustomer
Throws:
java.rmi.RemoteException for communication-related exceptions
  }
New to GrepCode? Check out our FAQ X