(ctx context.Context, iprot thrift.TProtocol)
| 6248 | } |
| 6249 | |
| 6250 | func (p *TSGetTimeZoneResp) Read(ctx context.Context, iprot thrift.TProtocol) error { |
| 6251 | if _, err := iprot.ReadStructBegin(ctx); err != nil { |
| 6252 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| 6253 | } |
| 6254 | |
| 6255 | var issetStatus bool = false; |
| 6256 | var issetTimeZone bool = false; |
| 6257 | |
| 6258 | for { |
| 6259 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) |
| 6260 | if err != nil { |
| 6261 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| 6262 | } |
| 6263 | if fieldTypeId == thrift.STOP { break; } |
| 6264 | switch fieldId { |
| 6265 | case 1: |
| 6266 | if fieldTypeId == thrift.STRUCT { |
| 6267 | if err := p.ReadField1(ctx, iprot); err != nil { |
| 6268 | return err |
| 6269 | } |
| 6270 | issetStatus = true |
| 6271 | } else { |
| 6272 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { |
| 6273 | return err |
| 6274 | } |
| 6275 | } |
| 6276 | case 2: |
| 6277 | if fieldTypeId == thrift.STRING { |
| 6278 | if err := p.ReadField2(ctx, iprot); err != nil { |
| 6279 | return err |
| 6280 | } |
| 6281 | issetTimeZone = true |
| 6282 | } else { |
| 6283 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { |
| 6284 | return err |
| 6285 | } |
| 6286 | } |
| 6287 | default: |
| 6288 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { |
| 6289 | return err |
| 6290 | } |
| 6291 | } |
| 6292 | if err := iprot.ReadFieldEnd(ctx); err != nil { |
| 6293 | return err |
| 6294 | } |
| 6295 | } |
| 6296 | if err := iprot.ReadStructEnd(ctx); err != nil { |
| 6297 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| 6298 | } |
| 6299 | if !issetStatus{ |
| 6300 | return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); |
| 6301 | } |
| 6302 | if !issetTimeZone{ |
| 6303 | return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TimeZone is not set")); |
| 6304 | } |
| 6305 | return nil |
| 6306 | } |
| 6307 |
nothing calls this directly
no test coverage detected