// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc             (unknown)
// source: api/gharesults/gharesults.proto

package gharesults

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 (
	CacheService_CreateCacheEntry_FullMethodName         = "/github.actions.results.api.v1.CacheService/CreateCacheEntry"
	CacheService_FinalizeCacheEntryUpload_FullMethodName = "/github.actions.results.api.v1.CacheService/FinalizeCacheEntryUpload"
	CacheService_GetCacheEntryDownloadURL_FullMethodName = "/github.actions.results.api.v1.CacheService/GetCacheEntryDownloadURL"
)

// CacheServiceClient is the client API for CacheService 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 CacheServiceClient interface {
	CreateCacheEntry(ctx context.Context, in *CreateCacheEntryRequest, opts ...grpc.CallOption) (*CreateCacheEntryResponse, error)
	FinalizeCacheEntryUpload(ctx context.Context, in *FinalizeCacheEntryUploadRequest, opts ...grpc.CallOption) (*FinalizeCacheEntryUploadResponse, error)
	GetCacheEntryDownloadURL(ctx context.Context, in *GetCacheEntryDownloadURLRequest, opts ...grpc.CallOption) (*GetCacheEntryDownloadURLResponse, error)
}

type cacheServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewCacheServiceClient(cc grpc.ClientConnInterface) CacheServiceClient {
	return &cacheServiceClient{cc}
}

func (c *cacheServiceClient) CreateCacheEntry(ctx context.Context, in *CreateCacheEntryRequest, opts ...grpc.CallOption) (*CreateCacheEntryResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(CreateCacheEntryResponse)
	err := c.cc.Invoke(ctx, CacheService_CreateCacheEntry_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *cacheServiceClient) FinalizeCacheEntryUpload(ctx context.Context, in *FinalizeCacheEntryUploadRequest, opts ...grpc.CallOption) (*FinalizeCacheEntryUploadResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(FinalizeCacheEntryUploadResponse)
	err := c.cc.Invoke(ctx, CacheService_FinalizeCacheEntryUpload_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *cacheServiceClient) GetCacheEntryDownloadURL(ctx context.Context, in *GetCacheEntryDownloadURLRequest, opts ...grpc.CallOption) (*GetCacheEntryDownloadURLResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(GetCacheEntryDownloadURLResponse)
	err := c.cc.Invoke(ctx, CacheService_GetCacheEntryDownloadURL_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// CacheServiceServer is the server API for CacheService service.
// All implementations must embed UnimplementedCacheServiceServer
// for forward compatibility.
type CacheServiceServer interface {
	CreateCacheEntry(context.Context, *CreateCacheEntryRequest) (*CreateCacheEntryResponse, error)
	FinalizeCacheEntryUpload(context.Context, *FinalizeCacheEntryUploadRequest) (*FinalizeCacheEntryUploadResponse, error)
	GetCacheEntryDownloadURL(context.Context, *GetCacheEntryDownloadURLRequest) (*GetCacheEntryDownloadURLResponse, error)
	mustEmbedUnimplementedCacheServiceServer()
}

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

func (UnimplementedCacheServiceServer) CreateCacheEntry(context.Context, *CreateCacheEntryRequest) (*CreateCacheEntryResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method CreateCacheEntry not implemented")
}
func (UnimplementedCacheServiceServer) FinalizeCacheEntryUpload(context.Context, *FinalizeCacheEntryUploadRequest) (*FinalizeCacheEntryUploadResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method FinalizeCacheEntryUpload not implemented")
}
func (UnimplementedCacheServiceServer) GetCacheEntryDownloadURL(context.Context, *GetCacheEntryDownloadURLRequest) (*GetCacheEntryDownloadURLResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetCacheEntryDownloadURL not implemented")
}
func (UnimplementedCacheServiceServer) mustEmbedUnimplementedCacheServiceServer() {}
func (UnimplementedCacheServiceServer) testEmbeddedByValue()                      {}

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

func RegisterCacheServiceServer(s grpc.ServiceRegistrar, srv CacheServiceServer) {
	// If the following call pancis, it indicates UnimplementedCacheServiceServer 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(&CacheService_ServiceDesc, srv)
}

func _CacheService_CreateCacheEntry_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CreateCacheEntryRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(CacheServiceServer).CreateCacheEntry(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: CacheService_CreateCacheEntry_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(CacheServiceServer).CreateCacheEntry(ctx, req.(*CreateCacheEntryRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _CacheService_FinalizeCacheEntryUpload_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(FinalizeCacheEntryUploadRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(CacheServiceServer).FinalizeCacheEntryUpload(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: CacheService_FinalizeCacheEntryUpload_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(CacheServiceServer).FinalizeCacheEntryUpload(ctx, req.(*FinalizeCacheEntryUploadRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _CacheService_GetCacheEntryDownloadURL_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetCacheEntryDownloadURLRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(CacheServiceServer).GetCacheEntryDownloadURL(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: CacheService_GetCacheEntryDownloadURL_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(CacheServiceServer).GetCacheEntryDownloadURL(ctx, req.(*GetCacheEntryDownloadURLRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// CacheService_ServiceDesc is the grpc.ServiceDesc for CacheService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var CacheService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "github.actions.results.api.v1.CacheService",
	HandlerType: (*CacheServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateCacheEntry",
			Handler:    _CacheService_CreateCacheEntry_Handler,
		},
		{
			MethodName: "FinalizeCacheEntryUpload",
			Handler:    _CacheService_FinalizeCacheEntryUpload_Handler,
		},
		{
			MethodName: "GetCacheEntryDownloadURL",
			Handler:    _CacheService_GetCacheEntryDownloadURL_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api/gharesults/gharesults.proto",
}
