/** * * Autogenerated by Thrift Compiler (0.19.0) * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * */ 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 IDE0017 // object init can be simplified #pragma warning disable IDE0028 // collection init can be simplified #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 Echo.ThriftModel { public partial class Payment : TBase { private global::Echo.ThriftModel.PaymentMethod _method; private double _amount; private string _reference; private long _timestamp; private double _fee; private global::Echo.ThriftModel.Currency _currency; /// /// /// /// public global::Echo.ThriftModel.PaymentMethod Method { get { return _method; } set { __isset.@method = true; this._method = value; } } public double Amount { get { return _amount; } set { __isset.@amount = true; this._amount = value; } } public string Reference { get { return _reference; } set { __isset.@reference = true; this._reference = value; } } public long Timestamp { get { return _timestamp; } set { __isset.@timestamp = true; this._timestamp = value; } } public double Fee { get { return _fee; } set { __isset.@fee = true; this._fee = value; } } /// /// /// /// public global::Echo.ThriftModel.Currency Currency { get { return _currency; } set { __isset.@currency = true; this._currency = value; } } public Isset __isset; public struct Isset { public bool @method; public bool @amount; public bool @reference; public bool @timestamp; public bool @fee; public bool @currency; } public Payment() { } public Payment DeepCopy() { var tmp45 = new Payment(); if(__isset.@method) { tmp45.Method = this.Method; } tmp45.__isset.@method = this.__isset.@method; if(__isset.@amount) { tmp45.Amount = this.Amount; } tmp45.__isset.@amount = this.__isset.@amount; if((Reference != null) && __isset.@reference) { tmp45.Reference = this.Reference; } tmp45.__isset.@reference = this.__isset.@reference; if(__isset.@timestamp) { tmp45.Timestamp = this.Timestamp; } tmp45.__isset.@timestamp = this.__isset.@timestamp; if(__isset.@fee) { tmp45.Fee = this.Fee; } tmp45.__isset.@fee = this.__isset.@fee; if(__isset.@currency) { tmp45.Currency = this.Currency; } tmp45.__isset.@currency = this.__isset.@currency; return tmp45; } 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) { Method = (global::Echo.ThriftModel.PaymentMethod)await iprot.ReadI32Async(cancellationToken); } else { await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); } break; case 2: if (field.Type == TType.Double) { Amount = await iprot.ReadDoubleAsync(cancellationToken); } else { await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); } break; case 3: if (field.Type == TType.String) { Reference = await iprot.ReadStringAsync(cancellationToken); } else { await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); } break; case 4: if (field.Type == TType.I64) { Timestamp = await iprot.ReadI64Async(cancellationToken); } else { await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); } break; case 5: if (field.Type == TType.Double) { Fee = await iprot.ReadDoubleAsync(cancellationToken); } else { await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); } break; case 6: if (field.Type == TType.I32) { Currency = (global::Echo.ThriftModel.Currency)await iprot.ReadI32Async(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 tmp46 = new TStruct("Payment"); await oprot.WriteStructBeginAsync(tmp46, cancellationToken); var tmp47 = new TField(); if(__isset.@method) { tmp47.Name = "method"; tmp47.Type = TType.I32; tmp47.ID = 1; await oprot.WriteFieldBeginAsync(tmp47, cancellationToken); await oprot.WriteI32Async((int)Method, cancellationToken); await oprot.WriteFieldEndAsync(cancellationToken); } if(__isset.@amount) { tmp47.Name = "amount"; tmp47.Type = TType.Double; tmp47.ID = 2; await oprot.WriteFieldBeginAsync(tmp47, cancellationToken); await oprot.WriteDoubleAsync(Amount, cancellationToken); await oprot.WriteFieldEndAsync(cancellationToken); } if((Reference != null) && __isset.@reference) { tmp47.Name = "reference"; tmp47.Type = TType.String; tmp47.ID = 3; await oprot.WriteFieldBeginAsync(tmp47, cancellationToken); await oprot.WriteStringAsync(Reference, cancellationToken); await oprot.WriteFieldEndAsync(cancellationToken); } if(__isset.@timestamp) { tmp47.Name = "timestamp"; tmp47.Type = TType.I64; tmp47.ID = 4; await oprot.WriteFieldBeginAsync(tmp47, cancellationToken); await oprot.WriteI64Async(Timestamp, cancellationToken); await oprot.WriteFieldEndAsync(cancellationToken); } if(__isset.@fee) { tmp47.Name = "fee"; tmp47.Type = TType.Double; tmp47.ID = 5; await oprot.WriteFieldBeginAsync(tmp47, cancellationToken); await oprot.WriteDoubleAsync(Fee, cancellationToken); await oprot.WriteFieldEndAsync(cancellationToken); } if(__isset.@currency) { tmp47.Name = "currency"; tmp47.Type = TType.I32; tmp47.ID = 6; await oprot.WriteFieldBeginAsync(tmp47, cancellationToken); await oprot.WriteI32Async((int)Currency, 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 Payment other)) return false; if (ReferenceEquals(this, other)) return true; return ((__isset.@method == other.__isset.@method) && ((!__isset.@method) || (global::System.Object.Equals(Method, other.Method)))) && ((__isset.@amount == other.__isset.@amount) && ((!__isset.@amount) || (global::System.Object.Equals(Amount, other.Amount)))) && ((__isset.@reference == other.__isset.@reference) && ((!__isset.@reference) || (global::System.Object.Equals(Reference, other.Reference)))) && ((__isset.@timestamp == other.__isset.@timestamp) && ((!__isset.@timestamp) || (global::System.Object.Equals(Timestamp, other.Timestamp)))) && ((__isset.@fee == other.__isset.@fee) && ((!__isset.@fee) || (global::System.Object.Equals(Fee, other.Fee)))) && ((__isset.@currency == other.__isset.@currency) && ((!__isset.@currency) || (global::System.Object.Equals(Currency, other.Currency)))); } public override int GetHashCode() { int hashcode = 157; unchecked { if(__isset.@method) { hashcode = (hashcode * 397) + Method.GetHashCode(); } if(__isset.@amount) { hashcode = (hashcode * 397) + Amount.GetHashCode(); } if((Reference != null) && __isset.@reference) { hashcode = (hashcode * 397) + Reference.GetHashCode(); } if(__isset.@timestamp) { hashcode = (hashcode * 397) + Timestamp.GetHashCode(); } if(__isset.@fee) { hashcode = (hashcode * 397) + Fee.GetHashCode(); } if(__isset.@currency) { hashcode = (hashcode * 397) + Currency.GetHashCode(); } } return hashcode; } public override string ToString() { var tmp48 = new StringBuilder("Payment("); int tmp49 = 0; if(__isset.@method) { if(0 < tmp49++) { tmp48.Append(", "); } tmp48.Append("Method: "); Method.ToString(tmp48); } if(__isset.@amount) { if(0 < tmp49++) { tmp48.Append(", "); } tmp48.Append("Amount: "); Amount.ToString(tmp48); } if((Reference != null) && __isset.@reference) { if(0 < tmp49++) { tmp48.Append(", "); } tmp48.Append("Reference: "); Reference.ToString(tmp48); } if(__isset.@timestamp) { if(0 < tmp49++) { tmp48.Append(", "); } tmp48.Append("Timestamp: "); Timestamp.ToString(tmp48); } if(__isset.@fee) { if(0 < tmp49++) { tmp48.Append(", "); } tmp48.Append("Fee: "); Fee.ToString(tmp48); } if(__isset.@currency) { if(0 < tmp49++) { tmp48.Append(", "); } tmp48.Append("Currency: "); Currency.ToString(tmp48); } tmp48.Append(')'); return tmp48.ToString(); } } }