TreatmentResource.fromJson constructor

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

Implementation

factory TreatmentResource.fromJson(Map<String, dynamic> json) {
  return TreatmentResource(
    id: json['Id'] as String,
    sizePercent: json['SizePercent'] as int,
    customDeliveryConfiguration: json['CustomDeliveryConfiguration'] != null
        ? CustomDeliveryConfiguration.fromJson(
            json['CustomDeliveryConfiguration'] as Map<String, dynamic>)
        : null,
    messageConfiguration: json['MessageConfiguration'] != null
        ? MessageConfiguration.fromJson(
            json['MessageConfiguration'] as Map<String, dynamic>)
        : null,
    schedule: json['Schedule'] != null
        ? Schedule.fromJson(json['Schedule'] as Map<String, dynamic>)
        : null,
    state: json['State'] != null
        ? CampaignState.fromJson(json['State'] as Map<String, dynamic>)
        : null,
    templateConfiguration: json['TemplateConfiguration'] != null
        ? TemplateConfiguration.fromJson(
            json['TemplateConfiguration'] as Map<String, dynamic>)
        : null,
    treatmentDescription: json['TreatmentDescription'] as String?,
    treatmentName: json['TreatmentName'] as String?,
  );
}