// Code generated by protoc-gen-connect-go. DO NOT EDIT.
//
// Source: xyz/block/ftl/v1/schemaservice.proto

package ftlv1connect

import (
	connect "connectrpc.com/connect"
	context "context"
	errors "errors"
	v1 "github.com/block/ftl/backend/protos/xyz/block/ftl/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.IsAtLeastVersion1_13_0

const (
	// SchemaServiceName is the fully-qualified name of the SchemaService service.
	SchemaServiceName = "xyz.block.ftl.v1.SchemaService"
	// SchemaMirrorServiceName is the fully-qualified name of the SchemaMirrorService service.
	SchemaMirrorServiceName = "xyz.block.ftl.v1.SchemaMirrorService"
)

// 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 (
	// SchemaServicePingProcedure is the fully-qualified name of the SchemaService's Ping RPC.
	SchemaServicePingProcedure = "/xyz.block.ftl.v1.SchemaService/Ping"
	// SchemaServiceGetSchemaProcedure is the fully-qualified name of the SchemaService's GetSchema RPC.
	SchemaServiceGetSchemaProcedure = "/xyz.block.ftl.v1.SchemaService/GetSchema"
	// SchemaServicePullSchemaProcedure is the fully-qualified name of the SchemaService's PullSchema
	// RPC.
	SchemaServicePullSchemaProcedure = "/xyz.block.ftl.v1.SchemaService/PullSchema"
	// SchemaServiceUpdateDeploymentRuntimeProcedure is the fully-qualified name of the SchemaService's
	// UpdateDeploymentRuntime RPC.
	SchemaServiceUpdateDeploymentRuntimeProcedure = "/xyz.block.ftl.v1.SchemaService/UpdateDeploymentRuntime"
	// SchemaServiceGetDeploymentsProcedure is the fully-qualified name of the SchemaService's
	// GetDeployments RPC.
	SchemaServiceGetDeploymentsProcedure = "/xyz.block.ftl.v1.SchemaService/GetDeployments"
	// SchemaServiceCreateChangesetProcedure is the fully-qualified name of the SchemaService's
	// CreateChangeset RPC.
	SchemaServiceCreateChangesetProcedure = "/xyz.block.ftl.v1.SchemaService/CreateChangeset"
	// SchemaServicePrepareChangesetProcedure is the fully-qualified name of the SchemaService's
	// PrepareChangeset RPC.
	SchemaServicePrepareChangesetProcedure = "/xyz.block.ftl.v1.SchemaService/PrepareChangeset"
	// SchemaServiceCommitChangesetProcedure is the fully-qualified name of the SchemaService's
	// CommitChangeset RPC.
	SchemaServiceCommitChangesetProcedure = "/xyz.block.ftl.v1.SchemaService/CommitChangeset"
	// SchemaServiceDrainChangesetProcedure is the fully-qualified name of the SchemaService's
	// DrainChangeset RPC.
	SchemaServiceDrainChangesetProcedure = "/xyz.block.ftl.v1.SchemaService/DrainChangeset"
	// SchemaServiceFinalizeChangesetProcedure is the fully-qualified name of the SchemaService's
	// FinalizeChangeset RPC.
	SchemaServiceFinalizeChangesetProcedure = "/xyz.block.ftl.v1.SchemaService/FinalizeChangeset"
	// SchemaServiceRollbackChangesetProcedure is the fully-qualified name of the SchemaService's
	// RollbackChangeset RPC.
	SchemaServiceRollbackChangesetProcedure = "/xyz.block.ftl.v1.SchemaService/RollbackChangeset"
	// SchemaServiceFailChangesetProcedure is the fully-qualified name of the SchemaService's
	// FailChangeset RPC.
	SchemaServiceFailChangesetProcedure = "/xyz.block.ftl.v1.SchemaService/FailChangeset"
	// SchemaServiceGetDeploymentProcedure is the fully-qualified name of the SchemaService's
	// GetDeployment RPC.
	SchemaServiceGetDeploymentProcedure = "/xyz.block.ftl.v1.SchemaService/GetDeployment"
	// SchemaMirrorServicePingProcedure is the fully-qualified name of the SchemaMirrorService's Ping
	// RPC.
	SchemaMirrorServicePingProcedure = "/xyz.block.ftl.v1.SchemaMirrorService/Ping"
	// SchemaMirrorServicePushSchemaProcedure is the fully-qualified name of the SchemaMirrorService's
	// PushSchema RPC.
	SchemaMirrorServicePushSchemaProcedure = "/xyz.block.ftl.v1.SchemaMirrorService/PushSchema"
)

