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

from spacex.api.device import device_pb2 as spacex_dot_api_dot_device_dot_device__pb2


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.Stream = channel.stream_stream(
                '/SpaceX.API.Device.Device/Stream',
                request_serializer=spacex_dot_api_dot_device_dot_device__pb2.ToDevice.SerializeToString,
                response_deserializer=spacex_dot_api_dot_device_dot_device__pb2.FromDevice.FromString,
                _registered_method=True)
        self.Handle = channel.unary_unary(
                '/SpaceX.API.Device.Device/Handle',
                request_serializer=spacex_dot_api_dot_device_dot_device__pb2.Request.SerializeToString,
                response_deserializer=spacex_dot_api_dot_device_dot_device__pb2.Response.FromString,
                _registered_method=True)


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

    def Stream(self, request_iterator, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Handle(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_DeviceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Stream': grpc.stream_stream_rpc_method_handler(
                    servicer.Stream,
                    request_deserializer=spacex_dot_api_dot_device_dot_device__pb2.ToDevice.FromString,
                    response_serializer=spacex_dot_api_dot_device_dot_device__pb2.FromDevice.SerializeToString,
            ),
            'Handle': grpc.unary_unary_rpc_method_handler(
                    servicer.Handle,
                    request_deserializer=spacex_dot_api_dot_device_dot_device__pb2.Request.FromString,
                    response_serializer=spacex_dot_api_dot_device_dot_device__pb2.Response.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'SpaceX.API.Device.Device', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('SpaceX.API.Device.Device', rpc_method_handlers)


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

    @staticmethod
    def Stream(request_iterator,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.stream_stream(
            request_iterator,
            target,
            '/SpaceX.API.Device.Device/Stream',
            spacex_dot_api_dot_device_dot_device__pb2.ToDevice.SerializeToString,
            spacex_dot_api_dot_device_dot_device__pb2.FromDevice.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Handle(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,
            '/SpaceX.API.Device.Device/Handle',
            spacex_dot_api_dot_device_dot_device__pb2.Request.SerializeToString,
            spacex_dot_api_dot_device_dot_device__pb2.Response.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
