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); }
public override int GetHashCode() { int hash = 1; if (ResourceName.Length != 0) { hash ^= ResourceName.GetHashCode(); } if (ExtensionType != 0) { hash ^= ExtensionType.GetHashCode(); } if (startDateTime_ != null) { hash ^= StartDateTime.GetHashCode(); } if (endDateTime_ != null) { hash ^= EndDateTime.GetHashCode(); } hash ^= adSchedules_.GetHashCode(); if (Device != 0) { hash ^= Device.GetHashCode(); } if (Status != 0) { hash ^= Status.GetHashCode(); } if (extensionCase_ == ExtensionOneofCase.SitelinkFeedItem) { hash ^= SitelinkFeedItem.GetHashCode(); } if (extensionCase_ == ExtensionOneofCase.StructuredSnippetFeedItem) { hash ^= StructuredSnippetFeedItem.GetHashCode(); } if (extensionCase_ == ExtensionOneofCase.AppFeedItem) { hash ^= AppFeedItem.GetHashCode(); } if (extensionCase_ == ExtensionOneofCase.CallFeedItem) { hash ^= CallFeedItem.GetHashCode(); } if (extensionCase_ == ExtensionOneofCase.CalloutFeedItem) { hash ^= CalloutFeedItem.GetHashCode(); } if (extensionCase_ == ExtensionOneofCase.TextMessageFeedItem) { hash ^= TextMessageFeedItem.GetHashCode(); } if (extensionCase_ == ExtensionOneofCase.PriceFeedItem) { hash ^= PriceFeedItem.GetHashCode(); } if (extensionCase_ == ExtensionOneofCase.PromotionFeedItem) { hash ^= PromotionFeedItem.GetHashCode(); } if (extensionCase_ == ExtensionOneofCase.LocationFeedItem) { hash ^= LocationFeedItem.GetHashCode(); } if (extensionCase_ == ExtensionOneofCase.AffiliateLocationFeedItem) { hash ^= AffiliateLocationFeedItem.GetHashCode(); } hash ^= (int)extensionCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }