part of 'generated.dart';

class GetRoleCategoryByIdVariablesBuilder {
  String id;

  final FirebaseDataConnect _dataConnect;
  GetRoleCategoryByIdVariablesBuilder(this._dataConnect, {required  this.id,});
  Deserializer<GetRoleCategoryByIdData> dataDeserializer = (dynamic json)  => GetRoleCategoryByIdData.fromJson(jsonDecode(json));
  Serializer<GetRoleCategoryByIdVariables> varsSerializer = (GetRoleCategoryByIdVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<GetRoleCategoryByIdData, GetRoleCategoryByIdVariables>> execute() {
    return ref().execute();
  }

  QueryRef<GetRoleCategoryByIdData, GetRoleCategoryByIdVariables> ref() {
    GetRoleCategoryByIdVariables vars= GetRoleCategoryByIdVariables(id: id,);
    return _dataConnect.query("getRoleCategoryById", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class GetRoleCategoryByIdRoleCategory {
  final String id;
  final String roleName;
  final EnumValue<RoleCategoryType> category;
  final Timestamp? createdAt;
  final Timestamp? updatedAt;
  GetRoleCategoryByIdRoleCategory.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  roleName = nativeFromJson<String>(json['roleName']),
  category = roleCategoryTypeDeserializer(json['category']),
  createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']),
  updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final GetRoleCategoryByIdRoleCategory otherTyped = other as GetRoleCategoryByIdRoleCategory;
    return id == otherTyped.id && 
    roleName == otherTyped.roleName && 
    category == otherTyped.category && 
    createdAt == otherTyped.createdAt && 
    updatedAt == otherTyped.updatedAt;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, roleName.hashCode, category.hashCode, createdAt.hashCode, updatedAt.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['roleName'] = nativeToJson<String>(roleName);
    json['category'] = 
    roleCategoryTypeSerializer(category)
    ;
    if (createdAt != null) {
      json['createdAt'] = createdAt!.toJson();
    }
    if (updatedAt != null) {
      json['updatedAt'] = updatedAt!.toJson();
    }
    return json;
  }

  GetRoleCategoryByIdRoleCategory({
    required this.id,
    required this.roleName,
    required this.category,
    this.createdAt,
    this.updatedAt,
  });
}

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

    final GetRoleCategoryByIdData otherTyped = other as GetRoleCategoryByIdData;
    return roleCategory == otherTyped.roleCategory;
    
  }
  @override
  int get hashCode => roleCategory.hashCode;
  

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

  GetRoleCategoryByIdData({
    this.roleCategory,
  });
}

@immutable
class GetRoleCategoryByIdVariables {
  final String id;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  GetRoleCategoryByIdVariables.fromJson(Map<String, 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 GetRoleCategoryByIdVariables otherTyped = other as GetRoleCategoryByIdVariables;
    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;
  }

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

