part of 'generated.dart';

class CreateRecentPaymentVariablesBuilder {
  Optional<String> _workedTime = Optional.optional(nativeFromJson, nativeToJson);
  Optional<RecentPaymentStatus> _status = Optional.optional((data) => RecentPaymentStatus.values.byName(data), enumSerializer);
  String staffId;
  String applicationId;
  String invoiceId;

  final FirebaseDataConnect _dataConnect;
  CreateRecentPaymentVariablesBuilder workedTime(String? t) {
   _workedTime.value = t;
   return this;
  }
  CreateRecentPaymentVariablesBuilder status(RecentPaymentStatus? t) {
   _status.value = t;
   return this;
  }

  CreateRecentPaymentVariablesBuilder(this._dataConnect, {required  this.staffId,required  this.applicationId,required  this.invoiceId,});
  Deserializer<CreateRecentPaymentData> dataDeserializer = (dynamic json)  => CreateRecentPaymentData.fromJson(jsonDecode(json));
  Serializer<CreateRecentPaymentVariables> varsSerializer = (CreateRecentPaymentVariables vars) => jsonEncode(vars.toJson());
  Future<OperationResult<CreateRecentPaymentData, CreateRecentPaymentVariables>> execute() {
    return ref().execute();
  }

  MutationRef<CreateRecentPaymentData, CreateRecentPaymentVariables> ref() {
    CreateRecentPaymentVariables vars= CreateRecentPaymentVariables(workedTime: _workedTime,status: _status,staffId: staffId,applicationId: applicationId,invoiceId: invoiceId,);
    return _dataConnect.mutation("createRecentPayment", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

    final CreateRecentPaymentData otherTyped = other as CreateRecentPaymentData;
    return recentPayment_insert == otherTyped.recentPayment_insert;
    
  }
  @override
  int get hashCode => recentPayment_insert.hashCode;
  

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

  CreateRecentPaymentData({
    required this.recentPayment_insert,
  });
}

@immutable
class CreateRecentPaymentVariables {
  late final Optional<String>workedTime;
  late final Optional<RecentPaymentStatus>status;
  final String staffId;
  final String applicationId;
  final String invoiceId;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  CreateRecentPaymentVariables.fromJson(Map<String, dynamic> json):
  
  staffId = nativeFromJson<String>(json['staffId']),
  applicationId = nativeFromJson<String>(json['applicationId']),
  invoiceId = nativeFromJson<String>(json['invoiceId']) {
  
  
    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']);
  
  
  
  
  }
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

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

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

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

