part of 'generated.dart';

class UpdateTaskVariablesBuilder {
  String id;
  Optional<String> _taskName = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _description = Optional.optional(nativeFromJson, nativeToJson);
  Optional<TaskPriority> _priority = Optional.optional((data) => TaskPriority.values.byName(data), enumSerializer);
  Optional<TaskStatus> _status = Optional.optional((data) => TaskStatus.values.byName(data), enumSerializer);
  Optional<Timestamp> _dueDate = Optional.optional((json) => json['dueDate'] = Timestamp.fromJson(json['dueDate']), defaultSerializer);
  Optional<int> _progress = Optional.optional(nativeFromJson, nativeToJson);
  Optional<AnyValue> _assignedMembers = Optional.optional(AnyValue.fromJson, defaultSerializer);
  Optional<int> _orderIndex = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _commentCount = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _attachmentCount = Optional.optional(nativeFromJson, nativeToJson);
  Optional<AnyValue> _files = Optional.optional(AnyValue.fromJson, defaultSerializer);

  final FirebaseDataConnect _dataConnect;  UpdateTaskVariablesBuilder taskName(String? t) {
   _taskName.value = t;
   return this;
  }
  UpdateTaskVariablesBuilder description(String? t) {
   _description.value = t;
   return this;
  }
  UpdateTaskVariablesBuilder priority(TaskPriority? t) {
   _priority.value = t;
   return this;
  }
  UpdateTaskVariablesBuilder status(TaskStatus? t) {
   _status.value = t;
   return this;
  }
  UpdateTaskVariablesBuilder dueDate(Timestamp? t) {
   _dueDate.value = t;
   return this;
  }
  UpdateTaskVariablesBuilder progress(int? t) {
   _progress.value = t;
   return this;
  }
  UpdateTaskVariablesBuilder assignedMembers(AnyValue? t) {
   _assignedMembers.value = t;
   return this;
  }
  UpdateTaskVariablesBuilder orderIndex(int? t) {
   _orderIndex.value = t;
   return this;
  }
  UpdateTaskVariablesBuilder commentCount(int? t) {
   _commentCount.value = t;
   return this;
  }
  UpdateTaskVariablesBuilder attachmentCount(int? t) {
   _attachmentCount.value = t;
   return this;
  }
  UpdateTaskVariablesBuilder files(AnyValue? t) {
   _files.value = t;
   return this;
  }

  UpdateTaskVariablesBuilder(this._dataConnect, {required  this.id,});
  Deserializer<UpdateTaskData> dataDeserializer = (dynamic json)  => UpdateTaskData.fromJson(jsonDecode(json));
  Serializer<UpdateTaskVariables> varsSerializer = (UpdateTaskVariables vars) => jsonEncode(vars.toJson());
  Future<OperationResult<UpdateTaskData, UpdateTaskVariables>> execute() {
    return ref().execute();
  }

