# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
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.ListGroundStationPlans = channel.unary_unary(
        '/stellarstation.api.v1.StellarStationService/ListGroundStationPlans',
        request_serializer=stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.ListGroundStationPlansRequest.SerializeToString,
        response_deserializer=stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.ListGroundStationPlansResponse.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,
        )


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 ListGroundStationPlans(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 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 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.

    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 add_StellarStationServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'ListGroundStationPlans': grpc.unary_unary_rpc_method_handler(
          servicer.ListGroundStationPlans,
          request_deserializer=stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.ListGroundStationPlansRequest.FromString,
          response_serializer=stellarstation_dot_api_dot_v1_dot_stellarstation__pb2.ListGroundStationPlansResponse.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,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'stellarstation.api.v1.StellarStationService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
