fetchRelatedResource method
Future<RelatedResourceFetched>
fetchRelatedResource(
- String type,
- String id,
- String relationship, {
- Map<String, String> query = const {},
- Map<String, String> filter = const {},
- Iterable<String> include = const [],
- Map<String, Iterable<String>> fields = const {},
})
Implementation
Future<RelatedResourceFetched> fetchRelatedResource(
String type,
String id,
String relationship, {
Map<String, String> headers = const {},
Map<String, String> query = const {},
Map<String, String> filter = const {},
Iterable<String> include = const [],
Map<String, Iterable<String>> fields = const {},
}) async {
final response = await send(
baseUri.related(type, id, relationship),
Request.get()
..headers.addAll(headers)
..query.addAll(query)
..filter(filter)
..include(include)
..fields(fields));
return RelatedResourceFetched(
response.http, response.document ?? (throw FormatException()));
}