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_id_codec.Read(input); if (id_ == null || value != 0L) { Id = value; } break; } case 26: { global::Google.Ads.GoogleAds.V0.Resources.MediaImage subBuilder = new global::Google.Ads.GoogleAds.V0.Resources.MediaImage(); if (mediatypeCase_ == MediatypeOneofCase.Image) { subBuilder.MergeFrom(Image); } input.ReadMessage(subBuilder); Image = subBuilder; break; } case 34: { global::Google.Ads.GoogleAds.V0.Resources.MediaBundle subBuilder = new global::Google.Ads.GoogleAds.V0.Resources.MediaBundle(); if (mediatypeCase_ == MediatypeOneofCase.MediaBundle) { subBuilder.MergeFrom(MediaBundle); } input.ReadMessage(subBuilder); MediaBundle = subBuilder; break; } case 40: { type_ = (global::Google.Ads.GoogleAds.V0.Enums.MediaTypeEnum.Types.MediaType)input.ReadEnum(); break; } case 48: { mimeType_ = (global::Google.Ads.GoogleAds.V0.Enums.MimeTypeEnum.Types.MimeType)input.ReadEnum(); break; } case 58: { string value = _single_sourceUrl_codec.Read(input); if (sourceUrl_ == null || value != "") { SourceUrl = value; } break; } case 66: { string value = _single_name_codec.Read(input); if (name_ == null || value != "") { Name = value; } break; } case 74: { long?value = _single_fileSize_codec.Read(input); if (fileSize_ == null || value != 0L) { FileSize = value; } break; } } } }
public void MergeFrom(MediaFile 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.Type != 0) { Type = other.Type; } if (other.MimeType != 0) { MimeType = other.MimeType; } if (other.sourceUrl_ != null) { if (sourceUrl_ == null || other.SourceUrl != "") { SourceUrl = other.SourceUrl; } } if (other.name_ != null) { if (name_ == null || other.Name != "") { Name = other.Name; } } if (other.fileSize_ != null) { if (fileSize_ == null || other.FileSize != 0L) { FileSize = other.FileSize; } } switch (other.MediatypeCase) { case MediatypeOneofCase.Image: if (Image == null) { Image = new global::Google.Ads.GoogleAds.V0.Resources.MediaImage(); } Image.MergeFrom(other.Image); break; case MediatypeOneofCase.MediaBundle: if (MediaBundle == null) { MediaBundle = new global::Google.Ads.GoogleAds.V0.Resources.MediaBundle(); } MediaBundle.MergeFrom(other.MediaBundle); break; } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); }