public virtual void ReadFrom(XElement xE) { AdGroupId = null; CriterionUse = null; Criterion = null; Labels = null; ForwardCompatibilityMap = null; BaseCampaignId = null; BaseAdGroupId = null; AdGroupCriterionType = null; foreach (var xItem in xE.Elements()) { var localName = xItem.Name.LocalName; if (localName == "adGroupId") { AdGroupId = long.Parse(xItem.Value); } else if (localName == "criterionUse") { CriterionUse = CriterionUseExtensions.Parse(xItem.Value); } else if (localName == "criterion") { Criterion = InstanceCreator.CreateCriterion(xItem); Criterion.ReadFrom(xItem); } else if (localName == "labels") { if (Labels == null) { Labels = new List <Label>(); } var labelsItem = InstanceCreator.CreateLabel(xItem); labelsItem.ReadFrom(xItem); Labels.Add(labelsItem); } else if (localName == "forwardCompatibilityMap") { if (ForwardCompatibilityMap == null) { ForwardCompatibilityMap = new List <String_StringMapEntry>(); } var forwardCompatibilityMapItem = new String_StringMapEntry(); forwardCompatibilityMapItem.ReadFrom(xItem); ForwardCompatibilityMap.Add(forwardCompatibilityMapItem); } else if (localName == "baseCampaignId") { BaseCampaignId = long.Parse(xItem.Value); } else if (localName == "baseAdGroupId") { BaseAdGroupId = long.Parse(xItem.Value); } else if (localName == "AdGroupCriterion.Type") { AdGroupCriterionType = xItem.Value; } } }
public virtual void ReadFrom(XElement xE) { CampaignId = null; IsNegative = null; Criterion = null; BidModifier = null; CampaignCriterionStatus = null; BaseCampaignId = null; ForwardCompatibilityMap = null; CampaignCriterionType = null; foreach (var xItem in xE.Elements()) { var localName = xItem.Name.LocalName; if (localName == "campaignId") { CampaignId = long.Parse(xItem.Value); } else if (localName == "isNegative") { IsNegative = bool.Parse(xItem.Value); } else if (localName == "criterion") { Criterion = InstanceCreator.CreateCriterion(xItem); Criterion.ReadFrom(xItem); } else if (localName == "bidModifier") { BidModifier = double.Parse(xItem.Value); } else if (localName == "campaignCriterionStatus") { CampaignCriterionStatus = CampaignCriterionCampaignCriterionStatusExtensions.Parse(xItem.Value); } else if (localName == "baseCampaignId") { BaseCampaignId = long.Parse(xItem.Value); } else if (localName == "forwardCompatibilityMap") { if (ForwardCompatibilityMap == null) { ForwardCompatibilityMap = new List <String_StringMapEntry>(); } var forwardCompatibilityMapItem = new String_StringMapEntry(); forwardCompatibilityMapItem.ReadFrom(xItem); ForwardCompatibilityMap.Add(forwardCompatibilityMapItem); } else if (localName == "CampaignCriterion.Type") { CampaignCriterionType = xItem.Value; } } }
public override void ReadFrom(XElement xE) { base.ReadFrom(xE); DimensionValue = null; ParentDimensionValue = null; Country = null; Status = null; DisplayValue = null; foreach (var xItem in xE.Elements()) { var localName = xItem.Name.LocalName; if (localName == "dimensionValue") { DimensionValue = new ProductBiddingCategory(); DimensionValue.ReadFrom(xItem); } else if (localName == "parentDimensionValue") { ParentDimensionValue = new ProductBiddingCategory(); ParentDimensionValue.ReadFrom(xItem); } else if (localName == "country") { Country = xItem.Value; } else if (localName == "status") { Status = ShoppingBiddingDimensionStatusExtensions.Parse(xItem.Value); } else if (localName == "displayValue") { if (DisplayValue == null) { DisplayValue = new List <String_StringMapEntry>(); } var displayValueItem = new String_StringMapEntry(); displayValueItem.ReadFrom(xItem); DisplayValue.Add(displayValueItem); } } }
public virtual void ReadFrom(XElement xE) { AdGroupId = null; Ad = null; Status = null; ApprovalStatus = null; Trademarks = null; DisapprovalReasons = null; TrademarkDisapproved = null; Labels = null; BaseCampaignId = null; BaseAdGroupId = null; ForwardCompatibilityMap = null; foreach (var xItem in xE.Elements()) { var localName = xItem.Name.LocalName; if (localName == "adGroupId") { AdGroupId = long.Parse(xItem.Value); } else if (localName == "ad") { Ad = InstanceCreator.CreateAd(xItem); Ad.ReadFrom(xItem); } else if (localName == "status") { Status = AdGroupAdStatusExtensions.Parse(xItem.Value); } else if (localName == "approvalStatus") { ApprovalStatus = AdGroupAdApprovalStatusExtensions.Parse(xItem.Value); } else if (localName == "trademarks") { if (Trademarks == null) { Trademarks = new List <string>(); } Trademarks.Add(xItem.Value); } else if (localName == "disapprovalReasons") { if (DisapprovalReasons == null) { DisapprovalReasons = new List <string>(); } DisapprovalReasons.Add(xItem.Value); } else if (localName == "trademarkDisapproved") { TrademarkDisapproved = bool.Parse(xItem.Value); } else if (localName == "labels") { if (Labels == null) { Labels = new List <Label>(); } var labelsItem = InstanceCreator.CreateLabel(xItem); labelsItem.ReadFrom(xItem); Labels.Add(labelsItem); } else if (localName == "baseCampaignId") { BaseCampaignId = long.Parse(xItem.Value); } else if (localName == "baseAdGroupId") { BaseAdGroupId = long.Parse(xItem.Value); } else if (localName == "forwardCompatibilityMap") { if (ForwardCompatibilityMap == null) { ForwardCompatibilityMap = new List <String_StringMapEntry>(); } var forwardCompatibilityMapItem = new String_StringMapEntry(); forwardCompatibilityMapItem.ReadFrom(xItem); ForwardCompatibilityMap.Add(forwardCompatibilityMapItem); } } }
public virtual void ReadFrom(XElement xE) { Id = null; CampaignId = null; CampaignName = null; Name = null; Status = null; Settings = null; Labels = null; ForwardCompatibilityMap = null; BiddingStrategyConfiguration = null; ContentBidCriterionTypeGroup = null; BaseCampaignId = null; BaseAdGroupId = null; TrackingUrlTemplate = null; UrlCustomParameters = null; foreach (var xItem in xE.Elements()) { var localName = xItem.Name.LocalName; if (localName == "id") { Id = long.Parse(xItem.Value); } else if (localName == "campaignId") { CampaignId = long.Parse(xItem.Value); } else if (localName == "campaignName") { CampaignName = xItem.Value; } else if (localName == "name") { Name = xItem.Value; } else if (localName == "status") { Status = AdGroupStatusExtensions.Parse(xItem.Value); } else if (localName == "settings") { if (Settings == null) { Settings = new List <Setting>(); } var settingsItem = InstanceCreator.CreateSetting(xItem); settingsItem.ReadFrom(xItem); Settings.Add(settingsItem); } else if (localName == "labels") { if (Labels == null) { Labels = new List <Label>(); } var labelsItem = InstanceCreator.CreateLabel(xItem); labelsItem.ReadFrom(xItem); Labels.Add(labelsItem); } else if (localName == "forwardCompatibilityMap") { if (ForwardCompatibilityMap == null) { ForwardCompatibilityMap = new List <String_StringMapEntry>(); } var forwardCompatibilityMapItem = new String_StringMapEntry(); forwardCompatibilityMapItem.ReadFrom(xItem); ForwardCompatibilityMap.Add(forwardCompatibilityMapItem); } else if (localName == "biddingStrategyConfiguration") { BiddingStrategyConfiguration = new BiddingStrategyConfiguration(); BiddingStrategyConfiguration.ReadFrom(xItem); } else if (localName == "contentBidCriterionTypeGroup") { ContentBidCriterionTypeGroup = CriterionTypeGroupExtensions.Parse(xItem.Value); } else if (localName == "baseCampaignId") { BaseCampaignId = long.Parse(xItem.Value); } else if (localName == "baseAdGroupId") { BaseAdGroupId = long.Parse(xItem.Value); } else if (localName == "trackingUrlTemplate") { TrackingUrlTemplate = xItem.Value; } else if (localName == "urlCustomParameters") { UrlCustomParameters = new CustomParameters(); UrlCustomParameters.ReadFrom(xItem); } } }
public virtual void ReadFrom(XElement xE) { Id = null; Name = null; Status = null; ServingStatus = null; StartDate = null; EndDate = null; Budget = null; ConversionOptimizerEligibility = null; AdServingOptimizationStatus = null; FrequencyCap = null; Settings = null; AdvertisingChannelType = null; AdvertisingChannelSubType = null; NetworkSetting = null; Labels = null; BiddingStrategyConfiguration = null; CampaignTrialType = null; BaseCampaignId = null; ForwardCompatibilityMap = null; TrackingUrlTemplate = null; UrlCustomParameters = null; VanityPharma = null; SelectiveOptimization = null; foreach (var xItem in xE.Elements()) { var localName = xItem.Name.LocalName; if (localName == "id") { Id = long.Parse(xItem.Value); } else if (localName == "name") { Name = xItem.Value; } else if (localName == "status") { Status = CampaignStatusExtensions.Parse(xItem.Value); } else if (localName == "servingStatus") { ServingStatus = ServingStatusExtensions.Parse(xItem.Value); } else if (localName == "startDate") { StartDate = xItem.Value; } else if (localName == "endDate") { EndDate = xItem.Value; } else if (localName == "budget") { Budget = new Budget(); Budget.ReadFrom(xItem); } else if (localName == "conversionOptimizerEligibility") { ConversionOptimizerEligibility = new ConversionOptimizerEligibility(); ConversionOptimizerEligibility.ReadFrom(xItem); } else if (localName == "adServingOptimizationStatus") { AdServingOptimizationStatus = AdServingOptimizationStatusExtensions.Parse(xItem.Value); } else if (localName == "frequencyCap") { FrequencyCap = new FrequencyCap(); FrequencyCap.ReadFrom(xItem); } else if (localName == "settings") { if (Settings == null) { Settings = new List <Setting>(); } var settingsItem = InstanceCreator.CreateSetting(xItem); settingsItem.ReadFrom(xItem); Settings.Add(settingsItem); } else if (localName == "advertisingChannelType") { AdvertisingChannelType = AdvertisingChannelTypeExtensions.Parse(xItem.Value); } else if (localName == "advertisingChannelSubType") { AdvertisingChannelSubType = AdvertisingChannelSubTypeExtensions.Parse(xItem.Value); } else if (localName == "networkSetting") { NetworkSetting = new NetworkSetting(); NetworkSetting.ReadFrom(xItem); } else if (localName == "labels") { if (Labels == null) { Labels = new List <Label>(); } var labelsItem = InstanceCreator.CreateLabel(xItem); labelsItem.ReadFrom(xItem); Labels.Add(labelsItem); } else if (localName == "biddingStrategyConfiguration") { BiddingStrategyConfiguration = new BiddingStrategyConfiguration(); BiddingStrategyConfiguration.ReadFrom(xItem); } else if (localName == "campaignTrialType") { CampaignTrialType = CampaignTrialTypeExtensions.Parse(xItem.Value); } else if (localName == "baseCampaignId") { BaseCampaignId = long.Parse(xItem.Value); } else if (localName == "forwardCompatibilityMap") { if (ForwardCompatibilityMap == null) { ForwardCompatibilityMap = new List <String_StringMapEntry>(); } var forwardCompatibilityMapItem = new String_StringMapEntry(); forwardCompatibilityMapItem.ReadFrom(xItem); ForwardCompatibilityMap.Add(forwardCompatibilityMapItem); } else if (localName == "trackingUrlTemplate") { TrackingUrlTemplate = xItem.Value; } else if (localName == "urlCustomParameters") { UrlCustomParameters = new CustomParameters(); UrlCustomParameters.ReadFrom(xItem); } else if (localName == "vanityPharma") { VanityPharma = new VanityPharma(); VanityPharma.ReadFrom(xItem); } else if (localName == "selectiveOptimization") { SelectiveOptimization = new SelectiveOptimization(); SelectiveOptimization.ReadFrom(xItem); } } }