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

            var field = new TField();
            if (SquareMid != null && __isset.squareMid)
            {
                field.Name = "squareMid";
                field.Type = TType.String;
                field.ID   = 2;
                await oprot.WriteFieldBeginAsync(field, cancellationToken);

                await oprot.WriteStringAsync(SquareMid, cancellationToken);

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

                await SearchOption.WriteAsync(oprot, cancellationToken);

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

                await oprot.WriteStringAsync(ContinuationToken, cancellationToken);

                await oprot.WriteFieldEndAsync(cancellationToken);
            }
            if (__isset.limit)
            {
                field.Name = "limit";
                field.Type = TType.I32;
                field.ID   = 5;
                await oprot.WriteFieldBeginAsync(field, cancellationToken);

                await oprot.WriteI32Async(Limit, cancellationToken);

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

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