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

package integration_registryv1connect

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

// 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 (
	// IntegrationRegistryServiceCreateProcedure is the fully-qualified name of the
	// IntegrationRegistryService's Create RPC.
	IntegrationRegistryServiceCreateProcedure = "/autokitteh.integration_registry.v1.IntegrationRegistryService/Create"
	// IntegrationRegistryServiceUpdateProcedure is the fully-qualified name of the
	// IntegrationRegistryService's Update RPC.
	IntegrationRegistryServiceUpdateProcedure = "/autokitteh.integration_registry.v1.IntegrationRegistryService/Update"
	// IntegrationRegistryServiceDeleteProcedure is the fully-qualified name of the
	// IntegrationRegistryService's Delete RPC.
	IntegrationRegistryServiceDeleteProcedure = "/autokitteh.integration_registry.v1.IntegrationRegistryService/Delete"
	// IntegrationRegistryServiceGetProcedure is the fully-qualified name of the
	// IntegrationRegistryService's Get RPC.
	IntegrationRegistryServiceGetProcedure = "/autokitteh.integration_registry.v1.IntegrationRegistryService/Get"
	// IntegrationRegistryServiceListProcedure is the fully-qualified name of the
	// IntegrationRegistryService's List RPC.
	IntegrationRegistryServiceListProcedure = "/autokitteh.integration_registry.v1.IntegrationRegistryService/List"
)

// IntegrationRegistryServiceClient is a client for the
// autokitteh.integration_registry.v1.IntegrationRegistryService service.
type IntegrationRegistryServiceClient interface {
	// Register a new integration with the autokitteh server,
	// to enable that server to create connections using it.
	Create(context.Context, *connect.Request[v1.CreateRequest]) (*connect.Response[v1.CreateResponse], error)
	Update(context.Context, *connect.Request[v1.UpdateRequest]) (*connect.Response[v1.UpdateResponse], 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)
	List(context.Context, *connect.Request[v1.ListRequest]) (*connect.Response[v1.ListResponse], error)
}

// NewIntegrationRegistryServiceClient constructs a client for the
// autokitteh.integration_registry.v1.IntegrationRegistryService 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 NewIntegrationRegistryServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) IntegrationRegistryServiceClient {
	baseURL = strings.TrimRight(baseURL, "/")
	return &integrationRegistryServiceClient{
		create: connect.NewClient[v1.CreateRequest, v1.CreateResponse](
			httpClient,
			baseURL+IntegrationRegistryServiceCreateProcedure,
			opts...,
		),
		update: connect.NewClient[v1.UpdateRequest, v1.UpdateResponse](
			httpClient,
			baseURL+IntegrationRegistryServiceUpdateProcedure,
			opts...,
		),
		delete: connect.NewClient[v1.DeleteRequest, v1.DeleteResponse](
			httpClient,
			baseURL+IntegrationRegistryServiceDeleteProcedure,
			opts...,
		),
		get: connect.NewClient[v1.GetRequest, v1.GetResponse](
			httpClient,
			baseURL+IntegrationRegistryServiceGetProcedure,
			opts...,
		),
		list: connect.NewClient[v1.ListRequest, v1.ListResponse](
			httpClient,
			baseURL+IntegrationRegistryServiceListProcedure,
			opts...,
		),
	}
}

// integrationRegistryServiceClient implements IntegrationRegistryServiceClient.
type integrationRegistryServiceClient struct {
	create *connect.Client[v1.CreateRequest, v1.CreateResponse]
	update *connect.Client[v1.UpdateRequest, v1.UpdateResponse]
	delete *connect.Client[v1.DeleteRequest, v1.DeleteResponse]
	get    *connect.Client[v1.GetRequest, v1.GetResponse]
	list   *connect.Client[v1.ListRequest, v1.ListResponse]
}

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

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

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

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

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

// IntegrationRegistryServiceHandler is an implementation of the
// autokitteh.integration_registry.v1.IntegrationRegistryService service.
type IntegrationRegistryServiceHandler interface {
	// Register a new integration with the autokitteh server,
	// to enable that server to create connections using it.
	Create(context.Context, *connect.Request[v1.CreateRequest]) (*connect.Response[v1.CreateResponse], error)
	Update(context.Context, *connect.Request[v1.UpdateRequest]) (*connect.Response[v1.UpdateResponse], 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)
	List(context.Context, *connect.Request[v1.ListRequest]) (*connect.Response[v1.ListResponse], error)
}

// NewIntegrationRegistryServiceHandler 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 NewIntegrationRegistryServiceHandler(svc IntegrationRegistryServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {
	integrationRegistryServiceCreateHandler := connect.NewUnaryHandler(
		IntegrationRegistryServiceCreateProcedure,
		svc.Create,
		opts...,
	)
	integrationRegistryServiceUpdateHandler := connect.NewUnaryHandler(
		IntegrationRegistryServiceUpdateProcedure,
		svc.Update,
		opts...,
	)
	integrationRegistryServiceDeleteHandler := connect.NewUnaryHandler(
		IntegrationRegistryServiceDeleteProcedure,
		svc.Delete,
		opts...,
	)
	integrationRegistryServiceGetHandler := connect.NewUnaryHandler(
		IntegrationRegistryServiceGetProcedure,
		svc.Get,
		opts...,
	)
	integrationRegistryServiceListHandler := connect.NewUnaryHandler(
		IntegrationRegistryServiceListProcedure,
		svc.List,
		opts...,
	)
	return "/autokitteh.integration_registry.v1.IntegrationRegistryService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		switch r.URL.Path {
		case IntegrationRegistryServiceCreateProcedure:
			integrationRegistryServiceCreateHandler.ServeHTTP(w, r)
		case IntegrationRegistryServiceUpdateProcedure:
			integrationRegistryServiceUpdateHandler.ServeHTTP(w, r)
		case IntegrationRegistryServiceDeleteProcedure:
			integrationRegistryServiceDeleteHandler.ServeHTTP(w, r)
		case IntegrationRegistryServiceGetProcedure:
			integrationRegistryServiceGetHandler.ServeHTTP(w, r)
		case IntegrationRegistryServiceListProcedure:
			integrationRegistryServiceListHandler.ServeHTTP(w, r)
		default:
			http.NotFound(w, r)
		}
	})
}

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

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

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

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

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

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