CreateApacuanaUserRequest.fromJson constructor

CreateApacuanaUserRequest.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory CreateApacuanaUserRequest.fromJson(Map<String, dynamic> json) {
  T? _as<T>(Object? v) => v == null ? null : (v as T);

  return CreateApacuanaUserRequest(
    kinddoc: json['kinddoc']?.toString() ?? '',
    doc: json['doc']?.toString() ?? '',
    email: _as<String>(json['email']),
    typeuser: json['typeuser'] is int
        ? json['typeuser'] as int
        : (json['typeuser'] != null
            ? int.tryParse(json['typeuser'].toString())
            : null),
    name: _as<String>(json['name']),
    lastname: _as<String>(json['lastname']),
    birthdate: _as<String>(json['birthdate']),
    gender: _as<String>(json['gender']),
    kindrif: _as<String>(json['kindrif']),
    rif: _as<String>(json['rif']),
    phone: json['phone'] is int
        ? json['phone'] as int
        : (json['phone'] != null
            ? int.tryParse(json['phone'].toString())
            : null),
    kindphone: _as<String>(json['kindphone']),
    postalcode: _as<String>(json['postalcode']),
    address: _as<String>(json['address']),
    fiscaladdress: _as<String>(json['fiscaladdress']),
    fiscalkindphone: _as<String>(json['fiscalkindphone']),
    fiscalphone: json['fiscalphone'] is int
        ? json['fiscalphone'] as int
        : (json['fiscalphone'] != null
            ? int.tryParse(json['fiscalphone'].toString())
            : null),
    occupation: _as<String>(json['occupation']),
    degree: _as<String>(json['degree']),
    university: _as<String>(json['university']),
    graduationyear: _as<String>(json['graduationyear']),
    collegiatenumber: _as<String>(json['collegiatenumber']),
    collegiateyear: _as<String>(json['collegiateyear']),
    companyname: _as<String>(json['companyname']),
    companykindrif: _as<String>(json['companykindrif']),
    companyrif: _as<String>(json['companyrif']),
    companystate: _as<String>(json['companystate']),
    companymunicipality: _as<String>(json['companymunicipality']),
    companyparish: _as<String>(json['companyparish']),
    companyaddress: _as<String>(json['companyaddress']),
    companykindphone: _as<String>(json['companykindphone']),
    companyphone: _as<String>(json['companyphone']),
    companypostalcode: _as<String>(json['companypostalcode']),
    companywebpage: _as<String>(json['companywebpage']),
    companycommercialregister: _as<String>(json['companycommercialregister']),
    companyregisterdate: _as<String>(json['companyregisterdate']),
    companyregisternumber: _as<String>(json['companyregisternumber']),
    companyconstitutiondate: _as<String>(json['companyconstitutiondate']),
    companypublishdate: _as<String>(json['companypublishdate']),
    companyconstitutiondecree: _as<String>(json['companyconstitutiondecree']),
    companynumberdecree: _as<String>(json['companynumberdecree']),
    positionprivate: _as<String>(json['positionprivate']),
    departmentprivate: _as<String>(json['departmentprivate']),
    authorizedprivate: _as<String>(json['authorizedprivate']),
    functionsprivate: _as<String>(json['functionsprivate']),
    publishprivate: _as<String>(json['publishprivate']),
    issuedateprivate: _as<String>(json['issuedateprivate']),
    kindphoneprivate: _as<String>(json['kindphoneprivate']),
    phoneprivate: json['phoneprivate'] is int
        ? json['phoneprivate'] as int
        : (json['phoneprivate'] != null
            ? int.tryParse(json['phoneprivate'].toString())
            : null),
    positionpublic: _as<String>(json['positionpublic']),
    departmentpublic: _as<String>(json['departmentpublic']),
    authorizedpublic: _as<String>(json['authorizedpublic']),
    functionspublic: _as<String>(json['functionspublic']),
    publishpublic: _as<String>(json['publishpublic']),
    issuedatepublic: _as<String>(json['issuedatepublic']),
    kindphonepublic: _as<String>(json['kindphonepublic']),
    phonepublic: json['phonepublic'] is int
        ? json['phonepublic'] as int
        : (json['phonepublic'] != null
            ? int.tryParse(json['phonepublic'].toString())
            : null),
    companyid: _as<String>(json['companyid']),
    files: json['files'] as Map<String, dynamic>?,
  );
}