Exemple #1
0
    public async Task WriteAsync(TProtocol oprot, CancellationToken cancellationToken)
    {
        oprot.IncrementRecursionDepth();
        try
        {
            var struc = new TStruct("CreateSquareChatResponse");
            await oprot.WriteStructBeginAsync(struc, cancellationToken);

            var field = new TField();
            if (SquareChat != null && __isset.squareChat)
            {
                field.Name = "squareChat";
                field.Type = TType.Struct;
                field.ID   = 1;
                await oprot.WriteFieldBeginAsync(field, cancellationToken);

                await SquareChat.WriteAsync(oprot, cancellationToken);

                await oprot.WriteFieldEndAsync(cancellationToken);
            }
            if (SquareChatStatus != null && __isset.squareChatStatus)
            {
                field.Name = "squareChatStatus";
                field.Type = TType.Struct;
                field.ID   = 2;
                await oprot.WriteFieldBeginAsync(field, cancellationToken);

                await SquareChatStatus.WriteAsync(oprot, cancellationToken);

                await oprot.WriteFieldEndAsync(cancellationToken);
            }
            if (SquareChatMember != null && __isset.squareChatMember)
            {
                field.Name = "squareChatMember";
                field.Type = TType.Struct;
                field.ID   = 3;
                await oprot.WriteFieldBeginAsync(field, cancellationToken);

                await SquareChatMember.WriteAsync(oprot, cancellationToken);

                await oprot.WriteFieldEndAsync(cancellationToken);
            }
            await oprot.WriteFieldStopAsync(cancellationToken);

            await oprot.WriteStructEndAsync(cancellationToken);
        }
        finally
        {
            oprot.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.Struct)
                    {
                        ChatStatus = new SquareChatStatus();
                        await ChatStatus.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();
        }
    }
Exemple #3
0
 public void Write(TProtocol oprot)
 {
     oprot.IncrementRecursionDepth();
     try
     {
         TStruct struc = new TStruct("JoinSquareChatResponse");
         oprot.WriteStructBegin(struc);
         TField field = new TField();
         if (SquareChat != null && __isset.squareChat)
         {
             field.Name = "squareChat";
             field.Type = TType.Struct;
             field.ID   = 1;
             oprot.WriteFieldBegin(field);
             SquareChat.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (SquareChatStatus != null && __isset.squareChatStatus)
         {
             field.Name = "squareChatStatus";
             field.Type = TType.Struct;
             field.ID   = 2;
             oprot.WriteFieldBegin(field);
             SquareChatStatus.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (SquareChatMember != null && __isset.squareChatMember)
         {
             field.Name = "squareChatMember";
             field.Type = TType.Struct;
             field.ID   = 3;
             oprot.WriteFieldBegin(field);
             SquareChatMember.Write(oprot);
             oprot.WriteFieldEnd();
         }
         oprot.WriteFieldStop();
         oprot.WriteStructEnd();
     }
     finally
     {
         oprot.DecrementRecursionDepth();
     }
 }
Exemple #4
0
    public override int GetHashCode()
    {
        int hashcode = 157;

        unchecked {
            if (__isset.squareChat)
            {
                hashcode = (hashcode * 397) + SquareChat.GetHashCode();
            }
            if (__isset.squareChatStatus)
            {
                hashcode = (hashcode * 397) + SquareChatStatus.GetHashCode();
            }
            if (__isset.squareChatMember)
            {
                hashcode = (hashcode * 397) + SquareChatMember.GetHashCode();
            }
        }
        return(hashcode);
    }
    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)
                    {
                        ChatStatus = new SquareChatStatus();
                        ChatStatus.Read(iprot);
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                default:
                    TProtocolUtil.Skip(iprot, field.Type);
                    break;
                }
                iprot.ReadFieldEnd();
            }
            iprot.ReadStructEnd();
        }
        finally
        {
            iprot.DecrementRecursionDepth();
        }
    }
Exemple #6
0
    public override string ToString()
    {
        var  sb      = new StringBuilder("CreateSquareChatResponse(");
        bool __first = true;

        if (SquareChat != null && __isset.squareChat)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("SquareChat: ");
            sb.Append(SquareChat == null ? "<null>" : SquareChat.ToString());
        }
        if (SquareChatStatus != null && __isset.squareChatStatus)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("SquareChatStatus: ");
            sb.Append(SquareChatStatus == null ? "<null>" : SquareChatStatus.ToString());
        }
        if (SquareChatMember != null && __isset.squareChatMember)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("SquareChatMember: ");
            sb.Append(SquareChatMember == null ? "<null>" : SquareChatMember.ToString());
        }
        sb.Append(")");
        return(sb.ToString());
    }
    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();
        }
    }
Exemple #8
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();
        }
    }
