// To parse this JSON data, do
//
//     final document = documentFromJson(jsonString);

import 'dart:convert';

Document documentFromJson(String str) => Document.fromJson(json.decode(str));

String documentToJson(Document data) => json.encode(data.toJson());

class Document {
  Document({
    this.totalItemsCount,
    this.data,
    this.messageStatus,
    this.message,
  });

  int? totalItemsCount;
  List<DocumentData>? data;
  int? messageStatus;
  String? message;

  factory Document.fromJson(Map<String, dynamic> json) => Document(
        totalItemsCount: json["totalItemsCount"],
        data: json["data"] == null ? null : List<DocumentData>.from(json["data"].map((x) => DocumentData.fromJson(x))),
        messageStatus: json["messageStatus"],
        message: json["message"],
      );

  Map<String, dynamic> toJson() => {
        "totalItemsCount": totalItemsCount,
        "data": data == null ? null : List<dynamic>.from(data!.map((x) => x.toJson())),
        "messageStatus": messageStatus,
        "message": message,
      };
}

class DocumentData {
  DocumentData({
    this.id,
    this.serviceProviderId,
    this.documentId,
    this.documentUrl,
    this.status,
    this.statusText,
    this.comment,
    this.isActive,
    this.document,
    this.fileExt,
    this.documentName,
    this.isLocalFile,
  });

  int? id;
  int? serviceProviderId;
  int? documentId;
  String? documentUrl;
  int? status;
  String? comment;
  bool? isActive;
  String? document;
  String? fileExt;
  String? statusText;
  String? documentName;
  bool? isLocalFile;

  factory DocumentData.fromJson(Map<String, dynamic> json) => DocumentData(
      id: json["id"],
      serviceProviderId: json["serviceProviderID"],
      documentId: json["documentID"],
      documentUrl: json["documentURL"],
      status: json["status"],
      statusText: json["statusText"],
      comment: json["comment"],
      isActive: json["isActive"],
      document: null,
      fileExt: null,
      documentName: json["documentName"],
      isLocalFile: false);

  Map<String, dynamic> toJson() => {
        "id": id,
        "serviceProviderID": serviceProviderId,
        "documentID": documentId,
        "documentURL": documentUrl,
        "status": status,
        "comment": comment,
        "isActive": isActive,
      };
}
