blob: 2ec20289d24aab5798f606f12f2f6b7762a0c8bf [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 TSCreateAlignedTimeseriesReq : TBase
{
private List<string> _measurementAlias;
private List<Dictionary<string, string>> _tagsList;
private List<Dictionary<string, string>> _attributesList;
public long SessionId { get; set; }
public string PrefixPath { get; set; }
public List<string> Measurements { get; set; }
public List<int> DataTypes { get; set; }
public List<int> Encodings { get; set; }
public List<int> Compressors { get; set; }
public List<string> MeasurementAlias
{
get
{
return _measurementAlias;
}
set
{
__isset.measurementAlias = true;
this._measurementAlias = value;
}
}
public List<Dictionary<string, string>> TagsList
{
get
{
return _tagsList;
}
set
{
__isset.tagsList = true;
this._tagsList = value;
}
}
public List<Dictionary<string, string>> AttributesList
{
get
{
return _attributesList;
}
set
{
__isset.attributesList = true;
this._attributesList = value;
}
}
public Isset __isset;
public struct Isset
{
public bool measurementAlias;
public bool tagsList;
public bool attributesList;
}
public TSCreateAlignedTimeseriesReq()
{
}
public TSCreateAlignedTimeseriesReq(long sessionId, string prefixPath, List<string> measurements, List<int> dataTypes, List<int> encodings, List<int> compressors) : this()
{
this.SessionId = sessionId;
this.PrefixPath = prefixPath;
this.Measurements = measurements;
this.DataTypes = dataTypes;
this.Encodings = encodings;
this.Compressors = compressors;
}
public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
{
iprot.IncrementRecursionDepth();
try
{
bool isset_sessionId = false;
bool isset_prefixPath = false;
bool isset_measurements = false;
bool isset_dataTypes = false;
bool isset_encodings = false;
bool isset_compressors = 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.I64)
{
SessionId = await iprot.ReadI64Async(cancellationToken);
isset_sessionId = true;
}
else
{
await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
}
break;
case 2:
if (field.Type == TType.String)
{
PrefixPath = await iprot.ReadStringAsync(cancellationToken);
isset_prefixPath = true;
}
else
{
await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
}
break;
case 3:
if (field.Type == TType.List)
{
{
TList _list250 = await iprot.ReadListBeginAsync(cancellationToken);
Measurements = new List<string>(_list250.Count);
for(int _i251 = 0; _i251 < _list250.Count; ++_i251)
{
string _elem252;
_elem252 = await iprot.ReadStringAsync(cancellationToken);
Measurements.Add(_elem252);
}
await iprot.ReadListEndAsync(cancellationToken);
}
isset_measurements = true;
}
else
{
await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
}
break;
case 4:
if (field.Type == TType.List)
{
{
TList _list253 = await iprot.ReadListBeginAsync(cancellationToken);
DataTypes = new List<int>(_list253.Count);
for(int _i254 = 0; _i254 < _list253.Count; ++_i254)
{
int _elem255;
_elem255 = await iprot.ReadI32Async(cancellationToken);
DataTypes.Add(_elem255);
}
await iprot.ReadListEndAsync(cancellationToken);
}
isset_dataTypes = true;
}
else
{
await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
}
break;
case 5:
if (field.Type == TType.List)
{
{
TList _list256 = await iprot.ReadListBeginAsync(cancellationToken);
Encodings = new List<int>(_list256.Count);
for(int _i257 = 0; _i257 < _list256.Count; ++_i257)
{
int _elem258;
_elem258 = await iprot.ReadI32Async(cancellationToken);
Encodings.Add(_elem258);
}
await iprot.ReadListEndAsync(cancellationToken);
}
isset_encodings = true;
}
else
{
await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
}
break;
case 6:
if (field.Type == TType.List)
{
{
TList _list259 = await iprot.ReadListBeginAsync(cancellationToken);
Compressors = new List<int>(_list259.Count);
for(int _i260 = 0; _i260 < _list259.Count; ++_i260)
{
int _elem261;
_elem261 = await iprot.ReadI32Async(cancellationToken);
Compressors.Add(_elem261);
}
await iprot.ReadListEndAsync(cancellationToken);
}
isset_compressors = true;
}
else
{
await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
}
break;
case 7:
if (field.Type == TType.List)
{
{
TList _list262 = await iprot.ReadListBeginAsync(cancellationToken);
MeasurementAlias = new List<string>(_list262.Count);
for(int _i263 = 0; _i263 < _list262.Count; ++_i263)
{
string _elem264;
_elem264 = await iprot.ReadStringAsync(cancellationToken);
MeasurementAlias.Add(_elem264);
}
await iprot.ReadListEndAsync(cancellationToken);
}
}
else
{
await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
}
break;
case 8:
if (field.Type == TType.List)
{
{
TList _list265 = await iprot.ReadListBeginAsync(cancellationToken);
TagsList = new List<Dictionary<string, string>>(_list265.Count);
for(int _i266 = 0; _i266 < _list265.Count; ++_i266)
{
Dictionary<string, string> _elem267;
{
TMap _map268 = await iprot.ReadMapBeginAsync(cancellationToken);
_elem267 = new Dictionary<string, string>(_map268.Count);
for(int _i269 = 0; _i269 < _map268.Count; ++_i269)
{
string _key270;
string _val271;
_key270 = await iprot.ReadStringAsync(cancellationToken);
_val271 = await iprot.ReadStringAsync(cancellationToken);
_elem267[_key270] = _val271;
}
await iprot.ReadMapEndAsync(cancellationToken);
}
TagsList.Add(_elem267);
}
await iprot.ReadListEndAsync(cancellationToken);
}
}
else
{
await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
}
break;
case 9:
if (field.Type == TType.List)
{
{
TList _list272 = await iprot.ReadListBeginAsync(cancellationToken);
AttributesList = new List<Dictionary<string, string>>(_list272.Count);
for(int _i273 = 0; _i273 < _list272.Count; ++_i273)
{
Dictionary<string, string> _elem274;
{
TMap _map275 = await iprot.ReadMapBeginAsync(cancellationToken);
_elem274 = new Dictionary<string, string>(_map275.Count);
for(int _i276 = 0; _i276 < _map275.Count; ++_i276)
{
string _key277;
string _val278;
_key277 = await iprot.ReadStringAsync(cancellationToken);
_val278 = await iprot.ReadStringAsync(cancellationToken);
_elem274[_key277] = _val278;
}
await iprot.ReadMapEndAsync(cancellationToken);
}
AttributesList.Add(_elem274);
}
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_sessionId)
{
throw new TProtocolException(TProtocolException.INVALID_DATA);
}
if (!isset_prefixPath)
{
throw new TProtocolException(TProtocolException.INVALID_DATA);
}
if (!isset_measurements)
{
throw new TProtocolException(TProtocolException.INVALID_DATA);
}
if (!isset_dataTypes)
{
throw new TProtocolException(TProtocolException.INVALID_DATA);
}
if (!isset_encodings)
{
throw new TProtocolException(TProtocolException.INVALID_DATA);
}
if (!isset_compressors)
{
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("TSCreateAlignedTimeseriesReq");
await oprot.WriteStructBeginAsync(struc, cancellationToken);
var field = new TField();
field.Name = "sessionId";
field.Type = TType.I64;
field.ID = 1;
await oprot.WriteFieldBeginAsync(field, cancellationToken);
await oprot.WriteI64Async(SessionId, cancellationToken);
await oprot.WriteFieldEndAsync(cancellationToken);
if((PrefixPath != null))
{
field.Name = "prefixPath";
field.Type = TType.String;
field.ID = 2;
await oprot.WriteFieldBeginAsync(field, cancellationToken);
await oprot.WriteStringAsync(PrefixPath, cancellationToken);
await oprot.WriteFieldEndAsync(cancellationToken);
}
if((Measurements != null))
{
field.Name = "measurements";
field.Type = TType.List;
field.ID = 3;
await oprot.WriteFieldBeginAsync(field, cancellationToken);
{
await oprot.WriteListBeginAsync(new TList(TType.String, Measurements.Count), cancellationToken);
foreach (string _iter279 in Measurements)
{
await oprot.WriteStringAsync(_iter279, cancellationToken);
}
await oprot.WriteListEndAsync(cancellationToken);
}
await oprot.WriteFieldEndAsync(cancellationToken);
}
if((DataTypes != null))
{
field.Name = "dataTypes";
field.Type = TType.List;
field.ID = 4;
await oprot.WriteFieldBeginAsync(field, cancellationToken);
{
await oprot.WriteListBeginAsync(new TList(TType.I32, DataTypes.Count), cancellationToken);
foreach (int _iter280 in DataTypes)
{
await oprot.WriteI32Async(_iter280, cancellationToken);
}
await oprot.WriteListEndAsync(cancellationToken);
}
await oprot.WriteFieldEndAsync(cancellationToken);
}
if((Encodings != null))
{
field.Name = "encodings";
field.Type = TType.List;
field.ID = 5;
await oprot.WriteFieldBeginAsync(field, cancellationToken);
{
await oprot.WriteListBeginAsync(new TList(TType.I32, Encodings.Count), cancellationToken);
foreach (int _iter281 in Encodings)
{
await oprot.WriteI32Async(_iter281, cancellationToken);
}
await oprot.WriteListEndAsync(cancellationToken);
}
await oprot.WriteFieldEndAsync(cancellationToken);
}
if((Compressors != null))
{
field.Name = "compressors";
field.Type = TType.List;
field.ID = 6;
await oprot.WriteFieldBeginAsync(field, cancellationToken);
{
await oprot.WriteListBeginAsync(new TList(TType.I32, Compressors.Count), cancellationToken);
foreach (int _iter282 in Compressors)
{
await oprot.WriteI32Async(_iter282, cancellationToken);
}
await oprot.WriteListEndAsync(cancellationToken);
}
await oprot.WriteFieldEndAsync(cancellationToken);
}
if((MeasurementAlias != null) && __isset.measurementAlias)
{
field.Name = "measurementAlias";
field.Type = TType.List;
field.ID = 7;
await oprot.WriteFieldBeginAsync(field, cancellationToken);
{
await oprot.WriteListBeginAsync(new TList(TType.String, MeasurementAlias.Count), cancellationToken);
foreach (string _iter283 in MeasurementAlias)
{
await oprot.WriteStringAsync(_iter283, cancellationToken);
}
await oprot.WriteListEndAsync(cancellationToken);
}
await oprot.WriteFieldEndAsync(cancellationToken);
}
if((TagsList != null) && __isset.tagsList)
{
field.Name = "tagsList";
field.Type = TType.List;
field.ID = 8;
await oprot.WriteFieldBeginAsync(field, cancellationToken);
{
await oprot.WriteListBeginAsync(new TList(TType.Map, TagsList.Count), cancellationToken);
foreach (Dictionary<string, string> _iter284 in TagsList)
{
{
await oprot.WriteMapBeginAsync(new TMap(TType.String, TType.String, _iter284.Count), cancellationToken);
foreach (string _iter285 in _iter284.Keys)
{
await oprot.WriteStringAsync(_iter285, cancellationToken);
await oprot.WriteStringAsync(_iter284[_iter285], cancellationToken);
}
await oprot.WriteMapEndAsync(cancellationToken);
}
}
await oprot.WriteListEndAsync(cancellationToken);
}
await oprot.WriteFieldEndAsync(cancellationToken);
}
if((AttributesList != null) && __isset.attributesList)
{
field.Name = "attributesList";
field.Type = TType.List;
field.ID = 9;
await oprot.WriteFieldBeginAsync(field, cancellationToken);
{
await oprot.WriteListBeginAsync(new TList(TType.Map, AttributesList.Count), cancellationToken);
foreach (Dictionary<string, string> _iter286 in AttributesList)
{
{
await oprot.WriteMapBeginAsync(new TMap(TType.String, TType.String, _iter286.Count), cancellationToken);
foreach (string _iter287 in _iter286.Keys)
{
await oprot.WriteStringAsync(_iter287, cancellationToken);
await oprot.WriteStringAsync(_iter286[_iter287], cancellationToken);
}
await oprot.WriteMapEndAsync(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 TSCreateAlignedTimeseriesReq other)) return false;
if (ReferenceEquals(this, other)) return true;
return System.Object.Equals(SessionId, other.SessionId)
&& System.Object.Equals(PrefixPath, other.PrefixPath)
&& TCollections.Equals(Measurements, other.Measurements)
&& TCollections.Equals(DataTypes, other.DataTypes)
&& TCollections.Equals(Encodings, other.Encodings)
&& TCollections.Equals(Compressors, other.Compressors)
&& ((__isset.measurementAlias == other.__isset.measurementAlias) && ((!__isset.measurementAlias) || (TCollections.Equals(MeasurementAlias, other.MeasurementAlias))))
&& ((__isset.tagsList == other.__isset.tagsList) && ((!__isset.tagsList) || (TCollections.Equals(TagsList, other.TagsList))))
&& ((__isset.attributesList == other.__isset.attributesList) && ((!__isset.attributesList) || (TCollections.Equals(AttributesList, other.AttributesList))));
}
public override int GetHashCode() {
int hashcode = 157;
unchecked {
hashcode = (hashcode * 397) + SessionId.GetHashCode();
if((PrefixPath != null))
{
hashcode = (hashcode * 397) + PrefixPath.GetHashCode();
}
if((Measurements != null))
{
hashcode = (hashcode * 397) + TCollections.GetHashCode(Measurements);
}
if((DataTypes != null))
{
hashcode = (hashcode * 397) + TCollections.GetHashCode(DataTypes);
}
if((Encodings != null))
{
hashcode = (hashcode * 397) + TCollections.GetHashCode(Encodings);
}
if((Compressors != null))
{
hashcode = (hashcode * 397) + TCollections.GetHashCode(Compressors);
}
if((MeasurementAlias != null) && __isset.measurementAlias)
{
hashcode = (hashcode * 397) + TCollections.GetHashCode(MeasurementAlias);
}
if((TagsList != null) && __isset.tagsList)
{
hashcode = (hashcode * 397) + TCollections.GetHashCode(TagsList);
}
if((AttributesList != null) && __isset.attributesList)
{
hashcode = (hashcode * 397) + TCollections.GetHashCode(AttributesList);
}
}
return hashcode;
}
public override string ToString()
{
var sb = new StringBuilder("TSCreateAlignedTimeseriesReq(");
sb.Append(", SessionId: ");
SessionId.ToString(sb);
if((PrefixPath != null))
{
sb.Append(", PrefixPath: ");
PrefixPath.ToString(sb);
}
if((Measurements != null))
{
sb.Append(", Measurements: ");
Measurements.ToString(sb);
}
if((DataTypes != null))
{
sb.Append(", DataTypes: ");
DataTypes.ToString(sb);
}
if((Encodings != null))
{
sb.Append(", Encodings: ");
Encodings.ToString(sb);
}
if((Compressors != null))
{
sb.Append(", Compressors: ");
Compressors.ToString(sb);
}
if((MeasurementAlias != null) && __isset.measurementAlias)
{
sb.Append(", MeasurementAlias: ");
MeasurementAlias.ToString(sb);
}
if((TagsList != null) && __isset.tagsList)
{
sb.Append(", TagsList: ");
TagsList.ToString(sb);
}
if((AttributesList != null) && __isset.attributesList)
{
sb.Append(", AttributesList: ");
AttributesList.ToString(sb);
}
sb.Append(')');
return sb.ToString();
}
}