PushNotificationTemplateResponse.fromJson constructor

PushNotificationTemplateResponse.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory PushNotificationTemplateResponse.fromJson(Map<String, dynamic> json) {
  return PushNotificationTemplateResponse(
    creationDate: json['CreationDate'] as String,
    lastModifiedDate: json['LastModifiedDate'] as String,
    templateName: json['TemplateName'] as String,
    templateType: (json['TemplateType'] as String).toTemplateType(),
    adm: json['ADM'] != null
        ? AndroidPushNotificationTemplate.fromJson(
            json['ADM'] as Map<String, dynamic>)
        : null,
    apns: json['APNS'] != null
        ? APNSPushNotificationTemplate.fromJson(
            json['APNS'] as Map<String, dynamic>)
        : null,
    arn: json['Arn'] as String?,
    baidu: json['Baidu'] != null
        ? AndroidPushNotificationTemplate.fromJson(
            json['Baidu'] as Map<String, dynamic>)
        : null,
    defaultValue: json['Default'] != null
        ? DefaultPushNotificationTemplate.fromJson(
            json['Default'] as Map<String, dynamic>)
        : null,
    defaultSubstitutions: json['DefaultSubstitutions'] as String?,
    gcm: json['GCM'] != null
        ? AndroidPushNotificationTemplate.fromJson(
            json['GCM'] as Map<String, dynamic>)
        : null,
    recommenderId: json['RecommenderId'] as String?,
    templateDescription: json['TemplateDescription'] as String?,
    version: json['Version'] as String?,
    tags: (json['tags'] as Map<String, dynamic>?)
        ?.map((k, e) => MapEntry(k, e as String)),
  );
}