// Code generated by Azure.Iot.Operations.ProtocolCompilerLib v0.10.0.0; DO NOT EDIT.
package oven

import (
	"github.com/Azure/iot-operations-sdks/go/protocol"
)

type TelemetryReceiver struct {
	*protocol.TelemetryReceiver[TelemetryCollection]
}

func NewTelemetryReceiver(
	app *protocol.Application,
	client protocol.MqttClient,
	topic string,
	handler protocol.TelemetryHandler[TelemetryCollection],
	opt ...protocol.TelemetryReceiverOption,
) (*TelemetryReceiver, error) {
	var err error
	receiver := &TelemetryReceiver{}

	var opts protocol.TelemetryReceiverOptions
	opts.Apply(
		opt,
	)

	receiver.TelemetryReceiver, err = protocol.NewTelemetryReceiver(
		app,
		client,
		protocol.JSON[TelemetryCollection]{},
		topic,
		handler,
		&opts,
	)

	return receiver, err
}
