public async Task WriteAsync(TProtocol oprot, CancellationToken cancellationToken) { oprot.IncrementRecursionDepth(); try { var struc = new TStruct("CreateSquareChatRequest"); await oprot.WriteStructBeginAsync(struc, cancellationToken); var field = new TField(); if (__isset.reqSeq) { field.Name = "reqSeq"; field.Type = TType.I32; field.ID = 1; await oprot.WriteFieldBeginAsync(field, cancellationToken); await oprot.WriteI32Async(ReqSeq, cancellationToken); await oprot.WriteFieldEndAsync(cancellationToken); } if (SquareChat != null && __isset.squareChat) { field.Name = "squareChat"; field.Type = TType.Struct; field.ID = 2; await oprot.WriteFieldBeginAsync(field, cancellationToken); await SquareChat.WriteAsync(oprot, cancellationToken); await oprot.WriteFieldEndAsync(cancellationToken); } if (SquareMemberMids != null && __isset.squareMemberMids) { field.Name = "squareMemberMids"; field.Type = TType.List; field.ID = 3; await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, SquareMemberMids.Count), cancellationToken); foreach (string _iter295 in SquareMemberMids) { await oprot.WriteStringAsync(_iter295, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } await oprot.WriteFieldEndAsync(cancellationToken); } await oprot.WriteFieldStopAsync(cancellationToken); await oprot.WriteStructEndAsync(cancellationToken); } finally { oprot.DecrementRecursionDepth(); } }
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(); } }