// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.4.0
// - protoc             v3.12.4
// source: services/dependencies_service_v2.proto

package grpc

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.62.0 or later.
const _ = grpc.SupportPackageIsVersion8

const (
	DependenciesServiceV2_Connect_FullMethodName       = "/grpc.DependenciesServiceV2/Connect"
	DependenciesServiceV2_Sync_FullMethodName          = "/grpc.DependenciesServiceV2/Sync"
	DependenciesServiceV2_UpdateTaskLog_FullMethodName = "/grpc.DependenciesServiceV2/UpdateTaskLog"
)

// DependenciesServiceV2Client is the client API for DependenciesServiceV2 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 DependenciesServiceV2Client interface {
	Connect(ctx context.Context, in *DependenciesServiceV2ConnectRequest, opts ...grpc.CallOption) (DependenciesServiceV2_ConnectClient, error)
	Sync(ctx context.Context, in *DependenciesServiceV2SyncRequest, opts ...grpc.CallOption) (*Response, error)
	UpdateTaskLog(ctx context.Context, opts ...grpc.CallOption) (DependenciesServiceV2_UpdateTaskLogClient, error)
}

type dependenciesServiceV2Client struct {
	cc grpc.ClientConnInterface
}

func NewDependenciesServiceV2Client(cc grpc.ClientConnInterface) DependenciesServiceV2Client {
	return &dependenciesServiceV2Client{cc}
}

func (c *dependenciesServiceV2Client) Connect(ctx context.Context, in *DependenciesServiceV2ConnectRequest, opts ...grpc.CallOption) (DependenciesServiceV2_ConnectClient, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &DependenciesServiceV2_ServiceDesc.Streams[0], DependenciesServiceV2_Connect_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &dependenciesServiceV2ConnectClient{ClientStream: 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 DependenciesServiceV2_ConnectClient interface {
	Recv() (*DependenciesServiceV2ConnectResponse, error)
	grpc.ClientStream
}

type dependenciesServiceV2ConnectClient struct {
	grpc.ClientStream
}

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

func (c *dependenciesServiceV2Client) Sync(ctx context.Context, in *DependenciesServiceV2SyncRequest, opts ...grpc.CallOption) (*Response, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(Response)
	err := c.cc.Invoke(ctx, DependenciesServiceV2_Sync_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *dependenciesServiceV2Client) UpdateTaskLog(ctx context.Context, opts ...grpc.CallOption) (DependenciesServiceV2_UpdateTaskLogClient, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &DependenciesServiceV2_ServiceDesc.Streams[1], DependenciesServiceV2_UpdateTaskLog_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &dependenciesServiceV2UpdateTaskLogClient{ClientStream: stream}
	return x, nil
}

type DependenciesServiceV2_UpdateTaskLogClient interface {
	Send(*DependenciesServiceV2UpdateTaskLogRequest) error
	CloseAndRecv() (*Response, error)
	grpc.ClientStream
}

type dependenciesServiceV2UpdateTaskLogClient struct {
	grpc.ClientStream
}

func (x *dependenciesServiceV2UpdateTaskLogClient) Send(m *DependenciesServiceV2UpdateTaskLogRequest) error {
	return x.ClientStream.SendMsg(m)
}

func (x *dependenciesServiceV2UpdateTaskLogClient) CloseAndRecv() (*Response, error) {
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	m := new(Response)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

// DependenciesServiceV2Server is the server API for DependenciesServiceV2 service.
// All implementations must embed UnimplementedDependenciesServiceV2Server
// for forward compatibility
type DependenciesServiceV2Server interface {
	Connect(*DependenciesServiceV2ConnectRequest, DependenciesServiceV2_ConnectServer) error
	Sync(context.Context, *DependenciesServiceV2SyncRequest) (*Response, error)
	UpdateTaskLog(DependenciesServiceV2_UpdateTaskLogServer) error
	mustEmbedUnimplementedDependenciesServiceV2Server()
}

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

func (UnimplementedDependenciesServiceV2Server) Connect(*DependenciesServiceV2ConnectRequest, DependenciesServiceV2_ConnectServer) error {
	return status.Errorf(codes.Unimplemented, "method Connect not implemented")
}
func (UnimplementedDependenciesServiceV2Server) Sync(context.Context, *DependenciesServiceV2SyncRequest) (*Response, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Sync not implemented")
}
func (UnimplementedDependenciesServiceV2Server) UpdateTaskLog(DependenciesServiceV2_UpdateTaskLogServer) error {
	return status.Errorf(codes.Unimplemented, "method UpdateTaskLog not implemented")
}
func (UnimplementedDependenciesServiceV2Server) mustEmbedUnimplementedDependenciesServiceV2Server() {}

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

func RegisterDependenciesServiceV2Server(s grpc.ServiceRegistrar, srv DependenciesServiceV2Server) {
	s.RegisterService(&DependenciesServiceV2_ServiceDesc, srv)
}

func _DependenciesServiceV2_Connect_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(DependenciesServiceV2ConnectRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(DependenciesServiceV2Server).Connect(m, &dependenciesServiceV2ConnectServer{ServerStream: stream})
}

type DependenciesServiceV2_ConnectServer interface {
	Send(*DependenciesServiceV2ConnectResponse) error
	grpc.ServerStream
}

type dependenciesServiceV2ConnectServer struct {
	grpc.ServerStream
}

func (x *dependenciesServiceV2ConnectServer) Send(m *DependenciesServiceV2ConnectResponse) error {
	return x.ServerStream.SendMsg(m)
}

func _DependenciesServiceV2_Sync_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DependenciesServiceV2SyncRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(DependenciesServiceV2Server).Sync(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: DependenciesServiceV2_Sync_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(DependenciesServiceV2Server).Sync(ctx, req.(*DependenciesServiceV2SyncRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _DependenciesServiceV2_UpdateTaskLog_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(DependenciesServiceV2Server).UpdateTaskLog(&dependenciesServiceV2UpdateTaskLogServer{ServerStream: stream})
}

type DependenciesServiceV2_UpdateTaskLogServer interface {
	SendAndClose(*Response) error
	Recv() (*DependenciesServiceV2UpdateTaskLogRequest, error)
	grpc.ServerStream
}

type dependenciesServiceV2UpdateTaskLogServer struct {
	grpc.ServerStream
}

func (x *dependenciesServiceV2UpdateTaskLogServer) SendAndClose(m *Response) error {
	return x.ServerStream.SendMsg(m)
}

func (x *dependenciesServiceV2UpdateTaskLogServer) Recv() (*DependenciesServiceV2UpdateTaskLogRequest, error) {
	m := new(DependenciesServiceV2UpdateTaskLogRequest)
	if err := x.ServerStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

// DependenciesServiceV2_ServiceDesc is the grpc.ServiceDesc for DependenciesServiceV2 service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var DependenciesServiceV2_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "grpc.DependenciesServiceV2",
	HandlerType: (*DependenciesServiceV2Server)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Sync",
			Handler:    _DependenciesServiceV2_Sync_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Connect",
			Handler:       _DependenciesServiceV2_Connect_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "UpdateTaskLog",
			Handler:       _DependenciesServiceV2_UpdateTaskLog_Handler,
			ClientStreams: true,
		},
	},
	Metadata: "services/dependencies_service_v2.proto",
}
