part of 'generated.dart';

class CreateShiftRoleVariablesBuilder {
  String shiftId;
  String roleId;
  int count;
  Optional<int> _assigned = Optional.optional(nativeFromJson, nativeToJson);
  Optional<Timestamp> _startTime = Optional.optional((json) => json['startTime'] = Timestamp.fromJson(json['startTime']), defaultSerializer);
  Optional<Timestamp> _endTime = Optional.optional((json) => json['endTime'] = Timestamp.fromJson(json['endTime']), defaultSerializer);
  Optional<double> _hours = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _department = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _uniform = Optional.optional(nativeFromJson, nativeToJson);
  Optional<BreakDuration> _breakType = Optional.optional((data) => BreakDuration.values.byName(data), enumSerializer);
  Optional<double> _totalValue = Optional.optional(nativeFromJson, nativeToJson);

  final FirebaseDataConnect _dataConnect;  CreateShiftRoleVariablesBuilder assigned(int? t) {
   _assigned.value = t;
   return this;
  }
  CreateShiftRoleVariablesBuilder startTime(Timestamp? t) {
   _startTime.value = t;
   return this;
  }
  CreateShiftRoleVariablesBuilder endTime(Timestamp? t) {
   _endTime.value = t;
   return this;
  }
  CreateShiftRoleVariablesBuilder hours(double? t) {
   _hours.value = t;
   return this;
  }
  CreateShiftRoleVariablesBuilder department(String? t) {
   _department.value = t;
   return this;
  }
  CreateShiftRoleVariablesBuilder uniform(String? t) {
   _uniform.value = t;
   return this;
  }
  CreateShiftRoleVariablesBuilder breakType(BreakDuration? t) {
   _breakType.value = t;
   return this;
  }
  CreateShiftRoleVariablesBuilder totalValue(double? t) {
   _totalValue.value = t;
   return this;
  }

  CreateShiftRoleVariablesBuilder(this._dataConnect, {required  this.shiftId,required  this.roleId,required  this.count,});
  Deserializer<CreateShiftRoleData> dataDeserializer = (dynamic json)  => CreateShiftRoleData.fromJson(jsonDecode(json));
  Serializer<CreateShiftRoleVariables> varsSerializer = (CreateShiftRoleVariables vars) => jsonEncode(vars.toJson());
  Future<OperationResult<CreateShiftRoleData, CreateShiftRoleVariables>> execute() {
    return ref().execute();
  }

  MutationRef<CreateShiftRoleData, CreateShiftRoleVariables> ref() {
    CreateShiftRoleVariables vars= CreateShiftRoleVariables(shiftId: shiftId,roleId: roleId,count: count,assigned: _assigned,startTime: _startTime,endTime: _endTime,hours: _hours,department: _department,uniform: _uniform,breakType: _breakType,totalValue: _totalValue,);
    return _dataConnect.mutation("createShiftRole", dataDeserializer, varsSerializer, vars);
  }
}

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

    final CreateShiftRoleShiftRoleInsert otherTyped = other as CreateShiftRoleShiftRoleInsert;
    return shiftId == otherTyped.shiftId && 
    roleId == otherTyped.roleId;
    
  }
  @override
  int get hashCode => Object.hashAll([shiftId.hashCode, roleId.hashCode]);
  

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

  CreateShiftRoleShiftRoleInsert({
    required this.shiftId,
    required this.roleId,
  });
}

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

    final CreateShiftRoleData otherTyped = other as CreateShiftRoleData;
    return shiftRole_insert == otherTyped.shiftRole_insert;
    
  }
  @override
  int get hashCode => shiftRole_insert.hashCode;
  

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

  CreateShiftRoleData({
    required this.shiftRole_insert,
  });
}

@immutable
class CreateShiftRoleVariables {
  final String shiftId;
  final String roleId;
  final int count;
  late final Optional<int>assigned;
  late final Optional<Timestamp>startTime;
  late final Optional<Timestamp>endTime;
  late final Optional<double>hours;
  late final Optional<String>department;
  late final Optional<String>uniform;
  late final Optional<BreakDuration>breakType;
  late final Optional<double>totalValue;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  CreateShiftRoleVariables.fromJson(Map<String, dynamic> json):
  
