| /** |
| * Autogenerated by Thrift Compiler (0.14.2) |
| * |
| * 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 TSQueryTemplateResp : TBase |
| { |
| private bool _result; |
| private int _count; |
| private List<string> _measurements; |
| |
| public TSStatus Status { get; set; } |
| |
| public int QueryType { get; set; } |
| |
| public bool Result |
| { |
| get |
| { |
| return _result; |
| } |
| set |
| { |
| __isset.result = true; |
| this._result = value; |
| } |
| } |
| |
| public int Count |
| { |
| get |
| { |
| return _count; |
| } |
| set |
| { |
| __isset.count = true; |
| this._count = value; |
| } |
| } |
| |
| public List<string> Measurements |
| { |
| get |
| { |
| return _measurements; |
| } |
| set |
| { |
| __isset.measurements = true; |
| this._measurements = value; |
| } |
| } |
| |
| |
| public Isset __isset; |
| public struct Isset |
| { |
| public bool result; |
| public bool count; |
| public bool measurements; |
| } |
| |
| public TSQueryTemplateResp() |
| { |
| } |
| |
| public TSQueryTemplateResp(TSStatus status, int queryType) : this() |
| { |
| this.Status = status; |
| this.QueryType = queryType; |
| } |
| |
| public TSQueryTemplateResp DeepCopy() |
| { |
| var tmp411 = new TSQueryTemplateResp(); |
| if((Status != null)) |
| { |
| tmp411.Status = (TSStatus)this.Status.DeepCopy(); |
| } |
| tmp411.QueryType = this.QueryType; |
| if(__isset.result) |
| { |
| tmp411.Result = this.Result; |
| } |
| tmp411.__isset.result = this.__isset.result; |
| if(__isset.count) |
| { |
| tmp411.Count = this.Count; |
| } |
| tmp411.__isset.count = this.__isset.count; |
| if((Measurements != null) && __isset.measurements) |
| { |
| tmp411.Measurements = this.Measurements.DeepCopy(); |
| } |
| tmp411.__isset.measurements = this.__isset.measurements; |
| return tmp411; |
| } |
| |
| public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) |
| { |
| iprot.IncrementRecursionDepth(); |
| try |
| { |
| bool isset_status = false; |
| bool isset_queryType = 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.I32) |
| { |
| QueryType = await iprot.ReadI32Async(cancellationToken); |
| isset_queryType = true; |
| } |
| else |
| { |
| await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); |
| } |
| break; |
| case 3: |
| if (field.Type == TType.Bool) |
| { |
| Result = await iprot.ReadBoolAsync(cancellationToken); |
| } |
| else |
| { |
| await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); |
| } |
| break; |
| case 4: |
| if (field.Type == TType.I32) |
| { |
| Count = await iprot.ReadI32Async(cancellationToken); |
| } |
| else |
| { |
| await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); |
| } |
| break; |
| case 5: |
| if (field.Type == TType.List) |
| { |
| { |
| TList _list412 = await iprot.ReadListBeginAsync(cancellationToken); |
| Measurements = new List<string>(_list412.Count); |
| for(int _i413 = 0; _i413 < _list412.Count; ++_i413) |
| { |
| string _elem414; |
| _elem414 = await iprot.ReadStringAsync(cancellationToken); |
| Measurements.Add(_elem414); |
| } |
| await iprot.ReadListEndAsync(cancellationToken); |
| } |
| } |
| 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_queryType) |
| { |
| 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("TSQueryTemplateResp"); |
| 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); |
| } |
| field.Name = "queryType"; |
| field.Type = TType.I32; |
| field.ID = 2; |
| await oprot.WriteFieldBeginAsync(field, cancellationToken); |
| await oprot.WriteI32Async(QueryType, cancellationToken); |
| await oprot.WriteFieldEndAsync(cancellationToken); |
| if(__isset.result) |
| { |
| field.Name = "result"; |
| field.Type = TType.Bool; |
| field.ID = 3; |
| await oprot.WriteFieldBeginAsync(field, cancellationToken); |
| await oprot.WriteBoolAsync(Result, cancellationToken); |
| await oprot.WriteFieldEndAsync(cancellationToken); |
| } |
| if(__isset.count) |
| { |
| field.Name = "count"; |
| field.Type = TType.I32; |
| field.ID = 4; |
| await oprot.WriteFieldBeginAsync(field, cancellationToken); |
| await oprot.WriteI32Async(Count, cancellationToken); |
| await oprot.WriteFieldEndAsync(cancellationToken); |
| } |
| if((Measurements != null) && __isset.measurements) |
| { |
| field.Name = "measurements"; |
| field.Type = TType.List; |
| field.ID = 5; |
| await oprot.WriteFieldBeginAsync(field, cancellationToken); |
| { |
| await oprot.WriteListBeginAsync(new TList(TType.String, Measurements.Count), cancellationToken); |
| foreach (string _iter415 in Measurements) |
| { |
| await oprot.WriteStringAsync(_iter415, 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 TSQueryTemplateResp other)) return false; |
| if (ReferenceEquals(this, other)) return true; |
| return System.Object.Equals(Status, other.Status) |
| && System.Object.Equals(QueryType, other.QueryType) |
| && ((__isset.result == other.__isset.result) && ((!__isset.result) || (System.Object.Equals(Result, other.Result)))) |
| && ((__isset.count == other.__isset.count) && ((!__isset.count) || (System.Object.Equals(Count, other.Count)))) |
| && ((__isset.measurements == other.__isset.measurements) && ((!__isset.measurements) || (TCollections.Equals(Measurements, other.Measurements)))); |
| } |
| |
| public override int GetHashCode() { |
| int hashcode = 157; |
| unchecked { |
| if((Status != null)) |
| { |
| hashcode = (hashcode * 397) + Status.GetHashCode(); |
| } |
| hashcode = (hashcode * 397) + QueryType.GetHashCode(); |
| if(__isset.result) |
| { |
| hashcode = (hashcode * 397) + Result.GetHashCode(); |
| } |
| if(__isset.count) |
| { |
| hashcode = (hashcode * 397) + Count.GetHashCode(); |
| } |
| if((Measurements != null) && __isset.measurements) |
| { |
| hashcode = (hashcode * 397) + TCollections.GetHashCode(Measurements); |
| } |
| } |
| return hashcode; |
| } |
| |
| public override string ToString() |
| { |
| var sb = new StringBuilder("TSQueryTemplateResp("); |
| if((Status != null)) |
| { |
| sb.Append(", Status: "); |
| Status.ToString(sb); |
| } |
| sb.Append(", QueryType: "); |
| QueryType.ToString(sb); |
| if(__isset.result) |
| { |
| sb.Append(", Result: "); |
| Result.ToString(sb); |
| } |
| if(__isset.count) |
| { |
| sb.Append(", Count: "); |
| Count.ToString(sb); |
| } |
| if((Measurements != null) && __isset.measurements) |
| { |
| sb.Append(", Measurements: "); |
| Measurements.ToString(sb); |
| } |
| sb.Append(')'); |
| return sb.ToString(); |
| } |
| } |
| |