part of 'generated.dart';

class CreateActivityLogVariablesBuilder {
  String userId;
  Timestamp date;
  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);
  String title;
  String description;
  Optional<bool> _isRead = Optional.optional(nativeFromJson, nativeToJson);
  ActivityType activityType;

  final FirebaseDataConnect _dataConnect;  CreateActivityLogVariablesBuilder hourStart(String? t) {
   _hourStart.value = t;
   return this;
  }
  CreateActivityLogVariablesBuilder hourEnd(String? t) {
   _hourEnd.value = t;
   return this;
  }
  CreateActivityLogVariablesBuilder totalhours(String? t) {
   _totalhours.value = t;
   return this;
  }
  CreateActivityLogVariablesBuilder iconType(ActivityIconType? t) {
   _iconType.value = t;
   return this;
  }
  CreateActivityLogVariablesBuilder iconColor(String? t) {
   _iconColor.value = t;
   return this;
  }
  CreateActivityLogVariablesBuilder isRead(bool? t) {
   _isRead.value = t;
   return this;
  }

  CreateActivityLogVariablesBuilder(this._dataConnect, {required  this.userId,required  this.date,required  this.title,required  this.description,required  this.activityType,});
  Deserializer<CreateActivityLogData> dataDeserializer = (dynamic json)  => CreateActivityLogData.fromJson(jsonDecode(json));
  Serializer<CreateActivityLogVariables> varsSerializer = (CreateActivityLogVariables vars) => jsonEncode(vars.toJson());
  Future<OperationResult<CreateActivityLogData, CreateActivityLogVariables>> execute() {
    return ref().execute();
  }

  MutationRef<CreateActivityLogData, CreateActivityLogVariables> ref() {
    CreateActivityLogVariables vars= CreateActivityLogVariables(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("createActivityLog", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

    final CreateActivityLogData otherTyped = other as CreateActivityLogData;
    return activityLog_insert == otherTyped.activityLog_insert;
    
  }
  @override
  int get hashCode => activityLog_insert.hashCode;
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['activityLog_insert'] = activityLog_insert.toJson();
    return json;
  }

  CreateActivityLogData({
    required this.activityLog_insert,
  });
}

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

    final CreateActivityLogVariables otherTyped = other as CreateActivityLogVariables;
    return 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([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['userId'] = nativeToJson<String>(userId);
    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();
    }
    json['title'] = nativeToJson<String>(title);
    json['description'] = nativeToJson<String>(description);
    if(isRead.state == OptionalState.set) {
      json['isRead'] = isRead.toJson();
    }
    json['activityType'] = 
    activityType.name
    ;
    return json;
  }

  CreateActivityLogVariables({
    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,
  });
}

