blob: 907ba23b1f28e93747cdeddaf339888b6a332a13 [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 TSetTTLReq : TBase
{
public List<string> PathPattern { get; set; }
public long TTL { get; set; }
public bool IsDataBase { get; set; }
public TSetTTLReq()
{
}
public TSetTTLReq(List<string> pathPattern, long TTL, bool isDataBase) : this()
{
this.PathPattern = pathPattern;
this.TTL = TTL;
this.IsDataBase = isDataBase;
}
public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
{
iprot.IncrementRecursionDepth();
try
{
bool isset_pathPattern = false;
bool isset_TTL = false;
bool isset_isDataBase = 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.List)
{
{
TList _list41 = await iprot.ReadListBeginAsync(cancellationToken);
PathPattern = new List<string>(_list41.Count);
for(int _i42 = 0; _i42 < _list41.Count; ++_i42)
{
string _elem43;
_elem43 = await iprot.ReadStringAsync(cancellationToken);
PathPattern.Add(_elem43);
}
await iprot.ReadListEndAsync(cancellationToken);
}
isset_pathPattern = true;
}
else
{
await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
}
break;
case 2:
if (field.Type == TType.I64)
{
TTL = await iprot.ReadI64Async(cancellationToken);
isset_TTL = true;
}
else
{
await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
}
break;
case 3:
if (field.Type == TType.Bool)
{
IsDataBase = await iprot.ReadBoolAsync(cancellationToken);
isset_isDataBase = 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_pathPattern)
{
throw new TProtocolException(TProtocolException.INVALID_DATA);
}
if (!isset_TTL)
{
throw new TProtocolException(TProtocolException.INVALID_DATA);
}
if (!isset_isDataBase)
{
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("TSetTTLReq");
await oprot.WriteStructBeginAsync(struc, cancellationToken);
var field = new TField();
if((PathPattern != null))
{
field.Name = "pathPattern";
field.Type = TType.List;
field.ID = 1;
await oprot.WriteFieldBeginAsync(field, cancellationToken);
{
await oprot.WriteListBeginAsync(new TList(TType.String, PathPattern.Count), cancellationToken);
foreach (string _iter44 in PathPattern)
{
await oprot.WriteStringAsync(_iter44, cancellationToken);
}
await oprot.WriteListEndAsync(cancellationToken);
}
await oprot.WriteFieldEndAsync(cancellationToken);
}
field.Name = "TTL";
field.Type = TType.I64;
field.ID = 2;
await oprot.WriteFieldBeginAsync(field, cancellationToken);
await oprot.WriteI64Async(TTL, cancellationToken);
await oprot.WriteFieldEndAsync(cancellationToken);
field.Name = "isDataBase";
field.Type = TType.Bool;
field.ID = 3;
await oprot.WriteFieldBeginAsync(field, cancellationToken);
await oprot.WriteBoolAsync(IsDataBase, 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 TSetTTLReq other)) return false;
if (ReferenceEquals(this, other)) return true;
return TCollections.Equals(PathPattern, other.PathPattern)
&& System.Object.Equals(TTL, other.TTL)
&& System.Object.Equals(IsDataBase, other.IsDataBase);
}
public override int GetHashCode() {
int hashcode = 157;
unchecked {
if((PathPattern != null))
{
hashcode = (hashcode * 397) + TCollections.GetHashCode(PathPattern);
}
hashcode = (hashcode * 397) + TTL.GetHashCode();
hashcode = (hashcode * 397) + IsDataBase.GetHashCode();
}
return hashcode;
}
public override string ToString()
{
var sb = new StringBuilder("TSetTTLReq(");
if((PathPattern != null))
{
sb.Append(", PathPattern: ");
PathPattern.ToString(sb);
}
sb.Append(", TTL: ");
TTL.ToString(sb);
sb.Append(", IsDataBase: ");
IsDataBase.ToString(sb);
sb.Append(')');
return sb.ToString();
}
}