part of 'generated.dart';

class UpdateAssignmentVariablesBuilder {
  String id;
  Optional<String> _title = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _description = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _instructions = Optional.optional(nativeFromJson, nativeToJson);
  Optional<AssignmentStatus> _status = Optional.optional((data) => AssignmentStatus.values.byName(data), enumSerializer);
  Optional<bool> _tipsAvailable = Optional.optional(nativeFromJson, nativeToJson);
  Optional<bool> _travelTime = Optional.optional(nativeFromJson, nativeToJson);
  Optional<bool> _mealProvided = Optional.optional(nativeFromJson, nativeToJson);
  Optional<bool> _parkingAvailable = Optional.optional(nativeFromJson, nativeToJson);
  Optional<bool> _gasCompensation = Optional.optional(nativeFromJson, nativeToJson);
  Optional<List<AnyValue>> _managers = Optional.optional(listDeserializer(AnyValue.fromJson), listSerializer(defaultSerializer));
  String roleId;
  String shiftId;

  final FirebaseDataConnect _dataConnect;  UpdateAssignmentVariablesBuilder title(String? t) {
   _title.value = t;
   return this;
  }
  UpdateAssignmentVariablesBuilder description(String? t) {
   _description.value = t;
   return this;
  }
  UpdateAssignmentVariablesBuilder instructions(String? t) {
   _instructions.value = t;
   return this;
  }
  UpdateAssignmentVariablesBuilder status(AssignmentStatus? t) {
   _status.value = t;
   return this;
  }
  UpdateAssignmentVariablesBuilder tipsAvailable(bool? t) {
   _tipsAvailable.value = t;
   return this;
  }
  UpdateAssignmentVariablesBuilder travelTime(bool? t) {
   _travelTime.value = t;
   return this;
  }
  UpdateAssignmentVariablesBuilder mealProvided(bool? t) {
   _mealProvided.value = t;
   return this;
  }
  UpdateAssignmentVariablesBuilder parkingAvailable(bool? t) {
   _parkingAvailable.value = t;
   return this;
  }
  UpdateAssignmentVariablesBuilder gasCompensation(bool? t) {
   _gasCompensation.value = t;
   return this;
  }
  UpdateAssignmentVariablesBuilder managers(List<AnyValue>? t) {
   _managers.value = t;
   return this;
  }

  UpdateAssignmentVariablesBuilder(this._dataConnect, {required  this.id,required  this.roleId,required  this.shiftId,});
  Deserializer<UpdateAssignmentData> dataDeserializer = (dynamic json)  => UpdateAssignmentData.fromJson(jsonDecode(json));
  Serializer<UpdateAssignmentVariables> varsSerializer = (UpdateAssignmentVariables vars) => jsonEncode(vars.toJson());
  Future<OperationResult<UpdateAssignmentData, UpdateAssignmentVariables>> execute() {
    return ref().execute();
  }

  MutationRef<UpdateAssignmentData, UpdateAssignmentVariables> ref() {
    UpdateAssignmentVariables vars= UpdateAssignmentVariables(id: id,title: _title,description: _description,instructions: _instructions,status: _status,tipsAvailable: _tipsAvailable,travelTime: _travelTime,mealProvided: _mealProvided,parkingAvailable: _parkingAvailable,gasCompensation: _gasCompensation,managers: _managers,roleId: roleId,shiftId: shiftId,);
    return _dataConnect.mutation("UpdateAssignment", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

    final UpdateAssignmentData otherTyped = other as UpdateAssignmentData;
    return assignment_update == otherTyped.assignment_update;
    
  }
  @override
  int get hashCode => assignment_update.hashCode;
  

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

  UpdateAssignmentData({
    this.assignment_update,
  });
}

@immutable
class UpdateAssignmentVariables {
  final String id;
  late final Optional<String>title;
  late final Optional<String>description;
  late final Optional<String>instructions;
  late final Optional<AssignmentStatus>status;
  late final Optional<bool>tipsAvailable;
  late final Optional<bool>travelTime;
  late final Optional<bool>mealProvided;
  late final Optional<bool>parkingAvailable;
  late final Optional<bool>gasCompensation;
  late final Optional<List<AnyValue>>managers;
  final String roleId;
  final String shiftId;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  UpdateAssignmentVariables.fromJson(Map<String, dynamic> json):
  
