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.List;

ExtendedAdGroup, encapsulates the com.google.api.ads.adwords.axis.v201502.cm.AdGroup level operations.

Author(s):
Julian Toledo
 
 public final class ExtendedAdGroup {
 
   private final DelegateLocator delegateLocator;
 
   private final AdGroup adGroup;

  
Default Constructor.

Parameters:
delegateLocator the DelegateLocator for the Account (ManagedCustomer)
adGroup the AdGroup to encapsulate
 
   public ExtendedAdGroup(AdGroup adGroupDelegateLocator delegateLocator) {
     this. = adGroup;
     this. = delegateLocator;
   }

  
Transforms a regular list of AdGroups into a list of ExtendedAdGroups.

Parameters:
adGroups a list of AdGroups to convert
delegateLocator the DelegateLocator for the Account (ManagedCustomer)
Returns:
the converted list of ExtendedAdGroups
 
   public static List<ExtendedAdGroupas(List<AdGroupadGroups,
       final DelegateLocator delegateLocator) {
     if (adGroups == null || adGroups.isEmpty()) {
       return Lists.newArrayList(); 
     }
     return Lists.transform(adGroupsnew Function<AdGroupExtendedAdGroup>() {
       @Override
       public ExtendedAdGroup apply(AdGroup adGroup) {
         return new ExtendedAdGroup(adGroupdelegateLocator);
       }
     });
   }

  
Retrieves the DelegateLocator for the Account (ManagedCustomer).

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

  
Retrieves the encapsulated AdGroup.

Returns:
the encapsulated AdGroup
 
   public AdGroup getAdGroup() {
     return ;
   }

  
Updates the ExtendedAdGroup's AdGroup.

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

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

  
Gets the AdGroupCriterions for the ExtendedAdGroup's AdGroup.

Returns:
all the AdGroupCriterion for the AdGroup
Throws:
java.rmi.RemoteException for communication-related exceptions
  }

  
Gets the Negative AdGroupCriterions for the ExtendedAdGroup's AdGroup.

Returns:
all the Negative AdGroupCriterion for the AdGroup
Throws:
java.rmi.RemoteException for communication-related exceptions
        .getId(), .);
  }

  
Gets the Biddable (Positive) AdGroupCriterions for the ExtendedAdGroup's AdGroup.

Returns:
all the Biddable AdGroupCriterion for the AdGroup
Throws:
java.rmi.RemoteException for communication-related exceptions
        .getId(), .);
  }

  
Inserts the AdGroupCriterions into the ExtendedAdGroup's AdGroup.

Parameters:
adGroupCriterions the list of AdGroupCriterions to insert
Returns:
the updated list of AdGroupCriterions
Throws:
java.rmi.RemoteException for communication-related exceptions
      throws RemoteException {
    return .getAdGroupCriterionDelegate().insert(adGroupCriterions);
  }

  
Inserts the AdGroupCriterion into the ExtendedAdGroup's AdGroup.

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

  
Updates the Biddable AdGroupCriterions for the ExtendedAdGroup's AdGroup.

Parameters:
adGroupCriterions the list of AdGroupCriterions to update
Returns:
the updated list of AdGroupCriterions
Throws:
java.rmi.RemoteException for communication-related exceptions
      List<AdGroupCriterionadGroupCriterionsthrows RemoteException {
    return .getAdGroupCriterionDelegate().update(adGroupCriterions);
  }

  
Updates the Biddable AdGroupCriterion for the ExtendedAdGroup's AdGroup.

Parameters:
adGroupCriterion the AdGroupCriterion to update
Returns:
the updated list of AdGroupCriterions
Throws:
java.rmi.RemoteException for communication-related exceptions
      throws RemoteException {
    return .getAdGroupCriterionDelegate().update(adGroupCriterion);
  }

  
Removes the AdGroupCriterions from the ExtendedAdGroup's AdGroup.

Parameters:
adGroupCriterions the list of AdGroupCriterions to remove
Returns:
the updated list of AdGroupCriterions
Throws:
java.rmi.RemoteException for communication-related exceptions
      throws RemoteException {
    return .getAdGroupCriterionDelegate().remove(adGroupCriterions);
  }

  
Removes the AdGroupCriterion from the ExtendedAdGroup's AdGroup.

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

  
Gets the AdGroupAds for the ExtendedAdGroup's AdGroup.

Returns:
all the AdGroupAds for the AdGroup
Throws:
java.rmi.RemoteException for communication-related exceptions
  public List<AdGroupAdgetAdGroupAds() throws RemoteException {
  }

  
Inserts the AdGroupAds into the ExtendedAdGroup's AdGroup.

