part of 'generated.dart';

class UpdateCertificateVariablesBuilder {
  String id;
  Optional<String> _name = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _description = Optional.optional(nativeFromJson, nativeToJson);
  Optional<Timestamp> _expiry = Optional.optional((json) => json['expiry'] = Timestamp.fromJson(json['expiry']), defaultSerializer);
  Optional<CertificateStatus> _status = Optional.optional((data) => CertificateStatus.values.byName(data), enumSerializer);
  Optional<String> _fileUrl = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _icon = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _staffId = Optional.optional(nativeFromJson, nativeToJson);
  Optional<ComplianceType> _certificationType = Optional.optional((data) => ComplianceType.values.byName(data), enumSerializer);
  Optional<String> _issuer = Optional.optional(nativeFromJson, nativeToJson);
  Optional<ValidationStatus> _validationStatus = Optional.optional((data) => ValidationStatus.values.byName(data), enumSerializer);
  Optional<String> _certificateNumber = Optional.optional(nativeFromJson, nativeToJson);

  final FirebaseDataConnect _dataConnect;  UpdateCertificateVariablesBuilder name(String? t) {
   _name.value = t;
   return this;
  }
  UpdateCertificateVariablesBuilder description(String? t) {
   _description.value = t;
   return this;
  }
  UpdateCertificateVariablesBuilder expiry(Timestamp? t) {
   _expiry.value = t;
   return this;
  }
  UpdateCertificateVariablesBuilder status(CertificateStatus? t) {
   _status.value = t;
   return this;
  }
  UpdateCertificateVariablesBuilder fileUrl(String? t) {
   _fileUrl.value = t;
   return this;
  }
  UpdateCertificateVariablesBuilder icon(String? t) {
   _icon.value = t;
   return this;
  }
  UpdateCertificateVariablesBuilder staffId(String? t) {
   _staffId.value = t;
   return this;
  }
  UpdateCertificateVariablesBuilder certificationType(ComplianceType? t) {
   _certificationType.value = t;
   return this;
  }
  UpdateCertificateVariablesBuilder issuer(String? t) {
   _issuer.value = t;
   return this;
  }
  UpdateCertificateVariablesBuilder validationStatus(ValidationStatus? t) {
   _validationStatus.value = t;
   return this;
  }
  UpdateCertificateVariablesBuilder certificateNumber(String? t) {
   _certificateNumber.value = t;
   return this;
  }

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

  MutationRef<UpdateCertificateData, UpdateCertificateVariables> ref() {
    UpdateCertificateVariables vars= UpdateCertificateVariables(id: id,name: _name,description: _description,expiry: _expiry,status: _status,fileUrl: _fileUrl,icon: _icon,staffId: _staffId,certificationType: _certificationType,issuer: _issuer,validationStatus: _validationStatus,certificateNumber: _certificateNumber,);
    return _dataConnect.mutation("UpdateCertificate", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

    final UpdateCertificateData otherTyped = other as UpdateCertificateData;
    return certificate_update == otherTyped.certificate_update;
    
  }
  @override
  int get hashCode => certificate_update.hashCode;
  

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

  UpdateCertificateData({
    this.certificate_update,
  });
}

@immutable
class UpdateCertificateVariables {
  final String id;
  late final Optional<String>name;
  late final Optional<String>description;
  late final Optional<Timestamp>expiry;
  late final Optional<CertificateStatus>status;
  late final Optional<String>fileUrl;
  late final Optional<String>icon;
  late final Optional<String>staffId;
  late final Optional<ComplianceType>certificationType;
  late final Optional<String>issuer;
  late final Optional<ValidationStatus>validationStatus;
  late final Optional<String>certificateNumber;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  UpdateCertificateVariables.fromJson(Map<String, dynamic> json):
  
  id = nativeFromJson<String>(json['id']) {
  
  
  
    name = Optional.optional(nativeFromJson, nativeToJson);
    name.value = json['name'] == null ? null : nativeFromJson<String>(json['name']);
  
  
    description = Optional.optional(nativeFromJson, nativeToJson);
    description.value = json['description'] == null ? null : nativeFromJson<String>(json['description']);
  
  
    expiry = Optional.optional((json) => json['expiry'] = Timestamp.fromJson(json['expiry']), defaultSerializer);
    expiry.value = json['expiry'] == null ? null : Timestamp.fromJson(json['expiry']);
  
  
    status = Optional.optional((data) => CertificateStatus.values.byName(data), enumSerializer);
    status.value = json['status'] == null ? null : CertificateStatus.values.byName(json['status']);
  
  
    fileUrl = Optional.optional(nativeFromJson, nativeToJson);
    fileUrl.value = json['fileUrl'] == null ? null : nativeFromJson<String>(json['fileUrl']);
  
  
    icon = Optional.optional(nativeFromJson, nativeToJson);
    icon.value = json['icon'] == null ? null : nativeFromJson<String>(json['icon']);
  
  
    staffId = Optional.optional(nativeFromJson, nativeToJson);
    staffId.value = json['staffId'] == null ? null : nativeFromJson<String>(json['staffId']);
  
  
    certificationType = Optional.optional((data) => ComplianceType.values.byName(data), enumSerializer);
    certificationType.value = json['certificationType'] == null ? null : ComplianceType.values.byName(json['certificationType']);
  
  
    issuer = Optional.optional(nativeFromJson, nativeToJson);
    issuer.value = json['issuer'] == null ? null : nativeFromJson<String>(json['issuer']);
  
  
    validationStatus = Optional.optional((data) => ValidationStatus.values.byName(data), enumSerializer);
    validationStatus.value = json['validationStatus'] == null ? null : ValidationStatus.values.byName(json['validationStatus']);
  
  
    certificateNumber = Optional.optional(nativeFromJson, nativeToJson);
    certificateNumber.value = json['certificateNumber'] == null ? null : nativeFromJson<String>(json['certificateNumber']);
  
  }
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final UpdateCertificateVariables otherTyped = other as UpdateCertificateVariables;
    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;
    
  }
  @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]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    if(name.state == OptionalState.set) {
      json['name'] = name.toJson();
    }
    if(description.state == OptionalState.set) {
      json['description'] = description.toJson();
    }
    if(expiry.state == OptionalState.set) {
      json['expiry'] = expiry.toJson();
    }
    if(status.state == OptionalState.set) {
      json['status'] = status.toJson();
    }
    if(fileUrl.state == OptionalState.set) {
      json['fileUrl'] = fileUrl.toJson();
    }
    if(icon.state == OptionalState.set) {
      json['icon'] = icon.toJson();
    }
    if(staffId.state == OptionalState.set) {
      json['staffId'] = staffId.toJson();
    }
    if(certificationType.state == OptionalState.set) {
      json['certificationType'] = certificationType.toJson();
    }
    if(issuer.state == OptionalState.set) {
      json['issuer'] = issuer.toJson();
    }
    if(validationStatus.state == OptionalState.set) {
      json['validationStatus'] = validationStatus.toJson();
    }
    if(certificateNumber.state == OptionalState.set) {
      json['certificateNumber'] = certificateNumber.toJson();
    }
    return json;
  }

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

