コード例 #1
0
        public void MergeFrom(CampaignCriterionSimulation other)
        {
            if (other == null)
            {
                return;
            }
            if (other.ResourceName.Length != 0)
            {
                ResourceName = other.ResourceName;
            }
            if (other.campaignId_ != null)
            {
                if (campaignId_ == null || other.CampaignId != 0L)
                {
                    CampaignId = other.CampaignId;
                }
            }
            if (other.criterionId_ != null)
            {
                if (criterionId_ == null || other.CriterionId != 0L)
                {
                    CriterionId = other.CriterionId;
                }
            }
            if (other.Type != 0)
            {
                Type = other.Type;
            }
            if (other.ModificationMethod != 0)
            {
                ModificationMethod = other.ModificationMethod;
            }
            if (other.startDate_ != null)
            {
                if (startDate_ == null || other.StartDate != "")
                {
                    StartDate = other.StartDate;
                }
            }
            if (other.endDate_ != null)
            {
                if (endDate_ == null || other.EndDate != "")
                {
                    EndDate = other.EndDate;
                }
            }
            switch (other.PointListCase)
            {
            case PointListOneofCase.BidModifierPointList:
                if (BidModifierPointList == null)
                {
                    BidModifierPointList = new global::Google.Ads.GoogleAds.V3.Common.BidModifierSimulationPointList();
                }
                BidModifierPointList.MergeFrom(other.BidModifierPointList);
                break;
            }

            _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
        }
コード例 #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: {
                    ResourceName = input.ReadString();
                    break;
                }

                case 18: {
                    long?value = _single_campaignId_codec.Read(input);
                    if (campaignId_ == null || value != 0L)
                    {
                        CampaignId = value;
                    }
                    break;
                }

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

                case 32: {
                    Type = (global::Google.Ads.GoogleAds.V3.Enums.SimulationTypeEnum.Types.SimulationType)input.ReadEnum();
                    break;
                }

                case 40: {
                    ModificationMethod = (global::Google.Ads.GoogleAds.V3.Enums.SimulationModificationMethodEnum.Types.SimulationModificationMethod)input.ReadEnum();
                    break;
                }

                case 50: {
                    string value = _single_startDate_codec.Read(input);
                    if (startDate_ == null || value != "")
                    {
                        StartDate = value;
                    }
                    break;
                }

                case 58: {
                    string value = _single_endDate_codec.Read(input);
                    if (endDate_ == null || value != "")
                    {
                        EndDate = value;
                    }
                    break;
                }

                case 66: {
                    global::Google.Ads.GoogleAds.V3.Common.BidModifierSimulationPointList subBuilder = new global::Google.Ads.GoogleAds.V3.Common.BidModifierSimulationPointList();
                    if (pointListCase_ == PointListOneofCase.BidModifierPointList)
                    {
                        subBuilder.MergeFrom(BidModifierPointList);
                    }
                    input.ReadMessage(subBuilder);
                    BidModifierPointList = subBuilder;
                    break;
                }
                }
            }
        }