part of 'generated.dart';

class ListTasksVariablesBuilder {
  
  final FirebaseDataConnect _dataConnect;
  ListTasksVariablesBuilder(this._dataConnect, );
  Deserializer<ListTasksData> dataDeserializer = (dynamic json)  => ListTasksData.fromJson(jsonDecode(json));
  
  Future<QueryResult<ListTasksData, void>> execute() {
    return ref().execute();
  }

  QueryRef<ListTasksData, void> ref() {
    
    return _dataConnect.query("listTasks", dataDeserializer, emptySerializer, null);
  }
}

@immutable
class ListTasksTasks {
  final String id;
  final String taskName;
  final String? description;
  final EnumValue<TaskPriority> priority;
  final EnumValue<TaskStatus> status;
  final Timestamp? dueDate;
  final int? progress;
  final int? orderIndex;
  final int? commentCount;
  final int? attachmentCount;
  final AnyValue? files;
  final Timestamp? createdAt;
  final Timestamp? updatedAt;
  final String? createdBy;
  ListTasksTasks.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  taskName = nativeFromJson<String>(json['taskName']),
  description = json['description'] == null ? null : nativeFromJson<String>(json['description']),
  priority = taskPriorityDeserializer(json['priority']),
  status = taskStatusDeserializer(json['status']),
  dueDate = json['dueDate'] == null ? null : Timestamp.fromJson(json['dueDate']),
  progress = json['progress'] == null ? null : nativeFromJson<int>(json['progress']),
  orderIndex = json['orderIndex'] == null ? null : nativeFromJson<int>(json['orderIndex']),
  commentCount = json['commentCount'] == null ? null : nativeFromJson<int>(json['commentCount']),
  attachmentCount = json['attachmentCount'] == null ? null : nativeFromJson<int>(json['attachmentCount']),
  files = json['files'] == null ? null : AnyValue.fromJson(json['files']),
  createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']),
  updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']),
  createdBy = json['createdBy'] == null ? null : nativeFromJson<String>(json['createdBy']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListTasksTasks otherTyped = other as ListTasksTasks;
    return id == otherTyped.id && 
    taskName == otherTyped.taskName && 
    description == otherTyped.description && 
    priority == otherTyped.priority && 
    status == otherTyped.status && 
    dueDate == otherTyped.dueDate && 
    progress == otherTyped.progress && 
    orderIndex == otherTyped.orderIndex && 
    commentCount == otherTyped.commentCount && 
    attachmentCount == otherTyped.attachmentCount && 
    files == otherTyped.files && 
    createdAt == otherTyped.createdAt && 
    updatedAt == otherTyped.updatedAt && 
    createdBy == otherTyped.createdBy;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, taskName.hashCode, description.hashCode, priority.hashCode, status.hashCode, dueDate.hashCode, progress.hashCode, orderIndex.hashCode, commentCount.hashCode, attachmentCount.hashCode, files.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['taskName'] = nativeToJson<String>(taskName);
    if (description != null) {
      json['description'] = nativeToJson<String?>(description);
    }
    json['priority'] = 
    taskPrioritySerializer(priority)
    ;
    json['status'] = 
    taskStatusSerializer(status)
    ;
    if (dueDate != null) {
      json['dueDate'] = dueDate!.toJson();
    }
    if (progress != null) {
      json['progress'] = nativeToJson<int?>(progress);
    }
    if (orderIndex != null) {
      json['orderIndex'] = nativeToJson<int?>(orderIndex);
    }
    if (commentCount != null) {
      json['commentCount'] = nativeToJson<int?>(commentCount);
    }
    if (attachmentCount != null) {
      json['attachmentCount'] = nativeToJson<int?>(attachmentCount);
    }
    if (files != null) {
      json['files'] = files!.toJson();
    }
    if (createdAt != null) {
      json['createdAt'] = createdAt!.toJson();
    }
    if (updatedAt != null) {
      json['updatedAt'] = updatedAt!.toJson();
    }
    if (createdBy != null) {
      json['createdBy'] = nativeToJson<String?>(createdBy);
    }
    return json;
  }

  ListTasksTasks({
    required this.id,
    required this.taskName,
    this.description,
    required this.priority,
    required this.status,
    this.dueDate,
    this.progress,
    this.orderIndex,
    this.commentCount,
    this.attachmentCount,
    this.files,
    this.createdAt,
    this.updatedAt,
    this.createdBy,
  });
}

@immutable
class ListTasksData {
  final List<ListTasksTasks> tasks;
  ListTasksData.fromJson(dynamic json):
  
  tasks = (json['tasks'] as List<dynamic>)
        .map((e) => ListTasksTasks.fromJson(e))
        .toList();
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListTasksData otherTyped = other as ListTasksData;
    return tasks == otherTyped.tasks;
    
  }
  @override
  int get hashCode => tasks.hashCode;
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['tasks'] = tasks.map((e) => e.toJson()).toList();
    return json;
  }

  ListTasksData({
    required this.tasks,
  });
}

