// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// source: mcr/v1/admin.proto

package mcrv1

import (
	"context"

	"google.golang.org/grpc"
	"google.golang.org/grpc/codes"
	"google.golang.org/grpc/status"
)

// AdminServiceServer is the server API for AdminService.
type AdminServiceServer interface {
	Health(context.Context, *HealthRequest) (*HealthResponse, error)
	mustEmbedUnimplementedAdminServiceServer()
}

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

func (UnimplementedAdminServiceServer) Health(context.Context, *HealthRequest) (*HealthResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Health not implemented")
}

func (UnimplementedAdminServiceServer) mustEmbedUnimplementedAdminServiceServer() {}

// RegisterAdminServiceServer registers the AdminServiceServer with the grpc.Server.
func RegisterAdminServiceServer(s grpc.ServiceRegistrar, srv AdminServiceServer) {
	s.RegisterService(&AdminService_ServiceDesc, srv)
}

func adminServiceHealthHandler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) {
	in := new(HealthRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AdminServiceServer).Health(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/mcr.v1.AdminService/Health",
	}
	handler := func(ctx context.Context, req any) (any, error) {
		return srv.(AdminServiceServer).Health(ctx, req.(*HealthRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// AdminService_ServiceDesc is the grpc.ServiceDesc for AdminService.
var AdminService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "mcr.v1.AdminService",
	HandlerType: (*AdminServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Health",
			Handler:    adminServiceHealthHandler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "mcr/v1/admin.proto",
}

// AdminServiceClient is the client API for AdminService.
type AdminServiceClient interface {
	Health(ctx context.Context, in *HealthRequest, opts ...grpc.CallOption) (*HealthResponse, error)
}

type adminServiceClient struct {
	cc grpc.ClientConnInterface
}

// NewAdminServiceClient creates a new AdminServiceClient.
func NewAdminServiceClient(cc grpc.ClientConnInterface) AdminServiceClient {
	return &adminServiceClient{cc}
}

func (c *adminServiceClient) Health(ctx context.Context, in *HealthRequest, opts ...grpc.CallOption) (*HealthResponse, error) {
	out := new(HealthResponse)
	err := c.cc.Invoke(ctx, "/mcr.v1.AdminService/Health", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}
