// Code generated by protoc-gen-go-grpc. DO NOT EDIT.

package agent

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

// InstanceDiscoveryServiceClient is the client API for InstanceDiscoveryService 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 InstanceDiscoveryServiceClient interface {
	RegisterInstance(ctx context.Context, in *ApplicationInstance, opts ...grpc.CallOption) (*ApplicationInstanceMapping, error)
	Heartbeat(ctx context.Context, in *ApplicationInstanceHeartbeat, opts ...grpc.CallOption) (*Downstream, error)
}

type instanceDiscoveryServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewInstanceDiscoveryServiceClient(cc grpc.ClientConnInterface) InstanceDiscoveryServiceClient {
	return &instanceDiscoveryServiceClient{cc}
}

func (c *instanceDiscoveryServiceClient) RegisterInstance(ctx context.Context, in *ApplicationInstance, opts ...grpc.CallOption) (*ApplicationInstanceMapping, error) {
	out := new(ApplicationInstanceMapping)
	err := c.cc.Invoke(ctx, "/InstanceDiscoveryService/registerInstance", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *instanceDiscoveryServiceClient) Heartbeat(ctx context.Context, in *ApplicationInstanceHeartbeat, opts ...grpc.CallOption) (*Downstream, error) {
	out := new(Downstream)
	err := c.cc.Invoke(ctx, "/InstanceDiscoveryService/heartbeat", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// InstanceDiscoveryServiceServer is the server API for InstanceDiscoveryService service.
// All implementations should embed UnimplementedInstanceDiscoveryServiceServer
// for forward compatibility
type InstanceDiscoveryServiceServer interface {
	RegisterInstance(context.Context, *ApplicationInstance) (*ApplicationInstanceMapping, error)
	Heartbeat(context.Context, *ApplicationInstanceHeartbeat) (*Downstream, error)
}

// UnimplementedInstanceDiscoveryServiceServer should be embedded to have forward compatible implementations.
type UnimplementedInstanceDiscoveryServiceServer struct {
}

func (UnimplementedInstanceDiscoveryServiceServer) RegisterInstance(context.Context, *ApplicationInstance) (*ApplicationInstanceMapping, error) {
	return nil, status.Errorf(codes.Unimplemented, "method RegisterInstance not implemented")
}
func (UnimplementedInstanceDiscoveryServiceServer) Heartbeat(context.Context, *ApplicationInstanceHeartbeat) (*Downstream, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Heartbeat not implemented")
}

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

func RegisterInstanceDiscoveryServiceServer(s grpc.ServiceRegistrar, srv InstanceDiscoveryServiceServer) {
	s.RegisterService(&InstanceDiscoveryService_ServiceDesc, srv)
}

func _InstanceDiscoveryService_RegisterInstance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ApplicationInstance)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(InstanceDiscoveryServiceServer).RegisterInstance(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/InstanceDiscoveryService/registerInstance",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(InstanceDiscoveryServiceServer).RegisterInstance(ctx, req.(*ApplicationInstance))
	}
	return interceptor(ctx, in, info, handler)
}

func _InstanceDiscoveryService_Heartbeat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ApplicationInstanceHeartbeat)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(InstanceDiscoveryServiceServer).Heartbeat(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/InstanceDiscoveryService/heartbeat",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(InstanceDiscoveryServiceServer).Heartbeat(ctx, req.(*ApplicationInstanceHeartbeat))
	}
	return interceptor(ctx, in, info, handler)
}

// InstanceDiscoveryService_ServiceDesc is the grpc.ServiceDesc for InstanceDiscoveryService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var InstanceDiscoveryService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "InstanceDiscoveryService",
	HandlerType: (*InstanceDiscoveryServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "registerInstance",
			Handler:    _InstanceDiscoveryService_RegisterInstance_Handler,
		},
		{
			MethodName: "heartbeat",
			Handler:    _InstanceDiscoveryService_Heartbeat_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "language-agent/DiscoveryService.proto",
}

// ServiceNameDiscoveryServiceClient is the client API for ServiceNameDiscoveryService 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 ServiceNameDiscoveryServiceClient interface {
	Discovery(ctx context.Context, in *ServiceNameCollection, opts ...grpc.CallOption) (*ServiceNameMappingCollection, error)
}

type serviceNameDiscoveryServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewServiceNameDiscoveryServiceClient(cc grpc.ClientConnInterface) ServiceNameDiscoveryServiceClient {
	return &serviceNameDiscoveryServiceClient{cc}
}

func (c *serviceNameDiscoveryServiceClient) Discovery(ctx context.Context, in *ServiceNameCollection, opts ...grpc.CallOption) (*ServiceNameMappingCollection, error) {
	out := new(ServiceNameMappingCollection)
	err := c.cc.Invoke(ctx, "/ServiceNameDiscoveryService/discovery", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// ServiceNameDiscoveryServiceServer is the server API for ServiceNameDiscoveryService service.
// All implementations should embed UnimplementedServiceNameDiscoveryServiceServer
// for forward compatibility
type ServiceNameDiscoveryServiceServer interface {
	Discovery(context.Context, *ServiceNameCollection) (*ServiceNameMappingCollection, error)
}

// UnimplementedServiceNameDiscoveryServiceServer should be embedded to have forward compatible implementations.
type UnimplementedServiceNameDiscoveryServiceServer struct {
}

func (UnimplementedServiceNameDiscoveryServiceServer) Discovery(context.Context, *ServiceNameCollection) (*ServiceNameMappingCollection, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Discovery not implemented")
}

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

func RegisterServiceNameDiscoveryServiceServer(s grpc.ServiceRegistrar, srv ServiceNameDiscoveryServiceServer) {
	s.RegisterService(&ServiceNameDiscoveryService_ServiceDesc, srv)
}

func _ServiceNameDiscoveryService_Discovery_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ServiceNameCollection)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ServiceNameDiscoveryServiceServer).Discovery(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/ServiceNameDiscoveryService/discovery",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ServiceNameDiscoveryServiceServer).Discovery(ctx, req.(*ServiceNameCollection))
	}
	return interceptor(ctx, in, info, handler)
}

// ServiceNameDiscoveryService_ServiceDesc is the grpc.ServiceDesc for ServiceNameDiscoveryService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ServiceNameDiscoveryService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "ServiceNameDiscoveryService",
	HandlerType: (*ServiceNameDiscoveryServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "discovery",
			Handler:    _ServiceNameDiscoveryService_Discovery_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "language-agent/DiscoveryService.proto",
}