// SchemaServiceClient is a client for the xyz.block.ftl.v1.SchemaService service.
type SchemaServiceClient interface {
	// Ping service for readiness.
	Ping(context.Context, *connect.Request[v1.PingRequest]) (*connect.Response[v1.PingResponse], error)
	// Get the full schema.
	GetSchema(context.Context, *connect.Request[v1.GetSchemaRequest]) (*connect.Response[v1.GetSchemaResponse], error)
	// Pull schema changes.
	//
	// Note that if there are no deployments this will block indefinitely, making it unsuitable for
	// just retrieving the schema. Use GetSchema for that.
	PullSchema(context.Context, *connect.Request[v1.PullSchemaRequest]) (*connect.ServerStreamForClient[v1.PullSchemaResponse], error)
	// UpdateModuleRuntime is used to update the runtime configuration of a module.
	UpdateDeploymentRuntime(context.Context, *connect.Request[v1.UpdateDeploymentRuntimeRequest]) (*connect.Response[v1.UpdateDeploymentRuntimeResponse], error)
	// GetDeployments is used to get the schema for all deployments.
	GetDeployments(context.Context, *connect.Request[v1.GetDeploymentsRequest]) (*connect.Response[v1.GetDeploymentsResponse], error)
	// CreateChangeset creates a new changeset.
	CreateChangeset(context.Context, *connect.Request[v1.CreateChangesetRequest]) (*connect.Response[v1.CreateChangesetResponse], error)
	// PrepareChangeset moves the changeset into the prepared state.
	PrepareChangeset(context.Context, *connect.Request[v1.PrepareChangesetRequest]) (*connect.Response[v1.PrepareChangesetResponse], error)
	// CommitChangeset makes all deployments for the changeset part of the canonical schema.
	CommitChangeset(context.Context, *connect.Request[v1.CommitChangesetRequest]) (*connect.Response[v1.CommitChangesetResponse], error)
	DrainChangeset(context.Context, *connect.Request[v1.DrainChangesetRequest]) (*connect.Response[v1.DrainChangesetResponse], error)
	FinalizeChangeset(context.Context, *connect.Request[v1.FinalizeChangesetRequest]) (*connect.Response[v1.FinalizeChangesetResponse], error)
	// RollbackChangeset Rolls back a failing changeset
	RollbackChangeset(context.Context, *connect.Request[v1.RollbackChangesetRequest]) (*connect.Response[v1.RollbackChangesetResponse], error)
	// FailChangeset fails an active changeset.
	FailChangeset(context.Context, *connect.Request[v1.FailChangesetRequest]) (*connect.Response[v1.FailChangesetResponse], error)
	// GetDeployment gets a deployment by deployment key
	GetDeployment(context.Context, *connect.Request[v1.GetDeploymentRequest]) (*connect.Response[v1.GetDeploymentResponse], error)
}

