// 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/node/v1alpha1/issuer_service.proto

package identity_node_sdk_go

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 (
	IssuerService_Register_FullMethodName     = "/agntcy.identity.node.v1alpha1.IssuerService/Register"
	IssuerService_GetWellKnown_FullMethodName = "/agntcy.identity.node.v1alpha1.IssuerService/GetWellKnown"
)

// IssuerServiceClient is the client API for IssuerService 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.
//
// IssuerService is the service that provides ISSUER node operations.
type IssuerServiceClient interface {
	// Register an issuer by providing the issuer details
	Register(ctx context.Context, in *RegisterIssuerRequest, opts ...grpc.CallOption) (*RegisterIssuerResponse, error)
	// Returns the well-known document content for an issuer in
	// Json Web Key Set (JWKS) format
	GetWellKnown(ctx context.Context, in *GetIssuerWellKnownRequest, opts ...grpc.CallOption) (*GetIssuerWellKnownResponse, error)
}

type issuerServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewIssuerServiceClient(cc grpc.ClientConnInterface) IssuerServiceClient {
	return &issuerServiceClient{cc}
}

func (c *issuerServiceClient) Register(ctx context.Context, in *RegisterIssuerRequest, opts ...grpc.CallOption) (*RegisterIssuerResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(RegisterIssuerResponse)
	err := c.cc.Invoke(ctx, IssuerService_Register_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *issuerServiceClient) GetWellKnown(ctx context.Context, in *GetIssuerWellKnownRequest, opts ...grpc.CallOption) (*GetIssuerWellKnownResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(GetIssuerWellKnownResponse)
	err := c.cc.Invoke(ctx, IssuerService_GetWellKnown_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// IssuerServiceServer is the server API for IssuerService service.
// All implementations should embed UnimplementedIssuerServiceServer
// for forward compatibility.
//
// IssuerService is the service that provides ISSUER node operations.
type IssuerServiceServer interface {
	// Register an issuer by providing the issuer details
	Register(context.Context, *RegisterIssuerRequest) (*RegisterIssuerResponse, error)
	// Returns the well-known document content for an issuer in
	// Json Web Key Set (JWKS) format
	GetWellKnown(context.Context, *GetIssuerWellKnownRequest) (*GetIssuerWellKnownResponse, error)
}

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

func (UnimplementedIssuerServiceServer) Register(context.Context, *RegisterIssuerRequest) (*RegisterIssuerResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Register not implemented")
}
func (UnimplementedIssuerServiceServer) GetWellKnown(context.Context, *GetIssuerWellKnownRequest) (*GetIssuerWellKnownResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetWellKnown not implemented")
}
func (UnimplementedIssuerServiceServer) testEmbeddedByValue() {}

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

func RegisterIssuerServiceServer(s grpc.ServiceRegistrar, srv IssuerServiceServer) {
	// If the following call pancis, it indicates UnimplementedIssuerServiceServer 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(&IssuerService_ServiceDesc, srv)
}

func _IssuerService_Register_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(RegisterIssuerRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(IssuerServiceServer).Register(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: IssuerService_Register_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(IssuerServiceServer).Register(ctx, req.(*RegisterIssuerRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _IssuerService_GetWellKnown_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetIssuerWellKnownRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(IssuerServiceServer).GetWellKnown(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: IssuerService_GetWellKnown_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(IssuerServiceServer).GetWellKnown(ctx, req.(*GetIssuerWellKnownRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// IssuerService_ServiceDesc is the grpc.ServiceDesc for IssuerService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var IssuerService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "agntcy.identity.node.v1alpha1.IssuerService",
	HandlerType: (*IssuerServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Register",
			Handler:    _IssuerService_Register_Handler,
		},
		{
			MethodName: "GetWellKnown",
			Handler:    _IssuerService_GetWellKnown_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "agntcy/identity/node/v1alpha1/issuer_service.proto",
}
