part of 'generated.dart';

class CreateWorkforceVariablesBuilder {
  String vendorId;
  String staffId;
  String workforceNumber;
  Optional<WorkforceEmploymentType> _employmentType = Optional.optional((data) => WorkforceEmploymentType.values.byName(data), enumSerializer);

  final FirebaseDataConnect _dataConnect;  CreateWorkforceVariablesBuilder employmentType(WorkforceEmploymentType? t) {
   _employmentType.value = t;
   return this;
  }

  CreateWorkforceVariablesBuilder(this._dataConnect, {required  this.vendorId,required  this.staffId,required  this.workforceNumber,});
  Deserializer<CreateWorkforceData> dataDeserializer = (dynamic json)  => CreateWorkforceData.fromJson(jsonDecode(json));
  Serializer<CreateWorkforceVariables> varsSerializer = (CreateWorkforceVariables vars) => jsonEncode(vars.toJson());
  Future<OperationResult<CreateWorkforceData, CreateWorkforceVariables>> execute() {
    return ref().execute();
  }

  MutationRef<CreateWorkforceData, CreateWorkforceVariables> ref() {
    CreateWorkforceVariables vars= CreateWorkforceVariables(vendorId: vendorId,staffId: staffId,workforceNumber: workforceNumber,employmentType: _employmentType,);
    return _dataConnect.mutation("createWorkforce", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class CreateWorkforceWorkforceInsert {
  final String id;
  CreateWorkforceWorkforceInsert.fromJson(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 CreateWorkforceWorkforceInsert otherTyped = other as CreateWorkforceWorkforceInsert;
    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;
  }

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

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

    final CreateWorkforceData otherTyped = other as CreateWorkforceData;
    return workforce_insert == otherTyped.workforce_insert;
    
  }
  @override
  int get hashCode => workforce_insert.hashCode;
  

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

  CreateWorkforceData({
    required this.workforce_insert,
  });
}

@immutable
class CreateWorkforceVariables {
  final String vendorId;
  final String staffId;
  final String workforceNumber;
  late final Optional<WorkforceEmploymentType>employmentType;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  CreateWorkforceVariables.fromJson(Map<String, dynamic> json):
  
  vendorId = nativeFromJson<String>(json['vendorId']),
  staffId = nativeFromJson<String>(json['staffId']),
  workforceNumber = nativeFromJson<String>(json['workforceNumber']) {
  
  
  
  
  
    employmentType = Optional.optional((data) => WorkforceEmploymentType.values.byName(data), enumSerializer);
    employmentType.value = json['employmentType'] == null ? null : WorkforceEmploymentType.values.byName(json['employmentType']);
  
  }
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

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

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['vendorId'] = nativeToJson<String>(vendorId);
    json['staffId'] = nativeToJson<String>(staffId);
    json['workforceNumber'] = nativeToJson<String>(workforceNumber);
    if(employmentType.state == OptionalState.set) {
      json['employmentType'] = employmentType.toJson();
    }
    return json;
  }

  CreateWorkforceVariables({
    required this.vendorId,
    required this.staffId,
    required this.workforceNumber,
    required this.employmentType,
  });
}

