part of 'generated.dart';

class FilterActivityLogsVariablesBuilder {
  Optional<String> _userId = Optional.optional(nativeFromJson, nativeToJson);
  Optional<Timestamp> _dateFrom = Optional.optional((json) => json['dateFrom'] = Timestamp.fromJson(json['dateFrom']), defaultSerializer);
  Optional<Timestamp> _dateTo = Optional.optional((json) => json['dateTo'] = Timestamp.fromJson(json['dateTo']), defaultSerializer);
  Optional<bool> _isRead = Optional.optional(nativeFromJson, nativeToJson);
  Optional<ActivityType> _activityType = Optional.optional((data) => ActivityType.values.byName(data), enumSerializer);
  Optional<ActivityIconType> _iconType = Optional.optional((data) => ActivityIconType.values.byName(data), enumSerializer);
  Optional<int> _offset = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _limit = Optional.optional(nativeFromJson, nativeToJson);

  final FirebaseDataConnect _dataConnect;
  FilterActivityLogsVariablesBuilder userId(String? t) {
   _userId.value = t;
   return this;
  }
  FilterActivityLogsVariablesBuilder dateFrom(Timestamp? t) {
   _dateFrom.value = t;
   return this;
  }
  FilterActivityLogsVariablesBuilder dateTo(Timestamp? t) {
   _dateTo.value = t;
   return this;
  }
  FilterActivityLogsVariablesBuilder isRead(bool? t) {
   _isRead.value = t;
   return this;
  }
  FilterActivityLogsVariablesBuilder activityType(ActivityType? t) {
   _activityType.value = t;
   return this;
  }
  FilterActivityLogsVariablesBuilder iconType(ActivityIconType? t) {
   _iconType.value = t;
   return this;
  }
  FilterActivityLogsVariablesBuilder offset(int? t) {
   _offset.value = t;
   return this;
  }
  FilterActivityLogsVariablesBuilder limit(int? t) {
   _limit.value = t;
   return this;
  }