// NewSchemaServiceClient constructs a client for the xyz.block.ftl.v1.SchemaService 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 NewSchemaServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) SchemaServiceClient {
	baseURL = strings.TrimRight(baseURL, "/")
	schemaServiceMethods := v1.File_xyz_block_ftl_v1_schemaservice_proto.Services().ByName("SchemaService").Methods()
	return &schemaServiceClient{
		ping: connect.NewClient[v1.PingRequest, v1.PingResponse](
			httpClient,
			baseURL+SchemaServicePingProcedure,
			connect.WithSchema(schemaServiceMethods.ByName("Ping")),
			connect.WithIdempotency(connect.IdempotencyNoSideEffects),
			connect.WithClientOptions(opts...),
		),
		getSchema: connect.NewClient[v1.GetSchemaRequest, v1.GetSchemaResponse](
			httpClient,
			baseURL+SchemaServiceGetSchemaProcedure,
			connect.WithSchema(schemaServiceMethods.ByName("GetSchema")),
			connect.WithIdempotency(connect.IdempotencyNoSideEffects),
			connect.WithClientOptions(opts...),
		),
		pullSchema: connect.NewClient[v1.PullSchemaRequest, v1.PullSchemaResponse](
			httpClient,
			baseURL+SchemaServicePullSchemaProcedure,
			connect.WithSchema(schemaServiceMethods.ByName("PullSchema")),
			connect.WithIdempotency(connect.IdempotencyNoSideEffects),
			connect.WithClientOptions(opts...),
		),
		updateDeploymentRuntime: connect.NewClient[v1.UpdateDeploymentRuntimeRequest, v1.UpdateDeploymentRuntimeResponse](
			httpClient,
			baseURL+SchemaServiceUpdateDeploymentRuntimeProcedure,
			connect.WithSchema(schemaServiceMethods.ByName("UpdateDeploymentRuntime")),
			connect.WithClientOptions(opts...),
		),
		getDeployments: connect.NewClient[v1.GetDeploymentsRequest, v1.GetDeploymentsResponse](
			httpClient,
			baseURL+SchemaServiceGetDeploymentsProcedure,
			connect.WithSchema(schemaServiceMethods.ByName("GetDeployments")),
			connect.WithClientOptions(opts...),
		),
		createChangeset: connect.NewClient[v1.CreateChangesetRequest, v1.CreateChangesetResponse](
			httpClient,
			baseURL+SchemaServiceCreateChangesetProcedure,
			connect.WithSchema(schemaServiceMethods.ByName("CreateChangeset")),
			connect.WithClientOptions(opts...),
		),
		prepareChangeset: connect.NewClient[v1.PrepareChangesetRequest, v1.PrepareChangesetResponse](
			httpClient,
			baseURL+SchemaServicePrepareChangesetProcedure,
			connect.WithSchema(schemaServiceMethods.ByName("PrepareChangeset")),
			connect.WithClientOptions(opts...),
		),
		commitChangeset: connect.NewClient[v1.CommitChangesetRequest, v1.CommitChangesetResponse](
			httpClient,
			baseURL+SchemaServiceCommitChangesetProcedure,
			connect.WithSchema(schemaServiceMethods.ByName("CommitChangeset")),
			connect.WithClientOptions(opts...),
		),
		drainChangeset: connect.NewClient[v1.DrainChangesetRequest, v1.DrainChangesetResponse](
			httpClient,
			baseURL+SchemaServiceDrainChangesetProcedure,
			connect.WithSchema(schemaServiceMethods.ByName("DrainChangeset")),
			connect.WithClientOptions(opts...),
		),
		finalizeChangeset: connect.NewClient[v1.FinalizeChangesetRequest, v1.FinalizeChangesetResponse](
			httpClient,
			baseURL+SchemaServiceFinalizeChangesetProcedure,
			connect.WithSchema(schemaServiceMethods.ByName("FinalizeChangeset")),
			connect.WithClientOptions(opts...),
		),
		rollbackChangeset: connect.NewClient[v1.RollbackChangesetRequest, v1.RollbackChangesetResponse](
			httpClient,
			baseURL+SchemaServiceRollbackChangesetProcedure,
			connect.WithSchema(schemaServiceMethods.ByName("RollbackChangeset")),
			connect.WithClientOptions(opts...),
		),
		failChangeset: connect.NewClient[v1.FailChangesetRequest, v1.FailChangesetResponse](
			httpClient,
			baseURL+SchemaServiceFailChangesetProcedure,
			connect.WithSchema(schemaServiceMethods.ByName("FailChangeset")),
			connect.WithClientOptions(opts...),
		),
		getDeployment: connect.NewClient[v1.GetDeploymentRequest, v1.GetDeploymentResponse](
			httpClient,
			baseURL+SchemaServiceGetDeploymentProcedure,
			connect.WithSchema(schemaServiceMethods.ByName("GetDeployment")),
			connect.WithClientOptions(opts...),
		),
	}
}

// schemaServiceClient implements SchemaServiceClient.
type schemaServiceClient struct {
	ping                    *connect.Client[v1.PingRequest, v1.PingResponse]
	getSchema               *connect.Client[v1.GetSchemaRequest, v1.GetSchemaResponse]
	pullSchema              *connect.Client[v1.PullSchemaRequest, v1.PullSchemaResponse]
	updateDeploymentRuntime *connect.Client[v1.UpdateDeploymentRuntimeRequest, v1.UpdateDeploymentRuntimeResponse]
	getDeployments          *connect.Client[v1.GetDeploymentsRequest, v1.GetDeploymentsResponse]
	createChangeset         *connect.Client[v1.CreateChangesetRequest, v1.CreateChangesetResponse]
	prepareChangeset        *connect.Client[v1.PrepareChangesetRequest, v1.PrepareChangesetResponse]
	commitChangeset         *connect.Client[v1.CommitChangesetRequest, v1.CommitChangesetResponse]
	drainChangeset          *connect.Client[v1.DrainChangesetRequest, v1.DrainChangesetResponse]
	finalizeChangeset       *connect.Client[v1.FinalizeChangesetRequest, v1.FinalizeChangesetResponse]
	rollbackChangeset       *connect.Client[v1.RollbackChangesetRequest, v1.RollbackChangesetResponse]
	failChangeset           *connect.Client[v1.FailChangesetRequest, v1.FailChangesetResponse]
	getDeployment           *connect.Client[v1.GetDeploymentRequest, v1.GetDeploymentResponse]
}

