// Copyright 2025 AGNTCY Contributors (https://github.com/agntcy)
// SPDX-License-Identifier: Apache-2.0

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc             (unknown)
// source: agntcy/identity/issuer/v1alpha1/local_service.proto

package identity_issuer_sdk_go

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 (
	LocalService_KeyGen_FullMethodName  = "/agntcy.identity.issuer.v1alpha1.LocalService/KeyGen"
	LocalService_IssueVC_FullMethodName = "/agntcy.identity.issuer.v1alpha1.LocalService/IssueVC"
)

// LocalServiceClient is the client API for LocalService 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.
//
// LocalService is the service that provides LOCAL issuer operations.
type LocalServiceClient interface {
	// Generate a keypair in Json Web Key (JWK) format
	KeyGen(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*KeyGenResponse, error)
	// Issue a Verifiable Credential in a specific Envelope Type
	IssueVC(ctx context.Context, in *IssueVCRequest, opts ...grpc.CallOption) (*IssueVCResponse, error)
}

type localServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewLocalServiceClient(cc grpc.ClientConnInterface) LocalServiceClient {
	return &localServiceClient{cc}
}

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

func (c *localServiceClient) IssueVC(ctx context.Context, in *IssueVCRequest, opts ...grpc.CallOption) (*IssueVCResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(IssueVCResponse)
	err := c.cc.Invoke(ctx, LocalService_IssueVC_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// LocalServiceServer is the server API for LocalService service.
// All implementations should embed UnimplementedLocalServiceServer
// for forward compatibility.
//
// LocalService is the service that provides LOCAL issuer operations.
type LocalServiceServer interface {
	// Generate a keypair in Json Web Key (JWK) format
	KeyGen(context.Context, *emptypb.Empty) (*KeyGenResponse, error)
	// Issue a Verifiable Credential in a specific Envelope Type
	IssueVC(context.Context, *IssueVCRequest) (*IssueVCResponse, error)
}

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

func (UnimplementedLocalServiceServer) KeyGen(context.Context, *emptypb.Empty) (*KeyGenResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method KeyGen not implemented")
}
func (UnimplementedLocalServiceServer) IssueVC(context.Context, *IssueVCRequest) (*IssueVCResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method IssueVC not implemented")
}
func (UnimplementedLocalServiceServer) testEmbeddedByValue() {}

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

func RegisterLocalServiceServer(s grpc.ServiceRegistrar, srv LocalServiceServer) {
	// If the following call pancis, it indicates UnimplementedLocalServiceServer 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(&LocalService_ServiceDesc, srv)
}

func _LocalService_KeyGen_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(emptypb.Empty)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LocalServiceServer).KeyGen(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: LocalService_KeyGen_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LocalServiceServer).KeyGen(ctx, req.(*emptypb.Empty))
	}
	return interceptor(ctx, in, info, handler)
}

func _LocalService_IssueVC_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(IssueVCRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LocalServiceServer).IssueVC(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: LocalService_IssueVC_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LocalServiceServer).IssueVC(ctx, req.(*IssueVCRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// LocalService_ServiceDesc is the grpc.ServiceDesc for LocalService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var LocalService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "agntcy.identity.issuer.v1alpha1.LocalService",
	HandlerType: (*LocalServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "KeyGen",
			Handler:    _LocalService_KeyGen_Handler,
		},
		{
			MethodName: "IssueVC",
			Handler:    _LocalService_IssueVC_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "agntcy/identity/issuer/v1alpha1/local_service.proto",
}