  FilterActivityLogsVariablesBuilder(this._dataConnect, );
  Deserializer<FilterActivityLogsData> dataDeserializer = (dynamic json)  => FilterActivityLogsData.fromJson(jsonDecode(json));
  Serializer<FilterActivityLogsVariables> varsSerializer = (FilterActivityLogsVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<FilterActivityLogsData, FilterActivityLogsVariables>> execute() {
    return ref().execute();
  }

  QueryRef<FilterActivityLogsData, FilterActivityLogsVariables> ref() {
    FilterActivityLogsVariables vars= FilterActivityLogsVariables(userId: _userId,dateFrom: _dateFrom,dateTo: _dateTo,isRead: _isRead,activityType: _activityType,iconType: _iconType,offset: _offset,limit: _limit,);
    return _dataConnect.query("filterActivityLogs", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class FilterActivityLogsActivityLogs {
  final String id;
  final String userId;
  final Timestamp date;
  final String? hourStart;
  final String? hourEnd;
  final String? totalhours;
  final EnumValue<ActivityIconType>? iconType;
  final String? iconColor;
  final String title;
  final String description;
  final bool? isRead;
  final EnumValue<ActivityType> activityType;
  final Timestamp? createdAt;
  final Timestamp? updatedAt;
  final String? createdBy;
  FilterActivityLogsActivityLogs.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  userId = nativeFromJson<String>(json['userId']),
  date = Timestamp.fromJson(json['date']),
  hourStart = json['hourStart'] == null ? null : nativeFromJson<String>(json['hourStart']),
  hourEnd = json['hourEnd'] == null ? null : nativeFromJson<String>(json['hourEnd']),
  totalhours = json['totalhours'] == null ? null : nativeFromJson<String>(json['totalhours']),
  iconType = json['iconType'] == null ? null : activityIconTypeDeserializer(json['iconType']),
  iconColor = json['iconColor'] == null ? null : nativeFromJson<String>(json['iconColor']),
  title = nativeFromJson<String>(json['title']),
  description = nativeFromJson<String>(json['description']),
  isRead = json['isRead'] == null ? null : nativeFromJson<bool>(json['isRead']),
  activityType = activityTypeDeserializer(json['activityType']),
  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 FilterActivityLogsActivityLogs otherTyped = other as FilterActivityLogsActivityLogs;
    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 && 
    createdAt == otherTyped.createdAt && 
    updatedAt == otherTyped.updatedAt && 
    createdBy == otherTyped.createdBy;
    
  }
  @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, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['userId'] = nativeToJson<String>(userId);
    json['date'] = date.toJson();
    if (hourStart != null) {
      json['hourStart'] = nativeToJson<String?>(hourStart);
    }
    if (hourEnd != null) {
      json['hourEnd'] = nativeToJson<String?>(hourEnd);
    }
    if (totalhours != null) {
      json['totalhours'] = nativeToJson<String?>(totalhours);
    }
    if (iconType != null) {
      json['iconType'] = 
    activityIconTypeSerializer(iconType!)
    ;
    }
    if (iconColor != null) {
      json['iconColor'] = nativeToJson<String?>(iconColor);
    }
    json['title'] = nativeToJson<String>(title);
    json['description'] = nativeToJson<String>(description);
    if (isRead != null) {
      json['isRead'] = nativeToJson<bool?>(isRead);
    }
    json['activityType'] = 
    activityTypeSerializer(activityType)
    ;
    if (createdAt != null) {
      json['createdAt'] = createdAt!.toJson();
    }
    if (updatedAt != null) {
      json['updatedAt'] = updatedAt!.toJson();
    }
    if (createdBy != null) {
      json['createdBy'] = nativeToJson<String?>(createdBy);
    }
    return json;
  }

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

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

    final FilterActivityLogsData otherTyped = other as FilterActivityLogsData;
    return activityLogs == otherTyped.activityLogs;
    
  }
  @override
  int get hashCode => activityLogs.hashCode;
  

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

  FilterActivityLogsData({
    required this.activityLogs,
  });
}

@immutable
class FilterActivityLogsVariables {
  late final Optional<String>userId;
  late final Optional<Timestamp>dateFrom;
  late final Optional<Timestamp>dateTo;
  late final Optional<bool>isRead;
  late final Optional<ActivityType>activityType;
  late final Optional<ActivityIconType>iconType;
  late final Optional<int>offset;
  late final Optional<int>limit;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  FilterActivityLogsVariables.fromJson(Map<String, dynamic> json) {
  
  
    userId = Optional.optional(nativeFromJson, nativeToJson);
    userId.value = json['userId'] == null ? null : nativeFromJson<String>(json['userId']);
  
  
    dateFrom = Optional.optional((json) => json['dateFrom'] = Timestamp.fromJson(json['dateFrom']), defaultSerializer);
    dateFrom.value = json['dateFrom'] == null ? null : Timestamp.fromJson(json['dateFrom']);
  
  
    dateTo = Optional.optional((json) => json['dateTo'] = Timestamp.fromJson(json['dateTo']), defaultSerializer);
    dateTo.value = json['dateTo'] == null ? null : Timestamp.fromJson(json['dateTo']);
  
  
    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']);
  
  
    iconType = Optional.optional((data) => ActivityIconType.values.byName(data), enumSerializer);
    iconType.value = json['iconType'] == null ? null : ActivityIconType.values.byName(json['iconType']);
  
  
    offset = Optional.optional(nativeFromJson, nativeToJson);
    offset.value = json['offset'] == null ? null : nativeFromJson<int>(json['offset']);
  
  
    limit = Optional.optional(nativeFromJson, nativeToJson);
    limit.value = json['limit'] == null ? null : nativeFromJson<int>(json['limit']);
  
  }
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final FilterActivityLogsVariables otherTyped = other as FilterActivityLogsVariables;
    return userId == otherTyped.userId && 
    dateFrom == otherTyped.dateFrom && 
    dateTo == otherTyped.dateTo && 
    isRead == otherTyped.isRead && 
    activityType == otherTyped.activityType && 
    iconType == otherTyped.iconType && 
    offset == otherTyped.offset && 
    limit == otherTyped.limit;
    
  }
  @override
  int get hashCode => Object.hashAll([userId.hashCode, dateFrom.hashCode, dateTo.hashCode, isRead.hashCode, activityType.hashCode, iconType.hashCode, offset.hashCode, limit.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    if(userId.state == OptionalState.set) {
      json['userId'] = userId.toJson();
    }
    if(dateFrom.state == OptionalState.set) {
      json['dateFrom'] = dateFrom.toJson();
    }
    if(dateTo.state == OptionalState.set) {
      json['dateTo'] = dateTo.toJson();
    }
    if(isRead.state == OptionalState.set) {
      json['isRead'] = isRead.toJson();
    }
    if(activityType.state == OptionalState.set) {
      json['activityType'] = activityType.toJson();
    }
    if(iconType.state == OptionalState.set) {
      json['iconType'] = iconType.toJson();
    }
    if(offset.state == OptionalState.set) {
      json['offset'] = offset.toJson();
    }
    if(limit.state == OptionalState.set) {
      json['limit'] = limit.toJson();
    }
    return json;
  }

  FilterActivityLogsVariables({
    required this.userId,
    required this.dateFrom,
    required this.dateTo,
    required this.isRead,
    required this.activityType,
    required this.iconType,
    required this.offset,
    required this.limit,
  });
}

