listGroundStationReservations method

Future<ListGroundStationReservationsResponse> listGroundStationReservations({
  1. required DateTime endTime,
  2. required String groundStationId,
  3. required DateTime startTime,
  4. int? maxResults,
  5. String? nextToken,
  6. List<ReservationType>? reservationTypes,
})

Returns a list of reservations for a specified ground station.

May throw DependencyException. May throw InvalidParameterException.

Parameter endTime : End time of the reservation window in UTC.

Parameter groundStationId : ID of a ground station.

Parameter startTime : Start time of the reservation window in UTC.

Parameter maxResults : Maximum number of ground station reservations returned.

Parameter nextToken : Next token returned in the request of a previous ListGroundStationReservations call. Used to get the next page of results.

Parameter reservationTypes : Types of reservations to filter by.

Implementation

Future<ListGroundStationReservationsResponse> listGroundStationReservations({
  required DateTime endTime,
  required String groundStationId,
  required DateTime startTime,
  int? maxResults,
  String? nextToken,
  List<ReservationType>? reservationTypes,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final $query = <String, List<String>>{
    'endTime': [_s.unixTimestampToJson(endTime).toString().toString()],
    'startTime': [_s.unixTimestampToJson(startTime).toString().toString()],
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
    if (reservationTypes != null)
      'reservationTypes': reservationTypes.map((e) => e.value).toList(),
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/groundstation/${Uri.encodeComponent(groundStationId)}/reservation',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListGroundStationReservationsResponse.fromJson(response);
}