part of 'generated.dart';

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

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

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

  QueryRef<ListActivityLogsData, ListActivityLogsVariables> ref() {
    ListActivityLogsVariables vars= ListActivityLogsVariables(offset: _offset,limit: _limit,);
    return _dataConnect.query("listActivityLogs", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

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

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

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

  ListActivityLogsVariables({
    required this.offset,
    required this.limit,
  });
}

