// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc             v4.23.4
// source: audio_streaming.proto

package protogen

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 (
	AsrService_Send_FullMethodName = "/com.baidu.acu.pie.AsrService/send"
)

// AsrServiceClient is the client API for AsrService 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 AsrServiceClient interface {
	Send(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[AudioFragmentRequest, AudioFragmentResponse], error)
}

type asrServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewAsrServiceClient(cc grpc.ClientConnInterface) AsrServiceClient {
	return &asrServiceClient{cc}
}

func (c *asrServiceClient) Send(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[AudioFragmentRequest, AudioFragmentResponse], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &AsrService_ServiceDesc.Streams[0], AsrService_Send_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[AudioFragmentRequest, AudioFragmentResponse]{ClientStream: stream}
	return x, nil
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type AsrService_SendClient = grpc.BidiStreamingClient[AudioFragmentRequest, AudioFragmentResponse]

// AsrServiceServer is the server API for AsrService service.
// All implementations must embed UnimplementedAsrServiceServer
// for forward compatibility.
type AsrServiceServer interface {
	Send(grpc.BidiStreamingServer[AudioFragmentRequest, AudioFragmentResponse]) error
	mustEmbedUnimplementedAsrServiceServer()
}

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

func (UnimplementedAsrServiceServer) Send(grpc.BidiStreamingServer[AudioFragmentRequest, AudioFragmentResponse]) error {
	return status.Errorf(codes.Unimplemented, "method Send not implemented")
}
func (UnimplementedAsrServiceServer) mustEmbedUnimplementedAsrServiceServer() {}
func (UnimplementedAsrServiceServer) testEmbeddedByValue()                    {}

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

func RegisterAsrServiceServer(s grpc.ServiceRegistrar, srv AsrServiceServer) {
	// If the following call pancis, it indicates UnimplementedAsrServiceServer 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(&AsrService_ServiceDesc, srv)
}

func _AsrService_Send_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(AsrServiceServer).Send(&grpc.GenericServerStream[AudioFragmentRequest, AudioFragmentResponse]{ServerStream: stream})
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type AsrService_SendServer = grpc.BidiStreamingServer[AudioFragmentRequest, AudioFragmentResponse]

// AsrService_ServiceDesc is the grpc.ServiceDesc for AsrService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var AsrService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "com.baidu.acu.pie.AsrService",
	HandlerType: (*AsrServiceServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "send",
			Handler:       _AsrService_Send_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "audio_streaming.proto",
}