  shiftId = nativeFromJson<String>(json['shiftId']),
  roleId = nativeFromJson<String>(json['roleId']),
  count = nativeFromJson<int>(json['count']) {
  
  
  
  
  
    assigned = Optional.optional(nativeFromJson, nativeToJson);
    assigned.value = json['assigned'] == null ? null : nativeFromJson<int>(json['assigned']);
  
  
    startTime = Optional.optional((json) => json['startTime'] = Timestamp.fromJson(json['startTime']), defaultSerializer);
    startTime.value = json['startTime'] == null ? null : Timestamp.fromJson(json['startTime']);
  
  
    endTime = Optional.optional((json) => json['endTime'] = Timestamp.fromJson(json['endTime']), defaultSerializer);
    endTime.value = json['endTime'] == null ? null : Timestamp.fromJson(json['endTime']);
  
  
    hours = Optional.optional(nativeFromJson, nativeToJson);
    hours.value = json['hours'] == null ? null : nativeFromJson<double>(json['hours']);
  
  
    department = Optional.optional(nativeFromJson, nativeToJson);
    department.value = json['department'] == null ? null : nativeFromJson<String>(json['department']);
  
  
    uniform = Optional.optional(nativeFromJson, nativeToJson);
    uniform.value = json['uniform'] == null ? null : nativeFromJson<String>(json['uniform']);
  
  
    breakType = Optional.optional((data) => BreakDuration.values.byName(data), enumSerializer);
    breakType.value = json['breakType'] == null ? null : BreakDuration.values.byName(json['breakType']);
  
  
    totalValue = Optional.optional(nativeFromJson, nativeToJson);
    totalValue.value = json['totalValue'] == null ? null : nativeFromJson<double>(json['totalValue']);
  
  }
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final CreateShiftRoleVariables otherTyped = other as CreateShiftRoleVariables;
    return shiftId == otherTyped.shiftId && 
    roleId == otherTyped.roleId && 
    count == otherTyped.count && 
    assigned == otherTyped.assigned && 
    startTime == otherTyped.startTime && 
    endTime == otherTyped.endTime && 
    hours == otherTyped.hours && 
    department == otherTyped.department && 
    uniform == otherTyped.uniform && 
    breakType == otherTyped.breakType && 
    totalValue == otherTyped.totalValue;
    
  }
  @override
  int get hashCode => Object.hashAll([shiftId.hashCode, roleId.hashCode, count.hashCode, assigned.hashCode, startTime.hashCode, endTime.hashCode, hours.hashCode, department.hashCode, uniform.hashCode, breakType.hashCode, totalValue.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['shiftId'] = nativeToJson<String>(shiftId);
    json['roleId'] = nativeToJson<String>(roleId);
    json['count'] = nativeToJson<int>(count);
    if(assigned.state == OptionalState.set) {
      json['assigned'] = assigned.toJson();
    }
    if(startTime.state == OptionalState.set) {
      json['startTime'] = startTime.toJson();
    }
    if(endTime.state == OptionalState.set) {
      json['endTime'] = endTime.toJson();
    }
    if(hours.state == OptionalState.set) {
      json['hours'] = hours.toJson();
    }
    if(department.state == OptionalState.set) {
      json['department'] = department.toJson();
    }
    if(uniform.state == OptionalState.set) {
      json['uniform'] = uniform.toJson();
    }
    if(breakType.state == OptionalState.set) {
      json['breakType'] = breakType.toJson();
    }
    if(totalValue.state == OptionalState.set) {
      json['totalValue'] = totalValue.toJson();
    }
    return json;
  }

  CreateShiftRoleVariables({
    required this.shiftId,
    required this.roleId,
    required this.count,
    required this.assigned,
    required this.startTime,
    required this.endTime,
    required this.hours,
    required this.department,
    required this.uniform,
    required this.breakType,
    required this.totalValue,
  });
}