// Ping calls xyz.block.ftl.v1.SchemaService.Ping.
func (c *schemaServiceClient) Ping(ctx context.Context, req *connect.Request[v1.PingRequest]) (*connect.Response[v1.PingResponse], error) {
	return c.ping.CallUnary(ctx, req)
}

// GetSchema calls xyz.block.ftl.v1.SchemaService.GetSchema.
func (c *schemaServiceClient) GetSchema(ctx context.Context, req *connect.Request[v1.GetSchemaRequest]) (*connect.Response[v1.GetSchemaResponse], error) {
	return c.getSchema.CallUnary(ctx, req)
}

// PullSchema calls xyz.block.ftl.v1.SchemaService.PullSchema.
func (c *schemaServiceClient) PullSchema(ctx context.Context, req *connect.Request[v1.PullSchemaRequest]) (*connect.ServerStreamForClient[v1.PullSchemaResponse], error) {
	return c.pullSchema.CallServerStream(ctx, req)
}

// UpdateDeploymentRuntime calls xyz.block.ftl.v1.SchemaService.UpdateDeploymentRuntime.
func (c *schemaServiceClient) UpdateDeploymentRuntime(ctx context.Context, req *connect.Request[v1.UpdateDeploymentRuntimeRequest]) (*connect.Response[v1.UpdateDeploymentRuntimeResponse], error) {
	return c.updateDeploymentRuntime.CallUnary(ctx, req)
}

// GetDeployments calls xyz.block.ftl.v1.SchemaService.GetDeployments.
func (c *schemaServiceClient) GetDeployments(ctx context.Context, req *connect.Request[v1.GetDeploymentsRequest]) (*connect.Response[v1.GetDeploymentsResponse], error) {
	return c.getDeployments.CallUnary(ctx, req)
}

// CreateChangeset calls xyz.block.ftl.v1.SchemaService.CreateChangeset.
func (c *schemaServiceClient) CreateChangeset(ctx context.Context, req *connect.Request[v1.CreateChangesetRequest]) (*connect.Response[v1.CreateChangesetResponse], error) {
	return c.createChangeset.CallUnary(ctx, req)
}

// PrepareChangeset calls xyz.block.ftl.v1.SchemaService.PrepareChangeset.
func (c *schemaServiceClient) PrepareChangeset(ctx context.Context, req *connect.Request[v1.PrepareChangesetRequest]) (*connect.Response[v1.PrepareChangesetResponse], error) {
	return c.prepareChangeset.CallUnary(ctx, req)
}

// CommitChangeset calls xyz.block.ftl.v1.SchemaService.CommitChangeset.
func (c *schemaServiceClient) CommitChangeset(ctx context.Context, req *connect.Request[v1.CommitChangesetRequest]) (*connect.Response[v1.CommitChangesetResponse], error) {
	return c.commitChangeset.CallUnary(ctx, req)
}

// DrainChangeset calls xyz.block.ftl.v1.SchemaService.DrainChangeset.
func (c *schemaServiceClient) DrainChangeset(ctx context.Context, req *connect.Request[v1.DrainChangesetRequest]) (*connect.Response[v1.DrainChangesetResponse], error) {
	return c.drainChangeset.CallUnary(ctx, req)
}

// FinalizeChangeset calls xyz.block.ftl.v1.SchemaService.FinalizeChangeset.
func (c *schemaServiceClient) FinalizeChangeset(ctx context.Context, req *connect.Request[v1.FinalizeChangesetRequest]) (*connect.Response[v1.FinalizeChangesetResponse], error) {
	return c.finalizeChangeset.CallUnary(ctx, req)
}

// RollbackChangeset calls xyz.block.ftl.v1.SchemaService.RollbackChangeset.
func (c *schemaServiceClient) RollbackChangeset(ctx context.Context, req *connect.Request[v1.RollbackChangesetRequest]) (*connect.Response[v1.RollbackChangesetResponse], error) {
	return c.rollbackChangeset.CallUnary(ctx, req)
}

// FailChangeset calls xyz.block.ftl.v1.SchemaService.FailChangeset.
func (c *schemaServiceClient) FailChangeset(ctx context.Context, req *connect.Request[v1.FailChangesetRequest]) (*connect.Response[v1.FailChangesetResponse], error) {
	return c.failChangeset.CallUnary(ctx, req)
}

