part of 'generated.dart';

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

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

@immutable
class ListUsersUsers {
  final String id;
  final String? email;
  final String? fullName;
  final EnumValue<UserBaseRole> role;
  final String? userRole;
  final String? photoUrl;
  final Timestamp? createdDate;
  final Timestamp? updatedDate;
  ListUsersUsers.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  email = json['email'] == null ? null : nativeFromJson<String>(json['email']),
  fullName = json['fullName'] == null ? null : nativeFromJson<String>(json['fullName']),
  role = userBaseRoleDeserializer(json['role']),
  userRole = json['userRole'] == null ? null : nativeFromJson<String>(json['userRole']),
  photoUrl = json['photoUrl'] == null ? null : nativeFromJson<String>(json['photoUrl']),
  createdDate = json['createdDate'] == null ? null : Timestamp.fromJson(json['createdDate']),
  updatedDate = json['updatedDate'] == null ? null : Timestamp.fromJson(json['updatedDate']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListUsersUsers otherTyped = other as ListUsersUsers;
    return id == otherTyped.id && 
    email == otherTyped.email && 
    fullName == otherTyped.fullName && 
    role == otherTyped.role && 
    userRole == otherTyped.userRole && 
    photoUrl == otherTyped.photoUrl && 
    createdDate == otherTyped.createdDate && 
    updatedDate == otherTyped.updatedDate;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, email.hashCode, fullName.hashCode, role.hashCode, userRole.hashCode, photoUrl.hashCode, createdDate.hashCode, updatedDate.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    if (email != null) {
      json['email'] = nativeToJson<String?>(email);
    }
    if (fullName != null) {
      json['fullName'] = nativeToJson<String?>(fullName);
    }
    json['role'] = 
    userBaseRoleSerializer(role)
    ;
    if (userRole != null) {
      json['userRole'] = nativeToJson<String?>(userRole);
    }
    if (photoUrl != null) {
      json['photoUrl'] = nativeToJson<String?>(photoUrl);
    }
    if (createdDate != null) {
      json['createdDate'] = createdDate!.toJson();
    }
    if (updatedDate != null) {
      json['updatedDate'] = updatedDate!.toJson();
    }
    return json;
  }

  ListUsersUsers({
    required this.id,
    this.email,
    this.fullName,
    required this.role,
    this.userRole,
    this.photoUrl,
    this.createdDate,
    this.updatedDate,
  });
}

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

    final ListUsersData otherTyped = other as ListUsersData;
    return users == otherTyped.users;
    
  }
  @override
  int get hashCode => users.hashCode;
  

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

  ListUsersData({
    required this.users,
  });
}

