// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc             v4.23.1
// source: analysis.proto

package gitalypb

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

const (
	AnalysisService_CheckBlobsGenerated_FullMethodName = "/gitaly.AnalysisService/CheckBlobsGenerated"
)

// AnalysisServiceClient is the client API for AnalysisService 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 AnalysisServiceClient interface {
	// CheckBlobsGenerated checks a provided set of blobs in a specified repository to determine
	// whether the file is considered generated. This RPC supports bidirectional streaming because the
	// client may specify any number of files to check across multiple request messages and the server
	// responds to each request with a separate set of response messages.
	//
	// Each provided blob in the request is validated when received. Improperly formatted requests
	// result in RPC termination and an error being returned to the client. The RPC also aborts and
	// returns an error if requests are made that list Git revisions which do not resolve to a blob
	// and/or cannot be found in the repository.
	CheckBlobsGenerated(ctx context.Context, opts ...grpc.CallOption) (AnalysisService_CheckBlobsGeneratedClient, error)
}

type analysisServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewAnalysisServiceClient(cc grpc.ClientConnInterface) AnalysisServiceClient {
	return &analysisServiceClient{cc}
}

func (c *analysisServiceClient) CheckBlobsGenerated(ctx context.Context, opts ...grpc.CallOption) (AnalysisService_CheckBlobsGeneratedClient, error) {
	stream, err := c.cc.NewStream(ctx, &AnalysisService_ServiceDesc.Streams[0], AnalysisService_CheckBlobsGenerated_FullMethodName, opts...)
	if err != nil {
		return nil, err
	}
	x := &analysisServiceCheckBlobsGeneratedClient{stream}
	return x, nil
}

type AnalysisService_CheckBlobsGeneratedClient interface {
	Send(*CheckBlobsGeneratedRequest) error
	Recv() (*CheckBlobsGeneratedResponse, error)
	grpc.ClientStream
}

type analysisServiceCheckBlobsGeneratedClient struct {
	grpc.ClientStream
}

func (x *analysisServiceCheckBlobsGeneratedClient) Send(m *CheckBlobsGeneratedRequest) error {
	return x.ClientStream.SendMsg(m)
}

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

// AnalysisServiceServer is the server API for AnalysisService service.
// All implementations must embed UnimplementedAnalysisServiceServer
// for forward compatibility
type AnalysisServiceServer interface {
	// CheckBlobsGenerated checks a provided set of blobs in a specified repository to determine
	// whether the file is considered generated. This RPC supports bidirectional streaming because the
	// client may specify any number of files to check across multiple request messages and the server
	// responds to each request with a separate set of response messages.
	//
	// Each provided blob in the request is validated when received. Improperly formatted requests
	// result in RPC termination and an error being returned to the client. The RPC also aborts and
	// returns an error if requests are made that list Git revisions which do not resolve to a blob
	// and/or cannot be found in the repository.
	CheckBlobsGenerated(AnalysisService_CheckBlobsGeneratedServer) error
	mustEmbedUnimplementedAnalysisServiceServer()
}

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

func (UnimplementedAnalysisServiceServer) CheckBlobsGenerated(AnalysisService_CheckBlobsGeneratedServer) error {
	return status.Errorf(codes.Unimplemented, "method CheckBlobsGenerated not implemented")
}
func (UnimplementedAnalysisServiceServer) mustEmbedUnimplementedAnalysisServiceServer() {}

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

func RegisterAnalysisServiceServer(s grpc.ServiceRegistrar, srv AnalysisServiceServer) {
	s.RegisterService(&AnalysisService_ServiceDesc, srv)
}

func _AnalysisService_CheckBlobsGenerated_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(AnalysisServiceServer).CheckBlobsGenerated(&analysisServiceCheckBlobsGeneratedServer{stream})
}

type AnalysisService_CheckBlobsGeneratedServer interface {
	Send(*CheckBlobsGeneratedResponse) error
	Recv() (*CheckBlobsGeneratedRequest, error)
	grpc.ServerStream
}

type analysisServiceCheckBlobsGeneratedServer struct {
	grpc.ServerStream
}

func (x *analysisServiceCheckBlobsGeneratedServer) Send(m *CheckBlobsGeneratedResponse) error {
	return x.ServerStream.SendMsg(m)
}

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

// AnalysisService_ServiceDesc is the grpc.ServiceDesc for AnalysisService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var AnalysisService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "gitaly.AnalysisService",
	HandlerType: (*AnalysisServiceServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "CheckBlobsGenerated",
			Handler:       _AnalysisService_CheckBlobsGenerated_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "analysis.proto",
}
