Examples of FeedMapping


Examples of com.google.api.ads.adwords.axis.v201306.cm.FeedMapping

    AttributeFieldMapping linkUrlFieldMapping = new AttributeFieldMapping();
    linkUrlFieldMapping.setFeedAttributeId(siteLinksFeed.linkUrlFeedAttributeId);
    linkUrlFieldMapping.setFieldId(PLACEHOLDER_FIELD_SITELINK_URL);

    // Create the FieldMapping and operation.
    FeedMapping feedMapping = new FeedMapping();
    feedMapping.setPlaceholderType(PLACEHOLDER_SITELINKS);
    feedMapping.setFeedId(siteLinksFeed.siteLinksFeedId);
    feedMapping.setAttributeFieldMappings(
        new AttributeFieldMapping[] {linkTextFieldMapping, linkUrlFieldMapping});
    FeedMappingOperation operation = new FeedMappingOperation();
    operation.setOperand(feedMapping);
    operation.setOperator(Operator.ADD);
View Full Code Here

Examples of com.google.api.ads.adwords.axis.v201306.cm.FeedMapping

    AttributeFieldMapping linkUrlFieldMapping = new AttributeFieldMapping();
    linkUrlFieldMapping.setFeedAttributeId(siteLinksData.linkUrlFeedAttributeId);
    linkUrlFieldMapping.setFieldId(PLACEHOLDER_FIELD_SITELINK_URL);

    // Create the FieldMapping and operation.
    FeedMapping feedMapping = new FeedMapping();
    feedMapping.setPlaceholderType(PLACEHOLDER_SITELINKS);
    feedMapping.setFeedId(siteLinksData.siteLinksFeedId);
    feedMapping.setAttributeFieldMappings(
        new AttributeFieldMapping[] {linkTextFieldMapping, linkUrlFieldMapping});
    FeedMappingOperation operation = new FeedMappingOperation();
    operation.setOperand(feedMapping);
    operation.setOperator(Operator.ADD);
View Full Code Here

Examples of com.google.api.ads.adwords.axis.v201309.cm.FeedMapping

    selector.setFields(
        new String[] {"FeedId", "FeedMappingId", "PlaceholderType", "AttributeFieldMappings"});
    selector.setPredicates(new Predicate[] {
        new Predicate("FeedId", PredicateOperator.EQUALS, new String[] {feedId.toString()})});

    FeedMapping feedMapping = mappingService.get(selector).getEntries()[0];

    // Remove the existing mapping (FeedMapping is immutable).
    feedMapping = mappingService.mutate(new FeedMappingOperation[] {
        new FeedMappingOperation(Operator.REMOVE, null, feedMapping)}).getValue(0);

    // Create line 1 and line 2 attribute field mappings.
    AttributeFieldMapping line1FieldMapping = new AttributeFieldMapping();
    line1FieldMapping.setFeedAttributeId(line1FeedAttribute.getId());
    line1FieldMapping.setFieldId(PLACEHOLDER_FIELD_LINE_1_TEXT);

    AttributeFieldMapping line2FieldMapping = new AttributeFieldMapping();
    line2FieldMapping.setFeedAttributeId(line2FeedAttribute.getId());
    line2FieldMapping.setFieldId(PLACEHOLDER_FIELD_LINE_2_TEXT);

    // Combine the existing field mappings with the new mappings.
    List<AttributeFieldMapping> allFieldMappings = new ArrayList<AttributeFieldMapping>();

    // Include existing mappings.
    allFieldMappings.addAll(Arrays.asList(feedMapping.getAttributeFieldMappings()));
    // Add the new mappings for line 1 and line 2.
    allFieldMappings.add(line1FieldMapping);
    allFieldMappings.add(line2FieldMapping);

    feedMapping.setAttributeFieldMappings(allFieldMappings.toArray(new AttributeFieldMapping[0]));

    FeedMappingReturnValue mappingReturnValue = mappingService.mutate(
        new FeedMappingOperation[] {new FeedMappingOperation(Operator.ADD, null, feedMapping)});

    FeedMapping mutatedMapping = mappingReturnValue.getValue()[0];

    System.out.printf("Updated field mappings for feedId %d and feedMappingId %d to:%n",
        mutatedMapping.getFeedId(), mutatedMapping.getFeedMappingId());
    for (AttributeFieldMapping fieldMapping : mutatedMapping.getAttributeFieldMappings()) {
      System.out.printf("  feedAttributeId %d --> fieldId %d%n", fieldMapping.getFeedAttributeId(),
          fieldMapping.getFieldId());
    }
  }
View Full Code Here

Examples of com.google.api.ads.adwords.axis.v201309.cm.FeedMapping

    line2FieldMapping.setFeedAttributeId(siteLinksData.line2FeedAttributeId);
    line2FieldMapping.setFieldId(PLACEHOLDER_FIELD_LINE_2_TEXT);


    // Create the FieldMapping and operation.
    FeedMapping feedMapping = new FeedMapping();
    feedMapping.setPlaceholderType(PLACEHOLDER_SITELINKS);
    feedMapping.setFeedId(siteLinksData.siteLinksFeedId);
    feedMapping.setAttributeFieldMappings(new AttributeFieldMapping[] {linkTextFieldMapping,
        linkUrlFieldMapping, line1FieldMapping, line2FieldMapping});
    FeedMappingOperation operation = new FeedMappingOperation();
    operation.setOperand(feedMapping);
    operation.setOperator(Operator.ADD);
