Esempio n. 1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (ResourceName.Length != 0)
            {
                hash ^= ResourceName.GetHashCode();
            }
            if (id_ != null)
            {
                hash ^= Id.GetHashCode();
            }
            if (name_ != null)
            {
                hash ^= Name.GetHashCode();
            }
            if (Type != global::Google.Ads.GoogleAds.V4.Enums.AssetTypeEnum.Types.AssetType.Unspecified)
            {
                hash ^= Type.GetHashCode();
            }
            if (assetDataCase_ == AssetDataOneofCase.YoutubeVideoAsset)
            {
                hash ^= YoutubeVideoAsset.GetHashCode();
            }
            if (assetDataCase_ == AssetDataOneofCase.MediaBundleAsset)
            {
                hash ^= MediaBundleAsset.GetHashCode();
            }
            if (assetDataCase_ == AssetDataOneofCase.ImageAsset)
            {
                hash ^= ImageAsset.GetHashCode();
            }
            if (assetDataCase_ == AssetDataOneofCase.TextAsset)
            {
                hash ^= TextAsset.GetHashCode();
            }
            if (assetDataCase_ == AssetDataOneofCase.BookOnGoogleAsset)
            {
                hash ^= BookOnGoogleAsset.GetHashCode();
            }
            hash ^= (int)assetDataCase_;
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Esempio n. 2
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (ResourceName.Length != 0)
            {
                hash ^= ResourceName.GetHashCode();
            }
            if (id_ != null)
            {
                hash ^= Id.GetHashCode();
            }
            if (name_ != null)
            {
                hash ^= Name.GetHashCode();
            }
            if (Type != 0)
            {
                hash ^= Type.GetHashCode();
            }
            if (assetDataCase_ == AssetDataOneofCase.YoutubeVideoAsset)
            {
                hash ^= YoutubeVideoAsset.GetHashCode();
            }
            if (assetDataCase_ == AssetDataOneofCase.MediaBundleAsset)
            {
                hash ^= MediaBundleAsset.GetHashCode();
            }
            if (assetDataCase_ == AssetDataOneofCase.ImageAsset)
            {
                hash ^= ImageAsset.GetHashCode();
            }
            if (assetDataCase_ == AssetDataOneofCase.TextAsset)
            {
                hash ^= TextAsset.GetHashCode();
            }
            hash ^= (int)assetDataCase_;
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Esempio n. 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.V2.Enums.AssetTypeEnum.Types.AssetType.Unspecified)
            {
                Type = other.Type;
            }
            switch (other.AssetDataCase)
            {
            case AssetDataOneofCase.YoutubeVideoAsset:
                if (YoutubeVideoAsset == null)
                {
                    YoutubeVideoAsset = new global::Google.Ads.GoogleAds.V2.Common.YoutubeVideoAsset();
                }
                YoutubeVideoAsset.MergeFrom(other.YoutubeVideoAsset);
                break;

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

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

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

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