getRelation method
Future<EntityRelation?>
getRelation(
- EntityId fromId,
- String relationType,
- RelationTypeGroup relationTypeGroup,
- EntityId toId, {
- RequestConfig? requestConfig,
Implementation
Future<EntityRelation?> getRelation(EntityId fromId, String relationType,
RelationTypeGroup relationTypeGroup, EntityId toId,
{RequestConfig? requestConfig}) async {
return nullIfNotFound(
(RequestConfig requestConfig) async {
var response =
await _tbClient.get<Map<String, dynamic>>('/api/relation',
queryParameters: {
'fromId': fromId.id,
'fromType': fromId.entityType.toShortString(),
'relationType': relationType,
'relationTypeGroup': relationTypeGroup.toShortString(),
'toId': toId.id,
'toType': toId.entityType.toShortString()
},
options: defaultHttpOptionsFromConfig(requestConfig));
return response.data != null
? EntityRelation.fromJson(response.data!)
: null;
},
requestConfig: requestConfig,
);
}