// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.1
// - protoc             (unknown)
// source: backend.proto

package pluginv2

import (
	context "context"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
)

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9

const (
	Resource_CallResource_FullMethodName = "/pluginv2.Resource/CallResource"
)

// ResourceClient is the client API for Resource service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type ResourceClient interface {
	CallResource(ctx context.Context, in *CallResourceRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[CallResourceResponse], error)
}

type resourceClient struct {
	cc grpc.ClientConnInterface
}

func NewResourceClient(cc grpc.ClientConnInterface) ResourceClient {
	return &resourceClient{cc}
}

func (c *resourceClient) CallResource(ctx context.Context, in *CallResourceRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[CallResourceResponse], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &Resource_ServiceDesc.Streams[0], Resource_CallResource_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[CallResourceRequest, CallResourceResponse]{ClientStream: stream}
	if err := x.ClientStream.SendMsg(in); err != nil {
		return nil, err
	}
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	return x, nil
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Resource_CallResourceClient = grpc.ServerStreamingClient[CallResourceResponse]

// ResourceServer is the server API for Resource service.
// All implementations should embed UnimplementedResourceServer
// for forward compatibility.
type ResourceServer interface {
	CallResource(*CallResourceRequest, grpc.ServerStreamingServer[CallResourceResponse]) error
}

// UnimplementedResourceServer should be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedResourceServer struct{}

func (UnimplementedResourceServer) CallResource(*CallResourceRequest, grpc.ServerStreamingServer[CallResourceResponse]) error {
	return status.Error(codes.Unimplemented, "method CallResource not implemented")
}
func (UnimplementedResourceServer) testEmbeddedByValue() {}

// UnsafeResourceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ResourceServer will
// result in compilation errors.
type UnsafeResourceServer interface {
	mustEmbedUnimplementedResourceServer()
}

func RegisterResourceServer(s grpc.ServiceRegistrar, srv ResourceServer) {
	// If the following call panics, it indicates UnimplementedResourceServer was
	// embedded by pointer and is nil.  This will cause panics if an
	// unimplemented method is ever invoked, so we test this at initialization
	// time to prevent it from happening at runtime later due to I/O.
	if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
		t.testEmbeddedByValue()
	}
	s.RegisterService(&Resource_ServiceDesc, srv)
}

func _Resource_CallResource_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(CallResourceRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(ResourceServer).CallResource(m, &grpc.GenericServerStream[CallResourceRequest, CallResourceResponse]{ServerStream: stream})
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Resource_CallResourceServer = grpc.ServerStreamingServer[CallResourceResponse]

// Resource_ServiceDesc is the grpc.ServiceDesc for Resource service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Resource_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "pluginv2.Resource",
	HandlerType: (*ResourceServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "CallResource",
			Handler:       _Resource_CallResource_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "backend.proto",
}

const (
	Data_QueryData_FullMethodName        = "/pluginv2.Data/QueryData"
	Data_QueryChunkedData_FullMethodName = "/pluginv2.Data/QueryChunkedData"
)

// DataClient is the client API for Data service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type DataClient interface {
	QueryData(ctx context.Context, in *QueryDataRequest, opts ...grpc.CallOption) (*QueryDataResponse, error)
	QueryChunkedData(ctx context.Context, in *QueryChunkedDataRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[QueryChunkedDataResponse], error)
}

type dataClient struct {
	cc grpc.ClientConnInterface
}

func NewDataClient(cc grpc.ClientConnInterface) DataClient {
	return &dataClient{cc}
}

