(ctx context.Context, iprot thrift.TProtocol)
| 3916 | return p.File |
| 3917 | } |
| 3918 | func (p *TFile) Read(ctx context.Context, iprot thrift.TProtocol) error { |
| 3919 | if _, err := iprot.ReadStructBegin(ctx); err != nil { |
| 3920 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| 3921 | } |
| 3922 | |
| 3923 | var issetFileName bool = false; |
| 3924 | var issetFile bool = false; |
| 3925 | |
| 3926 | for { |
| 3927 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) |
| 3928 | if err != nil { |
| 3929 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| 3930 | } |
| 3931 | if fieldTypeId == thrift.STOP { break; } |
| 3932 | switch fieldId { |
| 3933 | case 1: |
| 3934 | if fieldTypeId == thrift.STRING { |
| 3935 | if err := p.ReadField1(ctx, iprot); err != nil { |
| 3936 | return err |
| 3937 | } |
| 3938 | issetFileName = true |
| 3939 | } else { |
| 3940 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { |
| 3941 | return err |
| 3942 | } |
| 3943 | } |
| 3944 | case 2: |
| 3945 | if fieldTypeId == thrift.STRING { |
| 3946 | if err := p.ReadField2(ctx, iprot); err != nil { |
| 3947 | return err |
| 3948 | } |
| 3949 | issetFile = true |
| 3950 | } else { |
| 3951 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { |
| 3952 | return err |
| 3953 | } |
| 3954 | } |
| 3955 | default: |
| 3956 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { |
| 3957 | return err |
| 3958 | } |
| 3959 | } |
| 3960 | if err := iprot.ReadFieldEnd(ctx); err != nil { |
| 3961 | return err |
| 3962 | } |
| 3963 | } |
| 3964 | if err := iprot.ReadStructEnd(ctx); err != nil { |
| 3965 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| 3966 | } |
| 3967 | if !issetFileName{ |
| 3968 | return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field FileName is not set")); |
| 3969 | } |
| 3970 | if !issetFile{ |
| 3971 | return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field File is not set")); |
| 3972 | } |
| 3973 | return nil |
| 3974 | } |
| 3975 |
no test coverage detected