part of 'generated.dart';

class CreateEmergencyContactVariablesBuilder {
  String name;
  String phone;
  RelationshipType relationship;
  String staffId;

  final FirebaseDataConnect _dataConnect;
  CreateEmergencyContactVariablesBuilder(this._dataConnect, {required  this.name,required  this.phone,required  this.relationship,required  this.staffId,});
  Deserializer<CreateEmergencyContactData> dataDeserializer = (dynamic json)  => CreateEmergencyContactData.fromJson(jsonDecode(json));
  Serializer<CreateEmergencyContactVariables> varsSerializer = (CreateEmergencyContactVariables vars) => jsonEncode(vars.toJson());
  Future<OperationResult<CreateEmergencyContactData, CreateEmergencyContactVariables>> execute() {
    return ref().execute();
  }

  MutationRef<CreateEmergencyContactData, CreateEmergencyContactVariables> ref() {
    CreateEmergencyContactVariables vars= CreateEmergencyContactVariables(name: name,phone: phone,relationship: relationship,staffId: staffId,);
    return _dataConnect.mutation("createEmergencyContact", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

    final CreateEmergencyContactData otherTyped = other as CreateEmergencyContactData;
    return emergencyContact_insert == otherTyped.emergencyContact_insert;
    
  }
  @override
  int get hashCode => emergencyContact_insert.hashCode;
  

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

  CreateEmergencyContactData({
    required this.emergencyContact_insert,
  });
}

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

    final CreateEmergencyContactVariables otherTyped = other as CreateEmergencyContactVariables;
    return name == otherTyped.name && 
    phone == otherTyped.phone && 
    relationship == otherTyped.relationship && 
    staffId == otherTyped.staffId;
    
  }
  @override
  int get hashCode => Object.hashAll([name.hashCode, phone.hashCode, relationship.hashCode, staffId.hashCode]);
  

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

  CreateEmergencyContactVariables({
    required this.name,
    required this.phone,
    required this.relationship,
    required this.staffId,
  });
}

