// Code generated by protoc-gen-connect-go. DO NOT EDIT.
//
// Source: mock/v1/ssh.proto

package mockv1connect

import (
	connect "connectrpc.com/connect"
	context "context"
	errors "errors"
	v1 "github.com/taubyte/tau/pkg/spore-drive/proto/gen/mock/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 (
	// MockSSHServiceName is the fully-qualified name of the MockSSHService service.
	MockSSHServiceName = "mock.v1.MockSSHService"
)

// 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 (
	// MockSSHServiceNewProcedure is the fully-qualified name of the MockSSHService's New RPC.
	MockSSHServiceNewProcedure = "/mock.v1.MockSSHService/New"
	// MockSSHServiceLookupProcedure is the fully-qualified name of the MockSSHService's Lookup RPC.
	MockSSHServiceLookupProcedure = "/mock.v1.MockSSHService/Lookup"
	// MockSSHServiceCommandsProcedure is the fully-qualified name of the MockSSHService's Commands RPC.
	MockSSHServiceCommandsProcedure = "/mock.v1.MockSSHService/Commands"
	// MockSSHServiceFilesystemProcedure is the fully-qualified name of the MockSSHService's Filesystem
	// RPC.
	MockSSHServiceFilesystemProcedure = "/mock.v1.MockSSHService/Filesystem"
	// MockSSHServiceFreeProcedure is the fully-qualified name of the MockSSHService's Free RPC.
	MockSSHServiceFreeProcedure = "/mock.v1.MockSSHService/Free"
)

// These variables are the protoreflect.Descriptor objects for the RPCs defined in this package.
var (
	mockSSHServiceServiceDescriptor          = v1.File_mock_v1_ssh_proto.Services().ByName("MockSSHService")
	mockSSHServiceNewMethodDescriptor        = mockSSHServiceServiceDescriptor.Methods().ByName("New")
	mockSSHServiceLookupMethodDescriptor     = mockSSHServiceServiceDescriptor.Methods().ByName("Lookup")
	mockSSHServiceCommandsMethodDescriptor   = mockSSHServiceServiceDescriptor.Methods().ByName("Commands")
	mockSSHServiceFilesystemMethodDescriptor = mockSSHServiceServiceDescriptor.Methods().ByName("Filesystem")
	mockSSHServiceFreeMethodDescriptor       = mockSSHServiceServiceDescriptor.Methods().ByName("Free")
)

// MockSSHServiceClient is a client for the mock.v1.MockSSHService service.
type MockSSHServiceClient interface {
	New(context.Context, *connect.Request[v1.HostConfig]) (*connect.Response[v1.HostConfig], error)
	Lookup(context.Context, *connect.Request[v1.Query]) (*connect.Response[v1.HostConfig], error)
	Commands(context.Context, *connect.Request[v1.Host]) (*connect.ServerStreamForClient[v1.Command], error)
	Filesystem(context.Context, *connect.Request[v1.Host]) (*connect.ServerStreamForClient[v1.BundleChunk], error)
	Free(context.Context, *connect.Request[v1.Host]) (*connect.Response[v1.Empty], error)
}

// NewMockSSHServiceClient constructs a client for the mock.v1.MockSSHService 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 NewMockSSHServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) MockSSHServiceClient {
	baseURL = strings.TrimRight(baseURL, "/")
	return &mockSSHServiceClient{
		new: connect.NewClient[v1.HostConfig, v1.HostConfig](
			httpClient,
			baseURL+MockSSHServiceNewProcedure,
			connect.WithSchema(mockSSHServiceNewMethodDescriptor),
			connect.WithClientOptions(opts...),
		),
		lookup: connect.NewClient[v1.Query, v1.HostConfig](
			httpClient,
			baseURL+MockSSHServiceLookupProcedure,
			connect.WithSchema(mockSSHServiceLookupMethodDescriptor),
			connect.WithClientOptions(opts...),
		),
		commands: connect.NewClient[v1.Host, v1.Command](
			httpClient,
			baseURL+MockSSHServiceCommandsProcedure,
			connect.WithSchema(mockSSHServiceCommandsMethodDescriptor),
			connect.WithClientOptions(opts...),
		),
		filesystem: connect.NewClient[v1.Host, v1.BundleChunk](
			httpClient,
			baseURL+MockSSHServiceFilesystemProcedure,
			connect.WithSchema(mockSSHServiceFilesystemMethodDescriptor),
			connect.WithClientOptions(opts...),
		),
		free: connect.NewClient[v1.Host, v1.Empty](
			httpClient,
			baseURL+MockSSHServiceFreeProcedure,
			connect.WithSchema(mockSSHServiceFreeMethodDescriptor),
			connect.WithClientOptions(opts...),
		),
	}
}

// mockSSHServiceClient implements MockSSHServiceClient.
type mockSSHServiceClient struct {
	new        *connect.Client[v1.HostConfig, v1.HostConfig]
	lookup     *connect.Client[v1.Query, v1.HostConfig]
	commands   *connect.Client[v1.Host, v1.Command]
	filesystem *connect.Client[v1.Host, v1.BundleChunk]
	free       *connect.Client[v1.Host, v1.Empty]
}

// New calls mock.v1.MockSSHService.New.
func (c *mockSSHServiceClient) New(ctx context.Context, req *connect.Request[v1.HostConfig]) (*connect.Response[v1.HostConfig], error) {
	return c.new.CallUnary(ctx, req)
}

