public static ReferralData ToReferralData(this THTokenInfo thTokenInfo)
        {
            var linkParams         = new Dictionary <string, string>(thTokenInfo.LinkParams);
            var originalLinkParams = new Dictionary <string, string>(thTokenInfo.OriginalData);

            var token           = thTokenInfo.LinkParams.GetOrDefault("$token", null);
            var provider        = thTokenInfo.LinkParams.GetOrDefault("$channel", null);
            var firstMatch      = bool.Parse(thTokenInfo.LinkParams.GetOrDefault("$first_match", null));
            var guaranteedMatch = bool.Parse(thTokenInfo.LinkParams.GetOrDefault("$guaranteed_match", null));
            var reinstall       = bool.Parse(thTokenInfo.LinkParams.GetOrDefault("$reinstall", null));
            var firstMatchLink  = bool.Parse(thTokenInfo.LinkParams.GetOrDefault("$first_match_link", null));
            var referrerUserId  = thTokenInfo.LinkParams.GetOrDefault("$referrer_user_guid", null);

#pragma warning disable 0618
            return(new ReferralData(token, referrerUserId, provider, firstMatch, guaranteedMatch, reinstall, firstMatchLink, new CustomReferralData(linkParams), linkParams, new CustomReferralData(originalLinkParams), originalLinkParams));

#pragma warning restore 0618
        }
        public void Read(TProtocol iprot)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                TField field;
                iprot.ReadStructBegin();
                while (true)
                {
                    field = iprot.ReadFieldBegin();
                    if (field.Type == TType.Stop)
                    {
                        break;
                    }
                    switch (field.ID)
                    {
                    case 1:
                        if (field.Type == TType.Struct)
                        {
                            SdkAuthResponse = new THSdkAuthResponse();
                            SdkAuthResponse.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 2:
                        if (field.Type == TType.Struct)
                        {
                            TokenInfo = new THTokenInfo();
                            TokenInfo.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 3:
                        if (field.Type == TType.Struct)
                        {
                            InviteProviders = new THInviteProviders();
                            InviteProviders.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    default:
                        TProtocolUtil.Skip(iprot, field.Type);
                        break;
                    }
                    iprot.ReadFieldEnd();
                }
                iprot.ReadStructEnd();
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }