// 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/service/v1alpha1/badge_service.proto

package identity_service_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 (
	BadgeService_IssueBadge_FullMethodName  = "/agntcy.identity.service.v1alpha1.BadgeService/IssueBadge"
	BadgeService_VerifyBadge_FullMethodName = "/agntcy.identity.service.v1alpha1.BadgeService/VerifyBadge"
)

// BadgeServiceClient is the client API for BadgeService 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.
//
// BadgeService manages badges.
type BadgeServiceClient interface {
	// Create a new Badge.
	IssueBadge(ctx context.Context, in *IssueBadgeRequest, opts ...grpc.CallOption) (*Badge, error)
	// Verify a badge.
	VerifyBadge(ctx context.Context, in *VerifyBadgeRequest, opts ...grpc.CallOption) (*VerificationResult, error)
}

type badgeServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewBadgeServiceClient(cc grpc.ClientConnInterface) BadgeServiceClient {
	return &badgeServiceClient{cc}
}

func (c *badgeServiceClient) IssueBadge(ctx context.Context, in *IssueBadgeRequest, opts ...grpc.CallOption) (*Badge, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(Badge)
	err := c.cc.Invoke(ctx, BadgeService_IssueBadge_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *badgeServiceClient) VerifyBadge(ctx context.Context, in *VerifyBadgeRequest, opts ...grpc.CallOption) (*VerificationResult, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(VerificationResult)
	err := c.cc.Invoke(ctx, BadgeService_VerifyBadge_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// BadgeServiceServer is the server API for BadgeService service.
// All implementations should embed UnimplementedBadgeServiceServer
// for forward compatibility.
//
// BadgeService manages badges.
type BadgeServiceServer interface {
	// Create a new Badge.
	IssueBadge(context.Context, *IssueBadgeRequest) (*Badge, error)
	// Verify a badge.
	VerifyBadge(context.Context, *VerifyBadgeRequest) (*VerificationResult, error)
}

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

func (UnimplementedBadgeServiceServer) IssueBadge(context.Context, *IssueBadgeRequest) (*Badge, error) {
	return nil, status.Errorf(codes.Unimplemented, "method IssueBadge not implemented")
}
func (UnimplementedBadgeServiceServer) VerifyBadge(context.Context, *VerifyBadgeRequest) (*VerificationResult, error) {
	return nil, status.Errorf(codes.Unimplemented, "method VerifyBadge not implemented")
}
func (UnimplementedBadgeServiceServer) testEmbeddedByValue() {}

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

func RegisterBadgeServiceServer(s grpc.ServiceRegistrar, srv BadgeServiceServer) {
	// If the following call pancis, it indicates UnimplementedBadgeServiceServer 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(&BadgeService_ServiceDesc, srv)
}

func _BadgeService_IssueBadge_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(IssueBadgeRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(BadgeServiceServer).IssueBadge(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: BadgeService_IssueBadge_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(BadgeServiceServer).IssueBadge(ctx, req.(*IssueBadgeRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _BadgeService_VerifyBadge_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(VerifyBadgeRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(BadgeServiceServer).VerifyBadge(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: BadgeService_VerifyBadge_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(BadgeServiceServer).VerifyBadge(ctx, req.(*VerifyBadgeRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// BadgeService_ServiceDesc is the grpc.ServiceDesc for BadgeService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var BadgeService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "agntcy.identity.service.v1alpha1.BadgeService",
	HandlerType: (*BadgeServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "IssueBadge",
			Handler:    _BadgeService_IssueBadge_Handler,
		},
		{
			MethodName: "VerifyBadge",
			Handler:    _BadgeService_VerifyBadge_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "agntcy/identity/service/v1alpha1/badge_service.proto",
}
