# -*- coding: utf-8 -*-
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
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.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,
        )


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 be canceled. However, there
    are cases when the plan cannot be canceled. When this happens, the request will be closed
    with a 'FAILED_PRECONDITION' status.

    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 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 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,
      ),
      '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,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'stellarstation.api.v1.groundstation.GroundStationService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
