// 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/id_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 (
	IdService_Generate_FullMethodName = "/agntcy.identity.node.v1alpha1.IdService/Generate"
	IdService_Resolve_FullMethodName  = "/agntcy.identity.node.v1alpha1.IdService/Resolve"
)

// IdServiceClient is the client API for IdService 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.
//
// IdService is the service that provides ID operations.
type IdServiceClient interface {
	// Generate an Id and its corresponding ResolverMetadata for the specified Issuer
	Generate(ctx context.Context, in *GenerateRequest, opts ...grpc.CallOption) (*GenerateResponse, error)
	// Resolve a specified Id to its corresponding ResolverMetadata
	Resolve(ctx context.Context, in *ResolveRequest, opts ...grpc.CallOption) (*ResolveResponse, error)
}

type idServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewIdServiceClient(cc grpc.ClientConnInterface) IdServiceClient {
	return &idServiceClient{cc}
}

func (c *idServiceClient) Generate(ctx context.Context, in *GenerateRequest, opts ...grpc.CallOption) (*GenerateResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(GenerateResponse)
	err := c.cc.Invoke(ctx, IdService_Generate_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *idServiceClient) Resolve(ctx context.Context, in *ResolveRequest, opts ...grpc.CallOption) (*ResolveResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ResolveResponse)
	err := c.cc.Invoke(ctx, IdService_Resolve_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// IdServiceServer is the server API for IdService service.
// All implementations should embed UnimplementedIdServiceServer
// for forward compatibility.
//
// IdService is the service that provides ID operations.
type IdServiceServer interface {
	// Generate an Id and its corresponding ResolverMetadata for the specified Issuer
	Generate(context.Context, *GenerateRequest) (*GenerateResponse, error)
	// Resolve a specified Id to its corresponding ResolverMetadata
	Resolve(context.Context, *ResolveRequest) (*ResolveResponse, error)
}

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

func (UnimplementedIdServiceServer) Generate(context.Context, *GenerateRequest) (*GenerateResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Generate not implemented")
}
func (UnimplementedIdServiceServer) Resolve(context.Context, *ResolveRequest) (*ResolveResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Resolve not implemented")
}
func (UnimplementedIdServiceServer) testEmbeddedByValue() {}

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

func RegisterIdServiceServer(s grpc.ServiceRegistrar, srv IdServiceServer) {
	// If the following call pancis, it indicates UnimplementedIdServiceServer 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(&IdService_ServiceDesc, srv)
}

func _IdService_Generate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GenerateRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(IdServiceServer).Generate(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: IdService_Generate_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(IdServiceServer).Generate(ctx, req.(*GenerateRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _IdService_Resolve_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ResolveRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(IdServiceServer).Resolve(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: IdService_Resolve_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(IdServiceServer).Resolve(ctx, req.(*ResolveRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// IdService_ServiceDesc is the grpc.ServiceDesc for IdService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var IdService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "agntcy.identity.node.v1alpha1.IdService",
	HandlerType: (*IdServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Generate",
			Handler:    _IdService_Generate_Handler,
		},
		{
			MethodName: "Resolve",
			Handler:    _IdService_Resolve_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "agntcy/identity/node/v1alpha1/id_service.proto",
}
