Exemplo n.º 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: {
                    global::Google.Ads.GoogleAds.V1.Common.SitelinkFeedItem subBuilder = new global::Google.Ads.GoogleAds.V1.Common.SitelinkFeedItem();
                    if (extensionCase_ == ExtensionOneofCase.SitelinkFeedItem)
                    {
                        subBuilder.MergeFrom(SitelinkFeedItem);
                    }
                    input.ReadMessage(subBuilder);
                    SitelinkFeedItem = subBuilder;
                    break;
                }

                case 26: {
                    global::Google.Ads.GoogleAds.V1.Common.StructuredSnippetFeedItem subBuilder = new global::Google.Ads.GoogleAds.V1.Common.StructuredSnippetFeedItem();
                    if (extensionCase_ == ExtensionOneofCase.StructuredSnippetFeedItem)
                    {
                        subBuilder.MergeFrom(StructuredSnippetFeedItem);
                    }
                    input.ReadMessage(subBuilder);
                    StructuredSnippetFeedItem = subBuilder;
                    break;
                }

                case 32: {
                    status_ = (global::Google.Ads.GoogleAds.V1.Enums.FeedItemStatusEnum.Types.FeedItemStatus)input.ReadEnum();
                    break;
                }

                case 42: {
                    string value = _single_startDateTime_codec.Read(input);
                    if (startDateTime_ == null || value != "")
                    {
                        StartDateTime = value;
                    }
                    break;
                }

                case 50: {
                    string value = _single_endDateTime_codec.Read(input);
                    if (endDateTime_ == null || value != "")
                    {
                        EndDateTime = value;
                    }
                    break;
                }

                case 58: {
                    global::Google.Ads.GoogleAds.V1.Common.AppFeedItem subBuilder = new global::Google.Ads.GoogleAds.V1.Common.AppFeedItem();
                    if (extensionCase_ == ExtensionOneofCase.AppFeedItem)
                    {
                        subBuilder.MergeFrom(AppFeedItem);
                    }
                    input.ReadMessage(subBuilder);
                    AppFeedItem = subBuilder;
                    break;
                }

                case 66: {
                    global::Google.Ads.GoogleAds.V1.Common.CallFeedItem subBuilder = new global::Google.Ads.GoogleAds.V1.Common.CallFeedItem();
                    if (extensionCase_ == ExtensionOneofCase.CallFeedItem)
                    {
                        subBuilder.MergeFrom(CallFeedItem);
                    }
                    input.ReadMessage(subBuilder);
                    CallFeedItem = subBuilder;
                    break;
                }

                case 74: {
                    global::Google.Ads.GoogleAds.V1.Common.CalloutFeedItem subBuilder = new global::Google.Ads.GoogleAds.V1.Common.CalloutFeedItem();
                    if (extensionCase_ == ExtensionOneofCase.CalloutFeedItem)
                    {
                        subBuilder.MergeFrom(CalloutFeedItem);
                    }
                    input.ReadMessage(subBuilder);
                    CalloutFeedItem = subBuilder;
                    break;
                }

                case 82: {
                    global::Google.Ads.GoogleAds.V1.Common.TextMessageFeedItem subBuilder = new global::Google.Ads.GoogleAds.V1.Common.TextMessageFeedItem();
                    if (extensionCase_ == ExtensionOneofCase.TextMessageFeedItem)
                    {
                        subBuilder.MergeFrom(TextMessageFeedItem);
                    }
                    input.ReadMessage(subBuilder);
                    TextMessageFeedItem = subBuilder;
                    break;
                }

                case 90: {
                    global::Google.Ads.GoogleAds.V1.Common.PriceFeedItem subBuilder = new global::Google.Ads.GoogleAds.V1.Common.PriceFeedItem();
                    if (extensionCase_ == ExtensionOneofCase.PriceFeedItem)
                    {
                        subBuilder.MergeFrom(PriceFeedItem);
                    }
                    input.ReadMessage(subBuilder);
                    PriceFeedItem = subBuilder;
                    break;
                }

                case 98: {
                    global::Google.Ads.GoogleAds.V1.Common.PromotionFeedItem subBuilder = new global::Google.Ads.GoogleAds.V1.Common.PromotionFeedItem();
                    if (extensionCase_ == ExtensionOneofCase.PromotionFeedItem)
                    {
                        subBuilder.MergeFrom(PromotionFeedItem);
                    }
                    input.ReadMessage(subBuilder);
                    PromotionFeedItem = subBuilder;
                    break;
                }

                case 104: {
                    extensionType_ = (global::Google.Ads.GoogleAds.V1.Enums.ExtensionTypeEnum.Types.ExtensionType)input.ReadEnum();
                    break;
                }

                case 114: {
                    global::Google.Ads.GoogleAds.V1.Common.LocationFeedItem subBuilder = new global::Google.Ads.GoogleAds.V1.Common.LocationFeedItem();
                    if (extensionCase_ == ExtensionOneofCase.LocationFeedItem)
                    {
                        subBuilder.MergeFrom(LocationFeedItem);
                    }
                    input.ReadMessage(subBuilder);
                    LocationFeedItem = subBuilder;
                    break;
                }

                case 122: {
                    global::Google.Ads.GoogleAds.V1.Common.AffiliateLocationFeedItem subBuilder = new global::Google.Ads.GoogleAds.V1.Common.AffiliateLocationFeedItem();
                    if (extensionCase_ == ExtensionOneofCase.AffiliateLocationFeedItem)
                    {
                        subBuilder.MergeFrom(AffiliateLocationFeedItem);
                    }
                    input.ReadMessage(subBuilder);
                    AffiliateLocationFeedItem = subBuilder;
                    break;
                }

                case 130: {
                    adSchedules_.AddEntriesFrom(input, _repeated_adSchedules_codec);
                    break;
                }

                case 136: {
                    device_ = (global::Google.Ads.GoogleAds.V1.Enums.FeedItemTargetDeviceEnum.Types.FeedItemTargetDevice)input.ReadEnum();
                    break;
                }
                }
            }
        }
