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

from stellarstation.api.v1.groundstation import groundstation_pb2 as stellarstation_dot_api_dot_v1_dot_groundstation_dot_groundstation__pb2


class GroundStationServiceStub(object):
    """The public API of StellarStation for use by ground station operators integrating with the
    StellarStation ground network. It is invalid to specify ground station IDs that the operator
    does not own. Only using IDs shown on the StellarStation Console or returned in API responses
    will ensure all inputs are valid.

    A pass is a time range where an ground station and satellite can communicate with each other, i.e.,
    the period between Acquisition of Signal (AOS) and Loss of Signal (LOS) of the ground station and
    satellite pair.

    A plan is a scheduled pass that will be executed to send and receive data between the ground
    station and satellite during the time range.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.AddUnavailabilityWindow = channel.unary_unary(
                '/stellarstation.api.v1.groundstation.GroundStationService/AddUnavailabilityWindow',
                request_serializer=stellarstation_dot_api_dot_v1_dot_groundstation_dot_groundstation__pb2.AddUnavailabilityWindowRequest.SerializeToString,
                response_deserializer=stellarstation_dot_api_dot_v1_dot_groundstation_dot_groundstation__pb2.AddUnavailabilityWindowResponse.FromString,
                )
        self.CancelPlan = channel.unary_unary(
                '/stellarstation.api.v1.groundstation.GroundStationService/CancelPlan',
                request_serializer=stellarstation_dot_api_dot_v1_dot_groundstation_dot_groundstation__pb2.CancelPlanRequest.SerializeToString,
                response_deserializer=stellarstation_dot_api_dot_v1_dot_groundstation_dot_groundstation__pb2.CancelPlanResponse.FromString,
                )
        self.DeleteUnavailabilityWindow = channel.unary_unary(
                '/stellarstation.api.v1.groundstation.GroundStationService/DeleteUnavailabilityWindow',
                request_serializer=stellarstation_dot_api_dot_v1_dot_groundstation_dot_groundstation__pb2.DeleteUnavailabilityWindowRequest.SerializeToString,
                response_deserializer=stellarstation_dot_api_dot_v1_dot_groundstation_dot_groundstation__pb2.DeleteUnavailabilityWindowResponse.FromString,
                )
        self.ListPlans = channel.unary_unary(
                '/stellarstation.api.v1.groundstation.GroundStationService/ListPlans',
                request_serializer=stellarstation_dot_api_dot_v1_dot_groundstation_dot_groundstation__pb2.ListPlansRequest.SerializeToString,
                response_deserializer=stellarstation_dot_api_dot_v1_dot_groundstation_dot_groundstation__pb2.ListPlansResponse.FromString,
                )
        self.ListUnavailabilityWindows = channel.unary_unary(
                '/stellarstation.api.v1.groundstation.GroundStationService/ListUnavailabilityWindows',
                request_serializer=stellarstation_dot_api_dot_v1_dot_groundstation_dot_groundstation__pb2.ListUnavailabilityWindowsRequest.SerializeToString,
                response_deserializer=stellarstation_dot_api_dot_v1_dot_groundstation_dot_groundstation__pb2.ListUnavailabilityWindowsResponse.FromString,
                )
        self.OpenGroundStationStream = channel.stream_stream(
                '/stellarstation.api.v1.groundstation.GroundStationService/OpenGroundStationStream',
                request_serializer=stellarstation_dot_api_dot_v1_dot_groundstation_dot_groundstation__pb2.GroundStationStreamRequest.SerializeToString,
                response_deserializer=stellarstation_dot_api_dot_v1_dot_groundstation_dot_groundstation__pb2.GroundStationStreamResponse.FromString,
                )
        self.GetCurrentPlan = channel.unary_unary(
                '/stellarstation.api.v1.groundstation.GroundStationService/GetCurrentPlan',
                request_serializer=stellarstation_dot_api_dot_v1_dot_groundstation_dot_groundstation__pb2.GetCurrentPlanRequest.SerializeToString,
                response_deserializer=stellarstation_dot_api_dot_v1_dot_groundstation_dot_groundstation__pb2.GetCurrentPlanResponse.FromString,
                )


class GroundStationServiceServicer(object):
    """The public API of StellarStation for use by ground station operators integrating with the
    StellarStation ground network. It is invalid to specify ground station IDs that the operator
    does not own. Only using IDs shown on the StellarStation Console or returned in API responses
    will ensure all inputs are valid.

    A pass is a time range where an ground station and satellite can communicate with each other, i.e.,
    the period between Acquisition of Signal (AOS) and Loss of Signal (LOS) of the ground station and
    satellite pair.

    A plan is a scheduled pass that will be executed to send and receive data between the ground
    station and satellite during the time range.
    """

    def AddUnavailabilityWindow(self, request, context):
        """Adds a new unavailability window to the requested ground station.

        Existing plans that overlap the unavailability window will not be canceled and the request will
        be closed with a 'FAILED_PRECONDITION' status. In this case you will need to list any existing
        plans with ListPlans and then cancel the plans with CancelPlan.

        The request will be closed with an `INVALID_ARGUMENT` status if `ground_station_id`,
        `start_time`, or `end_time` are missing, or 'end_time' is not after 'start_time'.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CancelPlan(self, request, context):
        """Cancel a previously reserved upcoming plan. Cancelling the plan will cause it to not be
        executed. This action cannot be undone, but it is still possible for the pass to be reserved
        again. The plan cannot be cancelled less than ten minutes before AOS.

        Canceling a plan may incur a charge based on the time left to AOS. See our cancellation policy
        for details.

        If the plan is not found, the request will return a `NOT_FOUND` error.

        If the plan has already been canceled or is less than ten minutes away from its AOS, the
        request will return a `FAILED_PRECONDITION` error.

        If the plan is ongoing or has already finished executing, the request will return a
        `OUT_OF_RANGE` error.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def DeleteUnavailabilityWindow(self, request, context):
        """Deletes an existing unavailability window of the requested ground station.

        The request will be closed with an `INVALID_ARGUMENT` status if `window_id` is missing
        or invalid.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListPlans(self, request, context):
        """Lists the plans for a particular ground station.

        The request will be closed with an `INVALID_ARGUMENT` status if `ground_station_id`,
        `aos_after`, or `aos_before` are missing, or the duration between the two times is longer than
        31 days.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListUnavailabilityWindows(self, request, context):
        """Returns a list of unavailability windows for the requested ground station.

        The request will be closed with an `INVALID_ARGUMENT` status if `ground_station_id`,
        `start_time`, or `end_time` are missing, or 'end_time' is not after 'start_time'.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def OpenGroundStationStream(self, request_iterator, context):
        """Open a stream from a ground station. The returned stream is bi-directional - it is used by
        the ground station to send telemetry received from a satellite and receive commands to send to
        the satellite. The ground station must keep this stream open while it is connected to the
        StellarStation network for use in executing plans - if the stream is cut, it must be
        reconnected with exponential backoff.

        The first `GroundStationStreamRequest` sent on the stream is used for configuring the stream.
        Unless otherwise specified, all configuration is taken from the first request and configuration
        values in subsequent requests will be ignored.

        There is no restriction on the number of active streams from a ground station (i.e., streams
        opened with the same `ground_station_id`). Most ground stations will issue a single stream to
        receive commands and send telemetry, but in certain cases, such as if uplink and downlink are
        handled by different computers, it can be appropriate to have multiple processes with their
        own stream. If opening multiple streams for a single ground station, it is the client's
        responsibility to handle the streams appropriately, for example by ensuring only one stream
        sends commands so they are not duplicated.

        If the ground station is not found or the API client is not authorized for it, the stream will
        be closed with a `NOT_FOUND` error.

        Status: ALPHA This API is under development and may not work correctly or be changed in backwards
        incompatible ways in the future.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetCurrentPlan(self, request, context):
        """For internal use only - retrieve current plan
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_GroundStationServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'AddUnavailabilityWindow': grpc.unary_unary_rpc_method_handler(
                    servicer.AddUnavailabilityWindow,
                    request_deserializer=stellarstation_dot_api_dot_v1_dot_groundstation_dot_groundstation__pb2.AddUnavailabilityWindowRequest.FromString,
                    response_serializer=stellarstation_dot_api_dot_v1_dot_groundstation_dot_groundstation__pb2.AddUnavailabilityWindowResponse.SerializeToString,
            ),
            'CancelPlan': grpc.unary_unary_rpc_method_handler(
                    servicer.CancelPlan,
                    request_deserializer=stellarstation_dot_api_dot_v1_dot_groundstation_dot_groundstation__pb2.CancelPlanRequest.FromString,
                    response_serializer=stellarstation_dot_api_dot_v1_dot_groundstation_dot_groundstation__pb2.CancelPlanResponse.SerializeToString,
            ),
            'DeleteUnavailabilityWindow': grpc.unary_unary_rpc_method_handler(
                    servicer.DeleteUnavailabilityWindow,
                    request_deserializer=stellarstation_dot_api_dot_v1_dot_groundstation_dot_groundstation__pb2.DeleteUnavailabilityWindowRequest.FromString,
                    response_serializer=stellarstation_dot_api_dot_v1_dot_groundstation_dot_groundstation__pb2.DeleteUnavailabilityWindowResponse.SerializeToString,
            ),
            'ListPlans': grpc.unary_unary_rpc_method_handler(
                    servicer.ListPlans,
                    request_deserializer=stellarstation_dot_api_dot_v1_dot_groundstation_dot_groundstation__pb2.ListPlansRequest.FromString,
                    response_serializer=stellarstation_dot_api_dot_v1_dot_groundstation_dot_groundstation__pb2.ListPlansResponse.SerializeToString,
            ),
            'ListUnavailabilityWindows': grpc.unary_unary_rpc_method_handler(
                    servicer.ListUnavailabilityWindows,
                    request_deserializer=stellarstation_dot_api_dot_v1_dot_groundstation_dot_groundstation__pb2.ListUnavailabilityWindowsRequest.FromString,
                    response_serializer=stellarstation_dot_api_dot_v1_dot_groundstation_dot_groundstation__pb2.ListUnavailabilityWindowsResponse.SerializeToString,
            ),
            'OpenGroundStationStream': grpc.stream_stream_rpc_method_handler(
                    servicer.OpenGroundStationStream,
                    request_deserializer=stellarstation_dot_api_dot_v1_dot_groundstation_dot_groundstation__pb2.GroundStationStreamRequest.FromString,
                    response_serializer=stellarstation_dot_api_dot_v1_dot_groundstation_dot_groundstation__pb2.GroundStationStreamResponse.SerializeToString,
            ),
            'GetCurrentPlan': grpc.unary_unary_rpc_method_handler(
                    servicer.GetCurrentPlan,
                    request_deserializer=stellarstation_dot_api_dot_v1_dot_groundstation_dot_groundstation__pb2.GetCurrentPlanRequest.FromString,
                    response_serializer=stellarstation_dot_api_dot_v1_dot_groundstation_dot_groundstation__pb2.GetCurrentPlanResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'stellarstation.api.v1.groundstation.GroundStationService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class GroundStationService(object):
    """The public API of StellarStation for use by ground station operators integrating with the
    StellarStation ground network. It is invalid to specify ground station IDs that the operator
    does not own. Only using IDs shown on the StellarStation Console or returned in API responses
    will ensure all inputs are valid.

    A pass is a time range where an ground station and satellite can communicate with each other, i.e.,
    the period between Acquisition of Signal (AOS) and Loss of Signal (LOS) of the ground station and
    satellite pair.

    A plan is a scheduled pass that will be executed to send and receive data between the ground
    station and satellite during the time range.
    """

    @staticmethod
    def AddUnavailabilityWindow(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, '/stellarstation.api.v1.groundstation.GroundStationService/AddUnavailabilityWindow',
            stellarstation_dot_api_dot_v1_dot_groundstation_dot_groundstation__pb2.AddUnavailabilityWindowRequest.SerializeToString,
            stellarstation_dot_api_dot_v1_dot_groundstation_dot_groundstation__pb2.AddUnavailabilityWindowResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def CancelPlan(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, '/stellarstation.api.v1.groundstation.GroundStationService/CancelPlan',
            stellarstation_dot_api_dot_v1_dot_groundstation_dot_groundstation__pb2.CancelPlanRequest.SerializeToString,
            stellarstation_dot_api_dot_v1_dot_groundstation_dot_groundstation__pb2.CancelPlanResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def DeleteUnavailabilityWindow(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, '/stellarstation.api.v1.groundstation.GroundStationService/DeleteUnavailabilityWindow',
            stellarstation_dot_api_dot_v1_dot_groundstation_dot_groundstation__pb2.DeleteUnavailabilityWindowRequest.SerializeToString,
            stellarstation_dot_api_dot_v1_dot_groundstation_dot_groundstation__pb2.DeleteUnavailabilityWindowResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ListPlans(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, '/stellarstation.api.v1.groundstation.GroundStationService/ListPlans',
            stellarstation_dot_api_dot_v1_dot_groundstation_dot_groundstation__pb2.ListPlansRequest.SerializeToString,
            stellarstation_dot_api_dot_v1_dot_groundstation_dot_groundstation__pb2.ListPlansResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ListUnavailabilityWindows(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, '/stellarstation.api.v1.groundstation.GroundStationService/ListUnavailabilityWindows',
            stellarstation_dot_api_dot_v1_dot_groundstation_dot_groundstation__pb2.ListUnavailabilityWindowsRequest.SerializeToString,
            stellarstation_dot_api_dot_v1_dot_groundstation_dot_groundstation__pb2.ListUnavailabilityWindowsResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def OpenGroundStationStream(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, '/stellarstation.api.v1.groundstation.GroundStationService/OpenGroundStationStream',
            stellarstation_dot_api_dot_v1_dot_groundstation_dot_groundstation__pb2.GroundStationStreamRequest.SerializeToString,
            stellarstation_dot_api_dot_v1_dot_groundstation_dot_groundstation__pb2.GroundStationStreamResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetCurrentPlan(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, '/stellarstation.api.v1.groundstation.GroundStationService/GetCurrentPlan',
            stellarstation_dot_api_dot_v1_dot_groundstation_dot_groundstation__pb2.GetCurrentPlanRequest.SerializeToString,
            stellarstation_dot_api_dot_v1_dot_groundstation_dot_groundstation__pb2.GetCurrentPlanResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
