/// <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.v201308.LineItemCreativeAssociationService);

              // Sets defaults for page and Statement.
              LineItemCreativeAssociationPage page = new LineItemCreativeAssociationPage();
              Statement statement = new Statement();
              int offset = 0;

              try {
            do {
              // Create a Statement to get all LICAs.
              statement.query = string.Format("LIMIT 500 OFFSET {0}", offset);

              // Get LICAs by Statement.
              page = licaService.getLineItemCreativeAssociationsByStatement(statement);

              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++;
            }
              }

              offset += 500;
            } while (page.results != null && page.results.Length == 500);

            Console.WriteLine("Number of results found: {0}", page.totalResultSetSize);
              } catch (Exception ex) {
            Console.WriteLine("Failed to get all LICAs. Exception says \"{0}\"", ex.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.v201308.LineItemCreativeAssociationService);

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

              String statementText = "WHERE lineItemId = :lineItemId and status = :status LIMIT 500";
              Statement statement = new StatementBuilder("").AddValue("lineItemId", lineItemId).
              AddValue("status", LineItemCreativeAssociationStatus.ACTIVE.ToString()).ToStatement();

              // Sets defaults for page and offset.
              LineItemCreativeAssociationPage page = new LineItemCreativeAssociationPage();
              int offset = 0;
              List<string> creativeIds = new List<string>();

              try {
            do {
              // Create a Statement to page through active LICAs.
              statement.query = string.Format("{0} OFFSET {1}", statementText, offset);

              // Get LICAs by Statement.
              page = licaService.getLineItemCreativeAssociationsByStatement(statement);

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

              offset += 500;
            } while (offset < page.totalResultSetSize);

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

            if (creativeIds.Count > 0) {
              // Create action Statement.
              statement = new StatementBuilder(
              string.Format("WHERE lineItemId = :lineItemId and creativeId IN ({0})",
                  string.Join(",", creativeIds.ToArray()))).
              AddValue("lineItemId", lineItemId).ToStatement();

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

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

              // 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 ex) {
            Console.WriteLine("Failed to deactivate LICAs. Exception says \"{0}\"", ex.Message);
              }
        }