part of 'generated.dart';

class GetWorkforceByIdVariablesBuilder {
  String id;

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

  QueryRef<GetWorkforceByIdData, GetWorkforceByIdVariables> ref() {
    GetWorkforceByIdVariables vars= GetWorkforceByIdVariables(id: id,);
    return _dataConnect.query("getWorkforceById", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class GetWorkforceByIdWorkforce {
  final String id;
  final String vendorId;
  final String staffId;
  final String workforceNumber;
  final EnumValue<WorkforceEmploymentType>? employmentType;
  final EnumValue<WorkforceStatus>? status;
  final Timestamp? createdAt;
  final Timestamp? updatedAt;
  final GetWorkforceByIdWorkforceStaff staff;
  final GetWorkforceByIdWorkforceVendor vendor;
  GetWorkforceByIdWorkforce.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  vendorId = nativeFromJson<String>(json['vendorId']),
  staffId = nativeFromJson<String>(json['staffId']),
  workforceNumber = nativeFromJson<String>(json['workforceNumber']),
  employmentType = json['employmentType'] == null ? null : workforceEmploymentTypeDeserializer(json['employmentType']),
  status = json['status'] == null ? null : workforceStatusDeserializer(json['status']),
  createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']),
  updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']),
  staff = GetWorkforceByIdWorkforceStaff.fromJson(json['staff']),
  vendor = GetWorkforceByIdWorkforceVendor.fromJson(json['vendor']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final GetWorkforceByIdWorkforce otherTyped = other as GetWorkforceByIdWorkforce;
    return id == otherTyped.id && 
    vendorId == otherTyped.vendorId && 
    staffId == otherTyped.staffId && 
    workforceNumber == otherTyped.workforceNumber && 
    employmentType == otherTyped.employmentType && 
    status == otherTyped.status && 
    createdAt == otherTyped.createdAt && 
    updatedAt == otherTyped.updatedAt && 
    staff == otherTyped.staff && 
    vendor == otherTyped.vendor;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, vendorId.hashCode, staffId.hashCode, workforceNumber.hashCode, employmentType.hashCode, status.hashCode, createdAt.hashCode, updatedAt.hashCode, staff.hashCode, vendor.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['vendorId'] = nativeToJson<String>(vendorId);
    json['staffId'] = nativeToJson<String>(staffId);
    json['workforceNumber'] = nativeToJson<String>(workforceNumber);
    if (employmentType != null) {
      json['employmentType'] = 
    workforceEmploymentTypeSerializer(employmentType!)
    ;
    }
    if (status != null) {
      json['status'] = 
    workforceStatusSerializer(status!)
    ;
    }
    if (createdAt != null) {
      json['createdAt'] = createdAt!.toJson();
    }
    if (updatedAt != null) {
      json['updatedAt'] = updatedAt!.toJson();
    }
    json['staff'] = staff.toJson();
    json['vendor'] = vendor.toJson();
    return json;
  }

  GetWorkforceByIdWorkforce({
    required this.id,
    required this.vendorId,
    required this.staffId,
    required this.workforceNumber,
    this.employmentType,
    this.status,
    this.createdAt,
    this.updatedAt,
    required this.staff,
    required this.vendor,
  });
}

@immutable
class GetWorkforceByIdWorkforceStaff {
  final String id;
  final String fullName;
  GetWorkforceByIdWorkforceStaff.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  fullName = nativeFromJson<String>(json['fullName']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

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

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

  GetWorkforceByIdWorkforceStaff({
    required this.id,
    required this.fullName,
  });
}

@immutable
class GetWorkforceByIdWorkforceVendor {
  final String id;
  final String companyName;
  GetWorkforceByIdWorkforceVendor.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  companyName = nativeFromJson<String>(json['companyName']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

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

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

  GetWorkforceByIdWorkforceVendor({
    required this.id,
    required this.companyName,
  });
}

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

    final GetWorkforceByIdData otherTyped = other as GetWorkforceByIdData;
    return workforce == otherTyped.workforce;
    
  }
  @override
  int get hashCode => workforce.hashCode;
  

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

  GetWorkforceByIdData({
    this.workforce,
  });
}

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

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

