HIT.fromJson constructor

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

Implementation

factory HIT.fromJson(Map<String, dynamic> json) {
  return HIT(
    assignmentDurationInSeconds: json['AssignmentDurationInSeconds'] as int?,
    autoApprovalDelayInSeconds: json['AutoApprovalDelayInSeconds'] as int?,
    creationTime: timeStampFromJson(json['CreationTime']),
    description: json['Description'] as String?,
    expiration: timeStampFromJson(json['Expiration']),
    hITGroupId: json['HITGroupId'] as String?,
    hITId: json['HITId'] as String?,
    hITLayoutId: json['HITLayoutId'] as String?,
    hITReviewStatus:
        (json['HITReviewStatus'] as String?)?.toHITReviewStatus(),
    hITStatus: (json['HITStatus'] as String?)?.toHITStatus(),
    hITTypeId: json['HITTypeId'] as String?,
    keywords: json['Keywords'] as String?,
    maxAssignments: json['MaxAssignments'] as int?,
    numberOfAssignmentsAvailable:
        json['NumberOfAssignmentsAvailable'] as int?,
    numberOfAssignmentsCompleted:
        json['NumberOfAssignmentsCompleted'] as int?,
    numberOfAssignmentsPending: json['NumberOfAssignmentsPending'] as int?,
    qualificationRequirements: (json['QualificationRequirements'] as List?)
        ?.whereNotNull()
        .map((e) =>
            QualificationRequirement.fromJson(e as Map<String, dynamic>))
        .toList(),
    question: json['Question'] as String?,
    requesterAnnotation: json['RequesterAnnotation'] as String?,
    reward: json['Reward'] as String?,
    title: json['Title'] as String?,
  );
}