/// <summary>
        /// Run the code example.
        /// </summary>
        /// <param name="user">The DFP user object running the code example.</param>
        public override void Run(DfpUser user)
        {
            // Get the LineItemCreativeAssociationService.
              LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService)
              user.GetService(DfpService.v201411.LineItemCreativeAssociationService);

              // Set the line item to get LICAs by.
              long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE"));

              // Create a statement to only select LICAs for the given lineItem ID.
              StatementBuilder statementBuilder = new StatementBuilder()
              .Where("lineItemId = :lineItemId")
              .OrderBy("lineItemId ASC, creativeId ASC")
              .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT)
              .AddValue("lineItemId", lineItemId);

              // Set default for page.
              LineItemCreativeAssociationPage page = new LineItemCreativeAssociationPage();

              try {
            do {
              // Get LICAs by statement.
              page = licaService.getLineItemCreativeAssociationsByStatement(
              statementBuilder.ToStatement());

              if (page.results != null && page.results.Length > 0) {
            int i = page.startIndex;
            foreach (LineItemCreativeAssociation lica in page.results) {
              Console.WriteLine("{0}) LICA with line item ID = '{1}', creative ID ='{2}' and " +
                  "status ='{3}' was found.", i, lica.lineItemId, lica.creativeId,
                  lica.status);
              i++;
            }
              }
              statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT);
            } while(statementBuilder.GetOffset() < page.totalResultSetSize);
            Console.WriteLine("Number of results found: {0}", page.totalResultSetSize);
              } catch (Exception e) {
            Console.WriteLine("Failed to get LICAs. Exception says \"{0}\"", e.Message);
              }
        }
        /// <summary>
        /// Run the code example.
        /// </summary>
        /// <param name="user">The DFP user object running the code example.</param>
        public override void Run(DfpUser user)
        {
            // Get the LineItemCreativeAssociationService.
              LineItemCreativeAssociationService licaService = (LineItemCreativeAssociationService)
              user.GetService(DfpService.v201411.LineItemCreativeAssociationService);

              // Set the line item to get LICAs by.
              long lineItemId = long.Parse(_T("INSERT_LINE_ITEM_ID_HERE"));

              // Create a statement to page through active LICAs.
              StatementBuilder statementBuilder = new StatementBuilder()
              .Where("lineItemId = :lineItemId")
              .OrderBy("lineItemId ASC, creativeId ASC")
              .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT)
              .AddValue("lineItemId", lineItemId);

              // Set default for page.
              LineItemCreativeAssociationPage page = new LineItemCreativeAssociationPage();
              List<string> creativeIds = new List<string>();

              try {
            do {
              // Get LICAs by statement.
              page = licaService.getLineItemCreativeAssociationsByStatement(
              statementBuilder.ToStatement());

              if (page.results != null && page.results.Length > 0) {
            int i = page.startIndex;
            foreach (LineItemCreativeAssociation lica in page.results) {
              Console.WriteLine("{0}) LICA with line item ID = '{1}', creative ID ='{2}' and " +
                  "status ='{3}' will be deactivated.", i, lica.lineItemId, lica.creativeId,
                  lica.status);
              i++;
              creativeIds.Add(lica.creativeId.ToString());
            }
              }

              statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT);
            } while (statementBuilder.GetOffset() < page.totalResultSetSize);

            Console.WriteLine("Number of LICAs to be deactivated: {0}", creativeIds.Count);

            if (creativeIds.Count > 0) {
              // Modify statement for action.
              statementBuilder.RemoveLimitAndOffset();

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

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

              // Display results.
              if (result != null && result.numChanges > 0) {
            Console.WriteLine("Number of LICAs deactivated: {0}", result.numChanges);
              } else {
            Console.WriteLine("No LICAs were deactivated.");
              }
            }
              } catch (Exception e) {
            Console.WriteLine("Failed to deactivate LICAs. Exception says \"{0}\"", e.Message);
              }
        }