listContacts method

Future<ListContactsResponse> listContacts({
  1. required DateTime endTime,
  2. required DateTime startTime,
  3. required List<ContactStatus> statusList,
  4. EphemerisFilter? ephemeris,
  5. String? groundStation,
  6. int? maxResults,
  7. String? missionProfileArn,
  8. String? nextToken,
  9. String? satelliteArn,
})

Returns a list of contacts.

If statusList contains AVAILABLE, the request must include groundStation, missionprofileArn, and satelliteArn.

May throw DependencyException. May throw InvalidParameterException. May throw ResourceNotFoundException.

Parameter endTime : End time of a contact in UTC.

Parameter startTime : Start time of a contact in UTC.

Parameter statusList : Status of a contact reservation.

Parameter ephemeris : Filter for selecting contacts that use a specific ephemeris".

Parameter groundStation : Name of a ground station.

Parameter maxResults : Maximum number of contacts returned.

Parameter missionProfileArn : ARN of a mission profile.

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

Parameter satelliteArn : ARN of a satellite.

Implementation

Future<ListContactsResponse> listContacts({
  required DateTime endTime,
  required DateTime startTime,
  required List<ContactStatus> statusList,
  EphemerisFilter? ephemeris,
  String? groundStation,
  int? maxResults,
  String? missionProfileArn,
  String? nextToken,
  String? satelliteArn,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final $payload = <String, dynamic>{
    'endTime': unixTimestampToJson(endTime),
    'startTime': unixTimestampToJson(startTime),
    'statusList': statusList.map((e) => e.value).toList(),
    if (ephemeris != null) 'ephemeris': ephemeris,
    if (groundStation != null) 'groundStation': groundStation,
    if (maxResults != null) 'maxResults': maxResults,
    if (missionProfileArn != null) 'missionProfileArn': missionProfileArn,
    if (nextToken != null) 'nextToken': nextToken,
    if (satelliteArn != null) 'satelliteArn': satelliteArn,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/contacts',
    exceptionFnMap: _exceptionFns,
  );
  return ListContactsResponse.fromJson(response);
}