part of 'generated.dart';

class CreateInvoiceTemplateVariablesBuilder {
  String name;
  String ownerId;
  Optional<String> _vendorId = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _businessId = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _orderId = Optional.optional(nativeFromJson, nativeToJson);
  Optional<InovicePaymentTermsTemp> _paymentTerms = Optional.optional((data) => InovicePaymentTermsTemp.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);

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

  CreateInvoiceTemplateVariablesBuilder(this._dataConnect, {required  this.name,required  this.ownerId,});
  Deserializer<CreateInvoiceTemplateData> dataDeserializer = (dynamic json)  => CreateInvoiceTemplateData.fromJson(jsonDecode(json));
  Serializer<CreateInvoiceTemplateVariables> varsSerializer = (CreateInvoiceTemplateVariables vars) => jsonEncode(vars.toJson());
  Future<OperationResult<CreateInvoiceTemplateData, CreateInvoiceTemplateVariables>> execute() {
    return ref().execute();
  }

  MutationRef<CreateInvoiceTemplateData, CreateInvoiceTemplateVariables> ref() {
    CreateInvoiceTemplateVariables vars= CreateInvoiceTemplateVariables(name: name,ownerId: ownerId,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,);
    return _dataConnect.mutation("createInvoiceTemplate", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

    final CreateInvoiceTemplateData otherTyped = other as CreateInvoiceTemplateData;
    return invoiceTemplate_insert == otherTyped.invoiceTemplate_insert;
    
  }
  @override
  int get hashCode => invoiceTemplate_insert.hashCode;
  

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

  CreateInvoiceTemplateData({
    required this.invoiceTemplate_insert,
  });
}

@immutable
class CreateInvoiceTemplateVariables {
  final String name;
  final String ownerId;
  late final Optional<String>vendorId;
  late final Optional<String>businessId;
  late final Optional<String>orderId;
  late final Optional<InovicePaymentTermsTemp>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;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  CreateInvoiceTemplateVariables.fromJson(Map<String, dynamic> json):
  
  name = nativeFromJson<String>(json['name']),
  ownerId = nativeFromJson<String>(json['ownerId']) {
  
  
  
  
    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) => InovicePaymentTermsTemp.values.byName(data), enumSerializer);
    paymentTerms.value = json['paymentTerms'] == null ? null : InovicePaymentTermsTemp.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']);
  
  }
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final CreateInvoiceTemplateVariables otherTyped = other as CreateInvoiceTemplateVariables;
    return name == otherTyped.name && 
    ownerId == otherTyped.ownerId && 
    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;
    
  }
  @override
  int get hashCode => Object.hashAll([name.hashCode, ownerId.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]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['name'] = nativeToJson<String>(name);
    json['ownerId'] = nativeToJson<String>(ownerId);
    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();
    }
    return json;
  }

  CreateInvoiceTemplateVariables({
    required this.name,
    required this.ownerId,
    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,
  });
}

