// 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/gitlab_access/rpc/rpc.proto

package rpc

import (
	context "context"

	grpctool "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/grpctool"
	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

// GitlabAccessClient is the client API for GitlabAccess 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 GitlabAccessClient interface {
	MakeRequest(ctx context.Context, opts ...grpc.CallOption) (GitlabAccess_MakeRequestClient, error)
}

type gitlabAccessClient struct {
	cc grpc.ClientConnInterface
}

func NewGitlabAccessClient(cc grpc.ClientConnInterface) GitlabAccessClient {
	return &gitlabAccessClient{cc}
}

func (c *gitlabAccessClient) MakeRequest(ctx context.Context, opts ...grpc.CallOption) (GitlabAccess_MakeRequestClient, error) {
	stream, err := c.cc.NewStream(ctx, &GitlabAccess_ServiceDesc.Streams[0], "/gitlab.agent.gitlab_access.rpc.GitlabAccess/MakeRequest", opts...)
	if err != nil {
		return nil, err
	}
	x := &gitlabAccessMakeRequestClient{stream}
	return x, nil
}

type GitlabAccess_MakeRequestClient interface {
	Send(*grpctool.HttpRequest) error
	Recv() (*grpctool.HttpResponse, error)
	grpc.ClientStream
}

type gitlabAccessMakeRequestClient struct {
	grpc.ClientStream
}

func (x *gitlabAccessMakeRequestClient) Send(m *grpctool.HttpRequest) error {
	return x.ClientStream.SendMsg(m)
}

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

// GitlabAccessServer is the server API for GitlabAccess service.
// All implementations must embed UnimplementedGitlabAccessServer
// for forward compatibility
type GitlabAccessServer interface {
	MakeRequest(GitlabAccess_MakeRequestServer) error
	mustEmbedUnimplementedGitlabAccessServer()
}

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

func (UnimplementedGitlabAccessServer) MakeRequest(GitlabAccess_MakeRequestServer) error {
	return status.Errorf(codes.Unimplemented, "method MakeRequest not implemented")
}
func (UnimplementedGitlabAccessServer) mustEmbedUnimplementedGitlabAccessServer() {}

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

func RegisterGitlabAccessServer(s grpc.ServiceRegistrar, srv GitlabAccessServer) {
	s.RegisterService(&GitlabAccess_ServiceDesc, srv)
}

func _GitlabAccess_MakeRequest_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(GitlabAccessServer).MakeRequest(&gitlabAccessMakeRequestServer{stream})
}

type GitlabAccess_MakeRequestServer interface {
	Send(*grpctool.HttpResponse) error
	Recv() (*grpctool.HttpRequest, error)
	grpc.ServerStream
}

type gitlabAccessMakeRequestServer struct {
	grpc.ServerStream
}

func (x *gitlabAccessMakeRequestServer) Send(m *grpctool.HttpResponse) error {
	return x.ServerStream.SendMsg(m)
}

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

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