fromJson method

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

Implementation

@override
UPostgateEmbeddingRule fromJson(Map<String, dynamic> json) {
  try {
    final type = json[core.objectType];

    if (type == ids.appBskyFeedPostgateDisableRule) {
      return UPostgateEmbeddingRule.disableRule(
        data: PostgateDisableRule.fromJson(json),
      );
    }

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