func (f *SubsequentVolumeThresholdFields) Marshal() ([]byte, error) {
	b := make([]byte, f.MarshalLen())
	if err := f.MarshalTo(b); err != nil {
		return nil, err
	}
	return b, nil
}
Marshal returns the serialized bytes of SubsequentVolumeThresholdFields.
package ie
import (
	"encoding/binary"
	"io"
)
func NewSubsequentVolumeThreshold(flags uint8, tvol, uvol, dvol uint64) *IE {
	fields := NewSubsequentVolumeThresholdFields(flags, tvol, uvol, dvol)
	b, err := fields.Marshal()
	if err != nil {
		return nil
	}
	return New(SubsequentVolumeThreshold, b)
}
func (i *IE) SubsequentVolumeThreshold() (*SubsequentVolumeThresholdFields, error) {
	switch i.Type {
	case SubsequentVolumeThreshold:
		fields, err := ParseSubsequentVolumeThresholdFields(i.Payload)
		if err != nil {
			return nil, err
		}
		return fields, nil
	case CreateURR:
		ies, err := i.CreateURR()
		if err != nil {
			return nil, err
		}
		for _, x := range ies {
			if x.Type == SubsequentVolumeThreshold {
				return x.SubsequentVolumeThreshold()
			}
		}
		return nil, ErrIENotFound
	case UpdateURR:
		ies, err := i.UpdateURR()
		if err != nil {
			return nil, err
		}
		for _, x := range ies {
			if x.Type == SubsequentVolumeThreshold {
				return x.SubsequentVolumeThreshold()
			}
		}
		return nil, ErrIENotFound
	case AdditionalMonitoringTime:
		ies, err := i.AdditionalMonitoringTime()
		if err != nil {
			return nil, err
		}
		for _, x := range ies {
			if x.Type == SubsequentVolumeThreshold {
				return x.SubsequentVolumeThreshold()
			}
		}
		return nil, ErrIENotFound
	default:
		return nil, &InvalidTypeError{Type: i.Type}
	}
}
type SubsequentVolumeThresholdFields struct {
	Flags          uint8
	TotalVolume    uint64
	UplinkVolume   uint64
	DownlinkVolume uint64
}
func NewSubsequentVolumeThresholdFields(flags uint8, tvol, uvol, dvol uint64) *SubsequentVolumeThresholdFields {
	f := &SubsequentVolumeThresholdFields{Flags: flags}
	if f.HasTOVOL() {
		f.TotalVolume = tvol
	}
	if f.HasULVOL() {
		f.UplinkVolume = uvol
	}
	if f.HasDLVOL() {
		f.DownlinkVolume = dvol
	}
	return f
}
func (f *SubsequentVolumeThresholdFields) HasDLVOL() bool {
	return has3rdBit(f.Flags)
}
func (f *SubsequentVolumeThresholdFields) SetDLVOLFlag() {
	f.Flags |= 0x04
}
func (f *SubsequentVolumeThresholdFields) HasULVOL() bool {
	return has2ndBit(f.Flags)
}
func (f *SubsequentVolumeThresholdFields) SetULVOLFlag() {
	f.Flags |= 0x02
}
func (f *SubsequentVolumeThresholdFields) HasTOVOL() bool {
	return has1stBit(f.Flags)
}
func (f *SubsequentVolumeThresholdFields) SetTOVOLFlag() {
	f.Flags |= 0x01
}
func ParseSubsequentVolumeThresholdFields(b []byte) (*SubsequentVolumeThresholdFields, error) {
	f := &SubsequentVolumeThresholdFields{}
	if err := f.UnmarshalBinary(b); err != nil {
		return nil, err
	}
	return f, nil
}
func (f *SubsequentVolumeThresholdFields) UnmarshalBinary(b []byte) error {
	l := len(b)
	if l < 2 {
		return io.ErrUnexpectedEOF
	}
	f.Flags = b[0]
	offset := 1
	if f.HasTOVOL() {
		if l < offset+8 {
			return io.ErrUnexpectedEOF
		}
		f.TotalVolume = binary.BigEndian.Uint64(b[offset : offset+8])
		offset += 8
	}
	if f.HasULVOL() {
		if l < offset+8 {
			return io.ErrUnexpectedEOF
		}
		f.UplinkVolume = binary.BigEndian.Uint64(b[offset : offset+8])
		offset += 8
	}
	if f.HasDLVOL() {
		if l < offset+8 {
			return io.ErrUnexpectedEOF
		}
		f.DownlinkVolume = binary.BigEndian.Uint64(b[offset : offset+8])
	}
	return nil
}