part of 'generated.dart';

class ListRolesByVendorIdVariablesBuilder {
  String vendorId;

  final FirebaseDataConnect _dataConnect;
  ListRolesByVendorIdVariablesBuilder(this._dataConnect, {required  this.vendorId,});
  Deserializer<ListRolesByVendorIdData> dataDeserializer = (dynamic json)  => ListRolesByVendorIdData.fromJson(jsonDecode(json));
  Serializer<ListRolesByVendorIdVariables> varsSerializer = (ListRolesByVendorIdVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<ListRolesByVendorIdData, ListRolesByVendorIdVariables>> execute() {
    return ref().execute();
  }

  QueryRef<ListRolesByVendorIdData, ListRolesByVendorIdVariables> ref() {
    ListRolesByVendorIdVariables vars= ListRolesByVendorIdVariables(vendorId: vendorId,);
    return _dataConnect.query("listRolesByVendorId", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

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

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

@immutable
class ListRolesByVendorIdVariables {
  final String vendorId;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  ListRolesByVendorIdVariables.fromJson(Map<String, dynamic> json):
  
  vendorId = nativeFromJson<String>(json['vendorId']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListRolesByVendorIdVariables otherTyped = other as ListRolesByVendorIdVariables;
    return vendorId == otherTyped.vendorId;
    
  }
  @override
  int get hashCode => vendorId.hashCode;
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['vendorId'] = nativeToJson<String>(vendorId);
    return json;
  }

  ListRolesByVendorIdVariables({
    required this.vendorId,
  });
}