View Full Code Here

Examples of com.google.api.ads.adwords.axis.v201402.cm.FeedMapping

    Selector selector = new SelectorBuilder()
        .fields("FeedId", "FeedMappingId", "PlaceholderType", "AttributeFieldMappings")
        .equalsId(feedId)
        .build();

    FeedMapping feedMapping = mappingService.get(selector).getEntries()[0];

    // Remove the existing mapping (FeedMapping is immutable).
    feedMapping = mappingService.mutate(new FeedMappingOperation[] {
        new FeedMappingOperation(Operator.REMOVE, null, feedMapping)}).getValue(0);

    // Create line 1 and line 2 attribute field mappings.
    AttributeFieldMapping line1FieldMapping = new AttributeFieldMapping();
    line1FieldMapping.setFeedAttributeId(line1FeedAttribute.getId());
    line1FieldMapping.setFieldId(PLACEHOLDER_FIELD_LINE_1_TEXT);

    AttributeFieldMapping line2FieldMapping = new AttributeFieldMapping();
    line2FieldMapping.setFeedAttributeId(line2FeedAttribute.getId());
    line2FieldMapping.setFieldId(PLACEHOLDER_FIELD_LINE_2_TEXT);

    // Combine the existing field mappings with the new mappings.
    List<AttributeFieldMapping> allFieldMappings = new ArrayList<AttributeFieldMapping>();

    // Include existing mappings.
    allFieldMappings.addAll(Arrays.asList(feedMapping.getAttributeFieldMappings()));
    // Add the new mappings for line 1 and line 2.
    allFieldMappings.add(line1FieldMapping);
    allFieldMappings.add(line2FieldMapping);

    feedMapping.setAttributeFieldMappings(allFieldMappings.toArray(new AttributeFieldMapping[0]));

    FeedMappingReturnValue mappingReturnValue = mappingService.mutate(
        new FeedMappingOperation[] {new FeedMappingOperation(Operator.ADD, null, feedMapping)});

    FeedMapping mutatedMapping = mappingReturnValue.getValue()[0];

    System.out.printf("Updated field mappings for feedId %d and feedMappingId %d to:%n",
        mutatedMapping.getFeedId(), mutatedMapping.getFeedMappingId());
    for (AttributeFieldMapping fieldMapping : mutatedMapping.getAttributeFieldMappings()) {
      System.out.printf("  feedAttributeId %d --> fieldId %d%n", fieldMapping.getFeedAttributeId(),
          fieldMapping.getFieldId());
    }
  }
View Full Code Here

Examples of com.google.api.ads.adwords.axis.v201402.cm.FeedMapping

    line2FieldMapping.setFeedAttributeId(siteLinksData.line2FeedAttributeId);
    line2FieldMapping.setFieldId(PLACEHOLDER_FIELD_LINE_2_TEXT);


    // Create the FieldMapping and operation.
    FeedMapping feedMapping = new FeedMapping();
    feedMapping.setPlaceholderType(PLACEHOLDER_SITELINKS);
    feedMapping.setFeedId(siteLinksData.siteLinksFeedId);
    feedMapping.setAttributeFieldMappings(new AttributeFieldMapping[] {linkTextFieldMapping,
        linkUrlFieldMapping, line1FieldMapping, line2FieldMapping});
    FeedMappingOperation operation = new FeedMappingOperation();
    operation.setOperand(feedMapping);
    operation.setOperator(Operator.ADD);
View Full Code Here

Examples of com.google.api.ads.adwords.axis.v201406.cm.FeedMapping

      CustomizersDataHolder dataHolder) throws Exception {
    // Get the FeedMappingService.
    FeedMappingServiceInterface feedMappingService = adWordsServices.get(session,
        FeedMappingServiceInterface.class);
   
    FeedMapping feedMapping = new FeedMapping();
    feedMapping.setFeedId(dataHolder.customizersFeedId);
    feedMapping.setPlaceholderType(PLACEHOLDER_AD_CUSTOMIZER);
   
    List<AttributeFieldMapping> attributeFieldMappings = Lists.newArrayList();
    attributeFieldMappings.add(
        new AttributeFieldMapping(dataHolder.nameFeedAttributeId, PLACEHOLDER_FIELD_STRING));
    attributeFieldMappings.add(
        new AttributeFieldMapping(dataHolder.priceFeedAttributeId, PLACEHOLDER_FIELD_PRICE));
    attributeFieldMappings.add(
        new AttributeFieldMapping(dataHolder.dateFeedAttributeId, PLACEHOLDER_FIELD_DATE));
   
    feedMapping.setAttributeFieldMappings(
        attributeFieldMappings.toArray(new AttributeFieldMapping[attributeFieldMappings.size()]));
   
    FeedMappingOperation feedMappingOperation = new FeedMappingOperation();
    feedMappingOperation.setOperand(feedMapping);
    feedMappingOperation.setOperator(Operator.ADD);
   
    FeedMapping addedFeedMapping =
        feedMappingService.mutate(new FeedMappingOperation[] {feedMappingOperation}).getValue(0);
   
    System.out.printf(
        "Feed mapping with ID %d and placeholder type %d was added " + "for feed with ID %d.%n",
        addedFeedMapping.getFeedMappingId(), addedFeedMapping.getPlaceholderType(),
        addedFeedMapping.getFeedId());
  }
