// Code generated by protoc-gen-go-grpc. DO NOT EDIT.

package gnetcli

import (
	context "context"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
	emptypb "google.golang.org/protobuf/types/known/emptypb"
)

// 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.32.0 or later.
const _ = grpc.SupportPackageIsVersion7

// GnetcliClient is the client API for Gnetcli 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 GnetcliClient interface {
	SetupHostParams(ctx context.Context, in *HostParams, opts ...grpc.CallOption) (*emptypb.Empty, error)
	Exec(ctx context.Context, in *CMD, opts ...grpc.CallOption) (*CMDResult, error)
	ExecChat(ctx context.Context, opts ...grpc.CallOption) (Gnetcli_ExecChatClient, error)
	AddDevice(ctx context.Context, in *Device, opts ...grpc.CallOption) (*DeviceResult, error)
	ExecNetconf(ctx context.Context, in *CMDNetconf, opts ...grpc.CallOption) (*CMDResult, error)
	ExecNetconfChat(ctx context.Context, opts ...grpc.CallOption) (Gnetcli_ExecNetconfChatClient, error)
	Download(ctx context.Context, in *FileDownloadRequest, opts ...grpc.CallOption) (*FilesResult, error)
	Upload(ctx context.Context, in *FileUploadRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

type gnetcliClient struct {
	cc grpc.ClientConnInterface
}

func NewGnetcliClient(cc grpc.ClientConnInterface) GnetcliClient {
	return &gnetcliClient{cc}
}

func (c *gnetcliClient) SetupHostParams(ctx context.Context, in *HostParams, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, "/gnetcli.Gnetcli/SetupHostParams", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *gnetcliClient) Exec(ctx context.Context, in *CMD, opts ...grpc.CallOption) (*CMDResult, error) {
	out := new(CMDResult)
	err := c.cc.Invoke(ctx, "/gnetcli.Gnetcli/Exec", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *gnetcliClient) ExecChat(ctx context.Context, opts ...grpc.CallOption) (Gnetcli_ExecChatClient, error) {
	stream, err := c.cc.NewStream(ctx, &Gnetcli_ServiceDesc.Streams[0], "/gnetcli.Gnetcli/ExecChat", opts...)
	if err != nil {
		return nil, err
	}
	x := &gnetcliExecChatClient{stream}
	return x, nil
}

type Gnetcli_ExecChatClient interface {
	Send(*CMD) error
	Recv() (*CMDResult, error)
	grpc.ClientStream
}

type gnetcliExecChatClient struct {
	grpc.ClientStream
}

func (x *gnetcliExecChatClient) Send(m *CMD) error {
	return x.ClientStream.SendMsg(m)
}

func (x *gnetcliExecChatClient) Recv() (*CMDResult, error) {
	m := new(CMDResult)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

func (c *gnetcliClient) AddDevice(ctx context.Context, in *Device, opts ...grpc.CallOption) (*DeviceResult, error) {
	out := new(DeviceResult)
	err := c.cc.Invoke(ctx, "/gnetcli.Gnetcli/AddDevice", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *gnetcliClient) ExecNetconf(ctx context.Context, in *CMDNetconf, opts ...grpc.CallOption) (*CMDResult, error) {
	out := new(CMDResult)
	err := c.cc.Invoke(ctx, "/gnetcli.Gnetcli/ExecNetconf", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *gnetcliClient) ExecNetconfChat(ctx context.Context, opts ...grpc.CallOption) (Gnetcli_ExecNetconfChatClient, error) {
	stream, err := c.cc.NewStream(ctx, &Gnetcli_ServiceDesc.Streams[1], "/gnetcli.Gnetcli/ExecNetconfChat", opts...)
	if err != nil {
		return nil, err
	}
	x := &gnetcliExecNetconfChatClient{stream}
	return x, nil
}

type Gnetcli_ExecNetconfChatClient interface {
	Send(*CMDNetconf) error
	Recv() (*CMDResult, error)
	grpc.ClientStream
}

type gnetcliExecNetconfChatClient struct {
	grpc.ClientStream
}

func (x *gnetcliExecNetconfChatClient) Send(m *CMDNetconf) error {
	return x.ClientStream.SendMsg(m)
}

func (x *gnetcliExecNetconfChatClient) Recv() (*CMDResult, error) {
	m := new(CMDResult)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

func (c *gnetcliClient) Download(ctx context.Context, in *FileDownloadRequest, opts ...grpc.CallOption) (*FilesResult, error) {
	out := new(FilesResult)
	err := c.cc.Invoke(ctx, "/gnetcli.Gnetcli/Download", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *gnetcliClient) Upload(ctx context.Context, in *FileUploadRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, "/gnetcli.Gnetcli/Upload", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// GnetcliServer is the server API for Gnetcli service.
// All implementations must embed UnimplementedGnetcliServer
// for forward compatibility
type GnetcliServer interface {
	SetupHostParams(context.Context, *HostParams) (*emptypb.Empty, error)
	Exec(context.Context, *CMD) (*CMDResult, error)
	ExecChat(Gnetcli_ExecChatServer) error
	AddDevice(context.Context, *Device) (*DeviceResult, error)
	ExecNetconf(context.Context, *CMDNetconf) (*CMDResult, error)
	ExecNetconfChat(Gnetcli_ExecNetconfChatServer) error
	Download(context.Context, *FileDownloadRequest) (*FilesResult, error)
	Upload(context.Context, *FileUploadRequest) (*emptypb.Empty, error)
	mustEmbedUnimplementedGnetcliServer()
}

// UnimplementedGnetcliServer must be embedded to have forward compatible implementations.
type UnimplementedGnetcliServer struct {
}

func (UnimplementedGnetcliServer) SetupHostParams(context.Context, *HostParams) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method SetupHostParams not implemented")
}
func (UnimplementedGnetcliServer) Exec(context.Context, *CMD) (*CMDResult, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Exec not implemented")
}
func (UnimplementedGnetcliServer) ExecChat(Gnetcli_ExecChatServer) error {
	return status.Errorf(codes.Unimplemented, "method ExecChat not implemented")
}
func (UnimplementedGnetcliServer) AddDevice(context.Context, *Device) (*DeviceResult, error) {
	return nil, status.Errorf(codes.Unimplemented, "method AddDevice not implemented")
}
func (UnimplementedGnetcliServer) ExecNetconf(context.Context, *CMDNetconf) (*CMDResult, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ExecNetconf not implemented")
}
func (UnimplementedGnetcliServer) ExecNetconfChat(Gnetcli_ExecNetconfChatServer) error {
	return status.Errorf(codes.Unimplemented, "method ExecNetconfChat not implemented")
}
func (UnimplementedGnetcliServer) Download(context.Context, *FileDownloadRequest) (*FilesResult, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Download not implemented")
}
func (UnimplementedGnetcliServer) Upload(context.Context, *FileUploadRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Upload not implemented")
}
func (UnimplementedGnetcliServer) mustEmbedUnimplementedGnetcliServer() {}

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

func RegisterGnetcliServer(s grpc.ServiceRegistrar, srv GnetcliServer) {
	s.RegisterService(&Gnetcli_ServiceDesc, srv)
}

func _Gnetcli_SetupHostParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(HostParams)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(GnetcliServer).SetupHostParams(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/gnetcli.Gnetcli/SetupHostParams",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(GnetcliServer).SetupHostParams(ctx, req.(*HostParams))
	}
	return interceptor(ctx, in, info, handler)
}

func _Gnetcli_Exec_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CMD)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(GnetcliServer).Exec(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/gnetcli.Gnetcli/Exec",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(GnetcliServer).Exec(ctx, req.(*CMD))
	}
	return interceptor(ctx, in, info, handler)
}

func _Gnetcli_ExecChat_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(GnetcliServer).ExecChat(&gnetcliExecChatServer{stream})
}

type Gnetcli_ExecChatServer interface {
	Send(*CMDResult) error
	Recv() (*CMD, error)
	grpc.ServerStream
}

type gnetcliExecChatServer struct {
	grpc.ServerStream
}

func (x *gnetcliExecChatServer) Send(m *CMDResult) error {
	return x.ServerStream.SendMsg(m)
}

func (x *gnetcliExecChatServer) Recv() (*CMD, error) {
	m := new(CMD)
	if err := x.ServerStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

func _Gnetcli_AddDevice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Device)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(GnetcliServer).AddDevice(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/gnetcli.Gnetcli/AddDevice",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(GnetcliServer).AddDevice(ctx, req.(*Device))
	}
	return interceptor(ctx, in, info, handler)
}

func _Gnetcli_ExecNetconf_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CMDNetconf)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(GnetcliServer).ExecNetconf(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/gnetcli.Gnetcli/ExecNetconf",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(GnetcliServer).ExecNetconf(ctx, req.(*CMDNetconf))
	}
	return interceptor(ctx, in, info, handler)
}

