part of 'generated.dart';

class GetEmergencyContactByIdVariablesBuilder {
  String id;

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

  QueryRef<GetEmergencyContactByIdData, GetEmergencyContactByIdVariables> ref() {
    GetEmergencyContactByIdVariables vars= GetEmergencyContactByIdVariables(id: id,);
    return _dataConnect.query("getEmergencyContactById", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

    final GetEmergencyContactByIdData otherTyped = other as GetEmergencyContactByIdData;
    return emergencyContact == otherTyped.emergencyContact;
    
  }
  @override
  int get hashCode => emergencyContact.hashCode;
  

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

  GetEmergencyContactByIdData({
    this.emergencyContact,
  });
}

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

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

