예제 #1
0
 public override void ReadFrom(XElement xE)
 {
     base.ReadFrom(xE);
     Value = null;
     PartialFailureErrors = null;
     foreach (var xItem in xE.Elements())
     {
         var localName = xItem.Name.LocalName;
         if (localName == "value")
         {
             if (Value == null)
             {
                 Value = new List <Budget>();
             }
             var valueItem = new Budget();
             valueItem.ReadFrom(xItem);
             Value.Add(valueItem);
         }
         else if (localName == "partialFailureErrors")
         {
             if (PartialFailureErrors == null)
             {
                 PartialFailureErrors = new List <ApiError>();
             }
             var partialFailureErrorsItem = InstanceCreator.CreateApiError(xItem);
             partialFailureErrorsItem.ReadFrom(xItem);
             PartialFailureErrors.Add(partialFailureErrorsItem);
         }
     }
 }
 public override void ReadFrom(XElement xE)
 {
     base.ReadFrom(xE);
     Operand = null;
     foreach (var xItem in xE.Elements())
     {
         var localName = xItem.Name.LocalName;
         if (localName == "operand")
         {
             Operand = new Budget();
             Operand.ReadFrom(xItem);
         }
     }
 }
예제 #3
0
 public override void ReadFrom(XElement xE)
 {
     base.ReadFrom(xE);
     Entries = null;
     foreach (var xItem in xE.Elements())
     {
         var localName = xItem.Name.LocalName;
         if (localName == "entries")
         {
             if (Entries == null)
             {
                 Entries = new List <Budget>();
             }
             var entriesItem = new Budget();
             entriesItem.ReadFrom(xItem);
             Entries.Add(entriesItem);
         }
     }
 }
예제 #4
0
 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);
         }
     }
 }