part of 'generated.dart';

class ListRolesVariablesBuilder {
  
  final FirebaseDataConnect _dataConnect;
  ListRolesVariablesBuilder(this._dataConnect, );
  Deserializer<ListRolesData> dataDeserializer = (dynamic json)  => ListRolesData.fromJson(jsonDecode(json));
  
  Future<QueryResult<ListRolesData, void>> execute() {
    return ref().execute();
  }

  QueryRef<ListRolesData, void> ref() {
    
    return _dataConnect.query("listRoles", dataDeserializer, emptySerializer, null);
  }
}

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

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

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['name'] = nativeToJson<String>(name);
    json['costPerHour'] = nativeToJson<double>(costPerHour);
    json['vendorId'] = nativeToJson<String>(vendorId);
    json['roleCategoryId'] = nativeToJson<String>(roleCategoryId);
    if (createdAt != null) {
      json['createdAt'] = createdAt!.toJson();
    }
    return json;
  }

  ListRolesRoles({
    required this.id,
    required this.name,
    required this.costPerHour,
    required this.vendorId,
    required this.roleCategoryId,
    this.createdAt,
  });
}

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

    final ListRolesData otherTyped = other as ListRolesData;
    return roles == otherTyped.roles;
    
  }
  @override
  int get hashCode => roles.hashCode;
  

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

  ListRolesData({
    required this.roles,
  });
}

