part of 'generated.dart';

class GetCertificateByIdVariablesBuilder {
  String id;

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

  QueryRef<GetCertificateByIdData, GetCertificateByIdVariables> ref() {
    GetCertificateByIdVariables vars= GetCertificateByIdVariables(id: id,);
    return _dataConnect.query("getCertificateById", dataDeserializer, varsSerializer, vars);
  }
}

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

    final GetCertificateByIdCertificate otherTyped = other as GetCertificateByIdCertificate;
    return id == otherTyped.id && 
    name == otherTyped.name && 
    description == otherTyped.description && 
    expiry == otherTyped.expiry && 
    status == otherTyped.status && 
    fileUrl == otherTyped.fileUrl && 
    icon == otherTyped.icon && 
    certificationType == otherTyped.certificationType && 
    issuer == otherTyped.issuer && 
    staffId == otherTyped.staffId && 
    validationStatus == otherTyped.validationStatus && 
    certificateNumber == otherTyped.certificateNumber && 
    updatedAt == otherTyped.updatedAt && 
    staff == otherTyped.staff;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, name.hashCode, description.hashCode, expiry.hashCode, status.hashCode, fileUrl.hashCode, icon.hashCode, certificationType.hashCode, issuer.hashCode, staffId.hashCode, validationStatus.hashCode, certificateNumber.hashCode, updatedAt.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);
    }
    if (certificationType != null) {
      json['certificationType'] = 
    complianceTypeSerializer(certificationType!)
    ;
    }
    if (issuer != null) {
      json['issuer'] = nativeToJson<String?>(issuer);
    }
    json['staffId'] = nativeToJson<String>(staffId);
    if (validationStatus != null) {
      json['validationStatus'] = 
    validationStatusSerializer(validationStatus!)
    ;
    }
    if (certificateNumber != null) {
      json['certificateNumber'] = nativeToJson<String?>(certificateNumber);
    }
    if (updatedAt != null) {
      json['updatedAt'] = updatedAt!.toJson();
    }
    json['staff'] = staff.toJson();
    return json;
  }

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

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

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

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

    final GetCertificateByIdData otherTyped = other as GetCertificateByIdData;
    return certificate == otherTyped.certificate;
    
  }
  @override
  int get hashCode => certificate.hashCode;
  

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

  GetCertificateByIdData({
    this.certificate,
  });
}

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

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

