You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: heartbeat_response.go
    path of file: ./repos/plumber/vendor/github.com/Shopify/sarama
    
    the code of the file until where you have to start completion: package sarama

type HeartbeatResponse struct {
	Version      int16
	ThrottleTime int32
	Err          KError
}

func (r *HeartbeatResponse) encode(pe packetEncoder) error {
	if r.Version >= 1 {
		pe.putInt32(r.ThrottleTime)
	}
	pe.putInt16(int16(r.Err))
	return nil
}
    
func (r *HeartbeatResponse) decode(pd packetDecoder, version int16) error {
	var err error
	r.Version = version
	if r.Version >= 1 {
		if r.ThrottleTime, err = pd.getInt32(); err != nil {
			return err
		}
	}
	kerr, err := pd.getInt16()
	if err != nil {
		return err
	}
	r.Err = KError(kerr)

	return nil
}