part of 'generated.dart';

class GetWorkforceByVendorAndNumberVariablesBuilder {
  String vendorId;
  String workforceNumber;

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

  QueryRef<GetWorkforceByVendorAndNumberData, GetWorkforceByVendorAndNumberVariables> ref() {
    GetWorkforceByVendorAndNumberVariables vars= GetWorkforceByVendorAndNumberVariables(vendorId: vendorId,workforceNumber: workforceNumber,);
    return _dataConnect.query("getWorkforceByVendorAndNumber", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class GetWorkforceByVendorAndNumberWorkforces {
  final String id;
  final String staffId;
  final String workforceNumber;
  final EnumValue<WorkforceStatus>? status;
  GetWorkforceByVendorAndNumberWorkforces.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  staffId = nativeFromJson<String>(json['staffId']),
  workforceNumber = nativeFromJson<String>(json['workforceNumber']),
  status = json['status'] == null ? null : workforceStatusDeserializer(json['status']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final GetWorkforceByVendorAndNumberWorkforces otherTyped = other as GetWorkforceByVendorAndNumberWorkforces;
    return id == otherTyped.id && 
    staffId == otherTyped.staffId && 
    workforceNumber == otherTyped.workforceNumber && 
    status == otherTyped.status;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, staffId.hashCode, workforceNumber.hashCode, status.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['staffId'] = nativeToJson<String>(staffId);
    json['workforceNumber'] = nativeToJson<String>(workforceNumber);
    if (status != null) {
      json['status'] = 
    workforceStatusSerializer(status!)
    ;
    }
    return json;
  }

  GetWorkforceByVendorAndNumberWorkforces({
    required this.id,
    required this.staffId,
    required this.workforceNumber,
    this.status,
  });
}

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

    final GetWorkforceByVendorAndNumberData otherTyped = other as GetWorkforceByVendorAndNumberData;
    return workforces == otherTyped.workforces;
    
  }
  @override
  int get hashCode => workforces.hashCode;
  

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

  GetWorkforceByVendorAndNumberData({
    required this.workforces,
  });
}

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

    final GetWorkforceByVendorAndNumberVariables otherTyped = other as GetWorkforceByVendorAndNumberVariables;
    return vendorId == otherTyped.vendorId && 
    workforceNumber == otherTyped.workforceNumber;
    
  }
  @override
  int get hashCode => Object.hashAll([vendorId.hashCode, workforceNumber.hashCode]);
  

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

  GetWorkforceByVendorAndNumberVariables({
    required this.vendorId,
    required this.workforceNumber,
  });
}

