part of 'generated.dart';

class CreateAssignmentVariablesBuilder {
  String workforceId;
  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;  CreateAssignmentVariablesBuilder title(String? t) {
   _title.value = t;
   return this;
  }
  CreateAssignmentVariablesBuilder description(String? t) {
   _description.value = t;
   return this;
  }
  CreateAssignmentVariablesBuilder instructions(String? t) {
   _instructions.value = t;
   return this;
  }
  CreateAssignmentVariablesBuilder status(AssignmentStatus? t) {
   _status.value = t;
   return this;
  }
  CreateAssignmentVariablesBuilder tipsAvailable(bool? t) {
   _tipsAvailable.value = t;
   return this;
  }
  CreateAssignmentVariablesBuilder travelTime(bool? t) {
   _travelTime.value = t;
   return this;
  }
  CreateAssignmentVariablesBuilder mealProvided(bool? t) {
   _mealProvided.value = t;
   return this;
  }
  CreateAssignmentVariablesBuilder parkingAvailable(bool? t) {
   _parkingAvailable.value = t;
   return this;
  }
  CreateAssignmentVariablesBuilder gasCompensation(bool? t) {
   _gasCompensation.value = t;
   return this;
  }
  CreateAssignmentVariablesBuilder managers(List<AnyValue>? t) {
   _managers.value = t;
   return this;
  }

  CreateAssignmentVariablesBuilder(this._dataConnect, {required  this.workforceId,required  this.roleId,required  this.shiftId,});
  Deserializer<CreateAssignmentData> dataDeserializer = (dynamic json)  => CreateAssignmentData.fromJson(jsonDecode(json));
  Serializer<CreateAssignmentVariables> varsSerializer = (CreateAssignmentVariables vars) => jsonEncode(vars.toJson());
  Future<OperationResult<CreateAssignmentData, CreateAssignmentVariables>> execute() {
    return ref().execute();
  }

  MutationRef<CreateAssignmentData, CreateAssignmentVariables> ref() {
    CreateAssignmentVariables vars= CreateAssignmentVariables(workforceId: workforceId,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("CreateAssignment", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

    final CreateAssignmentData otherTyped = other as CreateAssignmentData;
    return assignment_insert == otherTyped.assignment_insert;
    
  }
  @override
  int get hashCode => assignment_insert.hashCode;
  

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

  CreateAssignmentData({
    required this.assignment_insert,
  });
}

@immutable
class CreateAssignmentVariables {
  final String workforceId;
  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.')
  CreateAssignmentVariables.fromJson(Map<String, dynamic> json):
  
  workforceId = nativeFromJson<String>(json['workforceId']),
  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 CreateAssignmentVariables otherTyped = other as CreateAssignmentVariables;
    return workforceId == otherTyped.workforceId && 
    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([workforceId.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['workforceId'] = nativeToJson<String>(workforceId);
    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;
  }

  CreateAssignmentVariables({
    required this.workforceId,
    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,
  });
}