// GetDeployment calls xyz.block.ftl.v1.SchemaService.GetDeployment.
func (c *schemaServiceClient) GetDeployment(ctx context.Context, req *connect.Request[v1.GetDeploymentRequest]) (*connect.Response[v1.GetDeploymentResponse], error) {
	return c.getDeployment.CallUnary(ctx, req)
}

// SchemaServiceHandler is an implementation of the xyz.block.ftl.v1.SchemaService service.
type SchemaServiceHandler interface {
	// Ping service for readiness.
	Ping(context.Context, *connect.Request[v1.PingRequest]) (*connect.Response[v1.PingResponse], error)
	// Get the full schema.
	GetSchema(context.Context, *connect.Request[v1.GetSchemaRequest]) (*connect.Response[v1.GetSchemaResponse], error)
	// Pull schema changes.
	//
	// Note that if there are no deployments this will block indefinitely, making it unsuitable for
	// just retrieving the schema. Use GetSchema for that.
	PullSchema(context.Context, *connect.Request[v1.PullSchemaRequest], *connect.ServerStream[v1.PullSchemaResponse]) error
	// UpdateModuleRuntime is used to update the runtime configuration of a module.
	UpdateDeploymentRuntime(context.Context, *connect.Request[v1.UpdateDeploymentRuntimeRequest]) (*connect.Response[v1.UpdateDeploymentRuntimeResponse], error)
	// GetDeployments is used to get the schema for all deployments.
	GetDeployments(context.Context, *connect.Request[v1.GetDeploymentsRequest]) (*connect.Response[v1.GetDeploymentsResponse], error)
	// CreateChangeset creates a new changeset.
	CreateChangeset(context.Context, *connect.Request[v1.CreateChangesetRequest]) (*connect.Response[v1.CreateChangesetResponse], error)
	// PrepareChangeset moves the changeset into the prepared state.
	PrepareChangeset(context.Context, *connect.Request[v1.PrepareChangesetRequest]) (*connect.Response[v1.PrepareChangesetResponse], error)
	// CommitChangeset makes all deployments for the changeset part of the canonical schema.
	CommitChangeset(context.Context, *connect.Request[v1.CommitChangesetRequest]) (*connect.Response[v1.CommitChangesetResponse], error)
	DrainChangeset(context.Context, *connect.Request[v1.DrainChangesetRequest]) (*connect.Response[v1.DrainChangesetResponse], error)
	FinalizeChangeset(context.Context, *connect.Request[v1.FinalizeChangesetRequest]) (*connect.Response[v1.FinalizeChangesetResponse], error)
	// RollbackChangeset Rolls back a failing changeset
	RollbackChangeset(context.Context, *connect.Request[v1.RollbackChangesetRequest]) (*connect.Response[v1.RollbackChangesetResponse], error)
	// FailChangeset fails an active changeset.
	FailChangeset(context.Context, *connect.Request[v1.FailChangesetRequest]) (*connect.Response[v1.FailChangesetResponse], error)
	// GetDeployment gets a deployment by deployment key
	GetDeployment(context.Context, *connect.Request[v1.GetDeploymentRequest]) (*connect.Response[v1.GetDeploymentResponse], error)
}

