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 != 0)
            {
                BidModifierSource = other.BidModifierSource;
            }
            switch (other.CriterionCase)
            {
            case CriterionOneofCase.HotelDateSelectionType:
                if (HotelDateSelectionType == null)
                {
                    HotelDateSelectionType = new global::Google.Ads.GoogleAds.V0.Common.HotelDateSelectionTypeInfo();
                }
                HotelDateSelectionType.MergeFrom(other.HotelDateSelectionType);
                break;

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

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

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

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

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

            _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
        }
Esempio n. 2
0
        public void MergeFrom(AdGroupBidModifier other)
        {
            if (other == null)
            {
                return;
            }
            if (other.ResourceName.Length != 0)
            {
                ResourceName = other.ResourceName;
            }
            if (other.HasAdGroup)
            {
                AdGroup = other.AdGroup;
            }
            if (other.HasCriterionId)
            {
                CriterionId = other.CriterionId;
            }
            if (other.HasBidModifier)
            {
                BidModifier = other.BidModifier;
            }
            if (other.HasBaseAdGroup)
            {
                BaseAdGroup = other.BaseAdGroup;
            }
            if (other.BidModifierSource != global::Google.Ads.GoogleAds.V7.Enums.BidModifierSourceEnum.Types.BidModifierSource.Unspecified)
            {
                BidModifierSource = other.BidModifierSource;
            }
            switch (other.CriterionCase)
            {
            case CriterionOneofCase.HotelDateSelectionType:
                if (HotelDateSelectionType == null)
                {
                    HotelDateSelectionType = new global::Google.Ads.GoogleAds.V7.Common.HotelDateSelectionTypeInfo();
                }
                HotelDateSelectionType.MergeFrom(other.HotelDateSelectionType);
                break;

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

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

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

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

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

            case CriterionOneofCase.HotelCheckInDateRange:
                if (HotelCheckInDateRange == null)
                {
                    HotelCheckInDateRange = new global::Google.Ads.GoogleAds.V7.Common.HotelCheckInDateRangeInfo();
                }
                HotelCheckInDateRange.MergeFrom(other.HotelCheckInDateRange);
                break;
            }

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