part of 'generated.dart';

class CreateFaqDataVariablesBuilder {
  String category;
  Optional<List<AnyValue>> _questions = Optional.optional(listDeserializer(AnyValue.fromJson), listSerializer(defaultSerializer));

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

  CreateFaqDataVariablesBuilder(this._dataConnect, {required  this.category,});
  Deserializer<CreateFaqDataData> dataDeserializer = (dynamic json)  => CreateFaqDataData.fromJson(jsonDecode(json));
  Serializer<CreateFaqDataVariables> varsSerializer = (CreateFaqDataVariables vars) => jsonEncode(vars.toJson());
  Future<OperationResult<CreateFaqDataData, CreateFaqDataVariables>> execute() {
    return ref().execute();
  }

  MutationRef<CreateFaqDataData, CreateFaqDataVariables> ref() {
    CreateFaqDataVariables vars= CreateFaqDataVariables(category: category,questions: _questions,);
    return _dataConnect.mutation("createFaqData", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

    final CreateFaqDataData otherTyped = other as CreateFaqDataData;
    return faqData_insert == otherTyped.faqData_insert;
    
  }
  @override
  int get hashCode => faqData_insert.hashCode;
  

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

  CreateFaqDataData({
    required this.faqData_insert,
  });
}

@immutable
class CreateFaqDataVariables {
  final String category;
  late final Optional<List<AnyValue>>questions;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  CreateFaqDataVariables.fromJson(Map<String, dynamic> json):
  
  category = 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 CreateFaqDataVariables otherTyped = other as CreateFaqDataVariables;
    return category == otherTyped.category && 
    questions == otherTyped.questions;
    
  }
  @override
  int get hashCode => Object.hashAll([category.hashCode, questions.hashCode]);
  

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

  CreateFaqDataVariables({
    required this.category,
    required this.questions,
  });
}

