Esempio n. 1
0
    public async Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
    {
        iprot.IncrementRecursionDepth();
        try
        {
            TField field;
            await iprot.ReadStructBeginAsync(cancellationToken);

            while (true)
            {
                field = await iprot.ReadFieldBeginAsync(cancellationToken);

                if (field.Type == TType.Stop)
                {
                    break;
                }

                switch (field.ID)
                {
                case 1:
                    if (field.Type == TType.Struct)
                    {
                        SquareChat = new SquareChat();
                        await SquareChat.ReadAsync(iprot, cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                default:
                    await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);

                    break;
                }

                await iprot.ReadFieldEndAsync(cancellationToken);
            }

            await iprot.ReadStructEndAsync(cancellationToken);
        }
        finally
        {
            iprot.DecrementRecursionDepth();
        }
    }
    public async Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
    {
        iprot.IncrementRecursionDepth();
        try
        {
            TField field;
            await iprot.ReadStructBeginAsync(cancellationToken);

            while (true)
            {
                field = await iprot.ReadFieldBeginAsync(cancellationToken);

                if (field.Type == TType.Stop)
                {
                    break;
                }

                switch (field.ID)
                {
                case 1:
                    if (field.Type == TType.List)
                    {
                        {
                            SquareChats = new List <SquareChat>();
                            TList _list320 = await iprot.ReadListBeginAsync(cancellationToken);

                            for (int _i321 = 0; _i321 < _list320.Count; ++_i321)
                            {
                                SquareChat _elem322;
                                _elem322 = new SquareChat();
                                await _elem322.ReadAsync(iprot, cancellationToken);

                                SquareChats.Add(_elem322);
                            }
                            await iprot.ReadListEndAsync(cancellationToken);
                        }
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 2:
                    if (field.Type == TType.String)
                    {
                        ContinuationToken = await iprot.ReadStringAsync(cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 3:
                    if (field.Type == TType.I32)
                    {
                        TotalSquareChatCount = await iprot.ReadI32Async(cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 4:
                    if (field.Type == TType.Map)
                    {
                        {
                            SquareChatStatuses = new Dictionary <string, SquareChatStatus>();
                            TMap _map323 = await iprot.ReadMapBeginAsync(cancellationToken);

                            for (int _i324 = 0; _i324 < _map323.Count; ++_i324)
                            {
                                string           _key325;
                                SquareChatStatus _val326;
                                _key325 = await iprot.ReadStringAsync(cancellationToken);

                                _val326 = new SquareChatStatus();
                                await _val326.ReadAsync(iprot, cancellationToken);

                                SquareChatStatuses[_key325] = _val326;
                            }
                            await iprot.ReadMapEndAsync(cancellationToken);
                        }
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                default:
                    await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);

                    break;
                }

                await iprot.ReadFieldEndAsync(cancellationToken);
            }

            await iprot.ReadStructEndAsync(cancellationToken);
        }
        finally
        {
            iprot.DecrementRecursionDepth();
        }
    }
    public async Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
    {
        iprot.IncrementRecursionDepth();
        try
        {
            TField field;
            await iprot.ReadStructBeginAsync(cancellationToken);

            while (true)
            {
                field = await iprot.ReadFieldBeginAsync(cancellationToken);

                if (field.Type == TType.Stop)
                {
                    break;
                }

                switch (field.ID)
                {
                case 2:
                    if (field.Type == TType.Set)
                    {
                        {
                            TSet _set471 = await iprot.ReadSetBeginAsync(cancellationToken);

                            UpdatedAttrs = new THashSet <SquareChatAttribute>(_set471.Count);
                            for (int _i472 = 0; _i472 < _set471.Count; ++_i472)
                            {
                                SquareChatAttribute _elem473;
                                _elem473 = (SquareChatAttribute)await iprot.ReadI32Async(cancellationToken);

                                UpdatedAttrs.Add(_elem473);
                            }
                            await iprot.ReadSetEndAsync(cancellationToken);
                        }
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 3:
                    if (field.Type == TType.Struct)
                    {
                        SquareChat = new SquareChat();
                        await SquareChat.ReadAsync(iprot, cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                default:
                    await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);

                    break;
                }

                await iprot.ReadFieldEndAsync(cancellationToken);
            }

            await iprot.ReadStructEndAsync(cancellationToken);
        }
        finally
        {
            iprot.DecrementRecursionDepth();
        }
    }
Esempio n. 4
0
    public async Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
    {
        iprot.IncrementRecursionDepth();
        try
        {
            TField field;
            await iprot.ReadStructBeginAsync(cancellationToken);

            while (true)
            {
                field = await iprot.ReadFieldBeginAsync(cancellationToken);

                if (field.Type == TType.Stop)
                {
                    break;
                }

                switch (field.ID)
                {
                case 1:
                    if (field.Type == TType.List)
                    {
                        {
                            TList _list503 = await iprot.ReadListBeginAsync(cancellationToken);

                            Chats = new List <SquareChat>(_list503.Count);
                            for (int _i504 = 0; _i504 < _list503.Count; ++_i504)
                            {
                                SquareChat _elem505;
                                _elem505 = new SquareChat();
                                await _elem505.ReadAsync(iprot, cancellationToken);

                                Chats.Add(_elem505);
                            }
                            await iprot.ReadListEndAsync(cancellationToken);
                        }
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 2:
                    if (field.Type == TType.Map)
                    {
                        {
                            TMap _map506 = await iprot.ReadMapBeginAsync(cancellationToken);

                            ChatMembers = new Dictionary <string, SquareChatMember>(_map506.Count);
                            for (int _i507 = 0; _i507 < _map506.Count; ++_i507)
                            {
                                string           _key508;
                                SquareChatMember _val509;
                                _key508 = await iprot.ReadStringAsync(cancellationToken);

                                _val509 = new SquareChatMember();
                                await _val509.ReadAsync(iprot, cancellationToken);

                                ChatMembers[_key508] = _val509;
                            }
                            await iprot.ReadMapEndAsync(cancellationToken);
                        }
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 3:
                    if (field.Type == TType.Map)
                    {
                        {
                            TMap _map510 = await iprot.ReadMapBeginAsync(cancellationToken);

                            Statuses = new Dictionary <string, SquareChatStatus>(_map510.Count);
                            for (int _i511 = 0; _i511 < _map510.Count; ++_i511)
                            {
                                string           _key512;
                                SquareChatStatus _val513;
                                _key512 = await iprot.ReadStringAsync(cancellationToken);

                                _val513 = new SquareChatStatus();
                                await _val513.ReadAsync(iprot, cancellationToken);

                                Statuses[_key512] = _val513;
                            }
                            await iprot.ReadMapEndAsync(cancellationToken);
                        }
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 4:
                    if (field.Type == TType.String)
                    {
                        ContinuationToken = await iprot.ReadStringAsync(cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                default:
                    await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);

                    break;
                }

                await iprot.ReadFieldEndAsync(cancellationToken);
            }

            await iprot.ReadStructEndAsync(cancellationToken);
        }
        finally
        {
            iprot.DecrementRecursionDepth();
        }
    }
Esempio n. 5
0
    public async Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
    {
        iprot.IncrementRecursionDepth();
        try
        {
            TField field;
            await iprot.ReadStructBeginAsync(cancellationToken);

            while (true)
            {
                field = await iprot.ReadFieldBeginAsync(cancellationToken);

                if (field.Type == TType.Stop)
                {
                    break;
                }

                switch (field.ID)
                {
                case 1:
                    if (field.Type == TType.I32)
                    {
                        ReqSeq = await iprot.ReadI32Async(cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 2:
                    if (field.Type == TType.Struct)
                    {
                        SquareChat = new SquareChat();
                        await SquareChat.ReadAsync(iprot, cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 3:
                    if (field.Type == TType.List)
                    {
                        {
                            TList _list292 = await iprot.ReadListBeginAsync(cancellationToken);

                            SquareMemberMids = new List <string>(_list292.Count);
                            for (int _i293 = 0; _i293 < _list292.Count; ++_i293)
                            {
                                string _elem294;
                                _elem294 = await iprot.ReadStringAsync(cancellationToken);

                                SquareMemberMids.Add(_elem294);
                            }
                            await iprot.ReadListEndAsync(cancellationToken);
                        }
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                default:
                    await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);

                    break;
                }

                await iprot.ReadFieldEndAsync(cancellationToken);
            }

            await iprot.ReadStructEndAsync(cancellationToken);
        }
        finally
        {
            iprot.DecrementRecursionDepth();
        }
    }