コード例 #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 != 0)
            {
                hash ^= Type.GetHashCode();
            }
            if (schemeCase_ == SchemeOneofCase.EnhancedCpc)
            {
                hash ^= EnhancedCpc.GetHashCode();
            }
            if (schemeCase_ == SchemeOneofCase.PageOnePromoted)
            {
                hash ^= PageOnePromoted.GetHashCode();
            }
            if (schemeCase_ == SchemeOneofCase.TargetCpa)
            {
                hash ^= TargetCpa.GetHashCode();
            }
            if (schemeCase_ == SchemeOneofCase.TargetOutrankShare)
            {
                hash ^= TargetOutrankShare.GetHashCode();
            }
            if (schemeCase_ == SchemeOneofCase.TargetRoas)
            {
                hash ^= TargetRoas.GetHashCode();
            }
            if (schemeCase_ == SchemeOneofCase.TargetSpend)
            {
                hash ^= TargetSpend.GetHashCode();
            }
            hash ^= (int)schemeCase_;
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
コード例 #2
0
        public void MergeFrom(BiddingStrategy 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.Status != 0)
            {
                Status = other.Status;
            }
            if (other.Type != 0)
            {
                Type = other.Type;
            }
            if (other.campaignCount_ != null)
            {
                if (campaignCount_ == null || other.CampaignCount != 0L)
                {
                    CampaignCount = other.CampaignCount;
                }
            }
            if (other.nonRemovedCampaignCount_ != null)
            {
                if (nonRemovedCampaignCount_ == null || other.NonRemovedCampaignCount != 0L)
                {
                    NonRemovedCampaignCount = other.NonRemovedCampaignCount;
                }
            }
            switch (other.SchemeCase)
            {
            case SchemeOneofCase.EnhancedCpc:
                if (EnhancedCpc == null)
                {
                    EnhancedCpc = new global::Google.Ads.GoogleAds.V2.Common.EnhancedCpc();
                }
                EnhancedCpc.MergeFrom(other.EnhancedCpc);
                break;

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

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

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

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

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

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

            _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
        }
コード例 #3
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 (Status != global::Google.Ads.GoogleAds.V2.Enums.BiddingStrategyStatusEnum.Types.BiddingStrategyStatus.Unspecified)
            {
                hash ^= Status.GetHashCode();
            }
            if (Type != global::Google.Ads.GoogleAds.V2.Enums.BiddingStrategyTypeEnum.Types.BiddingStrategyType.Unspecified)
            {
                hash ^= Type.GetHashCode();
            }
            if (campaignCount_ != null)
            {
                hash ^= CampaignCount.GetHashCode();
            }
            if (nonRemovedCampaignCount_ != null)
            {
                hash ^= NonRemovedCampaignCount.GetHashCode();
            }
            if (schemeCase_ == SchemeOneofCase.EnhancedCpc)
            {
                hash ^= EnhancedCpc.GetHashCode();
            }
            if (schemeCase_ == SchemeOneofCase.PageOnePromoted)
            {
                hash ^= PageOnePromoted.GetHashCode();
            }
            if (schemeCase_ == SchemeOneofCase.TargetCpa)
            {
                hash ^= TargetCpa.GetHashCode();
            }
            if (schemeCase_ == SchemeOneofCase.TargetImpressionShare)
            {
                hash ^= TargetImpressionShare.GetHashCode();
            }
            if (schemeCase_ == SchemeOneofCase.TargetOutrankShare)
            {
                hash ^= TargetOutrankShare.GetHashCode();
            }
            if (schemeCase_ == SchemeOneofCase.TargetRoas)
            {
                hash ^= TargetRoas.GetHashCode();
            }
            if (schemeCase_ == SchemeOneofCase.TargetSpend)
            {
                hash ^= TargetSpend.GetHashCode();
            }
            hash ^= (int)schemeCase_;
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }