|
| 1 | +/** |
| 2 | + * Autogenerated by Thrift Compiler (0.14.1) |
| 3 | + * |
| 4 | + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING |
| 5 | + * @generated |
| 6 | + */ |
| 7 | +using System; |
| 8 | +using System.Collections; |
| 9 | +using System.Collections.Generic; |
| 10 | +using System.Text; |
| 11 | +using System.IO; |
| 12 | +using System.Linq; |
| 13 | +using System.Threading; |
| 14 | +using System.Threading.Tasks; |
| 15 | +using Microsoft.Extensions.Logging; |
| 16 | +using Thrift; |
| 17 | +using Thrift.Collections; |
| 18 | + |
| 19 | +using Thrift.Protocol; |
| 20 | +using Thrift.Protocol.Entities; |
| 21 | +using Thrift.Protocol.Utilities; |
| 22 | +using Thrift.Transport; |
| 23 | +using Thrift.Transport.Client; |
| 24 | +using Thrift.Transport.Server; |
| 25 | +using Thrift.Processor; |
| 26 | + |
| 27 | + |
| 28 | +#pragma warning disable IDE0079 // remove unnecessary pragmas |
| 29 | +#pragma warning disable IDE1006 // parts of the code use IDL spelling |
| 30 | + |
| 31 | + |
| 32 | +public partial class TAINodeConfiguration : TBase |
| 33 | +{ |
| 34 | + |
| 35 | + public TAINodeLocation Location { get; set; } |
| 36 | + |
| 37 | + public TNodeResource Resource { get; set; } |
| 38 | + |
| 39 | + public TAINodeConfiguration() |
| 40 | + { |
| 41 | + } |
| 42 | + |
| 43 | + public TAINodeConfiguration(TAINodeLocation location, TNodeResource resource) : this() |
| 44 | + { |
| 45 | + this.Location = location; |
| 46 | + this.Resource = resource; |
| 47 | + } |
| 48 | + |
| 49 | + public TAINodeConfiguration DeepCopy() |
| 50 | + { |
| 51 | + var tmp30 = new TAINodeConfiguration(); |
| 52 | + if((Location != null)) |
| 53 | + { |
| 54 | + tmp30.Location = (TAINodeLocation)this.Location.DeepCopy(); |
| 55 | + } |
| 56 | + if((Resource != null)) |
| 57 | + { |
| 58 | + tmp30.Resource = (TNodeResource)this.Resource.DeepCopy(); |
| 59 | + } |
| 60 | + return tmp30; |
| 61 | + } |
| 62 | + |
| 63 | + public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) |
| 64 | + { |
| 65 | + iprot.IncrementRecursionDepth(); |
| 66 | + try |
| 67 | + { |
| 68 | + bool isset_location = false; |
| 69 | + bool isset_resource = false; |
| 70 | + TField field; |
| 71 | + await iprot.ReadStructBeginAsync(cancellationToken); |
| 72 | + while (true) |
| 73 | + { |
| 74 | + field = await iprot.ReadFieldBeginAsync(cancellationToken); |
| 75 | + if (field.Type == TType.Stop) |
| 76 | + { |
| 77 | + break; |
| 78 | + } |
| 79 | + |
| 80 | + switch (field.ID) |
| 81 | + { |
| 82 | + case 1: |
| 83 | + if (field.Type == TType.Struct) |
| 84 | + { |
| 85 | + Location = new TAINodeLocation(); |
| 86 | + await Location.ReadAsync(iprot, cancellationToken); |
| 87 | + isset_location = true; |
| 88 | + } |
| 89 | + else |
| 90 | + { |
| 91 | + await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); |
| 92 | + } |
| 93 | + break; |
| 94 | + case 2: |
| 95 | + if (field.Type == TType.Struct) |
| 96 | + { |
| 97 | + Resource = new TNodeResource(); |
| 98 | + await Resource.ReadAsync(iprot, cancellationToken); |
| 99 | + isset_resource = true; |
| 100 | + } |
| 101 | + else |
| 102 | + { |
| 103 | + await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); |
| 104 | + } |
| 105 | + break; |
| 106 | + default: |
| 107 | + await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); |
| 108 | + break; |
| 109 | + } |
| 110 | + |
| 111 | + await iprot.ReadFieldEndAsync(cancellationToken); |
| 112 | + } |
| 113 | + |
| 114 | + await iprot.ReadStructEndAsync(cancellationToken); |
| 115 | + if (!isset_location) |
| 116 | + { |
| 117 | + throw new TProtocolException(TProtocolException.INVALID_DATA); |
| 118 | + } |
| 119 | + if (!isset_resource) |
| 120 | + { |
| 121 | + throw new TProtocolException(TProtocolException.INVALID_DATA); |
| 122 | + } |
| 123 | + } |
| 124 | + finally |
| 125 | + { |
| 126 | + iprot.DecrementRecursionDepth(); |
| 127 | + } |
| 128 | + } |
| 129 | + |
| 130 | + public async global::System.Threading.Tasks.Task WriteAsync(TProtocol oprot, CancellationToken cancellationToken) |
| 131 | + { |
| 132 | + oprot.IncrementRecursionDepth(); |
| 133 | + try |
| 134 | + { |
| 135 | + var struc = new TStruct("TAINodeConfiguration"); |
| 136 | + await oprot.WriteStructBeginAsync(struc, cancellationToken); |
| 137 | + var field = new TField(); |
| 138 | + if((Location != null)) |
| 139 | + { |
| 140 | + field.Name = "location"; |
| 141 | + field.Type = TType.Struct; |
| 142 | + field.ID = 1; |
| 143 | + await oprot.WriteFieldBeginAsync(field, cancellationToken); |
| 144 | + await Location.WriteAsync(oprot, cancellationToken); |
| 145 | + await oprot.WriteFieldEndAsync(cancellationToken); |
| 146 | + } |
| 147 | + if((Resource != null)) |
| 148 | + { |
| 149 | + field.Name = "resource"; |
| 150 | + field.Type = TType.Struct; |
| 151 | + field.ID = 2; |
| 152 | + await oprot.WriteFieldBeginAsync(field, cancellationToken); |
| 153 | + await Resource.WriteAsync(oprot, cancellationToken); |
| 154 | + await oprot.WriteFieldEndAsync(cancellationToken); |
| 155 | + } |
| 156 | + await oprot.WriteFieldStopAsync(cancellationToken); |
| 157 | + await oprot.WriteStructEndAsync(cancellationToken); |
| 158 | + } |
| 159 | + finally |
| 160 | + { |
| 161 | + oprot.DecrementRecursionDepth(); |
| 162 | + } |
| 163 | + } |
| 164 | + |
| 165 | + public override bool Equals(object that) |
| 166 | + { |
| 167 | + if (!(that is TAINodeConfiguration other)) return false; |
| 168 | + if (ReferenceEquals(this, other)) return true; |
| 169 | + return System.Object.Equals(Location, other.Location) |
| 170 | + && System.Object.Equals(Resource, other.Resource); |
| 171 | + } |
| 172 | + |
| 173 | + public override int GetHashCode() { |
| 174 | + int hashcode = 157; |
| 175 | + unchecked { |
| 176 | + if((Location != null)) |
| 177 | + { |
| 178 | + hashcode = (hashcode * 397) + Location.GetHashCode(); |
| 179 | + } |
| 180 | + if((Resource != null)) |
| 181 | + { |
| 182 | + hashcode = (hashcode * 397) + Resource.GetHashCode(); |
| 183 | + } |
| 184 | + } |
| 185 | + return hashcode; |
| 186 | + } |
| 187 | + |
| 188 | + public override string ToString() |
| 189 | + { |
| 190 | + var sb = new StringBuilder("TAINodeConfiguration("); |
| 191 | + if((Location != null)) |
| 192 | + { |
| 193 | + sb.Append(", Location: "); |
| 194 | + Location.ToString(sb); |
| 195 | + } |
| 196 | + if((Resource != null)) |
| 197 | + { |
| 198 | + sb.Append(", Resource: "); |
| 199 | + Resource.ToString(sb); |
| 200 | + } |
| 201 | + sb.Append(')'); |
| 202 | + return sb.ToString(); |
| 203 | + } |
| 204 | +} |
| 205 | + |
0 commit comments