  id = nativeFromJson<String>(json['id']),
  roleId = nativeFromJson<String>(json['roleId']),
  shiftId = nativeFromJson<String>(json['shiftId']) {
  
  
  
    title = Optional.optional(nativeFromJson, nativeToJson);
    title.value = json['title'] == null ? null : nativeFromJson<String>(json['title']);
  
  
    description = Optional.optional(nativeFromJson, nativeToJson);
    description.value = json['description'] == null ? null : nativeFromJson<String>(json['description']);
  
  
    instructions = Optional.optional(nativeFromJson, nativeToJson);
    instructions.value = json['instructions'] == null ? null : nativeFromJson<String>(json['instructions']);
  
  
    status = Optional.optional((data) => AssignmentStatus.values.byName(data), enumSerializer);
    status.value = json['status'] == null ? null : AssignmentStatus.values.byName(json['status']);
  
  
    tipsAvailable = Optional.optional(nativeFromJson, nativeToJson);
    tipsAvailable.value = json['tipsAvailable'] == null ? null : nativeFromJson<bool>(json['tipsAvailable']);
  
  
    travelTime = Optional.optional(nativeFromJson, nativeToJson);
    travelTime.value = json['travelTime'] == null ? null : nativeFromJson<bool>(json['travelTime']);
  
  
    mealProvided = Optional.optional(nativeFromJson, nativeToJson);
    mealProvided.value = json['mealProvided'] == null ? null : nativeFromJson<bool>(json['mealProvided']);
  
  
    parkingAvailable = Optional.optional(nativeFromJson, nativeToJson);
    parkingAvailable.value = json['parkingAvailable'] == null ? null : nativeFromJson<bool>(json['parkingAvailable']);
  
  
    gasCompensation = Optional.optional(nativeFromJson, nativeToJson);
    gasCompensation.value = json['gasCompensation'] == null ? null : nativeFromJson<bool>(json['gasCompensation']);
  
  
    managers = Optional.optional(listDeserializer(AnyValue.fromJson), listSerializer(defaultSerializer));
    managers.value = json['managers'] == null ? null : (json['managers'] as List<dynamic>)
        .map((e) => AnyValue.fromJson(e))
        .toList();
  
  
  
  }
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final UpdateAssignmentVariables otherTyped = other as UpdateAssignmentVariables;
    return id == otherTyped.id && 
    title == otherTyped.title && 
    description == otherTyped.description && 
    instructions == otherTyped.instructions && 
    status == otherTyped.status && 
    tipsAvailable == otherTyped.tipsAvailable && 
    travelTime == otherTyped.travelTime && 
    mealProvided == otherTyped.mealProvided && 
    parkingAvailable == otherTyped.parkingAvailable && 
    gasCompensation == otherTyped.gasCompensation && 
    managers == otherTyped.managers && 
    roleId == otherTyped.roleId && 
    shiftId == otherTyped.shiftId;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, title.hashCode, description.hashCode, instructions.hashCode, status.hashCode, tipsAvailable.hashCode, travelTime.hashCode, mealProvided.hashCode, parkingAvailable.hashCode, gasCompensation.hashCode, managers.hashCode, roleId.hashCode, shiftId.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    if(title.state == OptionalState.set) {
      json['title'] = title.toJson();
    }
    if(description.state == OptionalState.set) {
      json['description'] = description.toJson();
    }
    if(instructions.state == OptionalState.set) {
      json['instructions'] = instructions.toJson();
    }
    if(status.state == OptionalState.set) {
      json['status'] = status.toJson();
    }
    if(tipsAvailable.state == OptionalState.set) {
      json['tipsAvailable'] = tipsAvailable.toJson();
    }
    if(travelTime.state == OptionalState.set) {
      json['travelTime'] = travelTime.toJson();
    }
    if(mealProvided.state == OptionalState.set) {
      json['mealProvided'] = mealProvided.toJson();
    }
    if(parkingAvailable.state == OptionalState.set) {
      json['parkingAvailable'] = parkingAvailable.toJson();
    }
    if(gasCompensation.state == OptionalState.set) {
      json['gasCompensation'] = gasCompensation.toJson();
    }
    if(managers.state == OptionalState.set) {
      json['managers'] = managers.toJson();
    }
    json['roleId'] = nativeToJson<String>(roleId);
    json['shiftId'] = nativeToJson<String>(shiftId);
    return json;
  }

  UpdateAssignmentVariables({
    required this.id,
    required this.title,
    required this.description,
    required this.instructions,
    required this.status,
    required this.tipsAvailable,
    required this.travelTime,
    required this.mealProvided,
    required this.parkingAvailable,
    required this.gasCompensation,
    required this.managers,
    required this.roleId,
    required this.shiftId,
  });
}

