Allocation.fromJson constructor

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

Implementation

factory Allocation.fromJson(Map<String, Object?> json) => Allocation(
      id: json["id"] as String,
      type: AllocationType.fromJson(json["type"]),
      status: AllocationStatus.fromJson(json["status"]),
      refund: json["refund"] == null
          ? null
          : AllocationUse.fromJson(
              (json["refund"] as Map).cast<String, Object?>(),
            ),
      payout: json["payout"] == null
          ? null
          : AllocationUse.fromJson(
              (json["payout"] as Map).cast<String, Object?>(),
            ),
      createdAt: decodeDateTime(json["created_at"]),
      updatedAt: decodeDateTime(json["updated_at"]),
      completedAt: json["completed_at"] == null
          ? null
          : decodeDateTime(json["completed_at"]),
    );