// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc             v6.30.2
// source: proto/operator_lifecycle.proto

package lifecycle

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 (
	OperatorLifecycle_GetCapabilities_FullMethodName = "/cnpgi.operator_lifecycle.v1.OperatorLifecycle/GetCapabilities"
	OperatorLifecycle_LifecycleHook_FullMethodName   = "/cnpgi.operator_lifecycle.v1.OperatorLifecycle/LifecycleHook"
)

// OperatorLifecycleClient is the client API for OperatorLifecycle 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 OperatorLifecycleClient interface {
	// GetCapabilities gets the capabilities of the Lifecycle service
	GetCapabilities(ctx context.Context, in *OperatorLifecycleCapabilitiesRequest, opts ...grpc.CallOption) (*OperatorLifecycleCapabilitiesResponse, error)
	// LifecycleHook allows the plugin to manipulate the Kubernetes resources
	// before the CNPG operator applies them to the Kubernetes cluster.
	LifecycleHook(ctx context.Context, in *OperatorLifecycleRequest, opts ...grpc.CallOption) (*OperatorLifecycleResponse, error)
}

type operatorLifecycleClient struct {
	cc grpc.ClientConnInterface
}

func NewOperatorLifecycleClient(cc grpc.ClientConnInterface) OperatorLifecycleClient {
	return &operatorLifecycleClient{cc}
}

func (c *operatorLifecycleClient) GetCapabilities(ctx context.Context, in *OperatorLifecycleCapabilitiesRequest, opts ...grpc.CallOption) (*OperatorLifecycleCapabilitiesResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(OperatorLifecycleCapabilitiesResponse)
	err := c.cc.Invoke(ctx, OperatorLifecycle_GetCapabilities_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *operatorLifecycleClient) LifecycleHook(ctx context.Context, in *OperatorLifecycleRequest, opts ...grpc.CallOption) (*OperatorLifecycleResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(OperatorLifecycleResponse)
	err := c.cc.Invoke(ctx, OperatorLifecycle_LifecycleHook_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// OperatorLifecycleServer is the server API for OperatorLifecycle service.
// All implementations must embed UnimplementedOperatorLifecycleServer
// for forward compatibility.
type OperatorLifecycleServer interface {
	// GetCapabilities gets the capabilities of the Lifecycle service
	GetCapabilities(context.Context, *OperatorLifecycleCapabilitiesRequest) (*OperatorLifecycleCapabilitiesResponse, error)
	// LifecycleHook allows the plugin to manipulate the Kubernetes resources
	// before the CNPG operator applies them to the Kubernetes cluster.
	LifecycleHook(context.Context, *OperatorLifecycleRequest) (*OperatorLifecycleResponse, error)
	mustEmbedUnimplementedOperatorLifecycleServer()
}

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

func (UnimplementedOperatorLifecycleServer) GetCapabilities(context.Context, *OperatorLifecycleCapabilitiesRequest) (*OperatorLifecycleCapabilitiesResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetCapabilities not implemented")
}
func (UnimplementedOperatorLifecycleServer) LifecycleHook(context.Context, *OperatorLifecycleRequest) (*OperatorLifecycleResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method LifecycleHook not implemented")
}
func (UnimplementedOperatorLifecycleServer) mustEmbedUnimplementedOperatorLifecycleServer() {}
func (UnimplementedOperatorLifecycleServer) testEmbeddedByValue()                           {}

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

func RegisterOperatorLifecycleServer(s grpc.ServiceRegistrar, srv OperatorLifecycleServer) {
	// If the following call pancis, it indicates UnimplementedOperatorLifecycleServer 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(&OperatorLifecycle_ServiceDesc, srv)
}

func _OperatorLifecycle_GetCapabilities_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(OperatorLifecycleCapabilitiesRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(OperatorLifecycleServer).GetCapabilities(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: OperatorLifecycle_GetCapabilities_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(OperatorLifecycleServer).GetCapabilities(ctx, req.(*OperatorLifecycleCapabilitiesRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _OperatorLifecycle_LifecycleHook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(OperatorLifecycleRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(OperatorLifecycleServer).LifecycleHook(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: OperatorLifecycle_LifecycleHook_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(OperatorLifecycleServer).LifecycleHook(ctx, req.(*OperatorLifecycleRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// OperatorLifecycle_ServiceDesc is the grpc.ServiceDesc for OperatorLifecycle service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var OperatorLifecycle_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "cnpgi.operator_lifecycle.v1.OperatorLifecycle",
	HandlerType: (*OperatorLifecycleServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetCapabilities",
			Handler:    _OperatorLifecycle_GetCapabilities_Handler,
		},
		{
			MethodName: "LifecycleHook",
			Handler:    _OperatorLifecycle_LifecycleHook_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "proto/operator_lifecycle.proto",
}
