595 lines
18 KiB
C#
595 lines
18 KiB
C#
/**
|
|
* <auto-generated>
|
|
* Autogenerated by Thrift Compiler (0.22.0)
|
|
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
|
* </auto-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 Thrift;
|
|
using Thrift.Collections;
|
|
using System.Runtime.Serialization;
|
|
using Thrift.Protocol;
|
|
using Thrift.Protocol.Entities;
|
|
using Thrift.Protocol.Utilities;
|
|
using Thrift.Transport;
|
|
using Thrift.Transport.Client;
|
|
|
|
|
|
#pragma warning disable IDE0079 // remove unnecessary pragmas
|
|
#pragma warning disable IDE0017 // object init can be simplified
|
|
#pragma warning disable IDE0028 // collection init can be simplified
|
|
#pragma warning disable IDE0305 // collection init can be simplified
|
|
#pragma warning disable IDE0034 // simplify default expression
|
|
#pragma warning disable IDE0066 // use switch expression
|
|
#pragma warning disable IDE0090 // simplify new expression
|
|
#pragma warning disable IDE0290 // use primary CTOR
|
|
#pragma warning disable IDE1006 // parts of the code use IDL spelling
|
|
#pragma warning disable CA1822 // empty DeepCopy() methods still non-static
|
|
#pragma warning disable IDE0083 // pattern matching "that is not SomeType" requires net5.0 but we still support earlier versions
|
|
|
|
namespace Byway.Thrift.Data
|
|
{
|
|
|
|
[DataContract(Namespace="")]
|
|
public partial class NickNameRandomDataItem : TBase
|
|
{
|
|
private int _Id;
|
|
private string _EnglishAdjective;
|
|
private string _EnglishNoun;
|
|
private string _ChineseAdjective;
|
|
private string _ChineseNoun;
|
|
private string _ChineseAdjective2;
|
|
private string _PortugueseAdjective;
|
|
private string _PortugueseNoun;
|
|
|
|
[DataMember(Order = 0)]
|
|
public int Id
|
|
{
|
|
get
|
|
{
|
|
return _Id;
|
|
}
|
|
set
|
|
{
|
|
__isset.Id = true;
|
|
this._Id = value;
|
|
}
|
|
}
|
|
|
|
[DataMember(Order = 0)]
|
|
public string EnglishAdjective
|
|
{
|
|
get
|
|
{
|
|
return _EnglishAdjective;
|
|
}
|
|
set
|
|
{
|
|
__isset.EnglishAdjective = true;
|
|
this._EnglishAdjective = value;
|
|
}
|
|
}
|
|
|
|
[DataMember(Order = 0)]
|
|
public string EnglishNoun
|
|
{
|
|
get
|
|
{
|
|
return _EnglishNoun;
|
|
}
|
|
set
|
|
{
|
|
__isset.EnglishNoun = true;
|
|
this._EnglishNoun = value;
|
|
}
|
|
}
|
|
|
|
[DataMember(Order = 0)]
|
|
public string ChineseAdjective
|
|
{
|
|
get
|
|
{
|
|
return _ChineseAdjective;
|
|
}
|
|
set
|
|
{
|
|
__isset.ChineseAdjective = true;
|
|
this._ChineseAdjective = value;
|
|
}
|
|
}
|
|
|
|
[DataMember(Order = 0)]
|
|
public string ChineseNoun
|
|
{
|
|
get
|
|
{
|
|
return _ChineseNoun;
|
|
}
|
|
set
|
|
{
|
|
__isset.ChineseNoun = true;
|
|
this._ChineseNoun = value;
|
|
}
|
|
}
|
|
|
|
[DataMember(Order = 0)]
|
|
public string ChineseAdjective2
|
|
{
|
|
get
|
|
{
|
|
return _ChineseAdjective2;
|
|
}
|
|
set
|
|
{
|
|
__isset.ChineseAdjective2 = true;
|
|
this._ChineseAdjective2 = value;
|
|
}
|
|
}
|
|
|
|
[DataMember(Order = 0)]
|
|
public string PortugueseAdjective
|
|
{
|
|
get
|
|
{
|
|
return _PortugueseAdjective;
|
|
}
|
|
set
|
|
{
|
|
__isset.PortugueseAdjective = true;
|
|
this._PortugueseAdjective = value;
|
|
}
|
|
}
|
|
|
|
[DataMember(Order = 0)]
|
|
public string PortugueseNoun
|
|
{
|
|
get
|
|
{
|
|
return _PortugueseNoun;
|
|
}
|
|
set
|
|
{
|
|
__isset.PortugueseNoun = true;
|
|
this._PortugueseNoun = value;
|
|
}
|
|
}
|
|
|
|
|
|
[DataMember(Order = 1)]
|
|
public Isset __isset;
|
|
[DataContract]
|
|
public struct Isset
|
|
{
|
|
[DataMember]
|
|
public bool Id;
|
|
[DataMember]
|
|
public bool EnglishAdjective;
|
|
[DataMember]
|
|
public bool EnglishNoun;
|
|
[DataMember]
|
|
public bool ChineseAdjective;
|
|
[DataMember]
|
|
public bool ChineseNoun;
|
|
[DataMember]
|
|
public bool ChineseAdjective2;
|
|
[DataMember]
|
|
public bool PortugueseAdjective;
|
|
[DataMember]
|
|
public bool PortugueseNoun;
|
|
}
|
|
|
|
#region XmlSerializer support
|
|
|
|
public bool ShouldSerializeId()
|
|
{
|
|
return __isset.Id;
|
|
}
|
|
|
|
public bool ShouldSerializeEnglishAdjective()
|
|
{
|
|
return __isset.EnglishAdjective;
|
|
}
|
|
|
|
public bool ShouldSerializeEnglishNoun()
|
|
{
|
|
return __isset.EnglishNoun;
|
|
}
|
|
|
|
public bool ShouldSerializeChineseAdjective()
|
|
{
|
|
return __isset.ChineseAdjective;
|
|
}
|
|
|
|
public bool ShouldSerializeChineseNoun()
|
|
{
|
|
return __isset.ChineseNoun;
|
|
}
|
|
|
|
public bool ShouldSerializeChineseAdjective2()
|
|
{
|
|
return __isset.ChineseAdjective2;
|
|
}
|
|
|
|
public bool ShouldSerializePortugueseAdjective()
|
|
{
|
|
return __isset.PortugueseAdjective;
|
|
}
|
|
|
|
public bool ShouldSerializePortugueseNoun()
|
|
{
|
|
return __isset.PortugueseNoun;
|
|
}
|
|
|
|
#endregion XmlSerializer support
|
|
|
|
public NickNameRandomDataItem()
|
|
{
|
|
}
|
|
|
|
public NickNameRandomDataItem DeepCopy()
|
|
{
|
|
var tmp0 = new NickNameRandomDataItem();
|
|
if(__isset.Id)
|
|
{
|
|
tmp0.Id = this.Id;
|
|
}
|
|
tmp0.__isset.Id = this.__isset.Id;
|
|
if((EnglishAdjective != null) && __isset.EnglishAdjective)
|
|
{
|
|
tmp0.EnglishAdjective = this.EnglishAdjective;
|
|
}
|
|
tmp0.__isset.EnglishAdjective = this.__isset.EnglishAdjective;
|
|
if((EnglishNoun != null) && __isset.EnglishNoun)
|
|
{
|
|
tmp0.EnglishNoun = this.EnglishNoun;
|
|
}
|
|
tmp0.__isset.EnglishNoun = this.__isset.EnglishNoun;
|
|
if((ChineseAdjective != null) && __isset.ChineseAdjective)
|
|
{
|
|
tmp0.ChineseAdjective = this.ChineseAdjective;
|
|
}
|
|
tmp0.__isset.ChineseAdjective = this.__isset.ChineseAdjective;
|
|
if((ChineseNoun != null) && __isset.ChineseNoun)
|
|
{
|
|
tmp0.ChineseNoun = this.ChineseNoun;
|
|
}
|
|
tmp0.__isset.ChineseNoun = this.__isset.ChineseNoun;
|
|
if((ChineseAdjective2 != null) && __isset.ChineseAdjective2)
|
|
{
|
|
tmp0.ChineseAdjective2 = this.ChineseAdjective2;
|
|
}
|
|
tmp0.__isset.ChineseAdjective2 = this.__isset.ChineseAdjective2;
|
|
if((PortugueseAdjective != null) && __isset.PortugueseAdjective)
|
|
{
|
|
tmp0.PortugueseAdjective = this.PortugueseAdjective;
|
|
}
|
|
tmp0.__isset.PortugueseAdjective = this.__isset.PortugueseAdjective;
|
|
if((PortugueseNoun != null) && __isset.PortugueseNoun)
|
|
{
|
|
tmp0.PortugueseNoun = this.PortugueseNoun;
|
|
}
|
|
tmp0.__isset.PortugueseNoun = this.__isset.PortugueseNoun;
|
|
return tmp0;
|
|
}
|
|
|
|
public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
|
|
{
|
|
iprot.IncrementRecursionDepth();
|
|
try
|
|
{
|
|
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)
|
|
{
|
|
Id = await iprot.ReadI32Async(cancellationToken);
|
|
}
|
|
else
|
|
{
|
|
await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
|
|
}
|
|
break;
|
|
case 2:
|
|
if (field.Type == TType.String)
|
|
{
|
|
EnglishAdjective = await iprot.ReadStringAsync(cancellationToken);
|
|
}
|
|
else
|
|
{
|
|
await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
|
|
}
|
|
break;
|
|
case 3:
|
|
if (field.Type == TType.String)
|
|
{
|
|
EnglishNoun = await iprot.ReadStringAsync(cancellationToken);
|
|
}
|
|
else
|
|
{
|
|
await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
|
|
}
|
|
break;
|
|
case 4:
|
|
if (field.Type == TType.String)
|
|
{
|
|
ChineseAdjective = await iprot.ReadStringAsync(cancellationToken);
|
|
}
|
|
else
|
|
{
|
|
await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
|
|
}
|
|
break;
|
|
case 5:
|
|
if (field.Type == TType.String)
|
|
{
|
|
ChineseNoun = await iprot.ReadStringAsync(cancellationToken);
|
|
}
|
|
else
|
|
{
|
|
await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
|
|
}
|
|
break;
|
|
case 6:
|
|
if (field.Type == TType.String)
|
|
{
|
|
ChineseAdjective2 = await iprot.ReadStringAsync(cancellationToken);
|
|
}
|
|
else
|
|
{
|
|
await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
|
|
}
|
|
break;
|
|
case 7:
|
|
if (field.Type == TType.String)
|
|
{
|
|
PortugueseAdjective = await iprot.ReadStringAsync(cancellationToken);
|
|
}
|
|
else
|
|
{
|
|
await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
|
|
}
|
|
break;
|
|
case 8:
|
|
if (field.Type == TType.String)
|
|
{
|
|
PortugueseNoun = await iprot.ReadStringAsync(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);
|
|
}
|
|
finally
|
|
{
|
|
iprot.DecrementRecursionDepth();
|
|
}
|
|
}
|
|
|
|
public async global::System.Threading.Tasks.Task WriteAsync(TProtocol oprot, CancellationToken cancellationToken)
|
|
{
|
|
oprot.IncrementRecursionDepth();
|
|
try
|
|
{
|
|
var tmp1 = new TStruct("NickNameRandomDataItem");
|
|
await oprot.WriteStructBeginAsync(tmp1, cancellationToken);
|
|
var tmp2 = new TField();
|
|
if(__isset.Id)
|
|
{
|
|
tmp2.Name = "Id";
|
|
tmp2.Type = TType.I32;
|
|
tmp2.ID = 1;
|
|
await oprot.WriteFieldBeginAsync(tmp2, cancellationToken);
|
|
await oprot.WriteI32Async(Id, cancellationToken);
|
|
await oprot.WriteFieldEndAsync(cancellationToken);
|
|
}
|
|
if((EnglishAdjective != null) && __isset.EnglishAdjective)
|
|
{
|
|
tmp2.Name = "EnglishAdjective";
|
|
tmp2.Type = TType.String;
|
|
tmp2.ID = 2;
|
|
await oprot.WriteFieldBeginAsync(tmp2, cancellationToken);
|
|
await oprot.WriteStringAsync(EnglishAdjective, cancellationToken);
|
|
await oprot.WriteFieldEndAsync(cancellationToken);
|
|
}
|
|
if((EnglishNoun != null) && __isset.EnglishNoun)
|
|
{
|
|
tmp2.Name = "EnglishNoun";
|
|
tmp2.Type = TType.String;
|
|
tmp2.ID = 3;
|
|
await oprot.WriteFieldBeginAsync(tmp2, cancellationToken);
|
|
await oprot.WriteStringAsync(EnglishNoun, cancellationToken);
|
|
await oprot.WriteFieldEndAsync(cancellationToken);
|
|
}
|
|
if((ChineseAdjective != null) && __isset.ChineseAdjective)
|
|
{
|
|
tmp2.Name = "ChineseAdjective";
|
|
tmp2.Type = TType.String;
|
|
tmp2.ID = 4;
|
|
await oprot.WriteFieldBeginAsync(tmp2, cancellationToken);
|
|
await oprot.WriteStringAsync(ChineseAdjective, cancellationToken);
|
|
await oprot.WriteFieldEndAsync(cancellationToken);
|
|
}
|
|
if((ChineseNoun != null) && __isset.ChineseNoun)
|
|
{
|
|
tmp2.Name = "ChineseNoun";
|
|
tmp2.Type = TType.String;
|
|
tmp2.ID = 5;
|
|
await oprot.WriteFieldBeginAsync(tmp2, cancellationToken);
|
|
await oprot.WriteStringAsync(ChineseNoun, cancellationToken);
|
|
await oprot.WriteFieldEndAsync(cancellationToken);
|
|
}
|
|
if((ChineseAdjective2 != null) && __isset.ChineseAdjective2)
|
|
{
|
|
tmp2.Name = "ChineseAdjective2";
|
|
tmp2.Type = TType.String;
|
|
tmp2.ID = 6;
|
|
await oprot.WriteFieldBeginAsync(tmp2, cancellationToken);
|
|
await oprot.WriteStringAsync(ChineseAdjective2, cancellationToken);
|
|
await oprot.WriteFieldEndAsync(cancellationToken);
|
|
}
|
|
if((PortugueseAdjective != null) && __isset.PortugueseAdjective)
|
|
{
|
|
tmp2.Name = "PortugueseAdjective";
|
|
tmp2.Type = TType.String;
|
|
tmp2.ID = 7;
|
|
await oprot.WriteFieldBeginAsync(tmp2, cancellationToken);
|
|
await oprot.WriteStringAsync(PortugueseAdjective, cancellationToken);
|
|
await oprot.WriteFieldEndAsync(cancellationToken);
|
|
}
|
|
if((PortugueseNoun != null) && __isset.PortugueseNoun)
|
|
{
|
|
tmp2.Name = "PortugueseNoun";
|
|
tmp2.Type = TType.String;
|
|
tmp2.ID = 8;
|
|
await oprot.WriteFieldBeginAsync(tmp2, cancellationToken);
|
|
await oprot.WriteStringAsync(PortugueseNoun, 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 NickNameRandomDataItem other)) return false;
|
|
if (ReferenceEquals(this, other)) return true;
|
|
return ((__isset.Id == other.__isset.Id) && ((!__isset.Id) || (global::System.Object.Equals(Id, other.Id))))
|
|
&& ((__isset.EnglishAdjective == other.__isset.EnglishAdjective) && ((!__isset.EnglishAdjective) || (global::System.Object.Equals(EnglishAdjective, other.EnglishAdjective))))
|
|
&& ((__isset.EnglishNoun == other.__isset.EnglishNoun) && ((!__isset.EnglishNoun) || (global::System.Object.Equals(EnglishNoun, other.EnglishNoun))))
|
|
&& ((__isset.ChineseAdjective == other.__isset.ChineseAdjective) && ((!__isset.ChineseAdjective) || (global::System.Object.Equals(ChineseAdjective, other.ChineseAdjective))))
|
|
&& ((__isset.ChineseNoun == other.__isset.ChineseNoun) && ((!__isset.ChineseNoun) || (global::System.Object.Equals(ChineseNoun, other.ChineseNoun))))
|
|
&& ((__isset.ChineseAdjective2 == other.__isset.ChineseAdjective2) && ((!__isset.ChineseAdjective2) || (global::System.Object.Equals(ChineseAdjective2, other.ChineseAdjective2))))
|
|
&& ((__isset.PortugueseAdjective == other.__isset.PortugueseAdjective) && ((!__isset.PortugueseAdjective) || (global::System.Object.Equals(PortugueseAdjective, other.PortugueseAdjective))))
|
|
&& ((__isset.PortugueseNoun == other.__isset.PortugueseNoun) && ((!__isset.PortugueseNoun) || (global::System.Object.Equals(PortugueseNoun, other.PortugueseNoun))));
|
|
}
|
|
|
|
public override int GetHashCode() {
|
|
int hashcode = 157;
|
|
unchecked {
|
|
if(__isset.Id)
|
|
{
|
|
hashcode = (hashcode * 397) + Id.GetHashCode();
|
|
}
|
|
if((EnglishAdjective != null) && __isset.EnglishAdjective)
|
|
{
|
|
hashcode = (hashcode * 397) + EnglishAdjective.GetHashCode();
|
|
}
|
|
if((EnglishNoun != null) && __isset.EnglishNoun)
|
|
{
|
|
hashcode = (hashcode * 397) + EnglishNoun.GetHashCode();
|
|
}
|
|
if((ChineseAdjective != null) && __isset.ChineseAdjective)
|
|
{
|
|
hashcode = (hashcode * 397) + ChineseAdjective.GetHashCode();
|
|
}
|
|
if((ChineseNoun != null) && __isset.ChineseNoun)
|
|
{
|
|
hashcode = (hashcode * 397) + ChineseNoun.GetHashCode();
|
|
}
|
|
if((ChineseAdjective2 != null) && __isset.ChineseAdjective2)
|
|
{
|
|
hashcode = (hashcode * 397) + ChineseAdjective2.GetHashCode();
|
|
}
|
|
if((PortugueseAdjective != null) && __isset.PortugueseAdjective)
|
|
{
|
|
hashcode = (hashcode * 397) + PortugueseAdjective.GetHashCode();
|
|
}
|
|
if((PortugueseNoun != null) && __isset.PortugueseNoun)
|
|
{
|
|
hashcode = (hashcode * 397) + PortugueseNoun.GetHashCode();
|
|
}
|
|
}
|
|
return hashcode;
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
var tmp3 = new StringBuilder("NickNameRandomDataItem(");
|
|
int tmp4 = 0;
|
|
if(__isset.Id)
|
|
{
|
|
if(0 < tmp4++) { tmp3.Append(", "); }
|
|
tmp3.Append("Id: ");
|
|
Id.ToString(tmp3);
|
|
}
|
|
if((EnglishAdjective != null) && __isset.EnglishAdjective)
|
|
{
|
|
if(0 < tmp4++) { tmp3.Append(", "); }
|
|
tmp3.Append("EnglishAdjective: ");
|
|
EnglishAdjective.ToString(tmp3);
|
|
}
|
|
if((EnglishNoun != null) && __isset.EnglishNoun)
|
|
{
|
|
if(0 < tmp4++) { tmp3.Append(", "); }
|
|
tmp3.Append("EnglishNoun: ");
|
|
EnglishNoun.ToString(tmp3);
|
|
}
|
|
if((ChineseAdjective != null) && __isset.ChineseAdjective)
|
|
{
|
|
if(0 < tmp4++) { tmp3.Append(", "); }
|
|
tmp3.Append("ChineseAdjective: ");
|
|
ChineseAdjective.ToString(tmp3);
|
|
}
|
|
if((ChineseNoun != null) && __isset.ChineseNoun)
|
|
{
|
|
if(0 < tmp4++) { tmp3.Append(", "); }
|
|
tmp3.Append("ChineseNoun: ");
|
|
ChineseNoun.ToString(tmp3);
|
|
}
|
|
if((ChineseAdjective2 != null) && __isset.ChineseAdjective2)
|
|
{
|
|
if(0 < tmp4++) { tmp3.Append(", "); }
|
|
tmp3.Append("ChineseAdjective2: ");
|
|
ChineseAdjective2.ToString(tmp3);
|
|
}
|
|
if((PortugueseAdjective != null) && __isset.PortugueseAdjective)
|
|
{
|
|
if(0 < tmp4++) { tmp3.Append(", "); }
|
|
tmp3.Append("PortugueseAdjective: ");
|
|
PortugueseAdjective.ToString(tmp3);
|
|
}
|
|
if((PortugueseNoun != null) && __isset.PortugueseNoun)
|
|
{
|
|
if(0 < tmp4++) { tmp3.Append(", "); }
|
|
tmp3.Append("PortugueseNoun: ");
|
|
PortugueseNoun.ToString(tmp3);
|
|
}
|
|
tmp3.Append(')');
|
|
return tmp3.ToString();
|
|
}
|
|
}
|
|
|
|
}
|