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

            if (Id != null)
            {
                xItem = new XElement(XName.Get("id", "https://adwords.google.com/api/adwords/cm/v201609"));
                xItem.Add(Id.Value.ToString());
                xE.Add(xItem);
            }
            if (Url != null)
            {
                xItem = new XElement(XName.Get("url", "https://adwords.google.com/api/adwords/cm/v201609"));
                xItem.Add(Url);
                xE.Add(xItem);
            }
            if (DisplayUrl != null)
            {
                xItem = new XElement(XName.Get("displayUrl", "https://adwords.google.com/api/adwords/cm/v201609"));
                xItem.Add(DisplayUrl);
                xE.Add(xItem);
            }
            if (FinalUrls != null)
            {
                foreach (var finalUrlsItem in FinalUrls)
                {
                    xItem = new XElement(XName.Get("finalUrls", "https://adwords.google.com/api/adwords/cm/v201609"));
                    xItem.Add(finalUrlsItem);
                    xE.Add(xItem);
                }
            }
            if (FinalMobileUrls != null)
            {
                foreach (var finalMobileUrlsItem in FinalMobileUrls)
                {
                    xItem = new XElement(XName.Get("finalMobileUrls", "https://adwords.google.com/api/adwords/cm/v201609"));
                    xItem.Add(finalMobileUrlsItem);
                    xE.Add(xItem);
                }
            }
            if (FinalAppUrls != null)
            {
                foreach (var finalAppUrlsItem in FinalAppUrls)
                {
                    xItem = new XElement(XName.Get("finalAppUrls", "https://adwords.google.com/api/adwords/cm/v201609"));
                    finalAppUrlsItem.WriteTo(xItem);
                    xE.Add(xItem);
                }
            }
            if (TrackingUrlTemplate != null)
            {
                xItem = new XElement(XName.Get("trackingUrlTemplate", "https://adwords.google.com/api/adwords/cm/v201609"));
                xItem.Add(TrackingUrlTemplate);
                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);
            }
            if (Type != null)
            {
                xItem = new XElement(XName.Get("type", "https://adwords.google.com/api/adwords/cm/v201609"));
                xItem.Add(Type.Value.ToXmlValue());
                xE.Add(xItem);
            }
            if (DevicePreference != null)
            {
                xItem = new XElement(XName.Get("devicePreference", "https://adwords.google.com/api/adwords/cm/v201609"));
                xItem.Add(DevicePreference.Value.ToString());
                xE.Add(xItem);
            }
            if (AdType != null)
            {
                xItem = new XElement(XName.Get("Ad.Type", "https://adwords.google.com/api/adwords/cm/v201609"));
                xItem.Add(AdType);
                xE.Add(xItem);
            }
        }
