コード例 #1
0
    public async Task WriteAsync(TProtocol oprot, CancellationToken cancellationToken)
    {
        oprot.IncrementRecursionDepth();
        try
        {
            var struc = new TStruct("SquareInfo");
            await oprot.WriteStructBeginAsync(struc, cancellationToken);

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

                await Square.WriteAsync(oprot, cancellationToken);

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

                await SquareStatus.WriteAsync(oprot, cancellationToken);

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

                await SquareNoteStatus.WriteAsync(oprot, cancellationToken);

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

            await oprot.WriteStructEndAsync(cancellationToken);
        }
        finally
        {
            oprot.DecrementRecursionDepth();
        }
    }
コード例 #2
0
    public async Task WriteAsync(TProtocol oprot, CancellationToken cancellationToken)
    {
        oprot.IncrementRecursionDepth();
        try
        {
            var struc = new TStruct("SquareEventNotifiedCreateSquareMember");
            await oprot.WriteStructBeginAsync(struc, cancellationToken);

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

                await Square.WriteAsync(oprot, cancellationToken);

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

                await SquareAuthority.WriteAsync(oprot, cancellationToken);

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

                await SquareStatus.WriteAsync(oprot, cancellationToken);

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

                await SquareMember.WriteAsync(oprot, cancellationToken);

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

                await SquareFeatureSet.WriteAsync(oprot, cancellationToken);

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

            await oprot.WriteStructEndAsync(cancellationToken);
        }
        finally
        {
            oprot.DecrementRecursionDepth();
        }
    }