// Code generated by sdkgen. DO NOT EDIT.

// nolint
package broker

import (
	"context"

	"google.golang.org/grpc"

	broker "github.com/yandex-cloud/go-genproto/yandex/cloud/iot/broker/v1"
)

//revive:disable

// BrokerDataServiceClient is a broker.BrokerDataServiceClient with
// lazy GRPC connection initialization.
type BrokerDataServiceClient struct {
	getConn func(ctx context.Context) (*grpc.ClientConn, error)
}

// Publish implements broker.BrokerDataServiceClient
func (c *BrokerDataServiceClient) Publish(ctx context.Context, in *broker.PublishBrokerDataRequest, opts ...grpc.CallOption) (*broker.PublishBrokerDataResponse, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return broker.NewBrokerDataServiceClient(conn).Publish(ctx, in, opts...)
}
