// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc             v3.21.7
// source: internal/module/gitops/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.32.0 or later.
const _ = grpc.SupportPackageIsVersion7

// GitopsClient is the client API for Gitops 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 GitopsClient interface {
	GetObjectsToSynchronize(ctx context.Context, in *ObjectsToSynchronizeRequest, opts ...grpc.CallOption) (Gitops_GetObjectsToSynchronizeClient, error)
}

type gitopsClient struct {
	cc grpc.ClientConnInterface
}

func NewGitopsClient(cc grpc.ClientConnInterface) GitopsClient {
	return &gitopsClient{cc}
}

func (c *gitopsClient) GetObjectsToSynchronize(ctx context.Context, in *ObjectsToSynchronizeRequest, opts ...grpc.CallOption) (Gitops_GetObjectsToSynchronizeClient, error) {
	stream, err := c.cc.NewStream(ctx, &Gitops_ServiceDesc.Streams[0], "/gitlab.agent.gitops.rpc.Gitops/GetObjectsToSynchronize", opts...)
	if err != nil {
		return nil, err
	}
	x := &gitopsGetObjectsToSynchronizeClient{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
}

type Gitops_GetObjectsToSynchronizeClient interface {
	Recv() (*ObjectsToSynchronizeResponse, error)
	grpc.ClientStream
}

type gitopsGetObjectsToSynchronizeClient struct {
	grpc.ClientStream
}

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

// GitopsServer is the server API for Gitops service.
// All implementations must embed UnimplementedGitopsServer
// for forward compatibility
type GitopsServer interface {
	GetObjectsToSynchronize(*ObjectsToSynchronizeRequest, Gitops_GetObjectsToSynchronizeServer) error
	mustEmbedUnimplementedGitopsServer()
}

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

func (UnimplementedGitopsServer) GetObjectsToSynchronize(*ObjectsToSynchronizeRequest, Gitops_GetObjectsToSynchronizeServer) error {
	return status.Errorf(codes.Unimplemented, "method GetObjectsToSynchronize not implemented")
}
func (UnimplementedGitopsServer) mustEmbedUnimplementedGitopsServer() {}

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

func RegisterGitopsServer(s grpc.ServiceRegistrar, srv GitopsServer) {
	s.RegisterService(&Gitops_ServiceDesc, srv)
}

func _Gitops_GetObjectsToSynchronize_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(ObjectsToSynchronizeRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(GitopsServer).GetObjectsToSynchronize(m, &gitopsGetObjectsToSynchronizeServer{stream})
}

type Gitops_GetObjectsToSynchronizeServer interface {
	Send(*ObjectsToSynchronizeResponse) error
	grpc.ServerStream
}

type gitopsGetObjectsToSynchronizeServer struct {
	grpc.ServerStream
}

func (x *gitopsGetObjectsToSynchronizeServer) Send(m *ObjectsToSynchronizeResponse) error {
	return x.ServerStream.SendMsg(m)
}

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