ContentTemplateCreate.fromJson constructor

ContentTemplateCreate.fromJson(
  1. Map<String, Object?> json
)

Implementation

factory ContentTemplateCreate.fromJson(Map<String, Object?> json) {
  return ContentTemplateCreate(
    name: json[r'name'] as String? ?? '',
    templateType: json[r'templateType'] as String? ?? '',
    body: ContentTemplateBodyCreate.fromJson(
        json[r'body'] as Map<String, Object?>? ?? const {}),
    description: json[r'description'] as String?,
    labels: (json[r'labels'] as List<Object?>?)
            ?.map(
                (i) => Label.fromJson(i as Map<String, Object?>? ?? const {}))
            .toList() ??
        [],
    space: json[r'space'] != null
        ? ContentTemplateCreateSpace.fromJson(
            json[r'space']! as Map<String, Object?>)
        : null,
  );
}