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

package agentw_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 (
	AgentRegistrar_Register_FullMethodName   = "/gitlab.agent.agent_registrar.agentw.rpc.AgentRegistrar/Register"
	AgentRegistrar_Unregister_FullMethodName = "/gitlab.agent.agent_registrar.agentw.rpc.AgentRegistrar/Unregister"
)

// AgentRegistrarClient is the client API for AgentRegistrar 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 AgentRegistrarClient interface {
	Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error)
	Unregister(ctx context.Context, in *UnregisterRequest, opts ...grpc.CallOption) (*UnregisterResponse, error)
}

type agentRegistrarClient struct {
	cc grpc.ClientConnInterface
}

func NewAgentRegistrarClient(cc grpc.ClientConnInterface) AgentRegistrarClient {
	return &agentRegistrarClient{cc}
}

func (c *agentRegistrarClient) Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(RegisterResponse)
	err := c.cc.Invoke(ctx, AgentRegistrar_Register_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *agentRegistrarClient) Unregister(ctx context.Context, in *UnregisterRequest, opts ...grpc.CallOption) (*UnregisterResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(UnregisterResponse)
	err := c.cc.Invoke(ctx, AgentRegistrar_Unregister_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// AgentRegistrarServer is the server API for AgentRegistrar service.
// All implementations must embed UnimplementedAgentRegistrarServer
// for forward compatibility.
type AgentRegistrarServer interface {
	Register(context.Context, *RegisterRequest) (*RegisterResponse, error)
	Unregister(context.Context, *UnregisterRequest) (*UnregisterResponse, error)
	mustEmbedUnimplementedAgentRegistrarServer()
}

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

func (UnimplementedAgentRegistrarServer) Register(context.Context, *RegisterRequest) (*RegisterResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Register not implemented")
}
func (UnimplementedAgentRegistrarServer) Unregister(context.Context, *UnregisterRequest) (*UnregisterResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Unregister not implemented")
}
func (UnimplementedAgentRegistrarServer) mustEmbedUnimplementedAgentRegistrarServer() {}
func (UnimplementedAgentRegistrarServer) testEmbeddedByValue()                        {}

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

func RegisterAgentRegistrarServer(s grpc.ServiceRegistrar, srv AgentRegistrarServer) {
	// If the following call pancis, it indicates UnimplementedAgentRegistrarServer 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(&AgentRegistrar_ServiceDesc, srv)
}

func _AgentRegistrar_Register_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(RegisterRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AgentRegistrarServer).Register(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: AgentRegistrar_Register_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AgentRegistrarServer).Register(ctx, req.(*RegisterRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _AgentRegistrar_Unregister_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(UnregisterRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AgentRegistrarServer).Unregister(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: AgentRegistrar_Unregister_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AgentRegistrarServer).Unregister(ctx, req.(*UnregisterRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// AgentRegistrar_ServiceDesc is the grpc.ServiceDesc for AgentRegistrar service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var AgentRegistrar_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "gitlab.agent.agent_registrar.agentw.rpc.AgentRegistrar",
	HandlerType: (*AgentRegistrarServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Register",
			Handler:    _AgentRegistrar_Register_Handler,
		},
		{
			MethodName: "Unregister",
			Handler:    _AgentRegistrar_Unregister_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "internal/module/agent_registrar/agentw_rpc/rpc.proto",
}
