blob: 3575330c397d984fa4cf0dbad92a0efddbfe4e1b [file] [log] [blame]
/**
* 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 TSStatus : TBase
{
private string _message;
private List<TSStatus> _subStatus;
private TEndPoint _redirectNode;
private bool _needRetry;
public int Code { get; set; }
public string Message
{
get
{
return _message;
}
set
{
__isset.message = true;
this._message = value;
}
}
public List<TSStatus> SubStatus
{
get
{
return _subStatus;
}
set
{
__isset.subStatus = true;
this._subStatus = value;
}
}
public TEndPoint RedirectNode
{
get
{
return _redirectNode;
}
set
{
__isset.redirectNode = true;
this._redirectNode = value;
}
}
public bool NeedRetry
{
get
{
return _needRetry;
}
set
{
__isset.needRetry = true;
this._needRetry = value;
}
}
public Isset __isset;
public struct Isset
{
public bool message;
public bool subStatus;
public bool redirectNode;
public bool needRetry;
}
public TSStatus()
{
}
public TSStatus(int code) : this()
{
this.Code = code;
}
public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
{
iprot.IncrementRecursionDepth();
try
{
bool isset_code = 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.I32)
{
Code = await iprot.ReadI32Async(cancellationToken);
isset_code = true;
}
else
{
await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
}
break;
case 2:
if (field.Type == TType.String)
{
Message = await iprot.ReadStringAsync(cancellationToken);
}
else
{
await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
}
break;
case 3:
if (field.Type == TType.List)
{
{
TList _list1 = await iprot.ReadListBeginAsync(cancellationToken);
SubStatus = new List<TSStatus>(_list1.Count);
for(int _i2 = 0; _i2 < _list1.Count; ++_i2)
{
TSStatus _elem3;
_elem3 = new TSStatus();
await _elem3.ReadAsync(iprot, cancellationToken);
SubStatus.Add(_elem3);
}
await iprot.ReadListEndAsync(cancellationToken);
}
}
else
{
await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
}
break;
case 4:
if (field.Type == TType.Struct)
{
RedirectNode = new TEndPoint();
await RedirectNode.ReadAsync(iprot, cancellationToken);
}
else
{
await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
}
break;
case 5:
if (field.Type == TType.Bool)
{
NeedRetry = await iprot.ReadBoolAsync(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_code)
{
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("TSStatus");
await oprot.WriteStructBeginAsync(struc, cancellationToken);
var field = new TField();
field.Name = "code";
field.Type = TType.I32;
field.ID = 1;
await oprot.WriteFieldBeginAsync(field, cancellationToken);
await oprot.WriteI32Async(Code, cancellationToken);
await oprot.WriteFieldEndAsync(cancellationToken);
if((Message != null) && __isset.message)
{
field.Name = "message";
field.Type = TType.String;
field.ID = 2;
await oprot.WriteFieldBeginAsync(field, cancellationToken);
await oprot.WriteStringAsync(Message, cancellationToken);
await oprot.WriteFieldEndAsync(cancellationToken);
}
if((SubStatus != null) && __isset.subStatus)
{
field.Name = "subStatus";
field.Type = TType.List;
field.ID = 3;
await oprot.WriteFieldBeginAsync(field, cancellationToken);
{
await oprot.WriteListBeginAsync(new TList(TType.Struct, SubStatus.Count), cancellationToken);
foreach (TSStatus _iter4 in SubStatus)
{
await _iter4.WriteAsync(oprot, cancellationToken);
}
await oprot.WriteListEndAsync(cancellationToken);
}
await oprot.WriteFieldEndAsync(cancellationToken);
}
if((RedirectNode != null) && __isset.redirectNode)
{
field.Name = "redirectNode";
field.Type = TType.Struct;
field.ID = 4;
await oprot.WriteFieldBeginAsync(field, cancellationToken);
await RedirectNode.WriteAsync(oprot, cancellationToken);
await oprot.WriteFieldEndAsync(cancellationToken);
}
if(__isset.needRetry)
{
field.Name = "needRetry";
field.Type = TType.Bool;
field.ID = 5;
await oprot.WriteFieldBeginAsync(field, cancellationToken);
await oprot.WriteBoolAsync(NeedRetry, 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 TSStatus other)) return false;
if (ReferenceEquals(this, other)) return true;
return System.Object.Equals(Code, other.Code)
&& ((__isset.message == other.__isset.message) && ((!__isset.message) || (System.Object.Equals(Message, other.Message))))
&& ((__isset.subStatus == other.__isset.subStatus) && ((!__isset.subStatus) || (TCollections.Equals(SubStatus, other.SubStatus))))
&& ((__isset.redirectNode == other.__isset.redirectNode) && ((!__isset.redirectNode) || (System.Object.Equals(RedirectNode, other.RedirectNode))))
&& ((__isset.needRetry == other.__isset.needRetry) && ((!__isset.needRetry) || (System.Object.Equals(NeedRetry, other.NeedRetry))));
}
public override int GetHashCode() {
int hashcode = 157;
unchecked {
hashcode = (hashcode * 397) + Code.GetHashCode();
if((Message != null) && __isset.message)
{
hashcode = (hashcode * 397) + Message.GetHashCode();
}
if((SubStatus != null) && __isset.subStatus)
{
hashcode = (hashcode * 397) + TCollections.GetHashCode(SubStatus);
}
if((RedirectNode != null) && __isset.redirectNode)
{
hashcode = (hashcode * 397) + RedirectNode.GetHashCode();
}
if(__isset.needRetry)
{
hashcode = (hashcode * 397) + NeedRetry.GetHashCode();
}
}
return hashcode;
}
public override string ToString()
{
var sb = new StringBuilder("TSStatus(");
sb.Append(", Code: ");
Code.ToString(sb);
if((Message != null) && __isset.message)
{
sb.Append(", Message: ");
Message.ToString(sb);
}
if((SubStatus != null) && __isset.subStatus)
{
sb.Append(", SubStatus: ");
SubStatus.ToString(sb);
}
if((RedirectNode != null) && __isset.redirectNode)
{
sb.Append(", RedirectNode: ");
RedirectNode.ToString(sb);
}
if(__isset.needRetry)
{
sb.Append(", NeedRetry: ");
NeedRetry.ToString(sb);
}
sb.Append(')');
return sb.ToString();
}
}