// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc             v4.25.1
// source: pkg/abstractions/image/image.proto

package proto

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.32.0 or later.
const _ = grpc.SupportPackageIsVersion7

const (
	ImageService_VerifyImageBuild_FullMethodName = "/image.ImageService/VerifyImageBuild"
	ImageService_BuildImage_FullMethodName       = "/image.ImageService/BuildImage"
)

// ImageServiceClient is the client API for ImageService 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 ImageServiceClient interface {
	VerifyImageBuild(ctx context.Context, in *VerifyImageBuildRequest, opts ...grpc.CallOption) (*VerifyImageBuildResponse, error)
	BuildImage(ctx context.Context, in *BuildImageRequest, opts ...grpc.CallOption) (ImageService_BuildImageClient, error)
}

type imageServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewImageServiceClient(cc grpc.ClientConnInterface) ImageServiceClient {
	return &imageServiceClient{cc}
}

func (c *imageServiceClient) VerifyImageBuild(ctx context.Context, in *VerifyImageBuildRequest, opts ...grpc.CallOption) (*VerifyImageBuildResponse, error) {
	out := new(VerifyImageBuildResponse)
	err := c.cc.Invoke(ctx, ImageService_VerifyImageBuild_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *imageServiceClient) BuildImage(ctx context.Context, in *BuildImageRequest, opts ...grpc.CallOption) (ImageService_BuildImageClient, error) {
	stream, err := c.cc.NewStream(ctx, &ImageService_ServiceDesc.Streams[0], ImageService_BuildImage_FullMethodName, opts...)
	if err != nil {
		return nil, err
	}
	x := &imageServiceBuildImageClient{stream}
	if err := x.ClientStream.SendMsg(in); err != nil {
		return nil, err
	}
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	return x, nil
}

type ImageService_BuildImageClient interface {
	Recv() (*BuildImageResponse, error)
	grpc.ClientStream
}

type imageServiceBuildImageClient struct {
	grpc.ClientStream
}

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

// ImageServiceServer is the server API for ImageService service.
// All implementations must embed UnimplementedImageServiceServer
// for forward compatibility
type ImageServiceServer interface {
	VerifyImageBuild(context.Context, *VerifyImageBuildRequest) (*VerifyImageBuildResponse, error)
	BuildImage(*BuildImageRequest, ImageService_BuildImageServer) error
	mustEmbedUnimplementedImageServiceServer()
}

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

func (UnimplementedImageServiceServer) VerifyImageBuild(context.Context, *VerifyImageBuildRequest) (*VerifyImageBuildResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method VerifyImageBuild not implemented")
}
func (UnimplementedImageServiceServer) BuildImage(*BuildImageRequest, ImageService_BuildImageServer) error {
	return status.Errorf(codes.Unimplemented, "method BuildImage not implemented")
}
func (UnimplementedImageServiceServer) mustEmbedUnimplementedImageServiceServer() {}

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

func RegisterImageServiceServer(s grpc.ServiceRegistrar, srv ImageServiceServer) {
	s.RegisterService(&ImageService_ServiceDesc, srv)
}

func _ImageService_VerifyImageBuild_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(VerifyImageBuildRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ImageServiceServer).VerifyImageBuild(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ImageService_VerifyImageBuild_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ImageServiceServer).VerifyImageBuild(ctx, req.(*VerifyImageBuildRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _ImageService_BuildImage_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(BuildImageRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(ImageServiceServer).BuildImage(m, &imageServiceBuildImageServer{stream})
}

type ImageService_BuildImageServer interface {
	Send(*BuildImageResponse) error
	grpc.ServerStream
}

type imageServiceBuildImageServer struct {
	grpc.ServerStream
}

func (x *imageServiceBuildImageServer) Send(m *BuildImageResponse) error {
	return x.ServerStream.SendMsg(m)
}

// ImageService_ServiceDesc is the grpc.ServiceDesc for ImageService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ImageService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "image.ImageService",
	HandlerType: (*ImageServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "VerifyImageBuild",
			Handler:    _ImageService_VerifyImageBuild_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "BuildImage",
			Handler:       _ImageService_BuildImage_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "pkg/abstractions/image/image.proto",
}
