// Copyright 2015 The gRPC Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// The canonical version of this proto can be found at
// https://github.com/grpc/grpc-proto/blob/master/grpc/health/v1/health.proto

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc             v5.27.1
// source: grpc/health/v1/health.proto

package grpc_health_v1

import (
	context 
	grpc 
	codes 
	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 (
	Health_Check_FullMethodName = "/grpc.health.v1.Health/Check"
	Health_List_FullMethodName  = "/grpc.health.v1.Health/List"
	Health_Watch_FullMethodName = "/grpc.health.v1.Health/Watch"
)

// HealthClient is the client API for Health 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.
//
// Health is gRPC's mechanism for checking whether a server is able to handle
// RPCs. Its semantics are documented in
// https://github.com/grpc/grpc/blob/master/doc/health-checking.md.
type HealthClient interface {
	// Check gets the health of the specified service. If the requested service
	// is unknown, the call will fail with status NOT_FOUND. If the caller does
	// not specify a service name, the server should respond with its overall
	// health status.
	//
	// Clients should set a deadline when calling Check, and can declare the
	// server unhealthy if they do not receive a timely response.
	Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error)
	// List provides a non-atomic snapshot of the health of all the available
	// services.
	//
	// The server may respond with a RESOURCE_EXHAUSTED error if too many services
	// exist.
	//
	// Clients should set a deadline when calling List, and can declare the server
	// unhealthy if they do not receive a timely response.
	//
	// Clients should keep in mind that the list of health services exposed by an
	// application can change over the lifetime of the process.
	List(ctx context.Context, in *HealthListRequest, opts ...grpc.CallOption) (*HealthListResponse, error)
	// Performs a watch for the serving status of the requested service.
	// The server will immediately send back a message indicating the current
	// serving status.  It will then subsequently send a new message whenever
	// the service's serving status changes.
	//
	// If the requested service is unknown when the call is received, the
	// server will send a message setting the serving status to
	// SERVICE_UNKNOWN but will *not* terminate the call.  If at some
	// future point, the serving status of the service becomes known, the
	// server will send a new message with the service's serving status.
	//
	// If the call terminates with status UNIMPLEMENTED, then clients
	// should assume this method is not supported and should not retry the
	// call.  If the call terminates with any other status (including OK),
	// clients should retry the call with appropriate exponential backoff.
	Watch(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[HealthCheckResponse], error)
}

type healthClient struct {
	cc grpc.ClientConnInterface
}

func ( grpc.ClientConnInterface) HealthClient {
	return &healthClient{}
}

func ( *healthClient) ( context.Context,  *HealthCheckRequest,  ...grpc.CallOption) (*HealthCheckResponse, error) {
	 := append([]grpc.CallOption{grpc.StaticMethod()}, ...)
	 := new(HealthCheckResponse)
	 := .cc.Invoke(, Health_Check_FullMethodName, , , ...)
	if  != nil {
		return nil, 
	}
	return , nil
}

func ( *healthClient) ( context.Context,  *HealthListRequest,  ...grpc.CallOption) (*HealthListResponse, error) {
	 := append([]grpc.CallOption{grpc.StaticMethod()}, ...)
	 := new(HealthListResponse)
	 := .cc.Invoke(, Health_List_FullMethodName, , , ...)
	if  != nil {
		return nil, 
	}
	return , nil
}

func ( *healthClient) ( context.Context,  *HealthCheckRequest,  ...grpc.CallOption) (grpc.ServerStreamingClient[HealthCheckResponse], error) {
	 := append([]grpc.CallOption{grpc.StaticMethod()}, ...)
	,  := .cc.NewStream(, &Health_ServiceDesc.Streams[0], Health_Watch_FullMethodName, ...)
	if  != nil {
		return nil, 
	}
	 := &grpc.GenericClientStream[HealthCheckRequest, HealthCheckResponse]{ClientStream: }
	if  := .ClientStream.SendMsg();  != nil {
		return nil, 
	}
	if  := .ClientStream.CloseSend();  != nil {
		return nil, 
	}
	return , nil
}

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

