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

package projectsv1connect

import (
	connect "connectrpc.com/connect"
	context "context"
	errors "errors"
	v1 "go.autokitteh.dev/autokitteh/proto/gen/go/autokitteh/projects/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 (
	// ProjectsServiceName is the fully-qualified name of the ProjectsService service.
	ProjectsServiceName = "autokitteh.projects.v1.ProjectsService"
)

// 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 (
	// ProjectsServiceCreateProcedure is the fully-qualified name of the ProjectsService's Create RPC.
	ProjectsServiceCreateProcedure = "/autokitteh.projects.v1.ProjectsService/Create"
	// ProjectsServiceDeleteProcedure is the fully-qualified name of the ProjectsService's Delete RPC.
	ProjectsServiceDeleteProcedure = "/autokitteh.projects.v1.ProjectsService/Delete"
	// ProjectsServiceGetProcedure is the fully-qualified name of the ProjectsService's Get RPC.
	ProjectsServiceGetProcedure = "/autokitteh.projects.v1.ProjectsService/Get"
	// ProjectsServiceUpdateProcedure is the fully-qualified name of the ProjectsService's Update RPC.
	ProjectsServiceUpdateProcedure = "/autokitteh.projects.v1.ProjectsService/Update"
	// ProjectsServiceListProcedure is the fully-qualified name of the ProjectsService's List RPC.
	ProjectsServiceListProcedure = "/autokitteh.projects.v1.ProjectsService/List"
	// ProjectsServiceBuildProcedure is the fully-qualified name of the ProjectsService's Build RPC.
	ProjectsServiceBuildProcedure = "/autokitteh.projects.v1.ProjectsService/Build"
	// ProjectsServiceSetResourcesProcedure is the fully-qualified name of the ProjectsService's
	// SetResources RPC.
	ProjectsServiceSetResourcesProcedure = "/autokitteh.projects.v1.ProjectsService/SetResources"
	// ProjectsServiceDownloadResourcesProcedure is the fully-qualified name of the ProjectsService's
	// DownloadResources RPC.
	ProjectsServiceDownloadResourcesProcedure = "/autokitteh.projects.v1.ProjectsService/DownloadResources"
	// ProjectsServiceExportProcedure is the fully-qualified name of the ProjectsService's Export RPC.
	ProjectsServiceExportProcedure = "/autokitteh.projects.v1.ProjectsService/Export"
	// ProjectsServiceLintProcedure is the fully-qualified name of the ProjectsService's Lint RPC.
	ProjectsServiceLintProcedure = "/autokitteh.projects.v1.ProjectsService/Lint"
)

// ProjectsServiceClient is a client for the autokitteh.projects.v1.ProjectsService service.
type ProjectsServiceClient interface {
	Create(context.Context, *connect.Request[v1.CreateRequest]) (*connect.Response[v1.CreateResponse], error)
	Delete(context.Context, *connect.Request[v1.DeleteRequest]) (*connect.Response[v1.DeleteResponse], error)
	Get(context.Context, *connect.Request[v1.GetRequest]) (*connect.Response[v1.GetResponse], error)
	Update(context.Context, *connect.Request[v1.UpdateRequest]) (*connect.Response[v1.UpdateResponse], error)
	List(context.Context, *connect.Request[v1.ListRequest]) (*connect.Response[v1.ListResponse], error)
	Build(context.Context, *connect.Request[v1.BuildRequest]) (*connect.Response[v1.BuildResponse], error)
	SetResources(context.Context, *connect.Request[v1.SetResourcesRequest]) (*connect.Response[v1.SetResourcesResponse], error)
	DownloadResources(context.Context, *connect.Request[v1.DownloadResourcesRequest]) (*connect.Response[v1.DownloadResourcesResponse], error)
	Export(context.Context, *connect.Request[v1.ExportRequest]) (*connect.Response[v1.ExportResponse], error)
	Lint(context.Context, *connect.Request[v1.LintRequest]) (*connect.Response[v1.LintResponse], error)
}

