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

package version_resolver

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 (
	VersionResolver_AddVersion_FullMethodName   = "/VersionResolver/AddVersion"
	VersionResolver_GetVersion_FullMethodName   = "/VersionResolver/GetVersion"
	VersionResolver_ListVersions_FullMethodName = "/VersionResolver/ListVersions"
)

// VersionResolverClient is the client API for VersionResolver 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 VersionResolverClient interface {
	// register a new version tag for a given height and network
	AddVersion(ctx context.Context, in *RegisterVersionRequest, opts ...grpc.CallOption) (*RegisterVersionResponse, error)
	// retrieve the version tag for a given height and network
	GetVersion(ctx context.Context, in *GetVersionRequest, opts ...grpc.CallOption) (*GetVersionResponse, error)
	// list all registered versions
	ListVersions(ctx context.Context, in *ListVersionsRequest, opts ...grpc.CallOption) (*ListVersionsResponse, error)
}

type versionResolverClient struct {
	cc grpc.ClientConnInterface
}

func NewVersionResolverClient(cc grpc.ClientConnInterface) VersionResolverClient {
	return &versionResolverClient{cc}
}

func (c *versionResolverClient) AddVersion(ctx context.Context, in *RegisterVersionRequest, opts ...grpc.CallOption) (*RegisterVersionResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(RegisterVersionResponse)
	err := c.cc.Invoke(ctx, VersionResolver_AddVersion_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *versionResolverClient) GetVersion(ctx context.Context, in *GetVersionRequest, opts ...grpc.CallOption) (*GetVersionResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(GetVersionResponse)
	err := c.cc.Invoke(ctx, VersionResolver_GetVersion_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *versionResolverClient) ListVersions(ctx context.Context, in *ListVersionsRequest, opts ...grpc.CallOption) (*ListVersionsResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ListVersionsResponse)
	err := c.cc.Invoke(ctx, VersionResolver_ListVersions_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// VersionResolverServer is the server API for VersionResolver service.
// All implementations must embed UnimplementedVersionResolverServer
// for forward compatibility.
type VersionResolverServer interface {
	// register a new version tag for a given height and network
	AddVersion(context.Context, *RegisterVersionRequest) (*RegisterVersionResponse, error)
	// retrieve the version tag for a given height and network
	GetVersion(context.Context, *GetVersionRequest) (*GetVersionResponse, error)
	// list all registered versions
	ListVersions(context.Context, *ListVersionsRequest) (*ListVersionsResponse, error)
	mustEmbedUnimplementedVersionResolverServer()
}

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

func (UnimplementedVersionResolverServer) AddVersion(context.Context, *RegisterVersionRequest) (*RegisterVersionResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method AddVersion not implemented")
}
func (UnimplementedVersionResolverServer) GetVersion(context.Context, *GetVersionRequest) (*GetVersionResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetVersion not implemented")
}
func (UnimplementedVersionResolverServer) ListVersions(context.Context, *ListVersionsRequest) (*ListVersionsResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ListVersions not implemented")
}
func (UnimplementedVersionResolverServer) mustEmbedUnimplementedVersionResolverServer() {}
func (UnimplementedVersionResolverServer) testEmbeddedByValue()                         {}

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

func RegisterVersionResolverServer(s grpc.ServiceRegistrar, srv VersionResolverServer) {
	// If the following call pancis, it indicates UnimplementedVersionResolverServer 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(&VersionResolver_ServiceDesc, srv)
}

func _VersionResolver_AddVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(RegisterVersionRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(VersionResolverServer).AddVersion(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: VersionResolver_AddVersion_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(VersionResolverServer).AddVersion(ctx, req.(*RegisterVersionRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _VersionResolver_GetVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetVersionRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(VersionResolverServer).GetVersion(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: VersionResolver_GetVersion_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(VersionResolverServer).GetVersion(ctx, req.(*GetVersionRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _VersionResolver_ListVersions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListVersionsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(VersionResolverServer).ListVersions(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: VersionResolver_ListVersions_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(VersionResolverServer).ListVersions(ctx, req.(*ListVersionsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// VersionResolver_ServiceDesc is the grpc.ServiceDesc for VersionResolver service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var VersionResolver_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "VersionResolver",
	HandlerType: (*VersionResolverServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "AddVersion",
			Handler:    _VersionResolver_AddVersion_Handler,
		},
		{
			MethodName: "GetVersion",
			Handler:    _VersionResolver_GetVersion_Handler,
		},
		{
			MethodName: "ListVersions",
			Handler:    _VersionResolver_ListVersions_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "version_resolver.proto",
}