// HealthServer is the server API for Health service.
// All implementations should embed UnimplementedHealthServer
// for forward compatibility.
//
// Health is gRPC's mechanism for checking whether a server is able to handle
// RPCs. Its semantics are documented in
// https://github.com/grpc/grpc/blob/master/doc/health-checking.md.
type HealthServer interface {
	// Check gets the health of the specified service. If the requested service
	// is unknown, the call will fail with status NOT_FOUND. If the caller does
	// not specify a service name, the server should respond with its overall
	// health status.
	//
	// Clients should set a deadline when calling Check, and can declare the
	// server unhealthy if they do not receive a timely response.
	Check(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error)
	// List provides a non-atomic snapshot of the health of all the available
	// services.
	//
	// The server may respond with a RESOURCE_EXHAUSTED error if too many services
	// exist.
	//
	// Clients should set a deadline when calling List, and can declare the server
	// unhealthy if they do not receive a timely response.
	//
	// Clients should keep in mind that the list of health services exposed by an
	// application can change over the lifetime of the process.
	List(context.Context, *HealthListRequest) (*HealthListResponse, error)
	// Performs a watch for the serving status of the requested service.
	// The server will immediately send back a message indicating the current
	// serving status.  It will then subsequently send a new message whenever
	// the service's serving status changes.
	//
	// If the requested service is unknown when the call is received, the
	// server will send a message setting the serving status to
	// SERVICE_UNKNOWN but will *not* terminate the call.  If at some
	// future point, the serving status of the service becomes known, the
	// server will send a new message with the service's serving status.
	//
	// If the call terminates with status UNIMPLEMENTED, then clients
	// should assume this method is not supported and should not retry the
	// call.  If the call terminates with any other status (including OK),
	// clients should retry the call with appropriate exponential backoff.
	Watch(*HealthCheckRequest, grpc.ServerStreamingServer[HealthCheckResponse]) error
}

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

func (UnimplementedHealthServer) (context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method Check not implemented")
}
func (UnimplementedHealthServer) (context.Context, *HealthListRequest) (*HealthListResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method List not implemented")
}
func (UnimplementedHealthServer) (*HealthCheckRequest, grpc.ServerStreamingServer[HealthCheckResponse]) error {
	return status.Error(codes.Unimplemented, "method Watch not implemented")
}
func (UnimplementedHealthServer) () {}

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

func ( grpc.ServiceRegistrar,  HealthServer) {
	// If the following call panics, it indicates UnimplementedHealthServer 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 ,  := .(interface{ () });  {
		.()
	}
	.RegisterService(&Health_ServiceDesc, )
}

func ( interface{},  context.Context,  func(interface{}) error,  grpc.UnaryServerInterceptor) (interface{}, error) {
	 := new(HealthCheckRequest)
	if  := ();  != nil {
		return nil, 
	}
	if  == nil {
		return .(HealthServer).Check(, )
	}
	 := &grpc.UnaryServerInfo{
		Server:     ,
		FullMethod: Health_Check_FullMethodName,
	}
	 := func( context.Context,  interface{}) (interface{}, error) {
		return .(HealthServer).Check(, .(*HealthCheckRequest))
	}
	return (, , , )
}

func ( interface{},  context.Context,  func(interface{}) error,  grpc.UnaryServerInterceptor) (interface{}, error) {
	 := new(HealthListRequest)
	if  := ();  != nil {
		return nil, 
	}
	if  == nil {
		return .(HealthServer).List(, )
	}
	 := &grpc.UnaryServerInfo{
		Server:     ,
		FullMethod: Health_List_FullMethodName,
	}
	 := func( context.Context,  interface{}) (interface{}, error) {
		return .(HealthServer).List(, .(*HealthListRequest))
	}
	return (, , , )
}

func ( interface{},  grpc.ServerStream) error {
	 := new(HealthCheckRequest)
	if  := .RecvMsg();  != nil {
		return 
	}
	return .(HealthServer).Watch(, &grpc.GenericServerStream[HealthCheckRequest, HealthCheckResponse]{ServerStream: })
}

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

// Health_ServiceDesc is the grpc.ServiceDesc for Health service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Health_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "grpc.health.v1.Health",
	HandlerType: (*HealthServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Check",
			Handler:    _Health_Check_Handler,
		},
		{
			MethodName: "List",
			Handler:    _Health_List_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Watch",
			Handler:       _Health_Watch_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "grpc/health/v1/health.proto",
}