// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc             v5.29.3
// source: spark_authn.proto

package spark_authn

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 (
	SparkAuthnService_GetChallenge_FullMethodName    = "/spark_authn.SparkAuthnService/get_challenge"
	SparkAuthnService_VerifyChallenge_FullMethodName = "/spark_authn.SparkAuthnService/verify_challenge"
)

// SparkAuthnServiceClient is the client API for SparkAuthnService 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 SparkAuthnServiceClient interface {
	// Request a new authentication challenge for a public key
	GetChallenge(ctx context.Context, in *GetChallengeRequest, opts ...grpc.CallOption) (*GetChallengeResponse, error)
	// Verify a signed challenge and return a session token
	VerifyChallenge(ctx context.Context, in *VerifyChallengeRequest, opts ...grpc.CallOption) (*VerifyChallengeResponse, error)
}

type sparkAuthnServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewSparkAuthnServiceClient(cc grpc.ClientConnInterface) SparkAuthnServiceClient {
	return &sparkAuthnServiceClient{cc}
}

func (c *sparkAuthnServiceClient) GetChallenge(ctx context.Context, in *GetChallengeRequest, opts ...grpc.CallOption) (*GetChallengeResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(GetChallengeResponse)
	err := c.cc.Invoke(ctx, SparkAuthnService_GetChallenge_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *sparkAuthnServiceClient) VerifyChallenge(ctx context.Context, in *VerifyChallengeRequest, opts ...grpc.CallOption) (*VerifyChallengeResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(VerifyChallengeResponse)
	err := c.cc.Invoke(ctx, SparkAuthnService_VerifyChallenge_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// SparkAuthnServiceServer is the server API for SparkAuthnService service.
// All implementations must embed UnimplementedSparkAuthnServiceServer
// for forward compatibility.
type SparkAuthnServiceServer interface {
	// Request a new authentication challenge for a public key
	GetChallenge(context.Context, *GetChallengeRequest) (*GetChallengeResponse, error)
	// Verify a signed challenge and return a session token
	VerifyChallenge(context.Context, *VerifyChallengeRequest) (*VerifyChallengeResponse, error)
	mustEmbedUnimplementedSparkAuthnServiceServer()
}

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

func (UnimplementedSparkAuthnServiceServer) GetChallenge(context.Context, *GetChallengeRequest) (*GetChallengeResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetChallenge not implemented")
}
func (UnimplementedSparkAuthnServiceServer) VerifyChallenge(context.Context, *VerifyChallengeRequest) (*VerifyChallengeResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method VerifyChallenge not implemented")
}
func (UnimplementedSparkAuthnServiceServer) mustEmbedUnimplementedSparkAuthnServiceServer() {}
func (UnimplementedSparkAuthnServiceServer) testEmbeddedByValue()                           {}

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

func RegisterSparkAuthnServiceServer(s grpc.ServiceRegistrar, srv SparkAuthnServiceServer) {
	// If the following call pancis, it indicates UnimplementedSparkAuthnServiceServer 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(&SparkAuthnService_ServiceDesc, srv)
}

func _SparkAuthnService_GetChallenge_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetChallengeRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SparkAuthnServiceServer).GetChallenge(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: SparkAuthnService_GetChallenge_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SparkAuthnServiceServer).GetChallenge(ctx, req.(*GetChallengeRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _SparkAuthnService_VerifyChallenge_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(VerifyChallengeRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SparkAuthnServiceServer).VerifyChallenge(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: SparkAuthnService_VerifyChallenge_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SparkAuthnServiceServer).VerifyChallenge(ctx, req.(*VerifyChallengeRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// SparkAuthnService_ServiceDesc is the grpc.ServiceDesc for SparkAuthnService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var SparkAuthnService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "spark_authn.SparkAuthnService",
	HandlerType: (*SparkAuthnServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "get_challenge",
			Handler:    _SparkAuthnService_GetChallenge_Handler,
		},
		{
			MethodName: "verify_challenge",
			Handler:    _SparkAuthnService_VerifyChallenge_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "spark_authn.proto",
}
