part of 'generated.dart';

class GetDocumentByIdVariablesBuilder {
  String id;

  final FirebaseDataConnect _dataConnect;
  GetDocumentByIdVariablesBuilder(this._dataConnect, {required  this.id,});
  Deserializer<GetDocumentByIdData> dataDeserializer = (dynamic json)  => GetDocumentByIdData.fromJson(jsonDecode(json));
  Serializer<GetDocumentByIdVariables> varsSerializer = (GetDocumentByIdVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<GetDocumentByIdData, GetDocumentByIdVariables>> execute() {
    return ref().execute();
  }

  QueryRef<GetDocumentByIdData, GetDocumentByIdVariables> ref() {
    GetDocumentByIdVariables vars= GetDocumentByIdVariables(id: id,);
    return _dataConnect.query("getDocumentById", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class GetDocumentByIdDocument {
  final String id;
  final EnumValue<DocumentType> documentType;
  final String name;
  final String? description;
  final Timestamp? createdAt;
  GetDocumentByIdDocument.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  documentType = documentTypeDeserializer(json['documentType']),
  name = nativeFromJson<String>(json['name']),
  description = json['description'] == null ? null : nativeFromJson<String>(json['description']),
  createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final GetDocumentByIdDocument otherTyped = other as GetDocumentByIdDocument;
    return id == otherTyped.id && 
    documentType == otherTyped.documentType && 
    name == otherTyped.name && 
    description == otherTyped.description && 
    createdAt == otherTyped.createdAt;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, documentType.hashCode, name.hashCode, description.hashCode, createdAt.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['documentType'] = 
    documentTypeSerializer(documentType)
    ;
    json['name'] = nativeToJson<String>(name);
    if (description != null) {
      json['description'] = nativeToJson<String?>(description);
    }
    if (createdAt != null) {
      json['createdAt'] = createdAt!.toJson();
    }
    return json;
  }

  GetDocumentByIdDocument({
    required this.id,
    required this.documentType,
    required this.name,
    this.description,
    this.createdAt,
  });
}

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

    final GetDocumentByIdData otherTyped = other as GetDocumentByIdData;
    return document == otherTyped.document;
    
  }
  @override
  int get hashCode => document.hashCode;
  

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

  GetDocumentByIdData({
    this.document,
  });
}

@immutable
class GetDocumentByIdVariables {
  final String id;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  GetDocumentByIdVariables.fromJson(Map<String, 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 GetDocumentByIdVariables otherTyped = other as GetDocumentByIdVariables;
    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;
  }

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

