class AssistantCommentsModel {
  List<AssistantComments>? comments;
  int? page;
  int? totalCount;
  int? lastPage;

  AssistantCommentsModel(
      {this.comments, this.page, this.totalCount, this.lastPage});

  AssistantCommentsModel.fromJson(Map<String, dynamic> json) {
    if (json['comments'] != null) {
      comments = <AssistantComments>[];
      json['comments'].forEach((v) {
        comments!.add(AssistantComments.fromJson(v));
      });
    }
    page = json['page'];
    totalCount = json['total_count'];
    lastPage = json['last_page'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    if (comments != null) {
      data['comments'] = comments!.map((v) => v.toJson()).toList();
    }
    data['page'] = page;
    data['total_count'] = totalCount;
    data['last_page'] = lastPage;
    return data;
  }
}

class AssistantComments {
  String? text;
  double? score;
  String? createdAt;
  AssistantCommentsUser? user;

  AssistantComments({this.text, this.score, this.createdAt, this.user});

  AssistantComments.fromJson(Map<String, dynamic> json) {
    text = json['text'];
    score = json['score'];
    createdAt = json['created_at'];
    user = json['user'] != null
        ? AssistantCommentsUser.fromJson(json['user'])
        : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['text'] = text;
    data['score'] = score;
    data['created_at'] = createdAt;
    if (user != null) {
      data['user'] = user!.toJson();
    }
    return data;
  }
}

class AssistantCommentsUser {
  String? username;
  String? image;

  AssistantCommentsUser({this.username, this.image});

  AssistantCommentsUser.fromJson(Map<String, dynamic> json) {
    username = json['username'];
    image = json['image'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['username'] = username;
    data['image'] = image;
    return data;
  }
}
