func (m *HeartbeatResponse) UnmarshalBinary(b []byte) error {
	var err error
	m.Header, err = ParseHeader(b)
	if err != nil {
		return err
	}
	if len(m.Header.Payload) < 2 {
		return nil
	}
	ies, err := ie.ParseMultiIEs(m.Header.Payload)
	if err != nil {
		return err
	}
	for _, i := range ies {
		switch i.Type {
		case ie.RecoveryTimeStamp:
			m.RecoveryTimeStamp = i
		default:
			m.IEs = append(m.IEs, i)
		}
	}
	return nil
}
UnmarshalBinary decodes a given byte sequence as a HeartbeatResponse.
package message
import (
	"github.com/wmnsk/go-pfcp/ie"
)
type HeartbeatResponse struct {
	*Header
	RecoveryTimeStamp *ie.IE
	IEs               []*ie.IE
}
func NewHeartbeatResponse(seq uint32, ts *ie.IE, ies ...*ie.IE) *HeartbeatResponse {
	m := &HeartbeatResponse{
		Header: NewHeader(
			1, 0, 0, 0,
			MsgTypeHeartbeatResponse, 0, seq, 0,
			nil,
		),
		RecoveryTimeStamp: ts,
		IEs:               ies,
	}
	m.SetLength()
	return m
}
func (m *HeartbeatResponse) Marshal() ([]byte, error) {
	b := make([]byte, m.MarshalLen())
	if err := m.MarshalTo(b); err != nil {
		return nil, err
	}
	return b, nil
}
func (m *HeartbeatResponse) MarshalTo(b []byte) error {
	if m.Header.Payload != nil {
		m.Header.Payload = nil
	}
	m.Header.Payload = make([]byte, m.MarshalLen()-m.Header.MarshalLen())
	offset := 0
	if i := m.RecoveryTimeStamp; i != nil {
		if err := i.MarshalTo(m.Payload[offset:]); err != nil {
			return err
		}
		offset += i.MarshalLen()
	}
	for _, ie := range m.IEs {
		if ie == nil {
			continue
		}
		if err := ie.MarshalTo(m.Header.Payload[offset:]); err != nil {
			return err
		}
		offset += ie.MarshalLen()
	}
	m.Header.SetLength()
	return m.Header.MarshalTo(b)
}
func ParseHeartbeatResponse(b []byte) (*HeartbeatResponse, error) {
	m := &HeartbeatResponse{}
	if err := m.UnmarshalBinary(b); err != nil {
		return nil, err
	}
	return m, nil
}