part of 'generated.dart';

class GetStaffRoleByKeyVariablesBuilder {
  String staffId;
  String roleId;

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

  QueryRef<GetStaffRoleByKeyData, GetStaffRoleByKeyVariables> ref() {
    GetStaffRoleByKeyVariables vars= GetStaffRoleByKeyVariables(staffId: staffId,roleId: roleId,);
    return _dataConnect.query("getStaffRoleByKey", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class GetStaffRoleByKeyStaffRole {
  final String id;
  final String staffId;
  final String roleId;
  final Timestamp? createdAt;
  final EnumValue<RoleType>? roleType;
  final GetStaffRoleByKeyStaffRoleStaff staff;
  final GetStaffRoleByKeyStaffRoleRole role;
  GetStaffRoleByKeyStaffRole.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  staffId = nativeFromJson<String>(json['staffId']),
  roleId = nativeFromJson<String>(json['roleId']),
  createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']),
  roleType = json['roleType'] == null ? null : roleTypeDeserializer(json['roleType']),
  staff = GetStaffRoleByKeyStaffRoleStaff.fromJson(json['staff']),
  role = GetStaffRoleByKeyStaffRoleRole.fromJson(json['role']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final GetStaffRoleByKeyStaffRole otherTyped = other as GetStaffRoleByKeyStaffRole;
    return id == otherTyped.id && 
    staffId == otherTyped.staffId && 
    roleId == otherTyped.roleId && 
    createdAt == otherTyped.createdAt && 
    roleType == otherTyped.roleType && 
    staff == otherTyped.staff && 
    role == otherTyped.role;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, staffId.hashCode, roleId.hashCode, createdAt.hashCode, roleType.hashCode, staff.hashCode, role.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['staffId'] = nativeToJson<String>(staffId);
    json['roleId'] = nativeToJson<String>(roleId);
    if (createdAt != null) {
      json['createdAt'] = createdAt!.toJson();
    }
    if (roleType != null) {
      json['roleType'] = 
    roleTypeSerializer(roleType!)
    ;
    }
    json['staff'] = staff.toJson();
    json['role'] = role.toJson();
    return json;
  }

  GetStaffRoleByKeyStaffRole({
    required this.id,
    required this.staffId,
    required this.roleId,
    this.createdAt,
    this.roleType,
    required this.staff,
    required this.role,
  });
}

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

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

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

  GetStaffRoleByKeyStaffRoleStaff({
    required this.id,
    required this.fullName,
    required this.userId,
    this.email,
    this.phone,
  });
}

@immutable
class GetStaffRoleByKeyStaffRoleRole {
  final String id;
  final String name;
  final double costPerHour;
  GetStaffRoleByKeyStaffRoleRole.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  name = nativeFromJson<String>(json['name']),
  costPerHour = nativeFromJson<double>(json['costPerHour']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final GetStaffRoleByKeyStaffRoleRole otherTyped = other as GetStaffRoleByKeyStaffRoleRole;
    return id == otherTyped.id && 
    name == otherTyped.name && 
    costPerHour == otherTyped.costPerHour;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, name.hashCode, costPerHour.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['name'] = nativeToJson<String>(name);
    json['costPerHour'] = nativeToJson<double>(costPerHour);
    return json;
  }

  GetStaffRoleByKeyStaffRoleRole({
    required this.id,
    required this.name,
    required this.costPerHour,
  });
}

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

    final GetStaffRoleByKeyData otherTyped = other as GetStaffRoleByKeyData;
    return staffRole == otherTyped.staffRole;
    
  }
  @override
  int get hashCode => staffRole.hashCode;
  

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

  GetStaffRoleByKeyData({
    this.staffRole,
  });
}

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

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

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

  GetStaffRoleByKeyVariables({
    required this.staffId,
    required this.roleId,
  });
}

