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

package plugin

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

const (
	Plugin_Unmarshal_FullMethodName        = "/gosdn.plugin.Plugin/Unmarshal"
	Plugin_SetNode_FullMethodName          = "/gosdn.plugin.Plugin/SetNode"
	Plugin_GetNode_FullMethodName          = "/gosdn.plugin.Plugin/GetNode"
	Plugin_DeleteNode_FullMethodName       = "/gosdn.plugin.Plugin/DeleteNode"
	Plugin_Model_FullMethodName            = "/gosdn.plugin.Plugin/Model"
	Plugin_Diff_FullMethodName             = "/gosdn.plugin.Plugin/Diff"
	Plugin_SchemaTreeGzip_FullMethodName   = "/gosdn.plugin.Plugin/SchemaTreeGzip"
	Plugin_ValidateChange_FullMethodName   = "/gosdn.plugin.Plugin/ValidateChange"
	Plugin_PruneConfigFalse_FullMethodName = "/gosdn.plugin.Plugin/PruneConfigFalse"
)

// PluginClient is the client API for Plugin 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 PluginClient interface {
	Unmarshal(ctx context.Context, in *UnmarshalRequest, opts ...grpc.CallOption) (*UnmarshalResponse, error)
	SetNode(ctx context.Context, in *SetNodeRequest, opts ...grpc.CallOption) (*SetNodeResponse, error)
	GetNode(ctx context.Context, in *GetNodeRequest, opts ...grpc.CallOption) (*GetNodeResponse, error)
	DeleteNode(ctx context.Context, in *DeleteNodeRequest, opts ...grpc.CallOption) (*DeleteNodeResponse, error)
	Model(ctx context.Context, in *ModelRequest, opts ...grpc.CallOption) (*ModelResponse, error)
	Diff(ctx context.Context, in *DiffRequest, opts ...grpc.CallOption) (*DiffResponse, error)
	SchemaTreeGzip(ctx context.Context, in *SchemaTreeGzipRequest, opts ...grpc.CallOption) (Plugin_SchemaTreeGzipClient, error)
	ValidateChange(ctx context.Context, in *ValidateChangeRequest, opts ...grpc.CallOption) (*ValidateChangeResponse, error)
	PruneConfigFalse(ctx context.Context, in *PruneConfigFalseRequest, opts ...grpc.CallOption) (*PruneConfigFalseResponse, error)
}

type pluginClient struct {
	cc grpc.ClientConnInterface
}

func NewPluginClient(cc grpc.ClientConnInterface) PluginClient {
	return &pluginClient{cc}
}