// NewProjectsServiceClient constructs a client for the autokitteh.projects.v1.ProjectsService
// 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 NewProjectsServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) ProjectsServiceClient {
	baseURL = strings.TrimRight(baseURL, "/")
	return &projectsServiceClient{
		create: connect.NewClient[v1.CreateRequest, v1.CreateResponse](
			httpClient,
			baseURL+ProjectsServiceCreateProcedure,
			opts...,
		),
		delete: connect.NewClient[v1.DeleteRequest, v1.DeleteResponse](
			httpClient,
			baseURL+ProjectsServiceDeleteProcedure,
			opts...,
		),
		get: connect.NewClient[v1.GetRequest, v1.GetResponse](
			httpClient,
			baseURL+ProjectsServiceGetProcedure,
			opts...,
		),
		update: connect.NewClient[v1.UpdateRequest, v1.UpdateResponse](
			httpClient,
			baseURL+ProjectsServiceUpdateProcedure,
			opts...,
		),
		list: connect.NewClient[v1.ListRequest, v1.ListResponse](
			httpClient,
			baseURL+ProjectsServiceListProcedure,
			opts...,
		),
		build: connect.NewClient[v1.BuildRequest, v1.BuildResponse](
			httpClient,
			baseURL+ProjectsServiceBuildProcedure,
			opts...,
		),
		setResources: connect.NewClient[v1.SetResourcesRequest, v1.SetResourcesResponse](
			httpClient,
			baseURL+ProjectsServiceSetResourcesProcedure,
			opts...,
		),
		downloadResources: connect.NewClient[v1.DownloadResourcesRequest, v1.DownloadResourcesResponse](
			httpClient,
			baseURL+ProjectsServiceDownloadResourcesProcedure,
			opts...,
		),
		export: connect.NewClient[v1.ExportRequest, v1.ExportResponse](
			httpClient,
			baseURL+ProjectsServiceExportProcedure,
			opts...,
		),
		lint: connect.NewClient[v1.LintRequest, v1.LintResponse](
			httpClient,
			baseURL+ProjectsServiceLintProcedure,
			opts...,
		),
	}
}

// projectsServiceClient implements ProjectsServiceClient.
type projectsServiceClient struct {
	create            *connect.Client[v1.CreateRequest, v1.CreateResponse]
	delete            *connect.Client[v1.DeleteRequest, v1.DeleteResponse]
	get               *connect.Client[v1.GetRequest, v1.GetResponse]
	update            *connect.Client[v1.UpdateRequest, v1.UpdateResponse]
	list              *connect.Client[v1.ListRequest, v1.ListResponse]
	build             *connect.Client[v1.BuildRequest, v1.BuildResponse]
	setResources      *connect.Client[v1.SetResourcesRequest, v1.SetResourcesResponse]
	downloadResources *connect.Client[v1.DownloadResourcesRequest, v1.DownloadResourcesResponse]
	export            *connect.Client[v1.ExportRequest, v1.ExportResponse]
	lint              *connect.Client[v1.LintRequest, v1.LintResponse]
}

// Create calls autokitteh.projects.v1.ProjectsService.Create.
func (c *projectsServiceClient) Create(ctx context.Context, req *connect.Request[v1.CreateRequest]) (*connect.Response[v1.CreateResponse], error) {
	return c.create.CallUnary(ctx, req)
}

// Delete calls autokitteh.projects.v1.ProjectsService.Delete.
func (c *projectsServiceClient) Delete(ctx context.Context, req *connect.Request[v1.DeleteRequest]) (*connect.Response[v1.DeleteResponse], error) {
	return c.delete.CallUnary(ctx, req)
}

// Get calls autokitteh.projects.v1.ProjectsService.Get.
func (c *projectsServiceClient) Get(ctx context.Context, req *connect.Request[v1.GetRequest]) (*connect.Response[v1.GetResponse], error) {
	return c.get.CallUnary(ctx, req)
}

// Update calls autokitteh.projects.v1.ProjectsService.Update.
func (c *projectsServiceClient) Update(ctx context.Context, req *connect.Request[v1.UpdateRequest]) (*connect.Response[v1.UpdateResponse], error) {
	return c.update.CallUnary(ctx, req)
}

// List calls autokitteh.projects.v1.ProjectsService.List.
func (c *projectsServiceClient) List(ctx context.Context, req *connect.Request[v1.ListRequest]) (*connect.Response[v1.ListResponse], error) {
	return c.list.CallUnary(ctx, req)
}

