Exemple #1
0
        public void MergeFrom(pb::CodedInputStream input)
        {
    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
            input.ReadRawMessage(this);
    #else
            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_id_codec.Read(input);
                    if (id_ == null || value != 0L)
                    {
                        Id = value;
                    }
                    break;
                }

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

                case 32: {
                    Type = (global::Google.Ads.GoogleAds.V4.Enums.AssetTypeEnum.Types.AssetType)input.ReadEnum();
                    break;
                }

                case 42: {
                    global::Google.Ads.GoogleAds.V4.Common.YoutubeVideoAsset subBuilder = new global::Google.Ads.GoogleAds.V4.Common.YoutubeVideoAsset();
                    if (assetDataCase_ == AssetDataOneofCase.YoutubeVideoAsset)
                    {
                        subBuilder.MergeFrom(YoutubeVideoAsset);
                    }
                    input.ReadMessage(subBuilder);
                    YoutubeVideoAsset = subBuilder;
                    break;
                }

                case 50: {
                    global::Google.Ads.GoogleAds.V4.Common.MediaBundleAsset subBuilder = new global::Google.Ads.GoogleAds.V4.Common.MediaBundleAsset();
                    if (assetDataCase_ == AssetDataOneofCase.MediaBundleAsset)
                    {
                        subBuilder.MergeFrom(MediaBundleAsset);
                    }
                    input.ReadMessage(subBuilder);
                    MediaBundleAsset = subBuilder;
                    break;
                }

                case 58: {
                    global::Google.Ads.GoogleAds.V4.Common.ImageAsset subBuilder = new global::Google.Ads.GoogleAds.V4.Common.ImageAsset();
                    if (assetDataCase_ == AssetDataOneofCase.ImageAsset)
                    {
                        subBuilder.MergeFrom(ImageAsset);
                    }
                    input.ReadMessage(subBuilder);
                    ImageAsset = subBuilder;
                    break;
                }

                case 66: {
                    global::Google.Ads.GoogleAds.V4.Common.TextAsset subBuilder = new global::Google.Ads.GoogleAds.V4.Common.TextAsset();
                    if (assetDataCase_ == AssetDataOneofCase.TextAsset)
                    {
                        subBuilder.MergeFrom(TextAsset);
                    }
                    input.ReadMessage(subBuilder);
                    TextAsset = subBuilder;
                    break;
                }

                case 82: {
                    global::Google.Ads.GoogleAds.V4.Common.BookOnGoogleAsset subBuilder = new global::Google.Ads.GoogleAds.V4.Common.BookOnGoogleAsset();
                    if (assetDataCase_ == AssetDataOneofCase.BookOnGoogleAsset)
                    {
                        subBuilder.MergeFrom(BookOnGoogleAsset);
                    }
                    input.ReadMessage(subBuilder);
                    BookOnGoogleAsset = subBuilder;
                    break;
                }
                }
            }
    #endif
        }
