fromJson method

  1. @override
UGetRelationshipsRelationship fromJson(
  1. Map<String, dynamic> json
)

Implementation

@override
UGetRelationshipsRelationship fromJson(Map<String, dynamic> json) {
  try {
    if (isRelationship(json)) {
      return UGetRelationshipsRelationship.relationship(
        data: const RelationshipConverter().fromJson(json),
      );
    }
    if (isNotFoundActor(json)) {
      return UGetRelationshipsRelationship.notFoundActor(
        data: const NotFoundActorConverter().fromJson(json),
      );
    }

    return UGetRelationshipsRelationship.unknown(data: json);
  } catch (_) {
    return UGetRelationshipsRelationship.unknown(data: json);
  }
}