Пример #1
0
  static ApplyProductPartitionActionsResponse applyPartitionActions(
      ArrayOfAdGroupCriterionAction actions) throws RemoteException, Exception {
    ApplyProductPartitionActionsRequest request = new ApplyProductPartitionActionsRequest();
    request.setCriterionActions(actions);

    return CampaignService.getService().applyProductPartitionActions(request);
  }
Пример #2
0
  static void deleteCampaigns(long accountId, ArrayOflong campaignIds)
      throws RemoteException, Exception {
    DeleteCampaignsRequest request = new DeleteCampaignsRequest();
    request.setAccountId(accountId);
    request.setCampaignIds(campaignIds);

    CampaignService.getService().deleteCampaigns(request);
  }
Пример #3
0
  static ArrayOfAdGroupCriterion getAdGroupCriterionsByIds(
      long accountId, long adGroupId, ArrayOflong adGroupCriterionIds, CriterionType criterionType)
      throws RemoteException, Exception {
    GetAdGroupCriterionsByIdsRequest request = new GetAdGroupCriterionsByIdsRequest();
    request.setAccountId(accountId);
    request.setAdGroupId(adGroupId);
    request.setAdGroupCriterionIds(adGroupCriterionIds);

    return CampaignService.getService().getAdGroupCriterionsByIds(request).getAdGroupCriterions();
  }
Пример #4
0
  static AddAdsResponse addAds(long adGroupId, ArrayOfAd ads) throws RemoteException, Exception {
    AddAdsRequest request = new AddAdsRequest();

    // Set the request information.

    request.setAdGroupId(adGroupId);
    request.setAds(ads);

    return CampaignService.getService().addAds(request);
  }
Пример #5
0
  static AddCampaignsResponse addCampaigns(long accountId, ArrayOfCampaign campaigns)
      throws RemoteException, Exception {
    AddCampaignsRequest request = new AddCampaignsRequest();

    // Set the request information.

    request.setAccountId(accountId);
    request.setCampaigns(campaigns);

    return CampaignService.getService().addCampaigns(request);
  }
Пример #6
0
    public static AdGroupEstimatedBid getAdGroupEstimatedBidByKeywords(Currency currency, ArrayOfKeywordAndMatchType keywordAndMatchTypes, 
    		java.lang.String language, ArrayOfstring publisherCountries, TargetAdPosition targetPositionForAds) throws RemoteException, Exception
    {
        GetEstimatedBidByKeywordsRequest request = new GetEstimatedBidByKeywordsRequest();
        
        // Set the Currency, Keywords, Language, PublisherCountries, and TargetPositionForAds
        // for the estimated bid by keywords request.
        
        request.setCurrency(currency);
        request.setGetBidsAtLevel(2); // Set GetBidsAtLevel to 2 to get one AdGroupEstimatedBid.
        request.setKeywords(keywordAndMatchTypes);
        request.setLanguage(language);
        request.setPublisherCountries(publisherCountries);
        request.setTargetPositionForAds(targetPositionForAds);

        return AdIntelligenceService.getService().getEstimatedBidByKeywords(request).getAdGroupEstimatedBid();
    }
Пример #7
0
  static AddCampaignCriterionsResponse addCampaignCriterion(final long CAMPAIGN_ID)
      throws RemoteException, Exception {
    AddCampaignCriterionsRequest request =
        new AddCampaignCriterionsRequest() {
          {
            criterionType =
                new ArrayList<CampaignCriterionType>() {
                  {
                    add(CampaignCriterionType.PRODUCT_SCOPE);
                  }
                };
            campaignCriterions =
                new ArrayOfCampaignCriterion() {
                  {
                    campaignCriterions =
                        new ArrayList<CampaignCriterion>() {
                          {
                            add(
                                new CampaignCriterion() {
                                  {
                                    campaignId = CAMPAIGN_ID;
                                    bidAdjustment = null; // Reserved for future use
                                    criterion =
                                        new ProductScope() {
                                          {
                                            conditions =
                                                new ArrayOfProductCondition() {
                                                  {
                                                    productConditions =
                                                        new ArrayList<ProductCondition>() {
                                                          {
                                                            add(
                                                                new ProductCondition() {
                                                                  {
                                                                    operand = "Condition";
                                                                    attribute = "New";
                                                                  }
                                                                });
                                                            add(
                                                                new ProductCondition() {
                                                                  {
                                                                    operand = "Brand";
                                                                    attribute = "Contoso";
                                                                  }
                                                                });
                                                          }
                                                        };
                                                  }
                                                };
                                          }
                                        };
                                  }
                                });
                          }
                        };
                  }
                };
          }
        };

    return CampaignService.getService().addCampaignCriterions(request);
  }
Пример #8
0
  static ArrayOfBMCStore getBMCStoresByCustomerId() throws RemoteException, Exception {
    GetBMCStoresByCustomerIdRequest request = new GetBMCStoresByCustomerIdRequest();

    return CampaignService.getService().getBMCStoresByCustomerId(request).getBMCStores();
  }