part of 'generated.dart';

class ListCertificatesVariablesBuilder {
  
  final FirebaseDataConnect _dataConnect;
  ListCertificatesVariablesBuilder(this._dataConnect, );
  Deserializer<ListCertificatesData> dataDeserializer = (dynamic json)  => ListCertificatesData.fromJson(jsonDecode(json));
  
  Future<QueryResult<ListCertificatesData, void>> execute() {
    return ref().execute();
  }

  QueryRef<ListCertificatesData, void> ref() {
    
    return _dataConnect.query("listCertificates", dataDeserializer, emptySerializer, null);
  }
}

@immutable
class ListCertificatesCertificates {
  final String id;
  final String name;
  final String? description;
  final Timestamp? expiry;
  final EnumValue<CertificateStatus> status;
  final String? fileUrl;
  final String? icon;
  final String staffId;
  final EnumValue<ComplianceType>? certificationType;
  final String? issuer;
  final EnumValue<ValidationStatus>? validationStatus;
  final String? certificateNumber;
  final Timestamp? createdAt;
  final ListCertificatesCertificatesStaff staff;
  ListCertificatesCertificates.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  name = nativeFromJson<String>(json['name']),
  description = json['description'] == null ? null : nativeFromJson<String>(json['description']),
  expiry = json['expiry'] == null ? null : Timestamp.fromJson(json['expiry']),
  status = certificateStatusDeserializer(json['status']),
  fileUrl = json['fileUrl'] == null ? null : nativeFromJson<String>(json['fileUrl']),
  icon = json['icon'] == null ? null : nativeFromJson<String>(json['icon']),
  staffId = nativeFromJson<String>(json['staffId']),
  certificationType = json['certificationType'] == null ? null : complianceTypeDeserializer(json['certificationType']),
  issuer = json['issuer'] == null ? null : nativeFromJson<String>(json['issuer']),
  validationStatus = json['validationStatus'] == null ? null : validationStatusDeserializer(json['validationStatus']),
  certificateNumber = json['certificateNumber'] == null ? null : nativeFromJson<String>(json['certificateNumber']),
  createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']),
  staff = ListCertificatesCertificatesStaff.fromJson(json['staff']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListCertificatesCertificates otherTyped = other as ListCertificatesCertificates;
    return id == otherTyped.id && 
    name == otherTyped.name && 
    description == otherTyped.description && 
    expiry == otherTyped.expiry && 
    status == otherTyped.status && 
    fileUrl == otherTyped.fileUrl && 
    icon == otherTyped.icon && 
    staffId == otherTyped.staffId && 
    certificationType == otherTyped.certificationType && 
    issuer == otherTyped.issuer && 
    validationStatus == otherTyped.validationStatus && 
    certificateNumber == otherTyped.certificateNumber && 
    createdAt == otherTyped.createdAt && 
    staff == otherTyped.staff;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, name.hashCode, description.hashCode, expiry.hashCode, status.hashCode, fileUrl.hashCode, icon.hashCode, staffId.hashCode, certificationType.hashCode, issuer.hashCode, validationStatus.hashCode, certificateNumber.hashCode, createdAt.hashCode, staff.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['name'] = nativeToJson<String>(name);
    if (description != null) {
      json['description'] = nativeToJson<String?>(description);
    }
    if (expiry != null) {
      json['expiry'] = expiry!.toJson();
    }
    json['status'] = 
    certificateStatusSerializer(status)
    ;
    if (fileUrl != null) {
      json['fileUrl'] = nativeToJson<String?>(fileUrl);
    }
    if (icon != null) {
      json['icon'] = nativeToJson<String?>(icon);
    }
    json['staffId'] = nativeToJson<String>(staffId);
    if (certificationType != null) {
      json['certificationType'] = 
    complianceTypeSerializer(certificationType!)
    ;
    }
    if (issuer != null) {
      json['issuer'] = nativeToJson<String?>(issuer);
    }
    if (validationStatus != null) {
      json['validationStatus'] = 
    validationStatusSerializer(validationStatus!)
    ;
    }
    if (certificateNumber != null) {
      json['certificateNumber'] = nativeToJson<String?>(certificateNumber);
    }
    if (createdAt != null) {
      json['createdAt'] = createdAt!.toJson();
    }
    json['staff'] = staff.toJson();
    return json;
  }

  ListCertificatesCertificates({
    required this.id,
    required this.name,
    this.description,
    this.expiry,
    required this.status,
    this.fileUrl,
    this.icon,
    required this.staffId,
    this.certificationType,
    this.issuer,
    this.validationStatus,
    this.certificateNumber,
    this.createdAt,
    required this.staff,
  });
}

@immutable
class ListCertificatesCertificatesStaff {
  final String id;
  final String fullName;
  ListCertificatesCertificatesStaff.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  fullName = nativeFromJson<String>(json['fullName']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

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

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['fullName'] = nativeToJson<String>(fullName);
    return json;
  }

  ListCertificatesCertificatesStaff({
    required this.id,
    required this.fullName,
  });
}

@immutable
class ListCertificatesData {
  final List<ListCertificatesCertificates> certificates;
  ListCertificatesData.fromJson(dynamic json):
  
  certificates = (json['certificates'] as List<dynamic>)
        .map((e) => ListCertificatesCertificates.fromJson(e))
        .toList();
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListCertificatesData otherTyped = other as ListCertificatesData;
    return certificates == otherTyped.certificates;
    
  }
  @override
  int get hashCode => certificates.hashCode;
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['certificates'] = certificates.map((e) => e.toJson()).toList();
    return json;
  }

  ListCertificatesData({
    required this.certificates,
  });
}