Exemple #2
0
        void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input)
        {
            uint tag;

            while ((tag = input.ReadTag()) != 0)
            {
                switch (tag)
                {
                default:
                    _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
                    break;

                case 10: {
                    ResourceName = input.ReadString();
                    break;
                }

                case 18: {
                    long?value = _single_id_codec.Read(ref input);
                    if (id_ == null || value != 0L)
                    {
                        Id = value;
                    }
                    break;
                }

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

                case 32: {
                    Type = (global::Google.Ads.GoogleAds.V4.Enums.AssetTypeEnum.Types.AssetType)input.ReadEnum();
                    break;
                }

                case 42: {
                    global::Google.Ads.GoogleAds.V4.Common.YoutubeVideoAsset subBuilder = new global::Google.Ads.GoogleAds.V4.Common.YoutubeVideoAsset();
                    if (assetDataCase_ == AssetDataOneofCase.YoutubeVideoAsset)
                    {
                        subBuilder.MergeFrom(YoutubeVideoAsset);
                    }
                    input.ReadMessage(subBuilder);
                    YoutubeVideoAsset = subBuilder;
                    break;
                }

                case 50: {
                    global::Google.Ads.GoogleAds.V4.Common.MediaBundleAsset subBuilder = new global::Google.Ads.GoogleAds.V4.Common.MediaBundleAsset();
                    if (assetDataCase_ == AssetDataOneofCase.MediaBundleAsset)
                    {
                        subBuilder.MergeFrom(MediaBundleAsset);
                    }
                    input.ReadMessage(subBuilder);
                    MediaBundleAsset = subBuilder;
                    break;
                }

                case 58: {
                    global::Google.Ads.GoogleAds.V4.Common.ImageAsset subBuilder = new global::Google.Ads.GoogleAds.V4.Common.ImageAsset();
                    if (assetDataCase_ == AssetDataOneofCase.ImageAsset)
                    {
                        subBuilder.MergeFrom(ImageAsset);
                    }
                    input.ReadMessage(subBuilder);
                    ImageAsset = subBuilder;
                    break;
                }

                case 66: {
                    global::Google.Ads.GoogleAds.V4.Common.TextAsset subBuilder = new global::Google.Ads.GoogleAds.V4.Common.TextAsset();
                    if (assetDataCase_ == AssetDataOneofCase.TextAsset)
                    {
                        subBuilder.MergeFrom(TextAsset);
                    }
                    input.ReadMessage(subBuilder);
                    TextAsset = subBuilder;
                    break;
                }

                case 82: {
                    global::Google.Ads.GoogleAds.V4.Common.BookOnGoogleAsset subBuilder = new global::Google.Ads.GoogleAds.V4.Common.BookOnGoogleAsset();
                    if (assetDataCase_ == AssetDataOneofCase.BookOnGoogleAsset)
                    {
                        subBuilder.MergeFrom(BookOnGoogleAsset);
                    }
                    input.ReadMessage(subBuilder);
                    BookOnGoogleAsset = subBuilder;
                    break;
                }
                }
            }
        }
Exemple #3
0
        public void MergeFrom(Asset 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.Type != global::Google.Ads.GoogleAds.V4.Enums.AssetTypeEnum.Types.AssetType.Unspecified)
            {
                Type = other.Type;
            }
            switch (other.AssetDataCase)
            {
            case AssetDataOneofCase.YoutubeVideoAsset:
                if (YoutubeVideoAsset == null)
                {
                    YoutubeVideoAsset = new global::Google.Ads.GoogleAds.V4.Common.YoutubeVideoAsset();
                }
                YoutubeVideoAsset.MergeFrom(other.YoutubeVideoAsset);
                break;

            case AssetDataOneofCase.MediaBundleAsset:
                if (MediaBundleAsset == null)
                {
                    MediaBundleAsset = new global::Google.Ads.GoogleAds.V4.Common.MediaBundleAsset();
                }
                MediaBundleAsset.MergeFrom(other.MediaBundleAsset);
                break;

            case AssetDataOneofCase.ImageAsset:
                if (ImageAsset == null)
                {
                    ImageAsset = new global::Google.Ads.GoogleAds.V4.Common.ImageAsset();
                }
                ImageAsset.MergeFrom(other.ImageAsset);
                break;

            case AssetDataOneofCase.TextAsset:
                if (TextAsset == null)
                {
                    TextAsset = new global::Google.Ads.GoogleAds.V4.Common.TextAsset();
                }
                TextAsset.MergeFrom(other.TextAsset);
                break;

            case AssetDataOneofCase.BookOnGoogleAsset:
                if (BookOnGoogleAsset == null)
                {
                    BookOnGoogleAsset = new global::Google.Ads.GoogleAds.V4.Common.BookOnGoogleAsset();
                }
                BookOnGoogleAsset.MergeFrom(other.BookOnGoogleAsset);
                break;
            }

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