part of 'generated.dart';

class GetTaskByIdVariablesBuilder {
  String id;

  final FirebaseDataConnect _dataConnect;
  GetTaskByIdVariablesBuilder(this._dataConnect, {required  this.id,});
  Deserializer<GetTaskByIdData> dataDeserializer = (dynamic json)  => GetTaskByIdData.fromJson(jsonDecode(json));
  Serializer<GetTaskByIdVariables> varsSerializer = (GetTaskByIdVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<GetTaskByIdData, GetTaskByIdVariables>> execute() {
    return ref().execute();
  }

  QueryRef<GetTaskByIdData, GetTaskByIdVariables> ref() {
    GetTaskByIdVariables vars= GetTaskByIdVariables(id: id,);
    return _dataConnect.query("getTaskById", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class GetTaskByIdTask {
  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;
  GetTaskByIdTask.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 GetTaskByIdTask otherTyped = other as GetTaskByIdTask;
    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;
  }

  GetTaskByIdTask({
    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 GetTaskByIdData {
  final GetTaskByIdTask? task;
  GetTaskByIdData.fromJson(dynamic json):
  
  task = json['task'] == null ? null : GetTaskByIdTask.fromJson(json['task']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final GetTaskByIdData otherTyped = other as GetTaskByIdData;
    return task == otherTyped.task;
    
  }
  @override
  int get hashCode => task.hashCode;
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    if (task != null) {
      json['task'] = task!.toJson();
    }
    return json;
  }

  GetTaskByIdData({
    this.task,
  });
}

@immutable
class GetTaskByIdVariables {
  final String id;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  GetTaskByIdVariables.fromJson(Map<String, dynamic> json):
  
  id = nativeFromJson<String>(json['id']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final GetTaskByIdVariables otherTyped = other as GetTaskByIdVariables;
    return id == otherTyped.id;
    
  }
  @override
  int get hashCode => id.hashCode;
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    return json;
  }

  GetTaskByIdVariables({
    required this.id,
  });
}