Ejemplo n.º 2
0
        public virtual void WriteTo(XElement xE)
        {
            XElement xItem = null;

            if (Id != null)
            {
                xItem = new XElement(XName.Get("id", "https://adwords.google.com/api/adwords/cm/v201609"));
                xItem.Add(Id.Value.ToString());
                xE.Add(xItem);
            }
            if (Name != null)
            {
                xItem = new XElement(XName.Get("name", "https://adwords.google.com/api/adwords/cm/v201609"));
                xItem.Add(Name);
                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 (ServingStatus != null)
            {
                xItem = new XElement(XName.Get("servingStatus", "https://adwords.google.com/api/adwords/cm/v201609"));
                xItem.Add(ServingStatus.Value.ToXmlValue());
                xE.Add(xItem);
            }
            if (StartDate != null)
            {
                xItem = new XElement(XName.Get("startDate", "https://adwords.google.com/api/adwords/cm/v201609"));
                xItem.Add(StartDate);
                xE.Add(xItem);
            }
            if (EndDate != null)
            {
                xItem = new XElement(XName.Get("endDate", "https://adwords.google.com/api/adwords/cm/v201609"));
                xItem.Add(EndDate);
                xE.Add(xItem);
            }
            if (Budget != null)
            {
                xItem = new XElement(XName.Get("budget", "https://adwords.google.com/api/adwords/cm/v201609"));
                Budget.WriteTo(xItem);
                xE.Add(xItem);
            }
            if (ConversionOptimizerEligibility != null)
            {
                xItem = new XElement(XName.Get("conversionOptimizerEligibility", "https://adwords.google.com/api/adwords/cm/v201609"));
                ConversionOptimizerEligibility.WriteTo(xItem);
                xE.Add(xItem);
            }
            if (AdServingOptimizationStatus != null)
            {
                xItem = new XElement(XName.Get("adServingOptimizationStatus", "https://adwords.google.com/api/adwords/cm/v201609"));
                xItem.Add(AdServingOptimizationStatus.Value.ToXmlValue());
                xE.Add(xItem);
            }
            if (FrequencyCap != null)
            {
                xItem = new XElement(XName.Get("frequencyCap", "https://adwords.google.com/api/adwords/cm/v201609"));
                FrequencyCap.WriteTo(xItem);
                xE.Add(xItem);
            }
            if (Settings != null)
            {
                foreach (var settingsItem in Settings)
                {
                    xItem = new XElement(XName.Get("settings", "https://adwords.google.com/api/adwords/cm/v201609"));
                    settingsItem.WriteTo(xItem);
                    xE.Add(xItem);
                }
            }
            if (AdvertisingChannelType != null)
            {
                xItem = new XElement(XName.Get("advertisingChannelType", "https://adwords.google.com/api/adwords/cm/v201609"));
                xItem.Add(AdvertisingChannelType.Value.ToXmlValue());
                xE.Add(xItem);
            }
            if (AdvertisingChannelSubType != null)
            {
                xItem = new XElement(XName.Get("advertisingChannelSubType", "https://adwords.google.com/api/adwords/cm/v201609"));
                xItem.Add(AdvertisingChannelSubType.Value.ToXmlValue());
                xE.Add(xItem);
            }
            if (NetworkSetting != null)
            {
                xItem = new XElement(XName.Get("networkSetting", "https://adwords.google.com/api/adwords/cm/v201609"));
                NetworkSetting.WriteTo(xItem);
                xE.Add(xItem);
            }
            if (Labels != null)
            {
                foreach (var labelsItem in Labels)
                {
                    xItem = new XElement(XName.Get("labels", "https://adwords.google.com/api/adwords/cm/v201609"));
                    labelsItem.WriteTo(xItem);
                    xE.Add(xItem);
                }
            }
            if (BiddingStrategyConfiguration != null)
            {
                xItem = new XElement(XName.Get("biddingStrategyConfiguration", "https://adwords.google.com/api/adwords/cm/v201609"));
                BiddingStrategyConfiguration.WriteTo(xItem);
                xE.Add(xItem);
            }
            if (CampaignTrialType != null)
            {
                xItem = new XElement(XName.Get("campaignTrialType", "https://adwords.google.com/api/adwords/cm/v201609"));
                xItem.Add(CampaignTrialType.Value.ToXmlValue());
                xE.Add(xItem);
            }
            if (BaseCampaignId != null)
            {
                xItem = new XElement(XName.Get("baseCampaignId", "https://adwords.google.com/api/adwords/cm/v201609"));
                xItem.Add(BaseCampaignId.Value.ToString());
                xE.Add(xItem);
            }
            if (ForwardCompatibilityMap != null)
            {
                foreach (var forwardCompatibilityMapItem in ForwardCompatibilityMap)
                {
                    xItem = new XElement(XName.Get("forwardCompatibilityMap", "https://adwords.google.com/api/adwords/cm/v201609"));
                    forwardCompatibilityMapItem.WriteTo(xItem);
                    xE.Add(xItem);
                }
            }
            if (TrackingUrlTemplate != null)
            {
                xItem = new XElement(XName.Get("trackingUrlTemplate", "https://adwords.google.com/api/adwords/cm/v201609"));
                xItem.Add(TrackingUrlTemplate);
                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);
            }
            if (VanityPharma != null)
            {
                xItem = new XElement(XName.Get("vanityPharma", "https://adwords.google.com/api/adwords/cm/v201609"));
                VanityPharma.WriteTo(xItem);
                xE.Add(xItem);
            }
            if (SelectiveOptimization != null)
            {
                xItem = new XElement(XName.Get("selectiveOptimization", "https://adwords.google.com/api/adwords/cm/v201609"));
                SelectiveOptimization.WriteTo(xItem);
                xE.Add(xItem);
            }
        }