Example #1
0
        public void MergeFrom(UserList 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.readOnly_ != null)
            {
                if (readOnly_ == null || other.ReadOnly != false)
                {
                    ReadOnly = other.ReadOnly;
                }
            }
            if (other.name_ != null)
            {
                if (name_ == null || other.Name != "")
                {
                    Name = other.Name;
                }
            }
            if (other.description_ != null)
            {
                if (description_ == null || other.Description != "")
                {
                    Description = other.Description;
                }
            }
            if (other.MembershipStatus != 0)
            {
                MembershipStatus = other.MembershipStatus;
            }
            if (other.integrationCode_ != null)
            {
                if (integrationCode_ == null || other.IntegrationCode != "")
                {
                    IntegrationCode = other.IntegrationCode;
                }
            }
            if (other.membershipLifeSpan_ != null)
            {
                if (membershipLifeSpan_ == null || other.MembershipLifeSpan != 0L)
                {
                    MembershipLifeSpan = other.MembershipLifeSpan;
                }
            }
            if (other.sizeForDisplay_ != null)
            {
                if (sizeForDisplay_ == null || other.SizeForDisplay != 0L)
                {
                    SizeForDisplay = other.SizeForDisplay;
                }
            }
            if (other.SizeRangeForDisplay != 0)
            {
                SizeRangeForDisplay = other.SizeRangeForDisplay;
            }
            if (other.sizeForSearch_ != null)
            {
                if (sizeForSearch_ == null || other.SizeForSearch != 0L)
                {
                    SizeForSearch = other.SizeForSearch;
                }
            }
            if (other.SizeRangeForSearch != 0)
            {
                SizeRangeForSearch = other.SizeRangeForSearch;
            }
            if (other.Type != 0)
            {
                Type = other.Type;
            }
            if (other.ClosingReason != 0)
            {
                ClosingReason = other.ClosingReason;
            }
            if (other.AccessReason != 0)
            {
                AccessReason = other.AccessReason;
            }
            if (other.AccountUserListStatus != 0)
            {
                AccountUserListStatus = other.AccountUserListStatus;
            }
            if (other.eligibleForSearch_ != null)
            {
                if (eligibleForSearch_ == null || other.EligibleForSearch != false)
                {
                    EligibleForSearch = other.EligibleForSearch;
                }
            }
            if (other.eligibleForDisplay_ != null)
            {
                if (eligibleForDisplay_ == null || other.EligibleForDisplay != false)
                {
                    EligibleForDisplay = other.EligibleForDisplay;
                }
            }
            switch (other.UserListCase)
            {
            case UserListOneofCase.CrmBasedUserList:
                if (CrmBasedUserList == null)
                {
                    CrmBasedUserList = new global::Google.Ads.GoogleAds.V0.Common.CrmBasedUserListInfo();
                }
                CrmBasedUserList.MergeFrom(other.CrmBasedUserList);
                break;

            case UserListOneofCase.SimilarUserList:
                if (SimilarUserList == null)
                {
                    SimilarUserList = new global::Google.Ads.GoogleAds.V0.Common.SimilarUserListInfo();
                }
                SimilarUserList.MergeFrom(other.SimilarUserList);
                break;
            }

            _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
        }
Example #2
0
        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: {
                    bool?value = _single_readOnly_codec.Read(input);
                    if (readOnly_ == null || value != false)
                    {
                        ReadOnly = value;
                    }
                    break;
                }

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

                case 42: {
                    string value = _single_description_codec.Read(input);
                    if (description_ == null || value != "")
                    {
                        Description = value;
                    }
                    break;
                }

                case 48: {
                    membershipStatus_ = (global::Google.Ads.GoogleAds.V0.Enums.UserListMembershipStatusEnum.Types.UserListMembershipStatus)input.ReadEnum();
                    break;
                }

                case 58: {
                    string value = _single_integrationCode_codec.Read(input);
                    if (integrationCode_ == null || value != "")
                    {
                        IntegrationCode = value;
                    }
                    break;
                }

                case 66: {
                    long?value = _single_membershipLifeSpan_codec.Read(input);
                    if (membershipLifeSpan_ == null || value != 0L)
                    {
                        MembershipLifeSpan = value;
                    }
                    break;
                }

                case 74: {
                    long?value = _single_sizeForDisplay_codec.Read(input);
                    if (sizeForDisplay_ == null || value != 0L)
                    {
                        SizeForDisplay = value;
                    }
                    break;
                }

                case 80: {
                    sizeRangeForDisplay_ = (global::Google.Ads.GoogleAds.V0.Enums.UserListSizeRangeEnum.Types.UserListSizeRange)input.ReadEnum();
                    break;
                }

                case 90: {
                    long?value = _single_sizeForSearch_codec.Read(input);
                    if (sizeForSearch_ == null || value != 0L)
                    {
                        SizeForSearch = value;
                    }
                    break;
                }

                case 96: {
                    sizeRangeForSearch_ = (global::Google.Ads.GoogleAds.V0.Enums.UserListSizeRangeEnum.Types.UserListSizeRange)input.ReadEnum();
                    break;
                }

                case 104: {
                    type_ = (global::Google.Ads.GoogleAds.V0.Enums.UserListTypeEnum.Types.UserListType)input.ReadEnum();
                    break;
                }

                case 112: {
                    closingReason_ = (global::Google.Ads.GoogleAds.V0.Enums.UserListClosingReasonEnum.Types.UserListClosingReason)input.ReadEnum();
                    break;
                }

                case 120: {
                    accessReason_ = (global::Google.Ads.GoogleAds.V0.Enums.AccessReasonEnum.Types.AccessReason)input.ReadEnum();
                    break;
                }

                case 128: {
                    accountUserListStatus_ = (global::Google.Ads.GoogleAds.V0.Enums.UserListAccessStatusEnum.Types.UserListAccessStatus)input.ReadEnum();
                    break;
                }

                case 138: {
                    bool?value = _single_eligibleForSearch_codec.Read(input);
                    if (eligibleForSearch_ == null || value != false)
                    {
                        EligibleForSearch = value;
                    }
                    break;
                }

                case 146: {
                    bool?value = _single_eligibleForDisplay_codec.Read(input);
                    if (eligibleForDisplay_ == null || value != false)
                    {
                        EligibleForDisplay = value;
                    }
                    break;
                }

                case 154: {
                    global::Google.Ads.GoogleAds.V0.Common.CrmBasedUserListInfo subBuilder = new global::Google.Ads.GoogleAds.V0.Common.CrmBasedUserListInfo();
                    if (userListCase_ == UserListOneofCase.CrmBasedUserList)
                    {
                        subBuilder.MergeFrom(CrmBasedUserList);
                    }
                    input.ReadMessage(subBuilder);
                    CrmBasedUserList = subBuilder;
                    break;
                }

                case 162: {
                    global::Google.Ads.GoogleAds.V0.Common.SimilarUserListInfo subBuilder = new global::Google.Ads.GoogleAds.V0.Common.SimilarUserListInfo();
                    if (userListCase_ == UserListOneofCase.SimilarUserList)
                    {
                        subBuilder.MergeFrom(SimilarUserList);
                    }
                    input.ReadMessage(subBuilder);
                    SimilarUserList = subBuilder;
                    break;
                }
                }
            }
        }