// Copyright (c) 2020 Nokia

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.1
// - protoc             v7.34.1
// source: nokia-dialout-telemetry.proto

package nokia

import (
	context "context"
	gnmi "github.com/openconfig/gnmi/proto/gnmi"
	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 (
	DialoutTelemetry_Publish_FullMethodName = "/Nokia.SROS.DialoutTelemetry/Publish"
)

// DialoutTelemetryClient is the client API for DialoutTelemetry 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 DialoutTelemetryClient interface {
	Publish(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[gnmi.SubscribeResponse, gnmi.SubscribeRequest], error)
}

type dialoutTelemetryClient struct {
	cc grpc.ClientConnInterface
}

func NewDialoutTelemetryClient(cc grpc.ClientConnInterface) DialoutTelemetryClient {
	return &dialoutTelemetryClient{cc}
}

func (c *dialoutTelemetryClient) Publish(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[gnmi.SubscribeResponse, gnmi.SubscribeRequest], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &DialoutTelemetry_ServiceDesc.Streams[0], DialoutTelemetry_Publish_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[gnmi.SubscribeResponse, gnmi.SubscribeRequest]{ClientStream: stream}
	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 DialoutTelemetry_PublishClient = grpc.BidiStreamingClient[gnmi.SubscribeResponse, gnmi.SubscribeRequest]

// DialoutTelemetryServer is the server API for DialoutTelemetry service.
// All implementations must embed UnimplementedDialoutTelemetryServer
// for forward compatibility.
type DialoutTelemetryServer interface {
	Publish(grpc.BidiStreamingServer[gnmi.SubscribeResponse, gnmi.SubscribeRequest]) error
	mustEmbedUnimplementedDialoutTelemetryServer()
}

// UnimplementedDialoutTelemetryServer must 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 UnimplementedDialoutTelemetryServer struct{}

func (UnimplementedDialoutTelemetryServer) Publish(grpc.BidiStreamingServer[gnmi.SubscribeResponse, gnmi.SubscribeRequest]) error {
	return status.Error(codes.Unimplemented, "method Publish not implemented")
}
func (UnimplementedDialoutTelemetryServer) mustEmbedUnimplementedDialoutTelemetryServer() {}
func (UnimplementedDialoutTelemetryServer) testEmbeddedByValue()                          {}

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

func RegisterDialoutTelemetryServer(s grpc.ServiceRegistrar, srv DialoutTelemetryServer) {
	// If the following call panics, it indicates UnimplementedDialoutTelemetryServer 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(&DialoutTelemetry_ServiceDesc, srv)
}

func _DialoutTelemetry_Publish_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(DialoutTelemetryServer).Publish(&grpc.GenericServerStream[gnmi.SubscribeResponse, gnmi.SubscribeRequest]{ServerStream: stream})
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type DialoutTelemetry_PublishServer = grpc.BidiStreamingServer[gnmi.SubscribeResponse, gnmi.SubscribeRequest]

// DialoutTelemetry_ServiceDesc is the grpc.ServiceDesc for DialoutTelemetry service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var DialoutTelemetry_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "Nokia.SROS.DialoutTelemetry",
	HandlerType: (*DialoutTelemetryServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Publish",
			Handler:       _DialoutTelemetry_Publish_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "nokia-dialout-telemetry.proto",
}
