getReference method

Future<GetReferenceResponse> getReference({
  1. required String id,
  2. required int partNumber,
  3. required String referenceStoreId,
  4. ReferenceFile? file,
  5. String? range,
})

Downloads parts of data from a reference genome and returns the reference file in the same format that it was uploaded.

For more information, see Creating a HealthOmics reference store in the Amazon Web Services HealthOmics User Guide.

May throw AccessDeniedException. May throw InternalServerException. May throw RangeNotSatisfiableException. May throw RequestTimeoutException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter id : The reference's ID.

Parameter partNumber : The part number to retrieve.

Parameter referenceStoreId : The reference's store ID.

Parameter file : The file to retrieve.

Parameter range : The range to retrieve.

Implementation

Future<GetReferenceResponse> getReference({
  required String id,
  required int partNumber,
  required String referenceStoreId,
  ReferenceFile? file,
  String? range,
}) async {
  final headers = <String, String>{
    if (range != null) 'Range': range.toString(),
  };
  final $query = <String, List<String>>{
    'partNumber': [partNumber.toString()],
    if (file != null) 'file': [file.value],
  };
  final response = await _protocol.sendRaw(
    payload: null,
    method: 'GET',
    requestUri:
        '/referencestore/${Uri.encodeComponent(referenceStoreId)}/reference/${Uri.encodeComponent(id)}',
    queryParams: $query,
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
  return GetReferenceResponse(
    payload: await response.stream.toBytes(),
  );
}