コード例 #1
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: {
                    ResourceName = input.ReadString();
                    break;
                }

                case 18: {
                    string value = _single_adGroup_codec.Read(input);
                    if (adGroup_ == null || value != "")
                    {
                        AdGroup = value;
                    }
                    break;
                }

                case 26: {
                    long?value = _single_criterionId_codec.Read(input);
                    if (criterionId_ == null || value != 0L)
                    {
                        CriterionId = value;
                    }
                    break;
                }

                case 34: {
                    double?value = _single_bidModifier_codec.Read(input);
                    if (bidModifier_ == null || value != 0D)
                    {
                        BidModifier = value;
                    }
                    break;
                }

                case 42: {
                    global::Google.Ads.GoogleAds.V2.Common.HotelDateSelectionTypeInfo subBuilder = new global::Google.Ads.GoogleAds.V2.Common.HotelDateSelectionTypeInfo();
                    if (criterionCase_ == CriterionOneofCase.HotelDateSelectionType)
                    {
                        subBuilder.MergeFrom(HotelDateSelectionType);
                    }
                    input.ReadMessage(subBuilder);
                    HotelDateSelectionType = subBuilder;
                    break;
                }

                case 50: {
                    global::Google.Ads.GoogleAds.V2.Common.HotelAdvanceBookingWindowInfo subBuilder = new global::Google.Ads.GoogleAds.V2.Common.HotelAdvanceBookingWindowInfo();
                    if (criterionCase_ == CriterionOneofCase.HotelAdvanceBookingWindow)
                    {
                        subBuilder.MergeFrom(HotelAdvanceBookingWindow);
                    }
                    input.ReadMessage(subBuilder);
                    HotelAdvanceBookingWindow = subBuilder;
                    break;
                }

                case 58: {
                    global::Google.Ads.GoogleAds.V2.Common.HotelLengthOfStayInfo subBuilder = new global::Google.Ads.GoogleAds.V2.Common.HotelLengthOfStayInfo();
                    if (criterionCase_ == CriterionOneofCase.HotelLengthOfStay)
                    {
                        subBuilder.MergeFrom(HotelLengthOfStay);
                    }
                    input.ReadMessage(subBuilder);
                    HotelLengthOfStay = subBuilder;
                    break;
                }

                case 66: {
                    global::Google.Ads.GoogleAds.V2.Common.HotelCheckInDayInfo subBuilder = new global::Google.Ads.GoogleAds.V2.Common.HotelCheckInDayInfo();
                    if (criterionCase_ == CriterionOneofCase.HotelCheckInDay)
                    {
                        subBuilder.MergeFrom(HotelCheckInDay);
                    }
                    input.ReadMessage(subBuilder);
                    HotelCheckInDay = subBuilder;
                    break;
                }

                case 74: {
                    string value = _single_baseAdGroup_codec.Read(input);
                    if (baseAdGroup_ == null || value != "")
                    {
                        BaseAdGroup = value;
                    }
                    break;
                }

                case 80: {
                    BidModifierSource = (global::Google.Ads.GoogleAds.V2.Enums.BidModifierSourceEnum.Types.BidModifierSource)input.ReadEnum();
                    break;
                }

                case 90: {
                    global::Google.Ads.GoogleAds.V2.Common.DeviceInfo subBuilder = new global::Google.Ads.GoogleAds.V2.Common.DeviceInfo();
                    if (criterionCase_ == CriterionOneofCase.Device)
                    {
                        subBuilder.MergeFrom(Device);
                    }
                    input.ReadMessage(subBuilder);
                    Device = subBuilder;
                    break;
                }

                case 98: {
                    global::Google.Ads.GoogleAds.V2.Common.PreferredContentInfo subBuilder = new global::Google.Ads.GoogleAds.V2.Common.PreferredContentInfo();
                    if (criterionCase_ == CriterionOneofCase.PreferredContent)
                    {
                        subBuilder.MergeFrom(PreferredContent);
                    }
                    input.ReadMessage(subBuilder);
                    PreferredContent = subBuilder;
                    break;
                }
                }
            }
        }
コード例 #2
0
        public void MergeFrom(AdGroupBidModifier other)
        {
            if (other == null)
            {
                return;
            }
            if (other.ResourceName.Length != 0)
            {
                ResourceName = other.ResourceName;
            }
            if (other.adGroup_ != null)
            {
                if (adGroup_ == null || other.AdGroup != "")
                {
                    AdGroup = other.AdGroup;
                }
            }
            if (other.criterionId_ != null)
            {
                if (criterionId_ == null || other.CriterionId != 0L)
                {
                    CriterionId = other.CriterionId;
                }
            }
            if (other.bidModifier_ != null)
            {
                if (bidModifier_ == null || other.BidModifier != 0D)
                {
                    BidModifier = other.BidModifier;
                }
            }
            if (other.baseAdGroup_ != null)
            {
                if (baseAdGroup_ == null || other.BaseAdGroup != "")
                {
                    BaseAdGroup = other.BaseAdGroup;
                }
            }
            if (other.BidModifierSource != global::Google.Ads.GoogleAds.V2.Enums.BidModifierSourceEnum.Types.BidModifierSource.Unspecified)
            {
                BidModifierSource = other.BidModifierSource;
            }
            switch (other.CriterionCase)
            {
            case CriterionOneofCase.HotelDateSelectionType:
                if (HotelDateSelectionType == null)
                {
                    HotelDateSelectionType = new global::Google.Ads.GoogleAds.V2.Common.HotelDateSelectionTypeInfo();
                }
                HotelDateSelectionType.MergeFrom(other.HotelDateSelectionType);
                break;

            case CriterionOneofCase.HotelAdvanceBookingWindow:
                if (HotelAdvanceBookingWindow == null)
                {
                    HotelAdvanceBookingWindow = new global::Google.Ads.GoogleAds.V2.Common.HotelAdvanceBookingWindowInfo();
                }
                HotelAdvanceBookingWindow.MergeFrom(other.HotelAdvanceBookingWindow);
                break;

            case CriterionOneofCase.HotelLengthOfStay:
                if (HotelLengthOfStay == null)
                {
                    HotelLengthOfStay = new global::Google.Ads.GoogleAds.V2.Common.HotelLengthOfStayInfo();
                }
                HotelLengthOfStay.MergeFrom(other.HotelLengthOfStay);
                break;

            case CriterionOneofCase.HotelCheckInDay:
                if (HotelCheckInDay == null)
                {
                    HotelCheckInDay = new global::Google.Ads.GoogleAds.V2.Common.HotelCheckInDayInfo();
                }
                HotelCheckInDay.MergeFrom(other.HotelCheckInDay);
                break;

            case CriterionOneofCase.Device:
                if (Device == null)
                {
                    Device = new global::Google.Ads.GoogleAds.V2.Common.DeviceInfo();
                }
                Device.MergeFrom(other.Device);
                break;

            case CriterionOneofCase.PreferredContent:
                if (PreferredContent == null)
                {
                    PreferredContent = new global::Google.Ads.GoogleAds.V2.Common.PreferredContentInfo();
                }
                PreferredContent.MergeFrom(other.PreferredContent);
                break;
            }

            _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
        }