// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc             v4.24.4
// source: spire/common/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 (
	PluginInit_Init_FullMethodName = "/spire.common.plugin.PluginInit/Init"
)

// PluginInitClient is the client API for PluginInit 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 PluginInitClient interface {
	Init(ctx context.Context, in *InitRequest, opts ...grpc.CallOption) (*InitResponse, error)
}

type pluginInitClient struct {
	cc grpc.ClientConnInterface
}

func NewPluginInitClient(cc grpc.ClientConnInterface) PluginInitClient {
	return &pluginInitClient{cc}
}

func (c *pluginInitClient) Init(ctx context.Context, in *InitRequest, opts ...grpc.CallOption) (*InitResponse, error) {
	out := new(InitResponse)
	err := c.cc.Invoke(ctx, PluginInit_Init_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// PluginInitServer is the server API for PluginInit service.
// All implementations must embed UnimplementedPluginInitServer
// for forward compatibility
type PluginInitServer interface {
	Init(context.Context, *InitRequest) (*InitResponse, error)
	mustEmbedUnimplementedPluginInitServer()
}

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

func (UnimplementedPluginInitServer) Init(context.Context, *InitRequest) (*InitResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Init not implemented")
}
func (UnimplementedPluginInitServer) mustEmbedUnimplementedPluginInitServer() {}

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

func RegisterPluginInitServer(s grpc.ServiceRegistrar, srv PluginInitServer) {
	s.RegisterService(&PluginInit_ServiceDesc, srv)
}

func _PluginInit_Init_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(InitRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PluginInitServer).Init(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: PluginInit_Init_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PluginInitServer).Init(ctx, req.(*InitRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// PluginInit_ServiceDesc is the grpc.ServiceDesc for PluginInit service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var PluginInit_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "spire.common.plugin.PluginInit",
	HandlerType: (*PluginInitServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Init",
			Handler:    _PluginInit_Init_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "spire/common/plugin/plugin.proto",
}
