part of 'generated.dart';

class GetRoleByIdVariablesBuilder {
  String id;

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

  QueryRef<GetRoleByIdData, GetRoleByIdVariables> ref() {
    GetRoleByIdVariables vars= GetRoleByIdVariables(id: id,);
    return _dataConnect.query("getRoleById", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class GetRoleByIdRole {
  final String id;
  final String name;
  final double costPerHour;
  final String vendorId;
  final String roleCategoryId;
  final Timestamp? createdAt;
  GetRoleByIdRole.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 GetRoleByIdRole otherTyped = other as GetRoleByIdRole;
    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;
  }

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

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

    final GetRoleByIdData otherTyped = other as GetRoleByIdData;
    return role == otherTyped.role;
    
  }
  @override
  int get hashCode => role.hashCode;
  

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

  GetRoleByIdData({
    this.role,
  });
}

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

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