Exemple #9
0
    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.List)
                    {
                        {
                            Chats = new List <SquareChat>();
                            TList _list591 = iprot.ReadListBegin();
                            for (int _i592 = 0; _i592 < _list591.Count; ++_i592)
                            {
                                SquareChat _elem593;
                                _elem593 = new SquareChat();
                                _elem593.Read(iprot);
                                Chats.Add(_elem593);
                            }
                            iprot.ReadListEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 2:
                    if (field.Type == TType.Map)
                    {
                        {
                            ChatMembers = new Dictionary <string, SquareChatMember>();
                            TMap _map594 = iprot.ReadMapBegin();
                            for (int _i595 = 0; _i595 < _map594.Count; ++_i595)
                            {
                                string           _key596;
                                SquareChatMember _val597;
                                _key596 = iprot.ReadString();
                                _val597 = new SquareChatMember();
                                _val597.Read(iprot);
                                ChatMembers[_key596] = _val597;
                            }
                            iprot.ReadMapEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 3:
                    if (field.Type == TType.Map)
                    {
                        {
                            Statuses = new Dictionary <string, SquareChatStatus>();
                            TMap _map598 = iprot.ReadMapBegin();
                            for (int _i599 = 0; _i599 < _map598.Count; ++_i599)
                            {
                                string           _key600;
                                SquareChatStatus _val601;
                                _key600 = iprot.ReadString();
                                _val601 = new SquareChatStatus();
                                _val601.Read(iprot);
                                Statuses[_key600] = _val601;
                            }
                            iprot.ReadMapEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 4:
                    if (field.Type == TType.String)
                    {
                        ContinuationToken = iprot.ReadString();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                default:
                    TProtocolUtil.Skip(iprot, field.Type);
                    break;
                }
                iprot.ReadFieldEnd();
            }
            iprot.ReadStructEnd();
        }
        finally
        {
            iprot.DecrementRecursionDepth();
        }
    }
Exemple #10
0
    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.List)
                    {
                        {
                            Chats = new List <SquareChat>();
                            TList _list503 = iprot.ReadListBegin();
                            for (int _i504 = 0; _i504 < _list503.Count; ++_i504)
                            {
                                SquareChat _elem505;
                                _elem505 = new SquareChat();
                                _elem505.Read(iprot);
                                Chats.Add(_elem505);
                            }
                            iprot.ReadListEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 2:
                    if (field.Type == TType.Map)
                    {
                        {
                            ChatMembers = new Dictionary <string, SquareChatMember>();
                            TMap _map506 = iprot.ReadMapBegin();
                            for (int _i507 = 0; _i507 < _map506.Count; ++_i507)
                            {
                                string           _key508;
                                SquareChatMember _val509;
                                _key508 = iprot.ReadString();
                                _val509 = new SquareChatMember();
                                _val509.Read(iprot);
                                ChatMembers[_key508] = _val509;
                            }
                            iprot.ReadMapEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 3:
                    if (field.Type == TType.Map)
                    {
                        {
                            Statuses = new Dictionary <string, SquareChatStatus>();
                            TMap _map510 = iprot.ReadMapBegin();
                            for (int _i511 = 0; _i511 < _map510.Count; ++_i511)
                            {
                                string           _key512;
                                SquareChatStatus _val513;
                                _key512 = iprot.ReadString();
                                _val513 = new SquareChatStatus();
                                _val513.Read(iprot);
                                Statuses[_key512] = _val513;
                            }
                            iprot.ReadMapEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 4:
                    if (field.Type == TType.String)
                    {
                        ContinuationToken = iprot.ReadString();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                default:
                    TProtocolUtil.Skip(iprot, field.Type);
                    break;
                }
                iprot.ReadFieldEnd();
            }
            iprot.ReadStructEnd();
        }
        finally
        {
            iprot.DecrementRecursionDepth();
        }
    }
Exemple #11
0
    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.List)
                    {
                        {
                            SquareChats = new List <SquareChat>();
                            TList _list408 = iprot.ReadListBegin();
                            for (int _i409 = 0; _i409 < _list408.Count; ++_i409)
                            {
                                SquareChat _elem410;
                                _elem410 = new SquareChat();
                                _elem410.Read(iprot);
                                SquareChats.Add(_elem410);
                            }
                            iprot.ReadListEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 2:
                    if (field.Type == TType.String)
                    {
                        ContinuationToken = iprot.ReadString();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 3:
                    if (field.Type == TType.I32)
                    {
                        TotalSquareChatCount = iprot.ReadI32();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 4:
                    if (field.Type == TType.Map)
                    {
                        {
                            SquareChatStatuses = new Dictionary <string, SquareChatStatus>();
                            TMap _map411 = iprot.ReadMapBegin();
                            for (int _i412 = 0; _i412 < _map411.Count; ++_i412)
                            {
                                string           _key413;
                                SquareChatStatus _val414;
                                _key413 = iprot.ReadString();
                                _val414 = new SquareChatStatus();
                                _val414.Read(iprot);
                                SquareChatStatuses[_key413] = _val414;
                            }
                            iprot.ReadMapEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

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