Package com.google.api.ads.dfp.axis.v201308

Examples of com.google.api.ads.dfp.axis.v201308.CustomFieldOption


    adUnitTargeting.setIncludeDescendants(true);

    inventoryTargeting.setTargetedAdUnits(new AdUnitTargeting[] {adUnitTargeting});

    // Create targeting.
    Targeting targeting = new Targeting();
    targeting.setInventoryTargeting(inventoryTargeting);

    // Create the expression:
    //
    // CUSTOM_TARGETING_KEY_ID_1 == CUSTOM_TARGETING_VALUE_ID_1
    CustomCriteria customCriteria1 = new CustomCriteria();
    customCriteria1.setKeyId(customTargetingKeyId1);
    customCriteria1.setOperator(CustomCriteriaComparisonOperator.IS);
    customCriteria1.setValueIds(new long[] {customTargetingValueId1});

    // Create the expression:
    //
    // CUSTOM_TARGETING_KEY_ID_2 !=
    //     (CUSTOM_TARGETING_VALUE_ID_2 OR CUSTOM_TARGETING_VALUE_ID_3)
    CustomCriteria customCriteria2 = new CustomCriteria();
    customCriteria2.setKeyId(customTargetingKeyId2);
    customCriteria2.setOperator(CustomCriteriaComparisonOperator.IS_NOT);
    customCriteria2.setValueIds(new long[] {customTargetingValueId2, customTargetingValueId3});

    // Create the expression:
    //
    // CUSTOM_TARGETING_KEY_ID_3 = CUSTOM_TARGETING_VALUE_ID_4
    CustomCriteria customCriteria3 = new CustomCriteria();
    customCriteria3.setKeyId(customTargetingKeyId3);
    customCriteria3.setOperator(CustomCriteriaComparisonOperator.IS);
    customCriteria3.setValueIds(new long[] {customTargetingValueId4});

    // Create the custom criteria set that will resemble:
    //
    // (CUSTOM_TARGETING_KEY_ID_1 == CUSTOM_TARGETING_VALUE_ID_1 AND
    // (CUSTOM_TARGETING_KEY_ID_2 !=
    //     (CUSTOM_TARGETING_VALUE_ID_2 OR CUSTOM_TARGETING_VALUE_ID_3))
    // OR
    // (CUSTOM_TARGETING_KEY_ID_3 = CUSTOM_TARGETING_VALUE_ID_4)
    CustomCriteriaSet topCustomCriteriaSet = new CustomCriteriaSet();
    topCustomCriteriaSet.setLogicalOperator(CustomCriteriaSetLogicalOperator.OR);

    // Create the sub expression:
    //
    // (CUSTOM_TARGETING_KEY_ID_1 == CUSTOM_TARGETING_VALUE_ID_1 AND
    // (CUSTOM_TARGETING_KEY_ID_2 !=
    //     (CUSTOM_TARGETING_VALUE_ID_2 OR CUSTOM_TARGETING_VALUE_ID_3))
    CustomCriteriaSet subCustomCriteriaSet = new CustomCriteriaSet();
    subCustomCriteriaSet.setLogicalOperator(CustomCriteriaSetLogicalOperator.AND);
    subCustomCriteriaSet.setChildren(
        new CustomCriteriaNode[] {customCriteria1, customCriteria2});

    // Combine the expression
    // (CUSTOM_TARGETING_KEY_ID_3 = CUSTOM_TARGETING_VALUE_ID_4) with
    // subCustomCriteriaSet.
    topCustomCriteriaSet.setChildren(
        new CustomCriteriaNode[] {subCustomCriteriaSet, customCriteria3});

    // Set the custom targeting.
    targeting.setCustomTargeting(topCustomCriteriaSet);

    // Create a line item.
    LineItem lineItem = new LineItem();
    lineItem.setName("Line item #" + new Random().nextInt(Integer.MAX_VALUE));
    lineItem.setOrderId(orderId);
View Full Code Here


      // Create action.
      DeactivateLineItemCreativeAssociations action = new DeactivateLineItemCreativeAssociations();

      // Perform action.
      UpdateResult result = licaService.performLineItemCreativeAssociationAction(
          action, statementBuilder.toStatement());

      if (result != null && result.getNumChanges() > 0) {
        System.out.printf("Number of LICAs deactivated: %d\n", result.getNumChanges());
      } else {
        System.out.println("No LICAs were deactivated.");
      }
    }
  }
View Full Code Here

      // Create action.
      com.google.api.ads.dfp.axis.v201308.ApproveOrders action =
          new com.google.api.ads.dfp.axis.v201308.ApproveOrders();

      // Perform action.
      UpdateResult result =
          orderService.performOrderAction(action, statementBuilder.toStatement());

      if (result != null && result.getNumChanges() > 0) {
        System.out.printf("Number of orders approved: %d\n", result.getNumChanges());
      } else {
        System.out.println("No orders were approved.");
      }
    }
  }
View Full Code Here

    // Set the created drop-down custom field.
    dropDownCustomField = customFields[1];

    // Create approved custom field option.
    CustomFieldOption approvedCustomFieldOption = new CustomFieldOption();
    approvedCustomFieldOption.setDisplayName("APPROVED");
    approvedCustomFieldOption.setCustomFieldId(dropDownCustomField.getId());

    // Create unapproved custom field option.
    CustomFieldOption unapprovedCustomFieldOption = new CustomFieldOption();
    unapprovedCustomFieldOption.setDisplayName("UNAPPROVED");
    unapprovedCustomFieldOption.setCustomFieldId(dropDownCustomField.getId());

    // Create the custom field options on the server.
    CustomFieldOption[] customFieldOptions = customFieldService.createCustomFieldOptions(
        new CustomFieldOption[] {approvedCustomFieldOption, unapprovedCustomFieldOption});