func (c *dataClient) QueryData(ctx context.Context, in *QueryDataRequest, opts ...grpc.CallOption) (*QueryDataResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(QueryDataResponse)
	err := c.cc.Invoke(ctx, Data_QueryData_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *dataClient) QueryChunkedData(ctx context.Context, in *QueryChunkedDataRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[QueryChunkedDataResponse], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &Data_ServiceDesc.Streams[0], Data_QueryChunkedData_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[QueryChunkedDataRequest, QueryChunkedDataResponse]{ClientStream: stream}
	if err := x.ClientStream.SendMsg(in); err != nil {
		return nil, err
	}
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	return x, nil
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Data_QueryChunkedDataClient = grpc.ServerStreamingClient[QueryChunkedDataResponse]

// DataServer is the server API for Data service.
// All implementations should embed UnimplementedDataServer
// for forward compatibility.
type DataServer interface {
	QueryData(context.Context, *QueryDataRequest) (*QueryDataResponse, error)
	QueryChunkedData(*QueryChunkedDataRequest, grpc.ServerStreamingServer[QueryChunkedDataResponse]) error
}

// UnimplementedDataServer should be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedDataServer struct{}

func (UnimplementedDataServer) QueryData(context.Context, *QueryDataRequest) (*QueryDataResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method QueryData not implemented")
}
func (UnimplementedDataServer) QueryChunkedData(*QueryChunkedDataRequest, grpc.ServerStreamingServer[QueryChunkedDataResponse]) error {
	return status.Error(codes.Unimplemented, "method QueryChunkedData not implemented")
}
func (UnimplementedDataServer) testEmbeddedByValue() {}

// UnsafeDataServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to DataServer will
// result in compilation errors.
type UnsafeDataServer interface {
	mustEmbedUnimplementedDataServer()
}

func RegisterDataServer(s grpc.ServiceRegistrar, srv DataServer) {
	// If the following call panics, it indicates UnimplementedDataServer was
	// embedded by pointer and is nil.  This will cause panics if an
	// unimplemented method is ever invoked, so we test this at initialization
	// time to prevent it from happening at runtime later due to I/O.
	if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
		t.testEmbeddedByValue()
	}
	s.RegisterService(&Data_ServiceDesc, srv)
}

func _Data_QueryData_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(QueryDataRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(DataServer).QueryData(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Data_QueryData_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(DataServer).QueryData(ctx, req.(*QueryDataRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Data_QueryChunkedData_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(QueryChunkedDataRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(DataServer).QueryChunkedData(m, &grpc.GenericServerStream[QueryChunkedDataRequest, QueryChunkedDataResponse]{ServerStream: stream})
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Data_QueryChunkedDataServer = grpc.ServerStreamingServer[QueryChunkedDataResponse]

// Data_ServiceDesc is the grpc.ServiceDesc for Data service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Data_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "pluginv2.Data",
	HandlerType: (*DataServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "QueryData",
			Handler:    _Data_QueryData_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "QueryChunkedData",
			Handler:       _Data_QueryChunkedData_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "backend.proto",
}

const (
	Diagnostics_CheckHealth_FullMethodName    = "/pluginv2.Diagnostics/CheckHealth"
	Diagnostics_CollectMetrics_FullMethodName = "/pluginv2.Diagnostics/CollectMetrics"
)

// DiagnosticsClient is the client API for Diagnostics service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type DiagnosticsClient interface {
	CheckHealth(ctx context.Context, in *CheckHealthRequest, opts ...grpc.CallOption) (*CheckHealthResponse, error)
	CollectMetrics(ctx context.Context, in *CollectMetricsRequest, opts ...grpc.CallOption) (*CollectMetricsResponse, error)
}

type diagnosticsClient struct {
	cc grpc.ClientConnInterface
}

func NewDiagnosticsClient(cc grpc.ClientConnInterface) DiagnosticsClient {
	return &diagnosticsClient{cc}
}

func (c *diagnosticsClient) CheckHealth(ctx context.Context, in *CheckHealthRequest, opts ...grpc.CallOption) (*CheckHealthResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(CheckHealthResponse)
	err := c.cc.Invoke(ctx, Diagnostics_CheckHealth_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *diagnosticsClient) CollectMetrics(ctx context.Context, in *CollectMetricsRequest, opts ...grpc.CallOption) (*CollectMetricsResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(CollectMetricsResponse)
	err := c.cc.Invoke(ctx, Diagnostics_CollectMetrics_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// DiagnosticsServer is the server API for Diagnostics service.
// All implementations should embed UnimplementedDiagnosticsServer
// for forward compatibility.
type DiagnosticsServer interface {
	CheckHealth(context.Context, *CheckHealthRequest) (*CheckHealthResponse, error)
	CollectMetrics(context.Context, *CollectMetricsRequest) (*CollectMetricsResponse, error)
}

// UnimplementedDiagnosticsServer should be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedDiagnosticsServer struct{}

func (UnimplementedDiagnosticsServer) CheckHealth(context.Context, *CheckHealthRequest) (*CheckHealthResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method CheckHealth not implemented")
}
func (UnimplementedDiagnosticsServer) CollectMetrics(context.Context, *CollectMetricsRequest) (*CollectMetricsResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method CollectMetrics not implemented")
}
func (UnimplementedDiagnosticsServer) testEmbeddedByValue() {}

// UnsafeDiagnosticsServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to DiagnosticsServer will
// result in compilation errors.
type UnsafeDiagnosticsServer interface {
	mustEmbedUnimplementedDiagnosticsServer()
}

func RegisterDiagnosticsServer(s grpc.ServiceRegistrar, srv DiagnosticsServer) {
	// If the following call panics, it indicates UnimplementedDiagnosticsServer was
	// embedded by pointer and is nil.  This will cause panics if an
	// unimplemented method is ever invoked, so we test this at initialization
	// time to prevent it from happening at runtime later due to I/O.
	if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
		t.testEmbeddedByValue()
	}
	s.RegisterService(&Diagnostics_ServiceDesc, srv)
}

func _Diagnostics_CheckHealth_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CheckHealthRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(DiagnosticsServer).CheckHealth(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Diagnostics_CheckHealth_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(DiagnosticsServer).CheckHealth(ctx, req.(*CheckHealthRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Diagnostics_CollectMetrics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CollectMetricsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(DiagnosticsServer).CollectMetrics(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Diagnostics_CollectMetrics_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(DiagnosticsServer).CollectMetrics(ctx, req.(*CollectMetricsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// Diagnostics_ServiceDesc is the grpc.ServiceDesc for Diagnostics service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Diagnostics_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "pluginv2.Diagnostics",
	HandlerType: (*DiagnosticsServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CheckHealth",
			Handler:    _Diagnostics_CheckHealth_Handler,
		},
		{
			MethodName: "CollectMetrics",
			Handler:    _Diagnostics_CollectMetrics_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "backend.proto",
}

const (
	Stream_SubscribeStream_FullMethodName = "/pluginv2.Stream/SubscribeStream"
	Stream_RunStream_FullMethodName       = "/pluginv2.Stream/RunStream"
	Stream_PublishStream_FullMethodName   = "/pluginv2.Stream/PublishStream"
)

// StreamClient is the client API for Stream service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type StreamClient interface {
	// SubscribeStream called when a user tries to subscribe to a plugin/datasource
	// managed channel path – thus plugin can check subscribe permissions and communicate
	// options with Grafana Core. When the first subscriber joins a channel, RunStream
	// will be called.
	SubscribeStream(ctx context.Context, in *SubscribeStreamRequest, opts ...grpc.CallOption) (*SubscribeStreamResponse, error)
	// RunStream will be initiated by Grafana to consume a stream. RunStream will be
	// called once for the first client successfully subscribed to a channel path.
	// When Grafana detects that there are no longer any subscribers inside a channel,
	// the call will be terminated until next active subscriber appears. Call termination
	// can happen with a delay.
	RunStream(ctx context.Context, in *RunStreamRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[StreamPacket], error)
	// PublishStream called when a user tries to publish to a plugin/datasource
	// managed channel path. Here plugin can check publish permissions and
	// modify publication data if required.
	PublishStream(ctx context.Context, in *PublishStreamRequest, opts ...grpc.CallOption) (*PublishStreamResponse, error)
}

type streamClient struct {
	cc grpc.ClientConnInterface
}

func NewStreamClient(cc grpc.ClientConnInterface) StreamClient {
	return &streamClient{cc}
}

func (c *streamClient) SubscribeStream(ctx context.Context, in *SubscribeStreamRequest, opts ...grpc.CallOption) (*SubscribeStreamResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(SubscribeStreamResponse)
	err := c.cc.Invoke(ctx, Stream_SubscribeStream_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *streamClient) RunStream(ctx context.Context, in *RunStreamRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[StreamPacket], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &Stream_ServiceDesc.Streams[0], Stream_RunStream_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[RunStreamRequest, StreamPacket]{ClientStream: stream}
	if err := x.ClientStream.SendMsg(in); err != nil {
		return nil, err
	}
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	return x, nil
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Stream_RunStreamClient = grpc.ServerStreamingClient[StreamPacket]

func (c *streamClient) PublishStream(ctx context.Context, in *PublishStreamRequest, opts ...grpc.CallOption) (*PublishStreamResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(PublishStreamResponse)
	err := c.cc.Invoke(ctx, Stream_PublishStream_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// StreamServer is the server API for Stream service.
// All implementations should embed UnimplementedStreamServer
// for forward compatibility.
type StreamServer interface {
	// SubscribeStream called when a user tries to subscribe to a plugin/datasource
	// managed channel path – thus plugin can check subscribe permissions and communicate
	// options with Grafana Core. When the first subscriber joins a channel, RunStream
	// will be called.
	SubscribeStream(context.Context, *SubscribeStreamRequest) (*SubscribeStreamResponse, error)
	// RunStream will be initiated by Grafana to consume a stream. RunStream will be
	// called once for the first client successfully subscribed to a channel path.
	// When Grafana detects that there are no longer any subscribers inside a channel,
	// the call will be terminated until next active subscriber appears. Call termination
	// can happen with a delay.
	RunStream(*RunStreamRequest, grpc.ServerStreamingServer[StreamPacket]) error
	// PublishStream called when a user tries to publish to a plugin/datasource
	// managed channel path. Here plugin can check publish permissions and
	// modify publication data if required.
	PublishStream(context.Context, *PublishStreamRequest) (*PublishStreamResponse, error)
}

// UnimplementedStreamServer should be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedStreamServer struct{}

func (UnimplementedStreamServer) SubscribeStream(context.Context, *SubscribeStreamRequest) (*SubscribeStreamResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method SubscribeStream not implemented")
}
func (UnimplementedStreamServer) RunStream(*RunStreamRequest, grpc.ServerStreamingServer[StreamPacket]) error {
	return status.Error(codes.Unimplemented, "method RunStream not implemented")
}
func (UnimplementedStreamServer) PublishStream(context.Context, *PublishStreamRequest) (*PublishStreamResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method PublishStream not implemented")
}
func (UnimplementedStreamServer) testEmbeddedByValue() {}

// UnsafeStreamServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to StreamServer will
// result in compilation errors.
type UnsafeStreamServer interface {
	mustEmbedUnimplementedStreamServer()
}

func RegisterStreamServer(s grpc.ServiceRegistrar, srv StreamServer) {
	// If the following call panics, it indicates UnimplementedStreamServer was
	// embedded by pointer and is nil.  This will cause panics if an
	// unimplemented method is ever invoked, so we test this at initialization
	// time to prevent it from happening at runtime later due to I/O.
	if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
		t.testEmbeddedByValue()
	}
	s.RegisterService(&Stream_ServiceDesc, srv)
}

func _Stream_SubscribeStream_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SubscribeStreamRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(StreamServer).SubscribeStream(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Stream_SubscribeStream_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(StreamServer).SubscribeStream(ctx, req.(*SubscribeStreamRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Stream_RunStream_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(RunStreamRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(StreamServer).RunStream(m, &grpc.GenericServerStream[RunStreamRequest, StreamPacket]{ServerStream: stream})
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Stream_RunStreamServer = grpc.ServerStreamingServer[StreamPacket]

func _Stream_PublishStream_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(PublishStreamRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(StreamServer).PublishStream(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Stream_PublishStream_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(StreamServer).PublishStream(ctx, req.(*PublishStreamRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// Stream_ServiceDesc is the grpc.ServiceDesc for Stream service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Stream_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "pluginv2.Stream",
	HandlerType: (*StreamServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "SubscribeStream",
			Handler:    _Stream_SubscribeStream_Handler,
		},
		{
			MethodName: "PublishStream",
			Handler:    _Stream_PublishStream_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "RunStream",
			Handler:       _Stream_RunStream_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "backend.proto",
}

const (
	AdmissionControl_ValidateAdmission_FullMethodName = "/pluginv2.AdmissionControl/ValidateAdmission"
	AdmissionControl_MutateAdmission_FullMethodName   = "/pluginv2.AdmissionControl/MutateAdmission"
)

// AdmissionControlClient is the client API for AdmissionControl service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
//
// Admission control is a service based on the kubernetes admission webhook patterns.
// This service can be used to verify if objects are valid and convert between versions
// See: https://github.com/kubernetes/kubernetes/blob/v1.30.0/pkg/apis/admission/types.go#L41
// And: https://github.com/grafana/grafana-app-sdk/blob/main/resource/admission.go#L14
type AdmissionControlClient interface {
	// Validate a resource -- the response is a simple yes/no
	ValidateAdmission(ctx context.Context, in *AdmissionRequest, opts ...grpc.CallOption) (*ValidationResponse, error)
	// Return a modified copy of the request that can be saved or a descriptive error
	MutateAdmission(ctx context.Context, in *AdmissionRequest, opts ...grpc.CallOption) (*MutationResponse, error)
}

type admissionControlClient struct {
	cc grpc.ClientConnInterface
}

func NewAdmissionControlClient(cc grpc.ClientConnInterface) AdmissionControlClient {
	return &admissionControlClient{cc}
}

func (c *admissionControlClient) ValidateAdmission(ctx context.Context, in *AdmissionRequest, opts ...grpc.CallOption) (*ValidationResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ValidationResponse)
	err := c.cc.Invoke(ctx, AdmissionControl_ValidateAdmission_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *admissionControlClient) MutateAdmission(ctx context.Context, in *AdmissionRequest, opts ...grpc.CallOption) (*MutationResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(MutationResponse)
	err := c.cc.Invoke(ctx, AdmissionControl_MutateAdmission_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// AdmissionControlServer is the server API for AdmissionControl service.
// All implementations should embed UnimplementedAdmissionControlServer
// for forward compatibility.
//
// Admission control is a service based on the kubernetes admission webhook patterns.
// This service can be used to verify if objects are valid and convert between versions
// See: https://github.com/kubernetes/kubernetes/blob/v1.30.0/pkg/apis/admission/types.go#L41
// And: https://github.com/grafana/grafana-app-sdk/blob/main/resource/admission.go#L14
type AdmissionControlServer interface {
	// Validate a resource -- the response is a simple yes/no
	ValidateAdmission(context.Context, *AdmissionRequest) (*ValidationResponse, error)
	// Return a modified copy of the request that can be saved or a descriptive error
	MutateAdmission(context.Context, *AdmissionRequest) (*MutationResponse, error)
}

// UnimplementedAdmissionControlServer should be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedAdmissionControlServer struct{}

func (UnimplementedAdmissionControlServer) ValidateAdmission(context.Context, *AdmissionRequest) (*ValidationResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method ValidateAdmission not implemented")
}
func (UnimplementedAdmissionControlServer) MutateAdmission(context.Context, *AdmissionRequest) (*MutationResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method MutateAdmission not implemented")
}
func (UnimplementedAdmissionControlServer) testEmbeddedByValue() {}

// UnsafeAdmissionControlServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to AdmissionControlServer will
// result in compilation errors.
type UnsafeAdmissionControlServer interface {
	mustEmbedUnimplementedAdmissionControlServer()
}

func RegisterAdmissionControlServer(s grpc.ServiceRegistrar, srv AdmissionControlServer) {
	// If the following call panics, it indicates UnimplementedAdmissionControlServer was
	// embedded by pointer and is nil.  This will cause panics if an
	// unimplemented method is ever invoked, so we test this at initialization
	// time to prevent it from happening at runtime later due to I/O.
	if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
		t.testEmbeddedByValue()
	}
	s.RegisterService(&AdmissionControl_ServiceDesc, srv)
}

func _AdmissionControl_ValidateAdmission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(AdmissionRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AdmissionControlServer).ValidateAdmission(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: AdmissionControl_ValidateAdmission_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AdmissionControlServer).ValidateAdmission(ctx, req.(*AdmissionRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _AdmissionControl_MutateAdmission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(AdmissionRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AdmissionControlServer).MutateAdmission(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: AdmissionControl_MutateAdmission_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AdmissionControlServer).MutateAdmission(ctx, req.(*AdmissionRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// AdmissionControl_ServiceDesc is the grpc.ServiceDesc for AdmissionControl service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var AdmissionControl_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "pluginv2.AdmissionControl",
	HandlerType: (*AdmissionControlServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ValidateAdmission",
			Handler:    _AdmissionControl_ValidateAdmission_Handler,
		},
		{
			MethodName: "MutateAdmission",
			Handler:    _AdmissionControl_MutateAdmission_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "backend.proto",
}

const (
	ResourceConversion_ConvertObjects_FullMethodName = "/pluginv2.ResourceConversion/ConvertObjects"
)

// ResourceConversionClient is the client API for ResourceConversion service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
//
// ResourceConversion is a service that can be used to convert resources between versions
// See: https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definition-versioning/#webhook-request-and-response
type ResourceConversionClient interface {
	// Convert objects to a target version
	ConvertObjects(ctx context.Context, in *ConversionRequest, opts ...grpc.CallOption) (*ConversionResponse, error)
}

type resourceConversionClient struct {
	cc grpc.ClientConnInterface
}

func NewResourceConversionClient(cc grpc.ClientConnInterface) ResourceConversionClient {
	return &resourceConversionClient{cc}
}

func (c *resourceConversionClient) ConvertObjects(ctx context.Context, in *ConversionRequest, opts ...grpc.CallOption) (*ConversionResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ConversionResponse)
	err := c.cc.Invoke(ctx, ResourceConversion_ConvertObjects_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// ResourceConversionServer is the server API for ResourceConversion service.
// All implementations should embed UnimplementedResourceConversionServer
// for forward compatibility.
//
// ResourceConversion is a service that can be used to convert resources between versions
// See: https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definition-versioning/#webhook-request-and-response
type ResourceConversionServer interface {
	// Convert objects to a target version
	ConvertObjects(context.Context, *ConversionRequest) (*ConversionResponse, error)
}

// UnimplementedResourceConversionServer should be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedResourceConversionServer struct{}

func (UnimplementedResourceConversionServer) ConvertObjects(context.Context, *ConversionRequest) (*ConversionResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method ConvertObjects not implemented")
}
func (UnimplementedResourceConversionServer) testEmbeddedByValue() {}

// UnsafeResourceConversionServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ResourceConversionServer will
// result in compilation errors.
type UnsafeResourceConversionServer interface {
	mustEmbedUnimplementedResourceConversionServer()
}

func RegisterResourceConversionServer(s grpc.ServiceRegistrar, srv ResourceConversionServer) {
	// If the following call panics, it indicates UnimplementedResourceConversionServer was
	// embedded by pointer and is nil.  This will cause panics if an
	// unimplemented method is ever invoked, so we test this at initialization
	// time to prevent it from happening at runtime later due to I/O.
	if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
		t.testEmbeddedByValue()
	}
	s.RegisterService(&ResourceConversion_ServiceDesc, srv)
}

func _ResourceConversion_ConvertObjects_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ConversionRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ResourceConversionServer).ConvertObjects(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ResourceConversion_ConvertObjects_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ResourceConversionServer).ConvertObjects(ctx, req.(*ConversionRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// ResourceConversion_ServiceDesc is the grpc.ServiceDesc for ResourceConversion service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ResourceConversion_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "pluginv2.ResourceConversion",
	HandlerType: (*ResourceConversionServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ConvertObjects",
			Handler:    _ResourceConversion_ConvertObjects_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "backend.proto",
}
