internal override void ProcessMappingsFromRowValues(RowValues values)
        {
            RemarketingList = new RemarketingList {
            };

            values.ConvertToEntity(this, Mappings);
        }
        /// <summary>
        /// Run the code example.
        /// </summary>
        /// <param name="service">An initialized Dfa Reporting service object
        /// </param>
        public override void Run(DfareportingService service)
        {
            long advertiserId         = long.Parse(_T("INSERT_ADVERTISER_ID_HERE"));
            long floodlightActivityId = long.Parse(_T("INSERT_FLOODLIGHT_ACTIVITY_ID_HERE"));
            long profileId            = long.Parse(_T("INSERT_USER_PROFILE_ID_HERE"));

            string remarketingListName = _T("INSERT_REMARKETING_LIST_NAME_HERE");

            // Create the remarketing list.
            RemarketingList remarketingList = new RemarketingList();

            remarketingList.Active       = true;
            remarketingList.AdvertiserId = advertiserId;
            remarketingList.LifeSpan     = 30L;
            remarketingList.Name         = remarketingListName;

            // Create a list population term.
            // This term matches all visitors with a U1 value exactly matching "test_value".
            ListPopulationTerm term = new ListPopulationTerm();

            term.Operator__   = "STRING_EQUALS";
            term.Type         = "CUSTOM_VARIABLE_TERM";
            term.Value        = "test_value";
            term.VariableName = "U1";

            // Add the term to a list population clause.
            ListPopulationClause clause = new ListPopulationClause();

            clause.Terms = new List <ListPopulationTerm> {
                term
            };

            // Add the clause to a list population rule.
            // This rule will target all visitors who trigger the specified floodlight activity and
            // satisfy the custom rule defined in the list population term.
            ListPopulationRule rule = new ListPopulationRule();

            rule.FloodlightActivityId  = floodlightActivityId;
            rule.ListPopulationClauses = new List <ListPopulationClause> {
                clause
            };
            remarketingList.ListPopulationRule = rule;

            // Insert the remarketing list.
            RemarketingList result =
                service.RemarketingLists.Insert(remarketingList, profileId).Execute();

            // Display the new remarketing list ID.
            Console.WriteLine("Remarketing list with ID {0} was created.", result.Id);
        }
        /// <summary>
        /// Inserts a new remarketing list.
        /// Documentation https://developers.google.com/dfareporting/v2.6/reference/remarketingLists/insert
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated dfareporting service.</param>
        /// <param name="profileId">User profile ID associated with this request.</param>
        /// <param name="body">A valid dfareporting v2.6 body.</param>
        /// <returns>RemarketingListResponse</returns>
        public static RemarketingList Insert(dfareportingService service, string profileId, RemarketingList body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (profileId == null)
                {
                    throw new ArgumentNullException(profileId);
                }

                // Make the request.
                return(service.RemarketingLists.Insert(body, profileId).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request RemarketingLists.Insert failed.", ex);
            }
        }
        internal override void ProcessMappingsFromRowValues(RowValues values)
        {
            RemarketingList = new RemarketingList { };

            values.ConvertToEntity(this, Mappings);
        }