View Full Code Here

      // Set the ID of the drop-down custom field to create options for.
      Long customFieldId = Long.parseLong("INSERT_DROP_DOWN_CUSTOM_FIELD_ID_HERE");

      // Create custom field options.
      CustomFieldOption customFieldOption1 = new CustomFieldOption();
      customFieldOption1.setDisplayName("Approved");
      customFieldOption1.setCustomFieldId(customFieldId);

      CustomFieldOption customFieldOption2 = new CustomFieldOption();
      customFieldOption2.setDisplayName("Unapproved");
      customFieldOption2.setCustomFieldId(customFieldId);

      // Add custom field options.
      CustomFieldOption[] customFieldOptions =
          customFieldService.createCustomFieldOptions(new CustomFieldOption[] {customFieldOption1,
              customFieldOption2});
View Full Code Here

      // Set the ID of the drop-down custom field to create options for.
      Long customFieldId = Long.parseLong("INSERT_DROP_DOWN_CUSTOM_FIELD_ID_HERE");

      // Create custom field options.
      CustomFieldOption customFieldOption1 = new CustomFieldOption();
      customFieldOption1.setDisplayName("Approved");
      customFieldOption1.setCustomFieldId(customFieldId);

      CustomFieldOption customFieldOption2 = new CustomFieldOption();
      customFieldOption2.setDisplayName("Unapproved");
      customFieldOption2.setCustomFieldId(customFieldId);

      // Add custom field options.
      CustomFieldOption[] customFieldOptions =
          customFieldService.createCustomFieldOptions(new CustomFieldOption[] {customFieldOption1,
              customFieldOption2});
View Full Code Here

      // Set the ID of the drop-down custom field to create options for.
      Long customFieldId = Long.parseLong("INSERT_DROP_DOWN_CUSTOM_FIELD_ID_HERE");

      // Create custom field options.
      CustomFieldOption customFieldOption1 = new CustomFieldOption();
      customFieldOption1.setDisplayName("Approved");
      customFieldOption1.setCustomFieldId(customFieldId);

      CustomFieldOption customFieldOption2 = new CustomFieldOption();
      customFieldOption2.setDisplayName("Unapproved");
      customFieldOption2.setCustomFieldId(customFieldId);

      // Add custom field options.
      CustomFieldOption[] customFieldOptions =
          customFieldService.createCustomFieldOptions(new CustomFieldOption[] {customFieldOption1,
              customFieldOption2});
View Full Code Here

      // Set the ID of the drop-down custom field to create options for.
      Long customFieldId = Long.parseLong("INSERT_DROP_DOWN_CUSTOM_FIELD_ID_HERE");

      // Create custom field options.
      CustomFieldOption customFieldOption1 = new CustomFieldOption();
      customFieldOption1.setDisplayName("Approved");
      customFieldOption1.setCustomFieldId(customFieldId);

      CustomFieldOption customFieldOption2 = new CustomFieldOption();
      customFieldOption2.setDisplayName("Unapproved");
      customFieldOption2.setCustomFieldId(customFieldId);

      // Add custom field options.
      CustomFieldOption[] customFieldOptions =
          customFieldService.createCustomFieldOptions(new CustomFieldOption[] {customFieldOption1,
              customFieldOption2});
View Full Code Here

      // Set the ID of the drop-down custom field to create options for.
      Long customFieldId = Long.parseLong("INSERT_DROP_DOWN_CUSTOM_FIELD_ID_HERE");

      // Create custom field options.
      CustomFieldOption customFieldOption1 = new CustomFieldOption();
      customFieldOption1.setDisplayName("Approved");
      customFieldOption1.setCustomFieldId(customFieldId);

      CustomFieldOption customFieldOption2 = new CustomFieldOption();
      customFieldOption2.setDisplayName("Unapproved");
      customFieldOption2.setCustomFieldId(customFieldId);

      // Add custom field options.
      CustomFieldOption[] customFieldOptions =
          customFieldService.createCustomFieldOptions(new CustomFieldOption[] {customFieldOption1,
              customFieldOption2});
View Full Code Here

      // Set the ID of the drop-down custom field to create options for.
      Long customFieldId = Long.parseLong("INSERT_DROP_DOWN_CUSTOM_FIELD_ID_HERE");

      // Create custom field options.
      CustomFieldOption customFieldOption1 = new CustomFieldOption();
      customFieldOption1.setDisplayName("Approved");
      customFieldOption1.setCustomFieldId(customFieldId);

      CustomFieldOption customFieldOption2 = new CustomFieldOption();
      customFieldOption2.setDisplayName("Unapproved");
      customFieldOption2.setCustomFieldId(customFieldId);

      // Add custom field options.
      CustomFieldOption[] customFieldOptions =
          customFieldService.createCustomFieldOptions(new CustomFieldOption[] {customFieldOption1,
              customFieldOption2});
View Full Code Here

TOP

Related Classes of com.google.api.ads.dfp.axis.v201308.CustomFieldOption

Copyright © 2018 www.massapicom. 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.