part of 'generated.dart';

class UpdateInvoiceVariablesBuilder {
  String id;
  Optional<InvoiceStatus> _status = Optional.optional((data) => InvoiceStatus.values.byName(data), enumSerializer);
  Optional<String> _vendorId = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _businessId = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _orderId = Optional.optional(nativeFromJson, nativeToJson);
  Optional<InovicePaymentTerms> _paymentTerms = Optional.optional((data) => InovicePaymentTerms.values.byName(data), enumSerializer);
  Optional<String> _invoiceNumber = Optional.optional(nativeFromJson, nativeToJson);
  Optional<Timestamp> _issueDate = Optional.optional((json) => json['issueDate'] = Timestamp.fromJson(json['issueDate']), defaultSerializer);
  Optional<Timestamp> _dueDate = Optional.optional((json) => json['dueDate'] = Timestamp.fromJson(json['dueDate']), defaultSerializer);
  Optional<String> _hub = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _managerName = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _vendorNumber = Optional.optional(nativeFromJson, nativeToJson);
  Optional<AnyValue> _roles = Optional.optional(AnyValue.fromJson, defaultSerializer);
  Optional<AnyValue> _charges = Optional.optional(AnyValue.fromJson, defaultSerializer);
  Optional<double> _otherCharges = Optional.optional(nativeFromJson, nativeToJson);
  Optional<double> _subtotal = Optional.optional(nativeFromJson, nativeToJson);
  Optional<double> _amount = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _notes = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _staffCount = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _chargesCount = Optional.optional(nativeFromJson, nativeToJson);
  Optional<AnyValue> _disputedItems = Optional.optional(AnyValue.fromJson, defaultSerializer);
  Optional<String> _disputeReason = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _disputeDetails = Optional.optional(nativeFromJson, nativeToJson);

  final FirebaseDataConnect _dataConnect;  UpdateInvoiceVariablesBuilder status(InvoiceStatus? t) {
   _status.value = t;
   return this;
  }
  UpdateInvoiceVariablesBuilder vendorId(String? t) {
   _vendorId.value = t;
   return this;
  }
  UpdateInvoiceVariablesBuilder businessId(String? t) {
   _businessId.value = t;
   return this;
  }
  UpdateInvoiceVariablesBuilder orderId(String? t) {
   _orderId.value = t;
   return this;
  }
  UpdateInvoiceVariablesBuilder paymentTerms(InovicePaymentTerms? t) {
   _paymentTerms.value = t;
   return this;
  }
  UpdateInvoiceVariablesBuilder invoiceNumber(String? t) {
   _invoiceNumber.value = t;
   return this;
  }
  UpdateInvoiceVariablesBuilder issueDate(Timestamp? t) {
   _issueDate.value = t;
   return this;
  }
  UpdateInvoiceVariablesBuilder dueDate(Timestamp? t) {
   _dueDate.value = t;
   return this;
  }
  UpdateInvoiceVariablesBuilder hub(String? t) {
   _hub.value = t;
   return this;
  }
  UpdateInvoiceVariablesBuilder managerName(String? t) {
   _managerName.value = t;
   return this;
  }
  UpdateInvoiceVariablesBuilder vendorNumber(String? t) {
   _vendorNumber.value = t;
   return this;
  }
  UpdateInvoiceVariablesBuilder roles(AnyValue? t) {
   _roles.value = t;
   return this;
  }
  UpdateInvoiceVariablesBuilder charges(AnyValue? t) {
   _charges.value = t;
   return this;
  }
  UpdateInvoiceVariablesBuilder otherCharges(double? t) {
   _otherCharges.value = t;
   return this;
  }
  UpdateInvoiceVariablesBuilder subtotal(double? t) {
   _subtotal.value = t;
   return this;
  }
  UpdateInvoiceVariablesBuilder amount(double? t) {
   _amount.value = t;
   return this;
  }
  UpdateInvoiceVariablesBuilder notes(String? t) {
   _notes.value = t;
   return this;
  }
  UpdateInvoiceVariablesBuilder staffCount(int? t) {
   _staffCount.value = t;
   return this;
  }
  UpdateInvoiceVariablesBuilder chargesCount(int? t) {
   _chargesCount.value = t;
   return this;
  }
  UpdateInvoiceVariablesBuilder disputedItems(AnyValue? t) {
   _disputedItems.value = t;
   return this;
  }
  UpdateInvoiceVariablesBuilder disputeReason(String? t) {
   _disputeReason.value = t;
   return this;
  }
  UpdateInvoiceVariablesBuilder disputeDetails(String? t) {
   _disputeDetails.value = t;
   return this;
  }

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

