// Code generated by protoc-gen-connect-go. DO NOT EDIT.
//
// Source: autokitteh/runner_manager/v1/runner_manager_svc.proto

package runner_managerv1connect

import (
	connect "connectrpc.com/connect"
	context "context"
	errors "errors"
	v1 "go.autokitteh.dev/autokitteh/proto/gen/go/autokitteh/runner_manager/v1"
	http "net/http"
	strings "strings"
)

// This is a compile-time assertion to ensure that this generated file and the connect package are
// compatible. If you get a compiler error that this constant is not defined, this code was
// generated with a version of connect newer than the one compiled into your binary. You can fix the
// problem by either regenerating this code with an older version of connect or updating the connect
// version compiled into your binary.
const _ = connect.IsAtLeastVersion0_1_0

const (
	// RunnerManagerServiceName is the fully-qualified name of the RunnerManagerService service.
	RunnerManagerServiceName = "autokitteh.runner_manager.v1.RunnerManagerService"
)

// These constants are the fully-qualified names of the RPCs defined in this package. They're
// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
//
// Note that these are different from the fully-qualified method names used by
// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to
// reflection-formatted method names, remove the leading slash and convert the remaining slash to a
// period.
const (
	// RunnerManagerServiceStartRunnerProcedure is the fully-qualified name of the
	// RunnerManagerService's StartRunner RPC.
	RunnerManagerServiceStartRunnerProcedure = "/autokitteh.runner_manager.v1.RunnerManagerService/StartRunner"
	// RunnerManagerServiceRunnerHealthProcedure is the fully-qualified name of the
	// RunnerManagerService's RunnerHealth RPC.
	RunnerManagerServiceRunnerHealthProcedure = "/autokitteh.runner_manager.v1.RunnerManagerService/RunnerHealth"
	// RunnerManagerServiceStopRunnerProcedure is the fully-qualified name of the RunnerManagerService's
	// StopRunner RPC.
	RunnerManagerServiceStopRunnerProcedure = "/autokitteh.runner_manager.v1.RunnerManagerService/StopRunner"
	// RunnerManagerServiceHealthProcedure is the fully-qualified name of the RunnerManagerService's
	// Health RPC.
	RunnerManagerServiceHealthProcedure = "/autokitteh.runner_manager.v1.RunnerManagerService/Health"
)

// RunnerManagerServiceClient is a client for the autokitteh.runner_manager.v1.RunnerManagerService
// service.
type RunnerManagerServiceClient interface {
	StartRunner(context.Context, *connect.Request[v1.StartRunnerRequest]) (*connect.Response[v1.StartRunnerResponse], error)
	RunnerHealth(context.Context, *connect.Request[v1.RunnerHealthRequest]) (*connect.Response[v1.RunnerHealthResponse], error)
	StopRunner(context.Context, *connect.Request[v1.StopRunnerRequest]) (*connect.Response[v1.StopRunnerResponse], error)
	Health(context.Context, *connect.Request[v1.HealthRequest]) (*connect.Response[v1.HealthResponse], error)
}

// NewRunnerManagerServiceClient constructs a client for the
// autokitteh.runner_manager.v1.RunnerManagerService service. By default, it uses the Connect
// protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed
// requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or
// connect.WithGRPCWeb() options.
//
// The URL supplied here should be the base URL for the Connect or gRPC server (for example,
// http://api.acme.com or https://acme.com/grpc).
func NewRunnerManagerServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) RunnerManagerServiceClient {
	baseURL = strings.TrimRight(baseURL, "/")
	return &runnerManagerServiceClient{
		startRunner: connect.NewClient[v1.StartRunnerRequest, v1.StartRunnerResponse](
			httpClient,
			baseURL+RunnerManagerServiceStartRunnerProcedure,
			opts...,
		),
		runnerHealth: connect.NewClient[v1.RunnerHealthRequest, v1.RunnerHealthResponse](
			httpClient,
			baseURL+RunnerManagerServiceRunnerHealthProcedure,
			opts...,
		),
		stopRunner: connect.NewClient[v1.StopRunnerRequest, v1.StopRunnerResponse](
			httpClient,
			baseURL+RunnerManagerServiceStopRunnerProcedure,
			opts...,
		),
		health: connect.NewClient[v1.HealthRequest, v1.HealthResponse](
			httpClient,
			baseURL+RunnerManagerServiceHealthProcedure,
			opts...,
		),
	}
}

// runnerManagerServiceClient implements RunnerManagerServiceClient.
type runnerManagerServiceClient struct {
	startRunner  *connect.Client[v1.StartRunnerRequest, v1.StartRunnerResponse]
	runnerHealth *connect.Client[v1.RunnerHealthRequest, v1.RunnerHealthResponse]
	stopRunner   *connect.Client[v1.StopRunnerRequest, v1.StopRunnerResponse]
	health       *connect.Client[v1.HealthRequest, v1.HealthResponse]
}

