Example #1
0
 public void MergeFrom(FeedItemAttributeValue other)
 {
     if (other == null)
     {
         return;
     }
     if (other.feedAttributeId_ != null)
     {
         if (feedAttributeId_ == null || other.FeedAttributeId != 0L)
         {
             FeedAttributeId = other.FeedAttributeId;
         }
     }
     if (other.integerValue_ != null)
     {
         if (integerValue_ == null || other.IntegerValue != 0L)
         {
             IntegerValue = other.IntegerValue;
         }
     }
     if (other.booleanValue_ != null)
     {
         if (booleanValue_ == null || other.BooleanValue != false)
         {
             BooleanValue = other.BooleanValue;
         }
     }
     if (other.stringValue_ != null)
     {
         if (stringValue_ == null || other.StringValue != "")
         {
             StringValue = other.StringValue;
         }
     }
     if (other.doubleValue_ != null)
     {
         if (doubleValue_ == null || other.DoubleValue != 0D)
         {
             DoubleValue = other.DoubleValue;
         }
     }
     if (other.priceValue_ != null)
     {
         if (priceValue_ == null)
         {
             priceValue_ = new global::Google.Ads.GoogleAds.V0.Common.Price();
         }
         PriceValue.MergeFrom(other.PriceValue);
     }
     integerValues_.Add(other.integerValues_);
     booleanValues_.Add(other.booleanValues_);
     stringValues_.Add(other.stringValues_);
     doubleValues_.Add(other.doubleValues_);
     _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
 }
Example #2
0
        public void MergeFrom(pb::CodedInputStream input)
        {
            uint tag;

            while ((tag = input.ReadTag()) != 0)
            {
                switch (tag)
                {
                default:
                    _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
                    break;

                case 10: {
                    long?value = _single_feedAttributeId_codec.Read(input);
                    if (feedAttributeId_ == null || value != 0L)
                    {
                        FeedAttributeId = value;
                    }
                    break;
                }

                case 18: {
                    long?value = _single_integerValue_codec.Read(input);
                    if (integerValue_ == null || value != 0L)
                    {
                        IntegerValue = value;
                    }
                    break;
                }

                case 26: {
                    bool?value = _single_booleanValue_codec.Read(input);
                    if (booleanValue_ == null || value != false)
                    {
                        BooleanValue = value;
                    }
                    break;
                }

                case 34: {
                    string value = _single_stringValue_codec.Read(input);
                    if (stringValue_ == null || value != "")
                    {
                        StringValue = value;
                    }
                    break;
                }

                case 42: {
                    double?value = _single_doubleValue_codec.Read(input);
                    if (doubleValue_ == null || value != 0D)
                    {
                        DoubleValue = value;
                    }
                    break;
                }

                case 50: {
                    if (priceValue_ == null)
                    {
                        priceValue_ = new global::Google.Ads.GoogleAds.V0.Common.Price();
                    }
                    input.ReadMessage(priceValue_);
                    break;
                }

                case 58: {
                    integerValues_.AddEntriesFrom(input, _repeated_integerValues_codec);
                    break;
                }

                case 66: {
                    booleanValues_.AddEntriesFrom(input, _repeated_booleanValues_codec);
                    break;
                }

                case 74: {
                    stringValues_.AddEntriesFrom(input, _repeated_stringValues_codec);
                    break;
                }

                case 82: {
                    doubleValues_.AddEntriesFrom(input, _repeated_doubleValues_codec);
                    break;
                }
                }
            }
        }