part of 'generated.dart';

class ListUnreadActivityLogsByUserIdVariablesBuilder {
  String userId;
  Optional<int> _offset = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _limit = Optional.optional(nativeFromJson, nativeToJson);

  final FirebaseDataConnect _dataConnect;  ListUnreadActivityLogsByUserIdVariablesBuilder offset(int? t) {
   _offset.value = t;
   return this;
  }
  ListUnreadActivityLogsByUserIdVariablesBuilder limit(int? t) {
   _limit.value = t;
   return this;
  }

  ListUnreadActivityLogsByUserIdVariablesBuilder(this._dataConnect, {required  this.userId,});
  Deserializer<ListUnreadActivityLogsByUserIdData> dataDeserializer = (dynamic json)  => ListUnreadActivityLogsByUserIdData.fromJson(jsonDecode(json));
  Serializer<ListUnreadActivityLogsByUserIdVariables> varsSerializer = (ListUnreadActivityLogsByUserIdVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<ListUnreadActivityLogsByUserIdData, ListUnreadActivityLogsByUserIdVariables>> execute() {
    return ref().execute();
  }

  QueryRef<ListUnreadActivityLogsByUserIdData, ListUnreadActivityLogsByUserIdVariables> ref() {
    ListUnreadActivityLogsByUserIdVariables vars= ListUnreadActivityLogsByUserIdVariables(userId: userId,offset: _offset,limit: _limit,);
    return _dataConnect.query("listUnreadActivityLogsByUserId", dataDeserializer, varsSerializer, vars);
  }
}

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

  ListUnreadActivityLogsByUserIdActivityLogs({
    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 ListUnreadActivityLogsByUserIdData {
  final List<ListUnreadActivityLogsByUserIdActivityLogs> activityLogs;
  ListUnreadActivityLogsByUserIdData.fromJson(dynamic json):
  
  activityLogs = (json['activityLogs'] as List<dynamic>)
        .map((e) => ListUnreadActivityLogsByUserIdActivityLogs.fromJson(e))
        .toList();
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListUnreadActivityLogsByUserIdData otherTyped = other as ListUnreadActivityLogsByUserIdData;
    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;
  }

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

@immutable
class ListUnreadActivityLogsByUserIdVariables {
  final String userId;
  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.')
  ListUnreadActivityLogsByUserIdVariables.fromJson(Map<String, dynamic> json):
  
  userId = nativeFromJson<String>(json['userId']) {
  
  
  
    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 ListUnreadActivityLogsByUserIdVariables otherTyped = other as ListUnreadActivityLogsByUserIdVariables;
    return userId == otherTyped.userId && 
    offset == otherTyped.offset && 
    limit == otherTyped.limit;
    
  }
  @override
  int get hashCode => Object.hashAll([userId.hashCode, offset.hashCode, limit.hashCode]);
  

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

  ListUnreadActivityLogsByUserIdVariables({
    required this.userId,
    required this.offset,
    required this.limit,
  });
}

