// Copyright (c) 2023 Gitpod GmbH. All rights reserved.
// Licensed under the GNU Affero General Public License (AGPL).
// See License.AGPL.txt in the project root for license information.

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc             (unknown)
// source: gitpod/experimental/v1/ide_client.proto

package v1

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

// IDEClientServiceClient is the client API for IDEClientService 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 IDEClientServiceClient interface {
	// SendHeartbeat sends a clientheartbeat signal for a running workspace.
	SendHeartbeat(ctx context.Context, in *SendHeartbeatRequest, opts ...grpc.CallOption) (*SendHeartbeatResponse, error)
	// SendDidClose sends a client close signal for a running workspace.
	SendDidClose(ctx context.Context, in *SendDidCloseRequest, opts ...grpc.CallOption) (*SendDidCloseResponse, error)
}

type iDEClientServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewIDEClientServiceClient(cc grpc.ClientConnInterface) IDEClientServiceClient {
	return &iDEClientServiceClient{cc}
}

func (c *iDEClientServiceClient) SendHeartbeat(ctx context.Context, in *SendHeartbeatRequest, opts ...grpc.CallOption) (*SendHeartbeatResponse, error) {
	out := new(SendHeartbeatResponse)
	err := c.cc.Invoke(ctx, "/gitpod.experimental.v1.IDEClientService/SendHeartbeat", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *iDEClientServiceClient) SendDidClose(ctx context.Context, in *SendDidCloseRequest, opts ...grpc.CallOption) (*SendDidCloseResponse, error) {
	out := new(SendDidCloseResponse)
	err := c.cc.Invoke(ctx, "/gitpod.experimental.v1.IDEClientService/SendDidClose", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// IDEClientServiceServer is the server API for IDEClientService service.
// All implementations must embed UnimplementedIDEClientServiceServer
// for forward compatibility
type IDEClientServiceServer interface {
	// SendHeartbeat sends a clientheartbeat signal for a running workspace.
	SendHeartbeat(context.Context, *SendHeartbeatRequest) (*SendHeartbeatResponse, error)
	// SendDidClose sends a client close signal for a running workspace.
	SendDidClose(context.Context, *SendDidCloseRequest) (*SendDidCloseResponse, error)
	mustEmbedUnimplementedIDEClientServiceServer()
}

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

func (UnimplementedIDEClientServiceServer) SendHeartbeat(context.Context, *SendHeartbeatRequest) (*SendHeartbeatResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method SendHeartbeat not implemented")
}
func (UnimplementedIDEClientServiceServer) SendDidClose(context.Context, *SendDidCloseRequest) (*SendDidCloseResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method SendDidClose not implemented")
}
func (UnimplementedIDEClientServiceServer) mustEmbedUnimplementedIDEClientServiceServer() {}

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

func RegisterIDEClientServiceServer(s grpc.ServiceRegistrar, srv IDEClientServiceServer) {
	s.RegisterService(&IDEClientService_ServiceDesc, srv)
}

func _IDEClientService_SendHeartbeat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SendHeartbeatRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(IDEClientServiceServer).SendHeartbeat(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/gitpod.experimental.v1.IDEClientService/SendHeartbeat",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(IDEClientServiceServer).SendHeartbeat(ctx, req.(*SendHeartbeatRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _IDEClientService_SendDidClose_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SendDidCloseRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(IDEClientServiceServer).SendDidClose(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/gitpod.experimental.v1.IDEClientService/SendDidClose",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(IDEClientServiceServer).SendDidClose(ctx, req.(*SendDidCloseRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// IDEClientService_ServiceDesc is the grpc.ServiceDesc for IDEClientService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var IDEClientService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "gitpod.experimental.v1.IDEClientService",
	HandlerType: (*IDEClientServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "SendHeartbeat",
			Handler:    _IDEClientService_SendHeartbeat_Handler,
		},
		{
			MethodName: "SendDidClose",
			Handler:    _IDEClientService_SendDidClose_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "gitpod/experimental/v1/ide_client.proto",
}
