Beispiel #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.String)
                    {
                        ChannelId = await iprot.ReadStringAsync(cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

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

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

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

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

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

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

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

                            Permissions = new List <string>(_list36.Count);
                            for (int _i37 = 0; _i37 < _list36.Count; ++_i37)
                            {
                                string _elem38;
                                _elem38 = await iprot.ReadStringAsync(cancellationToken);

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

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

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

                            ChannelConfigurations = new List <ChannelConfiguration>(_list39.Count);
                            for (int _i40 = 0; _i40 < _list39.Count; ++_i40)
                            {
                                ChannelConfiguration _elem41;
                                _elem41 = (ChannelConfiguration)await iprot.ReadI32Async(cancellationToken);

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

                case 13:
                    if (field.Type == TType.Bool)
                    {
                        LcsAllApiUsable = await iprot.ReadBoolAsync(cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 14:
                    if (field.Type == TType.Set)
                    {
                        {
                            TSet _set42 = await iprot.ReadSetBeginAsync(cancellationToken);

                            AllowedPermissions = new THashSet <ChannelPermission>(_set42.Count);
                            for (int _i43 = 0; _i43 < _set42.Count; ++_i43)
                            {
                                ChannelPermission _elem44;
                                _elem44 = (ChannelPermission)await iprot.ReadI32Async(cancellationToken);

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

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

                            ChannelDomains = new List <ChannelDomain>(_list45.Count);
                            for (int _i46 = 0; _i46 < _list45.Count; ++_i46)
                            {
                                ChannelDomain _elem47;
                                _elem47 = new ChannelDomain();
                                await _elem47.ReadAsync(iprot, cancellationToken);

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

                case 16:
                    if (field.Type == TType.I64)
                    {
                        UpdatedTimestamp = await iprot.ReadI64Async(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();
        }
    }