part of 'generated.dart';

class GetEmergencyContactsByStaffIdVariablesBuilder {
  String staffId;

  final FirebaseDataConnect _dataConnect;
  GetEmergencyContactsByStaffIdVariablesBuilder(this._dataConnect, {required  this.staffId,});
  Deserializer<GetEmergencyContactsByStaffIdData> dataDeserializer = (dynamic json)  => GetEmergencyContactsByStaffIdData.fromJson(jsonDecode(json));
  Serializer<GetEmergencyContactsByStaffIdVariables> varsSerializer = (GetEmergencyContactsByStaffIdVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<GetEmergencyContactsByStaffIdData, GetEmergencyContactsByStaffIdVariables>> execute() {
    return ref().execute();
  }

  QueryRef<GetEmergencyContactsByStaffIdData, GetEmergencyContactsByStaffIdVariables> ref() {
    GetEmergencyContactsByStaffIdVariables vars= GetEmergencyContactsByStaffIdVariables(staffId: staffId,);
    return _dataConnect.query("getEmergencyContactsByStaffId", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class GetEmergencyContactsByStaffIdEmergencyContacts {
  final String id;
  final String name;
  final String phone;
  final EnumValue<RelationshipType> relationship;
  final String staffId;
  final Timestamp? createdAt;
  final Timestamp? updatedAt;
  final String? createdBy;
  GetEmergencyContactsByStaffIdEmergencyContacts.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  name = nativeFromJson<String>(json['name']),
  phone = nativeFromJson<String>(json['phone']),
  relationship = relationshipTypeDeserializer(json['relationship']),
  staffId = nativeFromJson<String>(json['staffId']),
  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 GetEmergencyContactsByStaffIdEmergencyContacts otherTyped = other as GetEmergencyContactsByStaffIdEmergencyContacts;
    return id == otherTyped.id && 
    name == otherTyped.name && 
    phone == otherTyped.phone && 
    relationship == otherTyped.relationship && 
    staffId == otherTyped.staffId && 
    createdAt == otherTyped.createdAt && 
    updatedAt == otherTyped.updatedAt && 
    createdBy == otherTyped.createdBy;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, name.hashCode, phone.hashCode, relationship.hashCode, staffId.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['name'] = nativeToJson<String>(name);
    json['phone'] = nativeToJson<String>(phone);
    json['relationship'] = 
    relationshipTypeSerializer(relationship)
    ;
    json['staffId'] = nativeToJson<String>(staffId);
    if (createdAt != null) {
      json['createdAt'] = createdAt!.toJson();
    }
    if (updatedAt != null) {
      json['updatedAt'] = updatedAt!.toJson();
    }
    if (createdBy != null) {
      json['createdBy'] = nativeToJson<String?>(createdBy);
    }
    return json;
  }

  GetEmergencyContactsByStaffIdEmergencyContacts({
    required this.id,
    required this.name,
    required this.phone,
    required this.relationship,
    required this.staffId,
    this.createdAt,
    this.updatedAt,
    this.createdBy,
  });
}

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

    final GetEmergencyContactsByStaffIdData otherTyped = other as GetEmergencyContactsByStaffIdData;
    return emergencyContacts == otherTyped.emergencyContacts;
    
  }
  @override
  int get hashCode => emergencyContacts.hashCode;
  

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

  GetEmergencyContactsByStaffIdData({
    required this.emergencyContacts,
  });
}

@immutable
class GetEmergencyContactsByStaffIdVariables {
  final String staffId;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  GetEmergencyContactsByStaffIdVariables.fromJson(Map<String, dynamic> json):
  
  staffId = nativeFromJson<String>(json['staffId']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final GetEmergencyContactsByStaffIdVariables otherTyped = other as GetEmergencyContactsByStaffIdVariables;
    return staffId == otherTyped.staffId;
    
  }
  @override
  int get hashCode => staffId.hashCode;
  

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

  GetEmergencyContactsByStaffIdVariables({
    required this.staffId,
  });
}