func _Gnetcli_ExecNetconfChat_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(GnetcliServer).ExecNetconfChat(&gnetcliExecNetconfChatServer{stream})
}

type Gnetcli_ExecNetconfChatServer interface {
	Send(*CMDResult) error
	Recv() (*CMDNetconf, error)
	grpc.ServerStream
}

type gnetcliExecNetconfChatServer struct {
	grpc.ServerStream
}

func (x *gnetcliExecNetconfChatServer) Send(m *CMDResult) error {
	return x.ServerStream.SendMsg(m)
}

func (x *gnetcliExecNetconfChatServer) Recv() (*CMDNetconf, error) {
	m := new(CMDNetconf)
	if err := x.ServerStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

func _Gnetcli_Download_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(FileDownloadRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(GnetcliServer).Download(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/gnetcli.Gnetcli/Download",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(GnetcliServer).Download(ctx, req.(*FileDownloadRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Gnetcli_Upload_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(FileUploadRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(GnetcliServer).Upload(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/gnetcli.Gnetcli/Upload",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(GnetcliServer).Upload(ctx, req.(*FileUploadRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// Gnetcli_ServiceDesc is the grpc.ServiceDesc for Gnetcli service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Gnetcli_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "gnetcli.Gnetcli",
	HandlerType: (*GnetcliServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "SetupHostParams",
			Handler:    _Gnetcli_SetupHostParams_Handler,
		},
		{
			MethodName: "Exec",
			Handler:    _Gnetcli_Exec_Handler,
		},
		{
			MethodName: "AddDevice",
			Handler:    _Gnetcli_AddDevice_Handler,
		},
		{
			MethodName: "ExecNetconf",
			Handler:    _Gnetcli_ExecNetconf_Handler,
		},
		{
			MethodName: "Download",
			Handler:    _Gnetcli_Download_Handler,
		},
		{
			MethodName: "Upload",
			Handler:    _Gnetcli_Upload_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "ExecChat",
			Handler:       _Gnetcli_ExecChat_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
		{
			StreamName:    "ExecNetconfChat",
			Handler:       _Gnetcli_ExecNetconfChat_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "server.proto",
}