Exemplo n.º 2
0
        public void MergeFrom(ExtensionFeedItem other)
        {
            if (other == null)
            {
                return;
            }
            if (other.ResourceName.Length != 0)
            {
                ResourceName = other.ResourceName;
            }
            if (other.ExtensionType != 0)
            {
                ExtensionType = other.ExtensionType;
            }
            if (other.startDateTime_ != null)
            {
                if (startDateTime_ == null || other.StartDateTime != "")
                {
                    StartDateTime = other.StartDateTime;
                }
            }
            if (other.endDateTime_ != null)
            {
                if (endDateTime_ == null || other.EndDateTime != "")
                {
                    EndDateTime = other.EndDateTime;
                }
            }
            adSchedules_.Add(other.adSchedules_);
            if (other.Device != 0)
            {
                Device = other.Device;
            }
            if (other.Status != 0)
            {
                Status = other.Status;
            }
            switch (other.ExtensionCase)
            {
            case ExtensionOneofCase.SitelinkFeedItem:
                if (SitelinkFeedItem == null)
                {
                    SitelinkFeedItem = new global::Google.Ads.GoogleAds.V1.Common.SitelinkFeedItem();
                }
                SitelinkFeedItem.MergeFrom(other.SitelinkFeedItem);
                break;

            case ExtensionOneofCase.StructuredSnippetFeedItem:
                if (StructuredSnippetFeedItem == null)
                {
                    StructuredSnippetFeedItem = new global::Google.Ads.GoogleAds.V1.Common.StructuredSnippetFeedItem();
                }
                StructuredSnippetFeedItem.MergeFrom(other.StructuredSnippetFeedItem);
                break;

            case ExtensionOneofCase.AppFeedItem:
                if (AppFeedItem == null)
                {
                    AppFeedItem = new global::Google.Ads.GoogleAds.V1.Common.AppFeedItem();
                }
                AppFeedItem.MergeFrom(other.AppFeedItem);
                break;

            case ExtensionOneofCase.CallFeedItem:
                if (CallFeedItem == null)
                {
                    CallFeedItem = new global::Google.Ads.GoogleAds.V1.Common.CallFeedItem();
                }
                CallFeedItem.MergeFrom(other.CallFeedItem);
                break;

            case ExtensionOneofCase.CalloutFeedItem:
                if (CalloutFeedItem == null)
                {
                    CalloutFeedItem = new global::Google.Ads.GoogleAds.V1.Common.CalloutFeedItem();
                }
                CalloutFeedItem.MergeFrom(other.CalloutFeedItem);
                break;

            case ExtensionOneofCase.TextMessageFeedItem:
                if (TextMessageFeedItem == null)
                {
                    TextMessageFeedItem = new global::Google.Ads.GoogleAds.V1.Common.TextMessageFeedItem();
                }
                TextMessageFeedItem.MergeFrom(other.TextMessageFeedItem);
                break;

            case ExtensionOneofCase.PriceFeedItem:
                if (PriceFeedItem == null)
                {
                    PriceFeedItem = new global::Google.Ads.GoogleAds.V1.Common.PriceFeedItem();
                }
                PriceFeedItem.MergeFrom(other.PriceFeedItem);
                break;

            case ExtensionOneofCase.PromotionFeedItem:
                if (PromotionFeedItem == null)
                {
                    PromotionFeedItem = new global::Google.Ads.GoogleAds.V1.Common.PromotionFeedItem();
                }
                PromotionFeedItem.MergeFrom(other.PromotionFeedItem);
                break;

            case ExtensionOneofCase.LocationFeedItem:
                if (LocationFeedItem == null)
                {
                    LocationFeedItem = new global::Google.Ads.GoogleAds.V1.Common.LocationFeedItem();
                }
                LocationFeedItem.MergeFrom(other.LocationFeedItem);
                break;

            case ExtensionOneofCase.AffiliateLocationFeedItem:
                if (AffiliateLocationFeedItem == null)
                {
                    AffiliateLocationFeedItem = new global::Google.Ads.GoogleAds.V1.Common.AffiliateLocationFeedItem();
                }
                AffiliateLocationFeedItem.MergeFrom(other.AffiliateLocationFeedItem);
                break;
            }

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