public async Task WriteAsync(TProtocol oprot, CancellationToken cancellationToken) { oprot.IncrementRecursionDepth(); try { var struc = new TStruct("TTypeEntry"); await oprot.WriteStructBeginAsync(struc, cancellationToken); var field = new TField(); if (PrimitiveEntry != null && __isset.primitiveEntry) { field.Name = "primitiveEntry"; field.Type = TType.Struct; field.ID = 1; await oprot.WriteFieldBeginAsync(field, cancellationToken); await PrimitiveEntry.WriteAsync(oprot, cancellationToken); await oprot.WriteFieldEndAsync(cancellationToken); } if (ArrayEntry != null && __isset.arrayEntry) { field.Name = "arrayEntry"; field.Type = TType.Struct; field.ID = 2; await oprot.WriteFieldBeginAsync(field, cancellationToken); await ArrayEntry.WriteAsync(oprot, cancellationToken); await oprot.WriteFieldEndAsync(cancellationToken); } if (MapEntry != null && __isset.mapEntry) { field.Name = "mapEntry"; field.Type = TType.Struct; field.ID = 3; await oprot.WriteFieldBeginAsync(field, cancellationToken); await MapEntry.WriteAsync(oprot, cancellationToken); await oprot.WriteFieldEndAsync(cancellationToken); } if (StructEntry != null && __isset.structEntry) { field.Name = "structEntry"; field.Type = TType.Struct; field.ID = 4; await oprot.WriteFieldBeginAsync(field, cancellationToken); await StructEntry.WriteAsync(oprot, cancellationToken); await oprot.WriteFieldEndAsync(cancellationToken); } if (UnionEntry != null && __isset.unionEntry) { field.Name = "unionEntry"; field.Type = TType.Struct; field.ID = 5; await oprot.WriteFieldBeginAsync(field, cancellationToken); await UnionEntry.WriteAsync(oprot, cancellationToken); await oprot.WriteFieldEndAsync(cancellationToken); } if (UserDefinedTypeEntry != null && __isset.userDefinedTypeEntry) { field.Name = "userDefinedTypeEntry"; field.Type = TType.Struct; field.ID = 6; await oprot.WriteFieldBeginAsync(field, cancellationToken); await UserDefinedTypeEntry.WriteAsync(oprot, cancellationToken); await oprot.WriteFieldEndAsync(cancellationToken); } await oprot.WriteFieldStopAsync(cancellationToken); await oprot.WriteStructEndAsync(cancellationToken); } finally { oprot.DecrementRecursionDepth(); } }