part of 'generated.dart';

class CreateTaxFormVariablesBuilder {
  TaxFormType formType;
  String title;
  Optional<String> _subtitle = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _description = Optional.optional(nativeFromJson, nativeToJson);
  Optional<TaxFormStatus> _status = Optional.optional((data) => TaxFormStatus.values.byName(data), enumSerializer);
  String staffId;
  Optional<AnyValue> _formData = Optional.optional(AnyValue.fromJson, defaultSerializer);

  final FirebaseDataConnect _dataConnect;  CreateTaxFormVariablesBuilder subtitle(String? t) {
   _subtitle.value = t;
   return this;
  }
  CreateTaxFormVariablesBuilder description(String? t) {
   _description.value = t;
   return this;
  }
  CreateTaxFormVariablesBuilder status(TaxFormStatus? t) {
   _status.value = t;
   return this;
  }
  CreateTaxFormVariablesBuilder formData(AnyValue? t) {
   _formData.value = t;
   return this;
  }

  CreateTaxFormVariablesBuilder(this._dataConnect, {required  this.formType,required  this.title,required  this.staffId,});
  Deserializer<CreateTaxFormData> dataDeserializer = (dynamic json)  => CreateTaxFormData.fromJson(jsonDecode(json));
  Serializer<CreateTaxFormVariables> varsSerializer = (CreateTaxFormVariables vars) => jsonEncode(vars.toJson());
  Future<OperationResult<CreateTaxFormData, CreateTaxFormVariables>> execute() {
    return ref().execute();
  }

  MutationRef<CreateTaxFormData, CreateTaxFormVariables> ref() {
    CreateTaxFormVariables vars= CreateTaxFormVariables(formType: formType,title: title,subtitle: _subtitle,description: _description,status: _status,staffId: staffId,formData: _formData,);
    return _dataConnect.mutation("createTaxForm", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

    final CreateTaxFormData otherTyped = other as CreateTaxFormData;
    return taxForm_insert == otherTyped.taxForm_insert;
    
  }
  @override
  int get hashCode => taxForm_insert.hashCode;
  

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

  CreateTaxFormData({
    required this.taxForm_insert,
  });
}

@immutable
class CreateTaxFormVariables {
  final TaxFormType formType;
  final String title;
  late final Optional<String>subtitle;
  late final Optional<String>description;
  late final Optional<TaxFormStatus>status;
  final String staffId;
  late final Optional<AnyValue>formData;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  CreateTaxFormVariables.fromJson(Map<String, dynamic> json):
  
  formType = TaxFormType.values.byName(json['formType']),
  title = nativeFromJson<String>(json['title']),
  staffId = nativeFromJson<String>(json['staffId']) {
  
  
  
  
    subtitle = Optional.optional(nativeFromJson, nativeToJson);
    subtitle.value = json['subtitle'] == null ? null : nativeFromJson<String>(json['subtitle']);
  
  
    description = Optional.optional(nativeFromJson, nativeToJson);
    description.value = json['description'] == null ? null : nativeFromJson<String>(json['description']);
  
  
    status = Optional.optional((data) => TaxFormStatus.values.byName(data), enumSerializer);
    status.value = json['status'] == null ? null : TaxFormStatus.values.byName(json['status']);
  
  
  
    formData = Optional.optional(AnyValue.fromJson, defaultSerializer);
    formData.value = json['formData'] == null ? null : AnyValue.fromJson(json['formData']);
  
  }
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final CreateTaxFormVariables otherTyped = other as CreateTaxFormVariables;
    return formType == otherTyped.formType && 
    title == otherTyped.title && 
    subtitle == otherTyped.subtitle && 
    description == otherTyped.description && 
    status == otherTyped.status && 
    staffId == otherTyped.staffId && 
    formData == otherTyped.formData;
    
  }
  @override
  int get hashCode => Object.hashAll([formType.hashCode, title.hashCode, subtitle.hashCode, description.hashCode, status.hashCode, staffId.hashCode, formData.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['formType'] = 
    formType.name
    ;
    json['title'] = nativeToJson<String>(title);
    if(subtitle.state == OptionalState.set) {
      json['subtitle'] = subtitle.toJson();
    }
    if(description.state == OptionalState.set) {
      json['description'] = description.toJson();
    }
    if(status.state == OptionalState.set) {
      json['status'] = status.toJson();
    }
    json['staffId'] = nativeToJson<String>(staffId);
    if(formData.state == OptionalState.set) {
      json['formData'] = formData.toJson();
    }
    return json;
  }

  CreateTaxFormVariables({
    required this.formType,
    required this.title,
    required this.subtitle,
    required this.description,
    required this.status,
    required this.staffId,
    required this.formData,
  });
}