Parameters:
adGroupAds the list of AdGroupAds to insert
Returns:
the updated list of AdGroupAds
Throws:
java.rmi.RemoteException for communication-related exceptions
  public List<AdGroupAdinsertAdGroupAds(List<AdGroupAdadGroupAdsthrows RemoteException {
    return .getAdGroupAdDelegate().insert(adGroupAds);
  }

  
Inserts the AdGroupAd into the ExtendedAdGroup's AdGroup.

Parameters:
adGroupAd the AdGroupAd to insert
Returns:
the updated AdGroupAd
Throws:
java.rmi.RemoteException for communication-related exceptions
  public AdGroupAd insertAdGroupAd(AdGroupAd adGroupAdthrows RemoteException {
    return .getAdGroupAdDelegate().insert(adGroupAd);
  }

  
Updates the AdGroupAds for the ExtendedAdGroup's AdGroup.

Parameters:
adGroupAds the list of AdGroupAds to update
Returns:
the updated list of AdGroupAds
Throws:
java.rmi.RemoteException for communication-related exceptions
  public List<AdGroupAdupdateAdGroupAds(List<AdGroupAdadGroupAdsthrows RemoteException {
    return .getAdGroupAdDelegate().update(adGroupAds);
  }

  
Updates the AdGroupAd for the ExtendedAdGroup's AdGroup.

Parameters:
adGroupAd the AdGroupAd to update
Returns:
the updated AdGroupAd
Throws:
java.rmi.RemoteException for communication-related exceptions
  public AdGroupAd updateAdGroupAd(AdGroupAd adGroupAdthrows RemoteException {
    return .getAdGroupAdDelegate().update(adGroupAd);
  }

  
Removes the AdGroupAds from the ExtendedAdGroup's AdGroup.

Parameters:
adGroupAds the list of AdGroupAds to remove
Returns:
the updated list of AdGroupAds
Throws:
java.rmi.RemoteException for communication-related exceptions
  public List<AdGroupAdremoveAdGroupAds(List<AdGroupAdadGroupAdsthrows RemoteException {
    return .getAdGroupAdDelegate().remove(adGroupAds);
  }

  
Removes the AdGroupAd from the ExtendedAdGroup's AdGroup.

Parameters:
adGroupAd the AdGroupAd to remove
Returns:
the updated AdGroupAd
Throws:
java.rmi.RemoteException for communication-related exceptions
  public AdGroupAd removeAdGroupAd(AdGroupAd adGroupAdthrows RemoteException {
    return .getAdGroupAdDelegate().remove(adGroupAd);
  }

  
Inserts the Ads into the ExtendedAdGroup's AdGroup.

Note: this method creates the necessary AdGroupAd implicitly.

Parameters:
ads the list of Ads to insert
Returns:
the updated list of AdGroupAds
Throws:
java.rmi.RemoteException for communication-related exceptions
  public List<AdGroupAdinsertAds(List<Adadsthrows RemoteException {
        Lists.transform(adsnew Function<AdAdGroupAd>() {
          @Override
          public AdGroupAd apply(Ad ad) {
            AdGroupAd adGroupAd = new AdGroupAd();
            adGroupAd.setAdGroupId(.getId());
            adGroupAd.setAd(ad);
            return adGroupAd;
          }
        }));
  }

  
Inserts the Ad into the ExtendedAdGroup's AdGroup.

Note: this method creates the necessary AdGroupAd implicitly.

Parameters:
ad the Ad to insert
Returns:
the updated AdGroupAd
Throws:
java.rmi.RemoteException for communication-related exceptions
  public AdGroupAd insertAd(Ad adthrows RemoteException {
    AdGroupAd adGroupAd = new AdGroupAd();
    adGroupAd.setAdGroupId(.getId());
    adGroupAd.setAd(ad);
    return .getAdGroupAdDelegate().insert(adGroupAd);
  }

  
Gets the AdParams for the ExtendedAdGroup's AdGroup.

Returns:
all the AdParams for the ExtendedAdGroup's AdGroup
Throws:
java.rmi.RemoteException for communication-related exceptions
  public List<AdParamgetAdParams() throws RemoteException {
  }

  
Updates the AdParams for the ExtendedAdGroup's AdGroup.

Note: insertAdParams is not supported, use update for new AdParams. See com.google.api.ads.adwords.axis.v201502.cm.AdParamServiceInterface.

Parameters:
adParams the list of AdParams to update
Returns:
the updated list of AdParams
Throws:
java.rmi.RemoteException for communication-related exceptions
  public List<AdParamupdateAdParams(List<AdParamadParamsthrows RemoteException {
    return .getAdParamDelegate().update(adParams);
  }

  
Updates the AdParam for the ExtendedAdGroup's AdGroup.

Note: insertAdParams is not supported, use update for new AdParams. See com.google.api.ads.adwords.axis.v201502.cm.AdParamServiceInterface.

Parameters:
adParam the AdParam to update
Returns:
the updated AdParam
Throws:
java.rmi.RemoteException for communication-related exceptions
  public AdParam updateAdParam(AdParam adParamthrows RemoteException {
    return .getAdParamDelegate().update(adParam);
  }

  
Removes the AdParams from the ExtendedAdGroup's AdGroup.

Parameters:
adParams the list of AdParams to remove
Returns:
the updated list of AdParams
Throws:
java.rmi.RemoteException for communication-related exceptions
  public List<AdParamremoveAdParams(List<AdParamadParamsthrows RemoteException {
    return .getAdParamDelegate().remove(adParams);
  }

  
Removes the AdParam from the ExtendedAdGroup's AdGroup.

Parameters:
adParam the AdParam to remove
Returns:
the updated AdParam
Throws:
java.rmi.RemoteException for communication-related exceptions
  public AdParam removeAdParam(AdParam adParamthrows RemoteException {
    return .getAdParamDelegate().remove(adParam);
  }

  
Gets the AdGroupBidLandscapes for the ExtendedAdGroup's AdGroup.

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

  
Gets the CriterionBidLandscapes for the ExtendedAdGroup's AdGroup.

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

  
Gets the AdGroupFeeds for the ExtendedAdGroup's AdGroup.

Returns:
all the AdGroupFeeds for the ExtendedAdGroup's AdGroup
Throws:
java.rmi.RemoteException for communication-related exceptions
  }

  
Inserts a AdGroupLabel into the ExtendedAdGroup's AdGroup.

(Creates a Label to AdGroup link).

Parameters:
labelId the Label to insert
Returns:
the new AdGroupLabel
Throws:
java.rmi.RemoteException for communication-related exceptions
  public AdGroupLabel insertAdGroupLabel(Long labelIdthrows RemoteException {
    AdGroupLabel adGroupLabel = new AdGroupLabel(this.getAdGroup().getId(),  labelId);
  }

  
Removes a AdGroupLabel into the ExtendedAdGroup's AdGroup.

(Deletes a Label to AdGroup link).

Parameters:
labelId the Label to insert
Returns:
the new AdGroupLabel
Throws:
java.rmi.RemoteException for communication-related exceptions
  public AdGroupLabel removeAdGroupLabel(Long labelIdthrows RemoteException {
    AdGroupLabel adGroupLabel = new AdGroupLabel(this.getAdGroup().getId(),  labelId);
  }

  
Inserts a AdGroupAdLabel into the ExtendedAdGroupAd's AdGroupAd.

(Creates a Label to AdGroupAd link).

Parameters:
labelId the Label to insert
adId the AdId to insert
Returns:
the new AdGroupAdLabel
Throws:
java.rmi.RemoteException for communication-related exceptions
  public AdGroupAdLabel insertAdGroupAdLabel(Long labelIdlong adIdthrows RemoteException {
    AdGroupAdLabel adGroupAdLabel = new AdGroupAdLabel(this.getAdGroup().getId(),  adIdlabelId);
  }

  
Removes a AdGroupAdLabel into the ExtendedAdGroupAd's AdGroupAd.

(Deletes a Label to AdGroupAd link).

Parameters:
labelId the Label to insert
adId the AdId to insert
Returns:
the new AdGroupAdLabel
Throws:
java.rmi.RemoteException for communication-related exceptions
  public AdGroupAdLabel removeAdGroupAdLabel(Long labelIdlong adIdthrows RemoteException {
    AdGroupAdLabel adGroupAdLabel = new AdGroupAdLabel(this.getAdGroup().getId(), adIdlabelId);
  }

  
Inserts a AdGroupCriterionLabel into the ExtendedAdGroupCriterion's AdGroupCriterion.

(Creates a Label to AdGroupCriterion link).

Parameters:
labelId the Label to insert
criterionId the CriterionId to insert
Returns:
the new AdGroupCriterionLabel
Throws:
java.rmi.RemoteException for communication-related exceptions
  public AdGroupCriterionLabel insertAdGroupCriterionLabel(Long labelIdlong criterionId)
      throws RemoteException {
    AdGroupCriterionLabel adGroupCriterionLabel = new AdGroupCriterionLabel(
        this.getAdGroup().getId(),  criterionIdlabelId);
        adGroupCriterionLabel);
  }

  
Removes a AdGroupCriterionLabel into the ExtendedAdGroupCriterion's AdGroupCriterion.

(Deletes a Label to AdGroupCriterion link).

Parameters:
labelId the Label to insert
criterionId the CriterionId to insert
Returns:
the new AdGroupCriterionLabel
Throws:
java.rmi.RemoteException for communication-related exceptions
  public AdGroupCriterionLabel removeAdGroupCriterionLabel(Long labelIdlong criterionId)
      throws RemoteException {
    AdGroupCriterionLabel adGroupCriterionLabel = new AdGroupCriterionLabel(
        this.getAdGroup().getId(), criterionIdlabelId);
        adGroupCriterionLabel);
  }
New to GrepCode? Check out our FAQ X