// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.2
// - protoc             v7.34.1
// source: keyprovider.proto

package keyprovider

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 (
	KeyProviderService_WrapKey_FullMethodName   = "/keyprovider.KeyProviderService/WrapKey"
	KeyProviderService_UnWrapKey_FullMethodName = "/keyprovider.KeyProviderService/UnWrapKey"
)

// KeyProviderServiceClient is the client API for KeyProviderService 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 KeyProviderServiceClient interface {
	WrapKey(ctx context.Context, in *KeyProviderKeyWrapProtocolInput, opts ...grpc.CallOption) (*KeyProviderKeyWrapProtocolOutput, error)
	UnWrapKey(ctx context.Context, in *KeyProviderKeyWrapProtocolInput, opts ...grpc.CallOption) (*KeyProviderKeyWrapProtocolOutput, error)
}

type keyProviderServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewKeyProviderServiceClient(cc grpc.ClientConnInterface) KeyProviderServiceClient {
	return &keyProviderServiceClient{cc}
}

func (c *keyProviderServiceClient) WrapKey(ctx context.Context, in *KeyProviderKeyWrapProtocolInput, opts ...grpc.CallOption) (*KeyProviderKeyWrapProtocolOutput, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(KeyProviderKeyWrapProtocolOutput)
	err := c.cc.Invoke(ctx, KeyProviderService_WrapKey_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *keyProviderServiceClient) UnWrapKey(ctx context.Context, in *KeyProviderKeyWrapProtocolInput, opts ...grpc.CallOption) (*KeyProviderKeyWrapProtocolOutput, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(KeyProviderKeyWrapProtocolOutput)
	err := c.cc.Invoke(ctx, KeyProviderService_UnWrapKey_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// KeyProviderServiceServer is the server API for KeyProviderService service.
// All implementations must embed UnimplementedKeyProviderServiceServer
// for forward compatibility.
type KeyProviderServiceServer interface {
	WrapKey(context.Context, *KeyProviderKeyWrapProtocolInput) (*KeyProviderKeyWrapProtocolOutput, error)
	UnWrapKey(context.Context, *KeyProviderKeyWrapProtocolInput) (*KeyProviderKeyWrapProtocolOutput, error)
	mustEmbedUnimplementedKeyProviderServiceServer()
}

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

func (UnimplementedKeyProviderServiceServer) WrapKey(context.Context, *KeyProviderKeyWrapProtocolInput) (*KeyProviderKeyWrapProtocolOutput, error) {
	return nil, status.Error(codes.Unimplemented, "method WrapKey not implemented")
}
func (UnimplementedKeyProviderServiceServer) UnWrapKey(context.Context, *KeyProviderKeyWrapProtocolInput) (*KeyProviderKeyWrapProtocolOutput, error) {
	return nil, status.Error(codes.Unimplemented, "method UnWrapKey not implemented")
}
func (UnimplementedKeyProviderServiceServer) mustEmbedUnimplementedKeyProviderServiceServer() {}
func (UnimplementedKeyProviderServiceServer) testEmbeddedByValue()                            {}

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

func RegisterKeyProviderServiceServer(s grpc.ServiceRegistrar, srv KeyProviderServiceServer) {
	// If the following call panics, it indicates UnimplementedKeyProviderServiceServer 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(&KeyProviderService_ServiceDesc, srv)
}

func _KeyProviderService_WrapKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(KeyProviderKeyWrapProtocolInput)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(KeyProviderServiceServer).WrapKey(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: KeyProviderService_WrapKey_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(KeyProviderServiceServer).WrapKey(ctx, req.(*KeyProviderKeyWrapProtocolInput))
	}
	return interceptor(ctx, in, info, handler)
}

func _KeyProviderService_UnWrapKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(KeyProviderKeyWrapProtocolInput)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(KeyProviderServiceServer).UnWrapKey(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: KeyProviderService_UnWrapKey_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(KeyProviderServiceServer).UnWrapKey(ctx, req.(*KeyProviderKeyWrapProtocolInput))
	}
	return interceptor(ctx, in, info, handler)
}

// KeyProviderService_ServiceDesc is the grpc.ServiceDesc for KeyProviderService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var KeyProviderService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "keyprovider.KeyProviderService",
	HandlerType: (*KeyProviderServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "WrapKey",
			Handler:    _KeyProviderService_WrapKey_Handler,
		},
		{
			MethodName: "UnWrapKey",
			Handler:    _KeyProviderService_UnWrapKey_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "keyprovider.proto",
}
