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

package machine

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.64.0 or later.
const _ = grpc.SupportPackageIsVersion9

const (
	LVMService_LogicalVolumeRemove_FullMethodName  = "/machine.LVMService/LogicalVolumeRemove"
	LVMService_VolumeGroupRemove_FullMethodName    = "/machine.LVMService/VolumeGroupRemove"
	LVMService_PhysicalVolumeRemove_FullMethodName = "/machine.LVMService/PhysicalVolumeRemove"
)

// LVMServiceClient is the client API for LVMService 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.
//
// LVMService manages LVM resources on a Talos node.
type LVMServiceClient interface {
	// LogicalVolumeRemove removes an LVM logical volume.
	//
	// The LV must not be open (e.g. mounted or in use by another device).
	LogicalVolumeRemove(ctx context.Context, in *LVMServiceLogicalVolumeRemoveRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// VolumeGroupRemove removes an LVM volume group.
	//
	// WARNING: this cascades. Every logical volume inside the group is
	// removed first, then the VG metadata itself. Callers that want
	// fine-grained control should invoke LogicalVolumeRemove per LV before
	// this RPC. The underlying physical volumes keep their LVM labels and
	// must be cleared separately with PhysicalVolumeRemove.
	VolumeGroupRemove(ctx context.Context, in *LVMServiceVolumeGroupRemoveRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// PhysicalVolumeRemove wipes the LVM label and metadata from a block device.
	//
	// The PV must not be part of an active volume group; remove the VG first
	// with VolumeGroupRemove.
	PhysicalVolumeRemove(ctx context.Context, in *LVMServicePhysicalVolumeRemoveRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

type lVMServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewLVMServiceClient(cc grpc.ClientConnInterface) LVMServiceClient {
	return &lVMServiceClient{cc}
}

func (c *lVMServiceClient) LogicalVolumeRemove(ctx context.Context, in *LVMServiceLogicalVolumeRemoveRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, LVMService_LogicalVolumeRemove_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *lVMServiceClient) VolumeGroupRemove(ctx context.Context, in *LVMServiceVolumeGroupRemoveRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, LVMService_VolumeGroupRemove_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *lVMServiceClient) PhysicalVolumeRemove(ctx context.Context, in *LVMServicePhysicalVolumeRemoveRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, LVMService_PhysicalVolumeRemove_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// LVMServiceServer is the server API for LVMService service.
// All implementations must embed UnimplementedLVMServiceServer
// for forward compatibility.
//
// LVMService manages LVM resources on a Talos node.
type LVMServiceServer interface {
	// LogicalVolumeRemove removes an LVM logical volume.
	//
	// The LV must not be open (e.g. mounted or in use by another device).
	LogicalVolumeRemove(context.Context, *LVMServiceLogicalVolumeRemoveRequest) (*emptypb.Empty, error)
	// VolumeGroupRemove removes an LVM volume group.
	//
	// WARNING: this cascades. Every logical volume inside the group is
	// removed first, then the VG metadata itself. Callers that want
	// fine-grained control should invoke LogicalVolumeRemove per LV before
	// this RPC. The underlying physical volumes keep their LVM labels and
	// must be cleared separately with PhysicalVolumeRemove.
	VolumeGroupRemove(context.Context, *LVMServiceVolumeGroupRemoveRequest) (*emptypb.Empty, error)
	// PhysicalVolumeRemove wipes the LVM label and metadata from a block device.
	//
	// The PV must not be part of an active volume group; remove the VG first
	// with VolumeGroupRemove.
	PhysicalVolumeRemove(context.Context, *LVMServicePhysicalVolumeRemoveRequest) (*emptypb.Empty, error)
	mustEmbedUnimplementedLVMServiceServer()
}

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

func (UnimplementedLVMServiceServer) LogicalVolumeRemove(context.Context, *LVMServiceLogicalVolumeRemoveRequest) (*emptypb.Empty, error) {
	return nil, status.Error(codes.Unimplemented, "method LogicalVolumeRemove not implemented")
}
func (UnimplementedLVMServiceServer) VolumeGroupRemove(context.Context, *LVMServiceVolumeGroupRemoveRequest) (*emptypb.Empty, error) {
	return nil, status.Error(codes.Unimplemented, "method VolumeGroupRemove not implemented")
}
func (UnimplementedLVMServiceServer) PhysicalVolumeRemove(context.Context, *LVMServicePhysicalVolumeRemoveRequest) (*emptypb.Empty, error) {
	return nil, status.Error(codes.Unimplemented, "method PhysicalVolumeRemove not implemented")
}
func (UnimplementedLVMServiceServer) mustEmbedUnimplementedLVMServiceServer() {}
func (UnimplementedLVMServiceServer) testEmbeddedByValue()                    {}

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

func RegisterLVMServiceServer(s grpc.ServiceRegistrar, srv LVMServiceServer) {
	// If the following call panics, it indicates UnimplementedLVMServiceServer 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(&LVMService_ServiceDesc, srv)
}

func _LVMService_LogicalVolumeRemove_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(LVMServiceLogicalVolumeRemoveRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LVMServiceServer).LogicalVolumeRemove(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: LVMService_LogicalVolumeRemove_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LVMServiceServer).LogicalVolumeRemove(ctx, req.(*LVMServiceLogicalVolumeRemoveRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _LVMService_VolumeGroupRemove_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(LVMServiceVolumeGroupRemoveRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LVMServiceServer).VolumeGroupRemove(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: LVMService_VolumeGroupRemove_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LVMServiceServer).VolumeGroupRemove(ctx, req.(*LVMServiceVolumeGroupRemoveRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _LVMService_PhysicalVolumeRemove_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(LVMServicePhysicalVolumeRemoveRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LVMServiceServer).PhysicalVolumeRemove(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: LVMService_PhysicalVolumeRemove_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LVMServiceServer).PhysicalVolumeRemove(ctx, req.(*LVMServicePhysicalVolumeRemoveRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// LVMService_ServiceDesc is the grpc.ServiceDesc for LVMService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var LVMService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "machine.LVMService",
	HandlerType: (*LVMServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "LogicalVolumeRemove",
			Handler:    _LVMService_LogicalVolumeRemove_Handler,
		},
		{
			MethodName: "VolumeGroupRemove",
			Handler:    _LVMService_VolumeGroupRemove_Handler,
		},
		{
			MethodName: "PhysicalVolumeRemove",
			Handler:    _LVMService_PhysicalVolumeRemove_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "machine/lvm.proto",
}
