// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc             v5.27.3
// source: v3/internal/com_newrelic_trace_v1/v1.proto

package com_newrelic_trace_v1

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.32.0 or later.
const _ = grpc.SupportPackageIsVersion7

// IngestServiceClient is the client API for IngestService 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 IngestServiceClient interface {
	// Accepts a stream of Span messages, and returns an irregular stream of
	// RecordStatus messages.
	RecordSpan(ctx context.Context, opts ...grpc.CallOption) (IngestService_RecordSpanClient, error)
	// Accepts a stream of SpanBatch messages, and returns an irregular
	// stream of RecordStatus messages. This endpoint can be used to improve
	// throughput when Span messages are small
	RecordSpanBatch(ctx context.Context, opts ...grpc.CallOption) (IngestService_RecordSpanBatchClient, error)
}

type ingestServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewIngestServiceClient(cc grpc.ClientConnInterface) IngestServiceClient {
	return &ingestServiceClient{cc}
}

func (c *ingestServiceClient) RecordSpan(ctx context.Context, opts ...grpc.CallOption) (IngestService_RecordSpanClient, error) {
	stream, err := c.cc.NewStream(ctx, &IngestService_ServiceDesc.Streams[0], "/com.newrelic.trace.v1.IngestService/RecordSpan", opts...)
	if err != nil {
		return nil, err
	}
	x := &ingestServiceRecordSpanClient{stream}
	return x, nil
}

type IngestService_RecordSpanClient interface {
	Send(*Span) error
	Recv() (*RecordStatus, error)
	grpc.ClientStream
}

type ingestServiceRecordSpanClient struct {
	grpc.ClientStream
}

func (x *ingestServiceRecordSpanClient) Send(m *Span) error {
	return x.ClientStream.SendMsg(m)
}

func (x *ingestServiceRecordSpanClient) Recv() (*RecordStatus, error) {
	m := new(RecordStatus)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

func (c *ingestServiceClient) RecordSpanBatch(ctx context.Context, opts ...grpc.CallOption) (IngestService_RecordSpanBatchClient, error) {
	stream, err := c.cc.NewStream(ctx, &IngestService_ServiceDesc.Streams[1], "/com.newrelic.trace.v1.IngestService/RecordSpanBatch", opts...)
	if err != nil {
		return nil, err
	}
	x := &ingestServiceRecordSpanBatchClient{stream}
	return x, nil
}

type IngestService_RecordSpanBatchClient interface {
	Send(*SpanBatch) error
	Recv() (*RecordStatus, error)
	grpc.ClientStream
}

type ingestServiceRecordSpanBatchClient struct {
	grpc.ClientStream
}

func (x *ingestServiceRecordSpanBatchClient) Send(m *SpanBatch) error {
	return x.ClientStream.SendMsg(m)
}

func (x *ingestServiceRecordSpanBatchClient) Recv() (*RecordStatus, error) {
	m := new(RecordStatus)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

// IngestServiceServer is the server API for IngestService service.
// All implementations must embed UnimplementedIngestServiceServer
// for forward compatibility
type IngestServiceServer interface {
	// Accepts a stream of Span messages, and returns an irregular stream of
	// RecordStatus messages.
	RecordSpan(IngestService_RecordSpanServer) error
	// Accepts a stream of SpanBatch messages, and returns an irregular
	// stream of RecordStatus messages. This endpoint can be used to improve
	// throughput when Span messages are small
	RecordSpanBatch(IngestService_RecordSpanBatchServer) error
	mustEmbedUnimplementedIngestServiceServer()
}

// UnimplementedIngestServiceServer must be embedded to have forward compatible implementations.
type UnimplementedIngestServiceServer struct {
}

func (UnimplementedIngestServiceServer) RecordSpan(IngestService_RecordSpanServer) error {
	return status.Errorf(codes.Unimplemented, "method RecordSpan not implemented")
}
func (UnimplementedIngestServiceServer) RecordSpanBatch(IngestService_RecordSpanBatchServer) error {
	return status.Errorf(codes.Unimplemented, "method RecordSpanBatch not implemented")
}
func (UnimplementedIngestServiceServer) mustEmbedUnimplementedIngestServiceServer() {}

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

func RegisterIngestServiceServer(s grpc.ServiceRegistrar, srv IngestServiceServer) {
	s.RegisterService(&IngestService_ServiceDesc, srv)
}

func _IngestService_RecordSpan_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(IngestServiceServer).RecordSpan(&ingestServiceRecordSpanServer{stream})
}

type IngestService_RecordSpanServer interface {
	Send(*RecordStatus) error
	Recv() (*Span, error)
	grpc.ServerStream
}

type ingestServiceRecordSpanServer struct {
	grpc.ServerStream
}

func (x *ingestServiceRecordSpanServer) Send(m *RecordStatus) error {
	return x.ServerStream.SendMsg(m)
}

func (x *ingestServiceRecordSpanServer) Recv() (*Span, error) {
	m := new(Span)
	if err := x.ServerStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

func _IngestService_RecordSpanBatch_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(IngestServiceServer).RecordSpanBatch(&ingestServiceRecordSpanBatchServer{stream})
}

type IngestService_RecordSpanBatchServer interface {
	Send(*RecordStatus) error
	Recv() (*SpanBatch, error)
	grpc.ServerStream
}

type ingestServiceRecordSpanBatchServer struct {
	grpc.ServerStream
}

func (x *ingestServiceRecordSpanBatchServer) Send(m *RecordStatus) error {
	return x.ServerStream.SendMsg(m)
}

func (x *ingestServiceRecordSpanBatchServer) Recv() (*SpanBatch, error) {
	m := new(SpanBatch)
	if err := x.ServerStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

// IngestService_ServiceDesc is the grpc.ServiceDesc for IngestService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var IngestService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "com.newrelic.trace.v1.IngestService",
	HandlerType: (*IngestServiceServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "RecordSpan",
			Handler:       _IngestService_RecordSpan_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
		{
			StreamName:    "RecordSpanBatch",
			Handler:       _IngestService_RecordSpanBatch_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "v3/internal/com_newrelic_trace_v1/v1.proto",
}
