diff --git a/account.go b/account.go index 48724cd..6f02902 100644 --- a/account.go +++ b/account.go @@ -175,6 +175,14 @@ const ( IntrospectionClientTypeSandbox IntrospectionClientType = "sandbox" ) +func (r IntrospectionClientType) IsKnown() bool { + switch r { + case IntrospectionClientTypeProduction, IntrospectionClientTypeDevelopment, IntrospectionClientTypeSandbox: + return true + } + return false +} + // The type of the connection associated with the token. // // `provider` - connection to an external provider @@ -186,3 +194,11 @@ const ( IntrospectionConnectionTypeProvider IntrospectionConnectionType = "provider" IntrospectionConnectionTypeFinch IntrospectionConnectionType = "finch" ) + +func (r IntrospectionConnectionType) IsKnown() bool { + switch r { + case IntrospectionConnectionTypeProvider, IntrospectionConnectionTypeFinch: + return true + } + return false +} diff --git a/hris.go b/hris.go index 9ab7901..884324e 100644 --- a/hris.go +++ b/hris.go @@ -89,6 +89,14 @@ const ( IncomeUnitFixed IncomeUnit = "fixed" ) +func (r IncomeUnit) IsKnown() bool { + switch r { + case IncomeUnitYearly, IncomeUnitQuarterly, IncomeUnitMonthly, IncomeUnitSemiMonthly, IncomeUnitBiWeekly, IncomeUnitWeekly, IncomeUnitDaily, IncomeUnitHourly, IncomeUnitFixed: + return true + } + return false +} + // The employee's income as reported by the provider. This may not always be // annualized income, but may be in units of bi-weekly, semi-monthly, daily, etc, // depending on what information the provider returns. diff --git a/hrisbenefit.go b/hrisbenefit.go index 14a74b9..272e66a 100644 --- a/hrisbenefit.go +++ b/hrisbenefit.go @@ -137,6 +137,14 @@ const ( BenefitContributionTypePercent BenefitContributionType = "percent" ) +func (r BenefitContributionType) IsKnown() bool { + switch r { + case BenefitContributionTypeFixed, BenefitContributionTypePercent: + return true + } + return false +} + type BenefitFeaturesAndOperations struct { SupportedFeatures BenefitFeaturesAndOperationsSupportedFeatures `json:"supported_features"` SupportedOperations SupportPerBenefitType `json:"supported_operations"` @@ -210,6 +218,14 @@ const ( BenefitFeaturesAndOperationsSupportedFeaturesCompanyContributionPercent BenefitFeaturesAndOperationsSupportedFeaturesCompanyContribution = "percent" ) +func (r BenefitFeaturesAndOperationsSupportedFeaturesCompanyContribution) IsKnown() bool { + switch r { + case BenefitFeaturesAndOperationsSupportedFeaturesCompanyContributionFixed, BenefitFeaturesAndOperationsSupportedFeaturesCompanyContributionPercent: + return true + } + return false +} + type BenefitFeaturesAndOperationsSupportedFeaturesEmployeeDeduction string const ( @@ -217,6 +233,14 @@ const ( BenefitFeaturesAndOperationsSupportedFeaturesEmployeeDeductionPercent BenefitFeaturesAndOperationsSupportedFeaturesEmployeeDeduction = "percent" ) +func (r BenefitFeaturesAndOperationsSupportedFeaturesEmployeeDeduction) IsKnown() bool { + switch r { + case BenefitFeaturesAndOperationsSupportedFeaturesEmployeeDeductionFixed, BenefitFeaturesAndOperationsSupportedFeaturesEmployeeDeductionPercent: + return true + } + return false +} + type BenefitFeaturesAndOperationsSupportedFeaturesHsaContributionLimit string const ( @@ -224,6 +248,14 @@ const ( BenefitFeaturesAndOperationsSupportedFeaturesHsaContributionLimitFamily BenefitFeaturesAndOperationsSupportedFeaturesHsaContributionLimit = "family" ) +func (r BenefitFeaturesAndOperationsSupportedFeaturesHsaContributionLimit) IsKnown() bool { + switch r { + case BenefitFeaturesAndOperationsSupportedFeaturesHsaContributionLimitIndividual, BenefitFeaturesAndOperationsSupportedFeaturesHsaContributionLimitFamily: + return true + } + return false +} + type BenefitFrequency string const ( @@ -232,6 +264,14 @@ const ( BenefitFrequencyMonthly BenefitFrequency = "monthly" ) +func (r BenefitFrequency) IsKnown() bool { + switch r { + case BenefitFrequencyOneTime, BenefitFrequencyEveryPaycheck, BenefitFrequencyMonthly: + return true + } + return false +} + // Type of benefit. type BenefitType string @@ -257,6 +297,14 @@ const ( BenefitTypeCustomPreTax BenefitType = "custom_pre_tax" ) +func (r BenefitType) IsKnown() bool { + switch r { + case BenefitType_401k, BenefitType_401kRoth, BenefitType_401kLoan, BenefitType_403b, BenefitType_403bRoth, BenefitType_457, BenefitType_457Roth, BenefitTypeS125Medical, BenefitTypeS125Dental, BenefitTypeS125Vision, BenefitTypeHsaPre, BenefitTypeHsaPost, BenefitTypeFsaMedical, BenefitTypeFsaDependentCare, BenefitTypeSimpleIRA, BenefitTypeSimple, BenefitTypeCommuter, BenefitTypeCustomPostTax, BenefitTypeCustomPreTax: + return true + } + return false +} + // Each benefit type and their supported features. If the benefit type is not // supported, the property will be null type BenefitsSupport struct { @@ -430,6 +478,14 @@ const ( SupportedBenefitCompanyContributionPercent SupportedBenefitCompanyContribution = "percent" ) +func (r SupportedBenefitCompanyContribution) IsKnown() bool { + switch r { + case SupportedBenefitCompanyContributionFixed, SupportedBenefitCompanyContributionPercent: + return true + } + return false +} + type SupportedBenefitEmployeeDeduction string const ( @@ -437,6 +493,14 @@ const ( SupportedBenefitEmployeeDeductionPercent SupportedBenefitEmployeeDeduction = "percent" ) +func (r SupportedBenefitEmployeeDeduction) IsKnown() bool { + switch r { + case SupportedBenefitEmployeeDeductionFixed, SupportedBenefitEmployeeDeductionPercent: + return true + } + return false +} + type SupportedBenefitHsaContributionLimit string const ( @@ -444,6 +508,14 @@ const ( SupportedBenefitHsaContributionLimitFamily SupportedBenefitHsaContributionLimit = "family" ) +func (r SupportedBenefitHsaContributionLimit) IsKnown() bool { + switch r { + case SupportedBenefitHsaContributionLimitIndividual, SupportedBenefitHsaContributionLimitFamily: + return true + } + return false +} + type UpdateCompanyBenefitResponse struct { BenefitID string `json:"benefit_id,required"` JSON updateCompanyBenefitResponseJSON `json:"-"` diff --git a/hrisbenefitindividual.go b/hrisbenefitindividual.go index 294adc9..d643a56 100644 --- a/hrisbenefitindividual.go +++ b/hrisbenefitindividual.go @@ -154,6 +154,14 @@ const ( IndividualBenefitBodyHsaContributionLimitFamily IndividualBenefitBodyHsaContributionLimit = "family" ) +func (r IndividualBenefitBodyHsaContributionLimit) IsKnown() bool { + switch r { + case IndividualBenefitBodyHsaContributionLimitIndividual, IndividualBenefitBodyHsaContributionLimitFamily: + return true + } + return false +} + type UnenrolledIndividual struct { Body UnenrolledIndividualBody `json:"body"` // HTTP status code diff --git a/hriscompany.go b/hriscompany.go index 97d7dbf..2dd36d4 100644 --- a/hriscompany.go +++ b/hriscompany.go @@ -122,6 +122,14 @@ const ( CompanyAccountsAccountTypeSavings CompanyAccountsAccountType = "savings" ) +func (r CompanyAccountsAccountType) IsKnown() bool { + switch r { + case CompanyAccountsAccountTypeChecking, CompanyAccountsAccountTypeSavings: + return true + } + return false +} + type CompanyDepartment struct { // The department name. Name string `json:"name,nullable"` @@ -204,6 +212,14 @@ const ( CompanyEntitySubtypeBCorporation CompanyEntitySubtype = "b_corporation" ) +func (r CompanyEntitySubtype) IsKnown() bool { + switch r { + case CompanyEntitySubtypeSCorporation, CompanyEntitySubtypeCCorporation, CompanyEntitySubtypeBCorporation: + return true + } + return false +} + // The tax payer type of the company. type CompanyEntityType string @@ -216,3 +232,11 @@ const ( CompanyEntityTypePartnership CompanyEntityType = "partnership" CompanyEntityTypeCooperative CompanyEntityType = "cooperative" ) + +func (r CompanyEntityType) IsKnown() bool { + switch r { + case CompanyEntityTypeLlc, CompanyEntityTypeLp, CompanyEntityTypeCorporation, CompanyEntityTypeSoleProprietor, CompanyEntityTypeNonProfit, CompanyEntityTypePartnership, CompanyEntityTypeCooperative: + return true + } + return false +} diff --git a/hrisemployment.go b/hrisemployment.go index 1a09160..8b473c6 100644 --- a/hrisemployment.go +++ b/hrisemployment.go @@ -209,6 +209,14 @@ const ( EmploymentDataEmploymentSubtypeIndividualContractor EmploymentDataEmploymentSubtype = "individual_contractor" ) +func (r EmploymentDataEmploymentSubtype) IsKnown() bool { + switch r { + case EmploymentDataEmploymentSubtypeFullTime, EmploymentDataEmploymentSubtypeIntern, EmploymentDataEmploymentSubtypePartTime, EmploymentDataEmploymentSubtypeTemp, EmploymentDataEmploymentSubtypeSeasonal, EmploymentDataEmploymentSubtypeIndividualContractor: + return true + } + return false +} + // The main employment type of the individual. type EmploymentDataEmploymentType string @@ -217,6 +225,14 @@ const ( EmploymentDataEmploymentTypeContractor EmploymentDataEmploymentType = "contractor" ) +func (r EmploymentDataEmploymentType) IsKnown() bool { + switch r { + case EmploymentDataEmploymentTypeEmployee, EmploymentDataEmploymentTypeContractor: + return true + } + return false +} + // The manager object representing the manager of the individual within the org. type EmploymentDataManager struct { // A stable Finch `id` (UUID v4) for an individual in the company. diff --git a/hrisindividual.go b/hrisindividual.go index 3494405..0909d05 100644 --- a/hrisindividual.go +++ b/hrisindividual.go @@ -139,6 +139,14 @@ const ( IndividualEmailsTypePersonal IndividualEmailsType = "personal" ) +func (r IndividualEmailsType) IsKnown() bool { + switch r { + case IndividualEmailsTypeWork, IndividualEmailsTypePersonal: + return true + } + return false +} + // The EEOC-defined ethnicity of the individual. type IndividualEthnicity string @@ -153,6 +161,14 @@ const ( IndividualEthnicityDeclineToSpecify IndividualEthnicity = "decline_to_specify" ) +func (r IndividualEthnicity) IsKnown() bool { + switch r { + case IndividualEthnicityAsian, IndividualEthnicityWhite, IndividualEthnicityBlackOrAfricanAmerican, IndividualEthnicityNativeHawaiianOrPacificIslander, IndividualEthnicityAmericanIndianOrAlaskaNative, IndividualEthnicityHispanicOrLatino, IndividualEthnicityTwoOrMoreRaces, IndividualEthnicityDeclineToSpecify: + return true + } + return false +} + // The gender of the individual. type IndividualGender string @@ -163,6 +179,14 @@ const ( IndividualGenderDeclineToSpecify IndividualGender = "decline_to_specify" ) +func (r IndividualGender) IsKnown() bool { + switch r { + case IndividualGenderFemale, IndividualGenderMale, IndividualGenderOther, IndividualGenderDeclineToSpecify: + return true + } + return false +} + type IndividualPhoneNumber struct { Data string `json:"data,nullable"` Type IndividualPhoneNumbersType `json:"type,nullable"` @@ -193,6 +217,14 @@ const ( IndividualPhoneNumbersTypePersonal IndividualPhoneNumbersType = "personal" ) +func (r IndividualPhoneNumbersType) IsKnown() bool { + switch r { + case IndividualPhoneNumbersTypeWork, IndividualPhoneNumbersTypePersonal: + return true + } + return false +} + type IndividualResponse struct { Body Individual `json:"body"` Code int64 `json:"code"` diff --git a/hrispaystatement.go b/hrispaystatement.go index 5ec6bfc..500a739 100644 --- a/hrispaystatement.go +++ b/hrispaystatement.go @@ -159,6 +159,14 @@ const ( PayStatementEarningsTypeOther PayStatementEarningsType = "other" ) +func (r PayStatementEarningsType) IsKnown() bool { + switch r { + case PayStatementEarningsTypeSalary, PayStatementEarningsTypeWage, PayStatementEarningsTypeReimbursement, PayStatementEarningsTypeOvertime, PayStatementEarningsTypeSeverance, PayStatementEarningsTypeDoubleOvertime, PayStatementEarningsTypePto, PayStatementEarningsTypeSick, PayStatementEarningsTypeBonus, PayStatementEarningsTypeCommission, PayStatementEarningsTypeTips, PayStatementEarningsType1099, PayStatementEarningsTypeOther: + return true + } + return false +} + type PayStatementEmployeeDeduction struct { // The deduction amount in cents. Amount int64 `json:"amount,nullable"` @@ -232,6 +240,14 @@ const ( PayStatementPaymentMethodDirectDeposit PayStatementPaymentMethod = "direct_deposit" ) +func (r PayStatementPaymentMethod) IsKnown() bool { + switch r { + case PayStatementPaymentMethodCheck, PayStatementPaymentMethodDirectDeposit: + return true + } + return false +} + type PayStatementTax struct { // The tax amount in cents. Amount int64 `json:"amount,nullable"` @@ -275,6 +291,14 @@ const ( PayStatementTaxesTypeFica PayStatementTaxesType = "fica" ) +func (r PayStatementTaxesType) IsKnown() bool { + switch r { + case PayStatementTaxesTypeState, PayStatementTaxesTypeFederal, PayStatementTaxesTypeLocal, PayStatementTaxesTypeFica: + return true + } + return false +} + // The type of the payment associated with the pay statement. type PayStatementType string @@ -284,6 +308,14 @@ const ( PayStatementTypeOneTimePayment PayStatementType = "one_time_payment" ) +func (r PayStatementType) IsKnown() bool { + switch r { + case PayStatementTypeRegularPayroll, PayStatementTypeOffCyclePayroll, PayStatementTypeOneTimePayment: + return true + } + return false +} + type PayStatementResponse struct { Body PayStatementResponseBody `json:"body"` Code int64 `json:"code"` diff --git a/internal/shared/shared.go b/internal/shared/shared.go index 2c4815f..0a173ff 100644 --- a/internal/shared/shared.go +++ b/internal/shared/shared.go @@ -17,6 +17,14 @@ const ( ConnectionStatusTypeReauth ConnectionStatusType = "reauth" ) +func (r ConnectionStatusType) IsKnown() bool { + switch r { + case ConnectionStatusTypePending, ConnectionStatusTypeProcessing, ConnectionStatusTypeConnected, ConnectionStatusTypeErrorNoAccountSetup, ConnectionStatusTypeErrorPermissions, ConnectionStatusTypeReauth: + return true + } + return false +} + // - `supported`: This operation is supported by both the provider and Finch // // - `not_supported_by_finch`: This operation is not supported by Finch but @@ -36,6 +44,14 @@ const ( OperationSupportClientAccessOnly OperationSupport = "client_access_only" ) +func (r OperationSupport) IsKnown() bool { + switch r { + case OperationSupportSupported, OperationSupportNotSupportedByFinch, OperationSupportNotSupportedByProvider, OperationSupportClientAccessOnly: + return true + } + return false +} + type OperationSupportMatrix struct { // - `supported`: This operation is supported by both the provider and Finch // diff --git a/jobautomated.go b/jobautomated.go index b20df62..9119827 100644 --- a/jobautomated.go +++ b/jobautomated.go @@ -143,6 +143,14 @@ const ( AutomatedAsyncJobStatusPermissionsError AutomatedAsyncJobStatus = "permissions_error" ) +func (r AutomatedAsyncJobStatus) IsKnown() bool { + switch r { + case AutomatedAsyncJobStatusPending, AutomatedAsyncJobStatusInProgress, AutomatedAsyncJobStatusComplete, AutomatedAsyncJobStatusError, AutomatedAsyncJobStatusReauthError, AutomatedAsyncJobStatusPermissionsError: + return true + } + return false +} + // Only `data_sync_all` currently supported type AutomatedAsyncJobType string @@ -150,6 +158,14 @@ const ( AutomatedAsyncJobTypeDataSyncAll AutomatedAsyncJobType = "data_sync_all" ) +func (r AutomatedAsyncJobType) IsKnown() bool { + switch r { + case AutomatedAsyncJobTypeDataSyncAll: + return true + } + return false +} + type JobAutomatedNewResponse struct { // The number of allowed refreshes per hour (per hour, fixed window) AllowedRefreshes int64 `json:"allowed_refreshes,required"` @@ -197,6 +213,14 @@ const ( JobAutomatedNewParamsTypeDataSyncAll JobAutomatedNewParamsType = "data_sync_all" ) +func (r JobAutomatedNewParamsType) IsKnown() bool { + switch r { + case JobAutomatedNewParamsTypeDataSyncAll: + return true + } + return false +} + type JobAutomatedListParams struct { // Number of items to return Limit param.Field[int64] `query:"limit"` diff --git a/jobmanual.go b/jobmanual.go index ab74c23..5de092c 100644 --- a/jobmanual.go +++ b/jobmanual.go @@ -71,3 +71,11 @@ const ( ManualAsyncJobStatusError ManualAsyncJobStatus = "error" ManualAsyncJobStatusComplete ManualAsyncJobStatus = "complete" ) + +func (r ManualAsyncJobStatus) IsKnown() bool { + switch r { + case ManualAsyncJobStatusPending, ManualAsyncJobStatusInProgress, ManualAsyncJobStatusError, ManualAsyncJobStatusComplete: + return true + } + return false +} diff --git a/provider.go b/provider.go index 94be634..55637ee 100644 --- a/provider.go +++ b/provider.go @@ -1039,3 +1039,11 @@ const ( ProviderAuthenticationMethodsTypeAPICredential ProviderAuthenticationMethodsType = "api_credential" ProviderAuthenticationMethodsTypeOAuth ProviderAuthenticationMethodsType = "oauth" ) + +func (r ProviderAuthenticationMethodsType) IsKnown() bool { + switch r { + case ProviderAuthenticationMethodsTypeAssisted, ProviderAuthenticationMethodsTypeCredential, ProviderAuthenticationMethodsTypeAPIToken, ProviderAuthenticationMethodsTypeAPICredential, ProviderAuthenticationMethodsTypeOAuth: + return true + } + return false +} diff --git a/sandboxcompany.go b/sandboxcompany.go index cc47fd7..9cd8ca3 100644 --- a/sandboxcompany.go +++ b/sandboxcompany.go @@ -122,6 +122,14 @@ const ( SandboxCompanyUpdateResponseAccountsAccountTypeSavings SandboxCompanyUpdateResponseAccountsAccountType = "savings" ) +func (r SandboxCompanyUpdateResponseAccountsAccountType) IsKnown() bool { + switch r { + case SandboxCompanyUpdateResponseAccountsAccountTypeChecking, SandboxCompanyUpdateResponseAccountsAccountTypeSavings: + return true + } + return false +} + type SandboxCompanyUpdateResponseDepartment struct { // The department name. Name string `json:"name,nullable"` @@ -205,6 +213,14 @@ const ( SandboxCompanyUpdateResponseEntitySubtypeBCorporation SandboxCompanyUpdateResponseEntitySubtype = "b_corporation" ) +func (r SandboxCompanyUpdateResponseEntitySubtype) IsKnown() bool { + switch r { + case SandboxCompanyUpdateResponseEntitySubtypeSCorporation, SandboxCompanyUpdateResponseEntitySubtypeCCorporation, SandboxCompanyUpdateResponseEntitySubtypeBCorporation: + return true + } + return false +} + // The tax payer type of the company. type SandboxCompanyUpdateResponseEntityType string @@ -218,6 +234,14 @@ const ( SandboxCompanyUpdateResponseEntityTypeCooperative SandboxCompanyUpdateResponseEntityType = "cooperative" ) +func (r SandboxCompanyUpdateResponseEntityType) IsKnown() bool { + switch r { + case SandboxCompanyUpdateResponseEntityTypeLlc, SandboxCompanyUpdateResponseEntityTypeLp, SandboxCompanyUpdateResponseEntityTypeCorporation, SandboxCompanyUpdateResponseEntityTypeSoleProprietor, SandboxCompanyUpdateResponseEntityTypeNonProfit, SandboxCompanyUpdateResponseEntityTypePartnership, SandboxCompanyUpdateResponseEntityTypeCooperative: + return true + } + return false +} + type SandboxCompanyUpdateParams struct { // An array of bank account objects associated with the payroll/HRIS system. Accounts param.Field[[]SandboxCompanyUpdateParamsAccount] `json:"accounts,required"` @@ -266,6 +290,14 @@ const ( SandboxCompanyUpdateParamsAccountsAccountTypeSavings SandboxCompanyUpdateParamsAccountsAccountType = "savings" ) +func (r SandboxCompanyUpdateParamsAccountsAccountType) IsKnown() bool { + switch r { + case SandboxCompanyUpdateParamsAccountsAccountTypeChecking, SandboxCompanyUpdateParamsAccountsAccountTypeSavings: + return true + } + return false +} + type SandboxCompanyUpdateParamsDepartment struct { // The department name. Name param.Field[string] `json:"name"` @@ -308,6 +340,14 @@ const ( SandboxCompanyUpdateParamsEntitySubtypeBCorporation SandboxCompanyUpdateParamsEntitySubtype = "b_corporation" ) +func (r SandboxCompanyUpdateParamsEntitySubtype) IsKnown() bool { + switch r { + case SandboxCompanyUpdateParamsEntitySubtypeSCorporation, SandboxCompanyUpdateParamsEntitySubtypeCCorporation, SandboxCompanyUpdateParamsEntitySubtypeBCorporation: + return true + } + return false +} + // The tax payer type of the company. type SandboxCompanyUpdateParamsEntityType string @@ -320,3 +360,11 @@ const ( SandboxCompanyUpdateParamsEntityTypePartnership SandboxCompanyUpdateParamsEntityType = "partnership" SandboxCompanyUpdateParamsEntityTypeCooperative SandboxCompanyUpdateParamsEntityType = "cooperative" ) + +func (r SandboxCompanyUpdateParamsEntityType) IsKnown() bool { + switch r { + case SandboxCompanyUpdateParamsEntityTypeLlc, SandboxCompanyUpdateParamsEntityTypeLp, SandboxCompanyUpdateParamsEntityTypeCorporation, SandboxCompanyUpdateParamsEntityTypeSoleProprietor, SandboxCompanyUpdateParamsEntityTypeNonProfit, SandboxCompanyUpdateParamsEntityTypePartnership, SandboxCompanyUpdateParamsEntityTypeCooperative: + return true + } + return false +} diff --git a/sandboxconnection.go b/sandboxconnection.go index 2523686..277cd75 100644 --- a/sandboxconnection.go +++ b/sandboxconnection.go @@ -80,6 +80,14 @@ const ( SandboxConnectionNewResponseAuthenticationTypeAssisted SandboxConnectionNewResponseAuthenticationType = "assisted" ) +func (r SandboxConnectionNewResponseAuthenticationType) IsKnown() bool { + switch r { + case SandboxConnectionNewResponseAuthenticationTypeCredential, SandboxConnectionNewResponseAuthenticationTypeAPIToken, SandboxConnectionNewResponseAuthenticationTypeOAuth, SandboxConnectionNewResponseAuthenticationTypeAssisted: + return true + } + return false +} + type SandboxConnectionNewParams struct { ProviderID param.Field[string] `json:"provider_id,required"` AuthenticationType param.Field[SandboxConnectionNewParamsAuthenticationType] `json:"authentication_type"` @@ -101,3 +109,11 @@ const ( SandboxConnectionNewParamsAuthenticationTypeOAuth SandboxConnectionNewParamsAuthenticationType = "oauth" SandboxConnectionNewParamsAuthenticationTypeAssisted SandboxConnectionNewParamsAuthenticationType = "assisted" ) + +func (r SandboxConnectionNewParamsAuthenticationType) IsKnown() bool { + switch r { + case SandboxConnectionNewParamsAuthenticationTypeCredential, SandboxConnectionNewParamsAuthenticationTypeAPIToken, SandboxConnectionNewParamsAuthenticationTypeOAuth, SandboxConnectionNewParamsAuthenticationTypeAssisted: + return true + } + return false +} diff --git a/sandboxconnectionaccount.go b/sandboxconnectionaccount.go index 76c49ad..17a990e 100644 --- a/sandboxconnectionaccount.go +++ b/sandboxconnectionaccount.go @@ -88,6 +88,14 @@ const ( SandboxConnectionAccountNewResponseAuthenticationTypeAssisted SandboxConnectionAccountNewResponseAuthenticationType = "assisted" ) +func (r SandboxConnectionAccountNewResponseAuthenticationType) IsKnown() bool { + switch r { + case SandboxConnectionAccountNewResponseAuthenticationTypeCredential, SandboxConnectionAccountNewResponseAuthenticationTypeAPIToken, SandboxConnectionAccountNewResponseAuthenticationTypeOAuth, SandboxConnectionAccountNewResponseAuthenticationTypeAssisted: + return true + } + return false +} + type SandboxConnectionAccountUpdateResponse struct { AccountID string `json:"account_id,required"` AuthenticationType SandboxConnectionAccountUpdateResponseAuthenticationType `json:"authentication_type,required"` @@ -126,6 +134,14 @@ const ( SandboxConnectionAccountUpdateResponseAuthenticationTypeAssisted SandboxConnectionAccountUpdateResponseAuthenticationType = "assisted" ) +func (r SandboxConnectionAccountUpdateResponseAuthenticationType) IsKnown() bool { + switch r { + case SandboxConnectionAccountUpdateResponseAuthenticationTypeCredential, SandboxConnectionAccountUpdateResponseAuthenticationTypeAPIToken, SandboxConnectionAccountUpdateResponseAuthenticationTypeOAuth, SandboxConnectionAccountUpdateResponseAuthenticationTypeAssisted: + return true + } + return false +} + type SandboxConnectionAccountNewParams struct { CompanyID param.Field[string] `json:"company_id,required" format:"uuid"` ProviderID param.Field[string] `json:"provider_id,required"` @@ -148,6 +164,14 @@ const ( SandboxConnectionAccountNewParamsAuthenticationTypeAssisted SandboxConnectionAccountNewParamsAuthenticationType = "assisted" ) +func (r SandboxConnectionAccountNewParamsAuthenticationType) IsKnown() bool { + switch r { + case SandboxConnectionAccountNewParamsAuthenticationTypeCredential, SandboxConnectionAccountNewParamsAuthenticationTypeAPIToken, SandboxConnectionAccountNewParamsAuthenticationTypeOAuth, SandboxConnectionAccountNewParamsAuthenticationTypeAssisted: + return true + } + return false +} + type SandboxConnectionAccountUpdateParams struct { ConnectionStatus param.Field[shared.ConnectionStatusType] `json:"connection_status"` } diff --git a/sandboxdirectory.go b/sandboxdirectory.go index 37b2d97..bc04c3e 100644 --- a/sandboxdirectory.go +++ b/sandboxdirectory.go @@ -143,6 +143,14 @@ const ( SandboxDirectoryNewParamsBodyEmailsTypePersonal SandboxDirectoryNewParamsBodyEmailsType = "personal" ) +func (r SandboxDirectoryNewParamsBodyEmailsType) IsKnown() bool { + switch r { + case SandboxDirectoryNewParamsBodyEmailsTypeWork, SandboxDirectoryNewParamsBodyEmailsTypePersonal: + return true + } + return false +} + // The employment object. type SandboxDirectoryNewParamsBodyEmployment struct { // The secondary employment type of the individual. Options: `full_time`, `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`. @@ -167,6 +175,14 @@ const ( SandboxDirectoryNewParamsBodyEmploymentSubtypeIndividualContractor SandboxDirectoryNewParamsBodyEmploymentSubtype = "individual_contractor" ) +func (r SandboxDirectoryNewParamsBodyEmploymentSubtype) IsKnown() bool { + switch r { + case SandboxDirectoryNewParamsBodyEmploymentSubtypeFullTime, SandboxDirectoryNewParamsBodyEmploymentSubtypeIntern, SandboxDirectoryNewParamsBodyEmploymentSubtypePartTime, SandboxDirectoryNewParamsBodyEmploymentSubtypeTemp, SandboxDirectoryNewParamsBodyEmploymentSubtypeSeasonal, SandboxDirectoryNewParamsBodyEmploymentSubtypeIndividualContractor: + return true + } + return false +} + // The main employment type of the individual. type SandboxDirectoryNewParamsBodyEmploymentType string @@ -175,6 +191,14 @@ const ( SandboxDirectoryNewParamsBodyEmploymentTypeContractor SandboxDirectoryNewParamsBodyEmploymentType = "contractor" ) +func (r SandboxDirectoryNewParamsBodyEmploymentType) IsKnown() bool { + switch r { + case SandboxDirectoryNewParamsBodyEmploymentTypeEmployee, SandboxDirectoryNewParamsBodyEmploymentTypeContractor: + return true + } + return false +} + // The EEOC-defined ethnicity of the individual. type SandboxDirectoryNewParamsBodyEthnicity string @@ -189,6 +213,14 @@ const ( SandboxDirectoryNewParamsBodyEthnicityDeclineToSpecify SandboxDirectoryNewParamsBodyEthnicity = "decline_to_specify" ) +func (r SandboxDirectoryNewParamsBodyEthnicity) IsKnown() bool { + switch r { + case SandboxDirectoryNewParamsBodyEthnicityAsian, SandboxDirectoryNewParamsBodyEthnicityWhite, SandboxDirectoryNewParamsBodyEthnicityBlackOrAfricanAmerican, SandboxDirectoryNewParamsBodyEthnicityNativeHawaiianOrPacificIslander, SandboxDirectoryNewParamsBodyEthnicityAmericanIndianOrAlaskaNative, SandboxDirectoryNewParamsBodyEthnicityHispanicOrLatino, SandboxDirectoryNewParamsBodyEthnicityTwoOrMoreRaces, SandboxDirectoryNewParamsBodyEthnicityDeclineToSpecify: + return true + } + return false +} + // The gender of the individual. type SandboxDirectoryNewParamsBodyGender string @@ -199,6 +231,14 @@ const ( SandboxDirectoryNewParamsBodyGenderDeclineToSpecify SandboxDirectoryNewParamsBodyGender = "decline_to_specify" ) +func (r SandboxDirectoryNewParamsBodyGender) IsKnown() bool { + switch r { + case SandboxDirectoryNewParamsBodyGenderFemale, SandboxDirectoryNewParamsBodyGenderMale, SandboxDirectoryNewParamsBodyGenderOther, SandboxDirectoryNewParamsBodyGenderDeclineToSpecify: + return true + } + return false +} + // The manager object representing the manager of the individual within the org. type SandboxDirectoryNewParamsBodyManager struct { // A stable Finch `id` (UUID v4) for an individual in the company. @@ -224,3 +264,11 @@ const ( SandboxDirectoryNewParamsBodyPhoneNumbersTypeWork SandboxDirectoryNewParamsBodyPhoneNumbersType = "work" SandboxDirectoryNewParamsBodyPhoneNumbersTypePersonal SandboxDirectoryNewParamsBodyPhoneNumbersType = "personal" ) + +func (r SandboxDirectoryNewParamsBodyPhoneNumbersType) IsKnown() bool { + switch r { + case SandboxDirectoryNewParamsBodyPhoneNumbersTypeWork, SandboxDirectoryNewParamsBodyPhoneNumbersTypePersonal: + return true + } + return false +} diff --git a/sandboxemployment.go b/sandboxemployment.go index 0218ad5..f03ba1d 100644 --- a/sandboxemployment.go +++ b/sandboxemployment.go @@ -194,6 +194,14 @@ const ( SandboxEmploymentUpdateResponseEmploymentSubtypeIndividualContractor SandboxEmploymentUpdateResponseEmploymentSubtype = "individual_contractor" ) +func (r SandboxEmploymentUpdateResponseEmploymentSubtype) IsKnown() bool { + switch r { + case SandboxEmploymentUpdateResponseEmploymentSubtypeFullTime, SandboxEmploymentUpdateResponseEmploymentSubtypeIntern, SandboxEmploymentUpdateResponseEmploymentSubtypePartTime, SandboxEmploymentUpdateResponseEmploymentSubtypeTemp, SandboxEmploymentUpdateResponseEmploymentSubtypeSeasonal, SandboxEmploymentUpdateResponseEmploymentSubtypeIndividualContractor: + return true + } + return false +} + // The main employment type of the individual. type SandboxEmploymentUpdateResponseEmploymentType string @@ -202,6 +210,14 @@ const ( SandboxEmploymentUpdateResponseEmploymentTypeContractor SandboxEmploymentUpdateResponseEmploymentType = "contractor" ) +func (r SandboxEmploymentUpdateResponseEmploymentType) IsKnown() bool { + switch r { + case SandboxEmploymentUpdateResponseEmploymentTypeEmployee, SandboxEmploymentUpdateResponseEmploymentTypeContractor: + return true + } + return false +} + // The manager object representing the manager of the individual within the org. type SandboxEmploymentUpdateResponseManager struct { // A stable Finch `id` (UUID v4) for an individual in the company. @@ -308,6 +324,14 @@ const ( SandboxEmploymentUpdateParamsEmploymentSubtypeIndividualContractor SandboxEmploymentUpdateParamsEmploymentSubtype = "individual_contractor" ) +func (r SandboxEmploymentUpdateParamsEmploymentSubtype) IsKnown() bool { + switch r { + case SandboxEmploymentUpdateParamsEmploymentSubtypeFullTime, SandboxEmploymentUpdateParamsEmploymentSubtypeIntern, SandboxEmploymentUpdateParamsEmploymentSubtypePartTime, SandboxEmploymentUpdateParamsEmploymentSubtypeTemp, SandboxEmploymentUpdateParamsEmploymentSubtypeSeasonal, SandboxEmploymentUpdateParamsEmploymentSubtypeIndividualContractor: + return true + } + return false +} + // The main employment type of the individual. type SandboxEmploymentUpdateParamsEmploymentType string @@ -316,6 +340,14 @@ const ( SandboxEmploymentUpdateParamsEmploymentTypeContractor SandboxEmploymentUpdateParamsEmploymentType = "contractor" ) +func (r SandboxEmploymentUpdateParamsEmploymentType) IsKnown() bool { + switch r { + case SandboxEmploymentUpdateParamsEmploymentTypeEmployee, SandboxEmploymentUpdateParamsEmploymentTypeContractor: + return true + } + return false +} + // The manager object representing the manager of the individual within the org. type SandboxEmploymentUpdateParamsManager struct { // A stable Finch `id` (UUID v4) for an individual in the company. diff --git a/sandboxindividual.go b/sandboxindividual.go index 34726d6..950c07e 100644 --- a/sandboxindividual.go +++ b/sandboxindividual.go @@ -127,6 +127,14 @@ const ( SandboxIndividualUpdateResponseEmailsTypePersonal SandboxIndividualUpdateResponseEmailsType = "personal" ) +func (r SandboxIndividualUpdateResponseEmailsType) IsKnown() bool { + switch r { + case SandboxIndividualUpdateResponseEmailsTypeWork, SandboxIndividualUpdateResponseEmailsTypePersonal: + return true + } + return false +} + // The EEOC-defined ethnicity of the individual. type SandboxIndividualUpdateResponseEthnicity string @@ -141,6 +149,14 @@ const ( SandboxIndividualUpdateResponseEthnicityDeclineToSpecify SandboxIndividualUpdateResponseEthnicity = "decline_to_specify" ) +func (r SandboxIndividualUpdateResponseEthnicity) IsKnown() bool { + switch r { + case SandboxIndividualUpdateResponseEthnicityAsian, SandboxIndividualUpdateResponseEthnicityWhite, SandboxIndividualUpdateResponseEthnicityBlackOrAfricanAmerican, SandboxIndividualUpdateResponseEthnicityNativeHawaiianOrPacificIslander, SandboxIndividualUpdateResponseEthnicityAmericanIndianOrAlaskaNative, SandboxIndividualUpdateResponseEthnicityHispanicOrLatino, SandboxIndividualUpdateResponseEthnicityTwoOrMoreRaces, SandboxIndividualUpdateResponseEthnicityDeclineToSpecify: + return true + } + return false +} + // The gender of the individual. type SandboxIndividualUpdateResponseGender string @@ -151,6 +167,14 @@ const ( SandboxIndividualUpdateResponseGenderDeclineToSpecify SandboxIndividualUpdateResponseGender = "decline_to_specify" ) +func (r SandboxIndividualUpdateResponseGender) IsKnown() bool { + switch r { + case SandboxIndividualUpdateResponseGenderFemale, SandboxIndividualUpdateResponseGenderMale, SandboxIndividualUpdateResponseGenderOther, SandboxIndividualUpdateResponseGenderDeclineToSpecify: + return true + } + return false +} + type SandboxIndividualUpdateResponsePhoneNumber struct { Data string `json:"data"` Type SandboxIndividualUpdateResponsePhoneNumbersType `json:"type"` @@ -181,6 +205,14 @@ const ( SandboxIndividualUpdateResponsePhoneNumbersTypePersonal SandboxIndividualUpdateResponsePhoneNumbersType = "personal" ) +func (r SandboxIndividualUpdateResponsePhoneNumbersType) IsKnown() bool { + switch r { + case SandboxIndividualUpdateResponsePhoneNumbersTypeWork, SandboxIndividualUpdateResponsePhoneNumbersTypePersonal: + return true + } + return false +} + type SandboxIndividualUpdateParams struct { Dob param.Field[string] `json:"dob"` Emails param.Field[[]SandboxIndividualUpdateParamsEmail] `json:"emails"` @@ -228,6 +260,14 @@ const ( SandboxIndividualUpdateParamsEmailsTypePersonal SandboxIndividualUpdateParamsEmailsType = "personal" ) +func (r SandboxIndividualUpdateParamsEmailsType) IsKnown() bool { + switch r { + case SandboxIndividualUpdateParamsEmailsTypeWork, SandboxIndividualUpdateParamsEmailsTypePersonal: + return true + } + return false +} + // The EEOC-defined ethnicity of the individual. type SandboxIndividualUpdateParamsEthnicity string @@ -242,6 +282,14 @@ const ( SandboxIndividualUpdateParamsEthnicityDeclineToSpecify SandboxIndividualUpdateParamsEthnicity = "decline_to_specify" ) +func (r SandboxIndividualUpdateParamsEthnicity) IsKnown() bool { + switch r { + case SandboxIndividualUpdateParamsEthnicityAsian, SandboxIndividualUpdateParamsEthnicityWhite, SandboxIndividualUpdateParamsEthnicityBlackOrAfricanAmerican, SandboxIndividualUpdateParamsEthnicityNativeHawaiianOrPacificIslander, SandboxIndividualUpdateParamsEthnicityAmericanIndianOrAlaskaNative, SandboxIndividualUpdateParamsEthnicityHispanicOrLatino, SandboxIndividualUpdateParamsEthnicityTwoOrMoreRaces, SandboxIndividualUpdateParamsEthnicityDeclineToSpecify: + return true + } + return false +} + // The gender of the individual. type SandboxIndividualUpdateParamsGender string @@ -252,6 +300,14 @@ const ( SandboxIndividualUpdateParamsGenderDeclineToSpecify SandboxIndividualUpdateParamsGender = "decline_to_specify" ) +func (r SandboxIndividualUpdateParamsGender) IsKnown() bool { + switch r { + case SandboxIndividualUpdateParamsGenderFemale, SandboxIndividualUpdateParamsGenderMale, SandboxIndividualUpdateParamsGenderOther, SandboxIndividualUpdateParamsGenderDeclineToSpecify: + return true + } + return false +} + type SandboxIndividualUpdateParamsPhoneNumber struct { Data param.Field[string] `json:"data"` Type param.Field[SandboxIndividualUpdateParamsPhoneNumbersType] `json:"type"` @@ -267,3 +323,11 @@ const ( SandboxIndividualUpdateParamsPhoneNumbersTypeWork SandboxIndividualUpdateParamsPhoneNumbersType = "work" SandboxIndividualUpdateParamsPhoneNumbersTypePersonal SandboxIndividualUpdateParamsPhoneNumbersType = "personal" ) + +func (r SandboxIndividualUpdateParamsPhoneNumbersType) IsKnown() bool { + switch r { + case SandboxIndividualUpdateParamsPhoneNumbersTypeWork, SandboxIndividualUpdateParamsPhoneNumbersTypePersonal: + return true + } + return false +} diff --git a/sandboxjob.go b/sandboxjob.go index 0b5976e..598678d 100644 --- a/sandboxjob.go +++ b/sandboxjob.go @@ -85,3 +85,11 @@ type SandboxJobNewParamsType string const ( SandboxJobNewParamsTypeDataSyncAll SandboxJobNewParamsType = "data_sync_all" ) + +func (r SandboxJobNewParamsType) IsKnown() bool { + switch r { + case SandboxJobNewParamsTypeDataSyncAll: + return true + } + return false +} diff --git a/sandboxjobconfiguration.go b/sandboxjobconfiguration.go index 38899fe..1e00e58 100644 --- a/sandboxjobconfiguration.go +++ b/sandboxjobconfiguration.go @@ -78,12 +78,28 @@ const ( SandboxJobConfigurationCompletionStatusError SandboxJobConfigurationCompletionStatus = "error" ) +func (r SandboxJobConfigurationCompletionStatus) IsKnown() bool { + switch r { + case SandboxJobConfigurationCompletionStatusComplete, SandboxJobConfigurationCompletionStatusReauthError, SandboxJobConfigurationCompletionStatusPermissionsError, SandboxJobConfigurationCompletionStatusError: + return true + } + return false +} + type SandboxJobConfigurationType string const ( SandboxJobConfigurationTypeDataSyncAll SandboxJobConfigurationType = "data_sync_all" ) +func (r SandboxJobConfigurationType) IsKnown() bool { + switch r { + case SandboxJobConfigurationTypeDataSyncAll: + return true + } + return false +} + type SandboxJobConfigurationUpdateParams struct { CompletionStatus param.Field[SandboxJobConfigurationUpdateParamsCompletionStatus] `json:"completion_status,required"` Type param.Field[SandboxJobConfigurationUpdateParamsType] `json:"type,required"` @@ -102,8 +118,24 @@ const ( SandboxJobConfigurationUpdateParamsCompletionStatusError SandboxJobConfigurationUpdateParamsCompletionStatus = "error" ) +func (r SandboxJobConfigurationUpdateParamsCompletionStatus) IsKnown() bool { + switch r { + case SandboxJobConfigurationUpdateParamsCompletionStatusComplete, SandboxJobConfigurationUpdateParamsCompletionStatusReauthError, SandboxJobConfigurationUpdateParamsCompletionStatusPermissionsError, SandboxJobConfigurationUpdateParamsCompletionStatusError: + return true + } + return false +} + type SandboxJobConfigurationUpdateParamsType string const ( SandboxJobConfigurationUpdateParamsTypeDataSyncAll SandboxJobConfigurationUpdateParamsType = "data_sync_all" ) + +func (r SandboxJobConfigurationUpdateParamsType) IsKnown() bool { + switch r { + case SandboxJobConfigurationUpdateParamsTypeDataSyncAll: + return true + } + return false +} diff --git a/sandboxpayment.go b/sandboxpayment.go index 1781015..b4a04c8 100644 --- a/sandboxpayment.go +++ b/sandboxpayment.go @@ -133,6 +133,14 @@ const ( SandboxPaymentNewParamsPayStatementsEarningsTypeOther SandboxPaymentNewParamsPayStatementsEarningsType = "other" ) +func (r SandboxPaymentNewParamsPayStatementsEarningsType) IsKnown() bool { + switch r { + case SandboxPaymentNewParamsPayStatementsEarningsTypeSalary, SandboxPaymentNewParamsPayStatementsEarningsTypeWage, SandboxPaymentNewParamsPayStatementsEarningsTypeReimbursement, SandboxPaymentNewParamsPayStatementsEarningsTypeOvertime, SandboxPaymentNewParamsPayStatementsEarningsTypeSeverance, SandboxPaymentNewParamsPayStatementsEarningsTypeDoubleOvertime, SandboxPaymentNewParamsPayStatementsEarningsTypePto, SandboxPaymentNewParamsPayStatementsEarningsTypeSick, SandboxPaymentNewParamsPayStatementsEarningsTypeBonus, SandboxPaymentNewParamsPayStatementsEarningsTypeCommission, SandboxPaymentNewParamsPayStatementsEarningsTypeTips, SandboxPaymentNewParamsPayStatementsEarningsType1099, SandboxPaymentNewParamsPayStatementsEarningsTypeOther: + return true + } + return false +} + type SandboxPaymentNewParamsPayStatementsEmployeeDeduction struct { // The deduction amount in cents. Amount param.Field[int64] `json:"amount"` @@ -173,6 +181,14 @@ const ( SandboxPaymentNewParamsPayStatementsPaymentMethodDirectDeposit SandboxPaymentNewParamsPayStatementsPaymentMethod = "direct_deposit" ) +func (r SandboxPaymentNewParamsPayStatementsPaymentMethod) IsKnown() bool { + switch r { + case SandboxPaymentNewParamsPayStatementsPaymentMethodCheck, SandboxPaymentNewParamsPayStatementsPaymentMethodDirectDeposit: + return true + } + return false +} + type SandboxPaymentNewParamsPayStatementsTax struct { // The tax amount in cents. Amount param.Field[int64] `json:"amount"` @@ -200,6 +216,14 @@ const ( SandboxPaymentNewParamsPayStatementsTaxesTypeFica SandboxPaymentNewParamsPayStatementsTaxesType = "fica" ) +func (r SandboxPaymentNewParamsPayStatementsTaxesType) IsKnown() bool { + switch r { + case SandboxPaymentNewParamsPayStatementsTaxesTypeState, SandboxPaymentNewParamsPayStatementsTaxesTypeFederal, SandboxPaymentNewParamsPayStatementsTaxesTypeLocal, SandboxPaymentNewParamsPayStatementsTaxesTypeFica: + return true + } + return false +} + // The type of the payment associated with the pay statement. type SandboxPaymentNewParamsPayStatementsType string @@ -208,3 +232,11 @@ const ( SandboxPaymentNewParamsPayStatementsTypeOffCyclePayroll SandboxPaymentNewParamsPayStatementsType = "off_cycle_payroll" SandboxPaymentNewParamsPayStatementsTypeOneTimePayment SandboxPaymentNewParamsPayStatementsType = "one_time_payment" ) + +func (r SandboxPaymentNewParamsPayStatementsType) IsKnown() bool { + switch r { + case SandboxPaymentNewParamsPayStatementsTypeRegularPayroll, SandboxPaymentNewParamsPayStatementsTypeOffCyclePayroll, SandboxPaymentNewParamsPayStatementsTypeOneTimePayment: + return true + } + return false +} diff --git a/webhook.go b/webhook.go index 3e9899b..837ea89 100644 --- a/webhook.go +++ b/webhook.go @@ -1110,12 +1110,28 @@ const ( AccountUpdateEventDataAuthenticationMethodTypeOAuth AccountUpdateEventDataAuthenticationMethodType = "oauth" ) +func (r AccountUpdateEventDataAuthenticationMethodType) IsKnown() bool { + switch r { + case AccountUpdateEventDataAuthenticationMethodTypeAssisted, AccountUpdateEventDataAuthenticationMethodTypeCredential, AccountUpdateEventDataAuthenticationMethodTypeAPIToken, AccountUpdateEventDataAuthenticationMethodTypeAPICredential, AccountUpdateEventDataAuthenticationMethodTypeOAuth: + return true + } + return false +} + type AccountUpdateEventEventType string const ( AccountUpdateEventEventTypeAccountUpdated AccountUpdateEventEventType = "account.updated" ) +func (r AccountUpdateEventEventType) IsKnown() bool { + switch r { + case AccountUpdateEventEventTypeAccountUpdated: + return true + } + return false +} + type BaseWebhookEvent struct { // Unique Finch id of the employer account that was used to make this connection. AccountID string `json:"account_id,required"` @@ -1172,6 +1188,14 @@ const ( CompanyEventEventTypeCompanyUpdated CompanyEventEventType = "company.updated" ) +func (r CompanyEventEventType) IsKnown() bool { + switch r { + case CompanyEventEventTypeCompanyUpdated: + return true + } + return false +} + type DirectoryEvent struct { Data DirectoryEventData `json:"data"` EventType DirectoryEventEventType `json:"event_type"` @@ -1227,6 +1251,14 @@ const ( DirectoryEventEventTypeDirectoryDeleted DirectoryEventEventType = "directory.deleted" ) +func (r DirectoryEventEventType) IsKnown() bool { + switch r { + case DirectoryEventEventTypeDirectoryCreated, DirectoryEventEventTypeDirectoryUpdated, DirectoryEventEventTypeDirectoryDeleted: + return true + } + return false +} + type EmploymentEvent struct { Data EmploymentEventData `json:"data"` EventType EmploymentEventEventType `json:"event_type"` @@ -1282,6 +1314,14 @@ const ( EmploymentEventEventTypeEmploymentDeleted EmploymentEventEventType = "employment.deleted" ) +func (r EmploymentEventEventType) IsKnown() bool { + switch r { + case EmploymentEventEventTypeEmploymentCreated, EmploymentEventEventTypeEmploymentUpdated, EmploymentEventEventTypeEmploymentDeleted: + return true + } + return false +} + type IndividualEvent struct { Data IndividualEventData `json:"data"` EventType IndividualEventEventType `json:"event_type"` @@ -1337,6 +1377,14 @@ const ( IndividualEventEventTypeIndividualDeleted IndividualEventEventType = "individual.deleted" ) +func (r IndividualEventEventType) IsKnown() bool { + switch r { + case IndividualEventEventTypeIndividualCreated, IndividualEventEventTypeIndividualUpdated, IndividualEventEventTypeIndividualDeleted: + return true + } + return false +} + type JobCompletionEvent struct { Data JobCompletionEventData `json:"data"` EventType JobCompletionEventEventType `json:"event_type"` @@ -1399,6 +1447,14 @@ const ( JobCompletionEventEventTypeJobDataSyncAllUpdated JobCompletionEventEventType = "job.data_sync_all.updated" ) +func (r JobCompletionEventEventType) IsKnown() bool { + switch r { + case JobCompletionEventEventTypeJobBenefitCreateUpdated, JobCompletionEventEventTypeJobBenefitEnrollUpdated, JobCompletionEventEventTypeJobBenefitRegisterUpdated, JobCompletionEventEventTypeJobBenefitUnenrollUpdated, JobCompletionEventEventTypeJobBenefitUpdateUpdated, JobCompletionEventEventTypeJobDataSyncAllUpdated: + return true + } + return false +} + type PayStatementEvent struct { Data PayStatementEventData `json:"data"` EventType PayStatementEventEventType `json:"event_type"` @@ -1458,6 +1514,14 @@ const ( PayStatementEventEventTypePayStatementDeleted PayStatementEventEventType = "pay_statement.deleted" ) +func (r PayStatementEventEventType) IsKnown() bool { + switch r { + case PayStatementEventEventTypePayStatementCreated, PayStatementEventEventTypePayStatementUpdated, PayStatementEventEventTypePayStatementDeleted: + return true + } + return false +} + type PaymentEvent struct { Data PaymentEventData `json:"data"` EventType PaymentEventEventType `json:"event_type"` @@ -1516,6 +1580,14 @@ const ( PaymentEventEventTypePaymentDeleted PaymentEventEventType = "payment.deleted" ) +func (r PaymentEventEventType) IsKnown() bool { + switch r { + case PaymentEventEventTypePaymentCreated, PaymentEventEventTypePaymentUpdated, PaymentEventEventTypePaymentDeleted: + return true + } + return false +} + // Union satisfied by [AccountUpdateEvent], [JobCompletionEvent], [CompanyEvent], // [DirectoryEvent], [EmploymentEvent], [IndividualEvent], [PaymentEvent] or // [PayStatementEvent].