// Build calls autokitteh.projects.v1.ProjectsService.Build.
func (c *projectsServiceClient) Build(ctx context.Context, req *connect.Request[v1.BuildRequest]) (*connect.Response[v1.BuildResponse], error) {
	return c.build.CallUnary(ctx, req)
}

// SetResources calls autokitteh.projects.v1.ProjectsService.SetResources.
func (c *projectsServiceClient) SetResources(ctx context.Context, req *connect.Request[v1.SetResourcesRequest]) (*connect.Response[v1.SetResourcesResponse], error) {
	return c.setResources.CallUnary(ctx, req)
}

// DownloadResources calls autokitteh.projects.v1.ProjectsService.DownloadResources.
func (c *projectsServiceClient) DownloadResources(ctx context.Context, req *connect.Request[v1.DownloadResourcesRequest]) (*connect.Response[v1.DownloadResourcesResponse], error) {
	return c.downloadResources.CallUnary(ctx, req)
}

// Export calls autokitteh.projects.v1.ProjectsService.Export.
func (c *projectsServiceClient) Export(ctx context.Context, req *connect.Request[v1.ExportRequest]) (*connect.Response[v1.ExportResponse], error) {
	return c.export.CallUnary(ctx, req)
}

// Lint calls autokitteh.projects.v1.ProjectsService.Lint.
func (c *projectsServiceClient) Lint(ctx context.Context, req *connect.Request[v1.LintRequest]) (*connect.Response[v1.LintResponse], error) {
	return c.lint.CallUnary(ctx, req)
}

// ProjectsServiceHandler is an implementation of the autokitteh.projects.v1.ProjectsService
// service.
type ProjectsServiceHandler interface {
	Create(context.Context, *connect.Request[v1.CreateRequest]) (*connect.Response[v1.CreateResponse], error)
	Delete(context.Context, *connect.Request[v1.DeleteRequest]) (*connect.Response[v1.DeleteResponse], error)
	Get(context.Context, *connect.Request[v1.GetRequest]) (*connect.Response[v1.GetResponse], error)
	Update(context.Context, *connect.Request[v1.UpdateRequest]) (*connect.Response[v1.UpdateResponse], error)
	List(context.Context, *connect.Request[v1.ListRequest]) (*connect.Response[v1.ListResponse], error)
	Build(context.Context, *connect.Request[v1.BuildRequest]) (*connect.Response[v1.BuildResponse], error)
	SetResources(context.Context, *connect.Request[v1.SetResourcesRequest]) (*connect.Response[v1.SetResourcesResponse], error)
	DownloadResources(context.Context, *connect.Request[v1.DownloadResourcesRequest]) (*connect.Response[v1.DownloadResourcesResponse], error)
	Export(context.Context, *connect.Request[v1.ExportRequest]) (*connect.Response[v1.ExportResponse], error)
	Lint(context.Context, *connect.Request[v1.LintRequest]) (*connect.Response[v1.LintResponse], error)
}

