part of 'generated.dart';

class UpdateActivityLogVariablesBuilder {
  String id;
  Optional<String> _userId = Optional.optional(nativeFromJson, nativeToJson);
  Optional<Timestamp> _date = Optional.optional((json) => json['date'] = Timestamp.fromJson(json['date']), defaultSerializer);
  Optional<String> _hourStart = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _hourEnd = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _totalhours = Optional.optional(nativeFromJson, nativeToJson);
  Optional<ActivityIconType> _iconType = Optional.optional((data) => ActivityIconType.values.byName(data), enumSerializer);
  Optional<String> _iconColor = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _title = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _description = Optional.optional(nativeFromJson, nativeToJson);
  Optional<bool> _isRead = Optional.optional(nativeFromJson, nativeToJson);
  Optional<ActivityType> _activityType = Optional.optional((data) => ActivityType.values.byName(data), enumSerializer);

  final FirebaseDataConnect _dataConnect;  UpdateActivityLogVariablesBuilder userId(String? t) {
   _userId.value = t;
   return this;
  }
  UpdateActivityLogVariablesBuilder date(Timestamp? t) {
   _date.value = t;
   return this;
  }
  UpdateActivityLogVariablesBuilder hourStart(String? t) {
   _hourStart.value = t;
   return this;
  }
  UpdateActivityLogVariablesBuilder hourEnd(String? t) {
   _hourEnd.value = t;
   return this;
  }
  UpdateActivityLogVariablesBuilder totalhours(String? t) {
   _totalhours.value = t;
   return this;
  }
  UpdateActivityLogVariablesBuilder iconType(ActivityIconType? t) {
   _iconType.value = t;
   return this;
  }
  UpdateActivityLogVariablesBuilder iconColor(String? t) {
   _iconColor.value = t;
   return this;
  }
  UpdateActivityLogVariablesBuilder title(String? t) {
   _title.value = t;
   return this;
  }
  UpdateActivityLogVariablesBuilder description(String? t) {
   _description.value = t;
   return this;
  }
  UpdateActivityLogVariablesBuilder isRead(bool? t) {
   _isRead.value = t;
   return this;
  }
  UpdateActivityLogVariablesBuilder activityType(ActivityType? t) {
   _activityType.value = t;
   return this;
  }

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

  MutationRef<UpdateActivityLogData, UpdateActivityLogVariables> ref() {
    UpdateActivityLogVariables vars= UpdateActivityLogVariables(id: id,userId: _userId,date: _date,hourStart: _hourStart,hourEnd: _hourEnd,totalhours: _totalhours,iconType: _iconType,iconColor: _iconColor,title: _title,description: _description,isRead: _isRead,activityType: _activityType,);
    return _dataConnect.mutation("updateActivityLog", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

    final UpdateActivityLogData otherTyped = other as UpdateActivityLogData;
    return activityLog_update == otherTyped.activityLog_update;
    
  }
  @override
  int get hashCode => activityLog_update.hashCode;
  

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

  UpdateActivityLogData({
    this.activityLog_update,
  });
}

@immutable
class UpdateActivityLogVariables {
  final String id;
  late final Optional<String>userId;
  late final Optional<Timestamp>date;
  late final Optional<String>hourStart;
  late final Optional<String>hourEnd;
  late final Optional<String>totalhours;
  late final Optional<ActivityIconType>iconType;
  late final Optional<String>iconColor;
  late final Optional<String>title;
  late final Optional<String>description;
  late final Optional<bool>isRead;
  late final Optional<ActivityType>activityType;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  UpdateActivityLogVariables.fromJson(Map<String, dynamic> json):
  