View Full Code Here

Examples of com.google.api.ads.adwords.axis.v201406.cm.FeedMapping

    Selector selector = new SelectorBuilder()
        .fields("FeedId", "FeedMappingId", "PlaceholderType", "AttributeFieldMappings")
        .equalsId(feedId)
        .build();

    FeedMapping feedMapping = mappingService.get(selector).getEntries()[0];

    // Remove the existing mapping (FeedMapping is immutable).
    feedMapping = mappingService.mutate(new FeedMappingOperation[] {
        new FeedMappingOperation(Operator.REMOVE, null, feedMapping)}).getValue(0);

    // Create line 1 and line 2 attribute field mappings.
    AttributeFieldMapping line1FieldMapping = new AttributeFieldMapping();
    line1FieldMapping.setFeedAttributeId(line1FeedAttribute.getId());
    line1FieldMapping.setFieldId(PLACEHOLDER_FIELD_LINE_1_TEXT);

    AttributeFieldMapping line2FieldMapping = new AttributeFieldMapping();
    line2FieldMapping.setFeedAttributeId(line2FeedAttribute.getId());
    line2FieldMapping.setFieldId(PLACEHOLDER_FIELD_LINE_2_TEXT);

    // Combine the existing field mappings with the new mappings.
    List<AttributeFieldMapping> allFieldMappings = new ArrayList<AttributeFieldMapping>();

    // Include existing mappings.
    allFieldMappings.addAll(Arrays.asList(feedMapping.getAttributeFieldMappings()));
    // Add the new mappings for line 1 and line 2.
    allFieldMappings.add(line1FieldMapping);
    allFieldMappings.add(line2FieldMapping);

    feedMapping.setAttributeFieldMappings(allFieldMappings.toArray(new AttributeFieldMapping[0]));

    FeedMappingReturnValue mappingReturnValue = mappingService.mutate(
        new FeedMappingOperation[] {new FeedMappingOperation(Operator.ADD, null, feedMapping)});

    FeedMapping mutatedMapping = mappingReturnValue.getValue()[0];

    System.out.printf("Updated field mappings for feedId %d and feedMappingId %d to:%n",
        mutatedMapping.getFeedId(), mutatedMapping.getFeedMappingId());
    for (AttributeFieldMapping fieldMapping : mutatedMapping.getAttributeFieldMappings()) {
      System.out.printf("  feedAttributeId %d --> fieldId %d%n", fieldMapping.getFeedAttributeId(),
          fieldMapping.getFieldId());
    }
  }
View Full Code Here

Examples of com.google.api.ads.adwords.axis.v201406.cm.FeedMapping

    line2FieldMapping.setFeedAttributeId(siteLinksData.line2FeedAttributeId);
    line2FieldMapping.setFieldId(PLACEHOLDER_FIELD_LINE_2_TEXT);


    // Create the FieldMapping and operation.
    FeedMapping feedMapping = new FeedMapping();
    feedMapping.setPlaceholderType(PLACEHOLDER_SITELINKS);
    feedMapping.setFeedId(siteLinksData.siteLinksFeedId);
    feedMapping.setAttributeFieldMappings(new AttributeFieldMapping[] {linkTextFieldMapping,
        linkUrlFieldMapping, line1FieldMapping, line2FieldMapping});
    FeedMappingOperation operation = new FeedMappingOperation();
    operation.setOperand(feedMapping);
    operation.setOperator(Operator.ADD);
View Full Code Here

Examples of com.google.api.adwords.v201306.cm.FeedMapping

    AttributeFieldMapping linkUrlFieldMapping = new AttributeFieldMapping();
    linkUrlFieldMapping.setFeedAttributeId(siteLinksFeed.linkUrlFeedAttributeId);
    linkUrlFieldMapping.setFieldId(PLACEHOLDER_FIELD_SITELINK_URL);

    // Create the FieldMapping and operation.
    FeedMapping feedMapping = new FeedMapping();
    feedMapping.setPlaceholderType(PLACEHOLDER_SITELINKS);
    feedMapping.setFeedId(siteLinksFeed.siteLinksFeedId);
    feedMapping.setAttributeFieldMappings(
        new AttributeFieldMapping[] {linkTextFieldMapping, linkUrlFieldMapping});
    FeedMappingOperation operation = new FeedMappingOperation();
    operation.setOperand(feedMapping);
    operation.setOperator(Operator.ADD);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.