// NewProjectsServiceHandler 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 NewProjectsServiceHandler(svc ProjectsServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {
	projectsServiceCreateHandler := connect.NewUnaryHandler(
		ProjectsServiceCreateProcedure,
		svc.Create,
		opts...,
	)
	projectsServiceDeleteHandler := connect.NewUnaryHandler(
		ProjectsServiceDeleteProcedure,
		svc.Delete,
		opts...,
	)
	projectsServiceGetHandler := connect.NewUnaryHandler(
		ProjectsServiceGetProcedure,
		svc.Get,
		opts...,
	)
	projectsServiceUpdateHandler := connect.NewUnaryHandler(
		ProjectsServiceUpdateProcedure,
		svc.Update,
		opts...,
	)
	projectsServiceListHandler := connect.NewUnaryHandler(
		ProjectsServiceListProcedure,
		svc.List,
		opts...,
	)
	projectsServiceBuildHandler := connect.NewUnaryHandler(
		ProjectsServiceBuildProcedure,
		svc.Build,
		opts...,
	)
	projectsServiceSetResourcesHandler := connect.NewUnaryHandler(
		ProjectsServiceSetResourcesProcedure,
		svc.SetResources,
		opts...,
	)
	projectsServiceDownloadResourcesHandler := connect.NewUnaryHandler(
		ProjectsServiceDownloadResourcesProcedure,
		svc.DownloadResources,
		opts...,
	)
	projectsServiceExportHandler := connect.NewUnaryHandler(
		ProjectsServiceExportProcedure,
		svc.Export,
		opts...,
	)
	projectsServiceLintHandler := connect.NewUnaryHandler(
		ProjectsServiceLintProcedure,
		svc.Lint,
		opts...,
	)
	return "/autokitteh.projects.v1.ProjectsService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		switch r.URL.Path {
		case ProjectsServiceCreateProcedure:
			projectsServiceCreateHandler.ServeHTTP(w, r)
		case ProjectsServiceDeleteProcedure:
			projectsServiceDeleteHandler.ServeHTTP(w, r)
		case ProjectsServiceGetProcedure:
			projectsServiceGetHandler.ServeHTTP(w, r)
		case ProjectsServiceUpdateProcedure:
			projectsServiceUpdateHandler.ServeHTTP(w, r)
		case ProjectsServiceListProcedure:
			projectsServiceListHandler.ServeHTTP(w, r)
		case ProjectsServiceBuildProcedure:
			projectsServiceBuildHandler.ServeHTTP(w, r)
		case ProjectsServiceSetResourcesProcedure:
			projectsServiceSetResourcesHandler.ServeHTTP(w, r)
		case ProjectsServiceDownloadResourcesProcedure:
			projectsServiceDownloadResourcesHandler.ServeHTTP(w, r)
		case ProjectsServiceExportProcedure:
			projectsServiceExportHandler.ServeHTTP(w, r)
		case ProjectsServiceLintProcedure:
			projectsServiceLintHandler.ServeHTTP(w, r)
		default:
			http.NotFound(w, r)
		}
	})
}

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

func (UnimplementedProjectsServiceHandler) Create(context.Context, *connect.Request[v1.CreateRequest]) (*connect.Response[v1.CreateResponse], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("autokitteh.projects.v1.ProjectsService.Create is not implemented"))
}

func (UnimplementedProjectsServiceHandler) Delete(context.Context, *connect.Request[v1.DeleteRequest]) (*connect.Response[v1.DeleteResponse], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("autokitteh.projects.v1.ProjectsService.Delete is not implemented"))
}

func (UnimplementedProjectsServiceHandler) Get(context.Context, *connect.Request[v1.GetRequest]) (*connect.Response[v1.GetResponse], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("autokitteh.projects.v1.ProjectsService.Get is not implemented"))
}

func (UnimplementedProjectsServiceHandler) Update(context.Context, *connect.Request[v1.UpdateRequest]) (*connect.Response[v1.UpdateResponse], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("autokitteh.projects.v1.ProjectsService.Update is not implemented"))
}

func (UnimplementedProjectsServiceHandler) List(context.Context, *connect.Request[v1.ListRequest]) (*connect.Response[v1.ListResponse], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("autokitteh.projects.v1.ProjectsService.List is not implemented"))
}

func (UnimplementedProjectsServiceHandler) Build(context.Context, *connect.Request[v1.BuildRequest]) (*connect.Response[v1.BuildResponse], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("autokitteh.projects.v1.ProjectsService.Build is not implemented"))
}

func (UnimplementedProjectsServiceHandler) SetResources(context.Context, *connect.Request[v1.SetResourcesRequest]) (*connect.Response[v1.SetResourcesResponse], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("autokitteh.projects.v1.ProjectsService.SetResources is not implemented"))
}

func (UnimplementedProjectsServiceHandler) DownloadResources(context.Context, *connect.Request[v1.DownloadResourcesRequest]) (*connect.Response[v1.DownloadResourcesResponse], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("autokitteh.projects.v1.ProjectsService.DownloadResources is not implemented"))
}

func (UnimplementedProjectsServiceHandler) Export(context.Context, *connect.Request[v1.ExportRequest]) (*connect.Response[v1.ExportResponse], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("autokitteh.projects.v1.ProjectsService.Export is not implemented"))
}

func (UnimplementedProjectsServiceHandler) Lint(context.Context, *connect.Request[v1.LintRequest]) (*connect.Response[v1.LintResponse], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("autokitteh.projects.v1.ProjectsService.Lint is not implemented"))
}
