# 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 import stellarstation_pb2 as stellarstation_dot_api_dot_v1_dot_stellarstation__pb2


class StellarStationServiceStub(object):
    """The public API service of StellarStation, a system supporting communication between satellites
    and ground stations. This API is for use by an operator of a satellite - it is invalid to specify
    satellites that the operator does not own or plans they have not reserved.
    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.ListPlans = channel.unary_unary(
                '/stellarstation.api.v1.StellarStationService/ListPlans',
                request_serializer=stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.ListPlansRequest.SerializeToString,
                response_deserializer=stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.ListPlansResponse.FromString,
                )
        self.CancelPlan = channel.unary_unary(
                '/stellarstation.api.v1.StellarStationService/CancelPlan',
                request_serializer=stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.CancelPlanRequest.SerializeToString,
                response_deserializer=stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.CancelPlanResponse.FromString,
                )
        self.ListUpcomingAvailablePasses = channel.unary_unary(
                '/stellarstation.api.v1.StellarStationService/ListUpcomingAvailablePasses',
                request_serializer=stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.ListUpcomingAvailablePassesRequest.SerializeToString,
                response_deserializer=stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.ListUpcomingAvailablePassesResponse.FromString,
                )
        self.OpenSatelliteStream = channel.stream_stream(
                '/stellarstation.api.v1.StellarStationService/OpenSatelliteStream',
                request_serializer=stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.SatelliteStreamRequest.SerializeToString,
                response_deserializer=stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.SatelliteStreamResponse.FromString,
                )
        self.ReservePass = channel.unary_unary(
                '/stellarstation.api.v1.StellarStationService/ReservePass',
                request_serializer=stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.ReservePassRequest.SerializeToString,
                response_deserializer=stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.ReservePassResponse.FromString,
                )
        self.AddTle = channel.unary_unary(
                '/stellarstation.api.v1.StellarStationService/AddTle',
                request_serializer=stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.AddTleRequest.SerializeToString,
                response_deserializer=stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.AddTleResponse.FromString,
                )
        self.GetTle = channel.unary_unary(
                '/stellarstation.api.v1.StellarStationService/GetTle',
                request_serializer=stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.GetTleRequest.SerializeToString,
                response_deserializer=stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.GetTleResponse.FromString,
                )
        self.SetTleSource = channel.unary_unary(
                '/stellarstation.api.v1.StellarStationService/SetTleSource',
                request_serializer=stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.SetTleSourceRequest.SerializeToString,
                response_deserializer=stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.SetTleSourceResponse.FromString,
                )
        self.SetPlanMetadata = channel.unary_unary(
                '/stellarstation.api.v1.StellarStationService/SetPlanMetadata',
                request_serializer=stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.SetPlanMetadataRequest.SerializeToString,
                response_deserializer=stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.SetPlanMetadataResponse.FromString,
                )


class StellarStationServiceServicer(object):
    """The public API service of StellarStation, a system supporting communication between satellites
    and ground stations. This API is for use by an operator of a satellite - it is invalid to specify
    satellites that the operator does not own or plans they have not reserved.
    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 ListPlans(self, request, context):
        """Lists the plans for a particular satellite.

        The request will be closed with an `INVALID_ARGUMENT` status if `satellite_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 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 to reserve the corresponding
        pass again by calling `ListUpcomingAvailablePasses` and `ReservePass` as usual - this will
        cause a new plan to be reserved. 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 ListUpcomingAvailablePasses(self, request, context):
        """Lists upcoming passes for a satellite. Passes that can be scheduled for the satellite with an
        Acquisition of Signal (AOS) within 14 days from now will be returned. This method does not
        reserve passes in any way - it is possible for a pass that is returned by this method to be
        unschedulable when actually trying to schedule because a conflict appeared during that time.

        If the satellite is not found or the client is not authorized for it, the request will return
        a `NOT_FOUND` error.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def OpenSatelliteStream(self, request_iterator, context):
        """Open a stream to a satellite. The returned stream is bi-directional - it can be used by the
        client to send commands to the satellite and data received from the satellite will be returned
        as it is made available. All telemetry received from the satellite on reserved passes along
        with associated events from this point on will be returned as soon as this method is called. If
        `SatelliteStreamRequest.stream_id` is specified, any messages that have been buffered for the
        stream will be returned as well. If `SatelliteStreamRequest.plan_id` is provided, only messages
        for the specified plan will be returned.

        The first `SatelliteStreamRequest` 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.

        The stream can be left open for any amount of time and telemetry will be received as available
        and returned. When the client is done with the stream, it should close it successfully. If the
        stream is cancelled with an unexpected error at any point, telemetry received before the next
        call to `OpenSatelliteStream` to resume the stream will be buffered up to 1 minute, and if no
        call to `OpenSatelliteStream` is made with `stream_id` specified to resume the stream, it will
        expire in 10 minutes and a call to `OpenSatelliteStream` with that `stream_id` will be closed
        with a `ABORTED` error.

        If the satellite is not found or the client is not authorized for it, the stream will be closed
        with a `NOT_FOUND` error.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ReservePass(self, request, context):
        """Reserves a pass for later execution as a plan. The pass must be specified by a
        `reservation_token` returned in another method like `ListUpcomingAvailablePasses` and its
        `aos_time` must be at least one hour in the future.

        If the `reservation_token` is invalid, the request will return an `INVALID_ARGUMENT` error.

        If the requested pass cannot be scheduled due to a conflict with existing plans or other
        scheduling constraints, the request will return a `FAILED_PRECONDITION` error. This includes
        if the pass `aos_time` is less than one hour in the future.

        Note that the reservation_token may have become unreservable since it was fetched. If that's
        the case, the call to `ReservePass` will fail with a 'FAILED_PRECONDITION' error and
        `ListUpcomingAvailablePasses` should be called again to get a fresh list of reservable passes.
        The pass must be scheduled at least one hour in advance of `aos_time` or it will be rejected.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def AddTle(self, request, context):
        """Adds TLE for a satellite.

        The TLE will be used for satellite orbit calculation until it is superseded by a newly
        added TLE. Adding TLE using this API will automatically change the satellite's TLE source to
        `MANUAL` if it was previously set to `NORAD` to allow for immediate use.

        An 'INVALID_ARGUMENT' error will be returned in the following conditions:
        - the TLE cannot be parsed
        - the TLE norad ID does not correspond to the requested satellite.

        If the satellite is not found or the client is not authorized for it, the request will return
        a `NOT_FOUND` error.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetTle(self, request, context):
        """Gets the TLE for a satellite.

        The returned TLE will be the one that has most recently been added to StellarStation and matches
        the satellite's TLE source. This TLE is used when calculating satellite orbits.

        If the satellite is not found or the client is not authorized for it, the request will return
        a `NOT_FOUND` error.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SetTleSource(self, request, context):
        """Sets the TLE source for a satellite.

        The selected source will be used for all upcoming pass calculations for the satellite. If TLE
        does not exist for a specific source, no passes will be generated.

        An 'INVALID_ARGUMENT' error will be returned in the following condition:
        - no satellite_id is provided.
        - the source provided is invalid.

        If the satellite is not found or the client is not authorized for it, the request will return
        a `NOT_FOUND` error.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SetPlanMetadata(self, request, context):
        """Sets the metadata for a plan.

        Metadata added to a plan is available via ListPlans RPCs for both satellite and ground station
        APIs. Because of this, it is important not to store sensitive information that the plan's
        satellite operator and ground station operator should not have access to.

        Any metadata set with this method will overwrite existing metadata.

        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 add_StellarStationServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'ListPlans': grpc.unary_unary_rpc_method_handler(
                    servicer.ListPlans,
                    request_deserializer=stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.ListPlansRequest.FromString,
                    response_serializer=stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.ListPlansResponse.SerializeToString,
            ),
            'CancelPlan': grpc.unary_unary_rpc_method_handler(
                    servicer.CancelPlan,
                    request_deserializer=stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.CancelPlanRequest.FromString,
                    response_serializer=stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.CancelPlanResponse.SerializeToString,
            ),
            'ListUpcomingAvailablePasses': grpc.unary_unary_rpc_method_handler(
                    servicer.ListUpcomingAvailablePasses,
                    request_deserializer=stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.ListUpcomingAvailablePassesRequest.FromString,
                    response_serializer=stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.ListUpcomingAvailablePassesResponse.SerializeToString,
            ),
            'OpenSatelliteStream': grpc.stream_stream_rpc_method_handler(
                    servicer.OpenSatelliteStream,
                    request_deserializer=stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.SatelliteStreamRequest.FromString,
                    response_serializer=stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.SatelliteStreamResponse.SerializeToString,
            ),
            'ReservePass': grpc.unary_unary_rpc_method_handler(
                    servicer.ReservePass,
                    request_deserializer=stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.ReservePassRequest.FromString,
                    response_serializer=stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.ReservePassResponse.SerializeToString,
            ),
            'AddTle': grpc.unary_unary_rpc_method_handler(
                    servicer.AddTle,
                    request_deserializer=stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.AddTleRequest.FromString,
                    response_serializer=stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.AddTleResponse.SerializeToString,
            ),
            'GetTle': grpc.unary_unary_rpc_method_handler(
                    servicer.GetTle,
                    request_deserializer=stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.GetTleRequest.FromString,
                    response_serializer=stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.GetTleResponse.SerializeToString,
            ),
            'SetTleSource': grpc.unary_unary_rpc_method_handler(
                    servicer.SetTleSource,
                    request_deserializer=stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.SetTleSourceRequest.FromString,
                    response_serializer=stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.SetTleSourceResponse.SerializeToString,
            ),
            'SetPlanMetadata': grpc.unary_unary_rpc_method_handler(
                    servicer.SetPlanMetadata,
                    request_deserializer=stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.SetPlanMetadataRequest.FromString,
                    response_serializer=stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.SetPlanMetadataResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'stellarstation.api.v1.StellarStationService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class StellarStationService(object):
    """The public API service of StellarStation, a system supporting communication between satellites
    and ground stations. This API is for use by an operator of a satellite - it is invalid to specify
    satellites that the operator does not own or plans they have not reserved.
    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 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.StellarStationService/ListPlans',
            stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.ListPlansRequest.SerializeToString,
            stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.ListPlansResponse.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.StellarStationService/CancelPlan',
            stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.CancelPlanRequest.SerializeToString,
            stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.CancelPlanResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ListUpcomingAvailablePasses(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.StellarStationService/ListUpcomingAvailablePasses',
            stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.ListUpcomingAvailablePassesRequest.SerializeToString,
            stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.ListUpcomingAvailablePassesResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def OpenSatelliteStream(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.StellarStationService/OpenSatelliteStream',
            stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.SatelliteStreamRequest.SerializeToString,
            stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.SatelliteStreamResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ReservePass(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.StellarStationService/ReservePass',
            stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.ReservePassRequest.SerializeToString,
            stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.ReservePassResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def AddTle(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.StellarStationService/AddTle',
            stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.AddTleRequest.SerializeToString,
            stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.AddTleResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetTle(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.StellarStationService/GetTle',
            stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.GetTleRequest.SerializeToString,
            stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.GetTleResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def SetTleSource(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.StellarStationService/SetTleSource',
            stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.SetTleSourceRequest.SerializeToString,
            stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.SetTleSourceResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def SetPlanMetadata(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.StellarStationService/SetPlanMetadata',
            stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.SetPlanMetadataRequest.SerializeToString,
            stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.SetPlanMetadataResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