// NewSchemaServiceHandler 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 NewSchemaServiceHandler(svc SchemaServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {
	schemaServiceMethods := v1.File_xyz_block_ftl_v1_schemaservice_proto.Services().ByName("SchemaService").Methods()
	schemaServicePingHandler := connect.NewUnaryHandler(
		SchemaServicePingProcedure,
		svc.Ping,
		connect.WithSchema(schemaServiceMethods.ByName("Ping")),
		connect.WithIdempotency(connect.IdempotencyNoSideEffects),
		connect.WithHandlerOptions(opts...),
	)
	schemaServiceGetSchemaHandler := connect.NewUnaryHandler(
		SchemaServiceGetSchemaProcedure,
		svc.GetSchema,
		connect.WithSchema(schemaServiceMethods.ByName("GetSchema")),
		connect.WithIdempotency(connect.IdempotencyNoSideEffects),
		connect.WithHandlerOptions(opts...),
	)
	schemaServicePullSchemaHandler := connect.NewServerStreamHandler(
		SchemaServicePullSchemaProcedure,
		svc.PullSchema,
		connect.WithSchema(schemaServiceMethods.ByName("PullSchema")),
		connect.WithIdempotency(connect.IdempotencyNoSideEffects),
		connect.WithHandlerOptions(opts...),
	)
	schemaServiceUpdateDeploymentRuntimeHandler := connect.NewUnaryHandler(
		SchemaServiceUpdateDeploymentRuntimeProcedure,
		svc.UpdateDeploymentRuntime,
		connect.WithSchema(schemaServiceMethods.ByName("UpdateDeploymentRuntime")),
		connect.WithHandlerOptions(opts...),
	)
	schemaServiceGetDeploymentsHandler := connect.NewUnaryHandler(
		SchemaServiceGetDeploymentsProcedure,
		svc.GetDeployments,
		connect.WithSchema(schemaServiceMethods.ByName("GetDeployments")),
		connect.WithHandlerOptions(opts...),
	)
	schemaServiceCreateChangesetHandler := connect.NewUnaryHandler(
		SchemaServiceCreateChangesetProcedure,
		svc.CreateChangeset,
		connect.WithSchema(schemaServiceMethods.ByName("CreateChangeset")),
		connect.WithHandlerOptions(opts...),
	)
	schemaServicePrepareChangesetHandler := connect.NewUnaryHandler(
		SchemaServicePrepareChangesetProcedure,
		svc.PrepareChangeset,
		connect.WithSchema(schemaServiceMethods.ByName("PrepareChangeset")),
		connect.WithHandlerOptions(opts...),
	)
	schemaServiceCommitChangesetHandler := connect.NewUnaryHandler(
		SchemaServiceCommitChangesetProcedure,
		svc.CommitChangeset,
		connect.WithSchema(schemaServiceMethods.ByName("CommitChangeset")),
		connect.WithHandlerOptions(opts...),
	)
	schemaServiceDrainChangesetHandler := connect.NewUnaryHandler(
		SchemaServiceDrainChangesetProcedure,
		svc.DrainChangeset,
		connect.WithSchema(schemaServiceMethods.ByName("DrainChangeset")),
		connect.WithHandlerOptions(opts...),
	)
	schemaServiceFinalizeChangesetHandler := connect.NewUnaryHandler(
		SchemaServiceFinalizeChangesetProcedure,
		svc.FinalizeChangeset,
		connect.WithSchema(schemaServiceMethods.ByName("FinalizeChangeset")),
		connect.WithHandlerOptions(opts...),
	)
	schemaServiceRollbackChangesetHandler := connect.NewUnaryHandler(
		SchemaServiceRollbackChangesetProcedure,
		svc.RollbackChangeset,
		connect.WithSchema(schemaServiceMethods.ByName("RollbackChangeset")),
		connect.WithHandlerOptions(opts...),
	)
	schemaServiceFailChangesetHandler := connect.NewUnaryHandler(
		SchemaServiceFailChangesetProcedure,
		svc.FailChangeset,
		connect.WithSchema(schemaServiceMethods.ByName("FailChangeset")),
		connect.WithHandlerOptions(opts...),
	)
	schemaServiceGetDeploymentHandler := connect.NewUnaryHandler(
		SchemaServiceGetDeploymentProcedure,
		svc.GetDeployment,
		connect.WithSchema(schemaServiceMethods.ByName("GetDeployment")),
		connect.WithHandlerOptions(opts...),
	)
	return "/xyz.block.ftl.v1.SchemaService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		switch r.URL.Path {
		case SchemaServicePingProcedure:
			schemaServicePingHandler.ServeHTTP(w, r)
		case SchemaServiceGetSchemaProcedure:
			schemaServiceGetSchemaHandler.ServeHTTP(w, r)
		case SchemaServicePullSchemaProcedure:
			schemaServicePullSchemaHandler.ServeHTTP(w, r)
		case SchemaServiceUpdateDeploymentRuntimeProcedure:
			schemaServiceUpdateDeploymentRuntimeHandler.ServeHTTP(w, r)
		case SchemaServiceGetDeploymentsProcedure:
			schemaServiceGetDeploymentsHandler.ServeHTTP(w, r)
		case SchemaServiceCreateChangesetProcedure:
			schemaServiceCreateChangesetHandler.ServeHTTP(w, r)
		case SchemaServicePrepareChangesetProcedure:
			schemaServicePrepareChangesetHandler.ServeHTTP(w, r)
		case SchemaServiceCommitChangesetProcedure:
			schemaServiceCommitChangesetHandler.ServeHTTP(w, r)
		case SchemaServiceDrainChangesetProcedure:
			schemaServiceDrainChangesetHandler.ServeHTTP(w, r)
		case SchemaServiceFinalizeChangesetProcedure:
			schemaServiceFinalizeChangesetHandler.ServeHTTP(w, r)
		case SchemaServiceRollbackChangesetProcedure:
			schemaServiceRollbackChangesetHandler.ServeHTTP(w, r)
		case SchemaServiceFailChangesetProcedure:
			schemaServiceFailChangesetHandler.ServeHTTP(w, r)
		case SchemaServiceGetDeploymentProcedure:
			schemaServiceGetDeploymentHandler.ServeHTTP(w, r)
		default:
			http.NotFound(w, r)
		}
	})
}

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

