ContentTemplateUpdate.fromJson constructor

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

Implementation

factory ContentTemplateUpdate.fromJson(Map<String, Object?> json) {
  return ContentTemplateUpdate(
    templateId: json[r'templateId'] as String? ?? '',
    name: json[r'name'] as String? ?? '',
    templateType: ContentTemplateUpdateTemplateType.fromValue(
        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
        ? ContentTemplateUpdateSpace.fromJson(
            json[r'space']! as Map<String, Object?>)
        : null,
  );
}