# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc

from . import synse_pb2 as synse__pb2


class V3PluginStub(object):
  """V3Plugin is the API for plugin communication in Synse v3.
  """

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

    Args:
      channel: A grpc.Channel.
    """
    self.Devices = channel.unary_stream(
        '/synse.V3Plugin/Devices',
        request_serializer=synse__pb2.V3DeviceSelector.SerializeToString,
        response_deserializer=synse__pb2.V3Device.FromString,
        )
    self.Health = channel.unary_unary(
        '/synse.V3Plugin/Health',
        request_serializer=synse__pb2.Empty.SerializeToString,
        response_deserializer=synse__pb2.V3Health.FromString,
        )
    self.Metadata = channel.unary_unary(
        '/synse.V3Plugin/Metadata',
        request_serializer=synse__pb2.Empty.SerializeToString,
        response_deserializer=synse__pb2.V3Metadata.FromString,
        )
    self.Read = channel.unary_stream(
        '/synse.V3Plugin/Read',
        request_serializer=synse__pb2.V3ReadRequest.SerializeToString,
        response_deserializer=synse__pb2.V3Reading.FromString,
        )
    self.ReadCache = channel.unary_stream(
        '/synse.V3Plugin/ReadCache',
        request_serializer=synse__pb2.V3Bounds.SerializeToString,
        response_deserializer=synse__pb2.V3Reading.FromString,
        )
    self.ReadStream = channel.unary_stream(
        '/synse.V3Plugin/ReadStream',
        request_serializer=synse__pb2.V3StreamRequest.SerializeToString,
        response_deserializer=synse__pb2.V3Reading.FromString,
        )
    self.Test = channel.unary_unary(
        '/synse.V3Plugin/Test',
        request_serializer=synse__pb2.Empty.SerializeToString,
        response_deserializer=synse__pb2.V3TestStatus.FromString,
        )
    self.Transaction = channel.unary_unary(
        '/synse.V3Plugin/Transaction',
        request_serializer=synse__pb2.V3TransactionSelector.SerializeToString,
        response_deserializer=synse__pb2.V3TransactionStatus.FromString,
        )
    self.Transactions = channel.unary_stream(
        '/synse.V3Plugin/Transactions',
        request_serializer=synse__pb2.Empty.SerializeToString,
        response_deserializer=synse__pb2.V3TransactionStatus.FromString,
        )
    self.Version = channel.unary_unary(
        '/synse.V3Plugin/Version',
        request_serializer=synse__pb2.Empty.SerializeToString,
        response_deserializer=synse__pb2.V3Version.FromString,
        )
    self.WriteAsync = channel.unary_stream(
        '/synse.V3Plugin/WriteAsync',
        request_serializer=synse__pb2.V3WritePayload.SerializeToString,
        response_deserializer=synse__pb2.V3WriteTransaction.FromString,
        )
    self.WriteSync = channel.unary_stream(
        '/synse.V3Plugin/WriteSync',
        request_serializer=synse__pb2.V3WritePayload.SerializeToString,
        response_deserializer=synse__pb2.V3TransactionStatus.FromString,
        )


class V3PluginServicer(object):
  """V3Plugin is the API for plugin communication in Synse v3.
  """

  def Devices(self, request, context):
    """Devices gets all devices that a plugin manages.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def Health(self, request, context):
    """Health gets the health status of a plugin.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def Metadata(self, request, context):
    """Metadata gets the plugin meta-information.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def Read(self, request, context):
    """Read gets readings from the specified plugin device(s).
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def ReadCache(self, request, context):
    """ReadCache gets the cached readings from the plugin. If the plugin
    is not configured to cache readings, it will returned the entire
    current read state.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def ReadStream(self, request, context):
    """ReadStream returns reading data for the specified devices as they
    are read by the plugin.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def Test(self, request, context):
    """Test checks whether the plugin is reachable and ready.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def Transaction(self, request, context):
    """Transaction gets the status of a write transaction for an
    asynchronous write.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def Transactions(self, request, context):
    """Transactions gets all transactions which are currently kept
    in the plugin's transaction cache.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def Version(self, request, context):
    """Version gets the version information for the plugin.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def WriteAsync(self, request, context):
    """WriteAsync writes data to the specified plugin device. A transaction ID
    is returned so the write status can be checked asynchronously.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def WriteSync(self, request, context):
    """WriteSync writes data to the specified plugin device. The request blocks
    until the write resolves so no asynchronous checking is required.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')


def add_V3PluginServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'Devices': grpc.unary_stream_rpc_method_handler(
          servicer.Devices,
          request_deserializer=synse__pb2.V3DeviceSelector.FromString,
          response_serializer=synse__pb2.V3Device.SerializeToString,
      ),
      'Health': grpc.unary_unary_rpc_method_handler(
          servicer.Health,
          request_deserializer=synse__pb2.Empty.FromString,
          response_serializer=synse__pb2.V3Health.SerializeToString,
      ),
      'Metadata': grpc.unary_unary_rpc_method_handler(
          servicer.Metadata,
          request_deserializer=synse__pb2.Empty.FromString,
          response_serializer=synse__pb2.V3Metadata.SerializeToString,
      ),
      'Read': grpc.unary_stream_rpc_method_handler(
          servicer.Read,
          request_deserializer=synse__pb2.V3ReadRequest.FromString,
          response_serializer=synse__pb2.V3Reading.SerializeToString,
      ),
      'ReadCache': grpc.unary_stream_rpc_method_handler(
          servicer.ReadCache,
          request_deserializer=synse__pb2.V3Bounds.FromString,
          response_serializer=synse__pb2.V3Reading.SerializeToString,
      ),
      'ReadStream': grpc.unary_stream_rpc_method_handler(
          servicer.ReadStream,
          request_deserializer=synse__pb2.V3StreamRequest.FromString,
          response_serializer=synse__pb2.V3Reading.SerializeToString,
      ),
      'Test': grpc.unary_unary_rpc_method_handler(
          servicer.Test,
          request_deserializer=synse__pb2.Empty.FromString,
          response_serializer=synse__pb2.V3TestStatus.SerializeToString,
      ),
      'Transaction': grpc.unary_unary_rpc_method_handler(
          servicer.Transaction,
          request_deserializer=synse__pb2.V3TransactionSelector.FromString,
          response_serializer=synse__pb2.V3TransactionStatus.SerializeToString,
      ),
      'Transactions': grpc.unary_stream_rpc_method_handler(
          servicer.Transactions,
          request_deserializer=synse__pb2.Empty.FromString,
          response_serializer=synse__pb2.V3TransactionStatus.SerializeToString,
      ),
      'Version': grpc.unary_unary_rpc_method_handler(
          servicer.Version,
          request_deserializer=synse__pb2.Empty.FromString,
          response_serializer=synse__pb2.V3Version.SerializeToString,
      ),
      'WriteAsync': grpc.unary_stream_rpc_method_handler(
          servicer.WriteAsync,
          request_deserializer=synse__pb2.V3WritePayload.FromString,
          response_serializer=synse__pb2.V3WriteTransaction.SerializeToString,
      ),
      'WriteSync': grpc.unary_stream_rpc_method_handler(
          servicer.WriteSync,
          request_deserializer=synse__pb2.V3WritePayload.FromString,
          response_serializer=synse__pb2.V3TransactionStatus.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'synse.V3Plugin', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