func (UnimplementedSchemaServiceHandler) Ping(context.Context, *connect.Request[v1.PingRequest]) (*connect.Response[v1.PingResponse], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("xyz.block.ftl.v1.SchemaService.Ping is not implemented"))
}

func (UnimplementedSchemaServiceHandler) GetSchema(context.Context, *connect.Request[v1.GetSchemaRequest]) (*connect.Response[v1.GetSchemaResponse], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("xyz.block.ftl.v1.SchemaService.GetSchema is not implemented"))
}

func (UnimplementedSchemaServiceHandler) PullSchema(context.Context, *connect.Request[v1.PullSchemaRequest], *connect.ServerStream[v1.PullSchemaResponse]) error {
	return connect.NewError(connect.CodeUnimplemented, errors.New("xyz.block.ftl.v1.SchemaService.PullSchema is not implemented"))
}

func (UnimplementedSchemaServiceHandler) UpdateDeploymentRuntime(context.Context, *connect.Request[v1.UpdateDeploymentRuntimeRequest]) (*connect.Response[v1.UpdateDeploymentRuntimeResponse], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("xyz.block.ftl.v1.SchemaService.UpdateDeploymentRuntime is not implemented"))
}

func (UnimplementedSchemaServiceHandler) GetDeployments(context.Context, *connect.Request[v1.GetDeploymentsRequest]) (*connect.Response[v1.GetDeploymentsResponse], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("xyz.block.ftl.v1.SchemaService.GetDeployments is not implemented"))
}

func (UnimplementedSchemaServiceHandler) CreateChangeset(context.Context, *connect.Request[v1.CreateChangesetRequest]) (*connect.Response[v1.CreateChangesetResponse], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("xyz.block.ftl.v1.SchemaService.CreateChangeset is not implemented"))
}

func (UnimplementedSchemaServiceHandler) PrepareChangeset(context.Context, *connect.Request[v1.PrepareChangesetRequest]) (*connect.Response[v1.PrepareChangesetResponse], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("xyz.block.ftl.v1.SchemaService.PrepareChangeset is not implemented"))
}

func (UnimplementedSchemaServiceHandler) CommitChangeset(context.Context, *connect.Request[v1.CommitChangesetRequest]) (*connect.Response[v1.CommitChangesetResponse], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("xyz.block.ftl.v1.SchemaService.CommitChangeset is not implemented"))
}

func (UnimplementedSchemaServiceHandler) DrainChangeset(context.Context, *connect.Request[v1.DrainChangesetRequest]) (*connect.Response[v1.DrainChangesetResponse], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("xyz.block.ftl.v1.SchemaService.DrainChangeset is not implemented"))
}

func (UnimplementedSchemaServiceHandler) FinalizeChangeset(context.Context, *connect.Request[v1.FinalizeChangesetRequest]) (*connect.Response[v1.FinalizeChangesetResponse], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("xyz.block.ftl.v1.SchemaService.FinalizeChangeset is not implemented"))
}

func (UnimplementedSchemaServiceHandler) RollbackChangeset(context.Context, *connect.Request[v1.RollbackChangesetRequest]) (*connect.Response[v1.RollbackChangesetResponse], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("xyz.block.ftl.v1.SchemaService.RollbackChangeset is not implemented"))
}

func (UnimplementedSchemaServiceHandler) FailChangeset(context.Context, *connect.Request[v1.FailChangesetRequest]) (*connect.Response[v1.FailChangesetResponse], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("xyz.block.ftl.v1.SchemaService.FailChangeset is not implemented"))
}

func (UnimplementedSchemaServiceHandler) GetDeployment(context.Context, *connect.Request[v1.GetDeploymentRequest]) (*connect.Response[v1.GetDeploymentResponse], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("xyz.block.ftl.v1.SchemaService.GetDeployment is not implemented"))
}

// SchemaMirrorServiceClient is a client for the xyz.block.ftl.v1.SchemaMirrorService service.
type SchemaMirrorServiceClient interface {
	// Ping service for readiness.
	Ping(context.Context, *connect.Request[v1.PingRequest]) (*connect.Response[v1.PingResponse], error)
	// PushSchema is used to push schema changes to the mirror service.
	PushSchema(context.Context) *connect.ClientStreamForClient[v1.PushSchemaRequest, v1.PushSchemaResponse]
}

