| /** |
| * Autogenerated by Thrift Compiler (0.14.1) |
| * |
| * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING |
| * @generated |
| */ |
| using System; |
| using System.Collections; |
| using System.Collections.Generic; |
| using System.Text; |
| using System.IO; |
| using System.Linq; |
| using System.Threading; |
| using System.Threading.Tasks; |
| using Microsoft.Extensions.Logging; |
| using Thrift; |
| using Thrift.Collections; |
| |
| using Thrift.Protocol; |
| using Thrift.Protocol.Entities; |
| using Thrift.Protocol.Utilities; |
| using Thrift.Transport; |
| using Thrift.Transport.Client; |
| using Thrift.Transport.Server; |
| using Thrift.Processor; |
| |
| |
| #pragma warning disable IDE0079 // remove unnecessary pragmas |
| #pragma warning disable IDE1006 // parts of the code use IDL spelling |
| |
| |
| public partial class TTestConnectionResp : TBase |
| { |
| |
| public TSStatus Status { get; set; } |
| |
| public List<TTestConnectionResult> ResultList { get; set; } |
| |
| public TTestConnectionResp() |
| { |
| } |
| |
| public TTestConnectionResp(TSStatus status, List<TTestConnectionResult> resultList) : this() |
| { |
| this.Status = status; |
| this.ResultList = resultList; |
| } |
| |
| public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) |
| { |
| iprot.IncrementRecursionDepth(); |
| try |
| { |
| bool isset_status = false; |
| bool isset_resultList = false; |
| 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) |
| { |
| Status = new TSStatus(); |
| await Status.ReadAsync(iprot, cancellationToken); |
| isset_status = true; |
| } |
| else |
| { |
| await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); |
| } |
| break; |
| case 2: |
| if (field.Type == TType.List) |
| { |
| { |
| TList _list93 = await iprot.ReadListBeginAsync(cancellationToken); |
| ResultList = new List<TTestConnectionResult>(_list93.Count); |
| for(int _i94 = 0; _i94 < _list93.Count; ++_i94) |
| { |
| TTestConnectionResult _elem95; |
| _elem95 = new TTestConnectionResult(); |
| await _elem95.ReadAsync(iprot, cancellationToken); |
| ResultList.Add(_elem95); |
| } |
| await iprot.ReadListEndAsync(cancellationToken); |
| } |
| isset_resultList = true; |
| } |
| 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); |
| if (!isset_status) |
| { |
| throw new TProtocolException(TProtocolException.INVALID_DATA); |
| } |
| if (!isset_resultList) |
| { |
| throw new TProtocolException(TProtocolException.INVALID_DATA); |
| } |
| } |
| finally |
| { |
| iprot.DecrementRecursionDepth(); |
| } |
| } |
| |
| public async global::System.Threading.Tasks.Task WriteAsync(TProtocol oprot, CancellationToken cancellationToken) |
| { |
| oprot.IncrementRecursionDepth(); |
| try |
| { |
| var struc = new TStruct("TTestConnectionResp"); |
| await oprot.WriteStructBeginAsync(struc, cancellationToken); |
| var field = new TField(); |
| if((Status != null)) |
| { |
| field.Name = "status"; |
| field.Type = TType.Struct; |
| field.ID = 1; |
| await oprot.WriteFieldBeginAsync(field, cancellationToken); |
| await Status.WriteAsync(oprot, cancellationToken); |
| await oprot.WriteFieldEndAsync(cancellationToken); |
| } |
| if((ResultList != null)) |
| { |
| field.Name = "resultList"; |
| field.Type = TType.List; |
| field.ID = 2; |
| await oprot.WriteFieldBeginAsync(field, cancellationToken); |
| { |
| await oprot.WriteListBeginAsync(new TList(TType.Struct, ResultList.Count), cancellationToken); |
| foreach (TTestConnectionResult _iter96 in ResultList) |
| { |
| await _iter96.WriteAsync(oprot, cancellationToken); |
| } |
| await oprot.WriteListEndAsync(cancellationToken); |
| } |
| await oprot.WriteFieldEndAsync(cancellationToken); |
| } |
| await oprot.WriteFieldStopAsync(cancellationToken); |
| await oprot.WriteStructEndAsync(cancellationToken); |
| } |
| finally |
| { |
| oprot.DecrementRecursionDepth(); |
| } |
| } |
| |
| public override bool Equals(object that) |
| { |
| if (!(that is TTestConnectionResp other)) return false; |
| if (ReferenceEquals(this, other)) return true; |
| return System.Object.Equals(Status, other.Status) |
| && TCollections.Equals(ResultList, other.ResultList); |
| } |
| |
| public override int GetHashCode() { |
| int hashcode = 157; |
| unchecked { |
| if((Status != null)) |
| { |
| hashcode = (hashcode * 397) + Status.GetHashCode(); |
| } |
| if((ResultList != null)) |
| { |
| hashcode = (hashcode * 397) + TCollections.GetHashCode(ResultList); |
| } |
| } |
| return hashcode; |
| } |
| |
| public override string ToString() |
| { |
| var sb = new StringBuilder("TTestConnectionResp("); |
| if((Status != null)) |
| { |
| sb.Append(", Status: "); |
| Status.ToString(sb); |
| } |
| if((ResultList != null)) |
| { |
| sb.Append(", ResultList: "); |
| ResultList.ToString(sb); |
| } |
| sb.Append(')'); |
| return sb.ToString(); |
| } |
| } |
| |