// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc             v6.31.1
// source: v2/skaffold.proto

package v2

import (
	context "context"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
	emptypb "google.golang.org/protobuf/types/known/emptypb"
)

// 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 (
	SkaffoldV2Service_GetState_FullMethodName        = "/proto.v2.SkaffoldV2Service/GetState"
	SkaffoldV2Service_Events_FullMethodName          = "/proto.v2.SkaffoldV2Service/Events"
	SkaffoldV2Service_ApplicationLogs_FullMethodName = "/proto.v2.SkaffoldV2Service/ApplicationLogs"
	SkaffoldV2Service_Execute_FullMethodName         = "/proto.v2.SkaffoldV2Service/Execute"
	SkaffoldV2Service_AutoBuild_FullMethodName       = "/proto.v2.SkaffoldV2Service/AutoBuild"
	SkaffoldV2Service_AutoSync_FullMethodName        = "/proto.v2.SkaffoldV2Service/AutoSync"
	SkaffoldV2Service_AutoDeploy_FullMethodName      = "/proto.v2.SkaffoldV2Service/AutoDeploy"
	SkaffoldV2Service_Handle_FullMethodName          = "/proto.v2.SkaffoldV2Service/Handle"
)

// SkaffoldV2ServiceClient is the client API for SkaffoldV2Service 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.
//
// Describes all the methods for the Skaffold API
type SkaffoldV2ServiceClient interface {
	// Returns the state of the current Skaffold execution
	GetState(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*State, error)
	// Returns all the events of the current Skaffold execution from the start
	Events(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Event], error)
	// Returns all the user application logs of the current Skaffold execution
	ApplicationLogs(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Event], error)
	// Allows for a single execution of some or all of the phases (build, sync, deploy) in case autoBuild, autoDeploy or autoSync are disabled.
	Execute(ctx context.Context, in *UserIntentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// Allows for enabling or disabling automatic build trigger
	AutoBuild(ctx context.Context, in *TriggerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// Allows for enabling or disabling automatic sync trigger
	AutoSync(ctx context.Context, in *TriggerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// Allows for enabling or disabling automatic deploy trigger
	AutoDeploy(ctx context.Context, in *TriggerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// EXPERIMENTAL. It allows for custom events to be implemented in custom builders for example.
	Handle(ctx context.Context, in *Event, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

type skaffoldV2ServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewSkaffoldV2ServiceClient(cc grpc.ClientConnInterface) SkaffoldV2ServiceClient {
	return &skaffoldV2ServiceClient{cc}
}

func (c *skaffoldV2ServiceClient) GetState(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*State, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(State)
	err := c.cc.Invoke(ctx, SkaffoldV2Service_GetState_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *skaffoldV2ServiceClient) Events(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Event], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &SkaffoldV2Service_ServiceDesc.Streams[0], SkaffoldV2Service_Events_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[emptypb.Empty, Event]{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
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type SkaffoldV2Service_EventsClient = grpc.ServerStreamingClient[Event]

func (c *skaffoldV2ServiceClient) ApplicationLogs(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Event], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &SkaffoldV2Service_ServiceDesc.Streams[1], SkaffoldV2Service_ApplicationLogs_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[emptypb.Empty, Event]{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
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type SkaffoldV2Service_ApplicationLogsClient = grpc.ServerStreamingClient[Event]

func (c *skaffoldV2ServiceClient) Execute(ctx context.Context, in *UserIntentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, SkaffoldV2Service_Execute_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *skaffoldV2ServiceClient) AutoBuild(ctx context.Context, in *TriggerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, SkaffoldV2Service_AutoBuild_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *skaffoldV2ServiceClient) AutoSync(ctx context.Context, in *TriggerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, SkaffoldV2Service_AutoSync_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *skaffoldV2ServiceClient) AutoDeploy(ctx context.Context, in *TriggerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, SkaffoldV2Service_AutoDeploy_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *skaffoldV2ServiceClient) Handle(ctx context.Context, in *Event, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, SkaffoldV2Service_Handle_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// SkaffoldV2ServiceServer is the server API for SkaffoldV2Service service.
// All implementations should embed UnimplementedSkaffoldV2ServiceServer
// for forward compatibility.
//
// Describes all the methods for the Skaffold API
type SkaffoldV2ServiceServer interface {
	// Returns the state of the current Skaffold execution
	GetState(context.Context, *emptypb.Empty) (*State, error)
	// Returns all the events of the current Skaffold execution from the start
	Events(*emptypb.Empty, grpc.ServerStreamingServer[Event]) error
	// Returns all the user application logs of the current Skaffold execution
	ApplicationLogs(*emptypb.Empty, grpc.ServerStreamingServer[Event]) error
	// Allows for a single execution of some or all of the phases (build, sync, deploy) in case autoBuild, autoDeploy or autoSync are disabled.
	Execute(context.Context, *UserIntentRequest) (*emptypb.Empty, error)
	// Allows for enabling or disabling automatic build trigger
	AutoBuild(context.Context, *TriggerRequest) (*emptypb.Empty, error)
	// Allows for enabling or disabling automatic sync trigger
	AutoSync(context.Context, *TriggerRequest) (*emptypb.Empty, error)
	// Allows for enabling or disabling automatic deploy trigger
	AutoDeploy(context.Context, *TriggerRequest) (*emptypb.Empty, error)
	// EXPERIMENTAL. It allows for custom events to be implemented in custom builders for example.
	Handle(context.Context, *Event) (*emptypb.Empty, error)
}

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

func (UnimplementedSkaffoldV2ServiceServer) GetState(context.Context, *emptypb.Empty) (*State, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetState not implemented")
}
func (UnimplementedSkaffoldV2ServiceServer) Events(*emptypb.Empty, grpc.ServerStreamingServer[Event]) error {
	return status.Errorf(codes.Unimplemented, "method Events not implemented")
}
func (UnimplementedSkaffoldV2ServiceServer) ApplicationLogs(*emptypb.Empty, grpc.ServerStreamingServer[Event]) error {
	return status.Errorf(codes.Unimplemented, "method ApplicationLogs not implemented")
}
func (UnimplementedSkaffoldV2ServiceServer) Execute(context.Context, *UserIntentRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Execute not implemented")
}
func (UnimplementedSkaffoldV2ServiceServer) AutoBuild(context.Context, *TriggerRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method AutoBuild not implemented")
}
func (UnimplementedSkaffoldV2ServiceServer) AutoSync(context.Context, *TriggerRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method AutoSync not implemented")
}
func (UnimplementedSkaffoldV2ServiceServer) AutoDeploy(context.Context, *TriggerRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method AutoDeploy not implemented")
}
func (UnimplementedSkaffoldV2ServiceServer) Handle(context.Context, *Event) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Handle not implemented")
}
func (UnimplementedSkaffoldV2ServiceServer) testEmbeddedByValue() {}

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

func RegisterSkaffoldV2ServiceServer(s grpc.ServiceRegistrar, srv SkaffoldV2ServiceServer) {
	// If the following call pancis, it indicates UnimplementedSkaffoldV2ServiceServer 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(&SkaffoldV2Service_ServiceDesc, srv)
}

func _SkaffoldV2Service_GetState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(emptypb.Empty)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SkaffoldV2ServiceServer).GetState(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: SkaffoldV2Service_GetState_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SkaffoldV2ServiceServer).GetState(ctx, req.(*emptypb.Empty))
	}
	return interceptor(ctx, in, info, handler)
}

func _SkaffoldV2Service_Events_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(emptypb.Empty)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(SkaffoldV2ServiceServer).Events(m, &grpc.GenericServerStream[emptypb.Empty, Event]{ServerStream: stream})
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type SkaffoldV2Service_EventsServer = grpc.ServerStreamingServer[Event]

func _SkaffoldV2Service_ApplicationLogs_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(emptypb.Empty)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(SkaffoldV2ServiceServer).ApplicationLogs(m, &grpc.GenericServerStream[emptypb.Empty, Event]{ServerStream: stream})
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type SkaffoldV2Service_ApplicationLogsServer = grpc.ServerStreamingServer[Event]

func _SkaffoldV2Service_Execute_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(UserIntentRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SkaffoldV2ServiceServer).Execute(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: SkaffoldV2Service_Execute_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SkaffoldV2ServiceServer).Execute(ctx, req.(*UserIntentRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _SkaffoldV2Service_AutoBuild_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(TriggerRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SkaffoldV2ServiceServer).AutoBuild(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: SkaffoldV2Service_AutoBuild_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SkaffoldV2ServiceServer).AutoBuild(ctx, req.(*TriggerRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _SkaffoldV2Service_AutoSync_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(TriggerRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SkaffoldV2ServiceServer).AutoSync(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: SkaffoldV2Service_AutoSync_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SkaffoldV2ServiceServer).AutoSync(ctx, req.(*TriggerRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _SkaffoldV2Service_AutoDeploy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(TriggerRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SkaffoldV2ServiceServer).AutoDeploy(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: SkaffoldV2Service_AutoDeploy_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SkaffoldV2ServiceServer).AutoDeploy(ctx, req.(*TriggerRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _SkaffoldV2Service_Handle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Event)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SkaffoldV2ServiceServer).Handle(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: SkaffoldV2Service_Handle_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SkaffoldV2ServiceServer).Handle(ctx, req.(*Event))
	}
	return interceptor(ctx, in, info, handler)
}

// SkaffoldV2Service_ServiceDesc is the grpc.ServiceDesc for SkaffoldV2Service service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var SkaffoldV2Service_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "proto.v2.SkaffoldV2Service",
	HandlerType: (*SkaffoldV2ServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetState",
			Handler:    _SkaffoldV2Service_GetState_Handler,
		},
		{
			MethodName: "Execute",
			Handler:    _SkaffoldV2Service_Execute_Handler,
		},
		{
			MethodName: "AutoBuild",
			Handler:    _SkaffoldV2Service_AutoBuild_Handler,
		},
		{
			MethodName: "AutoSync",
			Handler:    _SkaffoldV2Service_AutoSync_Handler,
		},
		{
			MethodName: "AutoDeploy",
			Handler:    _SkaffoldV2Service_AutoDeploy_Handler,
		},
		{
			MethodName: "Handle",
			Handler:    _SkaffoldV2Service_Handle_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Events",
			Handler:       _SkaffoldV2Service_Events_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "ApplicationLogs",
			Handler:       _SkaffoldV2Service_ApplicationLogs_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "v2/skaffold.proto",
}