func (c *pluginClient) Unmarshal(ctx context.Context, in *UnmarshalRequest, opts ...grpc.CallOption) (*UnmarshalResponse, error) {
	out := new(UnmarshalResponse)
	err := c.cc.Invoke(ctx, Plugin_Unmarshal_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *pluginClient) SetNode(ctx context.Context, in *SetNodeRequest, opts ...grpc.CallOption) (*SetNodeResponse, error) {
	out := new(SetNodeResponse)
	err := c.cc.Invoke(ctx, Plugin_SetNode_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *pluginClient) GetNode(ctx context.Context, in *GetNodeRequest, opts ...grpc.CallOption) (*GetNodeResponse, error) {
	out := new(GetNodeResponse)
	err := c.cc.Invoke(ctx, Plugin_GetNode_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *pluginClient) DeleteNode(ctx context.Context, in *DeleteNodeRequest, opts ...grpc.CallOption) (*DeleteNodeResponse, error) {
	out := new(DeleteNodeResponse)
	err := c.cc.Invoke(ctx, Plugin_DeleteNode_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *pluginClient) Model(ctx context.Context, in *ModelRequest, opts ...grpc.CallOption) (*ModelResponse, error) {
	out := new(ModelResponse)
	err := c.cc.Invoke(ctx, Plugin_Model_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *pluginClient) Diff(ctx context.Context, in *DiffRequest, opts ...grpc.CallOption) (*DiffResponse, error) {
	out := new(DiffResponse)
	err := c.cc.Invoke(ctx, Plugin_Diff_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *pluginClient) SchemaTreeGzip(ctx context.Context, in *SchemaTreeGzipRequest, opts ...grpc.CallOption) (Plugin_SchemaTreeGzipClient, error) {
	stream, err := c.cc.NewStream(ctx, &Plugin_ServiceDesc.Streams[0], Plugin_SchemaTreeGzip_FullMethodName, opts...)
	if err != nil {
		return nil, err
	}
	x := &pluginSchemaTreeGzipClient{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
}

type Plugin_SchemaTreeGzipClient interface {
	Recv() (*Payload, error)
	grpc.ClientStream
}

type pluginSchemaTreeGzipClient struct {
	grpc.ClientStream
}

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

func (c *pluginClient) ValidateChange(ctx context.Context, in *ValidateChangeRequest, opts ...grpc.CallOption) (*ValidateChangeResponse, error) {
	out := new(ValidateChangeResponse)
	err := c.cc.Invoke(ctx, Plugin_ValidateChange_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *pluginClient) PruneConfigFalse(ctx context.Context, in *PruneConfigFalseRequest, opts ...grpc.CallOption) (*PruneConfigFalseResponse, error) {
	out := new(PruneConfigFalseResponse)
	err := c.cc.Invoke(ctx, Plugin_PruneConfigFalse_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// PluginServer is the server API for Plugin service.
// All implementations must embed UnimplementedPluginServer
// for forward compatibility
type PluginServer interface {
	Unmarshal(context.Context, *UnmarshalRequest) (*UnmarshalResponse, error)
	SetNode(context.Context, *SetNodeRequest) (*SetNodeResponse, error)
	GetNode(context.Context, *GetNodeRequest) (*GetNodeResponse, error)
	DeleteNode(context.Context, *DeleteNodeRequest) (*DeleteNodeResponse, error)
	Model(context.Context, *ModelRequest) (*ModelResponse, error)
	Diff(context.Context, *DiffRequest) (*DiffResponse, error)
	SchemaTreeGzip(*SchemaTreeGzipRequest, Plugin_SchemaTreeGzipServer) error
	ValidateChange(context.Context, *ValidateChangeRequest) (*ValidateChangeResponse, error)
	PruneConfigFalse(context.Context, *PruneConfigFalseRequest) (*PruneConfigFalseResponse, error)
	mustEmbedUnimplementedPluginServer()
}

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

func (UnimplementedPluginServer) Unmarshal(context.Context, *UnmarshalRequest) (*UnmarshalResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Unmarshal not implemented")
}
func (UnimplementedPluginServer) SetNode(context.Context, *SetNodeRequest) (*SetNodeResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method SetNode not implemented")
}
func (UnimplementedPluginServer) GetNode(context.Context, *GetNodeRequest) (*GetNodeResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetNode not implemented")
}
func (UnimplementedPluginServer) DeleteNode(context.Context, *DeleteNodeRequest) (*DeleteNodeResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method DeleteNode not implemented")
}
func (UnimplementedPluginServer) Model(context.Context, *ModelRequest) (*ModelResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Model not implemented")
}
func (UnimplementedPluginServer) Diff(context.Context, *DiffRequest) (*DiffResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Diff not implemented")
}
func (UnimplementedPluginServer) SchemaTreeGzip(*SchemaTreeGzipRequest, Plugin_SchemaTreeGzipServer) error {
	return status.Errorf(codes.Unimplemented, "method SchemaTreeGzip not implemented")
}
func (UnimplementedPluginServer) ValidateChange(context.Context, *ValidateChangeRequest) (*ValidateChangeResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ValidateChange not implemented")
}
func (UnimplementedPluginServer) PruneConfigFalse(context.Context, *PruneConfigFalseRequest) (*PruneConfigFalseResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method PruneConfigFalse not implemented")
}
func (UnimplementedPluginServer) mustEmbedUnimplementedPluginServer() {}

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

func RegisterPluginServer(s grpc.ServiceRegistrar, srv PluginServer) {
	s.RegisterService(&Plugin_ServiceDesc, srv)
}

func _Plugin_Unmarshal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(UnmarshalRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PluginServer).Unmarshal(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Plugin_Unmarshal_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PluginServer).Unmarshal(ctx, req.(*UnmarshalRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Plugin_SetNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SetNodeRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PluginServer).SetNode(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Plugin_SetNode_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PluginServer).SetNode(ctx, req.(*SetNodeRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Plugin_GetNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetNodeRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PluginServer).GetNode(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Plugin_GetNode_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PluginServer).GetNode(ctx, req.(*GetNodeRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Plugin_DeleteNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DeleteNodeRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PluginServer).DeleteNode(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Plugin_DeleteNode_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PluginServer).DeleteNode(ctx, req.(*DeleteNodeRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Plugin_Model_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ModelRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PluginServer).Model(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Plugin_Model_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PluginServer).Model(ctx, req.(*ModelRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Plugin_Diff_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DiffRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PluginServer).Diff(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Plugin_Diff_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PluginServer).Diff(ctx, req.(*DiffRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Plugin_SchemaTreeGzip_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(SchemaTreeGzipRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(PluginServer).SchemaTreeGzip(m, &pluginSchemaTreeGzipServer{stream})
}

type Plugin_SchemaTreeGzipServer interface {
	Send(*Payload) error
	grpc.ServerStream
}

type pluginSchemaTreeGzipServer struct {
	grpc.ServerStream
}

func (x *pluginSchemaTreeGzipServer) Send(m *Payload) error {
	return x.ServerStream.SendMsg(m)
}

func _Plugin_ValidateChange_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ValidateChangeRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PluginServer).ValidateChange(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Plugin_ValidateChange_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PluginServer).ValidateChange(ctx, req.(*ValidateChangeRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Plugin_PruneConfigFalse_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(PruneConfigFalseRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PluginServer).PruneConfigFalse(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Plugin_PruneConfigFalse_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PluginServer).PruneConfigFalse(ctx, req.(*PruneConfigFalseRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// Plugin_ServiceDesc is the grpc.ServiceDesc for Plugin service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Plugin_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "gosdn.plugin.Plugin",
	HandlerType: (*PluginServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Unmarshal",
			Handler:    _Plugin_Unmarshal_Handler,
		},
		{
			MethodName: "SetNode",
			Handler:    _Plugin_SetNode_Handler,
		},
		{
			MethodName: "GetNode",
			Handler:    _Plugin_GetNode_Handler,
		},
		{
			MethodName: "DeleteNode",
			Handler:    _Plugin_DeleteNode_Handler,
		},
		{
			MethodName: "Model",
			Handler:    _Plugin_Model_Handler,
		},
		{
			MethodName: "Diff",
			Handler:    _Plugin_Diff_Handler,
		},
		{
			MethodName: "ValidateChange",
			Handler:    _Plugin_ValidateChange_Handler,
		},
		{
			MethodName: "PruneConfigFalse",
			Handler:    _Plugin_PruneConfigFalse_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "SchemaTreeGzip",
			Handler:       _Plugin_SchemaTreeGzip_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "gosdn/plugin/plugin.proto",
}
