// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc             v6.33.1
// source: internal/module/flux/rpc/rpc.proto

package rpc

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 (
	GitLabFlux_ReconcileProjects_FullMethodName = "/gitlab.agent.flux.rpc.GitLabFlux/ReconcileProjects"
)

// GitLabFluxClient is the client API for GitLabFlux 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 GitLabFluxClient interface {
	ReconcileProjects(ctx context.Context, in *ReconcileProjectsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ReconcileProjectsResponse], error)
}

type gitLabFluxClient struct {
	cc grpc.ClientConnInterface
}

func NewGitLabFluxClient(cc grpc.ClientConnInterface) GitLabFluxClient {
	return &gitLabFluxClient{cc}
}

func (c *gitLabFluxClient) ReconcileProjects(ctx context.Context, in *ReconcileProjectsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ReconcileProjectsResponse], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &GitLabFlux_ServiceDesc.Streams[0], GitLabFlux_ReconcileProjects_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[ReconcileProjectsRequest, ReconcileProjectsResponse]{ClientStream: stream}
	if err := x.ClientStream.SendMsg(in); err != nil {
		return nil, err
	}
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	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 GitLabFlux_ReconcileProjectsClient = grpc.ServerStreamingClient[ReconcileProjectsResponse]

// GitLabFluxServer is the server API for GitLabFlux service.
// All implementations must embed UnimplementedGitLabFluxServer
// for forward compatibility.
type GitLabFluxServer interface {
	ReconcileProjects(*ReconcileProjectsRequest, grpc.ServerStreamingServer[ReconcileProjectsResponse]) error
	mustEmbedUnimplementedGitLabFluxServer()
}

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

func (UnimplementedGitLabFluxServer) ReconcileProjects(*ReconcileProjectsRequest, grpc.ServerStreamingServer[ReconcileProjectsResponse]) error {
	return status.Errorf(codes.Unimplemented, "method ReconcileProjects not implemented")
}
func (UnimplementedGitLabFluxServer) mustEmbedUnimplementedGitLabFluxServer() {}
func (UnimplementedGitLabFluxServer) testEmbeddedByValue()                    {}

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

func RegisterGitLabFluxServer(s grpc.ServiceRegistrar, srv GitLabFluxServer) {
	// If the following call pancis, it indicates UnimplementedGitLabFluxServer 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(&GitLabFlux_ServiceDesc, srv)
}

func _GitLabFlux_ReconcileProjects_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(ReconcileProjectsRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(GitLabFluxServer).ReconcileProjects(m, &grpc.GenericServerStream[ReconcileProjectsRequest, ReconcileProjectsResponse]{ServerStream: stream})
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type GitLabFlux_ReconcileProjectsServer = grpc.ServerStreamingServer[ReconcileProjectsResponse]

// GitLabFlux_ServiceDesc is the grpc.ServiceDesc for GitLabFlux service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var GitLabFlux_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "gitlab.agent.flux.rpc.GitLabFlux",
	HandlerType: (*GitLabFluxServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "ReconcileProjects",
			Handler:       _GitLabFlux_ReconcileProjects_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "internal/module/flux/rpc/rpc.proto",
}
