part of 'generated.dart';

class UpdateFaqDataVariablesBuilder {
  String id;
  Optional<String> _category = Optional.optional(nativeFromJson, nativeToJson);
  Optional<List<AnyValue>> _questions = Optional.optional(listDeserializer(AnyValue.fromJson), listSerializer(defaultSerializer));

  final FirebaseDataConnect _dataConnect;  UpdateFaqDataVariablesBuilder category(String? t) {
   _category.value = t;
   return this;
  }
  UpdateFaqDataVariablesBuilder questions(List<AnyValue>? t) {
   _questions.value = t;
   return this;
  }

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

  MutationRef<UpdateFaqDataData, UpdateFaqDataVariables> ref() {
    UpdateFaqDataVariables vars= UpdateFaqDataVariables(id: id,category: _category,questions: _questions,);
    return _dataConnect.mutation("updateFaqData", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

    final UpdateFaqDataData otherTyped = other as UpdateFaqDataData;
    return faqData_update == otherTyped.faqData_update;
    
  }
  @override
  int get hashCode => faqData_update.hashCode;
  

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

  UpdateFaqDataData({
    this.faqData_update,
  });
}

@immutable
class UpdateFaqDataVariables {
  final String id;
  late final Optional<String>category;
  late final Optional<List<AnyValue>>questions;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  UpdateFaqDataVariables.fromJson(Map<String, dynamic> json):
  
  id = nativeFromJson<String>(json['id']) {
  
  
  
    category = Optional.optional(nativeFromJson, nativeToJson);
    category.value = json['category'] == null ? null : nativeFromJson<String>(json['category']);
  
  
    questions = Optional.optional(listDeserializer(AnyValue.fromJson), listSerializer(defaultSerializer));
    questions.value = json['questions'] == null ? null : (json['questions'] as List<dynamic>)
        .map((e) => AnyValue.fromJson(e))
        .toList();
  
  }
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final UpdateFaqDataVariables otherTyped = other as UpdateFaqDataVariables;
    return id == otherTyped.id && 
    category == otherTyped.category && 
    questions == otherTyped.questions;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, category.hashCode, questions.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    if(category.state == OptionalState.set) {
      json['category'] = category.toJson();
    }
    if(questions.state == OptionalState.set) {
      json['questions'] = questions.toJson();
    }
    return json;
  }

  UpdateFaqDataVariables({
    required this.id,
    required this.category,
    required this.questions,
  });
}

