part of 'generated.dart';

class ListStaffRolesVariablesBuilder {
  Optional<int> _offset = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _limit = Optional.optional(nativeFromJson, nativeToJson);

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

  ListStaffRolesVariablesBuilder(this._dataConnect, );
  Deserializer<ListStaffRolesData> dataDeserializer = (dynamic json)  => ListStaffRolesData.fromJson(jsonDecode(json));
  Serializer<ListStaffRolesVariables> varsSerializer = (ListStaffRolesVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<ListStaffRolesData, ListStaffRolesVariables>> execute() {
    return ref().execute();
  }

  QueryRef<ListStaffRolesData, ListStaffRolesVariables> ref() {
    ListStaffRolesVariables vars= ListStaffRolesVariables(offset: _offset,limit: _limit,);
    return _dataConnect.query("listStaffRoles", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class ListStaffRolesStaffRoles {
  final String id;
  final String staffId;
  final String roleId;
  final Timestamp? createdAt;
  final EnumValue<RoleType>? roleType;
  final ListStaffRolesStaffRolesStaff staff;
  final ListStaffRolesStaffRolesRole role;
  ListStaffRolesStaffRoles.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 = ListStaffRolesStaffRolesStaff.fromJson(json['staff']),
  role = ListStaffRolesStaffRolesRole.fromJson(json['role']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListStaffRolesStaffRoles otherTyped = other as ListStaffRolesStaffRoles;
    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;
  }

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

@immutable
class ListStaffRolesStaffRolesStaff {
  final String id;
  final String fullName;
  final String userId;
  final String? email;
  final String? phone;
  ListStaffRolesStaffRolesStaff.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 ListStaffRolesStaffRolesStaff otherTyped = other as ListStaffRolesStaffRolesStaff;
    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;
  }

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

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

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

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

    final ListStaffRolesData otherTyped = other as ListStaffRolesData;
    return staffRoles == otherTyped.staffRoles;
    
  }
  @override
  int get hashCode => staffRoles.hashCode;
  

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

  ListStaffRolesData({
    required this.staffRoles,
  });
}

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

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

  ListStaffRolesVariables({
    required this.offset,
    required this.limit,
  });
}