// StartRunner calls autokitteh.runner_manager.v1.RunnerManagerService.StartRunner.
func (c *runnerManagerServiceClient) StartRunner(ctx context.Context, req *connect.Request[v1.StartRunnerRequest]) (*connect.Response[v1.StartRunnerResponse], error) {
	return c.startRunner.CallUnary(ctx, req)
}

// RunnerHealth calls autokitteh.runner_manager.v1.RunnerManagerService.RunnerHealth.
func (c *runnerManagerServiceClient) RunnerHealth(ctx context.Context, req *connect.Request[v1.RunnerHealthRequest]) (*connect.Response[v1.RunnerHealthResponse], error) {
	return c.runnerHealth.CallUnary(ctx, req)
}

// StopRunner calls autokitteh.runner_manager.v1.RunnerManagerService.StopRunner.
func (c *runnerManagerServiceClient) StopRunner(ctx context.Context, req *connect.Request[v1.StopRunnerRequest]) (*connect.Response[v1.StopRunnerResponse], error) {
	return c.stopRunner.CallUnary(ctx, req)
}

// Health calls autokitteh.runner_manager.v1.RunnerManagerService.Health.
func (c *runnerManagerServiceClient) Health(ctx context.Context, req *connect.Request[v1.HealthRequest]) (*connect.Response[v1.HealthResponse], error) {
	return c.health.CallUnary(ctx, req)
}

// RunnerManagerServiceHandler is an implementation of the
// autokitteh.runner_manager.v1.RunnerManagerService service.
type RunnerManagerServiceHandler interface {
	StartRunner(context.Context, *connect.Request[v1.StartRunnerRequest]) (*connect.Response[v1.StartRunnerResponse], error)
	RunnerHealth(context.Context, *connect.Request[v1.RunnerHealthRequest]) (*connect.Response[v1.RunnerHealthResponse], error)
	StopRunner(context.Context, *connect.Request[v1.StopRunnerRequest]) (*connect.Response[v1.StopRunnerResponse], error)
	Health(context.Context, *connect.Request[v1.HealthRequest]) (*connect.Response[v1.HealthResponse], error)
}

// NewRunnerManagerServiceHandler builds an HTTP handler from the service implementation. It returns
// the path on which to mount the handler and the handler itself.
//
// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf
// and JSON codecs. They also support gzip compression.
func NewRunnerManagerServiceHandler(svc RunnerManagerServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {
	runnerManagerServiceStartRunnerHandler := connect.NewUnaryHandler(
		RunnerManagerServiceStartRunnerProcedure,
		svc.StartRunner,
		opts...,
	)
	runnerManagerServiceRunnerHealthHandler := connect.NewUnaryHandler(
		RunnerManagerServiceRunnerHealthProcedure,
		svc.RunnerHealth,
		opts...,
	)
	runnerManagerServiceStopRunnerHandler := connect.NewUnaryHandler(
		RunnerManagerServiceStopRunnerProcedure,
		svc.StopRunner,
		opts...,
	)
	runnerManagerServiceHealthHandler := connect.NewUnaryHandler(
		RunnerManagerServiceHealthProcedure,
		svc.Health,
		opts...,
	)
	return "/autokitteh.runner_manager.v1.RunnerManagerService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		switch r.URL.Path {
		case RunnerManagerServiceStartRunnerProcedure:
			runnerManagerServiceStartRunnerHandler.ServeHTTP(w, r)
		case RunnerManagerServiceRunnerHealthProcedure:
			runnerManagerServiceRunnerHealthHandler.ServeHTTP(w, r)
		case RunnerManagerServiceStopRunnerProcedure:
			runnerManagerServiceStopRunnerHandler.ServeHTTP(w, r)
		case RunnerManagerServiceHealthProcedure:
			runnerManagerServiceHealthHandler.ServeHTTP(w, r)
		default:
			http.NotFound(w, r)
		}
	})
}

// UnimplementedRunnerManagerServiceHandler returns CodeUnimplemented from all methods.
type UnimplementedRunnerManagerServiceHandler struct{}

func (UnimplementedRunnerManagerServiceHandler) StartRunner(context.Context, *connect.Request[v1.StartRunnerRequest]) (*connect.Response[v1.StartRunnerResponse], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("autokitteh.runner_manager.v1.RunnerManagerService.StartRunner is not implemented"))
}

func (UnimplementedRunnerManagerServiceHandler) RunnerHealth(context.Context, *connect.Request[v1.RunnerHealthRequest]) (*connect.Response[v1.RunnerHealthResponse], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("autokitteh.runner_manager.v1.RunnerManagerService.RunnerHealth is not implemented"))
}

func (UnimplementedRunnerManagerServiceHandler) StopRunner(context.Context, *connect.Request[v1.StopRunnerRequest]) (*connect.Response[v1.StopRunnerResponse], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("autokitteh.runner_manager.v1.RunnerManagerService.StopRunner is not implemented"))
}

func (UnimplementedRunnerManagerServiceHandler) Health(context.Context, *connect.Request[v1.HealthRequest]) (*connect.Response[v1.HealthResponse], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("autokitteh.runner_manager.v1.RunnerManagerService.Health is not implemented"))
}
