// Copyright IBM Corp. 2020, 2026
// SPDX-License-Identifier: BUSL-1.1

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.1
// - protoc             (unknown)
// source: controller/servers/services/v1/server_coordination_service.proto

package services

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.64.0 or later.
const _ = grpc.SupportPackageIsVersion9

const (
	ServerCoordinationService_Status_FullMethodName          = "/controller.servers.services.v1.ServerCoordinationService/Status"
	ServerCoordinationService_ListHcpbWorkers_FullMethodName = "/controller.servers.services.v1.ServerCoordinationService/ListHcpbWorkers"
	ServerCoordinationService_Statistics_FullMethodName      = "/controller.servers.services.v1.ServerCoordinationService/Statistics"
	ServerCoordinationService_RoutingInfo_FullMethodName     = "/controller.servers.services.v1.ServerCoordinationService/RoutingInfo"
	ServerCoordinationService_SessionInfo_FullMethodName     = "/controller.servers.services.v1.ServerCoordinationService/SessionInfo"
)

// ServerCoordinationServiceClient is the client API for ServerCoordinationService 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 ServerCoordinationServiceClient interface {
	// Deprecated: Do not use.
	// Status gets worker status requests which include the ongoing jobs the worker is handling and
	// returns the status response which includes the changes the controller would like to make to
	// jobs as well as provide a list of the controllers in the system.
	// This RPC is deprecated and is safe to remove after the release of Boundary v0.20.0.
	Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error)
	// Returns the addresses of HCP Boundary workers, if any
	ListHcpbWorkers(ctx context.Context, in *ListHcpbWorkersRequest, opts ...grpc.CallOption) (*ListHcpbWorkersResponse, error)
	// Statistics is used by the worker to report non-essential statistics about its sessions and connections.
	Statistics(ctx context.Context, in *StatisticsRequest, opts ...grpc.CallOption) (*StatisticsResponse, error)
	// RoutingInfo is used by the worker to inform the controller of information
	// required by the controller to make session routing decisions and any startup information.
	// The controller may inform the worker of any downstream workers that should be disconnected.
	// If the worker fails to successfully report its routing info to the controller,
	// it will try again later.
	RoutingInfo(ctx context.Context, in *RoutingInfoRequest, opts ...grpc.CallOption) (*RoutingInfoResponse, error)
	// SessionInfo is used by the worker to inform the controller of all the sessions
	// it is managing. The controller may inform the worker if any sessions need to be changed.
	// If the worker repeatedly fails to successfully report its session info to the controller,
	// it will tear down any running sessions.
	SessionInfo(ctx context.Context, in *SessionInfoRequest, opts ...grpc.CallOption) (*SessionInfoResponse, error)
}

type serverCoordinationServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewServerCoordinationServiceClient(cc grpc.ClientConnInterface) ServerCoordinationServiceClient {
	return &serverCoordinationServiceClient{cc}
}

