# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc

from benchmark.benchwrapper.proto import spanner_pb2 as benchmark_dot_benchwrapper_dot_proto_dot_spanner__pb2


class SpannerBenchWrapperStub(object):
    """Missing associated documentation comment in .proto file."""

    def __init__(self, channel):
        """Constructor.

        Args:
            channel: A grpc.Channel.
        """
        self.Read = channel.unary_unary(
                '/spanner_bench.SpannerBenchWrapper/Read',
                request_serializer=benchmark_dot_benchwrapper_dot_proto_dot_spanner__pb2.ReadQuery.SerializeToString,
                response_deserializer=benchmark_dot_benchwrapper_dot_proto_dot_spanner__pb2.EmptyResponse.FromString,
                )
        self.Insert = channel.unary_unary(
                '/spanner_bench.SpannerBenchWrapper/Insert',
                request_serializer=benchmark_dot_benchwrapper_dot_proto_dot_spanner__pb2.InsertQuery.SerializeToString,
                response_deserializer=benchmark_dot_benchwrapper_dot_proto_dot_spanner__pb2.EmptyResponse.FromString,
                )
        self.Update = channel.unary_unary(
                '/spanner_bench.SpannerBenchWrapper/Update',
                request_serializer=benchmark_dot_benchwrapper_dot_proto_dot_spanner__pb2.UpdateQuery.SerializeToString,
                response_deserializer=benchmark_dot_benchwrapper_dot_proto_dot_spanner__pb2.EmptyResponse.FromString,
                )


class SpannerBenchWrapperServicer(object):
    """Missing associated documentation comment in .proto file."""

    def Read(self, request, context):
        """Read represents operations like Go's ReadOnlyTransaction.Query, Java's
        ReadOnlyTransaction.executeQuery, Python's snapshot.read, and Node's
        Transaction.Read.

        It will typically be used to read many items.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Insert(self, request, context):
        """Insert represents operations like Go's Client.Apply, Java's
        DatabaseClient.writeAtLeastOnce, Python's transaction.commit, and Node's
        Transaction.Commit.

        It will typically be used to insert many items.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Update(self, request, context):
        """Update represents operations like Go's ReadWriteTransaction.BatchUpdate,
        Java's TransactionRunner.run, Python's Batch.update, and Node's
        Transaction.BatchUpdate.

        It will typically be used to update many items.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_SpannerBenchWrapperServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Read': grpc.unary_unary_rpc_method_handler(
                    servicer.Read,
                    request_deserializer=benchmark_dot_benchwrapper_dot_proto_dot_spanner__pb2.ReadQuery.FromString,
                    response_serializer=benchmark_dot_benchwrapper_dot_proto_dot_spanner__pb2.EmptyResponse.SerializeToString,
            ),
            'Insert': grpc.unary_unary_rpc_method_handler(
                    servicer.Insert,
                    request_deserializer=benchmark_dot_benchwrapper_dot_proto_dot_spanner__pb2.InsertQuery.FromString,
                    response_serializer=benchmark_dot_benchwrapper_dot_proto_dot_spanner__pb2.EmptyResponse.SerializeToString,
            ),
            'Update': grpc.unary_unary_rpc_method_handler(
                    servicer.Update,
                    request_deserializer=benchmark_dot_benchwrapper_dot_proto_dot_spanner__pb2.UpdateQuery.FromString,
                    response_serializer=benchmark_dot_benchwrapper_dot_proto_dot_spanner__pb2.EmptyResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'spanner_bench.SpannerBenchWrapper', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class SpannerBenchWrapper(object):
    """Missing associated documentation comment in .proto file."""

    @staticmethod
    def Read(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/spanner_bench.SpannerBenchWrapper/Read',
            benchmark_dot_benchwrapper_dot_proto_dot_spanner__pb2.ReadQuery.SerializeToString,
            benchmark_dot_benchwrapper_dot_proto_dot_spanner__pb2.EmptyResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Insert(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/spanner_bench.SpannerBenchWrapper/Insert',
            benchmark_dot_benchwrapper_dot_proto_dot_spanner__pb2.InsertQuery.SerializeToString,
            benchmark_dot_benchwrapper_dot_proto_dot_spanner__pb2.EmptyResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Update(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/spanner_bench.SpannerBenchWrapper/Update',
            benchmark_dot_benchwrapper_dot_proto_dot_spanner__pb2.UpdateQuery.SerializeToString,
            benchmark_dot_benchwrapper_dot_proto_dot_spanner__pb2.EmptyResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
