示例#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();
  }