// Lookup calls mock.v1.MockSSHService.Lookup.
func (c *mockSSHServiceClient) Lookup(ctx context.Context, req *connect.Request[v1.Query]) (*connect.Response[v1.HostConfig], error) {
	return c.lookup.CallUnary(ctx, req)
}

// Commands calls mock.v1.MockSSHService.Commands.
func (c *mockSSHServiceClient) Commands(ctx context.Context, req *connect.Request[v1.Host]) (*connect.ServerStreamForClient[v1.Command], error) {
	return c.commands.CallServerStream(ctx, req)
}

// Filesystem calls mock.v1.MockSSHService.Filesystem.
func (c *mockSSHServiceClient) Filesystem(ctx context.Context, req *connect.Request[v1.Host]) (*connect.ServerStreamForClient[v1.BundleChunk], error) {
	return c.filesystem.CallServerStream(ctx, req)
}

// Free calls mock.v1.MockSSHService.Free.
func (c *mockSSHServiceClient) Free(ctx context.Context, req *connect.Request[v1.Host]) (*connect.Response[v1.Empty], error) {
	return c.free.CallUnary(ctx, req)
}

// MockSSHServiceHandler is an implementation of the mock.v1.MockSSHService service.
type MockSSHServiceHandler interface {
	New(context.Context, *connect.Request[v1.HostConfig]) (*connect.Response[v1.HostConfig], error)
	Lookup(context.Context, *connect.Request[v1.Query]) (*connect.Response[v1.HostConfig], error)
	Commands(context.Context, *connect.Request[v1.Host], *connect.ServerStream[v1.Command]) error
	Filesystem(context.Context, *connect.Request[v1.Host], *connect.ServerStream[v1.BundleChunk]) error
	Free(context.Context, *connect.Request[v1.Host]) (*connect.Response[v1.Empty], error)
}

// NewMockSSHServiceHandler 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 NewMockSSHServiceHandler(svc MockSSHServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {
	mockSSHServiceNewHandler := connect.NewUnaryHandler(
		MockSSHServiceNewProcedure,
		svc.New,
		connect.WithSchema(mockSSHServiceNewMethodDescriptor),
		connect.WithHandlerOptions(opts...),
	)
	mockSSHServiceLookupHandler := connect.NewUnaryHandler(
		MockSSHServiceLookupProcedure,
		svc.Lookup,
		connect.WithSchema(mockSSHServiceLookupMethodDescriptor),
		connect.WithHandlerOptions(opts...),
	)
	mockSSHServiceCommandsHandler := connect.NewServerStreamHandler(
		MockSSHServiceCommandsProcedure,
		svc.Commands,
		connect.WithSchema(mockSSHServiceCommandsMethodDescriptor),
		connect.WithHandlerOptions(opts...),
	)
	mockSSHServiceFilesystemHandler := connect.NewServerStreamHandler(
		MockSSHServiceFilesystemProcedure,
		svc.Filesystem,
		connect.WithSchema(mockSSHServiceFilesystemMethodDescriptor),
		connect.WithHandlerOptions(opts...),
	)
	mockSSHServiceFreeHandler := connect.NewUnaryHandler(
		MockSSHServiceFreeProcedure,
		svc.Free,
		connect.WithSchema(mockSSHServiceFreeMethodDescriptor),
		connect.WithHandlerOptions(opts...),
	)
	return "/mock.v1.MockSSHService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		switch r.URL.Path {
		case MockSSHServiceNewProcedure:
			mockSSHServiceNewHandler.ServeHTTP(w, r)
		case MockSSHServiceLookupProcedure:
			mockSSHServiceLookupHandler.ServeHTTP(w, r)
		case MockSSHServiceCommandsProcedure:
			mockSSHServiceCommandsHandler.ServeHTTP(w, r)
		case MockSSHServiceFilesystemProcedure:
			mockSSHServiceFilesystemHandler.ServeHTTP(w, r)
		case MockSSHServiceFreeProcedure:
			mockSSHServiceFreeHandler.ServeHTTP(w, r)
		default:
			http.NotFound(w, r)
		}
	})
}

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

func (UnimplementedMockSSHServiceHandler) New(context.Context, *connect.Request[v1.HostConfig]) (*connect.Response[v1.HostConfig], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("mock.v1.MockSSHService.New is not implemented"))
}

func (UnimplementedMockSSHServiceHandler) Lookup(context.Context, *connect.Request[v1.Query]) (*connect.Response[v1.HostConfig], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("mock.v1.MockSSHService.Lookup is not implemented"))
}

func (UnimplementedMockSSHServiceHandler) Commands(context.Context, *connect.Request[v1.Host], *connect.ServerStream[v1.Command]) error {
	return connect.NewError(connect.CodeUnimplemented, errors.New("mock.v1.MockSSHService.Commands is not implemented"))
}

func (UnimplementedMockSSHServiceHandler) Filesystem(context.Context, *connect.Request[v1.Host], *connect.ServerStream[v1.BundleChunk]) error {
	return connect.NewError(connect.CodeUnimplemented, errors.New("mock.v1.MockSSHService.Filesystem is not implemented"))
}

func (UnimplementedMockSSHServiceHandler) Free(context.Context, *connect.Request[v1.Host]) (*connect.Response[v1.Empty], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("mock.v1.MockSSHService.Free is not implemented"))
}