  id = nativeFromJson<String>(json['id']) {
  
  
  
    userId = Optional.optional(nativeFromJson, nativeToJson);
    userId.value = json['userId'] == null ? null : nativeFromJson<String>(json['userId']);
  
  
    date = Optional.optional((json) => json['date'] = Timestamp.fromJson(json['date']), defaultSerializer);
    date.value = json['date'] == null ? null : Timestamp.fromJson(json['date']);
  
  
    hourStart = Optional.optional(nativeFromJson, nativeToJson);
    hourStart.value = json['hourStart'] == null ? null : nativeFromJson<String>(json['hourStart']);
  
  
    hourEnd = Optional.optional(nativeFromJson, nativeToJson);
    hourEnd.value = json['hourEnd'] == null ? null : nativeFromJson<String>(json['hourEnd']);
  
  
    totalhours = Optional.optional(nativeFromJson, nativeToJson);
    totalhours.value = json['totalhours'] == null ? null : nativeFromJson<String>(json['totalhours']);
  
  
    iconType = Optional.optional((data) => ActivityIconType.values.byName(data), enumSerializer);
    iconType.value = json['iconType'] == null ? null : ActivityIconType.values.byName(json['iconType']);
  
  
    iconColor = Optional.optional(nativeFromJson, nativeToJson);
    iconColor.value = json['iconColor'] == null ? null : nativeFromJson<String>(json['iconColor']);
  
  
    title = Optional.optional(nativeFromJson, nativeToJson);
    title.value = json['title'] == null ? null : nativeFromJson<String>(json['title']);
  
  
    description = Optional.optional(nativeFromJson, nativeToJson);
    description.value = json['description'] == null ? null : nativeFromJson<String>(json['description']);
  
  
    isRead = Optional.optional(nativeFromJson, nativeToJson);
    isRead.value = json['isRead'] == null ? null : nativeFromJson<bool>(json['isRead']);
  
  
    activityType = Optional.optional((data) => ActivityType.values.byName(data), enumSerializer);
    activityType.value = json['activityType'] == null ? null : ActivityType.values.byName(json['activityType']);
  
  }
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final UpdateActivityLogVariables otherTyped = other as UpdateActivityLogVariables;
    return id == otherTyped.id && 
    userId == otherTyped.userId && 
    date == otherTyped.date && 
    hourStart == otherTyped.hourStart && 
    hourEnd == otherTyped.hourEnd && 
    totalhours == otherTyped.totalhours && 
    iconType == otherTyped.iconType && 
    iconColor == otherTyped.iconColor && 
    title == otherTyped.title && 
    description == otherTyped.description && 
    isRead == otherTyped.isRead && 
    activityType == otherTyped.activityType;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, userId.hashCode, date.hashCode, hourStart.hashCode, hourEnd.hashCode, totalhours.hashCode, iconType.hashCode, iconColor.hashCode, title.hashCode, description.hashCode, isRead.hashCode, activityType.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    if(userId.state == OptionalState.set) {
      json['userId'] = userId.toJson();
    }
    if(date.state == OptionalState.set) {
      json['date'] = date.toJson();
    }
    if(hourStart.state == OptionalState.set) {
      json['hourStart'] = hourStart.toJson();
    }
    if(hourEnd.state == OptionalState.set) {
      json['hourEnd'] = hourEnd.toJson();
    }
    if(totalhours.state == OptionalState.set) {
      json['totalhours'] = totalhours.toJson();
    }
    if(iconType.state == OptionalState.set) {
      json['iconType'] = iconType.toJson();
    }
    if(iconColor.state == OptionalState.set) {
      json['iconColor'] = iconColor.toJson();
    }
    if(title.state == OptionalState.set) {
      json['title'] = title.toJson();
    }
    if(description.state == OptionalState.set) {
      json['description'] = description.toJson();
    }
    if(isRead.state == OptionalState.set) {
      json['isRead'] = isRead.toJson();
    }
    if(activityType.state == OptionalState.set) {
      json['activityType'] = activityType.toJson();
    }
    return json;
  }

  UpdateActivityLogVariables({
    required this.id,
    required this.userId,
    required this.date,
    required this.hourStart,
    required this.hourEnd,
    required this.totalhours,
    required this.iconType,
    required this.iconColor,
    required this.title,
    required this.description,
    required this.isRead,
    required this.activityType,
  });
}

