part of 'generated.dart';

class UpdateStaffCourseVariablesBuilder {
  String id;
  Optional<int> _progressPercent = Optional.optional(nativeFromJson, nativeToJson);
  Optional<bool> _completed = Optional.optional(nativeFromJson, nativeToJson);
  Optional<Timestamp> _completedAt = Optional.optional((json) => json['completedAt'] = Timestamp.fromJson(json['completedAt']), defaultSerializer);
  Optional<Timestamp> _startedAt = Optional.optional((json) => json['startedAt'] = Timestamp.fromJson(json['startedAt']), defaultSerializer);
  Optional<Timestamp> _lastAccessedAt = Optional.optional((json) => json['lastAccessedAt'] = Timestamp.fromJson(json['lastAccessedAt']), defaultSerializer);

  final FirebaseDataConnect _dataConnect;  UpdateStaffCourseVariablesBuilder progressPercent(int? t) {
   _progressPercent.value = t;
   return this;
  }
  UpdateStaffCourseVariablesBuilder completed(bool? t) {
   _completed.value = t;
   return this;
  }
  UpdateStaffCourseVariablesBuilder completedAt(Timestamp? t) {
   _completedAt.value = t;
   return this;
  }
  UpdateStaffCourseVariablesBuilder startedAt(Timestamp? t) {
   _startedAt.value = t;
   return this;
  }
  UpdateStaffCourseVariablesBuilder lastAccessedAt(Timestamp? t) {
   _lastAccessedAt.value = t;
   return this;
  }

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

  MutationRef<UpdateStaffCourseData, UpdateStaffCourseVariables> ref() {
    UpdateStaffCourseVariables vars= UpdateStaffCourseVariables(id: id,progressPercent: _progressPercent,completed: _completed,completedAt: _completedAt,startedAt: _startedAt,lastAccessedAt: _lastAccessedAt,);
    return _dataConnect.mutation("updateStaffCourse", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

    final UpdateStaffCourseData otherTyped = other as UpdateStaffCourseData;
    return staffCourse_update == otherTyped.staffCourse_update;
    
  }
  @override
  int get hashCode => staffCourse_update.hashCode;
  

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

  UpdateStaffCourseData({
    this.staffCourse_update,
  });
}

@immutable
class UpdateStaffCourseVariables {
  final String id;
  late final Optional<int>progressPercent;
  late final Optional<bool>completed;
  late final Optional<Timestamp>completedAt;
  late final Optional<Timestamp>startedAt;
  late final Optional<Timestamp>lastAccessedAt;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  UpdateStaffCourseVariables.fromJson(Map<String, dynamic> json):
  
  id = nativeFromJson<String>(json['id']) {
  
  
  
    progressPercent = Optional.optional(nativeFromJson, nativeToJson);
    progressPercent.value = json['progressPercent'] == null ? null : nativeFromJson<int>(json['progressPercent']);
  
  
    completed = Optional.optional(nativeFromJson, nativeToJson);
    completed.value = json['completed'] == null ? null : nativeFromJson<bool>(json['completed']);
  
  
    completedAt = Optional.optional((json) => json['completedAt'] = Timestamp.fromJson(json['completedAt']), defaultSerializer);
    completedAt.value = json['completedAt'] == null ? null : Timestamp.fromJson(json['completedAt']);
  
  
    startedAt = Optional.optional((json) => json['startedAt'] = Timestamp.fromJson(json['startedAt']), defaultSerializer);
    startedAt.value = json['startedAt'] == null ? null : Timestamp.fromJson(json['startedAt']);
  
  
    lastAccessedAt = Optional.optional((json) => json['lastAccessedAt'] = Timestamp.fromJson(json['lastAccessedAt']), defaultSerializer);
    lastAccessedAt.value = json['lastAccessedAt'] == null ? null : Timestamp.fromJson(json['lastAccessedAt']);
  
  }
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final UpdateStaffCourseVariables otherTyped = other as UpdateStaffCourseVariables;
    return id == otherTyped.id && 
    progressPercent == otherTyped.progressPercent && 
    completed == otherTyped.completed && 
    completedAt == otherTyped.completedAt && 
    startedAt == otherTyped.startedAt && 
    lastAccessedAt == otherTyped.lastAccessedAt;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, progressPercent.hashCode, completed.hashCode, completedAt.hashCode, startedAt.hashCode, lastAccessedAt.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    if(progressPercent.state == OptionalState.set) {
      json['progressPercent'] = progressPercent.toJson();
    }
    if(completed.state == OptionalState.set) {
      json['completed'] = completed.toJson();
    }
    if(completedAt.state == OptionalState.set) {
      json['completedAt'] = completedAt.toJson();
    }
    if(startedAt.state == OptionalState.set) {
      json['startedAt'] = startedAt.toJson();
    }
    if(lastAccessedAt.state == OptionalState.set) {
      json['lastAccessedAt'] = lastAccessedAt.toJson();
    }
    return json;
  }

  UpdateStaffCourseVariables({
    required this.id,
    required this.progressPercent,
    required this.completed,
    required this.completedAt,
    required this.startedAt,
    required this.lastAccessedAt,
  });
}

