use std::fmt;
use serde::{de, Deserialize, ser, Serialize};
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum ContactFunctionCode {
ReviewRepricingContact,
Code1B,
Code1C,
Code1D,
NewBusinessProcessing,
Physician,
ServiceTeam,
Underwriter,
LocalContact,
Code3A,
ClaimApprover,
Applicant,
Interviewer,
OwnerRepresentative,
AppointmentScheduler,
ConcurrentEmployerContact,
AuthorizedRepresentative,
Appraiser,
AdministrativeContractingOfficer,
AccountingDepartment,
CorporatePurchasingAgent,
AuthorizedFinancialContact,
Agent,
AfterHoursContact,
AdditionalInsuranceInformationContact,
PrimaryContact,
AlternateContact,
Administrator,
AttentionToParty,
AccountsPayableDepartment,
AccountsReceivableDepartment,
AuthorizedSignature,
MaterialSafetyDataSheetContact,
ReportAuthorizer,
Advisor,
CoInvestigator,
AdditionalContactPointsAtInstitutions,
Broker,
LocalPurchasingAgent,
BrokerContact,
BuyerNameOrDepartment,
BillInquiryContact,
Operations,
MarketingDepartment,
TechnicalDepartment,
WorkBrokerMaintenanceManager,
SchoolPrincipal,
BoardStaff,
BusinessUnitManager,
CarrierContact,
CoBorrower,
CustomerContactGrantingAppointment,
ChangedBy,
ComputerSystemsContact,
ContractContact,
Certifier,
CustomerEngineer,
ChiefExecutiveOfficer,
ChangeOrderApprover,
ChiefFinancialOfficer,
ChiefInformationOfficer,
ChairmanOfTheBoard,
ChiefOperatingOfficer,
ContainerManager,
GeneralContact,
ComponentEngineer,
CostAndScheduleCoordinator,
CustomerRelations,
CadCamSpecialist,
Claimant,
AuditingContact,
ClearinghouseContact,
ConfirmedWith,
PayersClaimOffice,
CaseManager,
ClaimRecipient,
DirectoryAdvertisingContact,
DeliveryContact,
DivisionDirector,
DesignEngineer,
Director,
DeliveryInstructionsContact,
DivisionManager,
DentalSchoolAdmissionsOffice,
DiscrepancyReportReplyContact,
Development,
Estimator,
EveningProgramsOffice,
EdiCoordinator,
EnteredBy,
EmergencyContactShipper,
EmergencyContactConsignee,
CodeEF,
Engineering,
EmergencyContact,
Engineer,
ExecutiveOfficer,
EmployerContact,
ElectronicSubmissionRecipient,
Endpoint,
ExecutiveVicePresident,
Expeditor,
FinancialAidOffice,
Coordinator,
ForwarderContact,
PrimaryControlPoint,
Licensee,
ForeclosingLenderAdministrativeContact,
FunctionalManager,
JointWorkAgent,
OfficeManager,
MarketingDirector,
Staff,
ComplianceOfficer,
GraduateFineArtsOffice,
GraduateBusinessOffice,
GuidanceCounselor,
GraduateEngineeringOffice,
GraduateAdmissionsOffice,
HazardousMaterialContact,
HumanResources,
InformationContact,
InternationalLogisticsControlOfficePointOfContact,
IssuingOfficer,
InsuredParty,
LawFirm,
AuthorizedNegotiator,
PreawardSurveyManager,
AcceptingOfficial,
Attorney,
ClerkOfCourt,
LawSchoolAdmissionsOffice,
LogisticsContact,
MaintenanceContact,
Mayor,
MedicalContact,
MedicalAdmissionsOffice,
Manufacturing,
Manager,
MultipleListingServiceStaff,
MultipleListingServiceVendor,
CustomerMaintenanceManager,
MexicanHazardousInformationContact,
NationalAgent,
NumericalControlEngineer,
NotaryPublic,
NotificationContact,
OtherAdult,
OrderContact,
OrderDepartment,
OfficeStaff,
Owner,
President,
PlantManager,
CodePC,
ProjectDirector,
ProcessEngineer,
PriceAdministration,
ProgramDirector,
Provider,
Preparer,
ProjectManager,
PerformanceEvaluationCommittee,
ManufacturingPlantContact,
ProductManager,
ProbationOrLegalOfficer,
ProductionRepresentative,
ProgramManager,
ParentOrGuardian,
PrototypeCoordinator,
PersonnelDepartment,
Partner,
ReportPreparer,
ParticipatingLaboratoryContact,
PrincipalStudyContactOrAuthor,
PurchaseServiceProvider,
Packager,
Patient,
QualityAssuranceContact,
QualityCoordinator,
QualityInspector,
QualityManager,
QuotingParty,
OrderingOfficer,
PortEngineer,
RentalCompanyAdministrativeContact,
RealEstatePropertyOccupant,
RebateChargebackContact,
ReceivingDock,
ReceivingContact,
RealEstatePropertyKeyHolder,
Registrar,
RecallAdministrator,
ResponsiblePerson,
Requestor,
RateSupervisorOrClerk,
Respondent,
SalesAdministration,
Student,
ScheduleContact,
ShippingDepartment,
ServiceOrganization,
StudentInAbsentia,
Secretary,
ShipperContact,
Investigator,
Spouse,
SchoolClerk,
Collector,
SubmittingContact,
StudySubmitterContact,
ServiceOrderWriter,
SpecialProgramContact,
SystemsAdministrator,
SalesRepresentativeOrDepartment,
Supervisor,
ServiceTechnician,
SupplierContact,
ServiceManager,
SocialServicesWorker,
SecondaryTaxpayer,
TrafficAdministrator,
TelephoneAnsweringServiceContact,
CollegeOfEducationAdmissionsOffice,
TenderDeveloper,
Treasurer,
SchoolOfTheologyAdmissionsOffice,
Transmitter,
Tenant,
PrimaryTaxpayer,
TechnicalMarketingRepresentative,
PlatformMaintenanceManager,
UndergraduateAdmissionsOffice,
UnionPresident,
Processor,
UltimateReceiver,
SchoolOfVeterinaryMedicineAdmissionsOffice,
VicePresident,
Warehouse,
Witness,
TechnicalWriter,
WaiverApplicationContact,
MutuallyDefined,
}
impl ContactFunctionCode {
pub fn code(&self) -> &str {
{
use ContactFunctionCode::*;
match self {
ReviewRepricingContact => "1A",
Code1B => "1B",
Code1C => "1C",
Code1D => "1D",
NewBusinessProcessing => "1E",
Physician => "1F",
ServiceTeam => "1G",
Underwriter => "1H",
LocalContact => "1I",
Code3A => "3A",
ClaimApprover => "A1",
Applicant => "A2",
Interviewer => "A3",
OwnerRepresentative => "A4",
AppointmentScheduler => "A5",
ConcurrentEmployerContact => "A6",
AuthorizedRepresentative => "AA",
Appraiser => "AB",
AdministrativeContractingOfficer => "AC",
AccountingDepartment => "AD",
CorporatePurchasingAgent => "AE",
AuthorizedFinancialContact => "AF",
Agent => "AG",
AfterHoursContact => "AH",
AdditionalInsuranceInformationContact => "AI",
PrimaryContact => "AJ",
AlternateContact => "AL",
Administrator => "AM",
AttentionToParty => "AN",
AccountsPayableDepartment => "AP",
AccountsReceivableDepartment => "AR",
AuthorizedSignature => "AS",
MaterialSafetyDataSheetContact => "AT",
ReportAuthorizer => "AU",
Advisor => "AV",
CoInvestigator => "AW",
AdditionalContactPointsAtInstitutions => "AX",
Broker => "BA",
LocalPurchasingAgent => "BB",
BrokerContact => "BC",
BuyerNameOrDepartment => "BD",
BillInquiryContact => "BI",
Operations => "BJ",
MarketingDepartment => "BK",
TechnicalDepartment => "BL",
WorkBrokerMaintenanceManager => "BM",
SchoolPrincipal => "BP",
BoardStaff => "BS",
BusinessUnitManager => "BU",
CarrierContact => "C1",
CoBorrower => "C2",
CustomerContactGrantingAppointment => "CA",
ChangedBy => "CB",
ComputerSystemsContact => "CC",
ContractContact => "CD",
Certifier => "CE",
CustomerEngineer => "CF",
ChiefExecutiveOfficer => "CG",
ChangeOrderApprover => "CH",
ChiefFinancialOfficer => "CI",
ChiefInformationOfficer => "CJ",
ChairmanOfTheBoard => "CK",
ChiefOperatingOfficer => "CL",
ContainerManager => "CM",
GeneralContact => "CN",
ComponentEngineer => "CO",
CostAndScheduleCoordinator => "CP",
CustomerRelations => "CR",
CadCamSpecialist => "CS",
Claimant => "CT",
AuditingContact => "CU",
ClearinghouseContact => "CV",
ConfirmedWith => "CW",
PayersClaimOffice => "CX",
CaseManager => "CY",
ClaimRecipient => "CZ",
DirectoryAdvertisingContact => "DA",
DeliveryContact => "DC",
DivisionDirector => "DD",
DesignEngineer => "DE",
Director => "DF",
DeliveryInstructionsContact => "DI",
DivisionManager => "DM",
DentalSchoolAdmissionsOffice => "DN",
DiscrepancyReportReplyContact => "DR",
Development => "DV",
Estimator => "E1",
EveningProgramsOffice => "E2",
EdiCoordinator => "EA",
EnteredBy => "EB",
EmergencyContactShipper => "EC",
EmergencyContactConsignee => "ED",
CodeEF => "EF",
Engineering => "EG",
EmergencyContact => "EM",
Engineer => "EN",
ExecutiveOfficer => "EO",
EmployerContact => "EP",
ElectronicSubmissionRecipient => "ES",
Endpoint => "EU",
ExecutiveVicePresident => "EV",
Expeditor => "EX",
FinancialAidOffice => "FA",
Coordinator => "FB",
ForwarderContact => "FC",
PrimaryControlPoint => "FD",
Licensee => "FF",
ForeclosingLenderAdministrativeContact => "FL",
FunctionalManager => "FM",
JointWorkAgent => "FN",
OfficeManager => "FO",
MarketingDirector => "FP",
Staff => "FQ",
ComplianceOfficer => "FR",
GraduateFineArtsOffice => "GA",
GraduateBusinessOffice => "GB",
GuidanceCounselor => "GC",
GraduateEngineeringOffice => "GE",
GraduateAdmissionsOffice => "GR",
HazardousMaterialContact => "HM",
HumanResources => "HR",
InformationContact => "IC",
InternationalLogisticsControlOfficePointOfContact => "IL",
IssuingOfficer => "IO",
InsuredParty => "IP",
LawFirm => "IS",
AuthorizedNegotiator => "KA",
PreawardSurveyManager => "KB",
AcceptingOfficial => "KC",
Attorney => "KP",
ClerkOfCourt => "KT",
LawSchoolAdmissionsOffice => "LD",
LogisticsContact => "LG",
MaintenanceContact => "MA",
Mayor => "MB",
MedicalContact => "MC",
MedicalAdmissionsOffice => "MD",
Manufacturing => "ME",
Manager => "MG",
MultipleListingServiceStaff => "MK",
MultipleListingServiceVendor => "ML",
CustomerMaintenanceManager => "MM",
MexicanHazardousInformationContact => "MX",
NationalAgent => "NA",
NumericalControlEngineer => "NC",
NotaryPublic => "NP",
NotificationContact => "NT",
OtherAdult => "OA",
OrderContact => "OC",
OrderDepartment => "OD",
OfficeStaff => "OS",
Owner => "OW",
President => "PA",
PlantManager => "PB",
CodePC => "PC",
ProjectDirector => "PD",
ProcessEngineer => "PE",
PriceAdministration => "PF",
ProgramDirector => "PG",
Provider => "PH",
Preparer => "PI",
ProjectManager => "PJ",
PerformanceEvaluationCommittee => "PK",
ManufacturingPlantContact => "PL",
ProductManager => "PM",
ProbationOrLegalOfficer => "PN",
ProductionRepresentative => "PO",
ProgramManager => "PP",
ParentOrGuardian => "PQ",
PrototypeCoordinator => "PR",
PersonnelDepartment => "PS",
Partner => "PT",
ReportPreparer => "PU",
ParticipatingLaboratoryContact => "PV",
PrincipalStudyContactOrAuthor => "PW",
PurchaseServiceProvider => "PX",
Packager => "PY",
Patient => "PZ",
QualityAssuranceContact => "QA",
QualityCoordinator => "QC",
QualityInspector => "QI",
QualityManager => "QM",
QuotingParty => "QP",
OrderingOfficer => "QR",
PortEngineer => "QY",
RentalCompanyAdministrativeContact => "RA",
RealEstatePropertyOccupant => "RB",
RebateChargebackContact => "RC",
ReceivingDock => "RD",
ReceivingContact => "RE",
RealEstatePropertyKeyHolder => "RF",
Registrar => "RG",
RecallAdministrator => "RM",
ResponsiblePerson => "RP",
Requestor => "RQ",
RateSupervisorOrClerk => "RS",
Respondent => "RZ",
SalesAdministration => "SA",
Student => "SB",
ScheduleContact => "SC",
ShippingDepartment => "SD",
ServiceOrganization => "SE",
StudentInAbsentia => "SF",
Secretary => "SG",
ShipperContact => "SH",
Investigator => "SI",
Spouse => "SJ",
SchoolClerk => "SK",
Collector => "SL",
SubmittingContact => "SM",
StudySubmitterContact => "SN",
ServiceOrderWriter => "SO",
SpecialProgramContact => "SP",
SystemsAdministrator => "SQ",
SalesRepresentativeOrDepartment => "SR",
Supervisor => "SS",
ServiceTechnician => "ST",
SupplierContact => "SU",
ServiceManager => "SV",
SocialServicesWorker => "SW",
SecondaryTaxpayer => "SY",
TrafficAdministrator => "TA",
TelephoneAnsweringServiceContact => "TB",
CollegeOfEducationAdmissionsOffice => "TC",
TenderDeveloper => "TD",
Treasurer => "TE",
SchoolOfTheologyAdmissionsOffice => "TH",
Transmitter => "TM",
Tenant => "TN",
PrimaryTaxpayer => "TP",
TechnicalMarketingRepresentative => "TR",
PlatformMaintenanceManager => "TY",
UndergraduateAdmissionsOffice => "UG",
UnionPresident => "UP",
Processor => "UQ",
UltimateReceiver => "UR",
SchoolOfVeterinaryMedicineAdmissionsOffice => "VM",
VicePresident => "VP",
Warehouse => "WH",
Witness => "WI",
TechnicalWriter => "WR",
WaiverApplicationContact => "WV",
MutuallyDefined => "ZZ",
}
}
}
pub fn from_code(code: &[u8]) -> Option<ContactFunctionCode> {
use ContactFunctionCode::*;
match code {
b"1A" => Some(ReviewRepricingContact),
b"1B" => Some(Code1B),
b"1C" => Some(Code1C),
b"1D" => Some(Code1D),
b"1E" => Some(NewBusinessProcessing),
b"1F" => Some(Physician),
b"1G" => Some(ServiceTeam),
b"1H" => Some(Underwriter),
b"1I" => Some(LocalContact),
b"3A" => Some(Code3A),
b"A1" => Some(ClaimApprover),
b"A2" => Some(Applicant),
b"A3" => Some(Interviewer),
b"A4" => Some(OwnerRepresentative),
b"A5" => Some(AppointmentScheduler),
b"A6" => Some(ConcurrentEmployerContact),
b"AA" => Some(AuthorizedRepresentative),
b"AB" => Some(Appraiser),
b"AC" => Some(AdministrativeContractingOfficer),
b"AD" => Some(AccountingDepartment),
b"AE" => Some(CorporatePurchasingAgent),
b"AF" => Some(AuthorizedFinancialContact),
b"AG" => Some(Agent),
b"AH" => Some(AfterHoursContact),
b"AI" => Some(AdditionalInsuranceInformationContact),
b"AJ" => Some(PrimaryContact),
b"AL" => Some(AlternateContact),
b"AM" => Some(Administrator),
b"AN" => Some(AttentionToParty),
b"AP" => Some(AccountsPayableDepartment),
b"AR" => Some(AccountsReceivableDepartment),
b"AS" => Some(AuthorizedSignature),
b"AT" => Some(MaterialSafetyDataSheetContact),
b"AU" => Some(ReportAuthorizer),
b"AV" => Some(Advisor),
b"AW" => Some(CoInvestigator),
b"AX" => Some(AdditionalContactPointsAtInstitutions),
b"BA" => Some(Broker),
b"BB" => Some(LocalPurchasingAgent),
b"BC" => Some(BrokerContact),
b"BD" => Some(BuyerNameOrDepartment),
b"BI" => Some(BillInquiryContact),
b"BJ" => Some(Operations),
b"BK" => Some(MarketingDepartment),
b"BL" => Some(TechnicalDepartment),
b"BM" => Some(WorkBrokerMaintenanceManager),
b"BP" => Some(SchoolPrincipal),
b"BS" => Some(BoardStaff),
b"BU" => Some(BusinessUnitManager),
b"C1" => Some(CarrierContact),
b"C2" => Some(CoBorrower),
b"CA" => Some(CustomerContactGrantingAppointment),
b"CB" => Some(ChangedBy),
b"CC" => Some(ComputerSystemsContact),
b"CD" => Some(ContractContact),
b"CE" => Some(Certifier),
b"CF" => Some(CustomerEngineer),
b"CG" => Some(ChiefExecutiveOfficer),
b"CH" => Some(ChangeOrderApprover),
b"CI" => Some(ChiefFinancialOfficer),
b"CJ" => Some(ChiefInformationOfficer),
b"CK" => Some(ChairmanOfTheBoard),
b"CL" => Some(ChiefOperatingOfficer),
b"CM" => Some(ContainerManager),
b"CN" => Some(GeneralContact),
b"CO" => Some(ComponentEngineer),
b"CP" => Some(CostAndScheduleCoordinator),
b"CR" => Some(CustomerRelations),
b"CS" => Some(CadCamSpecialist),
b"CT" => Some(Claimant),
b"CU" => Some(AuditingContact),
b"CV" => Some(ClearinghouseContact),
b"CW" => Some(ConfirmedWith),
b"CX" => Some(PayersClaimOffice),
b"CY" => Some(CaseManager),
b"CZ" => Some(ClaimRecipient),
b"DA" => Some(DirectoryAdvertisingContact),
b"DC" => Some(DeliveryContact),
b"DD" => Some(DivisionDirector),
b"DE" => Some(DesignEngineer),
b"DF" => Some(Director),
b"DI" => Some(DeliveryInstructionsContact),
b"DM" => Some(DivisionManager),
b"DN" => Some(DentalSchoolAdmissionsOffice),
b"DR" => Some(DiscrepancyReportReplyContact),
b"DV" => Some(Development),
b"E1" => Some(Estimator),
b"E2" => Some(EveningProgramsOffice),
b"EA" => Some(EdiCoordinator),
b"EB" => Some(EnteredBy),
b"EC" => Some(EmergencyContactShipper),
b"ED" => Some(EmergencyContactConsignee),
b"EF" => Some(CodeEF),
b"EG" => Some(Engineering),
b"EM" => Some(EmergencyContact),
b"EN" => Some(Engineer),
b"EO" => Some(ExecutiveOfficer),
b"EP" => Some(EmployerContact),
b"ES" => Some(ElectronicSubmissionRecipient),
b"EU" => Some(Endpoint),
b"EV" => Some(ExecutiveVicePresident),
b"EX" => Some(Expeditor),
b"FA" => Some(FinancialAidOffice),
b"FB" => Some(Coordinator),
b"FC" => Some(ForwarderContact),
b"FD" => Some(PrimaryControlPoint),
b"FF" => Some(Licensee),
b"FL" => Some(ForeclosingLenderAdministrativeContact),
b"FM" => Some(FunctionalManager),
b"FN" => Some(JointWorkAgent),
b"FO" => Some(OfficeManager),
b"FP" => Some(MarketingDirector),
b"FQ" => Some(Staff),
b"FR" => Some(ComplianceOfficer),
b"GA" => Some(GraduateFineArtsOffice),
b"GB" => Some(GraduateBusinessOffice),
b"GC" => Some(GuidanceCounselor),
b"GE" => Some(GraduateEngineeringOffice),
b"GR" => Some(GraduateAdmissionsOffice),
b"HM" => Some(HazardousMaterialContact),
b"HR" => Some(HumanResources),
b"IC" => Some(InformationContact),
b"IL" => Some(InternationalLogisticsControlOfficePointOfContact),
b"IO" => Some(IssuingOfficer),
b"IP" => Some(InsuredParty),
b"IS" => Some(LawFirm),
b"KA" => Some(AuthorizedNegotiator),
b"KB" => Some(PreawardSurveyManager),
b"KC" => Some(AcceptingOfficial),
b"KP" => Some(Attorney),
b"KT" => Some(ClerkOfCourt),
b"LD" => Some(LawSchoolAdmissionsOffice),
b"LG" => Some(LogisticsContact),
b"MA" => Some(MaintenanceContact),
b"MB" => Some(Mayor),
b"MC" => Some(MedicalContact),
b"MD" => Some(MedicalAdmissionsOffice),
b"ME" => Some(Manufacturing),
b"MG" => Some(Manager),
b"MK" => Some(MultipleListingServiceStaff),
b"ML" => Some(MultipleListingServiceVendor),
b"MM" => Some(CustomerMaintenanceManager),
b"MX" => Some(MexicanHazardousInformationContact),
b"NA" => Some(NationalAgent),
b"NC" => Some(NumericalControlEngineer),
b"NP" => Some(NotaryPublic),
b"NT" => Some(NotificationContact),
b"OA" => Some(OtherAdult),
b"OC" => Some(OrderContact),
b"OD" => Some(OrderDepartment),
b"OS" => Some(OfficeStaff),
b"OW" => Some(Owner),
b"PA" => Some(President),
b"PB" => Some(PlantManager),
b"PC" => Some(CodePC),
b"PD" => Some(ProjectDirector),
b"PE" => Some(ProcessEngineer),
b"PF" => Some(PriceAdministration),
b"PG" => Some(ProgramDirector),
b"PH" => Some(Provider),
b"PI" => Some(Preparer),
b"PJ" => Some(ProjectManager),
b"PK" => Some(PerformanceEvaluationCommittee),
b"PL" => Some(ManufacturingPlantContact),
b"PM" => Some(ProductManager),
b"PN" => Some(ProbationOrLegalOfficer),
b"PO" => Some(ProductionRepresentative),
b"PP" => Some(ProgramManager),
b"PQ" => Some(ParentOrGuardian),
b"PR" => Some(PrototypeCoordinator),
b"PS" => Some(PersonnelDepartment),
b"PT" => Some(Partner),
b"PU" => Some(ReportPreparer),
b"PV" => Some(ParticipatingLaboratoryContact),
b"PW" => Some(PrincipalStudyContactOrAuthor),
b"PX" => Some(PurchaseServiceProvider),
b"PY" => Some(Packager),
b"PZ" => Some(Patient),
b"QA" => Some(QualityAssuranceContact),
b"QC" => Some(QualityCoordinator),
b"QI" => Some(QualityInspector),
b"QM" => Some(QualityManager),
b"QP" => Some(QuotingParty),
b"QR" => Some(OrderingOfficer),
b"QY" => Some(PortEngineer),
b"RA" => Some(RentalCompanyAdministrativeContact),
b"RB" => Some(RealEstatePropertyOccupant),
b"RC" => Some(RebateChargebackContact),
b"RD" => Some(ReceivingDock),
b"RE" => Some(ReceivingContact),
b"RF" => Some(RealEstatePropertyKeyHolder),
b"RG" => Some(Registrar),
b"RM" => Some(RecallAdministrator),
b"RP" => Some(ResponsiblePerson),
b"RQ" => Some(Requestor),
b"RS" => Some(RateSupervisorOrClerk),
b"RZ" => Some(Respondent),
b"SA" => Some(SalesAdministration),
b"SB" => Some(Student),
b"SC" => Some(ScheduleContact),
b"SD" => Some(ShippingDepartment),
b"SE" => Some(ServiceOrganization),
b"SF" => Some(StudentInAbsentia),
b"SG" => Some(Secretary),
b"SH" => Some(ShipperContact),
b"SI" => Some(Investigator),
b"SJ" => Some(Spouse),
b"SK" => Some(SchoolClerk),
b"SL" => Some(Collector),
b"SM" => Some(SubmittingContact),
b"SN" => Some(StudySubmitterContact),
b"SO" => Some(ServiceOrderWriter),
b"SP" => Some(SpecialProgramContact),
b"SQ" => Some(SystemsAdministrator),
b"SR" => Some(SalesRepresentativeOrDepartment),
b"SS" => Some(Supervisor),
b"ST" => Some(ServiceTechnician),
b"SU" => Some(SupplierContact),
b"SV" => Some(ServiceManager),
b"SW" => Some(SocialServicesWorker),
b"SY" => Some(SecondaryTaxpayer),
b"TA" => Some(TrafficAdministrator),
b"TB" => Some(TelephoneAnsweringServiceContact),
b"TC" => Some(CollegeOfEducationAdmissionsOffice),
b"TD" => Some(TenderDeveloper),
b"TE" => Some(Treasurer),
b"TH" => Some(SchoolOfTheologyAdmissionsOffice),
b"TM" => Some(Transmitter),
b"TN" => Some(Tenant),
b"TP" => Some(PrimaryTaxpayer),
b"TR" => Some(TechnicalMarketingRepresentative),
b"TY" => Some(PlatformMaintenanceManager),
b"UG" => Some(UndergraduateAdmissionsOffice),
b"UP" => Some(UnionPresident),
b"UQ" => Some(Processor),
b"UR" => Some(UltimateReceiver),
b"VM" => Some(SchoolOfVeterinaryMedicineAdmissionsOffice),
b"VP" => Some(VicePresident),
b"WH" => Some(Warehouse),
b"WI" => Some(Witness),
b"WR" => Some(TechnicalWriter),
b"WV" => Some(WaiverApplicationContact),
b"ZZ" => Some(MutuallyDefined),
_ => None,
}
}
fn description(&self) -> &str {
use ContactFunctionCode::*;
match self {
ReviewRepricingContact => "Review/Repricing Contact",
Code1B => "Preferred Provider Organization (PPO) Contact",
Code1C => "Health Maintenance Organization (HMO) Contact",
Code1D => "Third-party Administrator (TPA) Contact",
NewBusinessProcessing => "New Business Processing",
Physician => "Physician",
ServiceTeam => "Service Team",
Underwriter => "Underwriter",
LocalContact => "Local Contact",
Code3A => "Automated Clearinghouse (ACH) Contact",
ClaimApprover => "Claim Approver",
Applicant => "Applicant",
Interviewer => "Interviewer",
OwnerRepresentative => "Owner Representative",
AppointmentScheduler => "Appointment Scheduler",
ConcurrentEmployerContact => "Concurrent Employer Contact",
AuthorizedRepresentative => "Authorized Representative",
Appraiser => "Appraiser",
AdministrativeContractingOfficer => "Administrative Contracting Officer",
AccountingDepartment => "Accounting Department",
CorporatePurchasingAgent => "Corporate Purchasing Agent",
AuthorizedFinancialContact => "Authorized Financial Contact",
Agent => "Agent",
AfterHoursContact => "After-Hours Contact",
AdditionalInsuranceInformationContact => {
"Additional Insurance Information Contact"
}
PrimaryContact => "Primary Contact",
AlternateContact => "Alternate Contact",
Administrator => "Administrator",
AttentionToParty => "Attention-to Party",
AccountsPayableDepartment => "Accounts Payable Department",
AccountsReceivableDepartment => "Accounts Receivable Department",
AuthorizedSignature => "Authorized Signature",
MaterialSafetyDataSheetContact => "Material Safety Data Sheet Contact",
ReportAuthorizer => "Report Authorizer",
Advisor => "Advisor",
CoInvestigator => "Co-investigator",
AdditionalContactPointsAtInstitutions => {
"Additional Contact Points at Institutions"
}
Broker => "Broker",
LocalPurchasingAgent => "Local Purchasing Agent",
BrokerContact => "Broker Contact",
BuyerNameOrDepartment => "Buyer Name or Department",
BillInquiryContact => "Bill Inquiry Contact",
Operations => "Operations",
MarketingDepartment => "Marketing Department",
TechnicalDepartment => "Technical Department",
WorkBrokerMaintenanceManager => "Work Broker Maintenance Manager",
SchoolPrincipal => "School Principal",
BoardStaff => "Board Staff",
BusinessUnitManager => "Business Unit Manager",
CarrierContact => "Carrier Contact",
CoBorrower => "Co-borrower",
CustomerContactGrantingAppointment => "Customer Contact Granting Appointment",
ChangedBy => "Changed By",
ComputerSystemsContact => "Computer Systems Contact",
ContractContact => "Contract Contact",
Certifier => "Certifier",
CustomerEngineer => "Customer Engineer",
ChiefExecutiveOfficer => "Chief Executive Officer",
ChangeOrderApprover => "Change Order Approver",
ChiefFinancialOfficer => "Chief Financial Officer",
ChiefInformationOfficer => "Chief Information Officer",
ChairmanOfTheBoard => "Chairman of the Board",
ChiefOperatingOfficer => "Chief Operating Officer",
ContainerManager => "Container Manager",
GeneralContact => "General Contact",
ComponentEngineer => "Component Engineer",
CostAndScheduleCoordinator => "Cost and Schedule Coordinator",
CustomerRelations => "Customer Relations",
CadCamSpecialist => "CAD/CAM Specialist",
Claimant => "Claimant",
AuditingContact => "Auditing Contact",
ClearinghouseContact => "Clearinghouse Contact",
ConfirmedWith => "Confirmed With",
PayersClaimOffice => "Payers Claim Office",
CaseManager => "Case Manager",
ClaimRecipient => "Claim Recipient",
DirectoryAdvertisingContact => "Directory Advertising Contact",
DeliveryContact => "Delivery Contact",
DivisionDirector => "Division Director",
DesignEngineer => "Design Engineer",
Director => "Director",
DeliveryInstructionsContact => "Delivery Instructions Contact",
DivisionManager => "Division Manager",
DentalSchoolAdmissionsOffice => "Dental School Admissions Office",
DiscrepancyReportReplyContact => "Discrepancy Report Reply Contact",
Development => "Development",
Estimator => "Estimator",
EveningProgramsOffice => "Evening Programs Office",
EdiCoordinator => "EDI Coordinator",
EnteredBy => "Entered By",
EmergencyContactShipper => "Emergency Contact-Shipper",
EmergencyContactConsignee => "Emergency Contact-Consignee",
CodeEF => {
"Emergency Contact-Military Surface Deployment and Distribution Command (SDDC)"
}
Engineering => "Engineering",
EmergencyContact => "Emergency Contact",
Engineer => "Engineer",
ExecutiveOfficer => "Executive Officer",
EmployerContact => "Employer Contact",
ElectronicSubmissionRecipient => "Electronic Submission Recipient",
Endpoint => "Endpoint",
ExecutiveVicePresident => "Executive Vice-President",
Expeditor => "Expeditor",
FinancialAidOffice => "Financial Aid Office",
Coordinator => "Coordinator",
ForwarderContact => "Forwarder Contact",
PrimaryControlPoint => "Primary Control Point",
Licensee => "Licensee",
ForeclosingLenderAdministrativeContact => {
"Foreclosing Lender Administrative Contact"
}
FunctionalManager => "Functional Manager",
JointWorkAgent => "Joint Work Agent",
OfficeManager => "Office Manager",
MarketingDirector => "Marketing Director",
Staff => "Staff",
ComplianceOfficer => "Compliance Officer",
GraduateFineArtsOffice => "Graduate Fine Arts Office",
GraduateBusinessOffice => "Graduate Business Office",
GuidanceCounselor => "Guidance Counselor",
GraduateEngineeringOffice => "Graduate Engineering Office",
GraduateAdmissionsOffice => "Graduate Admissions Office",
HazardousMaterialContact => "Hazardous Material Contact",
HumanResources => "Human Resources",
InformationContact => "Information Contact",
InternationalLogisticsControlOfficePointOfContact => {
"International Logistics Control Office Point of Contact"
}
IssuingOfficer => "Issuing Officer",
InsuredParty => "Insured Party",
LawFirm => "Law Firm",
AuthorizedNegotiator => "Authorized Negotiator",
PreawardSurveyManager => "Preaward Survey Manager",
AcceptingOfficial => "Accepting Official",
Attorney => "Attorney",
ClerkOfCourt => "Clerk of Court",
LawSchoolAdmissionsOffice => "Law School Admissions Office",
LogisticsContact => "Logistics Contact",
MaintenanceContact => "Maintenance Contact",
Mayor => "Mayor",
MedicalContact => "Medical Contact",
MedicalAdmissionsOffice => "Medical Admissions Office",
Manufacturing => "Manufacturing",
Manager => "Manager",
MultipleListingServiceStaff => "Multiple Listing Service Staff",
MultipleListingServiceVendor => "Multiple Listing Service Vendor",
CustomerMaintenanceManager => "Customer Maintenance Manager",
MexicanHazardousInformationContact => "Mexican Hazardous Information Contact",
NationalAgent => "National Agent",
NumericalControlEngineer => "Numerical Control Engineer",
NotaryPublic => "Notary Public",
NotificationContact => "Notification Contact",
OtherAdult => "Other Adult",
OrderContact => "Order Contact",
OrderDepartment => "Order Department",
OfficeStaff => "Office Staff",
Owner => "Owner",
President => "President",
PlantManager => "Plant Manager",
CodePC => "Purchasing Contracting Officer (PCO)",
ProjectDirector => "Project Director",
ProcessEngineer => "Process Engineer",
PriceAdministration => "Price Administration",
ProgramDirector => "Program Director",
Provider => "Provider",
Preparer => "Preparer",
ProjectManager => "Project Manager",
PerformanceEvaluationCommittee => "Performance Evaluation Committee",
ManufacturingPlantContact => "Manufacturing Plant Contact",
ProductManager => "Product Manager",
ProbationOrLegalOfficer => "Probation or Legal Officer",
ProductionRepresentative => "Production Representative",
ProgramManager => "Program Manager",
ParentOrGuardian => "Parent or Guardian",
PrototypeCoordinator => "Prototype Coordinator",
PersonnelDepartment => "Personnel Department",
Partner => "Partner",
ReportPreparer => "Report Preparer",
ParticipatingLaboratoryContact => "Participating Laboratory Contact",
PrincipalStudyContactOrAuthor => "Principal Study Contact or Author",
PurchaseServiceProvider => "Purchase Service Provider",
Packager => "Packager",
Patient => "Patient",
QualityAssuranceContact => "Quality Assurance Contact",
QualityCoordinator => "Quality Coordinator",
QualityInspector => "Quality Inspector",
QualityManager => "Quality Manager",
QuotingParty => "Quoting Party",
OrderingOfficer => "Ordering Officer",
PortEngineer => "Port Engineer",
RentalCompanyAdministrativeContact => "Rental Company Administrative Contact",
RealEstatePropertyOccupant => "Real Estate Property Occupant",
RebateChargebackContact => "Rebate/Chargeback Contact",
ReceivingDock => "Receiving Dock",
ReceivingContact => "Receiving Contact",
RealEstatePropertyKeyHolder => "Real Estate Property Key Holder",
Registrar => "Registrar",
RecallAdministrator => "Recall Administrator",
ResponsiblePerson => "Responsible Person",
Requestor => "Requestor",
RateSupervisorOrClerk => "Rate Supervisor or Clerk",
Respondent => "Respondent",
SalesAdministration => "Sales Administration",
Student => "Student",
ScheduleContact => "Schedule Contact",
ShippingDepartment => "Shipping Department",
ServiceOrganization => "Service Organization",
StudentInAbsentia => "Student in Absentia",
Secretary => "Secretary",
ShipperContact => "Shipper Contact",
Investigator => "Investigator",
Spouse => "Spouse",
SchoolClerk => "School Clerk",
Collector => "Collector",
SubmittingContact => "Submitting Contact",
StudySubmitterContact => "Study Submitter Contact",
ServiceOrderWriter => "Service Order Writer",
SpecialProgramContact => "Special Program Contact",
SystemsAdministrator => "Systems Administrator",
SalesRepresentativeOrDepartment => "Sales Representative or Department",
Supervisor => "Supervisor",
ServiceTechnician => "Service Technician",
SupplierContact => "Supplier Contact",
ServiceManager => "Service Manager",
SocialServicesWorker => "Social Services Worker",
SecondaryTaxpayer => "Secondary Taxpayer",
TrafficAdministrator => "Traffic Administrator",
TelephoneAnsweringServiceContact => "Telephone Answering Service Contact",
CollegeOfEducationAdmissionsOffice => {
"College of Education Admissions Office"
}
TenderDeveloper => "Tender Developer",
Treasurer => "Treasurer",
SchoolOfTheologyAdmissionsOffice => "School of Theology Admissions Office",
Transmitter => "Transmitter",
Tenant => "Tenant",
PrimaryTaxpayer => "Primary Taxpayer",
TechnicalMarketingRepresentative => "Technical Marketing Representative",
PlatformMaintenanceManager => "Platform Maintenance Manager",
UndergraduateAdmissionsOffice => "Undergraduate Admissions Office",
UnionPresident => "Union President",
Processor => "Processor",
UltimateReceiver => "Ultimate Receiver",
SchoolOfVeterinaryMedicineAdmissionsOffice => {
"School of Veterinary Medicine Admissions Office"
}
VicePresident => "Vice President",
Warehouse => "Warehouse",
Witness => "Witness",
TechnicalWriter => "Technical Writer",
WaiverApplicationContact => "Waiver Application Contact",
MutuallyDefined => "Mutually Defined",
}
}
fn from_description(description: &str) -> Option<ContactFunctionCode> {
{
use ContactFunctionCode::*;
match description {
"Review/Repricing Contact" => Some(ReviewRepricingContact),
"Preferred Provider Organization (PPO) Contact" => Some(Code1B),
"Health Maintenance Organization (HMO) Contact" => Some(Code1C),
"Third-party Administrator (TPA) Contact" => Some(Code1D),
"New Business Processing" => Some(NewBusinessProcessing),
"Physician" => Some(Physician),
"Service Team" => Some(ServiceTeam),
"Underwriter" => Some(Underwriter),
"Local Contact" => Some(LocalContact),
"Automated Clearinghouse (ACH) Contact" => Some(Code3A),
"Claim Approver" => Some(ClaimApprover),
"Applicant" => Some(Applicant),
"Interviewer" => Some(Interviewer),
"Owner Representative" => Some(OwnerRepresentative),
"Appointment Scheduler" => Some(AppointmentScheduler),
"Concurrent Employer Contact" => Some(ConcurrentEmployerContact),
"Authorized Representative" => Some(AuthorizedRepresentative),
"Appraiser" => Some(Appraiser),
"Administrative Contracting Officer" => {
Some(AdministrativeContractingOfficer)
}
"Accounting Department" => Some(AccountingDepartment),
"Corporate Purchasing Agent" => Some(CorporatePurchasingAgent),
"Authorized Financial Contact" => Some(AuthorizedFinancialContact),
"Agent" => Some(Agent),
"After-Hours Contact" => Some(AfterHoursContact),
"Additional Insurance Information Contact" => {
Some(AdditionalInsuranceInformationContact)
}
"Primary Contact" => Some(PrimaryContact),
"Alternate Contact" => Some(AlternateContact),
"Administrator" => Some(Administrator),
"Attention-to Party" => Some(AttentionToParty),
"Accounts Payable Department" => Some(AccountsPayableDepartment),
"Accounts Receivable Department" => Some(AccountsReceivableDepartment),
"Authorized Signature" => Some(AuthorizedSignature),
"Material Safety Data Sheet Contact" => {
Some(MaterialSafetyDataSheetContact)
}
"Report Authorizer" => Some(ReportAuthorizer),
"Advisor" => Some(Advisor),
"Co-investigator" => Some(CoInvestigator),
"Additional Contact Points at Institutions" => {
Some(AdditionalContactPointsAtInstitutions)
}
"Broker" => Some(Broker),
"Local Purchasing Agent" => Some(LocalPurchasingAgent),
"Broker Contact" => Some(BrokerContact),
"Buyer Name or Department" => Some(BuyerNameOrDepartment),
"Bill Inquiry Contact" => Some(BillInquiryContact),
"Operations" => Some(Operations),
"Marketing Department" => Some(MarketingDepartment),
"Technical Department" => Some(TechnicalDepartment),
"Work Broker Maintenance Manager" => Some(WorkBrokerMaintenanceManager),
"School Principal" => Some(SchoolPrincipal),
"Board Staff" => Some(BoardStaff),
"Business Unit Manager" => Some(BusinessUnitManager),
"Carrier Contact" => Some(CarrierContact),
"Co-borrower" => Some(CoBorrower),
"Customer Contact Granting Appointment" => {
Some(CustomerContactGrantingAppointment)
}
"Changed By" => Some(ChangedBy),
"Computer Systems Contact" => Some(ComputerSystemsContact),
"Contract Contact" => Some(ContractContact),
"Certifier" => Some(Certifier),
"Customer Engineer" => Some(CustomerEngineer),
"Chief Executive Officer" => Some(ChiefExecutiveOfficer),
"Change Order Approver" => Some(ChangeOrderApprover),
"Chief Financial Officer" => Some(ChiefFinancialOfficer),
"Chief Information Officer" => Some(ChiefInformationOfficer),
"Chairman of the Board" => Some(ChairmanOfTheBoard),
"Chief Operating Officer" => Some(ChiefOperatingOfficer),
"Container Manager" => Some(ContainerManager),
"General Contact" => Some(GeneralContact),
"Component Engineer" => Some(ComponentEngineer),
"Cost and Schedule Coordinator" => Some(CostAndScheduleCoordinator),
"Customer Relations" => Some(CustomerRelations),
"CAD/CAM Specialist" => Some(CadCamSpecialist),
"Claimant" => Some(Claimant),
"Auditing Contact" => Some(AuditingContact),
"Clearinghouse Contact" => Some(ClearinghouseContact),
"Confirmed With" => Some(ConfirmedWith),
"Payers Claim Office" => Some(PayersClaimOffice),
"Case Manager" => Some(CaseManager),
"Claim Recipient" => Some(ClaimRecipient),
"Directory Advertising Contact" => Some(DirectoryAdvertisingContact),
"Delivery Contact" => Some(DeliveryContact),
"Division Director" => Some(DivisionDirector),
"Design Engineer" => Some(DesignEngineer),
"Director" => Some(Director),
"Delivery Instructions Contact" => Some(DeliveryInstructionsContact),
"Division Manager" => Some(DivisionManager),
"Dental School Admissions Office" => Some(DentalSchoolAdmissionsOffice),
"Discrepancy Report Reply Contact" => Some(DiscrepancyReportReplyContact),
"Development" => Some(Development),
"Estimator" => Some(Estimator),
"Evening Programs Office" => Some(EveningProgramsOffice),
"EDI Coordinator" => Some(EdiCoordinator),
"Entered By" => Some(EnteredBy),
"Emergency Contact-Shipper" => Some(EmergencyContactShipper),
"Emergency Contact-Consignee" => Some(EmergencyContactConsignee),
"Emergency Contact-Military Surface Deployment and Distribution Command (SDDC)" => {
Some(CodeEF)
}
"Engineering" => Some(Engineering),
"Emergency Contact" => Some(EmergencyContact),
"Engineer" => Some(Engineer),
"Executive Officer" => Some(ExecutiveOfficer),
"Employer Contact" => Some(EmployerContact),
"Electronic Submission Recipient" => Some(ElectronicSubmissionRecipient),
"Endpoint" => Some(Endpoint),
"Executive Vice-President" => Some(ExecutiveVicePresident),
"Expeditor" => Some(Expeditor),
"Financial Aid Office" => Some(FinancialAidOffice),
"Coordinator" => Some(Coordinator),
"Forwarder Contact" => Some(ForwarderContact),
"Primary Control Point" => Some(PrimaryControlPoint),
"Licensee" => Some(Licensee),
"Foreclosing Lender Administrative Contact" => {
Some(ForeclosingLenderAdministrativeContact)
}
"Functional Manager" => Some(FunctionalManager),
"Joint Work Agent" => Some(JointWorkAgent),
"Office Manager" => Some(OfficeManager),
"Marketing Director" => Some(MarketingDirector),
"Staff" => Some(Staff),
"Compliance Officer" => Some(ComplianceOfficer),
"Graduate Fine Arts Office" => Some(GraduateFineArtsOffice),
"Graduate Business Office" => Some(GraduateBusinessOffice),
"Guidance Counselor" => Some(GuidanceCounselor),
"Graduate Engineering Office" => Some(GraduateEngineeringOffice),
"Graduate Admissions Office" => Some(GraduateAdmissionsOffice),
"Hazardous Material Contact" => Some(HazardousMaterialContact),
"Human Resources" => Some(HumanResources),
"Information Contact" => Some(InformationContact),
"International Logistics Control Office Point of Contact" => {
Some(InternationalLogisticsControlOfficePointOfContact)
}
"Issuing Officer" => Some(IssuingOfficer),
"Insured Party" => Some(InsuredParty),
"Law Firm" => Some(LawFirm),
"Authorized Negotiator" => Some(AuthorizedNegotiator),
"Preaward Survey Manager" => Some(PreawardSurveyManager),
"Accepting Official" => Some(AcceptingOfficial),
"Attorney" => Some(Attorney),
"Clerk of Court" => Some(ClerkOfCourt),
"Law School Admissions Office" => Some(LawSchoolAdmissionsOffice),
"Logistics Contact" => Some(LogisticsContact),
"Maintenance Contact" => Some(MaintenanceContact),
"Mayor" => Some(Mayor),
"Medical Contact" => Some(MedicalContact),
"Medical Admissions Office" => Some(MedicalAdmissionsOffice),
"Manufacturing" => Some(Manufacturing),
"Manager" => Some(Manager),
"Multiple Listing Service Staff" => Some(MultipleListingServiceStaff),
"Multiple Listing Service Vendor" => Some(MultipleListingServiceVendor),
"Customer Maintenance Manager" => Some(CustomerMaintenanceManager),
"Mexican Hazardous Information Contact" => {
Some(MexicanHazardousInformationContact)
}
"National Agent" => Some(NationalAgent),
"Numerical Control Engineer" => Some(NumericalControlEngineer),
"Notary Public" => Some(NotaryPublic),
"Notification Contact" => Some(NotificationContact),
"Other Adult" => Some(OtherAdult),
"Order Contact" => Some(OrderContact),
"Order Department" => Some(OrderDepartment),
"Office Staff" => Some(OfficeStaff),
"Owner" => Some(Owner),
"President" => Some(President),
"Plant Manager" => Some(PlantManager),
"Purchasing Contracting Officer (PCO)" => Some(CodePC),
"Project Director" => Some(ProjectDirector),
"Process Engineer" => Some(ProcessEngineer),
"Price Administration" => Some(PriceAdministration),
"Program Director" => Some(ProgramDirector),
"Provider" => Some(Provider),
"Preparer" => Some(Preparer),
"Project Manager" => Some(ProjectManager),
"Performance Evaluation Committee" => {
Some(PerformanceEvaluationCommittee)
}
"Manufacturing Plant Contact" => Some(ManufacturingPlantContact),
"Product Manager" => Some(ProductManager),
"Probation or Legal Officer" => Some(ProbationOrLegalOfficer),
"Production Representative" => Some(ProductionRepresentative),
"Program Manager" => Some(ProgramManager),
"Parent or Guardian" => Some(ParentOrGuardian),
"Prototype Coordinator" => Some(PrototypeCoordinator),
"Personnel Department" => Some(PersonnelDepartment),
"Partner" => Some(Partner),
"Report Preparer" => Some(ReportPreparer),
"Participating Laboratory Contact" => {
Some(ParticipatingLaboratoryContact)
}
"Principal Study Contact or Author" => {
Some(PrincipalStudyContactOrAuthor)
}
"Purchase Service Provider" => Some(PurchaseServiceProvider),
"Packager" => Some(Packager),
"Patient" => Some(Patient),
"Quality Assurance Contact" => Some(QualityAssuranceContact),
"Quality Coordinator" => Some(QualityCoordinator),
"Quality Inspector" => Some(QualityInspector),
"Quality Manager" => Some(QualityManager),
"Quoting Party" => Some(QuotingParty),
"Ordering Officer" => Some(OrderingOfficer),
"Port Engineer" => Some(PortEngineer),
"Rental Company Administrative Contact" => {
Some(RentalCompanyAdministrativeContact)
}
"Real Estate Property Occupant" => Some(RealEstatePropertyOccupant),
"Rebate/Chargeback Contact" => Some(RebateChargebackContact),
"Receiving Dock" => Some(ReceivingDock),
"Receiving Contact" => Some(ReceivingContact),
"Real Estate Property Key Holder" => Some(RealEstatePropertyKeyHolder),
"Registrar" => Some(Registrar),
"Recall Administrator" => Some(RecallAdministrator),
"Responsible Person" => Some(ResponsiblePerson),
"Requestor" => Some(Requestor),
"Rate Supervisor or Clerk" => Some(RateSupervisorOrClerk),
"Respondent" => Some(Respondent),
"Sales Administration" => Some(SalesAdministration),
"Student" => Some(Student),
"Schedule Contact" => Some(ScheduleContact),
"Shipping Department" => Some(ShippingDepartment),
"Service Organization" => Some(ServiceOrganization),
"Student in Absentia" => Some(StudentInAbsentia),
"Secretary" => Some(Secretary),
"Shipper Contact" => Some(ShipperContact),
"Investigator" => Some(Investigator),
"Spouse" => Some(Spouse),
"School Clerk" => Some(SchoolClerk),
"Collector" => Some(Collector),
"Submitting Contact" => Some(SubmittingContact),
"Study Submitter Contact" => Some(StudySubmitterContact),
"Service Order Writer" => Some(ServiceOrderWriter),
"Special Program Contact" => Some(SpecialProgramContact),
"Systems Administrator" => Some(SystemsAdministrator),
"Sales Representative or Department" => {
Some(SalesRepresentativeOrDepartment)
}
"Supervisor" => Some(Supervisor),
"Service Technician" => Some(ServiceTechnician),
"Supplier Contact" => Some(SupplierContact),
"Service Manager" => Some(ServiceManager),
"Social Services Worker" => Some(SocialServicesWorker),
"Secondary Taxpayer" => Some(SecondaryTaxpayer),
"Traffic Administrator" => Some(TrafficAdministrator),
"Telephone Answering Service Contact" => {
Some(TelephoneAnsweringServiceContact)
}
"College of Education Admissions Office" => {
Some(CollegeOfEducationAdmissionsOffice)
}
"Tender Developer" => Some(TenderDeveloper),
"Treasurer" => Some(Treasurer),
"School of Theology Admissions Office" => {
Some(SchoolOfTheologyAdmissionsOffice)
}
"Transmitter" => Some(Transmitter),
"Tenant" => Some(Tenant),
"Primary Taxpayer" => Some(PrimaryTaxpayer),
"Technical Marketing Representative" => {
Some(TechnicalMarketingRepresentative)
}
"Platform Maintenance Manager" => Some(PlatformMaintenanceManager),
"Undergraduate Admissions Office" => Some(UndergraduateAdmissionsOffice),
"Union President" => Some(UnionPresident),
"Processor" => Some(Processor),
"Ultimate Receiver" => Some(UltimateReceiver),
"School of Veterinary Medicine Admissions Office" => {
Some(SchoolOfVeterinaryMedicineAdmissionsOffice)
}
"Vice President" => Some(VicePresident),
"Warehouse" => Some(Warehouse),
"Witness" => Some(Witness),
"Technical Writer" => Some(TechnicalWriter),
"Waiver Application Contact" => Some(WaiverApplicationContact),
"Mutually Defined" => Some(MutuallyDefined),
_ => None,
}
}
}
}
impl Serialize for ContactFunctionCode {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: ser::Serializer,
{
let value = if serializer.is_human_readable() {
self.description()
} else {
self.code()
};
serializer.serialize_str(value)
}
}
struct Visitor;
impl<'de> de::Visitor<'de> for Visitor {
type Value = ContactFunctionCode;
fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
formatter.write_str("Contact Function Code")
}
fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
where
E: de::Error,
{
ContactFunctionCode::from_description(v)
.ok_or_else(|| E::custom(format!("Invalid Contact Function Code: {}", v)))
}
fn visit_bytes<E>(self, v: &[u8]) -> Result<Self::Value, E>
where
E: de::Error,
{
ContactFunctionCode::from_code(v)
.ok_or_else(|| E::custom(
format!(
"Invalid Contact Function Code: {}", std::str::from_utf8(v).unwrap()
),
))
}
}
impl<'de> Deserialize<'de> for ContactFunctionCode {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: de::Deserializer<'de>,
{
if deserializer.is_human_readable() {
deserializer.deserialize_str(Visitor)
} else {
deserializer.deserialize_bytes(Visitor)
}
}
}