  MutationRef<UpdateInvoiceData, UpdateInvoiceVariables> ref() {
    UpdateInvoiceVariables vars= UpdateInvoiceVariables(id: id,status: _status,vendorId: _vendorId,businessId: _businessId,orderId: _orderId,paymentTerms: _paymentTerms,invoiceNumber: _invoiceNumber,issueDate: _issueDate,dueDate: _dueDate,hub: _hub,managerName: _managerName,vendorNumber: _vendorNumber,roles: _roles,charges: _charges,otherCharges: _otherCharges,subtotal: _subtotal,amount: _amount,notes: _notes,staffCount: _staffCount,chargesCount: _chargesCount,disputedItems: _disputedItems,disputeReason: _disputeReason,disputeDetails: _disputeDetails,);
    return _dataConnect.mutation("updateInvoice", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

    final UpdateInvoiceData otherTyped = other as UpdateInvoiceData;
    return invoice_update == otherTyped.invoice_update;
    
  }
  @override
  int get hashCode => invoice_update.hashCode;
  

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

  UpdateInvoiceData({
    this.invoice_update,
  });
}

@immutable
class UpdateInvoiceVariables {
  final String id;
  late final Optional<InvoiceStatus>status;
  late final Optional<String>vendorId;
  late final Optional<String>businessId;
  late final Optional<String>orderId;
  late final Optional<InovicePaymentTerms>paymentTerms;
  late final Optional<String>invoiceNumber;
  late final Optional<Timestamp>issueDate;
  late final Optional<Timestamp>dueDate;
  late final Optional<String>hub;
  late final Optional<String>managerName;
  late final Optional<String>vendorNumber;
  late final Optional<AnyValue>roles;
  late final Optional<AnyValue>charges;
  late final Optional<double>otherCharges;
  late final Optional<double>subtotal;
  late final Optional<double>amount;
  late final Optional<String>notes;
  late final Optional<int>staffCount;
  late final Optional<int>chargesCount;
  late final Optional<AnyValue>disputedItems;
  late final Optional<String>disputeReason;
  late final Optional<String>disputeDetails;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  UpdateInvoiceVariables.fromJson(Map<String, dynamic> json):
  
