part of 'generated.dart';

class ListAcceptedApplicationsByShiftRoleKeyVariablesBuilder {
  String shiftId;
  String roleId;
  Optional<int> _offset = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _limit = Optional.optional(nativeFromJson, nativeToJson);

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

  ListAcceptedApplicationsByShiftRoleKeyVariablesBuilder(this._dataConnect, {required  this.shiftId,required  this.roleId,});
  Deserializer<ListAcceptedApplicationsByShiftRoleKeyData> dataDeserializer = (dynamic json)  => ListAcceptedApplicationsByShiftRoleKeyData.fromJson(jsonDecode(json));
  Serializer<ListAcceptedApplicationsByShiftRoleKeyVariables> varsSerializer = (ListAcceptedApplicationsByShiftRoleKeyVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<ListAcceptedApplicationsByShiftRoleKeyData, ListAcceptedApplicationsByShiftRoleKeyVariables>> execute() {
    return ref().execute();
  }

  QueryRef<ListAcceptedApplicationsByShiftRoleKeyData, ListAcceptedApplicationsByShiftRoleKeyVariables> ref() {
    ListAcceptedApplicationsByShiftRoleKeyVariables vars= ListAcceptedApplicationsByShiftRoleKeyVariables(shiftId: shiftId,roleId: roleId,offset: _offset,limit: _limit,);
    return _dataConnect.query("listAcceptedApplicationsByShiftRoleKey", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class ListAcceptedApplicationsByShiftRoleKeyApplications {
  final String id;
  final Timestamp? checkInTime;
  final Timestamp? checkOutTime;
  final ListAcceptedApplicationsByShiftRoleKeyApplicationsStaff staff;
  ListAcceptedApplicationsByShiftRoleKeyApplications.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  checkInTime = json['checkInTime'] == null ? null : Timestamp.fromJson(json['checkInTime']),
  checkOutTime = json['checkOutTime'] == null ? null : Timestamp.fromJson(json['checkOutTime']),
  staff = ListAcceptedApplicationsByShiftRoleKeyApplicationsStaff.fromJson(json['staff']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListAcceptedApplicationsByShiftRoleKeyApplications otherTyped = other as ListAcceptedApplicationsByShiftRoleKeyApplications;
    return id == otherTyped.id && 
    checkInTime == otherTyped.checkInTime && 
    checkOutTime == otherTyped.checkOutTime && 
    staff == otherTyped.staff;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, checkInTime.hashCode, checkOutTime.hashCode, staff.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    if (checkInTime != null) {
      json['checkInTime'] = checkInTime!.toJson();
    }
    if (checkOutTime != null) {
      json['checkOutTime'] = checkOutTime!.toJson();
    }
    json['staff'] = staff.toJson();
    return json;
  }

  ListAcceptedApplicationsByShiftRoleKeyApplications({
    required this.id,
    this.checkInTime,
    this.checkOutTime,
    required this.staff,
  });
}

@immutable
class ListAcceptedApplicationsByShiftRoleKeyApplicationsStaff {
  final String id;
  final String fullName;
  final String? email;
  final String? phone;
  final String? photoUrl;
  ListAcceptedApplicationsByShiftRoleKeyApplicationsStaff.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  fullName = nativeFromJson<String>(json['fullName']),
  email = json['email'] == null ? null : nativeFromJson<String>(json['email']),
  phone = json['phone'] == null ? null : nativeFromJson<String>(json['phone']),
  photoUrl = json['photoUrl'] == null ? null : nativeFromJson<String>(json['photoUrl']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListAcceptedApplicationsByShiftRoleKeyApplicationsStaff otherTyped = other as ListAcceptedApplicationsByShiftRoleKeyApplicationsStaff;
    return id == otherTyped.id && 
    fullName == otherTyped.fullName && 
    email == otherTyped.email && 
    phone == otherTyped.phone && 
    photoUrl == otherTyped.photoUrl;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, fullName.hashCode, email.hashCode, phone.hashCode, photoUrl.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['fullName'] = nativeToJson<String>(fullName);
    if (email != null) {
      json['email'] = nativeToJson<String?>(email);
    }
    if (phone != null) {
      json['phone'] = nativeToJson<String?>(phone);
    }
    if (photoUrl != null) {
      json['photoUrl'] = nativeToJson<String?>(photoUrl);
    }
    return json;
  }

  ListAcceptedApplicationsByShiftRoleKeyApplicationsStaff({
    required this.id,
    required this.fullName,
    this.email,
    this.phone,
    this.photoUrl,
  });
}

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

    final ListAcceptedApplicationsByShiftRoleKeyData otherTyped = other as ListAcceptedApplicationsByShiftRoleKeyData;
    return applications == otherTyped.applications;
    
  }
  @override
  int get hashCode => applications.hashCode;
  

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

  ListAcceptedApplicationsByShiftRoleKeyData({
    required this.applications,
  });
}

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

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

  ListAcceptedApplicationsByShiftRoleKeyVariables({
    required this.shiftId,
    required this.roleId,
    required this.offset,
    required this.limit,
  });
}

