// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.1
// - protoc             (unknown)
// source: runtime/v1/related_counts.proto

package runtimev1

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 (
	RelatedRecordCountService_CountRelatedRecords_FullMethodName = "/nexuscrm.runtime.v1.RelatedRecordCountService/CountRelatedRecords"
)

// RelatedRecordCountServiceClient is the client API for RelatedRecordCountService 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.
//
// RelatedRecordCountService executes one bounded, already-normalized batch of
// relationship-field counts. Product route grammar and response projection
// remain caller-owned and never cross this boundary.
type RelatedRecordCountServiceClient interface {
	CountRelatedRecords(ctx context.Context, in *CountRelatedRecordsRequest, opts ...grpc.CallOption) (*CountRelatedRecordsResponse, error)
}

type relatedRecordCountServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewRelatedRecordCountServiceClient(cc grpc.ClientConnInterface) RelatedRecordCountServiceClient {
	return &relatedRecordCountServiceClient{cc}
}

func (c *relatedRecordCountServiceClient) CountRelatedRecords(ctx context.Context, in *CountRelatedRecordsRequest, opts ...grpc.CallOption) (*CountRelatedRecordsResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(CountRelatedRecordsResponse)
	err := c.cc.Invoke(ctx, RelatedRecordCountService_CountRelatedRecords_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// RelatedRecordCountServiceServer is the server API for RelatedRecordCountService service.
// All implementations must embed UnimplementedRelatedRecordCountServiceServer
// for forward compatibility.
//
// RelatedRecordCountService executes one bounded, already-normalized batch of
// relationship-field counts. Product route grammar and response projection
// remain caller-owned and never cross this boundary.
type RelatedRecordCountServiceServer interface {
	CountRelatedRecords(context.Context, *CountRelatedRecordsRequest) (*CountRelatedRecordsResponse, error)
	mustEmbedUnimplementedRelatedRecordCountServiceServer()
}

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

func (UnimplementedRelatedRecordCountServiceServer) CountRelatedRecords(context.Context, *CountRelatedRecordsRequest) (*CountRelatedRecordsResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method CountRelatedRecords not implemented")
}
func (UnimplementedRelatedRecordCountServiceServer) mustEmbedUnimplementedRelatedRecordCountServiceServer() {
}
func (UnimplementedRelatedRecordCountServiceServer) testEmbeddedByValue() {}

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

func RegisterRelatedRecordCountServiceServer(s grpc.ServiceRegistrar, srv RelatedRecordCountServiceServer) {
	// If the following call panics, it indicates UnimplementedRelatedRecordCountServiceServer 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(&RelatedRecordCountService_ServiceDesc, srv)
}

func _RelatedRecordCountService_CountRelatedRecords_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CountRelatedRecordsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RelatedRecordCountServiceServer).CountRelatedRecords(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: RelatedRecordCountService_CountRelatedRecords_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RelatedRecordCountServiceServer).CountRelatedRecords(ctx, req.(*CountRelatedRecordsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// RelatedRecordCountService_ServiceDesc is the grpc.ServiceDesc for RelatedRecordCountService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var RelatedRecordCountService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "nexuscrm.runtime.v1.RelatedRecordCountService",
	HandlerType: (*RelatedRecordCountServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CountRelatedRecords",
			Handler:    _RelatedRecordCountService_CountRelatedRecords_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "runtime/v1/related_counts.proto",
}