// Deprecated: Do not use.
func (c *serverCoordinationServiceClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(StatusResponse)
	err := c.cc.Invoke(ctx, ServerCoordinationService_Status_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *serverCoordinationServiceClient) ListHcpbWorkers(ctx context.Context, in *ListHcpbWorkersRequest, opts ...grpc.CallOption) (*ListHcpbWorkersResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ListHcpbWorkersResponse)
	err := c.cc.Invoke(ctx, ServerCoordinationService_ListHcpbWorkers_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *serverCoordinationServiceClient) Statistics(ctx context.Context, in *StatisticsRequest, opts ...grpc.CallOption) (*StatisticsResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(StatisticsResponse)
	err := c.cc.Invoke(ctx, ServerCoordinationService_Statistics_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *serverCoordinationServiceClient) RoutingInfo(ctx context.Context, in *RoutingInfoRequest, opts ...grpc.CallOption) (*RoutingInfoResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(RoutingInfoResponse)
	err := c.cc.Invoke(ctx, ServerCoordinationService_RoutingInfo_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *serverCoordinationServiceClient) SessionInfo(ctx context.Context, in *SessionInfoRequest, opts ...grpc.CallOption) (*SessionInfoResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(SessionInfoResponse)
	err := c.cc.Invoke(ctx, ServerCoordinationService_SessionInfo_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// ServerCoordinationServiceServer is the server API for ServerCoordinationService service.
// All implementations must embed UnimplementedServerCoordinationServiceServer
// for forward compatibility.
type ServerCoordinationServiceServer interface {
	// Deprecated: Do not use.
	// Status gets worker status requests which include the ongoing jobs the worker is handling and
	// returns the status response which includes the changes the controller would like to make to
	// jobs as well as provide a list of the controllers in the system.
	// This RPC is deprecated and is safe to remove after the release of Boundary v0.20.0.
	Status(context.Context, *StatusRequest) (*StatusResponse, error)
	// Returns the addresses of HCP Boundary workers, if any
	ListHcpbWorkers(context.Context, *ListHcpbWorkersRequest) (*ListHcpbWorkersResponse, error)
	// Statistics is used by the worker to report non-essential statistics about its sessions and connections.
	Statistics(context.Context, *StatisticsRequest) (*StatisticsResponse, error)
	// RoutingInfo is used by the worker to inform the controller of information
	// required by the controller to make session routing decisions and any startup information.
	// The controller may inform the worker of any downstream workers that should be disconnected.
	// If the worker fails to successfully report its routing info to the controller,
	// it will try again later.
	RoutingInfo(context.Context, *RoutingInfoRequest) (*RoutingInfoResponse, error)
	// SessionInfo is used by the worker to inform the controller of all the sessions
	// it is managing. The controller may inform the worker if any sessions need to be changed.
	// If the worker repeatedly fails to successfully report its session info to the controller,
	// it will tear down any running sessions.
	SessionInfo(context.Context, *SessionInfoRequest) (*SessionInfoResponse, error)
	mustEmbedUnimplementedServerCoordinationServiceServer()
}

// UnimplementedServerCoordinationServiceServer must 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 UnimplementedServerCoordinationServiceServer struct{}

func (UnimplementedServerCoordinationServiceServer) Status(context.Context, *StatusRequest) (*StatusResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method Status not implemented")
}
func (UnimplementedServerCoordinationServiceServer) ListHcpbWorkers(context.Context, *ListHcpbWorkersRequest) (*ListHcpbWorkersResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method ListHcpbWorkers not implemented")
}
func (UnimplementedServerCoordinationServiceServer) Statistics(context.Context, *StatisticsRequest) (*StatisticsResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method Statistics not implemented")
}
func (UnimplementedServerCoordinationServiceServer) RoutingInfo(context.Context, *RoutingInfoRequest) (*RoutingInfoResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method RoutingInfo not implemented")
}
func (UnimplementedServerCoordinationServiceServer) SessionInfo(context.Context, *SessionInfoRequest) (*SessionInfoResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method SessionInfo not implemented")
}
func (UnimplementedServerCoordinationServiceServer) mustEmbedUnimplementedServerCoordinationServiceServer() {
}
func (UnimplementedServerCoordinationServiceServer) testEmbeddedByValue() {}

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

func RegisterServerCoordinationServiceServer(s grpc.ServiceRegistrar, srv ServerCoordinationServiceServer) {
	// If the following call panics, it indicates UnimplementedServerCoordinationServiceServer 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(&ServerCoordinationService_ServiceDesc, srv)
}

func _ServerCoordinationService_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(StatusRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ServerCoordinationServiceServer).Status(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ServerCoordinationService_Status_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ServerCoordinationServiceServer).Status(ctx, req.(*StatusRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _ServerCoordinationService_ListHcpbWorkers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListHcpbWorkersRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ServerCoordinationServiceServer).ListHcpbWorkers(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ServerCoordinationService_ListHcpbWorkers_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ServerCoordinationServiceServer).ListHcpbWorkers(ctx, req.(*ListHcpbWorkersRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _ServerCoordinationService_Statistics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(StatisticsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ServerCoordinationServiceServer).Statistics(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ServerCoordinationService_Statistics_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ServerCoordinationServiceServer).Statistics(ctx, req.(*StatisticsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _ServerCoordinationService_RoutingInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(RoutingInfoRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ServerCoordinationServiceServer).RoutingInfo(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ServerCoordinationService_RoutingInfo_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ServerCoordinationServiceServer).RoutingInfo(ctx, req.(*RoutingInfoRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _ServerCoordinationService_SessionInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SessionInfoRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ServerCoordinationServiceServer).SessionInfo(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ServerCoordinationService_SessionInfo_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ServerCoordinationServiceServer).SessionInfo(ctx, req.(*SessionInfoRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// ServerCoordinationService_ServiceDesc is the grpc.ServiceDesc for ServerCoordinationService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ServerCoordinationService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "controller.servers.services.v1.ServerCoordinationService",
	HandlerType: (*ServerCoordinationServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Status",
			Handler:    _ServerCoordinationService_Status_Handler,
		},
		{
			MethodName: "ListHcpbWorkers",
			Handler:    _ServerCoordinationService_ListHcpbWorkers_Handler,
		},
		{
			MethodName: "Statistics",
			Handler:    _ServerCoordinationService_Statistics_Handler,
		},
		{
			MethodName: "RoutingInfo",
			Handler:    _ServerCoordinationService_RoutingInfo_Handler,
		},
		{
			MethodName: "SessionInfo",
			Handler:    _ServerCoordinationService_SessionInfo_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "controller/servers/services/v1/server_coordination_service.proto",
}