  id = nativeFromJson<String>(json['id']) {
  
  
  
    status = Optional.optional((data) => InvoiceStatus.values.byName(data), enumSerializer);
    status.value = json['status'] == null ? null : InvoiceStatus.values.byName(json['status']);
  
  
    vendorId = Optional.optional(nativeFromJson, nativeToJson);
    vendorId.value = json['vendorId'] == null ? null : nativeFromJson<String>(json['vendorId']);
  
  
    businessId = Optional.optional(nativeFromJson, nativeToJson);
    businessId.value = json['businessId'] == null ? null : nativeFromJson<String>(json['businessId']);
  
  
    orderId = Optional.optional(nativeFromJson, nativeToJson);
    orderId.value = json['orderId'] == null ? null : nativeFromJson<String>(json['orderId']);
  
  
    paymentTerms = Optional.optional((data) => InovicePaymentTerms.values.byName(data), enumSerializer);
    paymentTerms.value = json['paymentTerms'] == null ? null : InovicePaymentTerms.values.byName(json['paymentTerms']);
  
  
    invoiceNumber = Optional.optional(nativeFromJson, nativeToJson);
    invoiceNumber.value = json['invoiceNumber'] == null ? null : nativeFromJson<String>(json['invoiceNumber']);
  
  
    issueDate = Optional.optional((json) => json['issueDate'] = Timestamp.fromJson(json['issueDate']), defaultSerializer);
    issueDate.value = json['issueDate'] == null ? null : Timestamp.fromJson(json['issueDate']);
  
  
    dueDate = Optional.optional((json) => json['dueDate'] = Timestamp.fromJson(json['dueDate']), defaultSerializer);
    dueDate.value = json['dueDate'] == null ? null : Timestamp.fromJson(json['dueDate']);
  
  
    hub = Optional.optional(nativeFromJson, nativeToJson);
    hub.value = json['hub'] == null ? null : nativeFromJson<String>(json['hub']);
  
  
    managerName = Optional.optional(nativeFromJson, nativeToJson);
    managerName.value = json['managerName'] == null ? null : nativeFromJson<String>(json['managerName']);
  
  
    vendorNumber = Optional.optional(nativeFromJson, nativeToJson);
    vendorNumber.value = json['vendorNumber'] == null ? null : nativeFromJson<String>(json['vendorNumber']);
  
  
    roles = Optional.optional(AnyValue.fromJson, defaultSerializer);
    roles.value = json['roles'] == null ? null : AnyValue.fromJson(json['roles']);
  
  
    charges = Optional.optional(AnyValue.fromJson, defaultSerializer);
    charges.value = json['charges'] == null ? null : AnyValue.fromJson(json['charges']);
  
  
    otherCharges = Optional.optional(nativeFromJson, nativeToJson);
    otherCharges.value = json['otherCharges'] == null ? null : nativeFromJson<double>(json['otherCharges']);
  
  
    subtotal = Optional.optional(nativeFromJson, nativeToJson);
    subtotal.value = json['subtotal'] == null ? null : nativeFromJson<double>(json['subtotal']);
  
  
    amount = Optional.optional(nativeFromJson, nativeToJson);
    amount.value = json['amount'] == null ? null : nativeFromJson<double>(json['amount']);
  
  
    notes = Optional.optional(nativeFromJson, nativeToJson);
    notes.value = json['notes'] == null ? null : nativeFromJson<String>(json['notes']);
  
  
    staffCount = Optional.optional(nativeFromJson, nativeToJson);
    staffCount.value = json['staffCount'] == null ? null : nativeFromJson<int>(json['staffCount']);
  
  
    chargesCount = Optional.optional(nativeFromJson, nativeToJson);
    chargesCount.value = json['chargesCount'] == null ? null : nativeFromJson<int>(json['chargesCount']);
  
  
    disputedItems = Optional.optional(AnyValue.fromJson, defaultSerializer);
    disputedItems.value = json['disputedItems'] == null ? null : AnyValue.fromJson(json['disputedItems']);
  
  
    disputeReason = Optional.optional(nativeFromJson, nativeToJson);
    disputeReason.value = json['disputeReason'] == null ? null : nativeFromJson<String>(json['disputeReason']);
  
  
    disputeDetails = Optional.optional(nativeFromJson, nativeToJson);
    disputeDetails.value = json['disputeDetails'] == null ? null : nativeFromJson<String>(json['disputeDetails']);
  
  }
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final UpdateInvoiceVariables otherTyped = other as UpdateInvoiceVariables;
    return id == otherTyped.id && 
    status == otherTyped.status && 
    vendorId == otherTyped.vendorId && 
    businessId == otherTyped.businessId && 
    orderId == otherTyped.orderId && 
    paymentTerms == otherTyped.paymentTerms && 
    invoiceNumber == otherTyped.invoiceNumber && 
    issueDate == otherTyped.issueDate && 
    dueDate == otherTyped.dueDate && 
    hub == otherTyped.hub && 
    managerName == otherTyped.managerName && 
    vendorNumber == otherTyped.vendorNumber && 
    roles == otherTyped.roles && 
    charges == otherTyped.charges && 
    otherCharges == otherTyped.otherCharges && 
    subtotal == otherTyped.subtotal && 
    amount == otherTyped.amount && 
    notes == otherTyped.notes && 
    staffCount == otherTyped.staffCount && 
    chargesCount == otherTyped.chargesCount && 
    disputedItems == otherTyped.disputedItems && 
    disputeReason == otherTyped.disputeReason && 
    disputeDetails == otherTyped.disputeDetails;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, status.hashCode, vendorId.hashCode, businessId.hashCode, orderId.hashCode, paymentTerms.hashCode, invoiceNumber.hashCode, issueDate.hashCode, dueDate.hashCode, hub.hashCode, managerName.hashCode, vendorNumber.hashCode, roles.hashCode, charges.hashCode, otherCharges.hashCode, subtotal.hashCode, amount.hashCode, notes.hashCode, staffCount.hashCode, chargesCount.hashCode, disputedItems.hashCode, disputeReason.hashCode, disputeDetails.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    if(status.state == OptionalState.set) {
      json['status'] = status.toJson();
    }
    if(vendorId.state == OptionalState.set) {
      json['vendorId'] = vendorId.toJson();
    }
    if(businessId.state == OptionalState.set) {
      json['businessId'] = businessId.toJson();
    }
    if(orderId.state == OptionalState.set) {
      json['orderId'] = orderId.toJson();
    }
    if(paymentTerms.state == OptionalState.set) {
      json['paymentTerms'] = paymentTerms.toJson();
    }
    if(invoiceNumber.state == OptionalState.set) {
      json['invoiceNumber'] = invoiceNumber.toJson();
    }
    if(issueDate.state == OptionalState.set) {
      json['issueDate'] = issueDate.toJson();
    }
    if(dueDate.state == OptionalState.set) {
      json['dueDate'] = dueDate.toJson();
    }
    if(hub.state == OptionalState.set) {
      json['hub'] = hub.toJson();
    }
    if(managerName.state == OptionalState.set) {
      json['managerName'] = managerName.toJson();
    }
    if(vendorNumber.state == OptionalState.set) {
      json['vendorNumber'] = vendorNumber.toJson();
    }
    if(roles.state == OptionalState.set) {
      json['roles'] = roles.toJson();
    }
    if(charges.state == OptionalState.set) {
      json['charges'] = charges.toJson();
    }
    if(otherCharges.state == OptionalState.set) {
      json['otherCharges'] = otherCharges.toJson();
    }
    if(subtotal.state == OptionalState.set) {
      json['subtotal'] = subtotal.toJson();
    }
    if(amount.state == OptionalState.set) {
      json['amount'] = amount.toJson();
    }
    if(notes.state == OptionalState.set) {
      json['notes'] = notes.toJson();
    }
    if(staffCount.state == OptionalState.set) {
      json['staffCount'] = staffCount.toJson();
    }
    if(chargesCount.state == OptionalState.set) {
      json['chargesCount'] = chargesCount.toJson();
    }
    if(disputedItems.state == OptionalState.set) {
      json['disputedItems'] = disputedItems.toJson();
    }
    if(disputeReason.state == OptionalState.set) {
      json['disputeReason'] = disputeReason.toJson();
    }
    if(disputeDetails.state == OptionalState.set) {
      json['disputeDetails'] = disputeDetails.toJson();
    }
    return json;
  }

  UpdateInvoiceVariables({
    required this.id,
    required this.status,
    required this.vendorId,
    required this.businessId,
    required this.orderId,
    required this.paymentTerms,
    required this.invoiceNumber,
    required this.issueDate,
    required this.dueDate,
    required this.hub,
    required this.managerName,
    required this.vendorNumber,
    required this.roles,
    required this.charges,
    required this.otherCharges,
    required this.subtotal,
    required this.amount,
    required this.notes,
    required this.staffCount,
    required this.chargesCount,
    required this.disputedItems,
    required this.disputeReason,
    required this.disputeDetails,
  });
}

