// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc             (unknown)
// source: shard/v1/shard.proto

package shardv1

import (
	context "context"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
)

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7

// ShardHandlerClient is the client API for ShardHandler service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type ShardHandlerClient interface {
	// SubmitCardinalBatch handles receiving transactions from a game shard and persisting them to the chain.
	SubmitShardTx(ctx context.Context, in *SubmitShardTxRequest, opts ...grpc.CallOption) (*SubmitShardTxResponse, error)
}

type shardHandlerClient struct {
	cc grpc.ClientConnInterface
}

func NewShardHandlerClient(cc grpc.ClientConnInterface) ShardHandlerClient {
	return &shardHandlerClient{cc}
}

func (c *shardHandlerClient) SubmitShardTx(ctx context.Context, in *SubmitShardTxRequest, opts ...grpc.CallOption) (*SubmitShardTxResponse, error) {
	out := new(SubmitShardTxResponse)
	err := c.cc.Invoke(ctx, "/world.engine.shard.v1.ShardHandler/SubmitShardTx", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// ShardHandlerServer is the server API for ShardHandler service.
// All implementations must embed UnimplementedShardHandlerServer
// for forward compatibility
type ShardHandlerServer interface {
	// SubmitCardinalBatch handles receiving transactions from a game shard and persisting them to the chain.
	SubmitShardTx(context.Context, *SubmitShardTxRequest) (*SubmitShardTxResponse, error)
	mustEmbedUnimplementedShardHandlerServer()
}

// UnimplementedShardHandlerServer must be embedded to have forward compatible implementations.
type UnimplementedShardHandlerServer struct {
}

func (UnimplementedShardHandlerServer) SubmitShardTx(context.Context, *SubmitShardTxRequest) (*SubmitShardTxResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method SubmitShardTx not implemented")
}
func (UnimplementedShardHandlerServer) mustEmbedUnimplementedShardHandlerServer() {}

// UnsafeShardHandlerServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ShardHandlerServer will
// result in compilation errors.
type UnsafeShardHandlerServer interface {
	mustEmbedUnimplementedShardHandlerServer()
}

func RegisterShardHandlerServer(s grpc.ServiceRegistrar, srv ShardHandlerServer) {
	s.RegisterService(&ShardHandler_ServiceDesc, srv)
}

func _ShardHandler_SubmitShardTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SubmitShardTxRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ShardHandlerServer).SubmitShardTx(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/world.engine.shard.v1.ShardHandler/SubmitShardTx",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ShardHandlerServer).SubmitShardTx(ctx, req.(*SubmitShardTxRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// ShardHandler_ServiceDesc is the grpc.ServiceDesc for ShardHandler service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ShardHandler_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "world.engine.shard.v1.ShardHandler",
	HandlerType: (*ShardHandlerServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "SubmitShardTx",
			Handler:    _ShardHandler_SubmitShardTx_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "shard/v1/shard.proto",
}
