// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc             v5.28.2
// source: upgrades_registry.proto

package upgrades_registry

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 (
	UpgradeRegistry_AddUpgrade_FullMethodName    = "/UpgradeRegistry/AddUpgrade"
	UpgradeRegistry_ListUpgrades_FullMethodName  = "/UpgradeRegistry/ListUpgrades"
	UpgradeRegistry_CancelUpgrade_FullMethodName = "/UpgradeRegistry/CancelUpgrade"
	UpgradeRegistry_ForceSync_FullMethodName     = "/UpgradeRegistry/ForceSync"
)

// UpgradeRegistryClient is the client API for UpgradeRegistry 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 UpgradeRegistryClient interface {
	// register a new upgrade with blazar
	AddUpgrade(ctx context.Context, in *AddUpgradeRequest, opts ...grpc.CallOption) (*AddUpgradeResponse, error)
	// list upgrades registered with blazar
	ListUpgrades(ctx context.Context, in *ListUpgradesRequest, opts ...grpc.CallOption) (*ListUpgradesResponse, error)
	// cancel upgrade
	CancelUpgrade(ctx context.Context, in *CancelUpgradeRequest, opts ...grpc.CallOption) (*CancelUpgradeResponse, error)
	// force the registry to sync the upgrades from all registered providers
	ForceSync(ctx context.Context, in *ForceSyncRequest, opts ...grpc.CallOption) (*ForceSyncResponse, error)
}

type upgradeRegistryClient struct {
	cc grpc.ClientConnInterface
}

func NewUpgradeRegistryClient(cc grpc.ClientConnInterface) UpgradeRegistryClient {
	return &upgradeRegistryClient{cc}
}

func (c *upgradeRegistryClient) AddUpgrade(ctx context.Context, in *AddUpgradeRequest, opts ...grpc.CallOption) (*AddUpgradeResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(AddUpgradeResponse)
	err := c.cc.Invoke(ctx, UpgradeRegistry_AddUpgrade_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *upgradeRegistryClient) ListUpgrades(ctx context.Context, in *ListUpgradesRequest, opts ...grpc.CallOption) (*ListUpgradesResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ListUpgradesResponse)
	err := c.cc.Invoke(ctx, UpgradeRegistry_ListUpgrades_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *upgradeRegistryClient) CancelUpgrade(ctx context.Context, in *CancelUpgradeRequest, opts ...grpc.CallOption) (*CancelUpgradeResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(CancelUpgradeResponse)
	err := c.cc.Invoke(ctx, UpgradeRegistry_CancelUpgrade_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *upgradeRegistryClient) ForceSync(ctx context.Context, in *ForceSyncRequest, opts ...grpc.CallOption) (*ForceSyncResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ForceSyncResponse)
	err := c.cc.Invoke(ctx, UpgradeRegistry_ForceSync_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// UpgradeRegistryServer is the server API for UpgradeRegistry service.
// All implementations must embed UnimplementedUpgradeRegistryServer
// for forward compatibility.
type UpgradeRegistryServer interface {
	// register a new upgrade with blazar
	AddUpgrade(context.Context, *AddUpgradeRequest) (*AddUpgradeResponse, error)
	// list upgrades registered with blazar
	ListUpgrades(context.Context, *ListUpgradesRequest) (*ListUpgradesResponse, error)
	// cancel upgrade
	CancelUpgrade(context.Context, *CancelUpgradeRequest) (*CancelUpgradeResponse, error)
	// force the registry to sync the upgrades from all registered providers
	ForceSync(context.Context, *ForceSyncRequest) (*ForceSyncResponse, error)
	mustEmbedUnimplementedUpgradeRegistryServer()
}

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

func (UnimplementedUpgradeRegistryServer) AddUpgrade(context.Context, *AddUpgradeRequest) (*AddUpgradeResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method AddUpgrade not implemented")
}
func (UnimplementedUpgradeRegistryServer) ListUpgrades(context.Context, *ListUpgradesRequest) (*ListUpgradesResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ListUpgrades not implemented")
}
func (UnimplementedUpgradeRegistryServer) CancelUpgrade(context.Context, *CancelUpgradeRequest) (*CancelUpgradeResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method CancelUpgrade not implemented")
}
func (UnimplementedUpgradeRegistryServer) ForceSync(context.Context, *ForceSyncRequest) (*ForceSyncResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ForceSync not implemented")
}
func (UnimplementedUpgradeRegistryServer) mustEmbedUnimplementedUpgradeRegistryServer() {}
func (UnimplementedUpgradeRegistryServer) testEmbeddedByValue()                         {}

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

func RegisterUpgradeRegistryServer(s grpc.ServiceRegistrar, srv UpgradeRegistryServer) {
	// If the following call pancis, it indicates UnimplementedUpgradeRegistryServer 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(&UpgradeRegistry_ServiceDesc, srv)
}

func _UpgradeRegistry_AddUpgrade_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(AddUpgradeRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(UpgradeRegistryServer).AddUpgrade(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: UpgradeRegistry_AddUpgrade_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(UpgradeRegistryServer).AddUpgrade(ctx, req.(*AddUpgradeRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _UpgradeRegistry_ListUpgrades_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListUpgradesRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(UpgradeRegistryServer).ListUpgrades(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: UpgradeRegistry_ListUpgrades_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(UpgradeRegistryServer).ListUpgrades(ctx, req.(*ListUpgradesRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _UpgradeRegistry_CancelUpgrade_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CancelUpgradeRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(UpgradeRegistryServer).CancelUpgrade(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: UpgradeRegistry_CancelUpgrade_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(UpgradeRegistryServer).CancelUpgrade(ctx, req.(*CancelUpgradeRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _UpgradeRegistry_ForceSync_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ForceSyncRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(UpgradeRegistryServer).ForceSync(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: UpgradeRegistry_ForceSync_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(UpgradeRegistryServer).ForceSync(ctx, req.(*ForceSyncRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// UpgradeRegistry_ServiceDesc is the grpc.ServiceDesc for UpgradeRegistry service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var UpgradeRegistry_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "UpgradeRegistry",
	HandlerType: (*UpgradeRegistryServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "AddUpgrade",
			Handler:    _UpgradeRegistry_AddUpgrade_Handler,
		},
		{
			MethodName: "ListUpgrades",
			Handler:    _UpgradeRegistry_ListUpgrades_Handler,
		},
		{
			MethodName: "CancelUpgrade",
			Handler:    _UpgradeRegistry_CancelUpgrade_Handler,
		},
		{
			MethodName: "ForceSync",
			Handler:    _UpgradeRegistry_ForceSync_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "upgrades_registry.proto",
}
