Exemplo n.º 1
0
        public virtual void WriteTo(XElement xE)
        {
            XElement xItem = null;

            if (FeedId != null)
            {
                xItem = new XElement(XName.Get("feedId", "https://adwords.google.com/api/adwords/cm/v201609"));
                xItem.Add(FeedId.Value.ToString());
                xE.Add(xItem);
            }
            if (FeedItemId != null)
            {
                xItem = new XElement(XName.Get("feedItemId", "https://adwords.google.com/api/adwords/cm/v201609"));
                xItem.Add(FeedItemId.Value.ToString());
                xE.Add(xItem);
            }
            if (Status != null)
            {
                xItem = new XElement(XName.Get("status", "https://adwords.google.com/api/adwords/cm/v201609"));
                xItem.Add(Status.Value.ToXmlValue());
                xE.Add(xItem);
            }
            if (StartTime != null)
            {
                xItem = new XElement(XName.Get("startTime", "https://adwords.google.com/api/adwords/cm/v201609"));
                xItem.Add(StartTime);
                xE.Add(xItem);
            }
            if (EndTime != null)
            {
                xItem = new XElement(XName.Get("endTime", "https://adwords.google.com/api/adwords/cm/v201609"));
                xItem.Add(EndTime);
                xE.Add(xItem);
            }
            if (AttributeValues != null)
            {
                foreach (var attributeValuesItem in AttributeValues)
                {
                    xItem = new XElement(XName.Get("attributeValues", "https://adwords.google.com/api/adwords/cm/v201609"));
                    attributeValuesItem.WriteTo(xItem);
                    xE.Add(xItem);
                }
            }
            if (PolicyData != null)
            {
                foreach (var policyDataItem in PolicyData)
                {
                    xItem = new XElement(XName.Get("policyData", "https://adwords.google.com/api/adwords/cm/v201609"));
                    policyDataItem.WriteTo(xItem);
                    xE.Add(xItem);
                }
            }
            if (DevicePreference != null)
            {
                xItem = new XElement(XName.Get("devicePreference", "https://adwords.google.com/api/adwords/cm/v201609"));
                DevicePreference.WriteTo(xItem);
                xE.Add(xItem);
            }
            if (Scheduling != null)
            {
                xItem = new XElement(XName.Get("scheduling", "https://adwords.google.com/api/adwords/cm/v201609"));
                Scheduling.WriteTo(xItem);
                xE.Add(xItem);
            }
            if (CampaignTargeting != null)
            {
                xItem = new XElement(XName.Get("campaignTargeting", "https://adwords.google.com/api/adwords/cm/v201609"));
                CampaignTargeting.WriteTo(xItem);
                xE.Add(xItem);
            }
            if (AdGroupTargeting != null)
            {
                xItem = new XElement(XName.Get("adGroupTargeting", "https://adwords.google.com/api/adwords/cm/v201609"));
                AdGroupTargeting.WriteTo(xItem);
                xE.Add(xItem);
            }
            if (KeywordTargeting != null)
            {
                xItem = new XElement(XName.Get("keywordTargeting", "https://adwords.google.com/api/adwords/cm/v201609"));
                KeywordTargeting.WriteTo(xItem);
                xE.Add(xItem);
            }
            if (GeoTargeting != null)
            {
                xItem = new XElement(XName.Get("geoTargeting", "https://adwords.google.com/api/adwords/cm/v201609"));
                GeoTargeting.WriteTo(xItem);
                xE.Add(xItem);
            }
            if (GeoTargetingRestriction != null)
            {
                xItem = new XElement(XName.Get("geoTargetingRestriction", "https://adwords.google.com/api/adwords/cm/v201609"));
                GeoTargetingRestriction.WriteTo(xItem);
                xE.Add(xItem);
            }
            if (UrlCustomParameters != null)
            {
                xItem = new XElement(XName.Get("urlCustomParameters", "https://adwords.google.com/api/adwords/cm/v201609"));
                UrlCustomParameters.WriteTo(xItem);
                xE.Add(xItem);
            }
        }