listContacts method

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

Returns a list of contacts.

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

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

Parameter endTime : End time of a contact.

Parameter startTime : Start time of a contact.

Parameter statusList : Status of a contact reservation.

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,
  String? groundStation,
  int? maxResults,
  String? missionProfileArn,
  String? nextToken,
  String? satelliteArn,
}) async {
  ArgumentError.checkNotNull(endTime, 'endTime');
  ArgumentError.checkNotNull(startTime, 'startTime');
  ArgumentError.checkNotNull(statusList, 'statusList');
  final $payload = <String, dynamic>{
    'endTime': unixTimestampToJson(endTime),
    'startTime': unixTimestampToJson(startTime),
    'statusList': statusList.map((e) => e.toValue()).toList(),
    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);
}