part of 'generated.dart';

class GetActivityLogByIdVariablesBuilder {
  String id;

  final FirebaseDataConnect _dataConnect;
  GetActivityLogByIdVariablesBuilder(this._dataConnect, {required  this.id,});
  Deserializer<GetActivityLogByIdData> dataDeserializer = (dynamic json)  => GetActivityLogByIdData.fromJson(jsonDecode(json));
  Serializer<GetActivityLogByIdVariables> varsSerializer = (GetActivityLogByIdVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<GetActivityLogByIdData, GetActivityLogByIdVariables>> execute() {
    return ref().execute();
  }

  QueryRef<GetActivityLogByIdData, GetActivityLogByIdVariables> ref() {
    GetActivityLogByIdVariables vars= GetActivityLogByIdVariables(id: id,);
    return _dataConnect.query("getActivityLogById", dataDeserializer, varsSerializer, vars);
  }
}

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

  GetActivityLogByIdActivityLog({
    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 GetActivityLogByIdData {
  final GetActivityLogByIdActivityLog? activityLog;
  GetActivityLogByIdData.fromJson(dynamic json):
  
  activityLog = json['activityLog'] == null ? null : GetActivityLogByIdActivityLog.fromJson(json['activityLog']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final GetActivityLogByIdData otherTyped = other as GetActivityLogByIdData;
    return activityLog == otherTyped.activityLog;
    
  }
  @override
  int get hashCode => activityLog.hashCode;
  

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

  GetActivityLogByIdData({
    this.activityLog,
  });
}

@immutable
class GetActivityLogByIdVariables {
  final String id;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  GetActivityLogByIdVariables.fromJson(Map<String, 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 GetActivityLogByIdVariables otherTyped = other as GetActivityLogByIdVariables;
    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;
  }

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

