Activity.fromJson constructor

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

Implementation

factory Activity.fromJson(Map<String, dynamic> json) {
  return Activity(
    custom: json['CUSTOM'] != null
        ? CustomMessageActivity.fromJson(
            json['CUSTOM'] as Map<String, dynamic>)
        : null,
    conditionalSplit: json['ConditionalSplit'] != null
        ? ConditionalSplitActivity.fromJson(
            json['ConditionalSplit'] as Map<String, dynamic>)
        : null,
    description: json['Description'] as String?,
    email: json['EMAIL'] != null
        ? EmailMessageActivity.fromJson(json['EMAIL'] as Map<String, dynamic>)
        : null,
    holdout: json['Holdout'] != null
        ? HoldoutActivity.fromJson(json['Holdout'] as Map<String, dynamic>)
        : null,
    multiCondition: json['MultiCondition'] != null
        ? MultiConditionalSplitActivity.fromJson(
            json['MultiCondition'] as Map<String, dynamic>)
        : null,
    push: json['PUSH'] != null
        ? PushMessageActivity.fromJson(json['PUSH'] as Map<String, dynamic>)
        : null,
    randomSplit: json['RandomSplit'] != null
        ? RandomSplitActivity.fromJson(
            json['RandomSplit'] as Map<String, dynamic>)
        : null,
    sms: json['SMS'] != null
        ? SMSMessageActivity.fromJson(json['SMS'] as Map<String, dynamic>)
        : null,
    wait: json['Wait'] != null
        ? WaitActivity.fromJson(json['Wait'] as Map<String, dynamic>)
        : null,
  );
}