// NewSchemaMirrorServiceClient constructs a client for the xyz.block.ftl.v1.SchemaMirrorService
// 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 NewSchemaMirrorServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) SchemaMirrorServiceClient {
	baseURL = strings.TrimRight(baseURL, "/")
	schemaMirrorServiceMethods := v1.File_xyz_block_ftl_v1_schemaservice_proto.Services().ByName("SchemaMirrorService").Methods()
	return &schemaMirrorServiceClient{
		ping: connect.NewClient[v1.PingRequest, v1.PingResponse](
			httpClient,
			baseURL+SchemaMirrorServicePingProcedure,
			connect.WithSchema(schemaMirrorServiceMethods.ByName("Ping")),
			connect.WithIdempotency(connect.IdempotencyNoSideEffects),
			connect.WithClientOptions(opts...),
		),
		pushSchema: connect.NewClient[v1.PushSchemaRequest, v1.PushSchemaResponse](
			httpClient,
			baseURL+SchemaMirrorServicePushSchemaProcedure,
			connect.WithSchema(schemaMirrorServiceMethods.ByName("PushSchema")),
			connect.WithClientOptions(opts...),
		),
	}
}

// schemaMirrorServiceClient implements SchemaMirrorServiceClient.
type schemaMirrorServiceClient struct {
	ping       *connect.Client[v1.PingRequest, v1.PingResponse]
	pushSchema *connect.Client[v1.PushSchemaRequest, v1.PushSchemaResponse]
}

// Ping calls xyz.block.ftl.v1.SchemaMirrorService.Ping.
func (c *schemaMirrorServiceClient) Ping(ctx context.Context, req *connect.Request[v1.PingRequest]) (*connect.Response[v1.PingResponse], error) {
	return c.ping.CallUnary(ctx, req)
}

// PushSchema calls xyz.block.ftl.v1.SchemaMirrorService.PushSchema.
func (c *schemaMirrorServiceClient) PushSchema(ctx context.Context) *connect.ClientStreamForClient[v1.PushSchemaRequest, v1.PushSchemaResponse] {
	return c.pushSchema.CallClientStream(ctx)
}

// SchemaMirrorServiceHandler is an implementation of the xyz.block.ftl.v1.SchemaMirrorService
// service.
type SchemaMirrorServiceHandler interface {
	// Ping service for readiness.
	Ping(context.Context, *connect.Request[v1.PingRequest]) (*connect.Response[v1.PingResponse], error)
	// PushSchema is used to push schema changes to the mirror service.
	PushSchema(context.Context, *connect.ClientStream[v1.PushSchemaRequest]) (*connect.Response[v1.PushSchemaResponse], error)
}

// NewSchemaMirrorServiceHandler 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 NewSchemaMirrorServiceHandler(svc SchemaMirrorServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {
	schemaMirrorServiceMethods := v1.File_xyz_block_ftl_v1_schemaservice_proto.Services().ByName("SchemaMirrorService").Methods()
	schemaMirrorServicePingHandler := connect.NewUnaryHandler(
		SchemaMirrorServicePingProcedure,
		svc.Ping,
		connect.WithSchema(schemaMirrorServiceMethods.ByName("Ping")),
		connect.WithIdempotency(connect.IdempotencyNoSideEffects),
		connect.WithHandlerOptions(opts...),
	)
	schemaMirrorServicePushSchemaHandler := connect.NewClientStreamHandler(
		SchemaMirrorServicePushSchemaProcedure,
		svc.PushSchema,
		connect.WithSchema(schemaMirrorServiceMethods.ByName("PushSchema")),
		connect.WithHandlerOptions(opts...),
	)
	return "/xyz.block.ftl.v1.SchemaMirrorService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		switch r.URL.Path {
		case SchemaMirrorServicePingProcedure:
			schemaMirrorServicePingHandler.ServeHTTP(w, r)
		case SchemaMirrorServicePushSchemaProcedure:
			schemaMirrorServicePushSchemaHandler.ServeHTTP(w, r)
		default:
			http.NotFound(w, r)
		}
	})
}

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

func (UnimplementedSchemaMirrorServiceHandler) Ping(context.Context, *connect.Request[v1.PingRequest]) (*connect.Response[v1.PingResponse], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("xyz.block.ftl.v1.SchemaMirrorService.Ping is not implemented"))
}

func (UnimplementedSchemaMirrorServiceHandler) PushSchema(context.Context, *connect.ClientStream[v1.PushSchemaRequest]) (*connect.Response[v1.PushSchemaResponse], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("xyz.block.ftl.v1.SchemaMirrorService.PushSchema is not implemented"))
}