  MutationRef<UpdateTaskData, UpdateTaskVariables> ref() {
    UpdateTaskVariables vars= UpdateTaskVariables(id: id,taskName: _taskName,description: _description,priority: _priority,status: _status,dueDate: _dueDate,progress: _progress,assignedMembers: _assignedMembers,orderIndex: _orderIndex,commentCount: _commentCount,attachmentCount: _attachmentCount,files: _files,);
    return _dataConnect.mutation("updateTask", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class UpdateTaskTaskUpdate {
  final String id;
  UpdateTaskTaskUpdate.fromJson(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 UpdateTaskTaskUpdate otherTyped = other as UpdateTaskTaskUpdate;
    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;
  }

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

@immutable
class UpdateTaskData {
  final UpdateTaskTaskUpdate? task_update;
  UpdateTaskData.fromJson(dynamic json):
  
  task_update = json['task_update'] == null ? null : UpdateTaskTaskUpdate.fromJson(json['task_update']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final UpdateTaskData otherTyped = other as UpdateTaskData;
    return task_update == otherTyped.task_update;
    
  }
  @override
  int get hashCode => task_update.hashCode;
  

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

  UpdateTaskData({
    this.task_update,
  });
}

@immutable
class UpdateTaskVariables {
  final String id;
  late final Optional<String>taskName;
  late final Optional<String>description;
  late final Optional<TaskPriority>priority;
  late final Optional<TaskStatus>status;
  late final Optional<Timestamp>dueDate;
  late final Optional<int>progress;
  late final Optional<AnyValue>assignedMembers;
  late final Optional<int>orderIndex;
  late final Optional<int>commentCount;
  late final Optional<int>attachmentCount;
  late final Optional<AnyValue>files;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  UpdateTaskVariables.fromJson(Map<String, dynamic> json):
  
  id = nativeFromJson<String>(json['id']) {
  
  
  
    taskName = Optional.optional(nativeFromJson, nativeToJson);
    taskName.value = json['taskName'] == null ? null : nativeFromJson<String>(json['taskName']);
  
  
    description = Optional.optional(nativeFromJson, nativeToJson);
    description.value = json['description'] == null ? null : nativeFromJson<String>(json['description']);
  
  
    priority = Optional.optional((data) => TaskPriority.values.byName(data), enumSerializer);
    priority.value = json['priority'] == null ? null : TaskPriority.values.byName(json['priority']);
  
  
    status = Optional.optional((data) => TaskStatus.values.byName(data), enumSerializer);
    status.value = json['status'] == null ? null : TaskStatus.values.byName(json['status']);
  
  
    dueDate = Optional.optional((json) => json['dueDate'] = Timestamp.fromJson(json['dueDate']), defaultSerializer);
    dueDate.value = json['dueDate'] == null ? null : Timestamp.fromJson(json['dueDate']);
  
  
    progress = Optional.optional(nativeFromJson, nativeToJson);
    progress.value = json['progress'] == null ? null : nativeFromJson<int>(json['progress']);
  
  
    assignedMembers = Optional.optional(AnyValue.fromJson, defaultSerializer);
    assignedMembers.value = json['assignedMembers'] == null ? null : AnyValue.fromJson(json['assignedMembers']);
  
  
    orderIndex = Optional.optional(nativeFromJson, nativeToJson);
    orderIndex.value = json['orderIndex'] == null ? null : nativeFromJson<int>(json['orderIndex']);
  
  
    commentCount = Optional.optional(nativeFromJson, nativeToJson);
    commentCount.value = json['commentCount'] == null ? null : nativeFromJson<int>(json['commentCount']);
  
  
    attachmentCount = Optional.optional(nativeFromJson, nativeToJson);
    attachmentCount.value = json['attachmentCount'] == null ? null : nativeFromJson<int>(json['attachmentCount']);
  
  
    files = Optional.optional(AnyValue.fromJson, defaultSerializer);
    files.value = json['files'] == null ? null : AnyValue.fromJson(json['files']);
  
  }
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

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

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    if(taskName.state == OptionalState.set) {
      json['taskName'] = taskName.toJson();
    }
    if(description.state == OptionalState.set) {
      json['description'] = description.toJson();
    }
    if(priority.state == OptionalState.set) {
      json['priority'] = priority.toJson();
    }
    if(status.state == OptionalState.set) {
      json['status'] = status.toJson();
    }
    if(dueDate.state == OptionalState.set) {
      json['dueDate'] = dueDate.toJson();
    }
    if(progress.state == OptionalState.set) {
      json['progress'] = progress.toJson();
    }
    if(assignedMembers.state == OptionalState.set) {
      json['assignedMembers'] = assignedMembers.toJson();
    }
    if(orderIndex.state == OptionalState.set) {
      json['orderIndex'] = orderIndex.toJson();
    }
    if(commentCount.state == OptionalState.set) {
      json['commentCount'] = commentCount.toJson();
    }
    if(attachmentCount.state == OptionalState.set) {
      json['attachmentCount'] = attachmentCount.toJson();
    }
    if(files.state == OptionalState.set) {
      json['files'] = files.toJson();
    }
    return json;
  }

  UpdateTaskVariables({
    required this.id,
    required this.taskName,
    required this.description,
    required this.priority,
    required this.status,
    required this.dueDate,
    required this.progress,
    required this.assignedMembers,
    required this.orderIndex,
    required this.commentCount,
    required this.attachmentCount,
    required this.files,
  });
}

