Google.Api.Ads.AdWords.Util.Shopping.v201702.ProductPartitionNode.AsBiddableUnit()

Here are the examples of the csharp api class Google.Api.Ads.AdWords.Util.Shopping.v201702.ProductPartitionNode.AsBiddableUnit() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Example 7

1. Example

Project: googleads-dotnet-lib
Source File: ProductPartitionNode.cs
public static ProductPartitionNode CopyProperties(ProductPartitionNode fromNode,
        ProductPartitionNode toNode) {
      switch (fromNode.nodeState.NodeType) {
        case NodeType.BIDDABLE_UNIT:
          toNode = toNode.AsBiddableUnit();
          if (fromNode.CpcBidSpecified) {
            toNode.CpcBid = fromNode.CpcBid;
          }
          break;

        case NodeType.EXCLUDED_UNIT:
          toNode = toNode.AsExcludedUnit();
          break;

        case NodeType.SUBDIVISION:
          toNode = toNode.AsSubdivision();
          break;

        default:
          throw new InvalidOperationException(
              "Unrecognized node state: " + fromNode.nodeState.NodeType);
      }

      toNode.ProductPartitionId = fromNode.ProductPartitionId;
      return toNode;
    }