Пример #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 26: {
                    long?value = _single_id_codec.Read(input);
                    if (id_ == null || value != 0L)
                    {
                        Id = value;
                    }
                    break;
                }

                case 34: {
                    string value = _single_name_codec.Read(input);
                    if (name_ == null || value != "")
                    {
                        Name = value;
                    }
                    break;
                }

                case 40: {
                    Type = (global::Google.Ads.GoogleAds.V2.Enums.BiddingStrategyTypeEnum.Types.BiddingStrategyType)input.ReadEnum();
                    break;
                }

                case 58: {
                    global::Google.Ads.GoogleAds.V2.Common.EnhancedCpc subBuilder = new global::Google.Ads.GoogleAds.V2.Common.EnhancedCpc();
                    if (schemeCase_ == SchemeOneofCase.EnhancedCpc)
                    {
                        subBuilder.MergeFrom(EnhancedCpc);
                    }
                    input.ReadMessage(subBuilder);
                    EnhancedCpc = subBuilder;
                    break;
                }

                case 66: {
                    global::Google.Ads.GoogleAds.V2.Common.PageOnePromoted subBuilder = new global::Google.Ads.GoogleAds.V2.Common.PageOnePromoted();
                    if (schemeCase_ == SchemeOneofCase.PageOnePromoted)
                    {
                        subBuilder.MergeFrom(PageOnePromoted);
                    }
                    input.ReadMessage(subBuilder);
                    PageOnePromoted = subBuilder;
                    break;
                }

                case 74: {
                    global::Google.Ads.GoogleAds.V2.Common.TargetCpa subBuilder = new global::Google.Ads.GoogleAds.V2.Common.TargetCpa();
                    if (schemeCase_ == SchemeOneofCase.TargetCpa)
                    {
                        subBuilder.MergeFrom(TargetCpa);
                    }
                    input.ReadMessage(subBuilder);
                    TargetCpa = subBuilder;
                    break;
                }

                case 82: {
                    global::Google.Ads.GoogleAds.V2.Common.TargetOutrankShare subBuilder = new global::Google.Ads.GoogleAds.V2.Common.TargetOutrankShare();
                    if (schemeCase_ == SchemeOneofCase.TargetOutrankShare)
                    {
                        subBuilder.MergeFrom(TargetOutrankShare);
                    }
                    input.ReadMessage(subBuilder);
                    TargetOutrankShare = subBuilder;
                    break;
                }

                case 90: {
                    global::Google.Ads.GoogleAds.V2.Common.TargetRoas subBuilder = new global::Google.Ads.GoogleAds.V2.Common.TargetRoas();
                    if (schemeCase_ == SchemeOneofCase.TargetRoas)
                    {
                        subBuilder.MergeFrom(TargetRoas);
                    }
                    input.ReadMessage(subBuilder);
                    TargetRoas = subBuilder;
                    break;
                }

                case 98: {
                    global::Google.Ads.GoogleAds.V2.Common.TargetSpend subBuilder = new global::Google.Ads.GoogleAds.V2.Common.TargetSpend();
                    if (schemeCase_ == SchemeOneofCase.TargetSpend)
                    {
                        subBuilder.MergeFrom(TargetSpend);
                    }
                    input.ReadMessage(subBuilder);
                    TargetSpend = subBuilder;
                    break;
                }

                case 106: {
                    long?value = _single_campaignCount_codec.Read(input);
                    if (campaignCount_ == null || value != 0L)
                    {
                        CampaignCount = value;
                    }
                    break;
                }

                case 114: {
                    long?value = _single_nonRemovedCampaignCount_codec.Read(input);
                    if (nonRemovedCampaignCount_ == null || value != 0L)
                    {
                        NonRemovedCampaignCount = value;
                    }
                    break;
                }

                case 120: {
                    Status = (global::Google.Ads.GoogleAds.V2.Enums.BiddingStrategyStatusEnum.Types.BiddingStrategyStatus)input.ReadEnum();
                    break;
                }

                case 386: {
                    global::Google.Ads.GoogleAds.V2.Common.TargetImpressionShare subBuilder = new global::Google.Ads.GoogleAds.V2.Common.TargetImpressionShare();
                    if (schemeCase_ == SchemeOneofCase.TargetImpressionShare)
                    {
                        subBuilder.MergeFrom(TargetImpressionShare);
                    }
                    input.ReadMessage(subBuilder);
                    TargetImpressionShare = subBuilder;
                    break;
                }
                }
            }
        }
Пример #2
0
        public void MergeFrom(BiddingStrategy other)
        {
            if (other == null)
            {
                return;
            }
            if (other.ResourceName.Length != 0)
            {
                ResourceName = other.ResourceName;
            }
            if (other.id_ != null)
            {
                if (id_ == null || other.Id != 0L)
                {
                    Id = other.Id;
                }
            }
            if (other.name_ != null)
            {
                if (name_ == null || other.Name != "")
                {
                    Name = other.Name;
                }
            }
            if (other.Status != 0)
            {
                Status = other.Status;
            }
            if (other.Type != 0)
            {
                Type = other.Type;
            }
            if (other.campaignCount_ != null)
            {
                if (campaignCount_ == null || other.CampaignCount != 0L)
                {
                    CampaignCount = other.CampaignCount;
                }
            }
            if (other.nonRemovedCampaignCount_ != null)
            {
                if (nonRemovedCampaignCount_ == null || other.NonRemovedCampaignCount != 0L)
                {
                    NonRemovedCampaignCount = other.NonRemovedCampaignCount;
                }
            }
            switch (other.SchemeCase)
            {
            case SchemeOneofCase.EnhancedCpc:
                if (EnhancedCpc == null)
                {
                    EnhancedCpc = new global::Google.Ads.GoogleAds.V2.Common.EnhancedCpc();
                }
                EnhancedCpc.MergeFrom(other.EnhancedCpc);
                break;

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

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

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

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

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

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

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