part of 'generated.dart';

class UpdateRecentPaymentVariablesBuilder {
  String id;
  Optional<String> _workedTime = Optional.optional(nativeFromJson, nativeToJson);
  Optional<RecentPaymentStatus> _status = Optional.optional((data) => RecentPaymentStatus.values.byName(data), enumSerializer);
  Optional<String> _staffId = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _applicationId = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _invoiceId = Optional.optional(nativeFromJson, nativeToJson);

  final FirebaseDataConnect _dataConnect;  UpdateRecentPaymentVariablesBuilder workedTime(String? t) {
   _workedTime.value = t;
   return this;
  }
  UpdateRecentPaymentVariablesBuilder status(RecentPaymentStatus? t) {
   _status.value = t;
   return this;
  }
  UpdateRecentPaymentVariablesBuilder staffId(String? t) {
   _staffId.value = t;
   return this;
  }
  UpdateRecentPaymentVariablesBuilder applicationId(String? t) {
   _applicationId.value = t;
   return this;
  }
  UpdateRecentPaymentVariablesBuilder invoiceId(String? t) {
   _invoiceId.value = t;
   return this;
  }

  UpdateRecentPaymentVariablesBuilder(this._dataConnect, {required  this.id,});
  Deserializer<UpdateRecentPaymentData> dataDeserializer = (dynamic json)  => UpdateRecentPaymentData.fromJson(jsonDecode(json));
  Serializer<UpdateRecentPaymentVariables> varsSerializer = (UpdateRecentPaymentVariables vars) => jsonEncode(vars.toJson());
  Future<OperationResult<UpdateRecentPaymentData, UpdateRecentPaymentVariables>> execute() {
    return ref().execute();
  }

  MutationRef<UpdateRecentPaymentData, UpdateRecentPaymentVariables> ref() {
    UpdateRecentPaymentVariables vars= UpdateRecentPaymentVariables(id: id,workedTime: _workedTime,status: _status,staffId: _staffId,applicationId: _applicationId,invoiceId: _invoiceId,);
    return _dataConnect.mutation("updateRecentPayment", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

    final UpdateRecentPaymentData otherTyped = other as UpdateRecentPaymentData;
    return recentPayment_update == otherTyped.recentPayment_update;
    
  }
  @override
  int get hashCode => recentPayment_update.hashCode;
  

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

  UpdateRecentPaymentData({
    this.recentPayment_update,
  });
}

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

    final UpdateRecentPaymentVariables otherTyped = other as UpdateRecentPaymentVariables;
    return id == otherTyped.id && 
    workedTime == otherTyped.workedTime && 
    status == otherTyped.status && 
    staffId == otherTyped.staffId && 
    applicationId == otherTyped.applicationId && 
    invoiceId == otherTyped.invoiceId;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, workedTime.hashCode, status.hashCode, staffId.hashCode, applicationId.hashCode, invoiceId.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    if(workedTime.state == OptionalState.set) {
      json['workedTime'] = workedTime.toJson();
    }
    if(status.state == OptionalState.set) {
      json['status'] = status.toJson();
    }
    if(staffId.state == OptionalState.set) {
      json['staffId'] = staffId.toJson();
    }
    if(applicationId.state == OptionalState.set) {
      json['applicationId'] = applicationId.toJson();
    }
    if(invoiceId.state == OptionalState.set) {
      json['invoiceId'] = invoiceId.toJson();
    }
    return json;
  }

  UpdateRecentPaymentVariables({
    required this.id,
    required this.workedTime,
    required this.status,
    required this.staffId,
    required this.applicationId,
    required this.invoiceId,
  });
}

