public void Read(TProtocol iprot) { iprot.IncrementRecursionDepth(); try { TField field; iprot.ReadStructBegin(); while (true) { field = iprot.ReadFieldBegin(); if (field.Type == TType.Stop) { break; } switch (field.ID) { case 1: if (field.Type == TType.List) { { CurrencyExchangeRates = new List <PaidCallCurrencyExchangeRate>(); TList _list95 = iprot.ReadListBegin(); for (int _i96 = 0; _i96 < _list95.Count; ++_i96) { PaidCallCurrencyExchangeRate _elem97; _elem97 = new PaidCallCurrencyExchangeRate(); _elem97.Read(iprot); CurrencyExchangeRates.Add(_elem97); } iprot.ReadListEnd(); } } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 2: if (field.Type == TType.List) { { RecommendedCountryCodes = new List <string>(); TList _list98 = iprot.ReadListBegin(); for (int _i99 = 0; _i99 < _list98.Count; ++_i99) { string _elem100; _elem100 = iprot.ReadString(); RecommendedCountryCodes.Add(_elem100); } iprot.ReadListEnd(); } } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 3: if (field.Type == TType.List) { { AdCountries = new List <PaidCallAdCountry>(); TList _list101 = iprot.ReadListBegin(); for (int _i102 = 0; _i102 < _list101.Count; ++_i102) { PaidCallAdCountry _elem103; _elem103 = new PaidCallAdCountry(); _elem103.Read(iprot); AdCountries.Add(_elem103); } iprot.ReadListEnd(); } } else { TProtocolUtil.Skip(iprot, field.Type); } break; default: TProtocolUtil.Skip(iprot, field.Type); break; } iprot.ReadFieldEnd(); } iprot.ReadStructEnd(); } finally { iprot.DecrementRecursionDepth(); } }
public async 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.List) { { TList _list20 = await iprot.ReadListBeginAsync(cancellationToken); CurrencyExchangeRates = new List <PaidCallCurrencyExchangeRate>(_list20.Count); for (int _i21 = 0; _i21 < _list20.Count; ++_i21) { PaidCallCurrencyExchangeRate _elem22; _elem22 = new PaidCallCurrencyExchangeRate(); await _elem22.ReadAsync(iprot, cancellationToken); CurrencyExchangeRates.Add(_elem22); } await iprot.ReadListEndAsync(cancellationToken); } } else { await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); } break; case 2: if (field.Type == TType.List) { { TList _list23 = await iprot.ReadListBeginAsync(cancellationToken); RecommendedCountryCodes = new List <string>(_list23.Count); for (int _i24 = 0; _i24 < _list23.Count; ++_i24) { string _elem25; _elem25 = await iprot.ReadStringAsync(cancellationToken); RecommendedCountryCodes.Add(_elem25); } await iprot.ReadListEndAsync(cancellationToken); } } else { await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); } break; case 3: if (field.Type == TType.List) { { TList _list26 = await iprot.ReadListBeginAsync(cancellationToken); AdCountries = new List <PaidCallAdCountry>(_list26.Count); for (int _i27 = 0; _i27 < _list26.Count; ++_i27) { PaidCallAdCountry _elem28; _elem28 = new PaidCallAdCountry(); await _elem28.ReadAsync(iprot, cancellationToken); AdCountries.Add(_elem28); } 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); } finally { iprot.DecrementRecursionDepth(); } }
public void Read(TProtocol iprot) { iprot.IncrementRecursionDepth(); try { TField field; iprot.ReadStructBegin(); while (true) { field = iprot.ReadFieldBegin(); if (field.Type == TType.Stop) { break; } switch (field.ID) { case 1: if (field.Type == TType.List) { { CurrencyExchangeRates = new List <PaidCallCurrencyExchangeRate>(); TList _list20 = iprot.ReadListBegin(); for (int _i21 = 0; _i21 < _list20.Count; ++_i21) { PaidCallCurrencyExchangeRate _elem22; _elem22 = new PaidCallCurrencyExchangeRate(); _elem22.Read(iprot); CurrencyExchangeRates.Add(_elem22); } iprot.ReadListEnd(); } } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 2: if (field.Type == TType.List) { { RecommendedCountryCodes = new List <string>(); TList _list23 = iprot.ReadListBegin(); for (int _i24 = 0; _i24 < _list23.Count; ++_i24) { string _elem25; _elem25 = iprot.ReadString(); RecommendedCountryCodes.Add(_elem25); } iprot.ReadListEnd(); } } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 3: if (field.Type == TType.List) { { AdCountries = new List <PaidCallAdCountry>(); TList _list26 = iprot.ReadListBegin(); for (int _i27 = 0; _i27 < _list26.Count; ++_i27) { PaidCallAdCountry _elem28; _elem28 = new PaidCallAdCountry(); _elem28.Read(iprot); AdCountries.Add(_elem28); } iprot.ReadListEnd(); } } else { TProtocolUtil.Skip(iprot, field.Type); } break; default: TProtocolUtil.Skip(iprot, field.Type); break; } iprot.ReadFieldEnd(); } iprot.ReadStructEnd(); } finally { iprot.DecrementRecursionDepth(); } }