/** * * 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 Address : TBase { private string _line1; private string _line2; private string _city; private string _region; private string _country; private string _postalCode; public string Line1 { get { return _line1; } set { __isset.line1 = true; this._line1 = value; } } public string Line2 { get { return _line2; } set { __isset.line2 = true; this._line2 = value; } } public string City { get { return _city; } set { __isset.@city = true; this._city = value; } } public string Region { get { return _region; } set { __isset.@region = true; this._region = value; } } public string Country { get { return _country; } set { __isset.@country = true; this._country = value; } } public string PostalCode { get { return _postalCode; } set { __isset.postalCode = true; this._postalCode = value; } } public Isset __isset; public struct Isset { public bool line1; public bool line2; public bool @city; public bool @region; public bool @country; public bool postalCode; } public Address() { } public Address DeepCopy() { var tmp15 = new Address(); if((Line1 != null) && __isset.line1) { tmp15.Line1 = this.Line1; } tmp15.__isset.line1 = this.__isset.line1; if((Line2 != null) && __isset.line2) { tmp15.Line2 = this.Line2; } tmp15.__isset.line2 = this.__isset.line2; if((City != null) && __isset.@city) { tmp15.City = this.City; } tmp15.__isset.@city = this.__isset.@city; if((Region != null) && __isset.@region) { tmp15.Region = this.Region; } tmp15.__isset.@region = this.__isset.@region; if((Country != null) && __isset.@country) { tmp15.Country = this.Country; } tmp15.__isset.@country = this.__isset.@country; if((PostalCode != null) && __isset.postalCode) { tmp15.PostalCode = this.PostalCode; } tmp15.__isset.postalCode = this.__isset.postalCode; return tmp15; } 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.String) { Line1 = await iprot.ReadStringAsync(cancellationToken); } else { await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); } break; case 2: if (field.Type == TType.String) { Line2 = await iprot.ReadStringAsync(cancellationToken); } else { await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); } break; case 3: if (field.Type == TType.String) { City = await iprot.ReadStringAsync(cancellationToken); } else { await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); } break; case 4: if (field.Type == TType.String) { Region = await iprot.ReadStringAsync(cancellationToken); } else { await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); } break; case 5: if (field.Type == TType.String) { Country = await iprot.ReadStringAsync(cancellationToken); } else { await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); } break; case 6: if (field.Type == TType.String) { PostalCode = 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 tmp16 = new TStruct("Address"); await oprot.WriteStructBeginAsync(tmp16, cancellationToken); var tmp17 = new TField(); if((Line1 != null) && __isset.line1) { tmp17.Name = "line1"; tmp17.Type = TType.String; tmp17.ID = 1; await oprot.WriteFieldBeginAsync(tmp17, cancellationToken); await oprot.WriteStringAsync(Line1, cancellationToken); await oprot.WriteFieldEndAsync(cancellationToken); } if((Line2 != null) && __isset.line2) { tmp17.Name = "line2"; tmp17.Type = TType.String; tmp17.ID = 2; await oprot.WriteFieldBeginAsync(tmp17, cancellationToken); await oprot.WriteStringAsync(Line2, cancellationToken); await oprot.WriteFieldEndAsync(cancellationToken); } if((City != null) && __isset.@city) { tmp17.Name = "city"; tmp17.Type = TType.String; tmp17.ID = 3; await oprot.WriteFieldBeginAsync(tmp17, cancellationToken); await oprot.WriteStringAsync(City, cancellationToken); await oprot.WriteFieldEndAsync(cancellationToken); } if((Region != null) && __isset.@region) { tmp17.Name = "region"; tmp17.Type = TType.String; tmp17.ID = 4; await oprot.WriteFieldBeginAsync(tmp17, cancellationToken); await oprot.WriteStringAsync(Region, cancellationToken); await oprot.WriteFieldEndAsync(cancellationToken); } if((Country != null) && __isset.@country) { tmp17.Name = "country"; tmp17.Type = TType.String; tmp17.ID = 5; await oprot.WriteFieldBeginAsync(tmp17, cancellationToken); await oprot.WriteStringAsync(Country, cancellationToken); await oprot.WriteFieldEndAsync(cancellationToken); } if((PostalCode != null) && __isset.postalCode) { tmp17.Name = "postalCode"; tmp17.Type = TType.String; tmp17.ID = 6; await oprot.WriteFieldBeginAsync(tmp17, cancellationToken); await oprot.WriteStringAsync(PostalCode, 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 Address other)) return false; if (ReferenceEquals(this, other)) return true; return ((__isset.line1 == other.__isset.line1) && ((!__isset.line1) || (global::System.Object.Equals(Line1, other.Line1)))) && ((__isset.line2 == other.__isset.line2) && ((!__isset.line2) || (global::System.Object.Equals(Line2, other.Line2)))) && ((__isset.@city == other.__isset.@city) && ((!__isset.@city) || (global::System.Object.Equals(City, other.City)))) && ((__isset.@region == other.__isset.@region) && ((!__isset.@region) || (global::System.Object.Equals(Region, other.Region)))) && ((__isset.@country == other.__isset.@country) && ((!__isset.@country) || (global::System.Object.Equals(Country, other.Country)))) && ((__isset.postalCode == other.__isset.postalCode) && ((!__isset.postalCode) || (global::System.Object.Equals(PostalCode, other.PostalCode)))); } public override int GetHashCode() { int hashcode = 157; unchecked { if((Line1 != null) && __isset.line1) { hashcode = (hashcode * 397) + Line1.GetHashCode(); } if((Line2 != null) && __isset.line2) { hashcode = (hashcode * 397) + Line2.GetHashCode(); } if((City != null) && __isset.@city) { hashcode = (hashcode * 397) + City.GetHashCode(); } if((Region != null) && __isset.@region) { hashcode = (hashcode * 397) + Region.GetHashCode(); } if((Country != null) && __isset.@country) { hashcode = (hashcode * 397) + Country.GetHashCode(); } if((PostalCode != null) && __isset.postalCode) { hashcode = (hashcode * 397) + PostalCode.GetHashCode(); } } return hashcode; } public override string ToString() { var tmp18 = new StringBuilder("Address("); int tmp19 = 0; if((Line1 != null) && __isset.line1) { if(0 < tmp19++) { tmp18.Append(", "); } tmp18.Append("Line1: "); Line1.ToString(tmp18); } if((Line2 != null) && __isset.line2) { if(0 < tmp19++) { tmp18.Append(", "); } tmp18.Append("Line2: "); Line2.ToString(tmp18); } if((City != null) && __isset.@city) { if(0 < tmp19++) { tmp18.Append(", "); } tmp18.Append("City: "); City.ToString(tmp18); } if((Region != null) && __isset.@region) { if(0 < tmp19++) { tmp18.Append(", "); } tmp18.Append("Region: "); Region.ToString(tmp18); } if((Country != null) && __isset.@country) { if(0 < tmp19++) { tmp18.Append(", "); } tmp18.Append("Country: "); Country.ToString(tmp18); } if((PostalCode != null) && __isset.postalCode) { if(0 < tmp19++) { tmp18.Append(", "); } tmp18.Append("PostalCode: "); PostalCode.ToString(tmp18); } tmp18.Append(')'); return tmp18.ToString(); } } }