From 4273cd2fd27dfb2c0d3c4f73ec0169ff1dfbd501 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 5 Mar 2025 15:59:18 +0000 Subject: [PATCH 1/2] feat(api): manual updates (#1) --- .github/workflows/ci.yml | 45 + .github/workflows/publish-gem.yml | 32 + .github/workflows/release-doctor.yml | 22 + .gitignore | 9 + .release-please-manifest.json | 3 + .rubocop.yml | 212 ++ .stats.yml | 2 + .yardopts | 1 + Gemfile | 25 + Gemfile.lock | 190 ++ LICENSE | 201 ++ README.md | 126 +- Rakefile | 89 + SECURITY.md | 27 + Steepfile | 15 + bin/check-release-environment | 21 + bin/publish-gem | 9 + finch-api.gemspec | 19 + lib/finch-api.rb | 178 ++ lib/finch-api/base_client.rb | 464 +++ lib/finch-api/base_model.rb | 1188 ++++++++ lib/finch-api/base_page.rb | 40 + lib/finch-api/client.rb | 145 + lib/finch-api/errors.rb | 188 ++ lib/finch-api/extern.rb | 10 + lib/finch-api/individuals_page.rb | 98 + .../models/access_token_create_params.rb | 54 + .../models/account_disconnect_params.rb | 18 + .../models/account_introspect_params.rb | 18 + lib/finch-api/models/account_update_event.rb | 1978 +++++++++++++ lib/finch-api/models/base_webhook_event.rb | 41 + lib/finch-api/models/company_event.rb | 49 + .../models/connect/session_new_params.rb | 203 ++ .../models/connect/session_new_response.rb | 29 + .../connect/session_reauthenticate_params.rb | 90 + .../session_reauthenticate_response.rb | 29 + .../models/connection_status_type.rb | 40 + .../models/create_access_token_response.rb | 163 ++ lib/finch-api/models/directory_event.rb | 78 + lib/finch-api/models/disconnect_response.rb | 20 + lib/finch-api/models/employment_event.rb | 78 + .../models/hris/benefit_contribution.rb | 54 + .../models/hris/benefit_create_params.rb | 46 + .../hris/benefit_features_and_operations.rb | 199 ++ .../models/hris/benefit_frequency.rb | 33 + .../models/hris/benefit_list_params.rb | 20 + .../benefit_list_supported_benefits_params.rb | 20 + .../models/hris/benefit_retrieve_params.rb | 20 + lib/finch-api/models/hris/benefit_type.rb | 57 + .../models/hris/benefit_update_params.rb | 31 + .../hris/benefits/enrolled_individual.rb | 108 + .../hris/benefits/individual_benefit.rb | 127 + .../benefits/individual_enroll_many_params.rb | 268 ++ .../individual_enrolled_ids_params.rb | 22 + .../individual_enrolled_ids_response.rb | 29 + ...ndividual_retrieve_many_benefits_params.rb | 34 + .../individual_unenroll_many_params.rb | 33 + .../hris/benefits/unenrolled_individual.rb | 77 + lib/finch-api/models/hris/benefits_support.rb | 106 + .../models/hris/benfit_contribution.rb | 9 + lib/finch-api/models/hris/company.rb | 290 ++ lib/finch-api/models/hris/company_benefit.rb | 40 + .../models/hris/company_retrieve_params.rb | 20 + .../hris/create_company_benefits_response.rb | 21 + .../hris/directory_list_individuals_params.rb | 42 + .../models/hris/directory_list_params.rb | 42 + .../models/hris/document_list_params.rb | 89 + .../models/hris/document_list_response.rb | 27 + .../models/hris/document_response.rb | 89 + .../models/hris/document_retreive_params.rb | 20 + .../models/hris/document_retreive_response.rb | 41 + lib/finch-api/models/hris/employment_data.rb | 380 +++ .../models/hris/employment_data_response.rb | 45 + .../hris/employment_retrieve_many_params.rb | 45 + lib/finch-api/models/hris/individual.rb | 290 ++ .../models/hris/individual_in_directory.rb | 117 + .../models/hris/individual_response.rb | 45 + .../hris/individual_retrieve_many_params.rb | 73 + lib/finch-api/models/hris/pay_statement.rb | 587 ++++ .../models/hris/pay_statement_response.rb | 45 + .../hris/pay_statement_response_body.rb | 36 + .../pay_statement_retrieve_many_params.rb | 65 + lib/finch-api/models/hris/payment.rb | 174 ++ .../models/hris/payment_list_params.rb | 36 + .../models/hris/support_per_benefit_type.rb | 35 + .../models/hris/supported_benefit.rb | 166 ++ .../hris/update_company_benefit_response.rb | 21 + lib/finch-api/models/hris/w42005.rb | 188 ++ lib/finch-api/models/hris/w42020.rb | 180 ++ lib/finch-api/models/income.rb | 87 + lib/finch-api/models/individual_event.rb | 78 + lib/finch-api/models/introspection.rb | 342 +++ lib/finch-api/models/job_completion_event.rb | 90 + .../models/jobs/automated_async_job.rb | 162 ++ .../models/jobs/automated_create_params.rb | 70 + .../models/jobs/automated_create_response.rb | 43 + .../models/jobs/automated_list_params.rb | 42 + .../models/jobs/automated_retrieve_params.rb | 20 + lib/finch-api/models/jobs/manual_async_job.rb | 63 + .../models/jobs/manual_retrieve_params.rb | 20 + lib/finch-api/models/location.rb | 79 + lib/finch-api/models/money.rb | 30 + lib/finch-api/models/operation_support.rb | 42 + .../models/operation_support_matrix.rb | 81 + lib/finch-api/models/paging.rb | 35 + lib/finch-api/models/pay_statement_event.rb | 89 + lib/finch-api/models/payment_event.rb | 81 + .../models/payroll/pay_group_list_params.rb | 40 + .../models/payroll/pay_group_list_response.rb | 87 + .../payroll/pay_group_retrieve_params.rb | 20 + .../payroll/pay_group_retrieve_response.rb | 81 + lib/finch-api/models/provider.rb | 2039 ++++++++++++++ lib/finch-api/models/provider_list_params.rb | 18 + .../request_forwarding_forward_params.rb | 60 + .../request_forwarding_forward_response.rb | 97 + .../models/sandbox/company_update_params.rb | 294 ++ .../models/sandbox/company_update_response.rb | 276 ++ .../sandbox/connection_create_params.rb | 90 + .../sandbox/connection_create_response.rb | 113 + .../connections/account_create_params.rb | 87 + .../connections/account_create_response.rb | 93 + .../connections/account_update_params.rb | 32 + .../connections/account_update_response.rb | 91 + .../models/sandbox/directory_create_params.rb | 642 +++++ .../sandbox/directory_create_response.rb | 9 + .../sandbox/employment_update_params.rb | 372 +++ .../sandbox/employment_update_response.rb | 378 +++ .../sandbox/individual_update_params.rb | 292 ++ .../sandbox/individual_update_response.rb | 300 ++ .../models/sandbox/job_create_params.rb | 49 + .../models/sandbox/job_create_response.rb | 43 + .../jobs/configuration_retrieve_params.rb | 22 + .../jobs/configuration_retrieve_response.rb | 11 + .../jobs/configuration_update_params.rb | 22 + .../sandbox/jobs/sandbox_job_configuration.rb | 79 + .../models/sandbox/payment_create_params.rb | 646 +++++ .../models/sandbox/payment_create_response.rb | 29 + lib/finch-api/models/webhook_event.rb | 48 + lib/finch-api/page.rb | 98 + lib/finch-api/pooled_net_requester.rb | 175 ++ lib/finch-api/request_options.rb | 115 + lib/finch-api/resources/access_tokens.rb | 40 + lib/finch-api/resources/account.rb | 47 + lib/finch-api/resources/connect.rb | 17 + lib/finch-api/resources/connect/sessions.rb | 81 + lib/finch-api/resources/hris.rb | 45 + lib/finch-api/resources/hris/benefits.rb | 125 + .../resources/hris/benefits/individuals.rb | 112 + lib/finch-api/resources/hris/company.rb | 32 + lib/finch-api/resources/hris/directory.rb | 65 + lib/finch-api/resources/hris/documents.rb | 65 + lib/finch-api/resources/hris/employments.rb | 37 + lib/finch-api/resources/hris/individuals.rb | 39 + .../resources/hris/pay_statements.rb | 40 + lib/finch-api/resources/hris/payments.rb | 41 + lib/finch-api/resources/jobs.rb | 21 + lib/finch-api/resources/jobs/automated.rb | 96 + lib/finch-api/resources/jobs/manual.rb | 35 + lib/finch-api/resources/payroll.rb | 17 + lib/finch-api/resources/payroll/pay_groups.rb | 58 + lib/finch-api/resources/providers.rb | 31 + lib/finch-api/resources/request_forwarding.rb | 52 + lib/finch-api/resources/sandbox.rb | 41 + lib/finch-api/resources/sandbox/company.rb | 50 + .../resources/sandbox/connections.rb | 48 + .../resources/sandbox/connections/accounts.rb | 67 + lib/finch-api/resources/sandbox/directory.rb | 37 + lib/finch-api/resources/sandbox/employment.rb | 76 + lib/finch-api/resources/sandbox/individual.rb | 65 + lib/finch-api/resources/sandbox/jobs.rb | 40 + .../resources/sandbox/jobs/configuration.rb | 57 + lib/finch-api/resources/sandbox/payment.rb | 40 + lib/finch-api/resources/webhooks.rb | 13 + lib/finch-api/responses_page.rb | 84 + lib/finch-api/single_page.rb | 82 + lib/finch-api/util.rb | 636 +++++ lib/finch-api/version.rb | 5 + manifest.yaml | 13 + rbi/lib/finch-api/base_client.rbi | 173 ++ rbi/lib/finch-api/base_model.rbi | 476 ++++ rbi/lib/finch-api/base_page.rbi | 39 + rbi/lib/finch-api/client.rbi | 102 + rbi/lib/finch-api/errors.rbi | 146 + rbi/lib/finch-api/extern.rbi | 7 + rbi/lib/finch-api/individuals_page.rbi | 37 + .../models/access_token_create_params.rbi | 70 + .../models/account_disconnect_params.rbi | 18 + .../models/account_introspect_params.rbi | 18 + .../finch-api/models/account_update_event.rbi | 2479 +++++++++++++++++ .../finch-api/models/base_webhook_event.rbi | 39 + rbi/lib/finch-api/models/company_event.rbi | 43 + .../models/connect/session_new_params.rbi | 203 ++ .../models/connect/session_new_response.rbi | 33 + .../connect/session_reauthenticate_params.rbi | 95 + .../session_reauthenticate_response.rbi | 33 + .../models/connection_status_type.rbi | 20 + .../models/create_access_token_response.rbi | 159 ++ rbi/lib/finch-api/models/directory_event.rbi | 61 + .../finch-api/models/disconnect_response.rbi | 23 + rbi/lib/finch-api/models/employment_event.rbi | 61 + .../models/hris/benefit_contribution.rbi | 44 + .../models/hris/benefit_create_params.rbi | 62 + .../hris/benefit_features_and_operations.rbi | 190 ++ .../models/hris/benefit_frequency.rbi | 19 + .../models/hris/benefit_list_params.rbi | 20 + ...benefit_list_supported_benefits_params.rbi | 20 + .../models/hris/benefit_retrieve_params.rbi | 20 + .../finch-api/models/hris/benefit_type.rbi | 35 + .../models/hris/benefit_update_params.rbi | 37 + .../hris/benefits/enrolled_individual.rbi | 115 + .../hris/benefits/individual_benefit.rbi | 153 + .../individual_enroll_many_params.rbi | 281 ++ .../individual_enrolled_ids_params.rbi | 22 + .../individual_enrolled_ids_response.rbi | 35 + ...dividual_retrieve_many_benefits_params.rbi | 36 + .../individual_unenroll_many_params.rbi | 38 + .../hris/benefits/unenrolled_individual.rbi | 102 + .../models/hris/benefits_support.rbi | 196 ++ .../models/hris/benfit_contribution.rbi | 9 + rbi/lib/finch-api/models/hris/company.rbi | 338 +++ .../finch-api/models/hris/company_benefit.rbi | 67 + .../models/hris/company_retrieve_params.rbi | 20 + .../hris/create_company_benefits_response.rbi | 25 + .../directory_list_individuals_params.rbi | 43 + .../models/hris/directory_list_params.rbi | 43 + .../models/hris/document_list_params.rbi | 83 + .../models/hris/document_list_response.rbi | 42 + .../models/hris/document_response.rbi | 86 + .../models/hris/document_retreive_params.rbi | 20 + .../hris/document_retreive_response.rbi | 15 + .../finch-api/models/hris/employment_data.rbi | 393 +++ .../models/hris/employment_data_response.rbi | 41 + .../hris/employment_retrieve_many_params.rbi | 63 + rbi/lib/finch-api/models/hris/individual.rbi | 281 ++ .../models/hris/individual_in_directory.rbi | 147 + .../models/hris/individual_response.rbi | 41 + .../hris/individual_retrieve_many_params.rbi | 94 + .../finch-api/models/hris/pay_statement.rbi | 691 +++++ .../models/hris/pay_statement_response.rbi | 47 + .../hris/pay_statement_response_body.rbi | 44 + .../pay_statement_retrieve_many_params.rbi | 79 + rbi/lib/finch-api/models/hris/payment.rbi | 207 ++ .../models/hris/payment_list_params.rbi | 45 + .../models/hris/support_per_benefit_type.rbi | 47 + .../models/hris/supported_benefit.rbi | 155 ++ .../hris/update_company_benefit_response.rbi | 25 + rbi/lib/finch-api/models/hris/w42005.rbi | 150 + rbi/lib/finch-api/models/hris/w42020.rbi | 177 ++ rbi/lib/finch-api/models/income.rbi | 83 + rbi/lib/finch-api/models/individual_event.rbi | 61 + rbi/lib/finch-api/models/introspection.rbi | 350 +++ .../finch-api/models/job_completion_event.rbi | 72 + .../models/jobs/automated_async_job.rbi | 174 ++ .../models/jobs/automated_create_params.rbi | 83 + .../models/jobs/automated_create_response.rbi | 64 + .../models/jobs/automated_list_params.rbi | 43 + .../models/jobs/automated_retrieve_params.rbi | 20 + .../models/jobs/manual_async_job.rbi | 54 + .../models/jobs/manual_retrieve_params.rbi | 20 + rbi/lib/finch-api/models/location.rbi | 114 + rbi/lib/finch-api/models/money.rbi | 31 + .../finch-api/models/operation_support.rbi | 18 + .../models/operation_support_matrix.rbi | 47 + rbi/lib/finch-api/models/paging.rbi | 31 + .../finch-api/models/pay_statement_event.rbi | 69 + rbi/lib/finch-api/models/payment_event.rbi | 69 + .../models/payroll/pay_group_list_params.rbi | 52 + .../payroll/pay_group_list_response.rbi | 59 + .../payroll/pay_group_retrieve_params.rbi | 20 + .../payroll/pay_group_retrieve_response.rbi | 82 + rbi/lib/finch-api/models/provider.rbi | 2369 ++++++++++++++++ .../finch-api/models/provider_list_params.rbi | 18 + .../request_forwarding_forward_params.rbi | 80 + .../request_forwarding_forward_response.rbi | 138 + .../models/sandbox/company_update_params.rbi | 336 +++ .../sandbox/company_update_response.rbi | 330 +++ .../sandbox/connection_create_params.rbi | 91 + .../sandbox/connection_create_response.rbi | 129 + .../connections/account_create_params.rbi | 93 + .../connections/account_create_response.rbi | 120 + .../connections/account_update_params.rbi | 36 + .../connections/account_update_response.rbi | 109 + .../sandbox/directory_create_params.rbi | 629 +++++ .../sandbox/directory_create_response.rbi | 9 + .../sandbox/employment_update_params.rbi | 377 +++ .../sandbox/employment_update_response.rbi | 382 +++ .../sandbox/individual_update_params.rbi | 276 ++ .../sandbox/individual_update_response.rbi | 283 ++ .../models/sandbox/job_create_params.rbi | 46 + .../models/sandbox/job_create_response.rbi | 64 + .../jobs/configuration_retrieve_params.rbi | 22 + .../jobs/configuration_retrieve_response.rbi | 11 + .../jobs/configuration_update_params.rbi | 22 + .../jobs/sandbox_job_configuration.rbi | 58 + .../models/sandbox/payment_create_params.rbi | 876 ++++++ .../sandbox/payment_create_response.rbi | 33 + rbi/lib/finch-api/models/webhook_event.rbi | 18 + rbi/lib/finch-api/page.rbi | 37 + rbi/lib/finch-api/pooled_net_requester.rbi | 36 + rbi/lib/finch-api/request_options.rbi | 84 + rbi/lib/finch-api/resources/access_tokens.rbi | 24 + rbi/lib/finch-api/resources/account.rbi | 25 + rbi/lib/finch-api/resources/connect.rbi | 15 + .../finch-api/resources/connect/sessions.rbi | 61 + rbi/lib/finch-api/resources/hris.rbi | 43 + rbi/lib/finch-api/resources/hris/benefits.rbi | 64 + .../resources/hris/benefits/individuals.rbi | 58 + rbi/lib/finch-api/resources/hris/company.rbi | 20 + .../finch-api/resources/hris/directory.rbi | 35 + .../finch-api/resources/hris/documents.rbi | 36 + .../finch-api/resources/hris/employments.rbi | 23 + .../finch-api/resources/hris/individuals.rbi | 24 + .../resources/hris/pay_statements.rbi | 23 + rbi/lib/finch-api/resources/hris/payments.rbi | 24 + rbi/lib/finch-api/resources/jobs.rbi | 19 + .../finch-api/resources/jobs/automated.rbi | 45 + rbi/lib/finch-api/resources/jobs/manual.rbi | 23 + rbi/lib/finch-api/resources/payroll.rbi | 15 + .../resources/payroll/pay_groups.rbi | 34 + rbi/lib/finch-api/resources/providers.rbi | 18 + .../resources/request_forwarding.rbi | 25 + rbi/lib/finch-api/resources/sandbox.rbi | 39 + .../finch-api/resources/sandbox/company.rbi | 40 + .../resources/sandbox/connections.rbi | 36 + .../sandbox/connections/accounts.rbi | 38 + .../finch-api/resources/sandbox/directory.rbi | 23 + .../resources/sandbox/employment.rbi | 62 + .../resources/sandbox/individual.rbi | 50 + rbi/lib/finch-api/resources/sandbox/jobs.rbi | 27 + .../resources/sandbox/jobs/configuration.rbi | 33 + .../finch-api/resources/sandbox/payment.rbi | 25 + rbi/lib/finch-api/resources/webhooks.rbi | 11 + rbi/lib/finch-api/responses_page.rbi | 29 + rbi/lib/finch-api/single_page.rbi | 33 + rbi/lib/finch-api/util.rbi | 167 ++ rbi/lib/finch-api/version.rbi | 5 + release-please-config.json | 68 + scripts/bootstrap | 16 + scripts/format | 8 + scripts/lint | 7 + scripts/mock | 41 + scripts/test | 56 + sig/finch-api/base_client.rbs | 101 + sig/finch-api/base_model.rbs | 242 ++ sig/finch-api/base_page.rbs | 20 + sig/finch-api/client.rbs | 54 + sig/finch-api/errors.rbs | 99 + sig/finch-api/extern.rbs | 4 + sig/finch-api/individuals_page.rbs | 16 + .../models/access_token_create_params.rbs | 46 + .../models/account_disconnect_params.rbs | 19 + .../models/account_introspect_params.rbs | 19 + sig/finch-api/models/account_update_event.rbs | 1448 ++++++++++ sig/finch-api/models/base_webhook_event.rbs | 24 + sig/finch-api/models/company_event.rbs | 36 + .../models/connect/session_new_params.rbs | 129 + .../models/connect/session_new_response.rbs | 22 + .../connect/session_reauthenticate_params.rbs | 65 + .../session_reauthenticate_response.rbs | 23 + .../models/connection_status_type.rbs | 22 + .../models/create_access_token_response.rbs | 80 + sig/finch-api/models/directory_event.rbs | 61 + sig/finch-api/models/disconnect_response.rbs | 17 + sig/finch-api/models/employment_event.rbs | 61 + .../models/hris/benefit_contribution.rbs | 38 + .../models/hris/benefit_create_params.rbs | 40 + .../hris/benefit_features_and_operations.rbs | 112 + .../models/hris/benefit_frequency.rbs | 15 + .../models/hris/benefit_list_params.rbs | 21 + ...benefit_list_supported_benefits_params.rbs | 22 + .../models/hris/benefit_retrieve_params.rbs | 21 + sig/finch-api/models/hris/benefit_type.rbs | 50 + .../models/hris/benefit_update_params.rbs | 26 + .../hris/benefits/enrolled_individual.rbs | 75 + .../hris/benefits/individual_benefit.rbs | 91 + .../individual_enroll_many_params.rbs | 203 ++ .../individual_enrolled_ids_params.rbs | 24 + .../individual_enrolled_ids_response.rbs | 25 + ...dividual_retrieve_many_benefits_params.rbs | 31 + .../individual_unenroll_many_params.rbs | 31 + .../hris/benefits/unenrolled_individual.rbs | 62 + .../models/hris/benefits_support.rbs | 68 + .../models/hris/benfit_contribution.rbs | 8 + sig/finch-api/models/hris/company.rbs | 195 ++ sig/finch-api/models/hris/company_benefit.rbs | 36 + .../models/hris/company_retrieve_params.rbs | 21 + .../hris/create_company_benefits_response.rbs | 20 + .../directory_list_individuals_params.rbs | 34 + .../models/hris/directory_list_params.rbs | 34 + .../models/hris/document_list_params.rbs | 61 + .../models/hris/document_list_response.rbs | 29 + .../models/hris/document_response.rbs | 58 + .../models/hris/document_retreive_params.rbs | 21 + .../hris/document_retreive_response.rbs | 12 + sig/finch-api/models/hris/employment_data.rbs | 228 ++ .../models/hris/employment_data_response.rbs | 41 + .../hris/employment_retrieve_many_params.rbs | 45 + sig/finch-api/models/hris/individual.rbs | 176 ++ .../models/hris/individual_in_directory.rbs | 83 + .../models/hris/individual_response.rbs | 41 + .../hris/individual_retrieve_many_params.rbs | 72 + sig/finch-api/models/hris/pay_statement.rbs | 445 +++ .../models/hris/pay_statement_response.rbs | 41 + .../hris/pay_statement_response_body.rbs | 35 + .../pay_statement_retrieve_many_params.rbs | 53 + sig/finch-api/models/hris/payment.rbs | 112 + .../models/hris/payment_list_params.rbs | 30 + .../models/hris/support_per_benefit_type.rbs | 37 + .../models/hris/supported_benefit.rbs | 84 + .../hris/update_company_benefit_response.rbs | 20 + sig/finch-api/models/hris/w42005.rbs | 111 + sig/finch-api/models/hris/w42020.rbs | 108 + sig/finch-api/models/income.rbs | 57 + sig/finch-api/models/individual_event.rbs | 61 + sig/finch-api/models/introspection.rbs | 204 ++ sig/finch-api/models/job_completion_event.rbs | 70 + .../models/jobs/automated_async_job.rbs | 102 + .../models/jobs/automated_create_params.rbs | 57 + .../models/jobs/automated_create_response.rbs | 37 + .../models/jobs/automated_list_params.rbs | 34 + .../models/jobs/automated_retrieve_params.rbs | 21 + .../models/jobs/manual_async_job.rbs | 43 + .../models/jobs/manual_retrieve_params.rbs | 21 + sig/finch-api/models/location.rbs | 48 + sig/finch-api/models/money.rbs | 19 + sig/finch-api/models/operation_support.rbs | 18 + .../models/operation_support_matrix.rbs | 50 + sig/finch-api/models/paging.rbs | 21 + sig/finch-api/models/pay_statement_event.rbs | 68 + sig/finch-api/models/payment_event.rbs | 59 + .../models/payroll/pay_group_list_params.rbs | 35 + .../payroll/pay_group_list_response.rbs | 66 + .../payroll/pay_group_retrieve_params.rbs | 21 + .../payroll/pay_group_retrieve_response.rbs | 62 + sig/finch-api/models/provider.rbs | 1455 ++++++++++ sig/finch-api/models/provider_list_params.rbs | 18 + .../request_forwarding_forward_params.rbs | 44 + .../request_forwarding_forward_response.rbs | 71 + .../models/sandbox/company_update_params.rbs | 197 ++ .../sandbox/company_update_response.rbs | 192 ++ .../sandbox/connection_create_params.rbs | 61 + .../sandbox/connection_create_response.rbs | 66 + .../connections/account_create_params.rbs | 62 + .../connections/account_create_response.rbs | 63 + .../connections/account_update_params.rbs | 34 + .../connections/account_update_response.rbs | 61 + .../sandbox/directory_create_params.rbs | 392 +++ .../sandbox/directory_create_response.rbs | 9 + .../sandbox/employment_update_params.rbs | 228 ++ .../sandbox/employment_update_response.rbs | 229 ++ .../sandbox/individual_update_params.rbs | 178 ++ .../sandbox/individual_update_response.rbs | 179 ++ .../models/sandbox/job_create_params.rbs | 36 + .../models/sandbox/job_create_response.rbs | 37 + .../jobs/configuration_retrieve_params.rbs | 23 + .../jobs/configuration_retrieve_response.rbs | 12 + .../jobs/configuration_update_params.rbs | 23 + .../jobs/sandbox_job_configuration.rbs | 51 + .../models/sandbox/payment_create_params.rbs | 487 ++++ .../sandbox/payment_create_response.rbs | 22 + sig/finch-api/models/webhook_event.rbs | 17 + sig/finch-api/page.rbs | 16 + sig/finch-api/pooled_net_requester.rbs | 28 + sig/finch-api/request_options.rbs | 40 + sig/finch-api/resources/access_tokens.rbs | 19 + sig/finch-api/resources/account.rbs | 25 + sig/finch-api/resources/connect.rbs | 9 + sig/finch-api/resources/connect/sessions.rbs | 40 + sig/finch-api/resources/hris.rbs | 23 + sig/finch-api/resources/hris/benefits.rbs | 64 + .../resources/hris/benefits/individuals.rbs | 58 + sig/finch-api/resources/hris/company.rbs | 18 + sig/finch-api/resources/hris/directory.rbs | 31 + sig/finch-api/resources/hris/documents.rbs | 33 + sig/finch-api/resources/hris/employments.rbs | 19 + sig/finch-api/resources/hris/individuals.rbs | 20 + .../resources/hris/pay_statements.rbs | 19 + sig/finch-api/resources/hris/payments.rbs | 20 + sig/finch-api/resources/jobs.rbs | 11 + sig/finch-api/resources/jobs/automated.rbs | 42 + sig/finch-api/resources/jobs/manual.rbs | 20 + sig/finch-api/resources/payroll.rbs | 9 + .../resources/payroll/pay_groups.rbs | 31 + sig/finch-api/resources/providers.rbs | 15 + .../resources/request_forwarding.rbs | 21 + sig/finch-api/resources/sandbox.rbs | 21 + sig/finch-api/resources/sandbox/company.rbs | 26 + .../resources/sandbox/connections.rbs | 24 + .../sandbox/connections/accounts.rbs | 34 + sig/finch-api/resources/sandbox/directory.rbs | 19 + .../resources/sandbox/employment.rbs | 38 + .../resources/sandbox/individual.rbs | 32 + sig/finch-api/resources/sandbox/jobs.rbs | 21 + .../resources/sandbox/jobs/configuration.rbs | 31 + sig/finch-api/resources/sandbox/payment.rbs | 21 + sig/finch-api/resources/webhooks.rbs | 7 + sig/finch-api/responses_page.rbs | 14 + sig/finch-api/single_page.rbs | 18 + sig/finch-api/util.rbs | 109 + sig/finch-api/version.rbs | 3 + test/finch-api/base_model_test.rb | 341 +++ test/finch-api/client_test.rb | 294 ++ test/finch-api/resource_namespaces.rb | 35 + .../finch-api/resources/access_tokens_test.rb | 28 + test/finch-api/resources/account_test.rb | 48 + .../resources/connect/sessions_test.rb | 35 + test/finch-api/resources/connect_test.rb | 6 + .../hris/benefits/individuals_test.rb | 83 + .../finch-api/resources/hris/benefits_test.rb | 98 + test/finch-api/resources/hris/company_test.rb | 27 + .../resources/hris/directory_test.rb | 55 + .../resources/hris/documents_test.rb | 28 + .../resources/hris/employments_test.rb | 26 + .../resources/hris/individuals_test.rb | 26 + .../resources/hris/pay_statements_test.rb | 26 + .../finch-api/resources/hris/payments_test.rb | 35 + test/finch-api/resources/hris_test.rb | 6 + .../resources/jobs/automated_test.rb | 74 + test/finch-api/resources/jobs/manual_test.rb | 21 + test/finch-api/resources/jobs_test.rb | 6 + .../resources/payroll/pay_groups_test.rb | 43 + test/finch-api/resources/payroll_test.rb | 6 + test/finch-api/resources/providers_test.rb | 33 + .../resources/request_forwarding_test.rb | 22 + .../resources/sandbox/company_test.rb | 35 + .../sandbox/connections/accounts_test.rb | 47 + .../resources/sandbox/connections_test.rb | 26 + .../resources/sandbox/directory_test.rb | 13 + .../resources/sandbox/employment_test.rb | 37 + .../resources/sandbox/individual_test.rb | 31 + .../sandbox/jobs/configuration_test.rb | 28 + test/finch-api/resources/sandbox/jobs_test.rb | 22 + .../resources/sandbox/payment_test.rb | 20 + test/finch-api/resources/sandbox_test.rb | 6 + test/finch-api/resources/shared_test.rb | 6 + test/finch-api/resources/webhooks_test.rb | 6 + test/finch-api/test_helper.rb | 74 + test/finch-api/util_test.rb | 467 ++++ 538 files changed, 55557 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/publish-gem.yml create mode 100644 .github/workflows/release-doctor.yml create mode 100644 .gitignore create mode 100644 .release-please-manifest.json create mode 100644 .rubocop.yml create mode 100644 .stats.yml create mode 100644 .yardopts create mode 100644 Gemfile create mode 100644 Gemfile.lock create mode 100644 LICENSE create mode 100644 Rakefile create mode 100644 SECURITY.md create mode 100644 Steepfile create mode 100644 bin/check-release-environment create mode 100644 bin/publish-gem create mode 100644 finch-api.gemspec create mode 100644 lib/finch-api.rb create mode 100644 lib/finch-api/base_client.rb create mode 100644 lib/finch-api/base_model.rb create mode 100644 lib/finch-api/base_page.rb create mode 100644 lib/finch-api/client.rb create mode 100644 lib/finch-api/errors.rb create mode 100644 lib/finch-api/extern.rb create mode 100644 lib/finch-api/individuals_page.rb create mode 100644 lib/finch-api/models/access_token_create_params.rb create mode 100644 lib/finch-api/models/account_disconnect_params.rb create mode 100644 lib/finch-api/models/account_introspect_params.rb create mode 100644 lib/finch-api/models/account_update_event.rb create mode 100644 lib/finch-api/models/base_webhook_event.rb create mode 100644 lib/finch-api/models/company_event.rb create mode 100644 lib/finch-api/models/connect/session_new_params.rb create mode 100644 lib/finch-api/models/connect/session_new_response.rb create mode 100644 lib/finch-api/models/connect/session_reauthenticate_params.rb create mode 100644 lib/finch-api/models/connect/session_reauthenticate_response.rb create mode 100644 lib/finch-api/models/connection_status_type.rb create mode 100644 lib/finch-api/models/create_access_token_response.rb create mode 100644 lib/finch-api/models/directory_event.rb create mode 100644 lib/finch-api/models/disconnect_response.rb create mode 100644 lib/finch-api/models/employment_event.rb create mode 100644 lib/finch-api/models/hris/benefit_contribution.rb create mode 100644 lib/finch-api/models/hris/benefit_create_params.rb create mode 100644 lib/finch-api/models/hris/benefit_features_and_operations.rb create mode 100644 lib/finch-api/models/hris/benefit_frequency.rb create mode 100644 lib/finch-api/models/hris/benefit_list_params.rb create mode 100644 lib/finch-api/models/hris/benefit_list_supported_benefits_params.rb create mode 100644 lib/finch-api/models/hris/benefit_retrieve_params.rb create mode 100644 lib/finch-api/models/hris/benefit_type.rb create mode 100644 lib/finch-api/models/hris/benefit_update_params.rb create mode 100644 lib/finch-api/models/hris/benefits/enrolled_individual.rb create mode 100644 lib/finch-api/models/hris/benefits/individual_benefit.rb create mode 100644 lib/finch-api/models/hris/benefits/individual_enroll_many_params.rb create mode 100644 lib/finch-api/models/hris/benefits/individual_enrolled_ids_params.rb create mode 100644 lib/finch-api/models/hris/benefits/individual_enrolled_ids_response.rb create mode 100644 lib/finch-api/models/hris/benefits/individual_retrieve_many_benefits_params.rb create mode 100644 lib/finch-api/models/hris/benefits/individual_unenroll_many_params.rb create mode 100644 lib/finch-api/models/hris/benefits/unenrolled_individual.rb create mode 100644 lib/finch-api/models/hris/benefits_support.rb create mode 100644 lib/finch-api/models/hris/benfit_contribution.rb create mode 100644 lib/finch-api/models/hris/company.rb create mode 100644 lib/finch-api/models/hris/company_benefit.rb create mode 100644 lib/finch-api/models/hris/company_retrieve_params.rb create mode 100644 lib/finch-api/models/hris/create_company_benefits_response.rb create mode 100644 lib/finch-api/models/hris/directory_list_individuals_params.rb create mode 100644 lib/finch-api/models/hris/directory_list_params.rb create mode 100644 lib/finch-api/models/hris/document_list_params.rb create mode 100644 lib/finch-api/models/hris/document_list_response.rb create mode 100644 lib/finch-api/models/hris/document_response.rb create mode 100644 lib/finch-api/models/hris/document_retreive_params.rb create mode 100644 lib/finch-api/models/hris/document_retreive_response.rb create mode 100644 lib/finch-api/models/hris/employment_data.rb create mode 100644 lib/finch-api/models/hris/employment_data_response.rb create mode 100644 lib/finch-api/models/hris/employment_retrieve_many_params.rb create mode 100644 lib/finch-api/models/hris/individual.rb create mode 100644 lib/finch-api/models/hris/individual_in_directory.rb create mode 100644 lib/finch-api/models/hris/individual_response.rb create mode 100644 lib/finch-api/models/hris/individual_retrieve_many_params.rb create mode 100644 lib/finch-api/models/hris/pay_statement.rb create mode 100644 lib/finch-api/models/hris/pay_statement_response.rb create mode 100644 lib/finch-api/models/hris/pay_statement_response_body.rb create mode 100644 lib/finch-api/models/hris/pay_statement_retrieve_many_params.rb create mode 100644 lib/finch-api/models/hris/payment.rb create mode 100644 lib/finch-api/models/hris/payment_list_params.rb create mode 100644 lib/finch-api/models/hris/support_per_benefit_type.rb create mode 100644 lib/finch-api/models/hris/supported_benefit.rb create mode 100644 lib/finch-api/models/hris/update_company_benefit_response.rb create mode 100644 lib/finch-api/models/hris/w42005.rb create mode 100644 lib/finch-api/models/hris/w42020.rb create mode 100644 lib/finch-api/models/income.rb create mode 100644 lib/finch-api/models/individual_event.rb create mode 100644 lib/finch-api/models/introspection.rb create mode 100644 lib/finch-api/models/job_completion_event.rb create mode 100644 lib/finch-api/models/jobs/automated_async_job.rb create mode 100644 lib/finch-api/models/jobs/automated_create_params.rb create mode 100644 lib/finch-api/models/jobs/automated_create_response.rb create mode 100644 lib/finch-api/models/jobs/automated_list_params.rb create mode 100644 lib/finch-api/models/jobs/automated_retrieve_params.rb create mode 100644 lib/finch-api/models/jobs/manual_async_job.rb create mode 100644 lib/finch-api/models/jobs/manual_retrieve_params.rb create mode 100644 lib/finch-api/models/location.rb create mode 100644 lib/finch-api/models/money.rb create mode 100644 lib/finch-api/models/operation_support.rb create mode 100644 lib/finch-api/models/operation_support_matrix.rb create mode 100644 lib/finch-api/models/paging.rb create mode 100644 lib/finch-api/models/pay_statement_event.rb create mode 100644 lib/finch-api/models/payment_event.rb create mode 100644 lib/finch-api/models/payroll/pay_group_list_params.rb create mode 100644 lib/finch-api/models/payroll/pay_group_list_response.rb create mode 100644 lib/finch-api/models/payroll/pay_group_retrieve_params.rb create mode 100644 lib/finch-api/models/payroll/pay_group_retrieve_response.rb create mode 100644 lib/finch-api/models/provider.rb create mode 100644 lib/finch-api/models/provider_list_params.rb create mode 100644 lib/finch-api/models/request_forwarding_forward_params.rb create mode 100644 lib/finch-api/models/request_forwarding_forward_response.rb create mode 100644 lib/finch-api/models/sandbox/company_update_params.rb create mode 100644 lib/finch-api/models/sandbox/company_update_response.rb create mode 100644 lib/finch-api/models/sandbox/connection_create_params.rb create mode 100644 lib/finch-api/models/sandbox/connection_create_response.rb create mode 100644 lib/finch-api/models/sandbox/connections/account_create_params.rb create mode 100644 lib/finch-api/models/sandbox/connections/account_create_response.rb create mode 100644 lib/finch-api/models/sandbox/connections/account_update_params.rb create mode 100644 lib/finch-api/models/sandbox/connections/account_update_response.rb create mode 100644 lib/finch-api/models/sandbox/directory_create_params.rb create mode 100644 lib/finch-api/models/sandbox/directory_create_response.rb create mode 100644 lib/finch-api/models/sandbox/employment_update_params.rb create mode 100644 lib/finch-api/models/sandbox/employment_update_response.rb create mode 100644 lib/finch-api/models/sandbox/individual_update_params.rb create mode 100644 lib/finch-api/models/sandbox/individual_update_response.rb create mode 100644 lib/finch-api/models/sandbox/job_create_params.rb create mode 100644 lib/finch-api/models/sandbox/job_create_response.rb create mode 100644 lib/finch-api/models/sandbox/jobs/configuration_retrieve_params.rb create mode 100644 lib/finch-api/models/sandbox/jobs/configuration_retrieve_response.rb create mode 100644 lib/finch-api/models/sandbox/jobs/configuration_update_params.rb create mode 100644 lib/finch-api/models/sandbox/jobs/sandbox_job_configuration.rb create mode 100644 lib/finch-api/models/sandbox/payment_create_params.rb create mode 100644 lib/finch-api/models/sandbox/payment_create_response.rb create mode 100644 lib/finch-api/models/webhook_event.rb create mode 100644 lib/finch-api/page.rb create mode 100644 lib/finch-api/pooled_net_requester.rb create mode 100644 lib/finch-api/request_options.rb create mode 100644 lib/finch-api/resources/access_tokens.rb create mode 100644 lib/finch-api/resources/account.rb create mode 100644 lib/finch-api/resources/connect.rb create mode 100644 lib/finch-api/resources/connect/sessions.rb create mode 100644 lib/finch-api/resources/hris.rb create mode 100644 lib/finch-api/resources/hris/benefits.rb create mode 100644 lib/finch-api/resources/hris/benefits/individuals.rb create mode 100644 lib/finch-api/resources/hris/company.rb create mode 100644 lib/finch-api/resources/hris/directory.rb create mode 100644 lib/finch-api/resources/hris/documents.rb create mode 100644 lib/finch-api/resources/hris/employments.rb create mode 100644 lib/finch-api/resources/hris/individuals.rb create mode 100644 lib/finch-api/resources/hris/pay_statements.rb create mode 100644 lib/finch-api/resources/hris/payments.rb create mode 100644 lib/finch-api/resources/jobs.rb create mode 100644 lib/finch-api/resources/jobs/automated.rb create mode 100644 lib/finch-api/resources/jobs/manual.rb create mode 100644 lib/finch-api/resources/payroll.rb create mode 100644 lib/finch-api/resources/payroll/pay_groups.rb create mode 100644 lib/finch-api/resources/providers.rb create mode 100644 lib/finch-api/resources/request_forwarding.rb create mode 100644 lib/finch-api/resources/sandbox.rb create mode 100644 lib/finch-api/resources/sandbox/company.rb create mode 100644 lib/finch-api/resources/sandbox/connections.rb create mode 100644 lib/finch-api/resources/sandbox/connections/accounts.rb create mode 100644 lib/finch-api/resources/sandbox/directory.rb create mode 100644 lib/finch-api/resources/sandbox/employment.rb create mode 100644 lib/finch-api/resources/sandbox/individual.rb create mode 100644 lib/finch-api/resources/sandbox/jobs.rb create mode 100644 lib/finch-api/resources/sandbox/jobs/configuration.rb create mode 100644 lib/finch-api/resources/sandbox/payment.rb create mode 100644 lib/finch-api/resources/webhooks.rb create mode 100644 lib/finch-api/responses_page.rb create mode 100644 lib/finch-api/single_page.rb create mode 100644 lib/finch-api/util.rb create mode 100644 lib/finch-api/version.rb create mode 100644 manifest.yaml create mode 100644 rbi/lib/finch-api/base_client.rbi create mode 100644 rbi/lib/finch-api/base_model.rbi create mode 100644 rbi/lib/finch-api/base_page.rbi create mode 100644 rbi/lib/finch-api/client.rbi create mode 100644 rbi/lib/finch-api/errors.rbi create mode 100644 rbi/lib/finch-api/extern.rbi create mode 100644 rbi/lib/finch-api/individuals_page.rbi create mode 100644 rbi/lib/finch-api/models/access_token_create_params.rbi create mode 100644 rbi/lib/finch-api/models/account_disconnect_params.rbi create mode 100644 rbi/lib/finch-api/models/account_introspect_params.rbi create mode 100644 rbi/lib/finch-api/models/account_update_event.rbi create mode 100644 rbi/lib/finch-api/models/base_webhook_event.rbi create mode 100644 rbi/lib/finch-api/models/company_event.rbi create mode 100644 rbi/lib/finch-api/models/connect/session_new_params.rbi create mode 100644 rbi/lib/finch-api/models/connect/session_new_response.rbi create mode 100644 rbi/lib/finch-api/models/connect/session_reauthenticate_params.rbi create mode 100644 rbi/lib/finch-api/models/connect/session_reauthenticate_response.rbi create mode 100644 rbi/lib/finch-api/models/connection_status_type.rbi create mode 100644 rbi/lib/finch-api/models/create_access_token_response.rbi create mode 100644 rbi/lib/finch-api/models/directory_event.rbi create mode 100644 rbi/lib/finch-api/models/disconnect_response.rbi create mode 100644 rbi/lib/finch-api/models/employment_event.rbi create mode 100644 rbi/lib/finch-api/models/hris/benefit_contribution.rbi create mode 100644 rbi/lib/finch-api/models/hris/benefit_create_params.rbi create mode 100644 rbi/lib/finch-api/models/hris/benefit_features_and_operations.rbi create mode 100644 rbi/lib/finch-api/models/hris/benefit_frequency.rbi create mode 100644 rbi/lib/finch-api/models/hris/benefit_list_params.rbi create mode 100644 rbi/lib/finch-api/models/hris/benefit_list_supported_benefits_params.rbi create mode 100644 rbi/lib/finch-api/models/hris/benefit_retrieve_params.rbi create mode 100644 rbi/lib/finch-api/models/hris/benefit_type.rbi create mode 100644 rbi/lib/finch-api/models/hris/benefit_update_params.rbi create mode 100644 rbi/lib/finch-api/models/hris/benefits/enrolled_individual.rbi create mode 100644 rbi/lib/finch-api/models/hris/benefits/individual_benefit.rbi create mode 100644 rbi/lib/finch-api/models/hris/benefits/individual_enroll_many_params.rbi create mode 100644 rbi/lib/finch-api/models/hris/benefits/individual_enrolled_ids_params.rbi create mode 100644 rbi/lib/finch-api/models/hris/benefits/individual_enrolled_ids_response.rbi create mode 100644 rbi/lib/finch-api/models/hris/benefits/individual_retrieve_many_benefits_params.rbi create mode 100644 rbi/lib/finch-api/models/hris/benefits/individual_unenroll_many_params.rbi create mode 100644 rbi/lib/finch-api/models/hris/benefits/unenrolled_individual.rbi create mode 100644 rbi/lib/finch-api/models/hris/benefits_support.rbi create mode 100644 rbi/lib/finch-api/models/hris/benfit_contribution.rbi create mode 100644 rbi/lib/finch-api/models/hris/company.rbi create mode 100644 rbi/lib/finch-api/models/hris/company_benefit.rbi create mode 100644 rbi/lib/finch-api/models/hris/company_retrieve_params.rbi create mode 100644 rbi/lib/finch-api/models/hris/create_company_benefits_response.rbi create mode 100644 rbi/lib/finch-api/models/hris/directory_list_individuals_params.rbi create mode 100644 rbi/lib/finch-api/models/hris/directory_list_params.rbi create mode 100644 rbi/lib/finch-api/models/hris/document_list_params.rbi create mode 100644 rbi/lib/finch-api/models/hris/document_list_response.rbi create mode 100644 rbi/lib/finch-api/models/hris/document_response.rbi create mode 100644 rbi/lib/finch-api/models/hris/document_retreive_params.rbi create mode 100644 rbi/lib/finch-api/models/hris/document_retreive_response.rbi create mode 100644 rbi/lib/finch-api/models/hris/employment_data.rbi create mode 100644 rbi/lib/finch-api/models/hris/employment_data_response.rbi create mode 100644 rbi/lib/finch-api/models/hris/employment_retrieve_many_params.rbi create mode 100644 rbi/lib/finch-api/models/hris/individual.rbi create mode 100644 rbi/lib/finch-api/models/hris/individual_in_directory.rbi create mode 100644 rbi/lib/finch-api/models/hris/individual_response.rbi create mode 100644 rbi/lib/finch-api/models/hris/individual_retrieve_many_params.rbi create mode 100644 rbi/lib/finch-api/models/hris/pay_statement.rbi create mode 100644 rbi/lib/finch-api/models/hris/pay_statement_response.rbi create mode 100644 rbi/lib/finch-api/models/hris/pay_statement_response_body.rbi create mode 100644 rbi/lib/finch-api/models/hris/pay_statement_retrieve_many_params.rbi create mode 100644 rbi/lib/finch-api/models/hris/payment.rbi create mode 100644 rbi/lib/finch-api/models/hris/payment_list_params.rbi create mode 100644 rbi/lib/finch-api/models/hris/support_per_benefit_type.rbi create mode 100644 rbi/lib/finch-api/models/hris/supported_benefit.rbi create mode 100644 rbi/lib/finch-api/models/hris/update_company_benefit_response.rbi create mode 100644 rbi/lib/finch-api/models/hris/w42005.rbi create mode 100644 rbi/lib/finch-api/models/hris/w42020.rbi create mode 100644 rbi/lib/finch-api/models/income.rbi create mode 100644 rbi/lib/finch-api/models/individual_event.rbi create mode 100644 rbi/lib/finch-api/models/introspection.rbi create mode 100644 rbi/lib/finch-api/models/job_completion_event.rbi create mode 100644 rbi/lib/finch-api/models/jobs/automated_async_job.rbi create mode 100644 rbi/lib/finch-api/models/jobs/automated_create_params.rbi create mode 100644 rbi/lib/finch-api/models/jobs/automated_create_response.rbi create mode 100644 rbi/lib/finch-api/models/jobs/automated_list_params.rbi create mode 100644 rbi/lib/finch-api/models/jobs/automated_retrieve_params.rbi create mode 100644 rbi/lib/finch-api/models/jobs/manual_async_job.rbi create mode 100644 rbi/lib/finch-api/models/jobs/manual_retrieve_params.rbi create mode 100644 rbi/lib/finch-api/models/location.rbi create mode 100644 rbi/lib/finch-api/models/money.rbi create mode 100644 rbi/lib/finch-api/models/operation_support.rbi create mode 100644 rbi/lib/finch-api/models/operation_support_matrix.rbi create mode 100644 rbi/lib/finch-api/models/paging.rbi create mode 100644 rbi/lib/finch-api/models/pay_statement_event.rbi create mode 100644 rbi/lib/finch-api/models/payment_event.rbi create mode 100644 rbi/lib/finch-api/models/payroll/pay_group_list_params.rbi create mode 100644 rbi/lib/finch-api/models/payroll/pay_group_list_response.rbi create mode 100644 rbi/lib/finch-api/models/payroll/pay_group_retrieve_params.rbi create mode 100644 rbi/lib/finch-api/models/payroll/pay_group_retrieve_response.rbi create mode 100644 rbi/lib/finch-api/models/provider.rbi create mode 100644 rbi/lib/finch-api/models/provider_list_params.rbi create mode 100644 rbi/lib/finch-api/models/request_forwarding_forward_params.rbi create mode 100644 rbi/lib/finch-api/models/request_forwarding_forward_response.rbi create mode 100644 rbi/lib/finch-api/models/sandbox/company_update_params.rbi create mode 100644 rbi/lib/finch-api/models/sandbox/company_update_response.rbi create mode 100644 rbi/lib/finch-api/models/sandbox/connection_create_params.rbi create mode 100644 rbi/lib/finch-api/models/sandbox/connection_create_response.rbi create mode 100644 rbi/lib/finch-api/models/sandbox/connections/account_create_params.rbi create mode 100644 rbi/lib/finch-api/models/sandbox/connections/account_create_response.rbi create mode 100644 rbi/lib/finch-api/models/sandbox/connections/account_update_params.rbi create mode 100644 rbi/lib/finch-api/models/sandbox/connections/account_update_response.rbi create mode 100644 rbi/lib/finch-api/models/sandbox/directory_create_params.rbi create mode 100644 rbi/lib/finch-api/models/sandbox/directory_create_response.rbi create mode 100644 rbi/lib/finch-api/models/sandbox/employment_update_params.rbi create mode 100644 rbi/lib/finch-api/models/sandbox/employment_update_response.rbi create mode 100644 rbi/lib/finch-api/models/sandbox/individual_update_params.rbi create mode 100644 rbi/lib/finch-api/models/sandbox/individual_update_response.rbi create mode 100644 rbi/lib/finch-api/models/sandbox/job_create_params.rbi create mode 100644 rbi/lib/finch-api/models/sandbox/job_create_response.rbi create mode 100644 rbi/lib/finch-api/models/sandbox/jobs/configuration_retrieve_params.rbi create mode 100644 rbi/lib/finch-api/models/sandbox/jobs/configuration_retrieve_response.rbi create mode 100644 rbi/lib/finch-api/models/sandbox/jobs/configuration_update_params.rbi create mode 100644 rbi/lib/finch-api/models/sandbox/jobs/sandbox_job_configuration.rbi create mode 100644 rbi/lib/finch-api/models/sandbox/payment_create_params.rbi create mode 100644 rbi/lib/finch-api/models/sandbox/payment_create_response.rbi create mode 100644 rbi/lib/finch-api/models/webhook_event.rbi create mode 100644 rbi/lib/finch-api/page.rbi create mode 100644 rbi/lib/finch-api/pooled_net_requester.rbi create mode 100644 rbi/lib/finch-api/request_options.rbi create mode 100644 rbi/lib/finch-api/resources/access_tokens.rbi create mode 100644 rbi/lib/finch-api/resources/account.rbi create mode 100644 rbi/lib/finch-api/resources/connect.rbi create mode 100644 rbi/lib/finch-api/resources/connect/sessions.rbi create mode 100644 rbi/lib/finch-api/resources/hris.rbi create mode 100644 rbi/lib/finch-api/resources/hris/benefits.rbi create mode 100644 rbi/lib/finch-api/resources/hris/benefits/individuals.rbi create mode 100644 rbi/lib/finch-api/resources/hris/company.rbi create mode 100644 rbi/lib/finch-api/resources/hris/directory.rbi create mode 100644 rbi/lib/finch-api/resources/hris/documents.rbi create mode 100644 rbi/lib/finch-api/resources/hris/employments.rbi create mode 100644 rbi/lib/finch-api/resources/hris/individuals.rbi create mode 100644 rbi/lib/finch-api/resources/hris/pay_statements.rbi create mode 100644 rbi/lib/finch-api/resources/hris/payments.rbi create mode 100644 rbi/lib/finch-api/resources/jobs.rbi create mode 100644 rbi/lib/finch-api/resources/jobs/automated.rbi create mode 100644 rbi/lib/finch-api/resources/jobs/manual.rbi create mode 100644 rbi/lib/finch-api/resources/payroll.rbi create mode 100644 rbi/lib/finch-api/resources/payroll/pay_groups.rbi create mode 100644 rbi/lib/finch-api/resources/providers.rbi create mode 100644 rbi/lib/finch-api/resources/request_forwarding.rbi create mode 100644 rbi/lib/finch-api/resources/sandbox.rbi create mode 100644 rbi/lib/finch-api/resources/sandbox/company.rbi create mode 100644 rbi/lib/finch-api/resources/sandbox/connections.rbi create mode 100644 rbi/lib/finch-api/resources/sandbox/connections/accounts.rbi create mode 100644 rbi/lib/finch-api/resources/sandbox/directory.rbi create mode 100644 rbi/lib/finch-api/resources/sandbox/employment.rbi create mode 100644 rbi/lib/finch-api/resources/sandbox/individual.rbi create mode 100644 rbi/lib/finch-api/resources/sandbox/jobs.rbi create mode 100644 rbi/lib/finch-api/resources/sandbox/jobs/configuration.rbi create mode 100644 rbi/lib/finch-api/resources/sandbox/payment.rbi create mode 100644 rbi/lib/finch-api/resources/webhooks.rbi create mode 100644 rbi/lib/finch-api/responses_page.rbi create mode 100644 rbi/lib/finch-api/single_page.rbi create mode 100644 rbi/lib/finch-api/util.rbi create mode 100644 rbi/lib/finch-api/version.rbi create mode 100644 release-please-config.json create mode 100755 scripts/bootstrap create mode 100755 scripts/format create mode 100755 scripts/lint create mode 100755 scripts/mock create mode 100755 scripts/test create mode 100644 sig/finch-api/base_client.rbs create mode 100644 sig/finch-api/base_model.rbs create mode 100644 sig/finch-api/base_page.rbs create mode 100644 sig/finch-api/client.rbs create mode 100644 sig/finch-api/errors.rbs create mode 100644 sig/finch-api/extern.rbs create mode 100644 sig/finch-api/individuals_page.rbs create mode 100644 sig/finch-api/models/access_token_create_params.rbs create mode 100644 sig/finch-api/models/account_disconnect_params.rbs create mode 100644 sig/finch-api/models/account_introspect_params.rbs create mode 100644 sig/finch-api/models/account_update_event.rbs create mode 100644 sig/finch-api/models/base_webhook_event.rbs create mode 100644 sig/finch-api/models/company_event.rbs create mode 100644 sig/finch-api/models/connect/session_new_params.rbs create mode 100644 sig/finch-api/models/connect/session_new_response.rbs create mode 100644 sig/finch-api/models/connect/session_reauthenticate_params.rbs create mode 100644 sig/finch-api/models/connect/session_reauthenticate_response.rbs create mode 100644 sig/finch-api/models/connection_status_type.rbs create mode 100644 sig/finch-api/models/create_access_token_response.rbs create mode 100644 sig/finch-api/models/directory_event.rbs create mode 100644 sig/finch-api/models/disconnect_response.rbs create mode 100644 sig/finch-api/models/employment_event.rbs create mode 100644 sig/finch-api/models/hris/benefit_contribution.rbs create mode 100644 sig/finch-api/models/hris/benefit_create_params.rbs create mode 100644 sig/finch-api/models/hris/benefit_features_and_operations.rbs create mode 100644 sig/finch-api/models/hris/benefit_frequency.rbs create mode 100644 sig/finch-api/models/hris/benefit_list_params.rbs create mode 100644 sig/finch-api/models/hris/benefit_list_supported_benefits_params.rbs create mode 100644 sig/finch-api/models/hris/benefit_retrieve_params.rbs create mode 100644 sig/finch-api/models/hris/benefit_type.rbs create mode 100644 sig/finch-api/models/hris/benefit_update_params.rbs create mode 100644 sig/finch-api/models/hris/benefits/enrolled_individual.rbs create mode 100644 sig/finch-api/models/hris/benefits/individual_benefit.rbs create mode 100644 sig/finch-api/models/hris/benefits/individual_enroll_many_params.rbs create mode 100644 sig/finch-api/models/hris/benefits/individual_enrolled_ids_params.rbs create mode 100644 sig/finch-api/models/hris/benefits/individual_enrolled_ids_response.rbs create mode 100644 sig/finch-api/models/hris/benefits/individual_retrieve_many_benefits_params.rbs create mode 100644 sig/finch-api/models/hris/benefits/individual_unenroll_many_params.rbs create mode 100644 sig/finch-api/models/hris/benefits/unenrolled_individual.rbs create mode 100644 sig/finch-api/models/hris/benefits_support.rbs create mode 100644 sig/finch-api/models/hris/benfit_contribution.rbs create mode 100644 sig/finch-api/models/hris/company.rbs create mode 100644 sig/finch-api/models/hris/company_benefit.rbs create mode 100644 sig/finch-api/models/hris/company_retrieve_params.rbs create mode 100644 sig/finch-api/models/hris/create_company_benefits_response.rbs create mode 100644 sig/finch-api/models/hris/directory_list_individuals_params.rbs create mode 100644 sig/finch-api/models/hris/directory_list_params.rbs create mode 100644 sig/finch-api/models/hris/document_list_params.rbs create mode 100644 sig/finch-api/models/hris/document_list_response.rbs create mode 100644 sig/finch-api/models/hris/document_response.rbs create mode 100644 sig/finch-api/models/hris/document_retreive_params.rbs create mode 100644 sig/finch-api/models/hris/document_retreive_response.rbs create mode 100644 sig/finch-api/models/hris/employment_data.rbs create mode 100644 sig/finch-api/models/hris/employment_data_response.rbs create mode 100644 sig/finch-api/models/hris/employment_retrieve_many_params.rbs create mode 100644 sig/finch-api/models/hris/individual.rbs create mode 100644 sig/finch-api/models/hris/individual_in_directory.rbs create mode 100644 sig/finch-api/models/hris/individual_response.rbs create mode 100644 sig/finch-api/models/hris/individual_retrieve_many_params.rbs create mode 100644 sig/finch-api/models/hris/pay_statement.rbs create mode 100644 sig/finch-api/models/hris/pay_statement_response.rbs create mode 100644 sig/finch-api/models/hris/pay_statement_response_body.rbs create mode 100644 sig/finch-api/models/hris/pay_statement_retrieve_many_params.rbs create mode 100644 sig/finch-api/models/hris/payment.rbs create mode 100644 sig/finch-api/models/hris/payment_list_params.rbs create mode 100644 sig/finch-api/models/hris/support_per_benefit_type.rbs create mode 100644 sig/finch-api/models/hris/supported_benefit.rbs create mode 100644 sig/finch-api/models/hris/update_company_benefit_response.rbs create mode 100644 sig/finch-api/models/hris/w42005.rbs create mode 100644 sig/finch-api/models/hris/w42020.rbs create mode 100644 sig/finch-api/models/income.rbs create mode 100644 sig/finch-api/models/individual_event.rbs create mode 100644 sig/finch-api/models/introspection.rbs create mode 100644 sig/finch-api/models/job_completion_event.rbs create mode 100644 sig/finch-api/models/jobs/automated_async_job.rbs create mode 100644 sig/finch-api/models/jobs/automated_create_params.rbs create mode 100644 sig/finch-api/models/jobs/automated_create_response.rbs create mode 100644 sig/finch-api/models/jobs/automated_list_params.rbs create mode 100644 sig/finch-api/models/jobs/automated_retrieve_params.rbs create mode 100644 sig/finch-api/models/jobs/manual_async_job.rbs create mode 100644 sig/finch-api/models/jobs/manual_retrieve_params.rbs create mode 100644 sig/finch-api/models/location.rbs create mode 100644 sig/finch-api/models/money.rbs create mode 100644 sig/finch-api/models/operation_support.rbs create mode 100644 sig/finch-api/models/operation_support_matrix.rbs create mode 100644 sig/finch-api/models/paging.rbs create mode 100644 sig/finch-api/models/pay_statement_event.rbs create mode 100644 sig/finch-api/models/payment_event.rbs create mode 100644 sig/finch-api/models/payroll/pay_group_list_params.rbs create mode 100644 sig/finch-api/models/payroll/pay_group_list_response.rbs create mode 100644 sig/finch-api/models/payroll/pay_group_retrieve_params.rbs create mode 100644 sig/finch-api/models/payroll/pay_group_retrieve_response.rbs create mode 100644 sig/finch-api/models/provider.rbs create mode 100644 sig/finch-api/models/provider_list_params.rbs create mode 100644 sig/finch-api/models/request_forwarding_forward_params.rbs create mode 100644 sig/finch-api/models/request_forwarding_forward_response.rbs create mode 100644 sig/finch-api/models/sandbox/company_update_params.rbs create mode 100644 sig/finch-api/models/sandbox/company_update_response.rbs create mode 100644 sig/finch-api/models/sandbox/connection_create_params.rbs create mode 100644 sig/finch-api/models/sandbox/connection_create_response.rbs create mode 100644 sig/finch-api/models/sandbox/connections/account_create_params.rbs create mode 100644 sig/finch-api/models/sandbox/connections/account_create_response.rbs create mode 100644 sig/finch-api/models/sandbox/connections/account_update_params.rbs create mode 100644 sig/finch-api/models/sandbox/connections/account_update_response.rbs create mode 100644 sig/finch-api/models/sandbox/directory_create_params.rbs create mode 100644 sig/finch-api/models/sandbox/directory_create_response.rbs create mode 100644 sig/finch-api/models/sandbox/employment_update_params.rbs create mode 100644 sig/finch-api/models/sandbox/employment_update_response.rbs create mode 100644 sig/finch-api/models/sandbox/individual_update_params.rbs create mode 100644 sig/finch-api/models/sandbox/individual_update_response.rbs create mode 100644 sig/finch-api/models/sandbox/job_create_params.rbs create mode 100644 sig/finch-api/models/sandbox/job_create_response.rbs create mode 100644 sig/finch-api/models/sandbox/jobs/configuration_retrieve_params.rbs create mode 100644 sig/finch-api/models/sandbox/jobs/configuration_retrieve_response.rbs create mode 100644 sig/finch-api/models/sandbox/jobs/configuration_update_params.rbs create mode 100644 sig/finch-api/models/sandbox/jobs/sandbox_job_configuration.rbs create mode 100644 sig/finch-api/models/sandbox/payment_create_params.rbs create mode 100644 sig/finch-api/models/sandbox/payment_create_response.rbs create mode 100644 sig/finch-api/models/webhook_event.rbs create mode 100644 sig/finch-api/page.rbs create mode 100644 sig/finch-api/pooled_net_requester.rbs create mode 100644 sig/finch-api/request_options.rbs create mode 100644 sig/finch-api/resources/access_tokens.rbs create mode 100644 sig/finch-api/resources/account.rbs create mode 100644 sig/finch-api/resources/connect.rbs create mode 100644 sig/finch-api/resources/connect/sessions.rbs create mode 100644 sig/finch-api/resources/hris.rbs create mode 100644 sig/finch-api/resources/hris/benefits.rbs create mode 100644 sig/finch-api/resources/hris/benefits/individuals.rbs create mode 100644 sig/finch-api/resources/hris/company.rbs create mode 100644 sig/finch-api/resources/hris/directory.rbs create mode 100644 sig/finch-api/resources/hris/documents.rbs create mode 100644 sig/finch-api/resources/hris/employments.rbs create mode 100644 sig/finch-api/resources/hris/individuals.rbs create mode 100644 sig/finch-api/resources/hris/pay_statements.rbs create mode 100644 sig/finch-api/resources/hris/payments.rbs create mode 100644 sig/finch-api/resources/jobs.rbs create mode 100644 sig/finch-api/resources/jobs/automated.rbs create mode 100644 sig/finch-api/resources/jobs/manual.rbs create mode 100644 sig/finch-api/resources/payroll.rbs create mode 100644 sig/finch-api/resources/payroll/pay_groups.rbs create mode 100644 sig/finch-api/resources/providers.rbs create mode 100644 sig/finch-api/resources/request_forwarding.rbs create mode 100644 sig/finch-api/resources/sandbox.rbs create mode 100644 sig/finch-api/resources/sandbox/company.rbs create mode 100644 sig/finch-api/resources/sandbox/connections.rbs create mode 100644 sig/finch-api/resources/sandbox/connections/accounts.rbs create mode 100644 sig/finch-api/resources/sandbox/directory.rbs create mode 100644 sig/finch-api/resources/sandbox/employment.rbs create mode 100644 sig/finch-api/resources/sandbox/individual.rbs create mode 100644 sig/finch-api/resources/sandbox/jobs.rbs create mode 100644 sig/finch-api/resources/sandbox/jobs/configuration.rbs create mode 100644 sig/finch-api/resources/sandbox/payment.rbs create mode 100644 sig/finch-api/resources/webhooks.rbs create mode 100644 sig/finch-api/responses_page.rbs create mode 100644 sig/finch-api/single_page.rbs create mode 100644 sig/finch-api/util.rbs create mode 100644 sig/finch-api/version.rbs create mode 100644 test/finch-api/base_model_test.rb create mode 100644 test/finch-api/client_test.rb create mode 100644 test/finch-api/resource_namespaces.rb create mode 100644 test/finch-api/resources/access_tokens_test.rb create mode 100644 test/finch-api/resources/account_test.rb create mode 100644 test/finch-api/resources/connect/sessions_test.rb create mode 100644 test/finch-api/resources/connect_test.rb create mode 100644 test/finch-api/resources/hris/benefits/individuals_test.rb create mode 100644 test/finch-api/resources/hris/benefits_test.rb create mode 100644 test/finch-api/resources/hris/company_test.rb create mode 100644 test/finch-api/resources/hris/directory_test.rb create mode 100644 test/finch-api/resources/hris/documents_test.rb create mode 100644 test/finch-api/resources/hris/employments_test.rb create mode 100644 test/finch-api/resources/hris/individuals_test.rb create mode 100644 test/finch-api/resources/hris/pay_statements_test.rb create mode 100644 test/finch-api/resources/hris/payments_test.rb create mode 100644 test/finch-api/resources/hris_test.rb create mode 100644 test/finch-api/resources/jobs/automated_test.rb create mode 100644 test/finch-api/resources/jobs/manual_test.rb create mode 100644 test/finch-api/resources/jobs_test.rb create mode 100644 test/finch-api/resources/payroll/pay_groups_test.rb create mode 100644 test/finch-api/resources/payroll_test.rb create mode 100644 test/finch-api/resources/providers_test.rb create mode 100644 test/finch-api/resources/request_forwarding_test.rb create mode 100644 test/finch-api/resources/sandbox/company_test.rb create mode 100644 test/finch-api/resources/sandbox/connections/accounts_test.rb create mode 100644 test/finch-api/resources/sandbox/connections_test.rb create mode 100644 test/finch-api/resources/sandbox/directory_test.rb create mode 100644 test/finch-api/resources/sandbox/employment_test.rb create mode 100644 test/finch-api/resources/sandbox/individual_test.rb create mode 100644 test/finch-api/resources/sandbox/jobs/configuration_test.rb create mode 100644 test/finch-api/resources/sandbox/jobs_test.rb create mode 100644 test/finch-api/resources/sandbox/payment_test.rb create mode 100644 test/finch-api/resources/sandbox_test.rb create mode 100644 test/finch-api/resources/shared_test.rb create mode 100644 test/finch-api/resources/webhooks_test.rb create mode 100644 test/finch-api/test_helper.rb create mode 100644 test/finch-api/util_test.rb diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..32e3f314 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,45 @@ +name: CI +on: + push: + branches: + - main + pull_request: + branches: + - main + - next + +jobs: + lint: + name: lint + runs-on: ubuntu-latest + + + steps: + - uses: actions/checkout@v4 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: false + ruby-version: '3.1' + - run: |- + bundle install + + - name: Run lints + run: ./scripts/lint + test: + name: test + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: false + ruby-version: '3.1' + - run: |- + bundle install + + - name: Run tests + run: ./scripts/test + diff --git a/.github/workflows/publish-gem.yml b/.github/workflows/publish-gem.yml new file mode 100644 index 00000000..596266f1 --- /dev/null +++ b/.github/workflows/publish-gem.yml @@ -0,0 +1,32 @@ +# This workflow is triggered when a GitHub release is created. +# It can also be run manually to re-publish to rubygems.org in case it failed for some reason. +# You can run this workflow by navigating to https://www.github.com/Finch-API/finch-api-python/actions/workflows/publish-gem.yml +name: Publish Gem +on: + workflow_dispatch: + + release: + types: [published] + +jobs: + publish: + name: publish + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: false + ruby-version: '3.1' + - run: |- + bundle install + + - name: Publish to RubyGems.org + run: | + bash ./bin/publish-gem + env: + # `RUBYGEMS_HOST` is only required for private gem repositories, not https://rubygems.org + RUBYGEMS_HOST: ${{ secrets.FINCH_RUBYGEMS_HOST || secrets.RUBYGEMS_HOST }} + GEM_HOST_API_KEY: ${{ secrets.FINCH_GEM_HOST_API_KEY || secrets.GEM_HOST_API_KEY }} diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml new file mode 100644 index 00000000..043c5aac --- /dev/null +++ b/.github/workflows/release-doctor.yml @@ -0,0 +1,22 @@ +name: Release Doctor +on: + pull_request: + branches: + - main + workflow_dispatch: + +jobs: + release_doctor: + name: release doctor + runs-on: ubuntu-latest + if: github.repository == 'Finch-API/finch-api-ruby' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') + + steps: + - uses: actions/checkout@v4 + + - name: Check release environment + run: | + bash ./bin/check-release-environment + env: + RUBYGEMS_HOST: ${{ secrets.FINCH_RUBYGEMS_HOST || secrets.RUBYGEMS_HOST }} + GEM_HOST_API_KEY: ${{ secrets.FINCH_GEM_HOST_API_KEY || secrets.GEM_HOST_API_KEY }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..1ef280e1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +.prism.log +.idea/ +.ruby-lsp/ +.yardoc/ +doc/ +sorbet/ +Brewfile.lock.json +bin/tapioca +*.gem diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 00000000..c4762802 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.0.1-alpha.0" +} \ No newline at end of file diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 00000000..2663e1d2 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,212 @@ +--- +# Explicitly disable pending cops for now. This is the default behaviour but +# this avoids a large warning every time we run it. +# Stop RuboCop nagging about rubocop-rake. +# Ensure that RuboCop validates according to the lowest version of Ruby that we support. +AllCops: + Exclude: + - "bin/*" + NewCops: enable + SuggestExtensions: false + TargetRubyVersion: 3.1.0 + +# Don't require this extra line break, it can be excessive. +Layout/EmptyLineAfterGuardClause: + Enabled: false + +# Don't leave complex assignment values hanging off to the right. +Layout/EndAlignment: + EnforcedStyleAlignWith: variable + +Layout/FirstArrayElementLineBreak: + Enabled: true + +Layout/FirstHashElementLineBreak: + Enabled: true + +Layout/FirstMethodArgumentLineBreak: + Enabled: true + +Layout/FirstMethodParameterLineBreak: + Enabled: true + +# Set a reasonable line length; rely on other cops to correct long lines. +Layout/LineLength: + AllowedPatterns: + - "^\\s*#.*$" + - ^require(_relative)? + - "FinchAPI::(Models|Resources)::" + Max: 110 + +Layout/MultilineArrayLineBreaks: + Enabled: true + +# Start the assignment on the same line variable is mentioned. +Layout/MultilineAssignmentLayout: + EnforcedStyle: same_line + +Layout/MultilineHashKeyLineBreaks: + Enabled: true + +Layout/MultilineMethodArgumentLineBreaks: + Enabled: true + +Layout/MultilineMethodParameterLineBreaks: + Enabled: true + +# Prefer compact hash literals. +Layout/SpaceInsideHashLiteralBraces: + EnforcedStyle: no_space + +Lint/MissingSuper: + Exclude: + - "**/*.rbi" + +# Disabled for safety reasons, this option changes code semantics. +Lint/UnusedMethodArgument: + AutoCorrect: false + +Metrics/AbcSize: + Enabled: false + +Metrics/ClassLength: + Enabled: false + +Metrics/CyclomaticComplexity: + Enabled: false + +Metrics/MethodLength: + Enabled: false + +Metrics/ParameterLists: + Enabled: false + +Metrics/PerceivedComplexity: + Enabled: false + +Naming/BlockForwarding: + Exclude: + - "**/*.rbi" + +Naming/MethodParameterName: + Exclude: + - "**/*.rbi" + +Naming/VariableNumber: + Enabled: false + +# Nothing wrong with inline private methods. +Style/AccessModifierDeclarations: + Enabled: false + +Style/AccessorGrouping: + Exclude: + - "**/*.rbi" + +# Behaviour of alias_method is more predictable. +Style/Alias: + EnforcedStyle: prefer_alias_method + +# And/or have confusing precedence, avoid them. +Style/AndOr: + EnforcedStyle: always + +Style/BisectedAttrAccessor: + Exclude: + - "**/*.rbi" + +# Fairly useful in tests for pattern matching. +Style/CaseEquality: + Exclude: + - "test/**/*" + +# We prefer nested modules in lib/, but are currently using compact style for tests. +Style/ClassAndModuleChildren: + Exclude: + - "test/**/*" + +# We should go back and add these docs, but ignore for now. +Style/Documentation: + Enabled: false + +# Allow explicit empty elses, for clarity. +Style/EmptyElse: + Enabled: false + +Style/EmptyMethod: + Exclude: + - "**/*.rbi" + +# We commonly use ENV['KEY'], it's OK. +Style/FetchEnvVar: + Enabled: false + +# Just to be safe, ensure nobody is mutating our internal strings. +Style/FrozenStringLiteralComment: + EnforcedStyle: always + Exclude: + - "**/*.rbi" + +# Nothing wrong with clear if statements. +Style/IfUnlessModifier: + Enabled: false + +# Rubocop is pretty bad about mangling single line lambdas. +Style/Lambda: + Enabled: false + +# Prefer consistency in method calling syntax. +Style/MethodCallWithArgsParentheses: + AllowedMethods: + - raise + Enabled: true + Exclude: + - "**/*.gemspec" + +# Perfectly fine. +Style/MultipleComparison: + Enabled: false + +Style/MutableConstant: + Exclude: + - "**/*.rbi" + +# Not all parameters should be named. +Style/NumberedParameters: + Enabled: false + +Style/NumberedParametersLimit: + Max: 2 + +# Reasonable to use brackets for errors with long messages. +Style/RaiseArgs: + Enabled: false + +# Be explicit about `RuntimeError`s. +Style/RedundantException: + Enabled: false + +Style/RedundantInitialize: + Exclude: + - "**/*.rbi" + +# Prefer slashes for regex literals. +Style/RegexpLiteral: + EnforcedStyle: slashes + +# Allow explicit ifs, especially for imperative use. +Style/SafeNavigation: + Enabled: false + +# We use these sparingly, where we anticipate future branches for the +# inner conditional. +Style/SoleNestedConditional: + Enabled: false + +# Prefer double quotes so that interpolation can be easily added. +Style/StringLiterals: + EnforcedStyle: double_quotes + +# Prefer explicit symbols for clarity; you can search for `:the_symbol`. +Style/SymbolArray: + EnforcedStyle: brackets diff --git a/.stats.yml b/.stats.yml new file mode 100644 index 00000000..06d70961 --- /dev/null +++ b/.stats.yml @@ -0,0 +1,2 @@ +configured_endpoints: 41 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-7a816d4a5f0039230590a6662f3513d5756344ca662761ecbc49016593f65836.yml diff --git a/.yardopts b/.yardopts new file mode 100644 index 00000000..29c933bc --- /dev/null +++ b/.yardopts @@ -0,0 +1 @@ +--markup markdown diff --git a/Gemfile b/Gemfile new file mode 100644 index 00000000..b064fc5a --- /dev/null +++ b/Gemfile @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +source "https://rubygems.org" + +gemspec + +group :development do + gem "async" + gem "minitest" + gem "minitest-focus" + gem "minitest-hooks" + gem "minitest-proveit" + gem "minitest-rg" + gem "rake" + gem "rbs" + gem "rubocop" + gem "sorbet" + gem "steep" + gem "syntax_tree" + # TODO: using a fork for now, the prettier below has a bug + gem "syntax_tree-rbs", github: "stainless-api/syntax_tree-rbs", branch: "main" + gem "tapioca" + gem "webrick" + gem "yard" +end diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 00000000..9370f270 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,190 @@ +GIT + remote: https://github.com/stainless-api/syntax_tree-rbs.git + revision: 140eb3ba2ff4b959b345ac2a7927cd758a9f1284 + branch: main + specs: + syntax_tree-rbs (1.0.0) + prettier_print + rbs + syntax_tree (>= 2.0.1) + +PATH + remote: . + specs: + finch-api (0.0.1.pre.alpha.0) + connection_pool + +GEM + remote: https://rubygems.org/ + specs: + activesupport (7.2.2.1) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + logger (>= 1.4.2) + minitest (>= 5.1) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + ast (2.4.2) + async (2.23.0) + console (~> 1.29) + fiber-annotation + io-event (~> 1.9) + metrics (~> 0.12) + traces (~> 0.15) + base64 (0.2.0) + benchmark (0.4.0) + bigdecimal (3.1.9) + concurrent-ruby (1.3.5) + connection_pool (2.5.0) + console (1.29.3) + fiber-annotation + fiber-local (~> 1.1) + json + csv (3.3.2) + drb (2.2.1) + erubi (1.13.1) + ffi (1.17.1) + fiber-annotation (0.2.0) + fiber-local (1.1.0) + fiber-storage + fiber-storage (1.0.0) + fileutils (1.7.3) + i18n (1.14.7) + concurrent-ruby (~> 1.0) + io-event (1.9.0) + json (2.10.1) + language_server-protocol (3.17.0.4) + lint_roller (1.1.0) + listen (3.9.0) + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) + logger (1.6.6) + metrics (0.12.1) + minitest (5.25.4) + minitest-focus (1.4.0) + minitest (>= 4, < 6) + minitest-hooks (1.5.2) + minitest (> 5.3) + minitest-proveit (1.0.0) + minitest (> 5, < 7) + minitest-rg (5.3.0) + minitest (~> 5.0) + netrc (0.11.0) + parallel (1.26.3) + parser (3.3.7.1) + ast (~> 2.4.1) + racc + prettier_print (1.2.1) + prism (1.3.0) + racc (1.8.1) + rainbow (3.1.1) + rake (13.2.1) + rb-fsevent (0.11.2) + rb-inotify (0.11.1) + ffi (~> 1.0) + rbi (0.2.4) + prism (~> 1.0) + sorbet-runtime (>= 0.5.9204) + rbs (3.8.1) + logger + regexp_parser (2.10.0) + rubocop (1.72.2) + json (~> 2.3) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) + parallel (~> 1.10) + parser (>= 3.3.0.2) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.38.0, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.38.1) + parser (>= 3.3.1.0) + ruby-progressbar (1.13.0) + securerandom (0.4.1) + sorbet (0.5.11856) + sorbet-static (= 0.5.11856) + sorbet-runtime (0.5.11856) + sorbet-static (0.5.11856-x86_64-linux) + sorbet-static-and-runtime (0.5.11856) + sorbet (= 0.5.11856) + sorbet-runtime (= 0.5.11856) + spoom (1.5.4) + erubi (>= 1.10.0) + prism (>= 0.28.0) + rbi (>= 0.2.3) + sorbet-static-and-runtime (>= 0.5.10187) + thor (>= 0.19.2) + steep (1.9.4) + activesupport (>= 5.1) + concurrent-ruby (>= 1.1.10) + csv (>= 3.0.9) + fileutils (>= 1.1.0) + json (>= 2.1.0) + language_server-protocol (>= 3.15, < 4.0) + listen (~> 3.0) + logger (>= 1.3.0) + parser (>= 3.1) + rainbow (>= 2.2.2, < 4.0) + rbs (~> 3.8) + securerandom (>= 0.1) + strscan (>= 1.0.0) + terminal-table (>= 2, < 4) + uri (>= 0.12.0) + strscan (3.1.2) + syntax_tree (6.2.0) + prettier_print (>= 1.2.0) + tapioca (0.16.11) + benchmark + bundler (>= 2.2.25) + netrc (>= 0.11.0) + parallel (>= 1.21.0) + rbi (~> 0.2) + sorbet-static-and-runtime (>= 0.5.11087) + spoom (>= 1.2.0) + thor (>= 1.2.0) + yard-sorbet + terminal-table (3.0.2) + unicode-display_width (>= 1.1.1, < 3) + thor (1.3.2) + traces (0.15.2) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + unicode-display_width (2.6.0) + uri (1.0.2) + webrick (1.9.1) + yard (0.9.37) + yard-sorbet (0.9.0) + sorbet-runtime + yard + +PLATFORMS + x86_64-linux + +DEPENDENCIES + async + finch-api! + minitest + minitest-focus + minitest-hooks + minitest-proveit + minitest-rg + rake + rbs + rubocop + sorbet + steep + syntax_tree + syntax_tree-rbs! + tapioca + webrick + yard + +BUNDLED WITH + 2.3.3 diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..eee60015 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2025 Finch + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md index b822c1e0..5b36337d 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,124 @@ -# finch-api-ruby -finch-api-ruby +# Finch Ruby API library + +The Finch Ruby library provides convenient access to the Finch REST API from any Ruby 3.0.0+ +application. + +It is generated with [Stainless](https://www.stainless.com/). + +## Documentation + +Documentation for the most recent release of this gem can be found [on RubyDoc](https://gemdocs.org/gems/finch-api/latest). + +The underlying REST API documentation can be found on [developer.tryfinch.com](https://developer.tryfinch.com/). + +## Installation + +To use this gem during the beta, install directly from GitHub with Bundler by +adding the following to your application's `Gemfile`: + +```ruby +gem "finch-api", git: "https://github.com/Finch-API/finch-api-ruby", branch: "main" +``` + +To fetch an initial copy of the gem: + +```sh +bundle install +``` + +To update the version used by your application when updates are pushed to +GitHub: + +```sh +bundle update finch-api +``` + +## Usage + +```ruby +require "bundler/setup" +require "finch-api" + +finch = FinchAPI::Client.new(access_token: "My Access Token") + +page = finch.hris.directory.list + +puts(page.id) +``` + +### Errors + +When the library is unable to connect to the API, or if the API returns a +non-success status code (i.e., 4xx or 5xx response), a subclass of +`FinchAPI::Error` will be thrown: + +```ruby +begin + company = finch.hris.company.retrieve +rescue FinchAPI::Error => e + puts(e.status) # 400 +end +``` + +Error codes are as followed: + +| Cause | Error Type | +| ---------------- | -------------------------- | +| HTTP 400 | `BadRequestError` | +| HTTP 401 | `AuthenticationError` | +| HTTP 403 | `PermissionDeniedError` | +| HTTP 404 | `NotFoundError` | +| HTTP 409 | `ConflictError` | +| HTTP 422 | `UnprocessableEntityError` | +| HTTP 429 | `RateLimitError` | +| HTTP >=500 | `InternalServerError` | +| Other HTTP error | `APIStatusError` | +| Timeout | `APITimeoutError` | +| Network error | `APIConnectionError` | + +### Retries + +Certain errors will be automatically retried 2 times by default, with a short +exponential backoff. Connection errors (for example, due to a network +connectivity problem), 408 Request Timeout, 409 Conflict, 429 Rate Limit, >=500 Internal errors, +and timeouts will all be retried by default. + +You can use the `max_retries` option to configure or disable this: + +```ruby +# Configure the default for all requests: +finch = FinchAPI::Client.new( + max_retries: 0 # default is 2 +) + +# Or, configure per-request: +finch.hris.directory.list(request_options: {max_retries: 5}) +``` + +### Timeouts + +By default, requests will time out after 60 seconds. +Timeouts are applied separately to the initial connection and the overall request time, +so in some cases a request could wait 2\*timeout seconds before it fails. + +You can use the `timeout` option to configure or disable this: + +```ruby +# Configure the default for all requests: +finch = FinchAPI::Client.new( + timeout: nil # default is 60 +) + +# Or, configure per-request: +finch.hris.directory.list(request_options: {timeout: 5}) +``` + +## Versioning + +This package follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions. As the +library is in initial development and has a major version of `0`, APIs may change +at any time. + +## Requirements + +Ruby 3.0 or higher. diff --git a/Rakefile b/Rakefile new file mode 100644 index 00000000..062fd055 --- /dev/null +++ b/Rakefile @@ -0,0 +1,89 @@ +# frozen_string_literal: true + +require "minitest/test_task" +require "rake/clean" +require "rubocop/rake_task" +require "securerandom" +require "shellwords" + +CLEAN.push(*%w[.idea/ .ruby-lsp/ .yardoc/]) + +xargs = %w[xargs --no-run-if-empty --null --max-procs=0 --max-args=300 --] + +task(default: [:test, :format]) + +Minitest::TestTask.create do |t| + t.libs = %w[.] + t.test_globs = ENV.fetch("TEST", "./test/**/*_test.rb") +end + +RuboCop::RakeTask.new(:rubocop) do |t| + t.options = %w[--fail-level E] + if ENV.key?("CI") + t.options += %w[--format github] + end +end + +multitask(:ruboformat) do + find = %w[find ./lib ./test ./rbi -type f -and ( -name *.rb -or -name *.rbi ) -print0] + fmt = xargs + %w[rubocop --fail-level F --autocorrect --format simple --] + sh("#{find.shelljoin} | #{fmt.shelljoin}") +end + +multitask(:syntax_tree) do + find = %w[find ./sig -type f -name *.rbs -print0] + inplace = /darwin|bsd/ =~ RUBY_PLATFORM ? %w[-i''] : %w[-i] + uuid = SecureRandom.uuid + + # `syntax_tree` has trouble with `rbs`'s class aliases + + sed = xargs + %w[sed -E] + inplace + %w[-e] + # annotate class aliases with a unique comment + pre = sed + ["s/class ([^ ]+) = (.+$)/# #{uuid}\\n\\1: \\2/", "--"] + fmt = xargs + %w[stree write --plugin=rbs --] + # remove the unique comment and transform class aliases to type aliases + subst = <<~SED + s/# #{uuid}// + t l1 + b + : l1 + n + s/([^ :]+): (.+$)/class \\1 = \\2/ + SED + # 1. delete the unique comment + # 2. if deletion happened, branch to label `l1`, else continue + # 3. transform the class alias to a type alias at label `l1` + pst = sed + [subst, "--"] + + # transform class aliases to type aliases, which syntax tree has no trouble with + sh("#{find.shelljoin} | #{pre.shelljoin}") + # run syntax tree to format `*.rbs` files + sh("#{find.shelljoin} | #{fmt.shelljoin}") + # transform type aliases back to class aliases + sh("#{find.shelljoin} | #{pst.shelljoin}") +end + +multitask(format: [:ruboformat, :syntax_tree]) + +multitask(:steep) do + sh(*%w[steep check]) +end + +multitask(:sorbet) do + sh(*%w[srb typecheck -- .], chdir: "./rbi") +end + +file("sorbet/tapioca") do + sh(*%w[tapioca init]) +end + +multitask(typecheck: [:steep, :sorbet]) +multitask(lint: [:rubocop, :typecheck]) + +multitask(:build) do + sh(*%w[gem build -- finch-api.gemspec]) +end + +multitask(release: [:build]) do + sh(*%w[gem push], *FileList["finch-api-*.gem"]) +end diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 00000000..b6499508 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,27 @@ +# Security Policy + +## Reporting Security Issues + +This SDK is generated by [Stainless Software Inc](http://stainless.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken. + +To report a security issue, please contact the Stainless team at security@stainless.com. + +## Responsible Disclosure + +We appreciate the efforts of security researchers and individuals who help us maintain the security of +SDKs we generate. If you believe you have found a security vulnerability, please adhere to responsible +disclosure practices by allowing us a reasonable amount of time to investigate and address the issue +before making any information public. + +## Reporting Non-SDK Related Security Issues + +If you encounter security issues that are not directly related to SDKs but pertain to the services +or products provided by Finch please follow the respective company's security reporting guidelines. + +### Finch Terms and Policies + +Please contact founders@tryfinch.com for any questions or concerns regarding security of our services. + +--- + +Thank you for helping us keep the SDKs and systems they interact with secure. diff --git a/Steepfile b/Steepfile new file mode 100644 index 00000000..48667fe7 --- /dev/null +++ b/Steepfile @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +require "yaml" + +target :lib do + configure_code_diagnostics(Steep::Diagnostic::Ruby.strict) + + signature("sig") + + YAML.safe_load_file("./manifest.yaml", symbolize_names: true) => { dependencies: } + # currently these libraries lack the `*.rbs` annotations required by `steep` + stdlibs = dependencies - %w[etc net/http rbconfig set stringio] + + stdlibs.each { library(_1) } +end diff --git a/bin/check-release-environment b/bin/check-release-environment new file mode 100644 index 00000000..75a04a56 --- /dev/null +++ b/bin/check-release-environment @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +errors=() + +if [ -z "${GEM_HOST_API_KEY}" ]; then + errors+=("The FINCH_GEM_HOST_API_KEY secret has not been set. Please set it in either this repository's secrets or your organization secrets") +fi + +lenErrors=${#errors[@]} + +if [[ lenErrors -gt 0 ]]; then + echo -e "Found the following errors in the release environment:\n" + + for error in "${errors[@]}"; do + echo -e "- $error\n" + done + + exit 1 +fi + +echo "The environment is ready to push releases!" diff --git a/bin/publish-gem b/bin/publish-gem new file mode 100644 index 00000000..8444af20 --- /dev/null +++ b/bin/publish-gem @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +set -Eeuo pipefail + +cd -- "$(dirname -- "$0")/.." + +bundle +find . -maxdepth 1 -type f -name "*.gem" -delete +rake release \ No newline at end of file diff --git a/finch-api.gemspec b/finch-api.gemspec new file mode 100644 index 00000000..6ab22ac2 --- /dev/null +++ b/finch-api.gemspec @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +require_relative "lib/finch-api/version" + +Gem::Specification.new do |s| + s.name = "finch-api" + s.version = FinchAPI::VERSION + s.summary = "Ruby library to access the Finch API" + s.authors = ["Finch"] + s.email = "founders@tryfinch.com" + s.files = Dir["lib/**/*.rb", "rbi/**/*.rbi", "sig/**/*.rbs", "manifest.yaml"] + s.extra_rdoc_files = ["README.md"] + s.required_ruby_version = ">= 3.0.0" + s.add_dependency "connection_pool" + s.homepage = "https://gemdocs.org/gems/finch-api/latest" + s.metadata["homepage_uri"] = s.homepage + s.metadata["source_code_uri"] = "https://github.com/Finch-API/finch-api-ruby" + s.metadata["rubygems_mfa_required"] = "false" +end diff --git a/lib/finch-api.rb b/lib/finch-api.rb new file mode 100644 index 00000000..1b0521be --- /dev/null +++ b/lib/finch-api.rb @@ -0,0 +1,178 @@ +# frozen_string_literal: true + +# Standard libraries. +require "cgi" +require "date" +require "erb" +require "etc" +require "json" +require "net/http" +require "rbconfig" +require "securerandom" +require "set" +require "stringio" +require "time" +require "uri" + +# Gems. +require "connection_pool" + +# Package files. +require_relative "finch-api/version" +require_relative "finch-api/util" +require_relative "finch-api/extern" +require_relative "finch-api/base_model" +require_relative "finch-api/base_page" +require_relative "finch-api/request_options" +require_relative "finch-api/errors" +require_relative "finch-api/base_client" +require_relative "finch-api/pooled_net_requester" +require_relative "finch-api/client" +require_relative "finch-api/individuals_page" +require_relative "finch-api/page" +require_relative "finch-api/responses_page" +require_relative "finch-api/single_page" +require_relative "finch-api/models/base_webhook_event" +require_relative "finch-api/models/hris/benefit_contribution" +require_relative "finch-api/models/sandbox/jobs/sandbox_job_configuration" +require_relative "finch-api/models/access_token_create_params" +require_relative "finch-api/models/account_disconnect_params" +require_relative "finch-api/models/account_introspect_params" +require_relative "finch-api/models/account_update_event" +require_relative "finch-api/models/company_event" +require_relative "finch-api/models/connect/session_new_params" +require_relative "finch-api/models/connect/session_new_response" +require_relative "finch-api/models/connect/session_reauthenticate_params" +require_relative "finch-api/models/connect/session_reauthenticate_response" +require_relative "finch-api/models/connection_status_type" +require_relative "finch-api/models/create_access_token_response" +require_relative "finch-api/models/directory_event" +require_relative "finch-api/models/disconnect_response" +require_relative "finch-api/models/employment_event" +require_relative "finch-api/models/hris/benefit_create_params" +require_relative "finch-api/models/hris/benefit_features_and_operations" +require_relative "finch-api/models/hris/benefit_frequency" +require_relative "finch-api/models/hris/benefit_list_params" +require_relative "finch-api/models/hris/benefit_list_supported_benefits_params" +require_relative "finch-api/models/hris/benefit_retrieve_params" +require_relative "finch-api/models/hris/benefits/enrolled_individual" +require_relative "finch-api/models/hris/benefits/individual_benefit" +require_relative "finch-api/models/hris/benefits/individual_enrolled_ids_params" +require_relative "finch-api/models/hris/benefits/individual_enrolled_ids_response" +require_relative "finch-api/models/hris/benefits/individual_enroll_many_params" +require_relative "finch-api/models/hris/benefits/individual_retrieve_many_benefits_params" +require_relative "finch-api/models/hris/benefits/individual_unenroll_many_params" +require_relative "finch-api/models/hris/benefits/unenrolled_individual" +require_relative "finch-api/models/hris/benefits_support" +require_relative "finch-api/models/hris/benefit_type" +require_relative "finch-api/models/hris/benefit_update_params" +require_relative "finch-api/models/hris/benfit_contribution" +require_relative "finch-api/models/hris/company_benefit" +require_relative "finch-api/models/hris/company_retrieve_params" +require_relative "finch-api/models/hris/create_company_benefits_response" +require_relative "finch-api/models/hris/directory_list_individuals_params" +require_relative "finch-api/models/hris/directory_list_params" +require_relative "finch-api/models/hris/document_list_params" +require_relative "finch-api/models/hris/document_list_response" +require_relative "finch-api/models/hris/document_response" +require_relative "finch-api/models/hris/document_retreive_params" +require_relative "finch-api/models/hris/document_retreive_response" +require_relative "finch-api/models/hris/employment_data" +require_relative "finch-api/models/hris/employment_data_response" +require_relative "finch-api/models/hris/employment_retrieve_many_params" +require_relative "finch-api/models/hris/company" +require_relative "finch-api/models/hris/individual" +require_relative "finch-api/models/hris/individual_in_directory" +require_relative "finch-api/models/hris/individual_response" +require_relative "finch-api/models/hris/individual_retrieve_many_params" +require_relative "finch-api/models/hris/payment" +require_relative "finch-api/models/hris/payment_list_params" +require_relative "finch-api/models/hris/pay_statement" +require_relative "finch-api/models/hris/pay_statement_response" +require_relative "finch-api/models/hris/pay_statement_response_body" +require_relative "finch-api/models/hris/pay_statement_retrieve_many_params" +require_relative "finch-api/models/hris/supported_benefit" +require_relative "finch-api/models/hris/support_per_benefit_type" +require_relative "finch-api/models/hris/update_company_benefit_response" +require_relative "finch-api/models/hris/w42005" +require_relative "finch-api/models/hris/w42020" +require_relative "finch-api/models/income" +require_relative "finch-api/models/individual_event" +require_relative "finch-api/models/introspection" +require_relative "finch-api/models/job_completion_event" +require_relative "finch-api/models/jobs/automated_async_job" +require_relative "finch-api/models/jobs/automated_create_params" +require_relative "finch-api/models/jobs/automated_create_response" +require_relative "finch-api/models/jobs/automated_list_params" +require_relative "finch-api/models/jobs/automated_retrieve_params" +require_relative "finch-api/models/jobs/manual_async_job" +require_relative "finch-api/models/jobs/manual_retrieve_params" +require_relative "finch-api/models/location" +require_relative "finch-api/models/money" +require_relative "finch-api/models/operation_support" +require_relative "finch-api/models/operation_support_matrix" +require_relative "finch-api/models/paging" +require_relative "finch-api/models/payment_event" +require_relative "finch-api/models/payroll/pay_group_list_params" +require_relative "finch-api/models/payroll/pay_group_list_response" +require_relative "finch-api/models/payroll/pay_group_retrieve_params" +require_relative "finch-api/models/payroll/pay_group_retrieve_response" +require_relative "finch-api/models/pay_statement_event" +require_relative "finch-api/models/provider" +require_relative "finch-api/models/provider_list_params" +require_relative "finch-api/models/request_forwarding_forward_params" +require_relative "finch-api/models/request_forwarding_forward_response" +require_relative "finch-api/models/sandbox/company_update_params" +require_relative "finch-api/models/sandbox/company_update_response" +require_relative "finch-api/models/sandbox/connection_create_params" +require_relative "finch-api/models/sandbox/connection_create_response" +require_relative "finch-api/models/sandbox/connections/account_create_params" +require_relative "finch-api/models/sandbox/connections/account_create_response" +require_relative "finch-api/models/sandbox/connections/account_update_params" +require_relative "finch-api/models/sandbox/connections/account_update_response" +require_relative "finch-api/models/sandbox/directory_create_params" +require_relative "finch-api/models/sandbox/directory_create_response" +require_relative "finch-api/models/sandbox/employment_update_params" +require_relative "finch-api/models/sandbox/employment_update_response" +require_relative "finch-api/models/sandbox/individual_update_params" +require_relative "finch-api/models/sandbox/individual_update_response" +require_relative "finch-api/models/sandbox/job_create_params" +require_relative "finch-api/models/sandbox/job_create_response" +require_relative "finch-api/models/sandbox/jobs/configuration_retrieve_params" +require_relative "finch-api/models/sandbox/jobs/configuration_retrieve_response" +require_relative "finch-api/models/sandbox/jobs/configuration_update_params" +require_relative "finch-api/models/sandbox/payment_create_params" +require_relative "finch-api/models/sandbox/payment_create_response" +require_relative "finch-api/models/webhook_event" +require_relative "finch-api/resources/access_tokens" +require_relative "finch-api/resources/account" +require_relative "finch-api/resources/connect" +require_relative "finch-api/resources/connect/sessions" +require_relative "finch-api/resources/hris" +require_relative "finch-api/resources/hris/benefits" +require_relative "finch-api/resources/hris/benefits/individuals" +require_relative "finch-api/resources/hris/company" +require_relative "finch-api/resources/hris/directory" +require_relative "finch-api/resources/hris/documents" +require_relative "finch-api/resources/hris/employments" +require_relative "finch-api/resources/hris/individuals" +require_relative "finch-api/resources/hris/payments" +require_relative "finch-api/resources/hris/pay_statements" +require_relative "finch-api/resources/jobs" +require_relative "finch-api/resources/jobs/automated" +require_relative "finch-api/resources/jobs/manual" +require_relative "finch-api/resources/payroll" +require_relative "finch-api/resources/payroll/pay_groups" +require_relative "finch-api/resources/providers" +require_relative "finch-api/resources/request_forwarding" +require_relative "finch-api/resources/sandbox" +require_relative "finch-api/resources/sandbox/company" +require_relative "finch-api/resources/sandbox/connections" +require_relative "finch-api/resources/sandbox/connections/accounts" +require_relative "finch-api/resources/sandbox/directory" +require_relative "finch-api/resources/sandbox/employment" +require_relative "finch-api/resources/sandbox/individual" +require_relative "finch-api/resources/sandbox/jobs" +require_relative "finch-api/resources/sandbox/jobs/configuration" +require_relative "finch-api/resources/sandbox/payment" +require_relative "finch-api/resources/webhooks" diff --git a/lib/finch-api/base_client.rb b/lib/finch-api/base_client.rb new file mode 100644 index 00000000..4f024e48 --- /dev/null +++ b/lib/finch-api/base_client.rb @@ -0,0 +1,464 @@ +# frozen_string_literal: true + +module FinchAPI + # @private + # + # @abstract + # + class BaseClient + # from whatwg fetch spec + MAX_REDIRECTS = 20 + + # rubocop:disable Style/MutableConstant + PLATFORM_HEADERS = { + "x-stainless-arch" => FinchAPI::Util.arch, + "x-stainless-lang" => "ruby", + "x-stainless-os" => FinchAPI::Util.os, + "x-stainless-package-version" => FinchAPI::VERSION, + "x-stainless-runtime" => ::RUBY_ENGINE, + "x-stainless-runtime-version" => ::RUBY_ENGINE_VERSION + } + # rubocop:enable Style/MutableConstant + + class << self + # @private + # + # @param req [Hash{Symbol=>Object}] + # + # @raise [ArgumentError] + # + def validate!(req) + keys = [:method, :path, :query, :headers, :body, :unwrap, :page, :stream, :model, :options] + case req + in Hash + req.each_key do |k| + unless keys.include?(k) + raise ArgumentError.new("Request `req` keys must be one of #{keys}, got #{k.inspect}") + end + end + else + raise ArgumentError.new("Request `req` must be a Hash or RequestOptions, got #{req.inspect}") + end + end + + # @private + # + # @param status [Integer] + # @param headers [Hash{String=>String}, Net::HTTPHeader] + # + # @return [Boolean] + # + def should_retry?(status, headers:) + coerced = FinchAPI::Util.coerce_boolean(headers["x-should-retry"]) + case [coerced, status] + in [true | false, _] + coerced + in [_, 408 | 409 | 429 | (500..)] + # retry on: + # 408: timeouts + # 409: locks + # 429: rate limits + # 500+: unknown errors + true + else + false + end + end + + # @private + # + # @param request [Hash{Symbol=>Object}] . + # + # @option request [Symbol] :method + # + # @option request [URI::Generic] :url + # + # @option request [Hash{String=>String}] :headers + # + # @option request [Object] :body + # + # @option request [Integer] :max_retries + # + # @option request [Float] :timeout + # + # @param status [Integer] + # + # @param response_headers [Hash{String=>String}, Net::HTTPHeader] + # + # @return [Hash{Symbol=>Object}] + # + def follow_redirect(request, status:, response_headers:) + method, url, headers = request.fetch_values(:method, :url, :headers) + location = + Kernel.then do + URI.join(url, response_headers["location"]) + rescue ArgumentError + message = "Server responded with status #{status} but no valid location header." + raise FinchAPI::APIConnectionError.new(url: url, message: message) + end + + request = {**request, url: location} + + case [url.scheme, location.scheme] + in ["https", "http"] + message = "Tried to redirect to a insecure URL" + raise FinchAPI::APIConnectionError.new(url: url, message: message) + else + nil + end + + # from whatwg fetch spec + case [status, method] + in [301 | 302, :post] | [303, _] + drop = %w[content-encoding content-language content-length content-location content-type] + request = { + **request, + method: method == :head ? :head : :get, + headers: headers.except(*drop), + body: nil + } + else + end + + # from undici + if FinchAPI::Util.uri_origin(url) != FinchAPI::Util.uri_origin(location) + drop = %w[authorization cookie host proxy-authorization] + request = {**request, headers: request.fetch(:headers).except(*drop)} + end + + request + end + end + + # @private + # + # @return [FinchAPI::PooledNetRequester] + attr_accessor :requester + + # @private + # + # @param base_url [String] + # @param timeout [Float] + # @param max_retries [Integer] + # @param initial_retry_delay [Float] + # @param max_retry_delay [Float] + # @param headers [Hash{String=>String, Integer, Array, nil}] + # @param idempotency_header [String, nil] + # + def initialize( + base_url:, + timeout: 0.0, + max_retries: 0, + initial_retry_delay: 0.0, + max_retry_delay: 0.0, + headers: {}, + idempotency_header: nil + ) + @requester = FinchAPI::PooledNetRequester.new + @headers = FinchAPI::Util.normalized_headers( + self.class::PLATFORM_HEADERS, + { + "accept" => "application/json", + "content-type" => "application/json" + }, + headers + ) + @base_url = FinchAPI::Util.parse_uri(base_url) + @idempotency_header = idempotency_header&.to_s&.downcase + @max_retries = max_retries + @timeout = timeout + @initial_retry_delay = initial_retry_delay + @max_retry_delay = max_retry_delay + end + + # @private + # + # @return [Hash{String=>String}] + # + private def auth_headers = {} + + # @private + # + # @return [String] + # + private def generate_idempotency_key = "stainless-ruby-retry-#{SecureRandom.uuid}" + + # @private + # + # @param req [Hash{Symbol=>Object}] . + # + # @option req [Symbol] :method + # + # @option req [String, Array] :path + # + # @option req [Hash{String=>Array, String, nil}, nil] :query + # + # @option req [Hash{String=>String, Integer, Array, nil}, nil] :headers + # + # @option req [Object, nil] :body + # + # @option req [Symbol, nil] :unwrap + # + # @option req [Class, nil] :page + # + # @option req [Class, nil] :stream + # + # @option req [FinchAPI::Converter, Class, nil] :model + # + # @param opts [Hash{Symbol=>Object}] . + # + # @option opts [String, nil] :idempotency_key + # + # @option opts [Hash{String=>Array, String, nil}, nil] :extra_query + # + # @option opts [Hash{String=>String, nil}, nil] :extra_headers + # + # @option opts [Hash{Symbol=>Object}, nil] :extra_body + # + # @option opts [Integer, nil] :max_retries + # + # @option opts [Float, nil] :timeout + # + # @return [Hash{Symbol=>Object}] + # + private def build_request(req, opts) + method, uninterpolated_path = req.fetch_values(:method, :path) + + path = FinchAPI::Util.interpolate_path(uninterpolated_path) + + query = FinchAPI::Util.deep_merge(req[:query].to_h, opts[:extra_query].to_h) + + headers = FinchAPI::Util.normalized_headers( + @headers, + auth_headers, + req[:headers].to_h, + opts[:extra_headers].to_h + ) + + if @idempotency_header && + !headers.key?(@idempotency_header) && + !Net::HTTP::IDEMPOTENT_METHODS_.include?(method.to_s.upcase) + headers[@idempotency_header] = opts.fetch(:idempotency_key) { generate_idempotency_key } + end + + unless headers.key?("x-stainless-retry-count") + headers["x-stainless-retry-count"] = "0" + end + + timeout = opts.fetch(:timeout, @timeout).to_f.clamp((0..)) + unless headers.key?("x-stainless-read-timeout") || timeout.zero? + headers["x-stainless-read-timeout"] = timeout.to_s + end + + headers.reject! { |_, v| v.to_s.empty? } + + body = + case method + in :get | :head | :options | :trace + nil + else + FinchAPI::Util.deep_merge(*[req[:body], opts[:extra_body]].compact) + end + + headers, encoded = FinchAPI::Util.encode_content(headers, body) + { + method: method, + url: FinchAPI::Util.join_parsed_uri(@base_url, {**req, path: path, query: query}), + headers: headers, + body: encoded, + max_retries: opts.fetch(:max_retries, @max_retries), + timeout: timeout + } + end + + # @private + # + # @param headers [Hash{String=>String}] + # @param retry_count [Integer] + # + # @return [Float] + # + private def retry_delay(headers, retry_count:) + # Non-standard extension + span = Float(headers["retry-after-ms"], exception: false)&.then { _1 / 1000 } + return span if span + + retry_header = headers["retry-after"] + return span if (span = Float(retry_header, exception: false)) + + span = retry_header&.then do + Time.httpdate(_1) - Time.now + rescue ArgumentError + nil + end + return span if span + + scale = retry_count**2 + jitter = 1 - (0.25 * rand) + (@initial_retry_delay * scale * jitter).clamp(0, @max_retry_delay) + end + + # @private + # + # @param request [Hash{Symbol=>Object}] . + # + # @option request [Symbol] :method + # + # @option request [URI::Generic] :url + # + # @option request [Hash{String=>String}] :headers + # + # @option request [Object] :body + # + # @option request [Integer] :max_retries + # + # @option request [Float] :timeout + # + # @param redirect_count [Integer] + # + # @param retry_count [Integer] + # + # @param send_retry_header [Boolean] + # + # @raise [FinchAPI::APIError] + # @return [Array(Integer, Net::HTTPResponse, Enumerable)] + # + private def send_request(request, redirect_count:, retry_count:, send_retry_header:) + url, headers, max_retries, timeout = request.fetch_values(:url, :headers, :max_retries, :timeout) + input = {**request.except(:timeout), deadline: FinchAPI::Util.monotonic_secs + timeout} + + if send_retry_header + headers["x-stainless-retry-count"] = retry_count.to_s + end + + begin + response, stream = @requester.execute(input) + status = Integer(response.code) + rescue FinchAPI::APIConnectionError => e + status = e + end + + # normally we want to drain the response body and reuse the HTTP session by clearing the socket buffers + # unless we hit a server error + srv_fault = (500...).include?(status) + + case status + in ..299 + [status, response, stream] + in 300..399 if redirect_count >= self.class::MAX_REDIRECTS + message = "Failed to complete the request within #{self.class::MAX_REDIRECTS} redirects." + + stream.each { next } + raise FinchAPI::APIConnectionError.new(url: url, message: message) + in 300..399 + request = self.class.follow_redirect(request, status: status, response_headers: response) + + stream.each { next } + send_request( + request, + redirect_count: redirect_count + 1, + retry_count: retry_count, + send_retry_header: send_retry_header + ) + in FinchAPI::APIConnectionError if retry_count >= max_retries + raise status + in (400..) if retry_count >= max_retries || !self.class.should_retry?(status, headers: response) + decoded = FinchAPI::Util.decode_content(response, stream: stream, suppress_error: true) + + if srv_fault + FinchAPI::Util.close_fused!(stream) + else + stream.each { next } + end + + raise FinchAPI::APIStatusError.for( + url: url, + status: status, + body: decoded, + request: nil, + response: response + ) + in (400..) | FinchAPI::APIConnectionError + delay = retry_delay(response, retry_count: retry_count) + + if srv_fault + FinchAPI::Util.close_fused!(stream) + else + stream&.each { next } + end + sleep(delay) + + send_request( + request, + redirect_count: redirect_count, + retry_count: retry_count + 1, + send_retry_header: send_retry_header + ) + end + end + + # Execute the request specified by `req`. This is the method that all resource + # methods call into. + # + # @param req [Hash{Symbol=>Object}] . + # + # @option req [Symbol] :method + # + # @option req [String, Array] :path + # + # @option req [Hash{String=>Array, String, nil}, nil] :query + # + # @option req [Hash{String=>String, Integer, Array, nil}, nil] :headers + # + # @option req [Object, nil] :body + # + # @option req [Symbol, nil] :unwrap + # + # @option req [Class, nil] :page + # + # @option req [Class, nil] :stream + # + # @option req [FinchAPI::Converter, Class, nil] :model + # + # @option req [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :options + # + # @raise [FinchAPI::APIError] + # @return [Object] + # + def request(req) + self.class.validate!(req) + model = req.fetch(:model) { FinchAPI::Unknown } + opts = req[:options].to_h + FinchAPI::RequestOptions.validate!(opts) + request = build_request(req.except(:options), opts) + url = request.fetch(:url) + + # Don't send the current retry count in the headers if the caller modified the header defaults. + send_retry_header = request.fetch(:headers)["x-stainless-retry-count"] == "0" + status, response, stream = send_request( + request, + redirect_count: 0, + retry_count: 0, + send_retry_header: send_retry_header + ) + + decoded = FinchAPI::Util.decode_content(response, stream: stream) + case req + in { stream: Class => st } + st.new(model: model, url: url, status: status, response: response, messages: decoded) + in { page: Class => page } + page.new(client: self, req: req, headers: response, unwrapped: decoded) + else + unwrapped = FinchAPI::Util.dig(decoded, req[:unwrap]) + FinchAPI::Converter.coerce(model, unwrapped) + end + end + + # @return [String] + # + def inspect + base_url = FinchAPI::Util.unparse_uri(@base_url) + "#<#{self.class.name}:0x#{object_id.to_s(16)} base_url=#{base_url} max_retries=#{@max_retries} timeout=#{@timeout}>" + end + end +end diff --git a/lib/finch-api/base_model.rb b/lib/finch-api/base_model.rb new file mode 100644 index 00000000..b31a922a --- /dev/null +++ b/lib/finch-api/base_model.rb @@ -0,0 +1,1188 @@ +# frozen_string_literal: true + +module FinchAPI + # @private + # + # @abstract + # + module Converter + # rubocop:disable Lint/UnusedMethodArgument + + # @private + # + # @param value [Object] + # + # @return [Object] + # + def coerce(value) = value + + # @private + # + # @param value [Object] + # + # @return [Object] + # + def dump(value) = value + + # @private + # + # @param value [Object] + # + # @return [Array(true, Object, nil), Array(false, Boolean, Integer)] + # + def try_strict_coerce(value) = (raise NotImplementedError) + + # rubocop:enable Lint/UnusedMethodArgument + + class << self + # @private + # + # @param spec [Hash{Symbol=>Object}, Proc, FinchAPI::Converter, Class] . + # + # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const + # + # @option spec [Proc] :enum + # + # @option spec [Proc] :union + # + # @option spec [Boolean] :"nil?" + # + # @return [Proc] + # + def type_info(spec) + case spec + in Hash + type_info(spec.slice(:const, :enum, :union).first&.last) + in Proc + spec + in FinchAPI::Converter | Class + -> { spec } + in true | false + -> { FinchAPI::BooleanModel } + in NilClass | true | false | Symbol | Integer | Float + -> { spec.class } + end + end + + # @private + # + # Based on `target`, transform `value` into `target`, to the extent possible: + # + # 1. if the given `value` conforms to `target` already, return the given `value` + # 2. if it's possible and safe to convert the given `value` to `target`, then the + # converted value + # 3. otherwise, the given `value` unaltered + # + # @param target [FinchAPI::Converter, Class] + # @param value [Object] + # + # @return [Object] + # + def coerce(target, value) + case target + in FinchAPI::Converter + target.coerce(value) + in Class + case target + in -> { _1 <= NilClass } + nil + in -> { _1 <= Integer } + value.is_a?(Numeric) ? Integer(value) : value + in -> { _1 <= Float } + value.is_a?(Numeric) ? Float(value) : value + in -> { _1 <= Symbol } + value.is_a?(String) ? value.to_sym : value + in -> { _1 <= String } + value.is_a?(Symbol) ? value.to_s : value + in -> { _1 <= Date || _1 <= Time } + value.is_a?(String) ? target.parse(value) : value + in -> { _1 <= IO } + value.is_a?(String) ? StringIO.new(value) : value + else + value + end + end + end + + # @private + # + # @param target [FinchAPI::Converter, Class] + # @param value [Object] + # + # @return [Object] + # + def dump(target, value) + case target + in FinchAPI::Converter + target.dump(value) + else + value + end + end + + # @private + # + # The underlying algorithm for computing maximal compatibility is subject to + # future improvements. + # + # Similar to `#.coerce`, used to determine the best union variant to decode into. + # + # 1. determine if strict-ish coercion is possible + # 2. return either result of successful coercion or if loose coercion is possible + # 3. return a score for recursively tallied count for fields that can be coerced + # + # @param target [FinchAPI::Converter, Class] + # @param value [Object] + # + # @return [Object] + # + def try_strict_coerce(target, value) + case target + in FinchAPI::Converter + target.try_strict_coerce(value) + in Class + case [target, value] + in [-> { _1 <= NilClass }, _] + [true, nil, value.nil? ? 1 : 0] + in [-> { _1 <= Integer }, Numeric] + [true, Integer(value), 1] + in [-> { _1 <= Float }, Numeric] + [true, Float(value), 1] + in [-> { _1 <= Symbol }, String] + [true, value.to_sym, 1] + in [-> { _1 <= String }, Symbol] + [true, value.to_s, 1] + in [-> { _1 <= Date || _1 <= Time }, String] + Kernel.then do + [true, target.parse(value), 1] + rescue ArgumentError, Date::Error + [false, false, 0] + end + in [_, ^target] + [true, value, 1] + else + [false, false, 0] + end + end + end + end + end + + # @private + # + # @abstract + # + # When we don't know what to expect for the value. + class Unknown + extend FinchAPI::Converter + + # rubocop:disable Lint/UnusedMethodArgument + + private_class_method :new + + # @param other [Object] + # + # @return [Boolean] + # + def self.===(other) = true + + # @param other [Object] + # + # @return [Boolean] + # + def self.==(other) = other.is_a?(Class) && other <= FinchAPI::Unknown + + # @!parse + # # @private + # # + # # @param value [Object] + # # + # # @return [Object] + # # + # def self.coerce(value) = super + + # @!parse + # # @private + # # + # # @param value [Object] + # # + # # @return [Object] + # # + # def self.dump(value) = super + + # @private + # + # @param value [Object] + # + # @return [Array(true, Object, nil), Array(false, Boolean, Integer)] + # + def self.try_strict_coerce(value) + # prevent unknown variant from being chosen during the first coercion pass + [false, true, 0] + end + + # rubocop:enable Lint/UnusedMethodArgument + end + + # @private + # + # @abstract + # + # Ruby has no Boolean class; this is something for models to refer to. + class BooleanModel + extend FinchAPI::Converter + + private_class_method :new + + # @param other [Object] + # + # @return [Boolean] + # + def self.===(other) = other == true || other == false + + # @param other [Object] + # + # @return [Boolean] + # + def self.==(other) = other.is_a?(Class) && other <= FinchAPI::BooleanModel + + # @!parse + # # @private + # # + # # @param value [Boolean, Object] + # # + # # @return [Boolean, Object] + # # + # def self.coerce(value) = super + + # @!parse + # # @private + # # + # # @param value [Boolean, Object] + # # + # # @return [Boolean, Object] + # # + # def self.dump(value) = super + + # @private + # + # @param value [Object] + # + # @return [Array(true, Object, nil), Array(false, Boolean, Integer)] + # + def self.try_strict_coerce(value) + case value + in true | false + [true, value, 1] + else + [false, false, 0] + end + end + end + + # @private + # + # @abstract + # + # A value from among a specified list of options. OpenAPI enum values map to Ruby + # values in the SDK as follows: + # + # 1. boolean => true | false + # 2. integer => Integer + # 3. float => Float + # 4. string => Symbol + # + # We can therefore convert string values to Symbols, but can't convert other + # values safely. + class Enum + extend FinchAPI::Converter + + # All of the valid Symbol values for this enum. + # + # @return [Array] + # + def self.values = (@values ||= constants.map { const_get(_1) }) + + # @private + # + # Guard against thread safety issues by instantiating `@values`. + # + private_class_method def self.finalize! = values + + private_class_method :new + + # @param other [Object] + # + # @return [Boolean] + # + def self.===(other) = values.include?(other) + + # @param other [Object] + # + # @return [Boolean] + # + def self.==(other) + other.is_a?(Class) && other <= FinchAPI::Enum && other.values.to_set == values.to_set + end + + # @private + # + # @param value [String, Symbol, Object] + # + # @return [Symbol, Object] + # + def self.coerce(value) = (value.is_a?(String) ? value.to_sym : value) + + # @!parse + # # @private + # # + # # @param value [Symbol, Object] + # # + # # @return [Symbol, Object] + # # + # def self.dump(value) = super + + # @private + # + # @param value [Object] + # + # @return [Array(true, Object, nil), Array(false, Boolean, Integer)] + # + def self.try_strict_coerce(value) + return [true, value, 1] if values.include?(value) + + case value + in String if values.include?(val = value.to_sym) + [true, val, 1] + else + case [value, values.first] + in [true | false, true | false] | [Integer, Integer] | [Symbol | String, Symbol] + [false, true, 0] + else + [false, false, 0] + end + end + end + end + + # @private + # + # @abstract + # + class Union + extend FinchAPI::Converter + + # @private + # + # All of the specified variant info for this union. + # + # @return [Array] + # + private_class_method def self.known_variants = (@known_variants ||= []) + + class << self + # @private + # + # All of the specified variants for this union. + # + # @return [Array] + # + protected def variants + @known_variants.map { |key, variant_fn| [key, variant_fn.call] } + end + end + + # @private + # + # @param property [Symbol] + # + private_class_method def self.discriminator(property) + case property + in Symbol + @discriminator = property + end + end + + # @private + # + # @param key [Symbol, Hash{Symbol=>Object}, Proc, FinchAPI::Converter, Class] + # + # @param spec [Hash{Symbol=>Object}, Proc, FinchAPI::Converter, Class] . + # + # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const + # + # @option spec [Proc] :enum + # + # @option spec [Proc] :union + # + # @option spec [Boolean] :"nil?" + # + private_class_method def self.variant(key, spec = nil) + variant_info = + case key + in Symbol + [key, FinchAPI::Converter.type_info(spec)] + in Proc | FinchAPI::Converter | Class | Hash + [nil, FinchAPI::Converter.type_info(key)] + end + + known_variants << variant_info + end + + # @private + # + # @param value [Object] + # + # @return [FinchAPI::Converter, Class, nil] + # + private_class_method def self.resolve_variant(value) + case [@discriminator, value] + in [_, FinchAPI::BaseModel] + value.class + in [Symbol, Hash] + key = + if value.key?(@discriminator) + value.fetch(@discriminator) + elsif value.key?((discriminator = @discriminator.to_s)) + value.fetch(discriminator) + end + + key = key.to_sym if key.is_a?(String) + _, resolved = known_variants.find { |k,| k == key } + resolved.nil? ? FinchAPI::Unknown : resolved.call + else + nil + end + end + + # rubocop:disable Style/HashEachMethods + # rubocop:disable Style/CaseEquality + + private_class_method :new + + # @param other [Object] + # + # @return [Boolean] + # + def self.===(other) + known_variants.any? do |_, variant_fn| + variant_fn.call === other + end + end + + # @param other [Object] + # + # @return [Boolean] + # + def self.==(other) + other.is_a?(Class) && other <= FinchAPI::Union && other.variants == variants + end + + # @private + # + # @param value [Object] + # + # @return [Object] + # + def self.coerce(value) + if (variant = resolve_variant(value)) + return FinchAPI::Converter.coerce(variant, value) + end + + matches = [] + + known_variants.each do |_, variant_fn| + variant = variant_fn.call + + case FinchAPI::Converter.try_strict_coerce(variant, value) + in [true, coerced, _] + return coerced + in [false, true, score] + matches << [score, variant] + in [false, false, _] + nil + end + end + + _, variant = matches.sort! { _2.first <=> _1.first }.find { |score,| !score.zero? } + variant.nil? ? value : FinchAPI::Converter.coerce(variant, value) + end + + # @private + # + # @param value [Object] + # + # @return [Object] + # + def self.dump(value) + if (variant = resolve_variant(value)) + return FinchAPI::Converter.dump(variant, value) + end + + known_variants.each do |_, variant_fn| + variant = variant_fn.call + if variant === value + return FinchAPI::Converter.dump(variant, value) + end + end + value + end + + # @private + # + # @param value [Object] + # + # @return [Array(true, Object, nil), Array(false, Boolean, Integer)] + # + def self.try_strict_coerce(value) + # TODO(ruby) this will result in super linear decoding behaviour for nested unions + # follow up with a decoding context that captures current strictness levels + if (variant = resolve_variant(value)) + return Converter.try_strict_coerce(variant, value) + end + + coercible = false + max_score = 0 + + known_variants.each do |_, variant_fn| + variant = variant_fn.call + + case FinchAPI::Converter.try_strict_coerce(variant, value) + in [true, coerced, score] + return [true, coerced, score] + in [false, true, score] + coercible = true + max_score = [max_score, score].max + in [false, false, _] + nil + end + end + + [false, coercible, max_score] + end + + # rubocop:enable Style/CaseEquality + # rubocop:enable Style/HashEachMethods + end + + # @private + # + # @abstract + # + # Array of items of a given type. + class ArrayOf + include FinchAPI::Converter + + private_class_method :new + + def self.[](...) = new(...) + + # @param other [Object] + # + # @return [Boolean] + # + def ===(other) + type = item_type + case other + in Array + # rubocop:disable Style/CaseEquality + other.all? { type === _1 } + # rubocop:enable Style/CaseEquality + else + false + end + end + + # @param other [Object] + # + # @return [Boolean] + # + def ==(other) = other.is_a?(FinchAPI::ArrayOf) && other.item_type == item_type + + # @private + # + # @param value [Enumerable, Object] + # + # @return [Array, Object] + # + def coerce(value) + type = item_type + case value + in Enumerable unless value.is_a?(Hash) + value.map { FinchAPI::Converter.coerce(type, _1) } + else + value + end + end + + # @private + # + # @param value [Enumerable, Object] + # + # @return [Array, Object] + # + def dump(value) + type = item_type + case value + in Enumerable unless value.is_a?(Hash) + value.map { FinchAPI::Converter.dump(type, _1) }.to_a + else + value + end + end + + # @private + # + # @param value [Object] + # + # @return [Array(true, Object, nil), Array(false, Boolean, Integer)] + # + def try_strict_coerce(value) + case value + in Array + type = item_type + great_success = true + tally = 0 + + mapped = + value.map do |item| + case FinchAPI::Converter.try_strict_coerce(type, item) + in [true, coerced, score] + tally += score + coerced + in [false, true, score] + great_success = false + tally += score + item + in [false, false, _] + great_success &&= item.nil? + item + end + end + + if great_success + [true, mapped, tally] + else + [false, true, tally] + end + else + [false, false, 0] + end + end + + # @private + # + # @return [FinchAPI::Converter, Class] + # + protected def item_type = @item_type_fn.call + + # @private + # + # @param type_info [Hash{Symbol=>Object}, Proc, FinchAPI::Converter, Class] + # + # @param spec [Hash{Symbol=>Object}] . + # + # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const + # + # @option spec [Proc] :enum + # + # @option spec [Proc] :union + # + # @option spec [Boolean] :"nil?" + # + def initialize(type_info, spec = {}) + @item_type_fn = FinchAPI::Converter.type_info(type_info || spec) + end + end + + # @private + # + # @abstract + # + # Hash of items of a given type. + class HashOf + include FinchAPI::Converter + + private_class_method :new + + def self.[](...) = new(...) + + # @param other [Object] + # + # @return [Boolean] + # + def ===(other) + type = item_type + case other + in Hash + other.all? do |key, val| + case [key, val] + in [Symbol | String, ^type] + true + else + false + end + end + else + false + end + end + + # @param other [Object] + # + # @return [Boolean] + # + def ==(other) = other.is_a?(FinchAPI::HashOf) && other.item_type == item_type + + # @private + # + # @param value [Hash{Object=>Object}, Object] + # + # @return [Hash{Symbol=>Object}, Object] + # + def coerce(value) + type = item_type + case value + in Hash + value.to_h do |key, val| + coerced = FinchAPI::Converter.coerce(type, val) + [key.is_a?(String) ? key.to_sym : key, coerced] + end + else + value + end + end + + # @private + # + # @param value [Hash{Object=>Object}, Object] + # + # @return [Hash{Symbol=>Object}, Object] + # + def dump(value) + type = item_type + case value + in Hash + value.transform_values do |val| + FinchAPI::Converter.dump(type, val) + end + else + value + end + end + + # @private + # + # @param value [Object] + # + # @return [Array(true, Object, nil), Array(false, Boolean, Integer)] + # + def try_strict_coerce(value) + case value + in Hash + type = item_type + great_success = true + tally = 0 + + mapped = + value.transform_values do |val| + case FinchAPI::Converter.try_strict_coerce(type, val) + in [true, coerced, score] + tally += score + coerced + in [false, true, score] + great_success = false + tally += score + val + in [false, false, _] + great_success &&= val.nil? + val + end + end + + if great_success + [true, mapped, tally] + else + [false, true, tally] + end + else + [false, false, 0] + end + end + + # @private + # + # @return [FinchAPI::Converter, Class] + # + protected def item_type = @item_type_fn.call + + # @private + # + # @param type_info [Hash{Symbol=>Object}, Proc, FinchAPI::Converter, Class] + # + # @param spec [Hash{Symbol=>Object}] . + # + # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const + # + # @option spec [Proc] :enum + # + # @option spec [Proc] :union + # + # @option spec [Boolean] :"nil?" + # + def initialize(type_info, spec = {}) + @item_type_fn = FinchAPI::Converter.type_info(type_info || spec) + end + end + + # @private + # + # @abstract + # + class BaseModel + extend FinchAPI::Converter + + # @private + # + # Assumes superclass fields are totally defined before fields are accessed / + # defined on subclasses. + # + # @return [Hash{Symbol=>Hash{Symbol=>Object}}] + # + def self.known_fields + @known_fields ||= (self < FinchAPI::BaseModel ? superclass.known_fields.dup : {}) + end + + class << self + # @private + # + # @return [Hash{Symbol=>Hash{Symbol=>Object}}] + # + def fields + known_fields.transform_values do |field| + {**field.except(:type_fn), type: field.fetch(:type_fn).call} + end + end + end + + # @private + # + # @return [Hash{Symbol=>Proc}] + # + def self.defaults = (@defaults ||= {}) + + # @private + # + # @param name_sym [Symbol] + # + # @param required [Boolean] + # + # @param type_info [Hash{Symbol=>Object}, Proc, FinchAPI::Converter, Class] + # + # @param spec [Hash{Symbol=>Object}] . + # + # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const + # + # @option spec [Proc] :enum + # + # @option spec [Proc] :union + # + # @option spec [Boolean] :"nil?" + # + private_class_method def self.add_field(name_sym, required:, type_info:, spec:) + type_fn, info = + case type_info + in Proc | Class | FinchAPI::Converter + [FinchAPI::Converter.type_info({**spec, union: type_info}), spec] + in Hash + [FinchAPI::Converter.type_info(type_info), type_info] + end + + fallback = info[:const] + defaults[name_sym] = fallback if required && !info[:nil?] && info.key?(:const) + + key = info.fetch(:api_name, name_sym) + setter = "#{name_sym}=" + + if known_fields.key?(name_sym) + [name_sym, setter].each { undef_method(_1) } + end + + known_fields[name_sym] = {mode: @mode, key: key, required: required, type_fn: type_fn} + + define_method(setter) do |val| + @data[key] = val + end + + define_method(name_sym) do + field_type = type_fn.call + value = @data.fetch(key) { self.class.defaults[key] } + FinchAPI::Converter.coerce(field_type, value) + rescue StandardError + name = self.class.name.split("::").last + raise FinchAPI::ConversionError.new( + "Failed to parse #{name}.#{name_sym} as #{field_type.inspect}. " \ + "To get the unparsed API response, use #{name}[:#{key}]." + ) + end + end + + # @private + # + # @param name_sym [Symbol] + # + # @param type_info [Hash{Symbol=>Object}, Proc, FinchAPI::Converter, Class] + # + # @param spec [Hash{Symbol=>Object}] . + # + # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const + # + # @option spec [Proc] :enum + # + # @option spec [Proc] :union + # + # @option spec [Boolean] :"nil?" + # + def self.required(name_sym, type_info, spec = {}) + add_field(name_sym, required: true, type_info: type_info, spec: spec) + end + + # @private + # + # @param name_sym [Symbol] + # + # @param type_info [Hash{Symbol=>Object}, Proc, FinchAPI::Converter, Class] + # + # @param spec [Hash{Symbol=>Object}] . + # + # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const + # + # @option spec [Proc] :enum + # + # @option spec [Proc] :union + # + # @option spec [Boolean] :"nil?" + # + def self.optional(name_sym, type_info, spec = {}) + add_field(name_sym, required: false, type_info: type_info, spec: spec) + end + + # @private + # + # `request_only` attributes not excluded from `.#coerce` when receiving responses + # even if well behaved servers should not send them + # + # @param blk [Proc] + # + private_class_method def self.request_only(&blk) + @mode = :dump + blk.call + ensure + @mode = nil + end + + # @private + # + # `response_only` attributes are omitted from `.#dump` when making requests + # + # @param blk [Proc] + # + private_class_method def self.response_only(&blk) + @mode = :coerce + blk.call + ensure + @mode = nil + end + + # @param other [Object] + # + # @return [Boolean] + # + def ==(other) + case other + in FinchAPI::BaseModel + self.class.fields == other.class.fields && @data == other.to_h + else + false + end + end + + # @private + # + # @param value [FinchAPI::BaseModel, Hash{Object=>Object}, Object] + # + # @return [FinchAPI::BaseModel, Object] + # + def self.coerce(value) + case FinchAPI::Util.coerce_hash(value) + in Hash => coerced + new(coerced) + else + value + end + end + + # @private + # + # @param value [FinchAPI::BaseModel, Object] + # + # @return [Hash{Object=>Object}, Object] + # + def self.dump(value) + unless (coerced = FinchAPI::Util.coerce_hash(value)).is_a?(Hash) + return value + end + + values = coerced.filter_map do |key, val| + name = key.to_sym + case (field = known_fields[name]) + in nil + [name, val] + else + mode, type_fn, api_name = field.fetch_values(:mode, :type_fn, :key) + case mode + in :coerce + next + else + target = type_fn.call + [api_name, FinchAPI::Converter.dump(target, val)] + end + end + end.to_h + + defaults.each do |key, val| + next if values.key?(key) + + values[key] = val + end + + values + end + + # @private + # + # @param value [Object] + # + # @return [Array(true, Object, nil), Array(false, Boolean, Integer)] + # + def self.try_strict_coerce(value) + case value + in Hash | FinchAPI::BaseModel + value = value.to_h + else + return [false, false, 0] + end + + keys = value.keys.to_set + great_success = true + tally = 0 + acc = {} + + known_fields.each_value do |field| + mode, required, type_fn, api_name = field.fetch_values(:mode, :required, :type_fn, :key) + keys.delete(api_name) + + case [required && mode != :dump, value.key?(api_name)] + in [_, true] + target = type_fn.call + item = value.fetch(api_name) + case FinchAPI::Converter.try_strict_coerce(target, item) + in [true, coerced, score] + tally += score + acc[api_name] = coerced + in [false, true, score] + great_success = false + tally += score + acc[api_name] = item + in [false, false, _] + great_success &&= item.nil? + end + in [true, false] + great_success = false + in [false, false] + nil + end + end + + keys.each do |key| + acc[key] = value.fetch(key) + end + + great_success ? [true, new(acc), tally] : [false, true, tally] + end + + # Returns the raw value associated with the given key, if found. Otherwise, nil is + # returned. + # + # It is valid to lookup keys that are not in the API spec, for example to access + # undocumented features. This method does not parse response data into + # higher-level types. Lookup by anything other than a Symbol is an ArgumentError. + # + # @param key [Symbol] + # + # @return [Object, nil] + # + def [](key) + unless key.instance_of?(Symbol) + raise ArgumentError.new("Expected symbol key for lookup, got #{key.inspect}") + end + + @data[key] + end + + # Returns a Hash of the data underlying this object. O(1) + # + # Keys are Symbols and values are the raw values from the response. The return + # value indicates which values were ever set on the object. i.e. there will be a + # key in this hash if they ever were, even if the set value was nil. + # + # This method is not recursive. The returned value is shared by the object, so it + # should not be mutated. + # + # @return [Hash{Symbol=>Object}] + # + def to_h = @data + + alias_method :to_hash, :to_h + + # @param keys [Array, nil] + # + # @return [Hash{Symbol=>Object}] + # + def deconstruct_keys(keys) + (keys || self.class.known_fields.keys).filter_map do |k| + unless self.class.known_fields.key?(k) + next + end + + [k, method(k).call] + end + .to_h + end + + # Create a new instance of a model. + # + # @param data [Hash{Symbol=>Object}, FinchAPI::BaseModel] + # + def initialize(data = {}) + case FinchAPI::Util.coerce_hash(data) + in Hash => coerced + @data = coerced.transform_keys(&:to_sym) + else + raise ArgumentError.new("Expected a #{Hash} or #{FinchAPI::BaseModel}, got #{data.inspect}") + end + end + + # @return [String] + # + def to_s = @data.to_s + + # @return [String] + # + def inspect + "#<#{self.class.name}:0x#{object_id.to_s(16)} #{deconstruct_keys(nil).map do |k, v| + "#{k}=#{v.inspect}" + end.join(' ')}>" + end + end +end diff --git a/lib/finch-api/base_page.rb b/lib/finch-api/base_page.rb new file mode 100644 index 00000000..428f6416 --- /dev/null +++ b/lib/finch-api/base_page.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +module FinchAPI + # @private + # + # @abstract + # + module BasePage + # @return [Boolean] + # + def next_page? = (raise NotImplementedError) + + # @raise [FinchAPI::APIError] + # @return [FinchAPI::BasePage] + # + def next_page = (raise NotImplementedError) + + # @param blk [Proc] + # + # @return [void] + # + def auto_paging_each(&) = (raise NotImplementedError) + + # @return [Enumerable] + # + def to_enum = super(:auto_paging_each) + + alias_method :enum_for, :to_enum + + # @!parse + # # @private + # # + # # @param client [FinchAPI::BaseClient] + # # @param req [Hash{Symbol=>Object}] + # # @param headers [Hash{String=>String}, Net::HTTPHeader] + # # @param unwrapped [Object] + # # + # def initialize(client:, req:, headers:, unwrapped:); end + end +end diff --git a/lib/finch-api/client.rb b/lib/finch-api/client.rb new file mode 100644 index 00000000..5ed0209d --- /dev/null +++ b/lib/finch-api/client.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +module FinchAPI + class Client < FinchAPI::BaseClient + # Default max number of retries to attempt after a failed retryable request. + DEFAULT_MAX_RETRIES = 2 + + # Default per-request timeout. + DEFAULT_TIMEOUT_IN_SECONDS = 60.0 + + # Default initial retry delay in seconds. + # Overall delay is calculated using exponential backoff + jitter. + DEFAULT_INITIAL_RETRY_DELAY = 0.5 + + # Default max retry delay in seconds. + DEFAULT_MAX_RETRY_DELAY = 8.0 + + # @return [String, nil] + attr_reader :access_token + + # @return [String, nil] + attr_reader :client_id + + # @return [String, nil] + attr_reader :client_secret + + # @return [FinchAPI::Resources::AccessTokens] + attr_reader :access_tokens + + # @return [FinchAPI::Resources::HRIS] + attr_reader :hris + + # @return [FinchAPI::Resources::Providers] + attr_reader :providers + + # @return [FinchAPI::Resources::Account] + attr_reader :account + + # @return [FinchAPI::Resources::Webhooks] + attr_reader :webhooks + + # @return [FinchAPI::Resources::RequestForwarding] + attr_reader :request_forwarding + + # @return [FinchAPI::Resources::Jobs] + attr_reader :jobs + + # @return [FinchAPI::Resources::Sandbox] + attr_reader :sandbox + + # @return [FinchAPI::Resources::Payroll] + attr_reader :payroll + + # @return [FinchAPI::Resources::Connect] + attr_reader :connect + + # @private + # + # @return [Hash{String=>String}] + # + private def auth_headers + {**bearer_auth, **basic_auth} + end + + # @private + # + # @return [Hash{String=>String}] + # + private def bearer_auth + return {} if @access_token.nil? + + {"authorization" => "Bearer #{@access_token}"} + end + + # @private + # + # @return [Hash{String=>String}] + # + private def basic_auth + return {} if @client_id.nil? || @client_secret.nil? + + base64_credentials = ["#{@client_id}:#{@client_secret}"].pack("m0") + {"authorization" => "Basic #{base64_credentials}"} + end + + # Creates and returns a new client for interacting with the API. + # + # @param base_url [String, nil] Override the default base URL for the API, e.g., `"https://api.example.com/v2/"` + # + # @param access_token [String, nil] + # + # @param client_id [String, nil] Defaults to `ENV["FINCH_CLIENT_ID"]` + # + # @param client_secret [String, nil] Defaults to `ENV["FINCH_CLIENT_SECRET"]` + # + # @param max_retries [Integer] Max number of retries to attempt after a failed retryable request. + # + # @param timeout [Float] + # + # @param initial_retry_delay [Float] + # + # @param max_retry_delay [Float] + # + def initialize( + base_url: nil, + access_token: nil, + client_id: ENV["FINCH_CLIENT_ID"], + client_secret: ENV["FINCH_CLIENT_SECRET"], + max_retries: DEFAULT_MAX_RETRIES, + timeout: DEFAULT_TIMEOUT_IN_SECONDS, + initial_retry_delay: DEFAULT_INITIAL_RETRY_DELAY, + max_retry_delay: DEFAULT_MAX_RETRY_DELAY + ) + base_url ||= "https://api.tryfinch.com" + + headers = { + "finch-api-version" => "2020-09-17" + } + + @access_token = access_token&.to_s + @client_id = client_id&.to_s + @client_secret = client_secret&.to_s + + super( + base_url: base_url, + timeout: timeout, + max_retries: max_retries, + initial_retry_delay: initial_retry_delay, + max_retry_delay: max_retry_delay, + headers: headers + ) + + @access_tokens = FinchAPI::Resources::AccessTokens.new(client: self) + @hris = FinchAPI::Resources::HRIS.new(client: self) + @providers = FinchAPI::Resources::Providers.new(client: self) + @account = FinchAPI::Resources::Account.new(client: self) + @webhooks = FinchAPI::Resources::Webhooks.new(client: self) + @request_forwarding = FinchAPI::Resources::RequestForwarding.new(client: self) + @jobs = FinchAPI::Resources::Jobs.new(client: self) + @sandbox = FinchAPI::Resources::Sandbox.new(client: self) + @payroll = FinchAPI::Resources::Payroll.new(client: self) + @connect = FinchAPI::Resources::Connect.new(client: self) + end + end +end diff --git a/lib/finch-api/errors.rb b/lib/finch-api/errors.rb new file mode 100644 index 00000000..fd627339 --- /dev/null +++ b/lib/finch-api/errors.rb @@ -0,0 +1,188 @@ +# frozen_string_literal: true + +module FinchAPI + class Error < StandardError + # @!parse + # # @return [StandardError, nil] + # attr_reader :cause + end + + class ConversionError < FinchAPI::Error + end + + class APIError < FinchAPI::Error + # @return [URI::Generic] + attr_reader :url + + # @return [Integer, nil] + attr_reader :status + + # @return [Object, nil] + attr_reader :body + + # @private + # + # @param url [URI::Generic] + # @param status [Integer, nil] + # @param body [Object, nil] + # @param request [nil] + # @param response [nil] + # @param message [String, nil] + # + def initialize(url:, status: nil, body: nil, request: nil, response: nil, message: nil) + @url = url + @status = status + @body = body + @request = request + @response = response + super(message) + end + end + + class APIConnectionError < FinchAPI::APIError + # @!parse + # # @return [nil] + # attr_reader :status + + # @!parse + # # @return [nil] + # attr_reader :body + + # @private + # + # @param url [URI::Generic] + # @param status [nil] + # @param body [nil] + # @param request [nil] + # @param response [nil] + # @param message [String, nil] + # + def initialize( + url:, + status: nil, + body: nil, + request: nil, + response: nil, + message: "Connection error." + ) + super + end + end + + class APITimeoutError < FinchAPI::APIConnectionError + # @private + # + # @param url [URI::Generic] + # @param status [nil] + # @param body [nil] + # @param request [nil] + # @param response [nil] + # @param message [String, nil] + # + def initialize( + url:, + status: nil, + body: nil, + request: nil, + response: nil, + message: "Request timed out." + ) + super + end + end + + class APIStatusError < FinchAPI::APIError + # @private + # + # @param url [URI::Generic] + # @param status [Integer] + # @param body [Object, nil] + # @param request [nil] + # @param response [nil] + # @param message [String, nil] + # + # @return [FinchAPI::APIStatusError] + # + def self.for(url:, status:, body:, request:, response:, message: nil) + kwargs = {url: url, status: status, body: body, request: request, response: response, message: message} + + case status + in 400 + FinchAPI::BadRequestError.new(**kwargs) + in 401 + FinchAPI::AuthenticationError.new(**kwargs) + in 403 + FinchAPI::PermissionDeniedError.new(**kwargs) + in 404 + FinchAPI::NotFoundError.new(**kwargs) + in 409 + FinchAPI::ConflictError.new(**kwargs) + in 422 + FinchAPI::UnprocessableEntityError.new(**kwargs) + in 429 + FinchAPI::RateLimitError.new(**kwargs) + in (500..) + FinchAPI::InternalServerError.new(**kwargs) + else + FinchAPI::APIStatusError.new(**kwargs) + end + end + + # @!parse + # # @return [Integer] + # attr_reader :status + + # @private + # + # @param url [URI::Generic] + # @param status [Integer] + # @param body [Object, nil] + # @param request [nil] + # @param response [nil] + # @param message [String, nil] + # + def initialize(url:, status:, body:, request:, response:, message: nil) + message ||= {url: url.to_s, status: status, body: body} + super( + url: url, + status: status, + body: body, + request: request, + response: response, + message: message&.to_s + ) + end + end + + class BadRequestError < FinchAPI::APIStatusError + HTTP_STATUS = 400 + end + + class AuthenticationError < FinchAPI::APIStatusError + HTTP_STATUS = 401 + end + + class PermissionDeniedError < FinchAPI::APIStatusError + HTTP_STATUS = 403 + end + + class NotFoundError < FinchAPI::APIStatusError + HTTP_STATUS = 404 + end + + class ConflictError < FinchAPI::APIStatusError + HTTP_STATUS = 409 + end + + class UnprocessableEntityError < FinchAPI::APIStatusError + HTTP_STATUS = 422 + end + + class RateLimitError < FinchAPI::APIStatusError + HTTP_STATUS = 429 + end + + class InternalServerError < FinchAPI::APIStatusError + HTTP_STATUS = (500..) + end +end diff --git a/lib/finch-api/extern.rb b/lib/finch-api/extern.rb new file mode 100644 index 00000000..8ab900bc --- /dev/null +++ b/lib/finch-api/extern.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module FinchAPI + # @private + # + # @abstract + # + module Extern + end +end diff --git a/lib/finch-api/individuals_page.rb b/lib/finch-api/individuals_page.rb new file mode 100644 index 00000000..9f549ce6 --- /dev/null +++ b/lib/finch-api/individuals_page.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +module FinchAPI + # @example + # ```ruby + # if individuals_page.has_next? + # page = individuals_page.next_page + # end + # ``` + # + # @example + # ```ruby + # individuals_page.auto_paging_each do |item| + # # item ... + # end + # ``` + # + # @example + # ```ruby + # items = individuals_page.to_enum.take(2) + # + # items => Array + # ``` + class IndividualsPage + include FinchAPI::BasePage + + # @return [Array] + attr_accessor :individuals + + # @return [FinchAPI::Models::Paging] + attr_accessor :paging + + # rubocop:disable Lint/UnusedMethodArgument + # @private + # + # @param client [FinchAPI::BaseClient] + # @param req [Hash{Symbol=>Object}] + # @param headers [Hash{String=>String}, Net::HTTPHeader] + # @param unwrapped [Hash{Symbol=>Object}] + # + def initialize(client:, req:, headers:, unwrapped:) + @client = client + @req = req + model = req.fetch(:model) + + case unwrapped + in {individuals: Array | nil => individuals} + @individuals = individuals&.map { model.coerce(_1) } + else + end + + case unwrapped + in {paging: Hash | nil => paging} + @paging = FinchAPI::Models::Paging.coerce(paging) + else + end + end + # rubocop:enable Lint/UnusedMethodArgument + + # @return [Boolean] + # + def next_page? + paging&.offset.to_i + individuals.size < paging&.count.to_i + end + + # @raise [FinchAPI::HTTP::Error] + # @return [FinchAPI::IndividualsPage] + # + def next_page + unless next_page? + raise RuntimeError.new("No more pages available; please check #next_page? before calling #next_page") + end + + req = FinchAPI::Util.deep_merge(@req, {query: {offset: paging&.offset.to_i + individuals.size}}) + @client.request(req) + end + + # @param blk [Proc] + # + def auto_paging_each(&blk) + unless block_given? + raise ArgumentError.new("A block must be given to #auto_paging_each") + end + page = self + loop do + page.individuals&.each { blk.call(_1) } + break unless page.next_page? + page = page.next_page + end + end + + # @return [String] + # + def inspect + "#<#{self.class}:0x#{object_id.to_s(16)} individuals=#{individuals.inspect} paging=#{paging.inspect}>" + end + end +end diff --git a/lib/finch-api/models/access_token_create_params.rb b/lib/finch-api/models/access_token_create_params.rb new file mode 100644 index 00000000..bedadb30 --- /dev/null +++ b/lib/finch-api/models/access_token_create_params.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + class AccessTokenCreateParams < FinchAPI::BaseModel + # @!parse + # extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + # @!attribute code + # + # @return [String] + required :code, String + + # @!attribute [r] client_id + # + # @return [String, nil] + optional :client_id, String + + # @!parse + # # @return [String] + # attr_writer :client_id + + # @!attribute [r] client_secret + # + # @return [String, nil] + optional :client_secret, String + + # @!parse + # # @return [String] + # attr_writer :client_secret + + # @!attribute [r] redirect_uri + # + # @return [String, nil] + optional :redirect_uri, String + + # @!parse + # # @return [String] + # attr_writer :redirect_uri + + # @!parse + # # @param code [String] + # # @param client_id [String] + # # @param client_secret [String] + # # @param redirect_uri [String] + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(code:, client_id: nil, client_secret: nil, redirect_uri: nil, request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end +end diff --git a/lib/finch-api/models/account_disconnect_params.rb b/lib/finch-api/models/account_disconnect_params.rb new file mode 100644 index 00000000..a3ca96b9 --- /dev/null +++ b/lib/finch-api/models/account_disconnect_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + class AccountDisconnectParams < FinchAPI::BaseModel + # @!parse + # extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + # @!parse + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end +end diff --git a/lib/finch-api/models/account_introspect_params.rb b/lib/finch-api/models/account_introspect_params.rb new file mode 100644 index 00000000..b0841e55 --- /dev/null +++ b/lib/finch-api/models/account_introspect_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + class AccountIntrospectParams < FinchAPI::BaseModel + # @!parse + # extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + # @!parse + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end +end diff --git a/lib/finch-api/models/account_update_event.rb b/lib/finch-api/models/account_update_event.rb new file mode 100644 index 00000000..4d3ad167 --- /dev/null +++ b/lib/finch-api/models/account_update_event.rb @@ -0,0 +1,1978 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + class AccountUpdateEvent < FinchAPI::Models::BaseWebhookEvent + # @!attribute [r] data + # + # @return [FinchAPI::Models::AccountUpdateEvent::Data, nil] + optional :data, -> { FinchAPI::Models::AccountUpdateEvent::Data } + + # @!parse + # # @return [FinchAPI::Models::AccountUpdateEvent::Data] + # attr_writer :data + + # @!attribute [r] event_type + # + # @return [Symbol, FinchAPI::Models::AccountUpdateEvent::EventType, nil] + optional :event_type, enum: -> { FinchAPI::Models::AccountUpdateEvent::EventType } + + # @!parse + # # @return [Symbol, FinchAPI::Models::AccountUpdateEvent::EventType] + # attr_writer :event_type + + # @!parse + # # @param data [FinchAPI::Models::AccountUpdateEvent::Data] + # # @param event_type [Symbol, FinchAPI::Models::AccountUpdateEvent::EventType] + # # + # def initialize(data: nil, event_type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Data < FinchAPI::BaseModel + # @!attribute authentication_method + # + # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod] + required :authentication_method, -> { FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod } + + # @!attribute status + # + # @return [Symbol, FinchAPI::Models::ConnectionStatusType] + required :status, enum: -> { FinchAPI::Models::ConnectionStatusType } + + # @!parse + # # @param authentication_method [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod] + # # @param status [Symbol, FinchAPI::Models::ConnectionStatusType] + # # + # def initialize(authentication_method:, status:, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class AuthenticationMethod < FinchAPI::BaseModel + # @!attribute benefits_support + # Each benefit type and their supported features. If the benefit type is not + # supported, the property will be null + # + # @return [FinchAPI::Models::HRIS::BenefitsSupport, nil] + optional :benefits_support, -> { FinchAPI::Models::HRIS::BenefitsSupport }, nil?: true + + # @!attribute supported_fields + # The supported data fields returned by our HR and payroll endpoints + # + # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields, nil] + optional :supported_fields, + -> { FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields }, + nil?: true + + # @!attribute [r] type + # The type of authentication method. + # + # @return [Symbol, FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::Type, nil] + optional :type, enum: -> { FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::Type } + + # @!parse + # # @return [Symbol, FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::Type] + # attr_writer :type + + # @!parse + # # @param benefits_support [FinchAPI::Models::HRIS::BenefitsSupport, nil] + # # @param supported_fields [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields, nil] + # # @param type [Symbol, FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::Type] + # # + # def initialize(benefits_support: nil, supported_fields: nil, type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class SupportedFields < FinchAPI::BaseModel + # @!attribute [r] company + # + # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company, nil] + optional :company, + -> { FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company } + + # @!parse + # # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company] + # attr_writer :company + + # @!attribute [r] directory + # + # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory, nil] + optional :directory, + -> { FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory } + + # @!parse + # # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory] + # attr_writer :directory + + # @!attribute [r] employment + # + # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment, nil] + optional :employment, + -> { FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment } + + # @!parse + # # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment] + # attr_writer :employment + + # @!attribute [r] individual + # + # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual, nil] + optional :individual, + -> { FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual } + + # @!parse + # # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual] + # attr_writer :individual + + # @!attribute [r] pay_group + # + # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayGroup, nil] + optional :pay_group, + -> { FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayGroup } + + # @!parse + # # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayGroup] + # attr_writer :pay_group + + # @!attribute [r] pay_statement + # + # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement, nil] + optional :pay_statement, + -> { FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement } + + # @!parse + # # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement] + # attr_writer :pay_statement + + # @!attribute [r] payment + # + # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment, nil] + optional :payment, + -> { FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment } + + # @!parse + # # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment] + # attr_writer :payment + + # @!parse + # # The supported data fields returned by our HR and payroll endpoints + # # + # # @param company [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company] + # # @param directory [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory] + # # @param employment [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment] + # # @param individual [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual] + # # @param pay_group [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayGroup] + # # @param pay_statement [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement] + # # @param payment [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment] + # # + # def initialize( + # company: nil, + # directory: nil, + # employment: nil, + # individual: nil, + # pay_group: nil, + # pay_statement: nil, + # payment: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Company < FinchAPI::BaseModel + # @!attribute [r] id + # + # @return [Boolean, nil] + optional :id, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :id + + # @!attribute [r] accounts + # + # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Accounts, nil] + optional :accounts, + -> { FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Accounts } + + # @!parse + # # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Accounts] + # attr_writer :accounts + + # @!attribute [r] departments + # + # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments, nil] + optional :departments, + -> { FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments } + + # @!parse + # # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments] + # attr_writer :departments + + # @!attribute [r] ein + # + # @return [Boolean, nil] + optional :ein, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :ein + + # @!attribute [r] entity + # + # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Entity, nil] + optional :entity, + -> { FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Entity } + + # @!parse + # # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Entity] + # attr_writer :entity + + # @!attribute [r] legal_name + # + # @return [Boolean, nil] + optional :legal_name, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :legal_name + + # @!attribute [r] locations + # + # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Locations, nil] + optional :locations, + -> { FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Locations } + + # @!parse + # # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Locations] + # attr_writer :locations + + # @!attribute [r] primary_email + # + # @return [Boolean, nil] + optional :primary_email, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :primary_email + + # @!attribute [r] primary_phone_number + # + # @return [Boolean, nil] + optional :primary_phone_number, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :primary_phone_number + + # @!parse + # # @param id [Boolean] + # # @param accounts [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Accounts] + # # @param departments [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments] + # # @param ein [Boolean] + # # @param entity [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Entity] + # # @param legal_name [Boolean] + # # @param locations [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Locations] + # # @param primary_email [Boolean] + # # @param primary_phone_number [Boolean] + # # + # def initialize( + # id: nil, + # accounts: nil, + # departments: nil, + # ein: nil, + # entity: nil, + # legal_name: nil, + # locations: nil, + # primary_email: nil, + # primary_phone_number: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Accounts < FinchAPI::BaseModel + # @!attribute [r] account_name + # + # @return [Boolean, nil] + optional :account_name, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :account_name + + # @!attribute [r] account_number + # + # @return [Boolean, nil] + optional :account_number, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :account_number + + # @!attribute [r] account_type + # + # @return [Boolean, nil] + optional :account_type, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :account_type + + # @!attribute [r] institution_name + # + # @return [Boolean, nil] + optional :institution_name, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :institution_name + + # @!attribute [r] routing_number + # + # @return [Boolean, nil] + optional :routing_number, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :routing_number + + # @!parse + # # @param account_name [Boolean] + # # @param account_number [Boolean] + # # @param account_type [Boolean] + # # @param institution_name [Boolean] + # # @param routing_number [Boolean] + # # + # def initialize(account_name: nil, account_number: nil, account_type: nil, institution_name: nil, routing_number: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + class Departments < FinchAPI::BaseModel + # @!attribute [r] name + # + # @return [Boolean, nil] + optional :name, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :name + + # @!attribute [r] parent + # + # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments::Parent, nil] + optional :parent, + -> { FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments::Parent } + + # @!parse + # # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments::Parent] + # attr_writer :parent + + # @!parse + # # @param name [Boolean] + # # @param parent [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments::Parent] + # # + # def initialize(name: nil, parent: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Parent < FinchAPI::BaseModel + # @!attribute [r] name + # + # @return [Boolean, nil] + optional :name, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :name + + # @!parse + # # @param name [Boolean] + # # + # def initialize(name: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + + class Entity < FinchAPI::BaseModel + # @!attribute [r] subtype + # + # @return [Boolean, nil] + optional :subtype, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :subtype + + # @!attribute [r] type + # + # @return [Boolean, nil] + optional :type, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :type + + # @!parse + # # @param subtype [Boolean] + # # @param type [Boolean] + # # + # def initialize(subtype: nil, type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + class Locations < FinchAPI::BaseModel + # @!attribute [r] city + # + # @return [Boolean, nil] + optional :city, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :city + + # @!attribute [r] country + # + # @return [Boolean, nil] + optional :country, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :country + + # @!attribute [r] line1 + # + # @return [Boolean, nil] + optional :line1, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :line1 + + # @!attribute [r] line2 + # + # @return [Boolean, nil] + optional :line2, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :line2 + + # @!attribute [r] postal_code + # + # @return [Boolean, nil] + optional :postal_code, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :postal_code + + # @!attribute [r] state + # + # @return [Boolean, nil] + optional :state, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :state + + # @!parse + # # @param city [Boolean] + # # @param country [Boolean] + # # @param line1 [Boolean] + # # @param line2 [Boolean] + # # @param postal_code [Boolean] + # # @param state [Boolean] + # # + # def initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + + class Directory < FinchAPI::BaseModel + # @!attribute [r] individuals + # + # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals, nil] + optional :individuals, + -> { FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals } + + # @!parse + # # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals] + # attr_writer :individuals + + # @!attribute [r] paging + # + # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Paging, nil] + optional :paging, + -> { FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Paging } + + # @!parse + # # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Paging] + # attr_writer :paging + + # @!parse + # # @param individuals [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals] + # # @param paging [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Paging] + # # + # def initialize(individuals: nil, paging: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Individuals < FinchAPI::BaseModel + # @!attribute [r] id + # + # @return [Boolean, nil] + optional :id, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :id + + # @!attribute [r] department + # + # @return [Boolean, nil] + optional :department, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :department + + # @!attribute [r] first_name + # + # @return [Boolean, nil] + optional :first_name, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :first_name + + # @!attribute [r] is_active + # + # @return [Boolean, nil] + optional :is_active, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :is_active + + # @!attribute [r] last_name + # + # @return [Boolean, nil] + optional :last_name, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :last_name + + # @!attribute [r] manager + # + # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager, nil] + optional :manager, + -> { FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager } + + # @!parse + # # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager] + # attr_writer :manager + + # @!attribute [r] middle_name + # + # @return [Boolean, nil] + optional :middle_name, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :middle_name + + # @!parse + # # @param id [Boolean] + # # @param department [Boolean] + # # @param first_name [Boolean] + # # @param is_active [Boolean] + # # @param last_name [Boolean] + # # @param manager [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager] + # # @param middle_name [Boolean] + # # + # def initialize( + # id: nil, + # department: nil, + # first_name: nil, + # is_active: nil, + # last_name: nil, + # manager: nil, + # middle_name: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Manager < FinchAPI::BaseModel + # @!attribute [r] id + # + # @return [Boolean, nil] + optional :id, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :id + + # @!parse + # # @param id [Boolean] + # # + # def initialize(id: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + + class Paging < FinchAPI::BaseModel + # @!attribute [r] count + # + # @return [Boolean, nil] + optional :count, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :count + + # @!attribute [r] offset + # + # @return [Boolean, nil] + optional :offset, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :offset + + # @!parse + # # @param count [Boolean] + # # @param offset [Boolean] + # # + # def initialize(count: nil, offset: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + + class Employment < FinchAPI::BaseModel + # @!attribute [r] id + # + # @return [Boolean, nil] + optional :id, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :id + + # @!attribute [r] class_code + # + # @return [Boolean, nil] + optional :class_code, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :class_code + + # @!attribute [r] custom_fields + # + # @return [Boolean, nil] + optional :custom_fields, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :custom_fields + + # @!attribute [r] department + # + # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Department, nil] + optional :department, + -> { FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Department } + + # @!parse + # # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Department] + # attr_writer :department + + # @!attribute [r] employment + # + # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Employment, nil] + optional :employment, + -> { FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Employment } + + # @!parse + # # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Employment] + # attr_writer :employment + + # @!attribute [r] employment_status + # + # @return [Boolean, nil] + optional :employment_status, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :employment_status + + # @!attribute [r] end_date + # + # @return [Boolean, nil] + optional :end_date, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :end_date + + # @!attribute [r] first_name + # + # @return [Boolean, nil] + optional :first_name, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :first_name + + # @!attribute [r] income + # + # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Income, nil] + optional :income, + -> { FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Income } + + # @!parse + # # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Income] + # attr_writer :income + + # @!attribute [r] income_history + # + # @return [Boolean, nil] + optional :income_history, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :income_history + + # @!attribute [r] is_active + # + # @return [Boolean, nil] + optional :is_active, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :is_active + + # @!attribute [r] last_name + # + # @return [Boolean, nil] + optional :last_name, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :last_name + + # @!attribute [r] location + # + # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Location, nil] + optional :location, + -> { FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Location } + + # @!parse + # # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Location] + # attr_writer :location + + # @!attribute [r] manager + # + # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Manager, nil] + optional :manager, + -> { FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Manager } + + # @!parse + # # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Manager] + # attr_writer :manager + + # @!attribute [r] middle_name + # + # @return [Boolean, nil] + optional :middle_name, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :middle_name + + # @!attribute [r] start_date + # + # @return [Boolean, nil] + optional :start_date, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :start_date + + # @!attribute [r] title + # + # @return [Boolean, nil] + optional :title, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :title + + # @!parse + # # @param id [Boolean] + # # @param class_code [Boolean] + # # @param custom_fields [Boolean] + # # @param department [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Department] + # # @param employment [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Employment] + # # @param employment_status [Boolean] + # # @param end_date [Boolean] + # # @param first_name [Boolean] + # # @param income [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Income] + # # @param income_history [Boolean] + # # @param is_active [Boolean] + # # @param last_name [Boolean] + # # @param location [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Location] + # # @param manager [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Manager] + # # @param middle_name [Boolean] + # # @param start_date [Boolean] + # # @param title [Boolean] + # # + # def initialize( + # id: nil, + # class_code: nil, + # custom_fields: nil, + # department: nil, + # employment: nil, + # employment_status: nil, + # end_date: nil, + # first_name: nil, + # income: nil, + # income_history: nil, + # is_active: nil, + # last_name: nil, + # location: nil, + # manager: nil, + # middle_name: nil, + # start_date: nil, + # title: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Department < FinchAPI::BaseModel + # @!attribute [r] name + # + # @return [Boolean, nil] + optional :name, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :name + + # @!parse + # # @param name [Boolean] + # # + # def initialize(name: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + class Employment < FinchAPI::BaseModel + # @!attribute [r] subtype + # + # @return [Boolean, nil] + optional :subtype, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :subtype + + # @!attribute [r] type + # + # @return [Boolean, nil] + optional :type, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :type + + # @!parse + # # @param subtype [Boolean] + # # @param type [Boolean] + # # + # def initialize(subtype: nil, type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + class Income < FinchAPI::BaseModel + # @!attribute [r] amount + # + # @return [Boolean, nil] + optional :amount, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :amount + + # @!attribute [r] currency + # + # @return [Boolean, nil] + optional :currency, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :currency + + # @!attribute [r] unit + # + # @return [Boolean, nil] + optional :unit, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :unit + + # @!parse + # # @param amount [Boolean] + # # @param currency [Boolean] + # # @param unit [Boolean] + # # + # def initialize(amount: nil, currency: nil, unit: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + class Location < FinchAPI::BaseModel + # @!attribute [r] city + # + # @return [Boolean, nil] + optional :city, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :city + + # @!attribute [r] country + # + # @return [Boolean, nil] + optional :country, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :country + + # @!attribute [r] line1 + # + # @return [Boolean, nil] + optional :line1, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :line1 + + # @!attribute [r] line2 + # + # @return [Boolean, nil] + optional :line2, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :line2 + + # @!attribute [r] postal_code + # + # @return [Boolean, nil] + optional :postal_code, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :postal_code + + # @!attribute [r] state + # + # @return [Boolean, nil] + optional :state, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :state + + # @!parse + # # @param city [Boolean] + # # @param country [Boolean] + # # @param line1 [Boolean] + # # @param line2 [Boolean] + # # @param postal_code [Boolean] + # # @param state [Boolean] + # # + # def initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + class Manager < FinchAPI::BaseModel + # @!attribute [r] id + # + # @return [Boolean, nil] + optional :id, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :id + + # @!parse + # # @param id [Boolean] + # # + # def initialize(id: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + + class Individual < FinchAPI::BaseModel + # @!attribute [r] id + # + # @return [Boolean, nil] + optional :id, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :id + + # @!attribute [r] dob + # + # @return [Boolean, nil] + optional :dob, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :dob + + # @!attribute [r] emails + # + # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::Emails, nil] + optional :emails, + -> { FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::Emails } + + # @!parse + # # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::Emails] + # attr_writer :emails + + # @!attribute [r] encrypted_ssn + # + # @return [Boolean, nil] + optional :encrypted_ssn, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :encrypted_ssn + + # @!attribute [r] ethnicity + # + # @return [Boolean, nil] + optional :ethnicity, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :ethnicity + + # @!attribute [r] first_name + # + # @return [Boolean, nil] + optional :first_name, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :first_name + + # @!attribute [r] gender + # + # @return [Boolean, nil] + optional :gender, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :gender + + # @!attribute [r] last_name + # + # @return [Boolean, nil] + optional :last_name, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :last_name + + # @!attribute [r] middle_name + # + # @return [Boolean, nil] + optional :middle_name, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :middle_name + + # @!attribute [r] phone_numbers + # + # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::PhoneNumbers, nil] + optional :phone_numbers, + -> { FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::PhoneNumbers } + + # @!parse + # # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::PhoneNumbers] + # attr_writer :phone_numbers + + # @!attribute [r] preferred_name + # + # @return [Boolean, nil] + optional :preferred_name, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :preferred_name + + # @!attribute [r] residence + # + # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::Residence, nil] + optional :residence, + -> { FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::Residence } + + # @!parse + # # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::Residence] + # attr_writer :residence + + # @!attribute [r] ssn + # + # @return [Boolean, nil] + optional :ssn, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :ssn + + # @!parse + # # @param id [Boolean] + # # @param dob [Boolean] + # # @param emails [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::Emails] + # # @param encrypted_ssn [Boolean] + # # @param ethnicity [Boolean] + # # @param first_name [Boolean] + # # @param gender [Boolean] + # # @param last_name [Boolean] + # # @param middle_name [Boolean] + # # @param phone_numbers [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::PhoneNumbers] + # # @param preferred_name [Boolean] + # # @param residence [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::Residence] + # # @param ssn [Boolean] + # # + # def initialize( + # id: nil, + # dob: nil, + # emails: nil, + # encrypted_ssn: nil, + # ethnicity: nil, + # first_name: nil, + # gender: nil, + # last_name: nil, + # middle_name: nil, + # phone_numbers: nil, + # preferred_name: nil, + # residence: nil, + # ssn: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Emails < FinchAPI::BaseModel + # @!attribute [r] data + # + # @return [Boolean, nil] + optional :data, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :data + + # @!attribute [r] type + # + # @return [Boolean, nil] + optional :type, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :type + + # @!parse + # # @param data [Boolean] + # # @param type [Boolean] + # # + # def initialize(data: nil, type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + class PhoneNumbers < FinchAPI::BaseModel + # @!attribute [r] data + # + # @return [Boolean, nil] + optional :data, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :data + + # @!attribute [r] type + # + # @return [Boolean, nil] + optional :type, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :type + + # @!parse + # # @param data [Boolean] + # # @param type [Boolean] + # # + # def initialize(data: nil, type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + class Residence < FinchAPI::BaseModel + # @!attribute [r] city + # + # @return [Boolean, nil] + optional :city, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :city + + # @!attribute [r] country + # + # @return [Boolean, nil] + optional :country, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :country + + # @!attribute [r] line1 + # + # @return [Boolean, nil] + optional :line1, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :line1 + + # @!attribute [r] line2 + # + # @return [Boolean, nil] + optional :line2, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :line2 + + # @!attribute [r] postal_code + # + # @return [Boolean, nil] + optional :postal_code, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :postal_code + + # @!attribute [r] state + # + # @return [Boolean, nil] + optional :state, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :state + + # @!parse + # # @param city [Boolean] + # # @param country [Boolean] + # # @param line1 [Boolean] + # # @param line2 [Boolean] + # # @param postal_code [Boolean] + # # @param state [Boolean] + # # + # def initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + + class PayGroup < FinchAPI::BaseModel + # @!attribute [r] id + # + # @return [Boolean, nil] + optional :id, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :id + + # @!attribute [r] individual_ids + # + # @return [Boolean, nil] + optional :individual_ids, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :individual_ids + + # @!attribute [r] name + # + # @return [Boolean, nil] + optional :name, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :name + + # @!attribute [r] pay_frequencies + # + # @return [Boolean, nil] + optional :pay_frequencies, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :pay_frequencies + + # @!parse + # # @param id [Boolean] + # # @param individual_ids [Boolean] + # # @param name [Boolean] + # # @param pay_frequencies [Boolean] + # # + # def initialize(id: nil, individual_ids: nil, name: nil, pay_frequencies: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + class PayStatement < FinchAPI::BaseModel + # @!attribute [r] paging + # + # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::Paging, nil] + optional :paging, + -> { FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::Paging } + + # @!parse + # # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::Paging] + # attr_writer :paging + + # @!attribute [r] pay_statements + # + # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements, nil] + optional :pay_statements, + -> { FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements } + + # @!parse + # # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements] + # attr_writer :pay_statements + + # @!parse + # # @param paging [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::Paging] + # # @param pay_statements [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements] + # # + # def initialize(paging: nil, pay_statements: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Paging < FinchAPI::BaseModel + # @!attribute count + # + # @return [Boolean] + required :count, FinchAPI::BooleanModel + + # @!attribute offset + # + # @return [Boolean] + required :offset, FinchAPI::BooleanModel + + # @!parse + # # @param count [Boolean] + # # @param offset [Boolean] + # # + # def initialize(count:, offset:, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + class PayStatements < FinchAPI::BaseModel + # @!attribute [r] earnings + # + # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings, nil] + optional :earnings, + -> { FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings } + + # @!parse + # # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings] + # attr_writer :earnings + + # @!attribute [r] employee_deductions + # + # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployeeDeductions, nil] + optional :employee_deductions, + -> { FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployeeDeductions } + + # @!parse + # # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployeeDeductions] + # attr_writer :employee_deductions + + # @!attribute [r] employer_contributions + # + # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployerContributions, nil] + optional :employer_contributions, + -> { FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployerContributions } + + # @!parse + # # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployerContributions] + # attr_writer :employer_contributions + + # @!attribute [r] gross_pay + # + # @return [Boolean, nil] + optional :gross_pay, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :gross_pay + + # @!attribute [r] individual_id + # + # @return [Boolean, nil] + optional :individual_id, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :individual_id + + # @!attribute [r] net_pay + # + # @return [Boolean, nil] + optional :net_pay, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :net_pay + + # @!attribute [r] payment_method + # + # @return [Boolean, nil] + optional :payment_method, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :payment_method + + # @!attribute [r] taxes + # + # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Taxes, nil] + optional :taxes, + -> { FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Taxes } + + # @!parse + # # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Taxes] + # attr_writer :taxes + + # @!attribute [r] total_hours + # + # @return [Boolean, nil] + optional :total_hours, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :total_hours + + # @!attribute [r] type + # + # @return [Boolean, nil] + optional :type, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :type + + # @!parse + # # @param earnings [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings] + # # @param employee_deductions [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployeeDeductions] + # # @param employer_contributions [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployerContributions] + # # @param gross_pay [Boolean] + # # @param individual_id [Boolean] + # # @param net_pay [Boolean] + # # @param payment_method [Boolean] + # # @param taxes [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Taxes] + # # @param total_hours [Boolean] + # # @param type [Boolean] + # # + # def initialize( + # earnings: nil, + # employee_deductions: nil, + # employer_contributions: nil, + # gross_pay: nil, + # individual_id: nil, + # net_pay: nil, + # payment_method: nil, + # taxes: nil, + # total_hours: nil, + # type: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Earnings < FinchAPI::BaseModel + # @!attribute [r] amount + # + # @return [Boolean, nil] + optional :amount, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :amount + + # @!attribute [r] currency + # + # @return [Boolean, nil] + optional :currency, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :currency + + # @!attribute [r] name + # + # @return [Boolean, nil] + optional :name, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :name + + # @!attribute [r] type + # + # @return [Boolean, nil] + optional :type, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :type + + # @!parse + # # @param amount [Boolean] + # # @param currency [Boolean] + # # @param name [Boolean] + # # @param type [Boolean] + # # + # def initialize(amount: nil, currency: nil, name: nil, type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + class EmployeeDeductions < FinchAPI::BaseModel + # @!attribute [r] amount + # + # @return [Boolean, nil] + optional :amount, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :amount + + # @!attribute [r] currency + # + # @return [Boolean, nil] + optional :currency, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :currency + + # @!attribute [r] name + # + # @return [Boolean, nil] + optional :name, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :name + + # @!attribute [r] pre_tax + # + # @return [Boolean, nil] + optional :pre_tax, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :pre_tax + + # @!attribute [r] type + # + # @return [Boolean, nil] + optional :type, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :type + + # @!parse + # # @param amount [Boolean] + # # @param currency [Boolean] + # # @param name [Boolean] + # # @param pre_tax [Boolean] + # # @param type [Boolean] + # # + # def initialize(amount: nil, currency: nil, name: nil, pre_tax: nil, type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + class EmployerContributions < FinchAPI::BaseModel + # @!attribute [r] amount + # + # @return [Boolean, nil] + optional :amount, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :amount + + # @!attribute [r] currency + # + # @return [Boolean, nil] + optional :currency, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :currency + + # @!attribute [r] name + # + # @return [Boolean, nil] + optional :name, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :name + + # @!parse + # # @param amount [Boolean] + # # @param currency [Boolean] + # # @param name [Boolean] + # # + # def initialize(amount: nil, currency: nil, name: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + class Taxes < FinchAPI::BaseModel + # @!attribute [r] amount + # + # @return [Boolean, nil] + optional :amount, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :amount + + # @!attribute [r] currency + # + # @return [Boolean, nil] + optional :currency, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :currency + + # @!attribute [r] employer + # + # @return [Boolean, nil] + optional :employer, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :employer + + # @!attribute [r] name + # + # @return [Boolean, nil] + optional :name, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :name + + # @!attribute [r] type + # + # @return [Boolean, nil] + optional :type, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :type + + # @!parse + # # @param amount [Boolean] + # # @param currency [Boolean] + # # @param employer [Boolean] + # # @param name [Boolean] + # # @param type [Boolean] + # # + # def initialize(amount: nil, currency: nil, employer: nil, name: nil, type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end + + class Payment < FinchAPI::BaseModel + # @!attribute [r] id + # + # @return [Boolean, nil] + optional :id, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :id + + # @!attribute [r] company_debit + # + # @return [Boolean, nil] + optional :company_debit, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :company_debit + + # @!attribute [r] debit_date + # + # @return [Boolean, nil] + optional :debit_date, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :debit_date + + # @!attribute [r] employee_taxes + # + # @return [Boolean, nil] + optional :employee_taxes, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :employee_taxes + + # @!attribute [r] employer_taxes + # + # @return [Boolean, nil] + optional :employer_taxes, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :employer_taxes + + # @!attribute [r] gross_pay + # + # @return [Boolean, nil] + optional :gross_pay, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :gross_pay + + # @!attribute [r] individual_ids + # + # @return [Boolean, nil] + optional :individual_ids, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :individual_ids + + # @!attribute [r] net_pay + # + # @return [Boolean, nil] + optional :net_pay, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :net_pay + + # @!attribute [r] pay_date + # + # @return [Boolean, nil] + optional :pay_date, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :pay_date + + # @!attribute [r] pay_frequencies + # + # @return [Boolean, nil] + optional :pay_frequencies, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :pay_frequencies + + # @!attribute [r] pay_group_ids + # + # @return [Boolean, nil] + optional :pay_group_ids, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :pay_group_ids + + # @!attribute [r] pay_period + # + # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment::PayPeriod, nil] + optional :pay_period, + -> { FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment::PayPeriod } + + # @!parse + # # @return [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment::PayPeriod] + # attr_writer :pay_period + + # @!parse + # # @param id [Boolean] + # # @param company_debit [Boolean] + # # @param debit_date [Boolean] + # # @param employee_taxes [Boolean] + # # @param employer_taxes [Boolean] + # # @param gross_pay [Boolean] + # # @param individual_ids [Boolean] + # # @param net_pay [Boolean] + # # @param pay_date [Boolean] + # # @param pay_frequencies [Boolean] + # # @param pay_group_ids [Boolean] + # # @param pay_period [FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment::PayPeriod] + # # + # def initialize( + # id: nil, + # company_debit: nil, + # debit_date: nil, + # employee_taxes: nil, + # employer_taxes: nil, + # gross_pay: nil, + # individual_ids: nil, + # net_pay: nil, + # pay_date: nil, + # pay_frequencies: nil, + # pay_group_ids: nil, + # pay_period: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class PayPeriod < FinchAPI::BaseModel + # @!attribute [r] end_date + # + # @return [Boolean, nil] + optional :end_date, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :end_date + + # @!attribute [r] start_date + # + # @return [Boolean, nil] + optional :start_date, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :start_date + + # @!parse + # # @param end_date [Boolean] + # # @param start_date [Boolean] + # # + # def initialize(end_date: nil, start_date: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end + + # @abstract + # + # The type of authentication method. + # + # @example + # ```ruby + # case type + # in :assisted + # # ... + # in :credential + # # ... + # in :api_token + # # ... + # in :api_credential + # # ... + # in :oauth + # # ... + # end + # ``` + class Type < FinchAPI::Enum + ASSISTED = :assisted + CREDENTIAL = :credential + API_TOKEN = :api_token + API_CREDENTIAL = :api_credential + OAUTH = :oauth + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + + # @abstract + # + # @example + # ```ruby + # case event_type + # in :"account.updated" + # # ... + # end + # ``` + class EventType < FinchAPI::Enum + ACCOUNT_UPDATED = :"account.updated" + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end +end diff --git a/lib/finch-api/models/base_webhook_event.rb b/lib/finch-api/models/base_webhook_event.rb new file mode 100644 index 00000000..a71bee98 --- /dev/null +++ b/lib/finch-api/models/base_webhook_event.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + class BaseWebhookEvent < FinchAPI::BaseModel + # @!attribute account_id + # [DEPRECATED] Unique Finch ID of the employer account used to make this + # connection. Use `connection_id` instead to identify the connection associated + # with this event. + # + # @return [String] + required :account_id, String + + # @!attribute company_id + # [DEPRECATED] Unique Finch ID of the company for which data has been updated. Use + # `connection_id` instead to identify the connection associated with this event. + # + # @return [String] + required :company_id, String + + # @!attribute [r] connection_id + # Unique Finch ID of the connection associated with the webhook event. + # + # @return [String, nil] + optional :connection_id, String + + # @!parse + # # @return [String] + # attr_writer :connection_id + + # @!parse + # # @param account_id [String] + # # @param company_id [String] + # # @param connection_id [String] + # # + # def initialize(account_id:, company_id:, connection_id: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end +end diff --git a/lib/finch-api/models/company_event.rb b/lib/finch-api/models/company_event.rb new file mode 100644 index 00000000..2aa752c4 --- /dev/null +++ b/lib/finch-api/models/company_event.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + class CompanyEvent < FinchAPI::Models::BaseWebhookEvent + # @!attribute data + # + # @return [Hash{Symbol=>Object}, nil] + optional :data, FinchAPI::HashOf[FinchAPI::Unknown], nil?: true + + # @!attribute [r] event_type + # + # @return [Symbol, FinchAPI::Models::CompanyEvent::EventType, nil] + optional :event_type, enum: -> { FinchAPI::Models::CompanyEvent::EventType } + + # @!parse + # # @return [Symbol, FinchAPI::Models::CompanyEvent::EventType] + # attr_writer :event_type + + # @!parse + # # @param data [Hash{Symbol=>Object}, nil] + # # @param event_type [Symbol, FinchAPI::Models::CompanyEvent::EventType] + # # + # def initialize(data: nil, event_type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case event_type + # in :"company.updated" + # # ... + # end + # ``` + class EventType < FinchAPI::Enum + COMPANY_UPDATED = :"company.updated" + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end +end diff --git a/lib/finch-api/models/connect/session_new_params.rb b/lib/finch-api/models/connect/session_new_params.rb new file mode 100644 index 00000000..3e3be8d4 --- /dev/null +++ b/lib/finch-api/models/connect/session_new_params.rb @@ -0,0 +1,203 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module Connect + class SessionNewParams < FinchAPI::BaseModel + # @!parse + # extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + # @!attribute customer_id + # + # @return [String] + required :customer_id, String + + # @!attribute customer_name + # + # @return [String] + required :customer_name, String + + # @!attribute products + # + # @return [Array] + required :products, -> { FinchAPI::ArrayOf[enum: FinchAPI::Models::Connect::SessionNewParams::Product] } + + # @!attribute customer_email + # + # @return [String, nil] + optional :customer_email, String, nil?: true + + # @!attribute integration + # + # @return [FinchAPI::Models::Connect::SessionNewParams::Integration, nil] + optional :integration, -> { FinchAPI::Models::Connect::SessionNewParams::Integration }, nil?: true + + # @!attribute manual + # + # @return [Boolean, nil] + optional :manual, FinchAPI::BooleanModel, nil?: true + + # @!attribute minutes_to_expire + # The number of minutes until the session expires (defaults to 43,200, which is 30 + # days) + # + # @return [Float, nil] + optional :minutes_to_expire, Float, nil?: true + + # @!attribute redirect_uri + # + # @return [String, nil] + optional :redirect_uri, String, nil?: true + + # @!attribute sandbox + # + # @return [Symbol, FinchAPI::Models::Connect::SessionNewParams::Sandbox, nil] + optional :sandbox, enum: -> { FinchAPI::Models::Connect::SessionNewParams::Sandbox }, nil?: true + + # @!parse + # # @param customer_id [String] + # # @param customer_name [String] + # # @param products [Array] + # # @param customer_email [String, nil] + # # @param integration [FinchAPI::Models::Connect::SessionNewParams::Integration, nil] + # # @param manual [Boolean, nil] + # # @param minutes_to_expire [Float, nil] + # # @param redirect_uri [String, nil] + # # @param sandbox [Symbol, FinchAPI::Models::Connect::SessionNewParams::Sandbox, nil] + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # customer_id:, + # customer_name:, + # products:, + # customer_email: nil, + # integration: nil, + # manual: nil, + # minutes_to_expire: nil, + # redirect_uri: nil, + # sandbox: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # The Finch products that can be requested during the Connect flow. + # + # @example + # ```ruby + # case product + # in :company + # # ... + # in :directory + # # ... + # in :individual + # # ... + # in :employment + # # ... + # in :payment + # # ... + # in ... + # #... + # end + # ``` + class Product < FinchAPI::Enum + COMPANY = :company + DIRECTORY = :directory + INDIVIDUAL = :individual + EMPLOYMENT = :employment + PAYMENT = :payment + PAY_STATEMENT = :pay_statement + BENEFITS = :benefits + SSN = :ssn + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + class Integration < FinchAPI::BaseModel + # @!attribute auth_method + # + # @return [Symbol, FinchAPI::Models::Connect::SessionNewParams::Integration::AuthMethod, nil] + optional :auth_method, + enum: -> { FinchAPI::Models::Connect::SessionNewParams::Integration::AuthMethod }, + nil?: true + + # @!attribute provider + # + # @return [String, nil] + optional :provider, String, nil?: true + + # @!parse + # # @param auth_method [Symbol, FinchAPI::Models::Connect::SessionNewParams::Integration::AuthMethod, nil] + # # @param provider [String, nil] + # # + # def initialize(auth_method: nil, provider: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case auth_method + # in :assisted + # # ... + # in :credential + # # ... + # in :oauth + # # ... + # in :api_token + # # ... + # end + # ``` + class AuthMethod < FinchAPI::Enum + ASSISTED = :assisted + CREDENTIAL = :credential + OAUTH = :oauth + API_TOKEN = :api_token + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @abstract + # + # @example + # ```ruby + # case sandbox + # in :finch + # # ... + # in :provider + # # ... + # end + # ``` + class Sandbox < FinchAPI::Enum + FINCH = :finch + PROVIDER = :provider + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end +end diff --git a/lib/finch-api/models/connect/session_new_response.rb b/lib/finch-api/models/connect/session_new_response.rb new file mode 100644 index 00000000..e21b6e76 --- /dev/null +++ b/lib/finch-api/models/connect/session_new_response.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module Connect + class SessionNewResponse < FinchAPI::BaseModel + # @!attribute connect_url + # The Connect URL to redirect the user to for authentication + # + # @return [String] + required :connect_url, String + + # @!attribute session_id + # The unique identifier for the created connect session + # + # @return [String] + required :session_id, String + + # @!parse + # # @param connect_url [String] + # # @param session_id [String] + # # + # def initialize(connect_url:, session_id:, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end +end diff --git a/lib/finch-api/models/connect/session_reauthenticate_params.rb b/lib/finch-api/models/connect/session_reauthenticate_params.rb new file mode 100644 index 00000000..2c9d4a30 --- /dev/null +++ b/lib/finch-api/models/connect/session_reauthenticate_params.rb @@ -0,0 +1,90 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module Connect + class SessionReauthenticateParams < FinchAPI::BaseModel + # @!parse + # extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + # @!attribute connection_id + # The ID of the existing connection to reauthenticate + # + # @return [String] + required :connection_id, String + + # @!attribute minutes_to_expire + # The number of minutes until the session expires (defaults to 43,200, which is 30 + # days) + # + # @return [Integer, nil] + optional :minutes_to_expire, Integer, nil?: true + + # @!attribute products + # The products to request access to (optional for reauthentication) + # + # @return [Array, nil] + optional :products, + -> { FinchAPI::ArrayOf[enum: FinchAPI::Models::Connect::SessionReauthenticateParams::Product] }, + nil?: true + + # @!attribute redirect_uri + # The URI to redirect to after the Connect flow is completed + # + # @return [String, nil] + optional :redirect_uri, String, nil?: true + + # @!parse + # # @param connection_id [String] + # # @param minutes_to_expire [Integer, nil] + # # @param products [Array, nil] + # # @param redirect_uri [String, nil] + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(connection_id:, minutes_to_expire: nil, products: nil, redirect_uri: nil, request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # The Finch products that can be requested during the Connect flow. + # + # @example + # ```ruby + # case product + # in :company + # # ... + # in :directory + # # ... + # in :individual + # # ... + # in :employment + # # ... + # in :payment + # # ... + # in ... + # #... + # end + # ``` + class Product < FinchAPI::Enum + COMPANY = :company + DIRECTORY = :directory + INDIVIDUAL = :individual + EMPLOYMENT = :employment + PAYMENT = :payment + PAY_STATEMENT = :pay_statement + BENEFITS = :benefits + SSN = :ssn + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end +end diff --git a/lib/finch-api/models/connect/session_reauthenticate_response.rb b/lib/finch-api/models/connect/session_reauthenticate_response.rb new file mode 100644 index 00000000..35e40476 --- /dev/null +++ b/lib/finch-api/models/connect/session_reauthenticate_response.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module Connect + class SessionReauthenticateResponse < FinchAPI::BaseModel + # @!attribute connect_url + # The Connect URL to redirect the user to for reauthentication + # + # @return [String] + required :connect_url, String + + # @!attribute session_id + # The unique identifier for the created connect session + # + # @return [String] + required :session_id, String + + # @!parse + # # @param connect_url [String] + # # @param session_id [String] + # # + # def initialize(connect_url:, session_id:, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end +end diff --git a/lib/finch-api/models/connection_status_type.rb b/lib/finch-api/models/connection_status_type.rb new file mode 100644 index 00000000..37bb73e7 --- /dev/null +++ b/lib/finch-api/models/connection_status_type.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + # @abstract + # + # @example + # ```ruby + # case connection_status_type + # in :pending + # # ... + # in :processing + # # ... + # in :connected + # # ... + # in :error_no_account_setup + # # ... + # in :error_permissions + # # ... + # in ... + # #... + # end + # ``` + class ConnectionStatusType < FinchAPI::Enum + PENDING = :pending + PROCESSING = :processing + CONNECTED = :connected + ERROR_NO_ACCOUNT_SETUP = :error_no_account_setup + ERROR_PERMISSIONS = :error_permissions + REAUTH = :reauth + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end +end diff --git a/lib/finch-api/models/create_access_token_response.rb b/lib/finch-api/models/create_access_token_response.rb new file mode 100644 index 00000000..859c9d0a --- /dev/null +++ b/lib/finch-api/models/create_access_token_response.rb @@ -0,0 +1,163 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + class CreateAccessTokenResponse < FinchAPI::BaseModel + # @!attribute access_token + # The access token for the connection. + # + # @return [String] + required :access_token, String + + # @!attribute account_id + # [DEPRECATED] Use `connection_id` to identify the connection instead of this + # account ID. + # + # @return [String] + required :account_id, String + + # @!attribute client_type + # The type of application associated with a token. + # + # @return [Symbol, FinchAPI::Models::CreateAccessTokenResponse::ClientType] + required :client_type, enum: -> { FinchAPI::Models::CreateAccessTokenResponse::ClientType } + + # @!attribute company_id + # [DEPRECATED] Use `connection_id` to identify the connection instead of this + # company ID. + # + # @return [String] + required :company_id, String + + # @!attribute connection_id + # The Finch UUID of the connection associated with the `access_token`. + # + # @return [String] + required :connection_id, String + + # @!attribute connection_type + # The type of the connection associated with the token. + # + # - `provider` - connection to an external provider + # - `finch` - finch-generated data. + # + # @return [Symbol, FinchAPI::Models::CreateAccessTokenResponse::ConnectionType] + required :connection_type, enum: -> { FinchAPI::Models::CreateAccessTokenResponse::ConnectionType } + + # @!attribute products + # An array of the authorized products associated with the `access_token`. + # + # @return [Array] + required :products, FinchAPI::ArrayOf[String] + + # @!attribute provider_id + # The ID of the provider associated with the `access_token`. + # + # @return [String] + required :provider_id, String + + # @!attribute customer_id + # The ID of your customer you provided to Finch when a connect session was created + # for this connection. + # + # @return [String, nil] + optional :customer_id, String, nil?: true + + # @!attribute [r] token_type + # The RFC 8693 token type (Finch uses `bearer` tokens) + # + # @return [String, nil] + optional :token_type, String + + # @!parse + # # @return [String] + # attr_writer :token_type + + # @!parse + # # @param access_token [String] + # # @param account_id [String] + # # @param client_type [Symbol, FinchAPI::Models::CreateAccessTokenResponse::ClientType] + # # @param company_id [String] + # # @param connection_id [String] + # # @param connection_type [Symbol, FinchAPI::Models::CreateAccessTokenResponse::ConnectionType] + # # @param products [Array] + # # @param provider_id [String] + # # @param customer_id [String, nil] + # # @param token_type [String] + # # + # def initialize( + # access_token:, + # account_id:, + # client_type:, + # company_id:, + # connection_id:, + # connection_type:, + # products:, + # provider_id:, + # customer_id: nil, + # token_type: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # The type of application associated with a token. + # + # @example + # ```ruby + # case client_type + # in :production + # # ... + # in :development + # # ... + # in :sandbox + # # ... + # end + # ``` + class ClientType < FinchAPI::Enum + PRODUCTION = :production + DEVELOPMENT = :development + SANDBOX = :sandbox + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @abstract + # + # The type of the connection associated with the token. + # + # - `provider` - connection to an external provider + # - `finch` - finch-generated data. + # + # @example + # ```ruby + # case connection_type + # in :provider + # # ... + # in :finch + # # ... + # end + # ``` + class ConnectionType < FinchAPI::Enum + PROVIDER = :provider + FINCH = :finch + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end +end diff --git a/lib/finch-api/models/directory_event.rb b/lib/finch-api/models/directory_event.rb new file mode 100644 index 00000000..553c0d74 --- /dev/null +++ b/lib/finch-api/models/directory_event.rb @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + class DirectoryEvent < FinchAPI::Models::BaseWebhookEvent + # @!attribute [r] data + # + # @return [FinchAPI::Models::DirectoryEvent::Data, nil] + optional :data, -> { FinchAPI::Models::DirectoryEvent::Data } + + # @!parse + # # @return [FinchAPI::Models::DirectoryEvent::Data] + # attr_writer :data + + # @!attribute [r] event_type + # + # @return [Symbol, FinchAPI::Models::DirectoryEvent::EventType, nil] + optional :event_type, enum: -> { FinchAPI::Models::DirectoryEvent::EventType } + + # @!parse + # # @return [Symbol, FinchAPI::Models::DirectoryEvent::EventType] + # attr_writer :event_type + + # @!parse + # # @param data [FinchAPI::Models::DirectoryEvent::Data] + # # @param event_type [Symbol, FinchAPI::Models::DirectoryEvent::EventType] + # # + # def initialize(data: nil, event_type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Data < FinchAPI::BaseModel + # @!attribute [r] individual_id + # The ID of the individual related to the event. + # + # @return [String, nil] + optional :individual_id, String + + # @!parse + # # @return [String] + # attr_writer :individual_id + + # @!parse + # # @param individual_id [String] + # # + # def initialize(individual_id: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case event_type + # in :"directory.created" + # # ... + # in :"directory.updated" + # # ... + # in :"directory.deleted" + # # ... + # end + # ``` + class EventType < FinchAPI::Enum + DIRECTORY_CREATED = :"directory.created" + DIRECTORY_UPDATED = :"directory.updated" + DIRECTORY_DELETED = :"directory.deleted" + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end +end diff --git a/lib/finch-api/models/disconnect_response.rb b/lib/finch-api/models/disconnect_response.rb new file mode 100644 index 00000000..0c0370ef --- /dev/null +++ b/lib/finch-api/models/disconnect_response.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + class DisconnectResponse < FinchAPI::BaseModel + # @!attribute status + # If the request is successful, Finch will return “success” (HTTP 200 status). + # + # @return [String] + required :status, String + + # @!parse + # # @param status [String] + # # + # def initialize(status:, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end +end diff --git a/lib/finch-api/models/employment_event.rb b/lib/finch-api/models/employment_event.rb new file mode 100644 index 00000000..c7d603b1 --- /dev/null +++ b/lib/finch-api/models/employment_event.rb @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + class EmploymentEvent < FinchAPI::Models::BaseWebhookEvent + # @!attribute [r] data + # + # @return [FinchAPI::Models::EmploymentEvent::Data, nil] + optional :data, -> { FinchAPI::Models::EmploymentEvent::Data } + + # @!parse + # # @return [FinchAPI::Models::EmploymentEvent::Data] + # attr_writer :data + + # @!attribute [r] event_type + # + # @return [Symbol, FinchAPI::Models::EmploymentEvent::EventType, nil] + optional :event_type, enum: -> { FinchAPI::Models::EmploymentEvent::EventType } + + # @!parse + # # @return [Symbol, FinchAPI::Models::EmploymentEvent::EventType] + # attr_writer :event_type + + # @!parse + # # @param data [FinchAPI::Models::EmploymentEvent::Data] + # # @param event_type [Symbol, FinchAPI::Models::EmploymentEvent::EventType] + # # + # def initialize(data: nil, event_type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Data < FinchAPI::BaseModel + # @!attribute [r] individual_id + # The ID of the individual related to the event. + # + # @return [String, nil] + optional :individual_id, String + + # @!parse + # # @return [String] + # attr_writer :individual_id + + # @!parse + # # @param individual_id [String] + # # + # def initialize(individual_id: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case event_type + # in :"employment.created" + # # ... + # in :"employment.updated" + # # ... + # in :"employment.deleted" + # # ... + # end + # ``` + class EventType < FinchAPI::Enum + EMPLOYMENT_CREATED = :"employment.created" + EMPLOYMENT_UPDATED = :"employment.updated" + EMPLOYMENT_DELETED = :"employment.deleted" + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end +end diff --git a/lib/finch-api/models/hris/benefit_contribution.rb b/lib/finch-api/models/hris/benefit_contribution.rb new file mode 100644 index 00000000..e3092be8 --- /dev/null +++ b/lib/finch-api/models/hris/benefit_contribution.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + class BenefitContribution < FinchAPI::BaseModel + # @!attribute amount + # Contribution amount in cents (if `fixed`) or basis points (if `percent`). + # + # @return [Integer, nil] + optional :amount, Integer, nil?: true + + # @!attribute type + # Contribution type. + # + # @return [Symbol, FinchAPI::Models::HRIS::BenefitContribution::Type, nil] + optional :type, enum: -> { FinchAPI::Models::HRIS::BenefitContribution::Type }, nil?: true + + # @!parse + # # @param amount [Integer, nil] + # # @param type [Symbol, FinchAPI::Models::HRIS::BenefitContribution::Type, nil] + # # + # def initialize(amount: nil, type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # Contribution type. + # + # @example + # ```ruby + # case type + # in :fixed + # # ... + # in :percent + # # ... + # end + # ``` + class Type < FinchAPI::Enum + FIXED = :fixed + PERCENT = :percent + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end +end diff --git a/lib/finch-api/models/hris/benefit_create_params.rb b/lib/finch-api/models/hris/benefit_create_params.rb new file mode 100644 index 00000000..53b35a22 --- /dev/null +++ b/lib/finch-api/models/hris/benefit_create_params.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + class BenefitCreateParams < FinchAPI::BaseModel + # @!parse + # extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + # @!attribute [r] description + # Name of the benefit as it appears in the provider and pay statements. Recommend + # limiting this to <30 characters due to limitations in specific providers (e.g. + # Justworks). + # + # @return [String, nil] + optional :description, String + + # @!parse + # # @return [String] + # attr_writer :description + + # @!attribute frequency + # + # @return [Symbol, FinchAPI::Models::HRIS::BenefitFrequency, nil] + optional :frequency, enum: -> { FinchAPI::Models::HRIS::BenefitFrequency }, nil?: true + + # @!attribute type + # Type of benefit. + # + # @return [Symbol, FinchAPI::Models::HRIS::BenefitType, nil] + optional :type, enum: -> { FinchAPI::Models::HRIS::BenefitType }, nil?: true + + # @!parse + # # @param description [String] + # # @param frequency [Symbol, FinchAPI::Models::HRIS::BenefitFrequency, nil] + # # @param type [Symbol, FinchAPI::Models::HRIS::BenefitType, nil] + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(description: nil, frequency: nil, type: nil, request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end +end diff --git a/lib/finch-api/models/hris/benefit_features_and_operations.rb b/lib/finch-api/models/hris/benefit_features_and_operations.rb new file mode 100644 index 00000000..94e3d83d --- /dev/null +++ b/lib/finch-api/models/hris/benefit_features_and_operations.rb @@ -0,0 +1,199 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + class BenefitFeaturesAndOperations < FinchAPI::BaseModel + # @!attribute [r] supported_features + # + # @return [FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures, nil] + optional :supported_features, + -> { FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures } + + # @!parse + # # @return [FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures] + # attr_writer :supported_features + + # @!attribute [r] supported_operations + # + # @return [FinchAPI::Models::HRIS::SupportPerBenefitType, nil] + optional :supported_operations, -> { FinchAPI::Models::HRIS::SupportPerBenefitType } + + # @!parse + # # @return [FinchAPI::Models::HRIS::SupportPerBenefitType] + # attr_writer :supported_operations + + # @!parse + # # @param supported_features [FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures] + # # @param supported_operations [FinchAPI::Models::HRIS::SupportPerBenefitType] + # # + # def initialize(supported_features: nil, supported_operations: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class SupportedFeatures < FinchAPI::BaseModel + # @!attribute annual_maximum + # Whether the provider supports an annual maximum for this benefit. + # + # @return [Boolean, nil] + optional :annual_maximum, FinchAPI::BooleanModel, nil?: true + + # @!attribute catch_up + # Whether the provider supports catch up for this benefit. This field will only be + # true for retirement benefits. + # + # @return [Boolean, nil] + optional :catch_up, FinchAPI::BooleanModel, nil?: true + + # @!attribute company_contribution + # Supported contribution types. An empty array indicates contributions are not + # supported. + # + # @return [Array, nil] + optional :company_contribution, + -> do + FinchAPI::ArrayOf[ + enum: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::CompanyContribution, nil?: true + ] + end, + nil?: true + + # @!attribute description + # + # @return [String, nil] + optional :description, String, nil?: true + + # @!attribute employee_deduction + # Supported deduction types. An empty array indicates deductions are not + # supported. + # + # @return [Array, nil] + optional :employee_deduction, + -> do + FinchAPI::ArrayOf[ + enum: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::EmployeeDeduction, nil?: true + ] + end, + nil?: true + + # @!attribute [r] frequencies + # The list of frequencies supported by the provider for this benefit + # + # @return [Array, nil] + optional :frequencies, + -> { FinchAPI::ArrayOf[enum: FinchAPI::Models::HRIS::BenefitFrequency, nil?: true] } + + # @!parse + # # @return [Array] + # attr_writer :frequencies + + # @!attribute hsa_contribution_limit + # Whether the provider supports HSA contribution limits. Empty if this feature is + # not supported for the benefit. This array only has values for HSA benefits. + # + # @return [Array, nil] + optional :hsa_contribution_limit, + -> do + FinchAPI::ArrayOf[ + enum: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::HsaContributionLimit, nil?: true + ] + end, + nil?: true + + # @!parse + # # @param annual_maximum [Boolean, nil] + # # @param catch_up [Boolean, nil] + # # @param company_contribution [Array, nil] + # # @param description [String, nil] + # # @param employee_deduction [Array, nil] + # # @param frequencies [Array] + # # @param hsa_contribution_limit [Array, nil] + # # + # def initialize( + # annual_maximum: nil, + # catch_up: nil, + # company_contribution: nil, + # description: nil, + # employee_deduction: nil, + # frequencies: nil, + # hsa_contribution_limit: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case company_contribution + # in :fixed + # # ... + # in :percent + # # ... + # end + # ``` + class CompanyContribution < FinchAPI::Enum + FIXED = :fixed + PERCENT = :percent + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @abstract + # + # @example + # ```ruby + # case employee_deduction + # in :fixed + # # ... + # in :percent + # # ... + # end + # ``` + class EmployeeDeduction < FinchAPI::Enum + FIXED = :fixed + PERCENT = :percent + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @abstract + # + # @example + # ```ruby + # case hsa_contribution_limit + # in :individual + # # ... + # in :family + # # ... + # end + # ``` + class HsaContributionLimit < FinchAPI::Enum + INDIVIDUAL = :individual + FAMILY = :family + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end + end +end diff --git a/lib/finch-api/models/hris/benefit_frequency.rb b/lib/finch-api/models/hris/benefit_frequency.rb new file mode 100644 index 00000000..4cc1d21b --- /dev/null +++ b/lib/finch-api/models/hris/benefit_frequency.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + # @abstract + # + # @example + # ```ruby + # case benefit_frequency + # in :one_time + # # ... + # in :every_paycheck + # # ... + # in :monthly + # # ... + # end + # ``` + class BenefitFrequency < FinchAPI::Enum + ONE_TIME = :one_time + EVERY_PAYCHECK = :every_paycheck + MONTHLY = :monthly + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end +end diff --git a/lib/finch-api/models/hris/benefit_list_params.rb b/lib/finch-api/models/hris/benefit_list_params.rb new file mode 100644 index 00000000..7e9b98bf --- /dev/null +++ b/lib/finch-api/models/hris/benefit_list_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + class BenefitListParams < FinchAPI::BaseModel + # @!parse + # extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + # @!parse + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end +end diff --git a/lib/finch-api/models/hris/benefit_list_supported_benefits_params.rb b/lib/finch-api/models/hris/benefit_list_supported_benefits_params.rb new file mode 100644 index 00000000..2420ca2b --- /dev/null +++ b/lib/finch-api/models/hris/benefit_list_supported_benefits_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + class BenefitListSupportedBenefitsParams < FinchAPI::BaseModel + # @!parse + # extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + # @!parse + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end +end diff --git a/lib/finch-api/models/hris/benefit_retrieve_params.rb b/lib/finch-api/models/hris/benefit_retrieve_params.rb new file mode 100644 index 00000000..ad4cf795 --- /dev/null +++ b/lib/finch-api/models/hris/benefit_retrieve_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + class BenefitRetrieveParams < FinchAPI::BaseModel + # @!parse + # extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + # @!parse + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end +end diff --git a/lib/finch-api/models/hris/benefit_type.rb b/lib/finch-api/models/hris/benefit_type.rb new file mode 100644 index 00000000..ca5830ef --- /dev/null +++ b/lib/finch-api/models/hris/benefit_type.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + # @abstract + # + # Type of benefit. + # + # @example + # ```ruby + # case benefit_type + # in :"401k" + # # ... + # in :"401k_roth" + # # ... + # in :"401k_loan" + # # ... + # in :"403b" + # # ... + # in :"403b_roth" + # # ... + # in ... + # #... + # end + # ``` + class BenefitType < FinchAPI::Enum + NUMBER_401K = :"401k" + NUMBER_401K_ROTH = :"401k_roth" + NUMBER_401K_LOAN = :"401k_loan" + NUMBER_403B = :"403b" + NUMBER_403B_ROTH = :"403b_roth" + NUMBER_457 = :"457" + NUMBER_457_ROTH = :"457_roth" + S125_MEDICAL = :s125_medical + S125_DENTAL = :s125_dental + S125_VISION = :s125_vision + HSA_PRE = :hsa_pre + HSA_POST = :hsa_post + FSA_MEDICAL = :fsa_medical + FSA_DEPENDENT_CARE = :fsa_dependent_care + SIMPLE_IRA = :simple_ira + SIMPLE = :simple + COMMUTER = :commuter + CUSTOM_POST_TAX = :custom_post_tax + CUSTOM_PRE_TAX = :custom_pre_tax + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end +end diff --git a/lib/finch-api/models/hris/benefit_update_params.rb b/lib/finch-api/models/hris/benefit_update_params.rb new file mode 100644 index 00000000..b6d58178 --- /dev/null +++ b/lib/finch-api/models/hris/benefit_update_params.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + class BenefitUpdateParams < FinchAPI::BaseModel + # @!parse + # extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + # @!attribute [r] description + # Updated name or description. + # + # @return [String, nil] + optional :description, String + + # @!parse + # # @return [String] + # attr_writer :description + + # @!parse + # # @param description [String] + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(description: nil, request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end +end diff --git a/lib/finch-api/models/hris/benefits/enrolled_individual.rb b/lib/finch-api/models/hris/benefits/enrolled_individual.rb new file mode 100644 index 00000000..e9f69a87 --- /dev/null +++ b/lib/finch-api/models/hris/benefits/enrolled_individual.rb @@ -0,0 +1,108 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + module Benefits + class EnrolledIndividual < FinchAPI::BaseModel + # @!attribute [r] body + # + # @return [FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Body, nil] + optional :body, -> { FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Body } + + # @!parse + # # @return [FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Body] + # attr_writer :body + + # @!attribute [r] code + # HTTP status code. Either 201 or 200 + # + # @return [Integer, FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Code, nil] + optional :code, enum: -> { FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Code } + + # @!parse + # # @return [Integer, FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Code] + # attr_writer :code + + # @!attribute [r] individual_id + # + # @return [String, nil] + optional :individual_id, String + + # @!parse + # # @return [String] + # attr_writer :individual_id + + # @!parse + # # @param body [FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Body] + # # @param code [Integer, FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Code] + # # @param individual_id [String] + # # + # def initialize(body: nil, code: nil, individual_id: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Body < FinchAPI::BaseModel + # @!attribute finch_code + # A descriptive identifier for the response + # + # @return [String, nil] + optional :finch_code, String, nil?: true + + # @!attribute message + # Short description in English that provides more information about the response. + # + # @return [String, nil] + optional :message, String, nil?: true + + # @!attribute name + # Identifier indicating whether the benefit was newly enrolled or updated. + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!parse + # # @param finch_code [String, nil] + # # @param message [String, nil] + # # @param name [String, nil] + # # + # def initialize(finch_code: nil, message: nil, name: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + # @abstract + # + # HTTP status code. Either 201 or 200 + # + # @example + # ```ruby + # case code + # in 200 + # # ... + # in 201 + # # ... + # in 404 + # # ... + # in 403 + # # ... + # end + # ``` + class Code < FinchAPI::Enum + OK = 200 + CREATED = 201 + NOT_FOUND = 404 + FORBIDDEN = 403 + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end + end +end diff --git a/lib/finch-api/models/hris/benefits/individual_benefit.rb b/lib/finch-api/models/hris/benefits/individual_benefit.rb new file mode 100644 index 00000000..399c4c50 --- /dev/null +++ b/lib/finch-api/models/hris/benefits/individual_benefit.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + module Benefits + class IndividualBenefit < FinchAPI::BaseModel + # @!attribute [r] body + # + # @return [FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body, nil] + optional :body, -> { FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body } + + # @!parse + # # @return [FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body] + # attr_writer :body + + # @!attribute [r] code + # + # @return [Integer, nil] + optional :code, Integer + + # @!parse + # # @return [Integer] + # attr_writer :code + + # @!attribute [r] individual_id + # + # @return [String, nil] + optional :individual_id, String + + # @!parse + # # @return [String] + # attr_writer :individual_id + + # @!parse + # # @param body [FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body] + # # @param code [Integer] + # # @param individual_id [String] + # # + # def initialize(body: nil, code: nil, individual_id: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Body < FinchAPI::BaseModel + # @!attribute annual_maximum + # If the benefit supports annual maximum, the amount in cents for this individual. + # + # @return [Integer, nil] + optional :annual_maximum, Integer, nil?: true + + # @!attribute catch_up + # If the benefit supports catch up (401k, 403b, etc.), whether catch up is enabled + # for this individual. + # + # @return [Boolean, nil] + optional :catch_up, FinchAPI::BooleanModel, nil?: true + + # @!attribute company_contribution + # + # @return [FinchAPI::Models::HRIS::BenefitContribution, nil] + optional :company_contribution, -> { FinchAPI::Models::HRIS::BenefitContribution }, nil?: true + + # @!attribute employee_deduction + # + # @return [FinchAPI::Models::HRIS::BenefitContribution, nil] + optional :employee_deduction, -> { FinchAPI::Models::HRIS::BenefitContribution }, nil?: true + + # @!attribute hsa_contribution_limit + # Type for HSA contribution limit if the benefit is a HSA. + # + # @return [Symbol, FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::HsaContributionLimit, nil] + optional :hsa_contribution_limit, + enum: -> { FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::HsaContributionLimit }, + nil?: true + + # @!parse + # # @param annual_maximum [Integer, nil] + # # @param catch_up [Boolean, nil] + # # @param company_contribution [FinchAPI::Models::HRIS::BenefitContribution, nil] + # # @param employee_deduction [FinchAPI::Models::HRIS::BenefitContribution, nil] + # # @param hsa_contribution_limit [Symbol, FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::HsaContributionLimit, nil] + # # + # def initialize( + # annual_maximum: nil, + # catch_up: nil, + # company_contribution: nil, + # employee_deduction: nil, + # hsa_contribution_limit: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # Type for HSA contribution limit if the benefit is a HSA. + # + # @example + # ```ruby + # case hsa_contribution_limit + # in :individual + # # ... + # in :family + # # ... + # end + # ``` + class HsaContributionLimit < FinchAPI::Enum + INDIVIDUAL = :individual + FAMILY = :family + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end + + IndividualBenefit = Benefits::IndividualBenefit + end + end +end diff --git a/lib/finch-api/models/hris/benefits/individual_enroll_many_params.rb b/lib/finch-api/models/hris/benefits/individual_enroll_many_params.rb new file mode 100644 index 00000000..2c910c6f --- /dev/null +++ b/lib/finch-api/models/hris/benefits/individual_enroll_many_params.rb @@ -0,0 +1,268 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + module Benefits + class IndividualEnrollManyParams < FinchAPI::BaseModel + # @!parse + # extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + # @!attribute [r] individuals + # Array of the individual_id to enroll and a configuration object. + # + # @return [Array, nil] + optional :individuals, + -> { FinchAPI::ArrayOf[FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual] } + + # @!parse + # # @return [Array] + # attr_writer :individuals + + # @!parse + # # @param individuals [Array] + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(individuals: nil, request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Individual < FinchAPI::BaseModel + # @!attribute [r] configuration + # + # @return [FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration, nil] + optional :configuration, + -> { FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration } + + # @!parse + # # @return [FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration] + # attr_writer :configuration + + # @!attribute [r] individual_id + # Finch id (uuidv4) for the individual to enroll + # + # @return [String, nil] + optional :individual_id, String + + # @!parse + # # @return [String] + # attr_writer :individual_id + + # @!parse + # # @param configuration [FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration] + # # @param individual_id [String] + # # + # def initialize(configuration: nil, individual_id: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Configuration < FinchAPI::BaseModel + # @!attribute [r] annual_contribution_limit + # For HSA benefits only - whether the contribution limit is for an individual or + # family + # + # @return [Symbol, FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::AnnualContributionLimit, nil] + optional :annual_contribution_limit, + enum: -> { FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::AnnualContributionLimit } + + # @!parse + # # @return [Symbol, FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::AnnualContributionLimit] + # attr_writer :annual_contribution_limit + + # @!attribute annual_maximum + # Maximum annual amount in cents + # + # @return [Integer, nil] + optional :annual_maximum, Integer, nil?: true + + # @!attribute [r] catch_up + # For retirement benefits only - whether catch up contributions are enabled + # + # @return [Boolean, nil] + optional :catch_up, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :catch_up + + # @!attribute [r] company_contribution + # + # @return [FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution, nil] + optional :company_contribution, + -> { FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution } + + # @!parse + # # @return [FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution] + # attr_writer :company_contribution + + # @!attribute [r] employee_deduction + # + # @return [FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction, nil] + optional :employee_deduction, + -> { FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction } + + # @!parse + # # @return [FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction] + # attr_writer :employee_deduction + + # @!parse + # # @param annual_contribution_limit [Symbol, FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::AnnualContributionLimit] + # # @param annual_maximum [Integer, nil] + # # @param catch_up [Boolean] + # # @param company_contribution [FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution] + # # @param employee_deduction [FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction] + # # + # def initialize( + # annual_contribution_limit: nil, + # annual_maximum: nil, + # catch_up: nil, + # company_contribution: nil, + # employee_deduction: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # For HSA benefits only - whether the contribution limit is for an individual or + # family + # + # @example + # ```ruby + # case annual_contribution_limit + # in :individual + # # ... + # in :family + # # ... + # end + # ``` + class AnnualContributionLimit < FinchAPI::Enum + INDIVIDUAL = :individual + FAMILY = :family + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + class CompanyContribution < FinchAPI::BaseModel + # @!attribute [r] amount + # Amount in cents for fixed type or basis points (1/100th of a percent) for + # percent type + # + # @return [Integer, nil] + optional :amount, Integer + + # @!parse + # # @return [Integer] + # attr_writer :amount + + # @!attribute [r] type + # + # @return [Symbol, FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution::Type, nil] + optional :type, + enum: -> { FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution::Type } + + # @!parse + # # @return [Symbol, FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution::Type] + # attr_writer :type + + # @!parse + # # @param amount [Integer] + # # @param type [Symbol, FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution::Type] + # # + # def initialize(amount: nil, type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case type + # in :fixed + # # ... + # in :percent + # # ... + # end + # ``` + class Type < FinchAPI::Enum + FIXED = :fixed + PERCENT = :percent + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + class EmployeeDeduction < FinchAPI::BaseModel + # @!attribute [r] amount + # Amount in cents for fixed type or basis points (1/100th of a percent) for + # percent type + # + # @return [Integer, nil] + optional :amount, Integer + + # @!parse + # # @return [Integer] + # attr_writer :amount + + # @!attribute [r] type + # + # @return [Symbol, FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction::Type, nil] + optional :type, + enum: -> { FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction::Type } + + # @!parse + # # @return [Symbol, FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction::Type] + # attr_writer :type + + # @!parse + # # @param amount [Integer] + # # @param type [Symbol, FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction::Type] + # # + # def initialize(amount: nil, type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case type + # in :fixed + # # ... + # in :percent + # # ... + # end + # ``` + class Type < FinchAPI::Enum + FIXED = :fixed + PERCENT = :percent + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end + end + end + end + end +end diff --git a/lib/finch-api/models/hris/benefits/individual_enrolled_ids_params.rb b/lib/finch-api/models/hris/benefits/individual_enrolled_ids_params.rb new file mode 100644 index 00000000..52252fc6 --- /dev/null +++ b/lib/finch-api/models/hris/benefits/individual_enrolled_ids_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + module Benefits + class IndividualEnrolledIDsParams < FinchAPI::BaseModel + # @!parse + # extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + # @!parse + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end + end +end diff --git a/lib/finch-api/models/hris/benefits/individual_enrolled_ids_response.rb b/lib/finch-api/models/hris/benefits/individual_enrolled_ids_response.rb new file mode 100644 index 00000000..dbe284bd --- /dev/null +++ b/lib/finch-api/models/hris/benefits/individual_enrolled_ids_response.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + module Benefits + class IndividualEnrolledIDsResponse < FinchAPI::BaseModel + # @!attribute benefit_id + # + # @return [String] + required :benefit_id, String + + # @!attribute individual_ids + # + # @return [Array] + required :individual_ids, FinchAPI::ArrayOf[String] + + # @!parse + # # @param benefit_id [String] + # # @param individual_ids [Array] + # # + # def initialize(benefit_id:, individual_ids:, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end + end +end diff --git a/lib/finch-api/models/hris/benefits/individual_retrieve_many_benefits_params.rb b/lib/finch-api/models/hris/benefits/individual_retrieve_many_benefits_params.rb new file mode 100644 index 00000000..28085efa --- /dev/null +++ b/lib/finch-api/models/hris/benefits/individual_retrieve_many_benefits_params.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + module Benefits + class IndividualRetrieveManyBenefitsParams < FinchAPI::BaseModel + # @!parse + # extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + # @!attribute [r] individual_ids + # comma-delimited list of stable Finch uuids for each individual. If empty, + # defaults to all individuals + # + # @return [String, nil] + optional :individual_ids, String + + # @!parse + # # @return [String] + # attr_writer :individual_ids + + # @!parse + # # @param individual_ids [String] + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(individual_ids: nil, request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end + end +end diff --git a/lib/finch-api/models/hris/benefits/individual_unenroll_many_params.rb b/lib/finch-api/models/hris/benefits/individual_unenroll_many_params.rb new file mode 100644 index 00000000..65d1a47c --- /dev/null +++ b/lib/finch-api/models/hris/benefits/individual_unenroll_many_params.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + module Benefits + class IndividualUnenrollManyParams < FinchAPI::BaseModel + # @!parse + # extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + # @!attribute [r] individual_ids + # Array of individual_ids to unenroll. + # + # @return [Array, nil] + optional :individual_ids, FinchAPI::ArrayOf[String] + + # @!parse + # # @return [Array] + # attr_writer :individual_ids + + # @!parse + # # @param individual_ids [Array] + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(individual_ids: nil, request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end + end +end diff --git a/lib/finch-api/models/hris/benefits/unenrolled_individual.rb b/lib/finch-api/models/hris/benefits/unenrolled_individual.rb new file mode 100644 index 00000000..569be98a --- /dev/null +++ b/lib/finch-api/models/hris/benefits/unenrolled_individual.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + module Benefits + class UnenrolledIndividual < FinchAPI::BaseModel + # @!attribute [r] body + # + # @return [FinchAPI::Models::HRIS::Benefits::UnenrolledIndividual::Body, nil] + optional :body, -> { FinchAPI::Models::HRIS::Benefits::UnenrolledIndividual::Body } + + # @!parse + # # @return [FinchAPI::Models::HRIS::Benefits::UnenrolledIndividual::Body] + # attr_writer :body + + # @!attribute [r] code + # HTTP status code + # + # @return [Integer, nil] + optional :code, Integer + + # @!parse + # # @return [Integer] + # attr_writer :code + + # @!attribute [r] individual_id + # + # @return [String, nil] + optional :individual_id, String + + # @!parse + # # @return [String] + # attr_writer :individual_id + + # @!parse + # # @param body [FinchAPI::Models::HRIS::Benefits::UnenrolledIndividual::Body] + # # @param code [Integer] + # # @param individual_id [String] + # # + # def initialize(body: nil, code: nil, individual_id: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Body < FinchAPI::BaseModel + # @!attribute finch_code + # A descriptive identifier for the response. + # + # @return [String, nil] + optional :finch_code, String, nil?: true + + # @!attribute message + # Short description in English that provides more information about the response. + # + # @return [String, nil] + optional :message, String, nil?: true + + # @!attribute name + # Identifier indicating whether the benefit was newly enrolled or updated. + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!parse + # # @param finch_code [String, nil] + # # @param message [String, nil] + # # @param name [String, nil] + # # + # def initialize(finch_code: nil, message: nil, name: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end + end + end +end diff --git a/lib/finch-api/models/hris/benefits_support.rb b/lib/finch-api/models/hris/benefits_support.rb new file mode 100644 index 00000000..a7770d06 --- /dev/null +++ b/lib/finch-api/models/hris/benefits_support.rb @@ -0,0 +1,106 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + class BenefitsSupport < FinchAPI::BaseModel + # @!attribute commuter + # + # @return [FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, nil] + optional :commuter, -> { FinchAPI::Models::HRIS::BenefitFeaturesAndOperations }, nil?: true + + # @!attribute custom_post_tax + # + # @return [FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, nil] + optional :custom_post_tax, -> { FinchAPI::Models::HRIS::BenefitFeaturesAndOperations }, nil?: true + + # @!attribute custom_pre_tax + # + # @return [FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, nil] + optional :custom_pre_tax, -> { FinchAPI::Models::HRIS::BenefitFeaturesAndOperations }, nil?: true + + # @!attribute fsa_dependent_care + # + # @return [FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, nil] + optional :fsa_dependent_care, -> { FinchAPI::Models::HRIS::BenefitFeaturesAndOperations }, nil?: true + + # @!attribute fsa_medical + # + # @return [FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, nil] + optional :fsa_medical, -> { FinchAPI::Models::HRIS::BenefitFeaturesAndOperations }, nil?: true + + # @!attribute hsa_post + # + # @return [FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, nil] + optional :hsa_post, -> { FinchAPI::Models::HRIS::BenefitFeaturesAndOperations }, nil?: true + + # @!attribute hsa_pre + # + # @return [FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, nil] + optional :hsa_pre, -> { FinchAPI::Models::HRIS::BenefitFeaturesAndOperations }, nil?: true + + # @!attribute s125_dental + # + # @return [FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, nil] + optional :s125_dental, -> { FinchAPI::Models::HRIS::BenefitFeaturesAndOperations }, nil?: true + + # @!attribute s125_medical + # + # @return [FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, nil] + optional :s125_medical, -> { FinchAPI::Models::HRIS::BenefitFeaturesAndOperations }, nil?: true + + # @!attribute s125_vision + # + # @return [FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, nil] + optional :s125_vision, -> { FinchAPI::Models::HRIS::BenefitFeaturesAndOperations }, nil?: true + + # @!attribute simple + # + # @return [FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, nil] + optional :simple, -> { FinchAPI::Models::HRIS::BenefitFeaturesAndOperations }, nil?: true + + # @!attribute simple_ira + # + # @return [FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, nil] + optional :simple_ira, -> { FinchAPI::Models::HRIS::BenefitFeaturesAndOperations }, nil?: true + + # @!parse + # # Each benefit type and their supported features. If the benefit type is not + # # supported, the property will be null + # # + # # @param commuter [FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, nil] + # # @param custom_post_tax [FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, nil] + # # @param custom_pre_tax [FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, nil] + # # @param fsa_dependent_care [FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, nil] + # # @param fsa_medical [FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, nil] + # # @param hsa_post [FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, nil] + # # @param hsa_pre [FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, nil] + # # @param s125_dental [FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, nil] + # # @param s125_medical [FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, nil] + # # @param s125_vision [FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, nil] + # # @param simple [FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, nil] + # # @param simple_ira [FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, nil] + # # + # def initialize( + # commuter: nil, + # custom_post_tax: nil, + # custom_pre_tax: nil, + # fsa_dependent_care: nil, + # fsa_medical: nil, + # hsa_post: nil, + # hsa_pre: nil, + # s125_dental: nil, + # s125_medical: nil, + # s125_vision: nil, + # simple: nil, + # simple_ira: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end +end diff --git a/lib/finch-api/models/hris/benfit_contribution.rb b/lib/finch-api/models/hris/benfit_contribution.rb new file mode 100644 index 00000000..3671bf54 --- /dev/null +++ b/lib/finch-api/models/hris/benfit_contribution.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + BenfitContribution = FinchAPI::Models::HRIS::BenefitContribution + end + end +end diff --git a/lib/finch-api/models/hris/company.rb b/lib/finch-api/models/hris/company.rb new file mode 100644 index 00000000..9eb638c2 --- /dev/null +++ b/lib/finch-api/models/hris/company.rb @@ -0,0 +1,290 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + class HRISCompany < FinchAPI::BaseModel + # @!attribute id + # A stable Finch `id` (UUID v4) for the company. + # + # @return [String] + required :id, String + + # @!attribute accounts + # An array of bank account objects associated with the payroll/HRIS system. + # + # @return [Array, nil] + required :accounts, -> { FinchAPI::ArrayOf[FinchAPI::Models::HRIS::HRISCompany::Account] }, nil?: true + + # @!attribute departments + # The array of company departments. + # + # @return [Array, nil] + required :departments, + -> { FinchAPI::ArrayOf[FinchAPI::Models::HRIS::HRISCompany::Department, nil?: true] }, + nil?: true + + # @!attribute ein + # The employer identification number. + # + # @return [String, nil] + required :ein, String, nil?: true + + # @!attribute entity + # The entity type object. + # + # @return [FinchAPI::Models::HRIS::HRISCompany::Entity, nil] + required :entity, -> { FinchAPI::Models::HRIS::HRISCompany::Entity }, nil?: true + + # @!attribute legal_name + # The legal name of the company. + # + # @return [String, nil] + required :legal_name, String, nil?: true + + # @!attribute locations + # + # @return [Array, nil] + required :locations, -> { FinchAPI::ArrayOf[FinchAPI::Models::Location, nil?: true] }, nil?: true + + # @!attribute primary_email + # The email of the main administrator on the account. + # + # @return [String, nil] + required :primary_email, String, nil?: true + + # @!attribute primary_phone_number + # The phone number of the main administrator on the account. Format: `XXXXXXXXXX` + # + # @return [String, nil] + required :primary_phone_number, String, nil?: true + + # @!parse + # # @param id [String] + # # @param accounts [Array, nil] + # # @param departments [Array, nil] + # # @param ein [String, nil] + # # @param entity [FinchAPI::Models::HRIS::HRISCompany::Entity, nil] + # # @param legal_name [String, nil] + # # @param locations [Array, nil] + # # @param primary_email [String, nil] + # # @param primary_phone_number [String, nil] + # # + # def initialize( + # id:, + # accounts:, + # departments:, + # ein:, + # entity:, + # legal_name:, + # locations:, + # primary_email:, + # primary_phone_number:, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Account < FinchAPI::BaseModel + # @!attribute account_name + # The name of the bank associated in the payroll/HRIS system. + # + # @return [String, nil] + optional :account_name, String, nil?: true + + # @!attribute account_number + # 10-12 digit number to specify the bank account + # + # @return [String, nil] + optional :account_number, String, nil?: true + + # @!attribute account_type + # The type of bank account. + # + # @return [Symbol, FinchAPI::Models::HRIS::HRISCompany::Account::AccountType, nil] + optional :account_type, enum: -> { FinchAPI::Models::HRIS::HRISCompany::Account::AccountType }, nil?: true + + # @!attribute institution_name + # Name of the banking institution. + # + # @return [String, nil] + optional :institution_name, String, nil?: true + + # @!attribute routing_number + # A nine-digit code that's based on the U.S. Bank location where your account was + # opened. + # + # @return [String, nil] + optional :routing_number, String, nil?: true + + # @!parse + # # @param account_name [String, nil] + # # @param account_number [String, nil] + # # @param account_type [Symbol, FinchAPI::Models::HRIS::HRISCompany::Account::AccountType, nil] + # # @param institution_name [String, nil] + # # @param routing_number [String, nil] + # # + # def initialize(account_name: nil, account_number: nil, account_type: nil, institution_name: nil, routing_number: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # The type of bank account. + # + # @example + # ```ruby + # case account_type + # in :checking + # # ... + # in :savings + # # ... + # end + # ``` + class AccountType < FinchAPI::Enum + CHECKING = :checking + SAVINGS = :savings + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + class Department < FinchAPI::BaseModel + # @!attribute name + # The department name. + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute parent + # The parent department, if present. + # + # @return [FinchAPI::Models::HRIS::HRISCompany::Department::Parent, nil] + optional :parent, -> { FinchAPI::Models::HRIS::HRISCompany::Department::Parent }, nil?: true + + # @!parse + # # @param name [String, nil] + # # @param parent [FinchAPI::Models::HRIS::HRISCompany::Department::Parent, nil] + # # + # def initialize(name: nil, parent: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Parent < FinchAPI::BaseModel + # @!attribute name + # The parent department's name. + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!parse + # # The parent department, if present. + # # + # # @param name [String, nil] + # # + # def initialize(name: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + + class Entity < FinchAPI::BaseModel + # @!attribute subtype + # The tax payer subtype of the company. + # + # @return [Symbol, FinchAPI::Models::HRIS::HRISCompany::Entity::Subtype, nil] + optional :subtype, enum: -> { FinchAPI::Models::HRIS::HRISCompany::Entity::Subtype }, nil?: true + + # @!attribute type + # The tax payer type of the company. + # + # @return [Symbol, FinchAPI::Models::HRIS::HRISCompany::Entity::Type, nil] + optional :type, enum: -> { FinchAPI::Models::HRIS::HRISCompany::Entity::Type }, nil?: true + + # @!parse + # # The entity type object. + # # + # # @param subtype [Symbol, FinchAPI::Models::HRIS::HRISCompany::Entity::Subtype, nil] + # # @param type [Symbol, FinchAPI::Models::HRIS::HRISCompany::Entity::Type, nil] + # # + # def initialize(subtype: nil, type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # The tax payer subtype of the company. + # + # @example + # ```ruby + # case subtype + # in :s_corporation + # # ... + # in :c_corporation + # # ... + # in :b_corporation + # # ... + # end + # ``` + class Subtype < FinchAPI::Enum + S_CORPORATION = :s_corporation + C_CORPORATION = :c_corporation + B_CORPORATION = :b_corporation + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @abstract + # + # The tax payer type of the company. + # + # @example + # ```ruby + # case type + # in :llc + # # ... + # in :lp + # # ... + # in :corporation + # # ... + # in :sole_proprietor + # # ... + # in :non_profit + # # ... + # in ... + # #... + # end + # ``` + class Type < FinchAPI::Enum + LLC = :llc + LP = :lp + CORPORATION = :corporation + SOLE_PROPRIETOR = :sole_proprietor + NON_PROFIT = :non_profit + PARTNERSHIP = :partnership + COOPERATIVE = :cooperative + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end + end +end diff --git a/lib/finch-api/models/hris/company_benefit.rb b/lib/finch-api/models/hris/company_benefit.rb new file mode 100644 index 00000000..b92f2879 --- /dev/null +++ b/lib/finch-api/models/hris/company_benefit.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + class CompanyBenefit < FinchAPI::BaseModel + # @!attribute benefit_id + # + # @return [String] + required :benefit_id, String + + # @!attribute description + # + # @return [String, nil] + required :description, String, nil?: true + + # @!attribute frequency + # + # @return [Symbol, FinchAPI::Models::HRIS::BenefitFrequency, nil] + required :frequency, enum: -> { FinchAPI::Models::HRIS::BenefitFrequency }, nil?: true + + # @!attribute type + # Type of benefit. + # + # @return [Symbol, FinchAPI::Models::HRIS::BenefitType, nil] + required :type, enum: -> { FinchAPI::Models::HRIS::BenefitType }, nil?: true + + # @!parse + # # @param benefit_id [String] + # # @param description [String, nil] + # # @param frequency [Symbol, FinchAPI::Models::HRIS::BenefitFrequency, nil] + # # @param type [Symbol, FinchAPI::Models::HRIS::BenefitType, nil] + # # + # def initialize(benefit_id:, description:, frequency:, type:, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end +end diff --git a/lib/finch-api/models/hris/company_retrieve_params.rb b/lib/finch-api/models/hris/company_retrieve_params.rb new file mode 100644 index 00000000..df644b1c --- /dev/null +++ b/lib/finch-api/models/hris/company_retrieve_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + class CompanyRetrieveParams < FinchAPI::BaseModel + # @!parse + # extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + # @!parse + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end +end diff --git a/lib/finch-api/models/hris/create_company_benefits_response.rb b/lib/finch-api/models/hris/create_company_benefits_response.rb new file mode 100644 index 00000000..925680b9 --- /dev/null +++ b/lib/finch-api/models/hris/create_company_benefits_response.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + class CreateCompanyBenefitsResponse < FinchAPI::BaseModel + # @!attribute benefit_id + # + # @return [String] + required :benefit_id, String + + # @!parse + # # @param benefit_id [String] + # # + # def initialize(benefit_id:, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end +end diff --git a/lib/finch-api/models/hris/directory_list_individuals_params.rb b/lib/finch-api/models/hris/directory_list_individuals_params.rb new file mode 100644 index 00000000..49883a9e --- /dev/null +++ b/lib/finch-api/models/hris/directory_list_individuals_params.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + class DirectoryListIndividualsParams < FinchAPI::BaseModel + # @!parse + # extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + # @!attribute [r] limit + # Number of employees to return (defaults to all) + # + # @return [Integer, nil] + optional :limit, Integer + + # @!parse + # # @return [Integer] + # attr_writer :limit + + # @!attribute [r] offset + # Index to start from (defaults to 0) + # + # @return [Integer, nil] + optional :offset, Integer + + # @!parse + # # @return [Integer] + # attr_writer :offset + + # @!parse + # # @param limit [Integer] + # # @param offset [Integer] + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(limit: nil, offset: nil, request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end +end diff --git a/lib/finch-api/models/hris/directory_list_params.rb b/lib/finch-api/models/hris/directory_list_params.rb new file mode 100644 index 00000000..f6c5353b --- /dev/null +++ b/lib/finch-api/models/hris/directory_list_params.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + class DirectoryListParams < FinchAPI::BaseModel + # @!parse + # extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + # @!attribute [r] limit + # Number of employees to return (defaults to all) + # + # @return [Integer, nil] + optional :limit, Integer + + # @!parse + # # @return [Integer] + # attr_writer :limit + + # @!attribute [r] offset + # Index to start from (defaults to 0) + # + # @return [Integer, nil] + optional :offset, Integer + + # @!parse + # # @return [Integer] + # attr_writer :offset + + # @!parse + # # @param limit [Integer] + # # @param offset [Integer] + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(limit: nil, offset: nil, request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end +end diff --git a/lib/finch-api/models/hris/document_list_params.rb b/lib/finch-api/models/hris/document_list_params.rb new file mode 100644 index 00000000..31186fbd --- /dev/null +++ b/lib/finch-api/models/hris/document_list_params.rb @@ -0,0 +1,89 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + class DocumentListParams < FinchAPI::BaseModel + # @!parse + # extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + # @!attribute [r] individual_ids + # Comma-delimited list of stable Finch uuids for each individual. If empty, + # defaults to all individuals + # + # @return [Array, nil] + optional :individual_ids, FinchAPI::ArrayOf[String] + + # @!parse + # # @return [Array] + # attr_writer :individual_ids + + # @!attribute [r] limit + # Number of documents to return (defaults to all) + # + # @return [Integer, nil] + optional :limit, Integer + + # @!parse + # # @return [Integer] + # attr_writer :limit + + # @!attribute [r] offset + # Index to start from (defaults to 0) + # + # @return [Integer, nil] + optional :offset, Integer + + # @!parse + # # @return [Integer] + # attr_writer :offset + + # @!attribute [r] types + # Comma-delimited list of document types to filter on. If empty, defaults to all + # types + # + # @return [Array, nil] + optional :types, -> { FinchAPI::ArrayOf[enum: FinchAPI::Models::HRIS::DocumentListParams::Type] } + + # @!parse + # # @return [Array] + # attr_writer :types + + # @!parse + # # @param individual_ids [Array] + # # @param limit [Integer] + # # @param offset [Integer] + # # @param types [Array] + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(individual_ids: nil, limit: nil, offset: nil, types: nil, request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case type + # in :w4_2020 + # # ... + # in :w4_2005 + # # ... + # end + # ``` + class Type < FinchAPI::Enum + W4_2020 = :w4_2020 + W4_2005 = :w4_2005 + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end +end diff --git a/lib/finch-api/models/hris/document_list_response.rb b/lib/finch-api/models/hris/document_list_response.rb new file mode 100644 index 00000000..9394c263 --- /dev/null +++ b/lib/finch-api/models/hris/document_list_response.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + class DocumentListResponse < FinchAPI::BaseModel + # @!attribute documents + # + # @return [Array] + required :documents, -> { FinchAPI::ArrayOf[FinchAPI::Models::HRIS::DocumentResponse] } + + # @!attribute paging + # + # @return [FinchAPI::Models::Paging] + required :paging, -> { FinchAPI::Models::Paging } + + # @!parse + # # @param documents [Array] + # # @param paging [FinchAPI::Models::Paging] + # # + # def initialize(documents:, paging:, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end +end diff --git a/lib/finch-api/models/hris/document_response.rb b/lib/finch-api/models/hris/document_response.rb new file mode 100644 index 00000000..78f9739b --- /dev/null +++ b/lib/finch-api/models/hris/document_response.rb @@ -0,0 +1,89 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + class DocumentResponse < FinchAPI::BaseModel + # @!attribute [r] id + # A stable Finch id for the document. + # + # @return [String, nil] + optional :id, String + + # @!parse + # # @return [String] + # attr_writer :id + + # @!attribute individual_id + # The ID of the individual associated with the document. This will be null for + # employer-level documents. + # + # @return [String, nil] + optional :individual_id, String, nil?: true + + # @!attribute [r] type + # The type of document. + # + # @return [Symbol, FinchAPI::Models::HRIS::DocumentResponse::Type, nil] + optional :type, enum: -> { FinchAPI::Models::HRIS::DocumentResponse::Type } + + # @!parse + # # @return [Symbol, FinchAPI::Models::HRIS::DocumentResponse::Type] + # attr_writer :type + + # @!attribute [r] url + # A URL to access the document. Format: + # `https://api.tryfinch.com/employer/documents/:document_id`. + # + # @return [String, nil] + optional :url, String + + # @!parse + # # @return [String] + # attr_writer :url + + # @!attribute year + # The year the document applies to, if available. + # + # @return [Float, nil] + optional :year, Float, nil?: true + + # @!parse + # # @param id [String] + # # @param individual_id [String, nil] + # # @param type [Symbol, FinchAPI::Models::HRIS::DocumentResponse::Type] + # # @param url [String] + # # @param year [Float, nil] + # # + # def initialize(id: nil, individual_id: nil, type: nil, url: nil, year: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # The type of document. + # + # @example + # ```ruby + # case type + # in :w4_2020 + # # ... + # in :w4_2005 + # # ... + # end + # ``` + class Type < FinchAPI::Enum + W4_2020 = :w4_2020 + W4_2005 = :w4_2005 + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end +end diff --git a/lib/finch-api/models/hris/document_retreive_params.rb b/lib/finch-api/models/hris/document_retreive_params.rb new file mode 100644 index 00000000..b84c305d --- /dev/null +++ b/lib/finch-api/models/hris/document_retreive_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + class DocumentRetreiveParams < FinchAPI::BaseModel + # @!parse + # extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + # @!parse + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end +end diff --git a/lib/finch-api/models/hris/document_retreive_response.rb b/lib/finch-api/models/hris/document_retreive_response.rb new file mode 100644 index 00000000..dc47ccf2 --- /dev/null +++ b/lib/finch-api/models/hris/document_retreive_response.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + # @abstract + # + # A 2020 version of the W-4 tax form containing information on an individual's + # filing status, dependents, and withholding details. + # + # @example + # ```ruby + # case document_retreive_response + # in {type: "w4_2020", data: FinchAPI::Models::HRIS::W42020::Data, year: Float} + # # FinchAPI::Models::HRIS::W42020 ... + # in {type: "w4_2005", data: FinchAPI::Models::HRIS::W42005::Data, year: Float} + # # FinchAPI::Models::HRIS::W42005 ... + # end + # ``` + # + # @example + # ```ruby + # case document_retreive_response + # in FinchAPI::Models::HRIS::W42020 + # # ... + # in FinchAPI::Models::HRIS::W42005 + # # ... + # end + # ``` + class DocumentRetreiveResponse < FinchAPI::Union + discriminator :type + + # A 2020 version of the W-4 tax form containing information on an individual's filing status, dependents, and withholding details. + variant :w4_2020, -> { FinchAPI::Models::HRIS::W42020 } + + # A 2005 version of the W-4 tax form containing information on an individual's filing status, dependents, and withholding details. + variant :w4_2005, -> { FinchAPI::Models::HRIS::W42005 } + end + end + end +end diff --git a/lib/finch-api/models/hris/employment_data.rb b/lib/finch-api/models/hris/employment_data.rb new file mode 100644 index 00000000..a1bfd120 --- /dev/null +++ b/lib/finch-api/models/hris/employment_data.rb @@ -0,0 +1,380 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + class EmploymentData < FinchAPI::BaseModel + # @!attribute [r] id + # string A stable Finch `id` (UUID v4) for an individual in the company. + # + # @return [String, nil] + optional :id, String + + # @!parse + # # @return [String] + # attr_writer :id + + # @!attribute class_code + # Worker's compensation classification code for this employee + # + # @return [String, nil] + optional :class_code, String, nil?: true + + # @!attribute custom_fields + # Custom fields for the individual. These are fields which are defined by the + # employer in the system. + # + # @return [Array, nil] + optional :custom_fields, + -> { FinchAPI::ArrayOf[FinchAPI::Models::HRIS::EmploymentData::CustomField] }, + nil?: true + + # @!attribute department + # The department object. + # + # @return [FinchAPI::Models::HRIS::EmploymentData::Department, nil] + optional :department, -> { FinchAPI::Models::HRIS::EmploymentData::Department }, nil?: true + + # @!attribute employment + # The employment object. + # + # @return [FinchAPI::Models::HRIS::EmploymentData::Employment, nil] + optional :employment, -> { FinchAPI::Models::HRIS::EmploymentData::Employment }, nil?: true + + # @!attribute employment_status + # The detailed employment status of the individual. Available options: `active`, + # `deceased`, `leave`, `onboarding`, `prehire`, `retired`, `terminated`. + # + # @return [Symbol, FinchAPI::Models::HRIS::EmploymentData::EmploymentStatus, nil] + optional :employment_status, + enum: -> { FinchAPI::Models::HRIS::EmploymentData::EmploymentStatus }, + nil?: true + + # @!attribute end_date + # + # @return [String, nil] + optional :end_date, String, nil?: true + + # @!attribute first_name + # The legal first name of the individual. + # + # @return [String, nil] + optional :first_name, String, nil?: true + + # @!attribute income + # 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. + # + # @return [FinchAPI::Models::Income, nil] + optional :income, -> { FinchAPI::Models::Income }, nil?: true + + # @!attribute income_history + # The array of income history. + # + # @return [Array, nil] + optional :income_history, -> { FinchAPI::ArrayOf[FinchAPI::Models::Income, nil?: true] }, nil?: true + + # @!attribute is_active + # `true` if the individual an an active employee or contractor at the company. + # + # @return [Boolean, nil] + optional :is_active, FinchAPI::BooleanModel, nil?: true + + # @!attribute last_name + # The legal last name of the individual. + # + # @return [String, nil] + optional :last_name, String, nil?: true + + # @!attribute latest_rehire_date + # + # @return [String, nil] + optional :latest_rehire_date, String, nil?: true + + # @!attribute location + # + # @return [FinchAPI::Models::Location, nil] + optional :location, -> { FinchAPI::Models::Location }, nil?: true + + # @!attribute manager + # The manager object representing the manager of the individual within the org. + # + # @return [FinchAPI::Models::HRIS::EmploymentData::Manager, nil] + optional :manager, -> { FinchAPI::Models::HRIS::EmploymentData::Manager }, nil?: true + + # @!attribute middle_name + # The legal middle name of the individual. + # + # @return [String, nil] + optional :middle_name, String, nil?: true + + # @!attribute source_id + # The source system's unique employment identifier for this individual + # + # @return [String, nil] + optional :source_id, String, nil?: true + + # @!attribute start_date + # + # @return [String, nil] + optional :start_date, String, nil?: true + + # @!attribute title + # The current title of the individual. + # + # @return [String, nil] + optional :title, String, nil?: true + + # @!attribute work_id + # This field is deprecated in favour of `source_id` + # + # @return [String, nil] + optional :work_id, String, nil?: true + + # @!parse + # # @param id [String] + # # @param class_code [String, nil] + # # @param custom_fields [Array, nil] + # # @param department [FinchAPI::Models::HRIS::EmploymentData::Department, nil] + # # @param employment [FinchAPI::Models::HRIS::EmploymentData::Employment, nil] + # # @param employment_status [Symbol, FinchAPI::Models::HRIS::EmploymentData::EmploymentStatus, nil] + # # @param end_date [String, nil] + # # @param first_name [String, nil] + # # @param income [FinchAPI::Models::Income, nil] + # # @param income_history [Array, nil] + # # @param is_active [Boolean, nil] + # # @param last_name [String, nil] + # # @param latest_rehire_date [String, nil] + # # @param location [FinchAPI::Models::Location, nil] + # # @param manager [FinchAPI::Models::HRIS::EmploymentData::Manager, nil] + # # @param middle_name [String, nil] + # # @param source_id [String, nil] + # # @param start_date [String, nil] + # # @param title [String, nil] + # # @param work_id [String, nil] + # # + # def initialize( + # id: nil, + # class_code: nil, + # custom_fields: nil, + # department: nil, + # employment: nil, + # employment_status: nil, + # end_date: nil, + # first_name: nil, + # income: nil, + # income_history: nil, + # is_active: nil, + # last_name: nil, + # latest_rehire_date: nil, + # location: nil, + # manager: nil, + # middle_name: nil, + # source_id: nil, + # start_date: nil, + # title: nil, + # work_id: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class CustomField < FinchAPI::BaseModel + # @!attribute [r] name + # + # @return [String, nil] + optional :name, String + + # @!parse + # # @return [String] + # attr_writer :name + + # @!attribute [r] value + # + # @return [Object, nil] + optional :value, FinchAPI::Unknown + + # @!parse + # # @return [Object] + # attr_writer :value + + # @!parse + # # @param name [String] + # # @param value [Object] + # # + # def initialize(name: nil, value: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + class Department < FinchAPI::BaseModel + # @!attribute name + # The name of the department associated with the individual. + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!parse + # # The department object. + # # + # # @param name [String, nil] + # # + # def initialize(name: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + class Employment < FinchAPI::BaseModel + # @!attribute subtype + # The secondary employment type of the individual. Options: `full_time`, + # `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`. + # + # @return [Symbol, FinchAPI::Models::HRIS::EmploymentData::Employment::Subtype, nil] + optional :subtype, enum: -> { FinchAPI::Models::HRIS::EmploymentData::Employment::Subtype }, nil?: true + + # @!attribute type + # The main employment type of the individual. + # + # @return [Symbol, FinchAPI::Models::HRIS::EmploymentData::Employment::Type, nil] + optional :type, enum: -> { FinchAPI::Models::HRIS::EmploymentData::Employment::Type }, nil?: true + + # @!parse + # # The employment object. + # # + # # @param subtype [Symbol, FinchAPI::Models::HRIS::EmploymentData::Employment::Subtype, nil] + # # @param type [Symbol, FinchAPI::Models::HRIS::EmploymentData::Employment::Type, nil] + # # + # def initialize(subtype: nil, type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # The secondary employment type of the individual. Options: `full_time`, + # `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`. + # + # @example + # ```ruby + # case subtype + # in :full_time + # # ... + # in :intern + # # ... + # in :part_time + # # ... + # in :temp + # # ... + # in :seasonal + # # ... + # in ... + # #... + # end + # ``` + class Subtype < FinchAPI::Enum + FULL_TIME = :full_time + INTERN = :intern + PART_TIME = :part_time + TEMP = :temp + SEASONAL = :seasonal + INDIVIDUAL_CONTRACTOR = :individual_contractor + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @abstract + # + # The main employment type of the individual. + # + # @example + # ```ruby + # case type + # in :employee + # # ... + # in :contractor + # # ... + # end + # ``` + class Type < FinchAPI::Enum + EMPLOYEE = :employee + CONTRACTOR = :contractor + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @abstract + # + # The detailed employment status of the individual. Available options: `active`, + # `deceased`, `leave`, `onboarding`, `prehire`, `retired`, `terminated`. + # + # @example + # ```ruby + # case employment_status + # in :active + # # ... + # in :deceased + # # ... + # in :leave + # # ... + # in :onboarding + # # ... + # in :prehire + # # ... + # in ... + # #... + # end + # ``` + class EmploymentStatus < FinchAPI::Enum + ACTIVE = :active + DECEASED = :deceased + LEAVE = :leave + ONBOARDING = :onboarding + PREHIRE = :prehire + RETIRED = :retired + TERMINATED = :terminated + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + class Manager < FinchAPI::BaseModel + # @!attribute [r] id + # A stable Finch `id` (UUID v4) for an individual in the company. + # + # @return [String, nil] + optional :id, String + + # @!parse + # # @return [String] + # attr_writer :id + + # @!parse + # # The manager object representing the manager of the individual within the org. + # # + # # @param id [String] + # # + # def initialize(id: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end + end +end diff --git a/lib/finch-api/models/hris/employment_data_response.rb b/lib/finch-api/models/hris/employment_data_response.rb new file mode 100644 index 00000000..414fce07 --- /dev/null +++ b/lib/finch-api/models/hris/employment_data_response.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + class EmploymentDataResponse < FinchAPI::BaseModel + # @!attribute [r] body + # + # @return [FinchAPI::Models::HRIS::EmploymentData, nil] + optional :body, -> { FinchAPI::Models::HRIS::EmploymentData } + + # @!parse + # # @return [FinchAPI::Models::HRIS::EmploymentData] + # attr_writer :body + + # @!attribute [r] code + # + # @return [Integer, nil] + optional :code, Integer + + # @!parse + # # @return [Integer] + # attr_writer :code + + # @!attribute [r] individual_id + # + # @return [String, nil] + optional :individual_id, String + + # @!parse + # # @return [String] + # attr_writer :individual_id + + # @!parse + # # @param body [FinchAPI::Models::HRIS::EmploymentData] + # # @param code [Integer] + # # @param individual_id [String] + # # + # def initialize(body: nil, code: nil, individual_id: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end +end diff --git a/lib/finch-api/models/hris/employment_retrieve_many_params.rb b/lib/finch-api/models/hris/employment_retrieve_many_params.rb new file mode 100644 index 00000000..9f855a9a --- /dev/null +++ b/lib/finch-api/models/hris/employment_retrieve_many_params.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + class EmploymentRetrieveManyParams < FinchAPI::BaseModel + # @!parse + # extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + # @!attribute requests + # The array of batch requests. + # + # @return [Array] + required :requests, + -> { FinchAPI::ArrayOf[FinchAPI::Models::HRIS::EmploymentRetrieveManyParams::Request] } + + # @!parse + # # @param requests [Array] + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(requests:, request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Request < FinchAPI::BaseModel + # @!attribute individual_id + # A stable Finch `id` (UUID v4) for an individual in the company. There is no + # limit to the number of `individual_id` to send per request. It is preferantial + # to send all ids in a single request for Finch to optimize provider rate-limits. + # + # @return [String] + required :individual_id, String + + # @!parse + # # @param individual_id [String] + # # + # def initialize(individual_id:, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end + end +end diff --git a/lib/finch-api/models/hris/individual.rb b/lib/finch-api/models/hris/individual.rb new file mode 100644 index 00000000..1e7f9ec5 --- /dev/null +++ b/lib/finch-api/models/hris/individual.rb @@ -0,0 +1,290 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + class Individual < FinchAPI::BaseModel + # @!attribute [r] id + # A stable Finch `id` (UUID v4) for an individual in the company. + # + # @return [String, nil] + optional :id, String + + # @!parse + # # @return [String] + # attr_writer :id + + # @!attribute dob + # + # @return [String, nil] + optional :dob, String, nil?: true + + # @!attribute emails + # + # @return [Array, nil] + optional :emails, -> { FinchAPI::ArrayOf[FinchAPI::Models::HRIS::Individual::Email] }, nil?: true + + # @!attribute encrypted_ssn + # Social Security Number of the individual in **encrypted** format. This field is + # only available with the `ssn` scope enabled and the + # `options: { include: ['ssn'] }` param set in the body. + # + # @return [String, nil] + optional :encrypted_ssn, String, nil?: true + + # @!attribute ethnicity + # The EEOC-defined ethnicity of the individual. + # + # @return [Symbol, FinchAPI::Models::HRIS::Individual::Ethnicity, nil] + optional :ethnicity, enum: -> { FinchAPI::Models::HRIS::Individual::Ethnicity }, nil?: true + + # @!attribute first_name + # The legal first name of the individual. + # + # @return [String, nil] + optional :first_name, String, nil?: true + + # @!attribute gender + # The gender of the individual. + # + # @return [Symbol, FinchAPI::Models::HRIS::Individual::Gender, nil] + optional :gender, enum: -> { FinchAPI::Models::HRIS::Individual::Gender }, nil?: true + + # @!attribute last_name + # The legal last name of the individual. + # + # @return [String, nil] + optional :last_name, String, nil?: true + + # @!attribute middle_name + # The legal middle name of the individual. + # + # @return [String, nil] + optional :middle_name, String, nil?: true + + # @!attribute phone_numbers + # + # @return [Array, nil] + optional :phone_numbers, + -> { FinchAPI::ArrayOf[FinchAPI::Models::HRIS::Individual::PhoneNumber, nil?: true] }, + nil?: true + + # @!attribute preferred_name + # The preferred name of the individual. + # + # @return [String, nil] + optional :preferred_name, String, nil?: true + + # @!attribute residence + # + # @return [FinchAPI::Models::Location, nil] + optional :residence, -> { FinchAPI::Models::Location }, nil?: true + + # @!attribute ssn + # Social Security Number of the individual. This field is only available with the + # `ssn` scope enabled and the `options: { include: ['ssn'] }` param set in the + # body. + # [Click here to learn more about enabling the SSN field](/developer-resources/Enable-SSN-Field). + # + # @return [String, nil] + optional :ssn, String, nil?: true + + # @!parse + # # @param id [String] + # # @param dob [String, nil] + # # @param emails [Array, nil] + # # @param encrypted_ssn [String, nil] + # # @param ethnicity [Symbol, FinchAPI::Models::HRIS::Individual::Ethnicity, nil] + # # @param first_name [String, nil] + # # @param gender [Symbol, FinchAPI::Models::HRIS::Individual::Gender, nil] + # # @param last_name [String, nil] + # # @param middle_name [String, nil] + # # @param phone_numbers [Array, nil] + # # @param preferred_name [String, nil] + # # @param residence [FinchAPI::Models::Location, nil] + # # @param ssn [String, nil] + # # + # def initialize( + # id: nil, + # dob: nil, + # emails: nil, + # encrypted_ssn: nil, + # ethnicity: nil, + # first_name: nil, + # gender: nil, + # last_name: nil, + # middle_name: nil, + # phone_numbers: nil, + # preferred_name: nil, + # residence: nil, + # ssn: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Email < FinchAPI::BaseModel + # @!attribute [r] data + # + # @return [String, nil] + optional :data, String + + # @!parse + # # @return [String] + # attr_writer :data + + # @!attribute type + # + # @return [Symbol, FinchAPI::Models::HRIS::Individual::Email::Type, nil] + optional :type, enum: -> { FinchAPI::Models::HRIS::Individual::Email::Type }, nil?: true + + # @!parse + # # @param data [String] + # # @param type [Symbol, FinchAPI::Models::HRIS::Individual::Email::Type, nil] + # # + # def initialize(data: nil, type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case type + # in :work + # # ... + # in :personal + # # ... + # end + # ``` + class Type < FinchAPI::Enum + WORK = :work + PERSONAL = :personal + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @abstract + # + # The EEOC-defined ethnicity of the individual. + # + # @example + # ```ruby + # case ethnicity + # in :asian + # # ... + # in :white + # # ... + # in :black_or_african_american + # # ... + # in :native_hawaiian_or_pacific_islander + # # ... + # in :american_indian_or_alaska_native + # # ... + # in ... + # #... + # end + # ``` + class Ethnicity < FinchAPI::Enum + ASIAN = :asian + WHITE = :white + BLACK_OR_AFRICAN_AMERICAN = :black_or_african_american + NATIVE_HAWAIIAN_OR_PACIFIC_ISLANDER = :native_hawaiian_or_pacific_islander + AMERICAN_INDIAN_OR_ALASKA_NATIVE = :american_indian_or_alaska_native + HISPANIC_OR_LATINO = :hispanic_or_latino + TWO_OR_MORE_RACES = :two_or_more_races + DECLINE_TO_SPECIFY = :decline_to_specify + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @abstract + # + # The gender of the individual. + # + # @example + # ```ruby + # case gender + # in :female + # # ... + # in :male + # # ... + # in :other + # # ... + # in :decline_to_specify + # # ... + # end + # ``` + class Gender < FinchAPI::Enum + FEMALE = :female + MALE = :male + OTHER = :other + DECLINE_TO_SPECIFY = :decline_to_specify + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + class PhoneNumber < FinchAPI::BaseModel + # @!attribute data + # + # @return [String, nil] + optional :data, String, nil?: true + + # @!attribute type + # + # @return [Symbol, FinchAPI::Models::HRIS::Individual::PhoneNumber::Type, nil] + optional :type, enum: -> { FinchAPI::Models::HRIS::Individual::PhoneNumber::Type }, nil?: true + + # @!parse + # # @param data [String, nil] + # # @param type [Symbol, FinchAPI::Models::HRIS::Individual::PhoneNumber::Type, nil] + # # + # def initialize(data: nil, type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case type + # in :work + # # ... + # in :personal + # # ... + # end + # ``` + class Type < FinchAPI::Enum + WORK = :work + PERSONAL = :personal + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end + end +end diff --git a/lib/finch-api/models/hris/individual_in_directory.rb b/lib/finch-api/models/hris/individual_in_directory.rb new file mode 100644 index 00000000..31d761e7 --- /dev/null +++ b/lib/finch-api/models/hris/individual_in_directory.rb @@ -0,0 +1,117 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + class IndividualInDirectory < FinchAPI::BaseModel + # @!attribute [r] id + # A stable Finch id (UUID v4) for an individual in the company. + # + # @return [String, nil] + optional :id, String + + # @!parse + # # @return [String] + # attr_writer :id + + # @!attribute department + # The department object. + # + # @return [FinchAPI::Models::HRIS::IndividualInDirectory::Department, nil] + optional :department, -> { FinchAPI::Models::HRIS::IndividualInDirectory::Department }, nil?: true + + # @!attribute first_name + # The legal first name of the individual. + # + # @return [String, nil] + optional :first_name, String, nil?: true + + # @!attribute is_active + # `true` if the individual is an active employee or contractor at the company. + # + # @return [Boolean, nil] + optional :is_active, FinchAPI::BooleanModel, nil?: true + + # @!attribute last_name + # The legal last name of the individual. + # + # @return [String, nil] + optional :last_name, String, nil?: true + + # @!attribute manager + # The manager object. + # + # @return [FinchAPI::Models::HRIS::IndividualInDirectory::Manager, nil] + optional :manager, -> { FinchAPI::Models::HRIS::IndividualInDirectory::Manager }, nil?: true + + # @!attribute middle_name + # The legal middle name of the individual. + # + # @return [String, nil] + optional :middle_name, String, nil?: true + + # @!parse + # # @param id [String] + # # @param department [FinchAPI::Models::HRIS::IndividualInDirectory::Department, nil] + # # @param first_name [String, nil] + # # @param is_active [Boolean, nil] + # # @param last_name [String, nil] + # # @param manager [FinchAPI::Models::HRIS::IndividualInDirectory::Manager, nil] + # # @param middle_name [String, nil] + # # + # def initialize( + # id: nil, + # department: nil, + # first_name: nil, + # is_active: nil, + # last_name: nil, + # manager: nil, + # middle_name: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Department < FinchAPI::BaseModel + # @!attribute name + # The name of the department. + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!parse + # # The department object. + # # + # # @param name [String, nil] + # # + # def initialize(name: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + class Manager < FinchAPI::BaseModel + # @!attribute [r] id + # A stable Finch `id` (UUID v4) for an individual in the company. + # + # @return [String, nil] + optional :id, String + + # @!parse + # # @return [String] + # attr_writer :id + + # @!parse + # # The manager object. + # # + # # @param id [String] + # # + # def initialize(id: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end + end +end diff --git a/lib/finch-api/models/hris/individual_response.rb b/lib/finch-api/models/hris/individual_response.rb new file mode 100644 index 00000000..4e1e9d94 --- /dev/null +++ b/lib/finch-api/models/hris/individual_response.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + class IndividualResponse < FinchAPI::BaseModel + # @!attribute [r] body + # + # @return [FinchAPI::Models::HRIS::Individual, nil] + optional :body, -> { FinchAPI::Models::HRIS::Individual } + + # @!parse + # # @return [FinchAPI::Models::HRIS::Individual] + # attr_writer :body + + # @!attribute [r] code + # + # @return [Integer, nil] + optional :code, Integer + + # @!parse + # # @return [Integer] + # attr_writer :code + + # @!attribute [r] individual_id + # + # @return [String, nil] + optional :individual_id, String + + # @!parse + # # @return [String] + # attr_writer :individual_id + + # @!parse + # # @param body [FinchAPI::Models::HRIS::Individual] + # # @param code [Integer] + # # @param individual_id [String] + # # + # def initialize(body: nil, code: nil, individual_id: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end +end diff --git a/lib/finch-api/models/hris/individual_retrieve_many_params.rb b/lib/finch-api/models/hris/individual_retrieve_many_params.rb new file mode 100644 index 00000000..9f13fa0c --- /dev/null +++ b/lib/finch-api/models/hris/individual_retrieve_many_params.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + class IndividualRetrieveManyParams < FinchAPI::BaseModel + # @!parse + # extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + # @!attribute options + # + # @return [FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Options, nil] + optional :options, -> { FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Options }, nil?: true + + # @!attribute [r] requests + # + # @return [Array, nil] + optional :requests, + -> { FinchAPI::ArrayOf[FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Request] } + + # @!parse + # # @return [Array] + # attr_writer :requests + + # @!parse + # # @param options [FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Options, nil] + # # @param requests [Array] + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(options: nil, requests: nil, request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Options < FinchAPI::BaseModel + # @!attribute [r] include + # + # @return [Array, nil] + optional :include, FinchAPI::ArrayOf[String] + + # @!parse + # # @return [Array] + # attr_writer :include + + # @!parse + # # @param include [Array] + # # + # def initialize(include: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + class Request < FinchAPI::BaseModel + # @!attribute [r] individual_id + # + # @return [String, nil] + optional :individual_id, String + + # @!parse + # # @return [String] + # attr_writer :individual_id + + # @!parse + # # @param individual_id [String] + # # + # def initialize(individual_id: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end + end +end diff --git a/lib/finch-api/models/hris/pay_statement.rb b/lib/finch-api/models/hris/pay_statement.rb new file mode 100644 index 00000000..2bc89ee0 --- /dev/null +++ b/lib/finch-api/models/hris/pay_statement.rb @@ -0,0 +1,587 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + class PayStatement < FinchAPI::BaseModel + # @!attribute earnings + # The array of earnings objects associated with this pay statement + # + # @return [Array, nil] + optional :earnings, + -> { FinchAPI::ArrayOf[FinchAPI::Models::HRIS::PayStatement::Earning, nil?: true] }, + nil?: true + + # @!attribute employee_deductions + # The array of deductions objects associated with this pay statement. + # + # @return [Array, nil] + optional :employee_deductions, + -> { FinchAPI::ArrayOf[FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction, nil?: true] }, + nil?: true + + # @!attribute employer_contributions + # + # @return [Array, nil] + optional :employer_contributions, + -> { FinchAPI::ArrayOf[FinchAPI::Models::HRIS::PayStatement::EmployerContribution, nil?: true] }, + nil?: true + + # @!attribute gross_pay + # + # @return [FinchAPI::Models::Money, nil] + optional :gross_pay, -> { FinchAPI::Models::Money }, nil?: true + + # @!attribute [r] individual_id + # A stable Finch `id` (UUID v4) for an individual in the company + # + # @return [String, nil] + optional :individual_id, String + + # @!parse + # # @return [String] + # attr_writer :individual_id + + # @!attribute net_pay + # + # @return [FinchAPI::Models::Money, nil] + optional :net_pay, -> { FinchAPI::Models::Money }, nil?: true + + # @!attribute payment_method + # The payment method. + # + # @return [Symbol, FinchAPI::Models::HRIS::PayStatement::PaymentMethod, nil] + optional :payment_method, enum: -> { FinchAPI::Models::HRIS::PayStatement::PaymentMethod }, nil?: true + + # @!attribute taxes + # The array of taxes objects associated with this pay statement. + # + # @return [Array, nil] + optional :taxes, + -> { FinchAPI::ArrayOf[FinchAPI::Models::HRIS::PayStatement::Tax, nil?: true] }, + nil?: true + + # @!attribute total_hours + # The number of hours worked for this pay period + # + # @return [Float, nil] + optional :total_hours, Float, nil?: true + + # @!attribute type + # The type of the payment associated with the pay statement. + # + # @return [Symbol, FinchAPI::Models::HRIS::PayStatement::Type, nil] + optional :type, enum: -> { FinchAPI::Models::HRIS::PayStatement::Type }, nil?: true + + # @!parse + # # @param earnings [Array, nil] + # # @param employee_deductions [Array, nil] + # # @param employer_contributions [Array, nil] + # # @param gross_pay [FinchAPI::Models::Money, nil] + # # @param individual_id [String] + # # @param net_pay [FinchAPI::Models::Money, nil] + # # @param payment_method [Symbol, FinchAPI::Models::HRIS::PayStatement::PaymentMethod, nil] + # # @param taxes [Array, nil] + # # @param total_hours [Float, nil] + # # @param type [Symbol, FinchAPI::Models::HRIS::PayStatement::Type, nil] + # # + # def initialize( + # earnings: nil, + # employee_deductions: nil, + # employer_contributions: nil, + # gross_pay: nil, + # individual_id: nil, + # net_pay: nil, + # payment_method: nil, + # taxes: nil, + # total_hours: nil, + # type: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Earning < FinchAPI::BaseModel + # @!attribute amount + # The earnings amount in cents. + # + # @return [Integer, nil] + optional :amount, Integer, nil?: true + + # @!attribute attributes + # + # @return [FinchAPI::Models::HRIS::PayStatement::Earning::Attributes, nil] + optional :attributes, -> { FinchAPI::Models::HRIS::PayStatement::Earning::Attributes }, nil?: true + + # @!attribute currency + # The earnings currency code. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute hours + # The number of hours associated with this earning. (For salaried employees, this + # could be hours per pay period, `0` or `null`, depending on the provider). + # + # @return [Float, nil] + optional :hours, Float, nil?: true + + # @!attribute name + # The exact name of the deduction from the pay statement. + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute type + # The type of earning. + # + # @return [Symbol, FinchAPI::Models::HRIS::PayStatement::Earning::Type, nil] + optional :type, enum: -> { FinchAPI::Models::HRIS::PayStatement::Earning::Type }, nil?: true + + # @!parse + # # @param amount [Integer, nil] + # # @param attributes [FinchAPI::Models::HRIS::PayStatement::Earning::Attributes, nil] + # # @param currency [String, nil] + # # @param hours [Float, nil] + # # @param name [String, nil] + # # @param type [Symbol, FinchAPI::Models::HRIS::PayStatement::Earning::Type, nil] + # # + # def initialize(amount: nil, attributes: nil, currency: nil, hours: nil, name: nil, type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Attributes < FinchAPI::BaseModel + # @!attribute [r] metadata + # + # @return [FinchAPI::Models::HRIS::PayStatement::Earning::Attributes::Metadata, nil] + optional :metadata, -> { FinchAPI::Models::HRIS::PayStatement::Earning::Attributes::Metadata } + + # @!parse + # # @return [FinchAPI::Models::HRIS::PayStatement::Earning::Attributes::Metadata] + # attr_writer :metadata + + # @!parse + # # @param metadata [FinchAPI::Models::HRIS::PayStatement::Earning::Attributes::Metadata] + # # + # def initialize(metadata: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Metadata < FinchAPI::BaseModel + # @!attribute [r] metadata + # The metadata to be attached to the entity by existing rules. It is a key-value + # pairs where the values can be of any type (string, number, boolean, object, + # array, etc.). + # + # @return [Hash{Symbol=>Object}, nil] + optional :metadata, FinchAPI::HashOf[FinchAPI::Unknown] + + # @!parse + # # @return [Hash{Symbol=>Object}] + # attr_writer :metadata + + # @!parse + # # @param metadata [Hash{Symbol=>Object}] + # # + # def initialize(metadata: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + + # @abstract + # + # The type of earning. + # + # @example + # ```ruby + # case type + # in :salary + # # ... + # in :wage + # # ... + # in :reimbursement + # # ... + # in :overtime + # # ... + # in :severance + # # ... + # in ... + # #... + # end + # ``` + class Type < FinchAPI::Enum + SALARY = :salary + WAGE = :wage + REIMBURSEMENT = :reimbursement + OVERTIME = :overtime + SEVERANCE = :severance + DOUBLE_OVERTIME = :double_overtime + PTO = :pto + SICK = :sick + BONUS = :bonus + COMMISSION = :commission + TIPS = :tips + NUMBER_1099 = :"1099" + OTHER = :other + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + class EmployeeDeduction < FinchAPI::BaseModel + # @!attribute amount + # The deduction amount in cents. + # + # @return [Integer, nil] + optional :amount, Integer, nil?: true + + # @!attribute attributes + # + # @return [FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes, nil] + optional :attributes, + -> { FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes }, + nil?: true + + # @!attribute currency + # The deduction currency. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute name + # The deduction name from the pay statement. + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute pre_tax + # Boolean indicating if the deduction is pre-tax. + # + # @return [Boolean, nil] + optional :pre_tax, FinchAPI::BooleanModel, nil?: true + + # @!attribute type + # Type of benefit. + # + # @return [Symbol, FinchAPI::Models::HRIS::BenefitType, nil] + optional :type, enum: -> { FinchAPI::Models::HRIS::BenefitType }, nil?: true + + # @!parse + # # @param amount [Integer, nil] + # # @param attributes [FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes, nil] + # # @param currency [String, nil] + # # @param name [String, nil] + # # @param pre_tax [Boolean, nil] + # # @param type [Symbol, FinchAPI::Models::HRIS::BenefitType, nil] + # # + # def initialize(amount: nil, attributes: nil, currency: nil, name: nil, pre_tax: nil, type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Attributes < FinchAPI::BaseModel + # @!attribute [r] metadata + # + # @return [FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes::Metadata, nil] + optional :metadata, -> { FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes::Metadata } + + # @!parse + # # @return [FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes::Metadata] + # attr_writer :metadata + + # @!parse + # # @param metadata [FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes::Metadata] + # # + # def initialize(metadata: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Metadata < FinchAPI::BaseModel + # @!attribute [r] metadata + # The metadata to be attached to the entity by existing rules. It is a key-value + # pairs where the values can be of any type (string, number, boolean, object, + # array, etc.). + # + # @return [Hash{Symbol=>Object}, nil] + optional :metadata, FinchAPI::HashOf[FinchAPI::Unknown] + + # @!parse + # # @return [Hash{Symbol=>Object}] + # attr_writer :metadata + + # @!parse + # # @param metadata [Hash{Symbol=>Object}] + # # + # def initialize(metadata: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end + + class EmployerContribution < FinchAPI::BaseModel + # @!attribute amount + # The contribution amount in cents. + # + # @return [Integer, nil] + optional :amount, Integer, nil?: true + + # @!attribute attributes + # + # @return [FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes, nil] + optional :attributes, + -> { FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes }, + nil?: true + + # @!attribute currency + # The contribution currency. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute name + # The contribution name from the pay statement. + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute type + # Type of benefit. + # + # @return [Symbol, FinchAPI::Models::HRIS::BenefitType, nil] + optional :type, enum: -> { FinchAPI::Models::HRIS::BenefitType }, nil?: true + + # @!parse + # # @param amount [Integer, nil] + # # @param attributes [FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes, nil] + # # @param currency [String, nil] + # # @param name [String, nil] + # # @param type [Symbol, FinchAPI::Models::HRIS::BenefitType, nil] + # # + # def initialize(amount: nil, attributes: nil, currency: nil, name: nil, type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Attributes < FinchAPI::BaseModel + # @!attribute [r] metadata + # + # @return [FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes::Metadata, nil] + optional :metadata, + -> { FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes::Metadata } + + # @!parse + # # @return [FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes::Metadata] + # attr_writer :metadata + + # @!parse + # # @param metadata [FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes::Metadata] + # # + # def initialize(metadata: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Metadata < FinchAPI::BaseModel + # @!attribute [r] metadata + # The metadata to be attached to the entity by existing rules. It is a key-value + # pairs where the values can be of any type (string, number, boolean, object, + # array, etc.). + # + # @return [Hash{Symbol=>Object}, nil] + optional :metadata, FinchAPI::HashOf[FinchAPI::Unknown] + + # @!parse + # # @return [Hash{Symbol=>Object}] + # attr_writer :metadata + + # @!parse + # # @param metadata [Hash{Symbol=>Object}] + # # + # def initialize(metadata: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end + + # @abstract + # + # The payment method. + # + # @example + # ```ruby + # case payment_method + # in :check + # # ... + # in :direct_deposit + # # ... + # end + # ``` + class PaymentMethod < FinchAPI::Enum + CHECK = :check + DIRECT_DEPOSIT = :direct_deposit + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + class Tax < FinchAPI::BaseModel + # @!attribute amount + # The tax amount in cents. + # + # @return [Integer, nil] + optional :amount, Integer, nil?: true + + # @!attribute attributes + # + # @return [FinchAPI::Models::HRIS::PayStatement::Tax::Attributes, nil] + optional :attributes, -> { FinchAPI::Models::HRIS::PayStatement::Tax::Attributes }, nil?: true + + # @!attribute currency + # The currency code. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute employer + # `true` if the amount is paid by the employers. + # + # @return [Boolean, nil] + optional :employer, FinchAPI::BooleanModel, nil?: true + + # @!attribute name + # The exact name of tax from the pay statement. + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute type + # The type of taxes. + # + # @return [Symbol, FinchAPI::Models::HRIS::PayStatement::Tax::Type, nil] + optional :type, enum: -> { FinchAPI::Models::HRIS::PayStatement::Tax::Type }, nil?: true + + # @!parse + # # @param amount [Integer, nil] + # # @param attributes [FinchAPI::Models::HRIS::PayStatement::Tax::Attributes, nil] + # # @param currency [String, nil] + # # @param employer [Boolean, nil] + # # @param name [String, nil] + # # @param type [Symbol, FinchAPI::Models::HRIS::PayStatement::Tax::Type, nil] + # # + # def initialize(amount: nil, attributes: nil, currency: nil, employer: nil, name: nil, type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Attributes < FinchAPI::BaseModel + # @!attribute [r] metadata + # + # @return [FinchAPI::Models::HRIS::PayStatement::Tax::Attributes::Metadata, nil] + optional :metadata, -> { FinchAPI::Models::HRIS::PayStatement::Tax::Attributes::Metadata } + + # @!parse + # # @return [FinchAPI::Models::HRIS::PayStatement::Tax::Attributes::Metadata] + # attr_writer :metadata + + # @!parse + # # @param metadata [FinchAPI::Models::HRIS::PayStatement::Tax::Attributes::Metadata] + # # + # def initialize(metadata: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Metadata < FinchAPI::BaseModel + # @!attribute [r] metadata + # The metadata to be attached to the entity by existing rules. It is a key-value + # pairs where the values can be of any type (string, number, boolean, object, + # array, etc.). + # + # @return [Hash{Symbol=>Object}, nil] + optional :metadata, FinchAPI::HashOf[FinchAPI::Unknown] + + # @!parse + # # @return [Hash{Symbol=>Object}] + # attr_writer :metadata + + # @!parse + # # @param metadata [Hash{Symbol=>Object}] + # # + # def initialize(metadata: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + + # @abstract + # + # The type of taxes. + # + # @example + # ```ruby + # case type + # in :state + # # ... + # in :federal + # # ... + # in :local + # # ... + # in :fica + # # ... + # end + # ``` + class Type < FinchAPI::Enum + STATE = :state + FEDERAL = :federal + LOCAL = :local + FICA = :fica + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @abstract + # + # The type of the payment associated with the pay statement. + # + # @example + # ```ruby + # case type + # in :regular_payroll + # # ... + # in :off_cycle_payroll + # # ... + # in :one_time_payment + # # ... + # end + # ``` + class Type < FinchAPI::Enum + REGULAR_PAYROLL = :regular_payroll + OFF_CYCLE_PAYROLL = :off_cycle_payroll + ONE_TIME_PAYMENT = :one_time_payment + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end +end diff --git a/lib/finch-api/models/hris/pay_statement_response.rb b/lib/finch-api/models/hris/pay_statement_response.rb new file mode 100644 index 00000000..a060deba --- /dev/null +++ b/lib/finch-api/models/hris/pay_statement_response.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + class PayStatementResponse < FinchAPI::BaseModel + # @!attribute [r] body + # + # @return [FinchAPI::Models::HRIS::PayStatementResponseBody, nil] + optional :body, -> { FinchAPI::Models::HRIS::PayStatementResponseBody } + + # @!parse + # # @return [FinchAPI::Models::HRIS::PayStatementResponseBody] + # attr_writer :body + + # @!attribute [r] code + # + # @return [Integer, nil] + optional :code, Integer + + # @!parse + # # @return [Integer] + # attr_writer :code + + # @!attribute [r] payment_id + # + # @return [String, nil] + optional :payment_id, String + + # @!parse + # # @return [String] + # attr_writer :payment_id + + # @!parse + # # @param body [FinchAPI::Models::HRIS::PayStatementResponseBody] + # # @param code [Integer] + # # @param payment_id [String] + # # + # def initialize(body: nil, code: nil, payment_id: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end +end diff --git a/lib/finch-api/models/hris/pay_statement_response_body.rb b/lib/finch-api/models/hris/pay_statement_response_body.rb new file mode 100644 index 00000000..f5c57c91 --- /dev/null +++ b/lib/finch-api/models/hris/pay_statement_response_body.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + class PayStatementResponseBody < FinchAPI::BaseModel + # @!attribute [r] paging + # + # @return [FinchAPI::Models::Paging, nil] + optional :paging, -> { FinchAPI::Models::Paging } + + # @!parse + # # @return [FinchAPI::Models::Paging] + # attr_writer :paging + + # @!attribute [r] pay_statements + # The array of pay statements for the current payment. + # + # @return [Array, nil] + optional :pay_statements, -> { FinchAPI::ArrayOf[FinchAPI::Models::HRIS::PayStatement] } + + # @!parse + # # @return [Array] + # attr_writer :pay_statements + + # @!parse + # # @param paging [FinchAPI::Models::Paging] + # # @param pay_statements [Array] + # # + # def initialize(paging: nil, pay_statements: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end +end diff --git a/lib/finch-api/models/hris/pay_statement_retrieve_many_params.rb b/lib/finch-api/models/hris/pay_statement_retrieve_many_params.rb new file mode 100644 index 00000000..14115d78 --- /dev/null +++ b/lib/finch-api/models/hris/pay_statement_retrieve_many_params.rb @@ -0,0 +1,65 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + class PayStatementRetrieveManyParams < FinchAPI::BaseModel + # @!parse + # extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + # @!attribute requests + # The array of batch requests. + # + # @return [Array] + required :requests, + -> { FinchAPI::ArrayOf[FinchAPI::Models::HRIS::PayStatementRetrieveManyParams::Request] } + + # @!parse + # # @param requests [Array] + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(requests:, request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Request < FinchAPI::BaseModel + # @!attribute payment_id + # A stable Finch `id` (UUID v4) for a payment. + # + # @return [String] + required :payment_id, String + + # @!attribute [r] limit + # Number of pay statements to return (defaults to all). + # + # @return [Integer, nil] + optional :limit, Integer + + # @!parse + # # @return [Integer] + # attr_writer :limit + + # @!attribute [r] offset + # Index to start from. + # + # @return [Integer, nil] + optional :offset, Integer + + # @!parse + # # @return [Integer] + # attr_writer :offset + + # @!parse + # # @param payment_id [String] + # # @param limit [Integer] + # # @param offset [Integer] + # # + # def initialize(payment_id:, limit: nil, offset: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end + end +end diff --git a/lib/finch-api/models/hris/payment.rb b/lib/finch-api/models/hris/payment.rb new file mode 100644 index 00000000..3e834e23 --- /dev/null +++ b/lib/finch-api/models/hris/payment.rb @@ -0,0 +1,174 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + class Payment < FinchAPI::BaseModel + # @!attribute [r] id + # The unique id for the payment. + # + # @return [String, nil] + optional :id, String + + # @!parse + # # @return [String] + # attr_writer :id + + # @!attribute company_debit + # + # @return [FinchAPI::Models::Money, nil] + optional :company_debit, -> { FinchAPI::Models::Money }, nil?: true + + # @!attribute debit_date + # + # @return [String, nil] + optional :debit_date, String, nil?: true + + # @!attribute employee_taxes + # + # @return [FinchAPI::Models::Money, nil] + optional :employee_taxes, -> { FinchAPI::Models::Money }, nil?: true + + # @!attribute employer_taxes + # + # @return [FinchAPI::Models::Money, nil] + optional :employer_taxes, -> { FinchAPI::Models::Money }, nil?: true + + # @!attribute gross_pay + # + # @return [FinchAPI::Models::Money, nil] + optional :gross_pay, -> { FinchAPI::Models::Money }, nil?: true + + # @!attribute individual_ids + # Array of every individual on this payment. + # + # @return [Array, nil] + optional :individual_ids, FinchAPI::ArrayOf[String], nil?: true + + # @!attribute net_pay + # + # @return [FinchAPI::Models::Money, nil] + optional :net_pay, -> { FinchAPI::Models::Money }, nil?: true + + # @!attribute pay_date + # + # @return [String, nil] + optional :pay_date, String, nil?: true + + # @!attribute pay_frequencies + # List of pay frequencies associated with this payment. + # + # @return [Array, nil] + optional :pay_frequencies, + -> { FinchAPI::ArrayOf[enum: FinchAPI::Models::HRIS::Payment::PayFrequency] }, + nil?: true + + # @!attribute pay_group_ids + # Array of the Finch id (uuidv4) of every pay group associated with this payment. + # + # @return [Array, nil] + optional :pay_group_ids, FinchAPI::ArrayOf[String], nil?: true + + # @!attribute pay_period + # The pay period object. + # + # @return [FinchAPI::Models::HRIS::Payment::PayPeriod, nil] + optional :pay_period, -> { FinchAPI::Models::HRIS::Payment::PayPeriod }, nil?: true + + # @!parse + # # @param id [String] + # # @param company_debit [FinchAPI::Models::Money, nil] + # # @param debit_date [String, nil] + # # @param employee_taxes [FinchAPI::Models::Money, nil] + # # @param employer_taxes [FinchAPI::Models::Money, nil] + # # @param gross_pay [FinchAPI::Models::Money, nil] + # # @param individual_ids [Array, nil] + # # @param net_pay [FinchAPI::Models::Money, nil] + # # @param pay_date [String, nil] + # # @param pay_frequencies [Array, nil] + # # @param pay_group_ids [Array, nil] + # # @param pay_period [FinchAPI::Models::HRIS::Payment::PayPeriod, nil] + # # + # def initialize( + # id: nil, + # company_debit: nil, + # debit_date: nil, + # employee_taxes: nil, + # employer_taxes: nil, + # gross_pay: nil, + # individual_ids: nil, + # net_pay: nil, + # pay_date: nil, + # pay_frequencies: nil, + # pay_group_ids: nil, + # pay_period: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case pay_frequency + # in :annually + # # ... + # in :semi_annually + # # ... + # in :quarterly + # # ... + # in :monthly + # # ... + # in :semi_monthly + # # ... + # in ... + # #... + # end + # ``` + class PayFrequency < FinchAPI::Enum + ANNUALLY = :annually + SEMI_ANNUALLY = :semi_annually + QUARTERLY = :quarterly + MONTHLY = :monthly + SEMI_MONTHLY = :semi_monthly + BI_WEEKLY = :bi_weekly + WEEKLY = :weekly + DAILY = :daily + OTHER = :other + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + class PayPeriod < FinchAPI::BaseModel + # @!attribute end_date + # + # @return [String, nil] + optional :end_date, String, nil?: true + + # @!attribute start_date + # + # @return [String, nil] + optional :start_date, String, nil?: true + + # @!parse + # # The pay period object. + # # + # # @param end_date [String, nil] + # # @param start_date [String, nil] + # # + # def initialize(end_date: nil, start_date: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end + end +end diff --git a/lib/finch-api/models/hris/payment_list_params.rb b/lib/finch-api/models/hris/payment_list_params.rb new file mode 100644 index 00000000..4f5e614f --- /dev/null +++ b/lib/finch-api/models/hris/payment_list_params.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + class PaymentListParams < FinchAPI::BaseModel + # @!parse + # extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + # @!attribute end_date + # The end date to retrieve payments by a company (inclusive) in `YYYY-MM-DD` + # format. + # + # @return [Date] + required :end_date, Date + + # @!attribute start_date + # The start date to retrieve payments by a company (inclusive) in `YYYY-MM-DD` + # format. + # + # @return [Date] + required :start_date, Date + + # @!parse + # # @param end_date [Date] + # # @param start_date [Date] + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(end_date:, start_date:, request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end +end diff --git a/lib/finch-api/models/hris/support_per_benefit_type.rb b/lib/finch-api/models/hris/support_per_benefit_type.rb new file mode 100644 index 00000000..e02307eb --- /dev/null +++ b/lib/finch-api/models/hris/support_per_benefit_type.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + class SupportPerBenefitType < FinchAPI::BaseModel + # @!attribute [r] company_benefits + # + # @return [FinchAPI::Models::OperationSupportMatrix, nil] + optional :company_benefits, -> { FinchAPI::Models::OperationSupportMatrix } + + # @!parse + # # @return [FinchAPI::Models::OperationSupportMatrix] + # attr_writer :company_benefits + + # @!attribute [r] individual_benefits + # + # @return [FinchAPI::Models::OperationSupportMatrix, nil] + optional :individual_benefits, -> { FinchAPI::Models::OperationSupportMatrix } + + # @!parse + # # @return [FinchAPI::Models::OperationSupportMatrix] + # attr_writer :individual_benefits + + # @!parse + # # @param company_benefits [FinchAPI::Models::OperationSupportMatrix] + # # @param individual_benefits [FinchAPI::Models::OperationSupportMatrix] + # # + # def initialize(company_benefits: nil, individual_benefits: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end +end diff --git a/lib/finch-api/models/hris/supported_benefit.rb b/lib/finch-api/models/hris/supported_benefit.rb new file mode 100644 index 00000000..c20638c9 --- /dev/null +++ b/lib/finch-api/models/hris/supported_benefit.rb @@ -0,0 +1,166 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + class SupportedBenefit < FinchAPI::BaseModel + # @!attribute annual_maximum + # Whether the provider supports an annual maximum for this benefit. + # + # @return [Boolean, nil] + optional :annual_maximum, FinchAPI::BooleanModel, nil?: true + + # @!attribute catch_up + # Whether the provider supports catch up for this benefit. This field will only be + # true for retirement benefits. + # + # @return [Boolean, nil] + optional :catch_up, FinchAPI::BooleanModel, nil?: true + + # @!attribute company_contribution + # Supported contribution types. An empty array indicates contributions are not + # supported. + # + # @return [Array, nil] + optional :company_contribution, + -> { FinchAPI::ArrayOf[enum: FinchAPI::Models::HRIS::SupportedBenefit::CompanyContribution, nil?: true] }, + nil?: true + + # @!attribute description + # + # @return [String, nil] + optional :description, String, nil?: true + + # @!attribute employee_deduction + # Supported deduction types. An empty array indicates deductions are not + # supported. + # + # @return [Array, nil] + optional :employee_deduction, + -> { FinchAPI::ArrayOf[enum: FinchAPI::Models::HRIS::SupportedBenefit::EmployeeDeduction, nil?: true] }, + nil?: true + + # @!attribute [r] frequencies + # The list of frequencies supported by the provider for this benefit + # + # @return [Array, nil] + optional :frequencies, + -> { FinchAPI::ArrayOf[enum: FinchAPI::Models::HRIS::BenefitFrequency, nil?: true] } + + # @!parse + # # @return [Array] + # attr_writer :frequencies + + # @!attribute hsa_contribution_limit + # Whether the provider supports HSA contribution limits. Empty if this feature is + # not supported for the benefit. This array only has values for HSA benefits. + # + # @return [Array, nil] + optional :hsa_contribution_limit, + -> { FinchAPI::ArrayOf[enum: FinchAPI::Models::HRIS::SupportedBenefit::HsaContributionLimit, nil?: true] }, + nil?: true + + # @!attribute type + # Type of benefit. + # + # @return [Symbol, FinchAPI::Models::HRIS::BenefitType, nil] + optional :type, enum: -> { FinchAPI::Models::HRIS::BenefitType }, nil?: true + + # @!parse + # # @param annual_maximum [Boolean, nil] + # # @param catch_up [Boolean, nil] + # # @param company_contribution [Array, nil] + # # @param description [String, nil] + # # @param employee_deduction [Array, nil] + # # @param frequencies [Array] + # # @param hsa_contribution_limit [Array, nil] + # # @param type [Symbol, FinchAPI::Models::HRIS::BenefitType, nil] + # # + # def initialize( + # annual_maximum: nil, + # catch_up: nil, + # company_contribution: nil, + # description: nil, + # employee_deduction: nil, + # frequencies: nil, + # hsa_contribution_limit: nil, + # type: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case company_contribution + # in :fixed + # # ... + # in :percent + # # ... + # end + # ``` + class CompanyContribution < FinchAPI::Enum + FIXED = :fixed + PERCENT = :percent + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @abstract + # + # @example + # ```ruby + # case employee_deduction + # in :fixed + # # ... + # in :percent + # # ... + # end + # ``` + class EmployeeDeduction < FinchAPI::Enum + FIXED = :fixed + PERCENT = :percent + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @abstract + # + # @example + # ```ruby + # case hsa_contribution_limit + # in :individual + # # ... + # in :family + # # ... + # end + # ``` + class HsaContributionLimit < FinchAPI::Enum + INDIVIDUAL = :individual + FAMILY = :family + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end +end diff --git a/lib/finch-api/models/hris/update_company_benefit_response.rb b/lib/finch-api/models/hris/update_company_benefit_response.rb new file mode 100644 index 00000000..76d54f79 --- /dev/null +++ b/lib/finch-api/models/hris/update_company_benefit_response.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + class UpdateCompanyBenefitResponse < FinchAPI::BaseModel + # @!attribute benefit_id + # + # @return [String] + required :benefit_id, String + + # @!parse + # # @param benefit_id [String] + # # + # def initialize(benefit_id:, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end +end diff --git a/lib/finch-api/models/hris/w42005.rb b/lib/finch-api/models/hris/w42005.rb new file mode 100644 index 00000000..616ba232 --- /dev/null +++ b/lib/finch-api/models/hris/w42005.rb @@ -0,0 +1,188 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + class W42005 < FinchAPI::BaseModel + # @!attribute [r] data + # Detailed information specific to the 2005 W4 form. + # + # @return [FinchAPI::Models::HRIS::W42005::Data, nil] + optional :data, -> { FinchAPI::Models::HRIS::W42005::Data } + + # @!parse + # # @return [FinchAPI::Models::HRIS::W42005::Data] + # attr_writer :data + + # @!attribute [r] type + # Specifies the form type, indicating that this document is a 2005 W4 form. + # + # @return [Symbol, FinchAPI::Models::HRIS::W42005::Type, nil] + optional :type, enum: -> { FinchAPI::Models::HRIS::W42005::Type } + + # @!parse + # # @return [Symbol, FinchAPI::Models::HRIS::W42005::Type] + # attr_writer :type + + # @!attribute year + # The tax year this W4 document applies to. + # + # @return [Float, nil] + optional :year, Float, nil?: true + + # @!parse + # # A 2005 version of the W-4 tax form containing information on an individual's + # # filing status, dependents, and withholding details. + # # + # # @param data [FinchAPI::Models::HRIS::W42005::Data] + # # @param type [Symbol, FinchAPI::Models::HRIS::W42005::Type] + # # @param year [Float, nil] + # # + # def initialize(data: nil, type: nil, year: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Data < FinchAPI::BaseModel + # @!attribute additional_withholding + # Additional withholding amount (in cents). + # + # @return [Integer, nil] + optional :additional_withholding, Integer, nil?: true + + # @!attribute [r] exemption + # Indicates exemption status from federal tax withholding. + # + # @return [Symbol, FinchAPI::Models::HRIS::W42005::Data::Exemption, nil] + optional :exemption, enum: -> { FinchAPI::Models::HRIS::W42005::Data::Exemption } + + # @!parse + # # @return [Symbol, FinchAPI::Models::HRIS::W42005::Data::Exemption] + # attr_writer :exemption + + # @!attribute [r] filing_status + # The individual's filing status for tax purposes. + # + # @return [Symbol, FinchAPI::Models::HRIS::W42005::Data::FilingStatus, nil] + optional :filing_status, enum: -> { FinchAPI::Models::HRIS::W42005::Data::FilingStatus } + + # @!parse + # # @return [Symbol, FinchAPI::Models::HRIS::W42005::Data::FilingStatus] + # attr_writer :filing_status + + # @!attribute [r] individual_id + # The unique identifier for the individual associated with this 2005 W4 form. + # + # @return [String, nil] + optional :individual_id, String + + # @!parse + # # @return [String] + # attr_writer :individual_id + + # @!attribute total_number_of_allowances + # Total number of allowances claimed (in cents). + # + # @return [Integer, nil] + optional :total_number_of_allowances, Integer, nil?: true + + # @!parse + # # Detailed information specific to the 2005 W4 form. + # # + # # @param additional_withholding [Integer, nil] + # # @param exemption [Symbol, FinchAPI::Models::HRIS::W42005::Data::Exemption] + # # @param filing_status [Symbol, FinchAPI::Models::HRIS::W42005::Data::FilingStatus] + # # @param individual_id [String] + # # @param total_number_of_allowances [Integer, nil] + # # + # def initialize( + # additional_withholding: nil, + # exemption: nil, + # filing_status: nil, + # individual_id: nil, + # total_number_of_allowances: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # Indicates exemption status from federal tax withholding. + # + # @example + # ```ruby + # case exemption + # in :exempt + # # ... + # in :non_exempt + # # ... + # end + # ``` + class Exemption < FinchAPI::Enum + EXEMPT = :exempt + NON_EXEMPT = :non_exempt + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @abstract + # + # The individual's filing status for tax purposes. + # + # @example + # ```ruby + # case filing_status + # in :married + # # ... + # in :married_but_withhold_at_higher_single_rate + # # ... + # in :single + # # ... + # end + # ``` + class FilingStatus < FinchAPI::Enum + MARRIED = :married + MARRIED_BUT_WITHHOLD_AT_HIGHER_SINGLE_RATE = :married_but_withhold_at_higher_single_rate + SINGLE = :single + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @abstract + # + # Specifies the form type, indicating that this document is a 2005 W4 form. + # + # @example + # ```ruby + # case type + # in :w4_2005 + # # ... + # end + # ``` + class Type < FinchAPI::Enum + W4_2005 = :w4_2005 + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end +end diff --git a/lib/finch-api/models/hris/w42020.rb b/lib/finch-api/models/hris/w42020.rb new file mode 100644 index 00000000..053888d5 --- /dev/null +++ b/lib/finch-api/models/hris/w42020.rb @@ -0,0 +1,180 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module HRIS + class W42020 < FinchAPI::BaseModel + # @!attribute [r] data + # Detailed information specific to the 2020 W4 form. + # + # @return [FinchAPI::Models::HRIS::W42020::Data, nil] + optional :data, -> { FinchAPI::Models::HRIS::W42020::Data } + + # @!parse + # # @return [FinchAPI::Models::HRIS::W42020::Data] + # attr_writer :data + + # @!attribute [r] type + # Specifies the form type, indicating that this document is a 2020 W4 form. + # + # @return [Symbol, FinchAPI::Models::HRIS::W42020::Type, nil] + optional :type, enum: -> { FinchAPI::Models::HRIS::W42020::Type } + + # @!parse + # # @return [Symbol, FinchAPI::Models::HRIS::W42020::Type] + # attr_writer :type + + # @!attribute year + # The tax year this W4 document applies to. + # + # @return [Float, nil] + optional :year, Float, nil?: true + + # @!parse + # # A 2020 version of the W-4 tax form containing information on an individual's + # # filing status, dependents, and withholding details. + # # + # # @param data [FinchAPI::Models::HRIS::W42020::Data] + # # @param type [Symbol, FinchAPI::Models::HRIS::W42020::Type] + # # @param year [Float, nil] + # # + # def initialize(data: nil, type: nil, year: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Data < FinchAPI::BaseModel + # @!attribute amount_for_other_dependents + # Amount claimed for dependents other than qualifying children under 17 (in + # cents). + # + # @return [Integer, nil] + optional :amount_for_other_dependents, Integer, nil?: true + + # @!attribute amount_for_qualifying_children_under_17 + # Amount claimed for dependents under 17 years old (in cents). + # + # @return [Integer, nil] + optional :amount_for_qualifying_children_under_17, Integer, nil?: true + + # @!attribute deductions + # Deductible expenses (in cents). + # + # @return [Integer, nil] + optional :deductions, Integer, nil?: true + + # @!attribute extra_withholding + # Additional withholding amount (in cents). + # + # @return [Integer, nil] + optional :extra_withholding, Integer, nil?: true + + # @!attribute filing_status + # The individual's filing status for tax purposes. + # + # @return [Symbol, FinchAPI::Models::HRIS::W42020::Data::FilingStatus, nil] + optional :filing_status, enum: -> { FinchAPI::Models::HRIS::W42020::Data::FilingStatus }, nil?: true + + # @!attribute [r] individual_id + # The unique identifier for the individual associated with this document. + # + # @return [String, nil] + optional :individual_id, String + + # @!parse + # # @return [String] + # attr_writer :individual_id + + # @!attribute other_income + # Additional income from sources outside of primary employment (in cents). + # + # @return [Integer, nil] + optional :other_income, Integer, nil?: true + + # @!attribute total_claim_dependent_and_other_credits + # Total amount claimed for dependents and other credits (in cents). + # + # @return [Integer, nil] + optional :total_claim_dependent_and_other_credits, Integer, nil?: true + + # @!parse + # # Detailed information specific to the 2020 W4 form. + # # + # # @param amount_for_other_dependents [Integer, nil] + # # @param amount_for_qualifying_children_under_17 [Integer, nil] + # # @param deductions [Integer, nil] + # # @param extra_withholding [Integer, nil] + # # @param filing_status [Symbol, FinchAPI::Models::HRIS::W42020::Data::FilingStatus, nil] + # # @param individual_id [String] + # # @param other_income [Integer, nil] + # # @param total_claim_dependent_and_other_credits [Integer, nil] + # # + # def initialize( + # amount_for_other_dependents: nil, + # amount_for_qualifying_children_under_17: nil, + # deductions: nil, + # extra_withholding: nil, + # filing_status: nil, + # individual_id: nil, + # other_income: nil, + # total_claim_dependent_and_other_credits: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # The individual's filing status for tax purposes. + # + # @example + # ```ruby + # case filing_status + # in :head_of_household + # # ... + # in :married_filing_jointly_or_qualifying_surviving_spouse + # # ... + # in :single_or_married_filing_separately + # # ... + # end + # ``` + class FilingStatus < FinchAPI::Enum + HEAD_OF_HOUSEHOLD = :head_of_household + MARRIED_FILING_JOINTLY_OR_QUALIFYING_SURVIVING_SPOUSE = :married_filing_jointly_or_qualifying_surviving_spouse + SINGLE_OR_MARRIED_FILING_SEPARATELY = :single_or_married_filing_separately + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @abstract + # + # Specifies the form type, indicating that this document is a 2020 W4 form. + # + # @example + # ```ruby + # case type + # in :w4_2020 + # # ... + # end + # ``` + class Type < FinchAPI::Enum + W4_2020 = :w4_2020 + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end +end diff --git a/lib/finch-api/models/income.rb b/lib/finch-api/models/income.rb new file mode 100644 index 00000000..06851161 --- /dev/null +++ b/lib/finch-api/models/income.rb @@ -0,0 +1,87 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + class Income < FinchAPI::BaseModel + # @!attribute amount + # The income amount in cents. + # + # @return [Integer, nil] + optional :amount, Integer, nil?: true + + # @!attribute currency + # The currency code. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute effective_date + # The date the income amount went into effect. + # + # @return [String, nil] + optional :effective_date, String, nil?: true + + # @!attribute unit + # The income unit of payment. Options: `yearly`, `quarterly`, `monthly`, + # `semi_monthly`, `bi_weekly`, `weekly`, `daily`, `hourly`, and `fixed`. + # + # @return [Symbol, FinchAPI::Models::Income::Unit, nil] + optional :unit, enum: -> { FinchAPI::Models::Income::Unit }, nil?: true + + # @!parse + # # 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. + # # + # # @param amount [Integer, nil] + # # @param currency [String, nil] + # # @param effective_date [String, nil] + # # @param unit [Symbol, FinchAPI::Models::Income::Unit, nil] + # # + # def initialize(amount: nil, currency: nil, effective_date: nil, unit: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # The income unit of payment. Options: `yearly`, `quarterly`, `monthly`, + # `semi_monthly`, `bi_weekly`, `weekly`, `daily`, `hourly`, and `fixed`. + # + # @example + # ```ruby + # case unit + # in :yearly + # # ... + # in :quarterly + # # ... + # in :monthly + # # ... + # in :semi_monthly + # # ... + # in :bi_weekly + # # ... + # in ... + # #... + # end + # ``` + class Unit < FinchAPI::Enum + YEARLY = :yearly + QUARTERLY = :quarterly + MONTHLY = :monthly + SEMI_MONTHLY = :semi_monthly + BI_WEEKLY = :bi_weekly + WEEKLY = :weekly + DAILY = :daily + HOURLY = :hourly + FIXED = :fixed + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end +end diff --git a/lib/finch-api/models/individual_event.rb b/lib/finch-api/models/individual_event.rb new file mode 100644 index 00000000..818affba --- /dev/null +++ b/lib/finch-api/models/individual_event.rb @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + class IndividualEvent < FinchAPI::Models::BaseWebhookEvent + # @!attribute [r] data + # + # @return [FinchAPI::Models::IndividualEvent::Data, nil] + optional :data, -> { FinchAPI::Models::IndividualEvent::Data } + + # @!parse + # # @return [FinchAPI::Models::IndividualEvent::Data] + # attr_writer :data + + # @!attribute [r] event_type + # + # @return [Symbol, FinchAPI::Models::IndividualEvent::EventType, nil] + optional :event_type, enum: -> { FinchAPI::Models::IndividualEvent::EventType } + + # @!parse + # # @return [Symbol, FinchAPI::Models::IndividualEvent::EventType] + # attr_writer :event_type + + # @!parse + # # @param data [FinchAPI::Models::IndividualEvent::Data] + # # @param event_type [Symbol, FinchAPI::Models::IndividualEvent::EventType] + # # + # def initialize(data: nil, event_type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Data < FinchAPI::BaseModel + # @!attribute [r] individual_id + # The ID of the individual related to the event. + # + # @return [String, nil] + optional :individual_id, String + + # @!parse + # # @return [String] + # attr_writer :individual_id + + # @!parse + # # @param individual_id [String] + # # + # def initialize(individual_id: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case event_type + # in :"individual.created" + # # ... + # in :"individual.updated" + # # ... + # in :"individual.deleted" + # # ... + # end + # ``` + class EventType < FinchAPI::Enum + INDIVIDUAL_CREATED = :"individual.created" + INDIVIDUAL_UPDATED = :"individual.updated" + INDIVIDUAL_DELETED = :"individual.deleted" + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end +end diff --git a/lib/finch-api/models/introspection.rb b/lib/finch-api/models/introspection.rb new file mode 100644 index 00000000..9d7db423 --- /dev/null +++ b/lib/finch-api/models/introspection.rb @@ -0,0 +1,342 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + class Introspection < FinchAPI::BaseModel + # @!attribute account_id + # [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection + # instead of this account ID. + # + # @return [String] + required :account_id, String + + # @!attribute authentication_methods + # + # @return [Array] + required :authentication_methods, + -> { FinchAPI::ArrayOf[FinchAPI::Models::Introspection::AuthenticationMethod] } + + # @!attribute client_id + # The client ID of the application associated with the `access_token`. + # + # @return [String] + required :client_id, String + + # @!attribute client_type + # The type of application associated with a token. + # + # @return [Symbol, FinchAPI::Models::Introspection::ClientType] + required :client_type, enum: -> { FinchAPI::Models::Introspection::ClientType } + + # @!attribute company_id + # [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection + # instead of this company ID. + # + # @return [String] + required :company_id, String + + # @!attribute connection_id + # The Finch UUID of the connection associated with the `access_token`. + # + # @return [String] + required :connection_id, String + + # @!attribute connection_status + # + # @return [FinchAPI::Models::Introspection::ConnectionStatus] + required :connection_status, -> { FinchAPI::Models::Introspection::ConnectionStatus } + + # @!attribute connection_type + # The type of the connection associated with the token. + # + # - `provider` - connection to an external provider + # - `finch` - finch-generated data. + # + # @return [Symbol, FinchAPI::Models::Introspection::ConnectionType] + required :connection_type, enum: -> { FinchAPI::Models::Introspection::ConnectionType } + + # @!attribute customer_email + # The email of your customer you provided to Finch when a connect session was + # created for this connection. + # + # @return [String, nil] + required :customer_email, String, nil?: true + + # @!attribute customer_id + # The ID of your customer you provided to Finch when a connect session was created + # for this connection. + # + # @return [String, nil] + required :customer_id, String, nil?: true + + # @!attribute customer_name + # The name of your customer you provided to Finch when a connect session was + # created for this connection. + # + # @return [String, nil] + required :customer_name, String, nil?: true + + # @!attribute manual + # Whether the connection associated with the `access_token` uses the Assisted + # Connect Flow. (`true` if using Assisted Connect, `false` if connection is + # automated) + # + # @return [Boolean] + required :manual, FinchAPI::BooleanModel + + # @!attribute payroll_provider_id + # [DEPRECATED] Use `provider_id` to identify the provider instead of this payroll + # provider ID. + # + # @return [String] + required :payroll_provider_id, String + + # @!attribute products + # An array of the authorized products associated with the `access_token`. + # + # @return [Array] + required :products, FinchAPI::ArrayOf[String] + + # @!attribute provider_id + # The ID of the provider associated with the `access_token`. + # + # @return [String] + required :provider_id, String + + # @!attribute username + # The account username used for login associated with the `access_token`. + # + # @return [String] + required :username, String + + # @!parse + # # @param account_id [String] + # # @param authentication_methods [Array] + # # @param client_id [String] + # # @param client_type [Symbol, FinchAPI::Models::Introspection::ClientType] + # # @param company_id [String] + # # @param connection_id [String] + # # @param connection_status [FinchAPI::Models::Introspection::ConnectionStatus] + # # @param connection_type [Symbol, FinchAPI::Models::Introspection::ConnectionType] + # # @param customer_email [String, nil] + # # @param customer_id [String, nil] + # # @param customer_name [String, nil] + # # @param manual [Boolean] + # # @param payroll_provider_id [String] + # # @param products [Array] + # # @param provider_id [String] + # # @param username [String] + # # + # def initialize( + # account_id:, + # authentication_methods:, + # client_id:, + # client_type:, + # company_id:, + # connection_id:, + # connection_status:, + # connection_type:, + # customer_email:, + # customer_id:, + # customer_name:, + # manual:, + # payroll_provider_id:, + # products:, + # provider_id:, + # username:, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class AuthenticationMethod < FinchAPI::BaseModel + # @!attribute [r] connection_status + # + # @return [FinchAPI::Models::Introspection::AuthenticationMethod::ConnectionStatus, nil] + optional :connection_status, + -> { FinchAPI::Models::Introspection::AuthenticationMethod::ConnectionStatus } + + # @!parse + # # @return [FinchAPI::Models::Introspection::AuthenticationMethod::ConnectionStatus] + # attr_writer :connection_status + + # @!attribute [r] products + # An array of the authorized products associated with the `access_token`. + # + # @return [Array, nil] + optional :products, FinchAPI::ArrayOf[String] + + # @!parse + # # @return [Array] + # attr_writer :products + + # @!attribute [r] type + # The type of authentication method. + # + # @return [Symbol, FinchAPI::Models::Introspection::AuthenticationMethod::Type, nil] + optional :type, enum: -> { FinchAPI::Models::Introspection::AuthenticationMethod::Type } + + # @!parse + # # @return [Symbol, FinchAPI::Models::Introspection::AuthenticationMethod::Type] + # attr_writer :type + + # @!parse + # # @param connection_status [FinchAPI::Models::Introspection::AuthenticationMethod::ConnectionStatus] + # # @param products [Array] + # # @param type [Symbol, FinchAPI::Models::Introspection::AuthenticationMethod::Type] + # # + # def initialize(connection_status: nil, products: nil, type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class ConnectionStatus < FinchAPI::BaseModel + # @!attribute [r] message + # + # @return [String, nil] + optional :message, String + + # @!parse + # # @return [String] + # attr_writer :message + + # @!attribute [r] status + # + # @return [Symbol, FinchAPI::Models::ConnectionStatusType, nil] + optional :status, enum: -> { FinchAPI::Models::ConnectionStatusType } + + # @!parse + # # @return [Symbol, FinchAPI::Models::ConnectionStatusType] + # attr_writer :status + + # @!parse + # # @param message [String] + # # @param status [Symbol, FinchAPI::Models::ConnectionStatusType] + # # + # def initialize(message: nil, status: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + # @abstract + # + # The type of authentication method. + # + # @example + # ```ruby + # case type + # in :assisted + # # ... + # in :credential + # # ... + # in :api_token + # # ... + # in :api_credential + # # ... + # in :oauth + # # ... + # end + # ``` + class Type < FinchAPI::Enum + ASSISTED = :assisted + CREDENTIAL = :credential + API_TOKEN = :api_token + API_CREDENTIAL = :api_credential + OAUTH = :oauth + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @abstract + # + # The type of application associated with a token. + # + # @example + # ```ruby + # case client_type + # in :production + # # ... + # in :development + # # ... + # in :sandbox + # # ... + # end + # ``` + class ClientType < FinchAPI::Enum + PRODUCTION = :production + DEVELOPMENT = :development + SANDBOX = :sandbox + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + class ConnectionStatus < FinchAPI::BaseModel + # @!attribute [r] message + # + # @return [String, nil] + optional :message, String + + # @!parse + # # @return [String] + # attr_writer :message + + # @!attribute [r] status + # + # @return [Symbol, FinchAPI::Models::ConnectionStatusType, nil] + optional :status, enum: -> { FinchAPI::Models::ConnectionStatusType } + + # @!parse + # # @return [Symbol, FinchAPI::Models::ConnectionStatusType] + # attr_writer :status + + # @!parse + # # @param message [String] + # # @param status [Symbol, FinchAPI::Models::ConnectionStatusType] + # # + # def initialize(message: nil, status: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + # @abstract + # + # The type of the connection associated with the token. + # + # - `provider` - connection to an external provider + # - `finch` - finch-generated data. + # + # @example + # ```ruby + # case connection_type + # in :provider + # # ... + # in :finch + # # ... + # end + # ``` + class ConnectionType < FinchAPI::Enum + PROVIDER = :provider + FINCH = :finch + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end +end diff --git a/lib/finch-api/models/job_completion_event.rb b/lib/finch-api/models/job_completion_event.rb new file mode 100644 index 00000000..895cd676 --- /dev/null +++ b/lib/finch-api/models/job_completion_event.rb @@ -0,0 +1,90 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + class JobCompletionEvent < FinchAPI::Models::BaseWebhookEvent + # @!attribute [r] data + # + # @return [FinchAPI::Models::JobCompletionEvent::Data, nil] + optional :data, -> { FinchAPI::Models::JobCompletionEvent::Data } + + # @!parse + # # @return [FinchAPI::Models::JobCompletionEvent::Data] + # attr_writer :data + + # @!attribute [r] event_type + # + # @return [Symbol, FinchAPI::Models::JobCompletionEvent::EventType, nil] + optional :event_type, enum: -> { FinchAPI::Models::JobCompletionEvent::EventType } + + # @!parse + # # @return [Symbol, FinchAPI::Models::JobCompletionEvent::EventType] + # attr_writer :event_type + + # @!parse + # # @param data [FinchAPI::Models::JobCompletionEvent::Data] + # # @param event_type [Symbol, FinchAPI::Models::JobCompletionEvent::EventType] + # # + # def initialize(data: nil, event_type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Data < FinchAPI::BaseModel + # @!attribute job_id + # The id of the job which has completed. + # + # @return [String] + required :job_id, String + + # @!attribute job_url + # The url to query the result of the job. + # + # @return [String] + required :job_url, String + + # @!parse + # # @param job_id [String] + # # @param job_url [String] + # # + # def initialize(job_id:, job_url:, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case event_type + # in :"job.benefit_create.completed" + # # ... + # in :"job.benefit_enroll.completed" + # # ... + # in :"job.benefit_register.completed" + # # ... + # in :"job.benefit_unenroll.completed" + # # ... + # in :"job.benefit_update.completed" + # # ... + # in ... + # #... + # end + # ``` + class EventType < FinchAPI::Enum + JOB_BENEFIT_CREATE_COMPLETED = :"job.benefit_create.completed" + JOB_BENEFIT_ENROLL_COMPLETED = :"job.benefit_enroll.completed" + JOB_BENEFIT_REGISTER_COMPLETED = :"job.benefit_register.completed" + JOB_BENEFIT_UNENROLL_COMPLETED = :"job.benefit_unenroll.completed" + JOB_BENEFIT_UPDATE_COMPLETED = :"job.benefit_update.completed" + JOB_DATA_SYNC_ALL_COMPLETED = :"job.data_sync_all.completed" + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end +end diff --git a/lib/finch-api/models/jobs/automated_async_job.rb b/lib/finch-api/models/jobs/automated_async_job.rb new file mode 100644 index 00000000..3addbe79 --- /dev/null +++ b/lib/finch-api/models/jobs/automated_async_job.rb @@ -0,0 +1,162 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module Jobs + class AutomatedAsyncJob < FinchAPI::BaseModel + # @!attribute completed_at + # The datetime the job completed. + # + # @return [Time, nil] + required :completed_at, Time, nil?: true + + # @!attribute created_at + # The datetime when the job was created. for scheduled jobs, this will be the + # initial connection time. For ad-hoc jobs, this will be the time the creation + # request was received. + # + # @return [Time] + required :created_at, Time + + # @!attribute job_id + # The id of the job that has been created. + # + # @return [String] + required :job_id, String + + # @!attribute job_url + # The url that can be used to retrieve the job status + # + # @return [String] + required :job_url, String + + # @!attribute params + # The input parameters for the job. + # + # @return [FinchAPI::Models::Jobs::AutomatedAsyncJob::Params, nil] + required :params, -> { FinchAPI::Models::Jobs::AutomatedAsyncJob::Params }, nil?: true + + # @!attribute scheduled_at + # The datetime a job is scheduled to be run. For scheduled jobs, this datetime can + # be in the future if the job has not yet been enqueued. For ad-hoc jobs, this + # field will be null. + # + # @return [Time, nil] + required :scheduled_at, Time, nil?: true + + # @!attribute started_at + # The datetime a job entered into the job queue. + # + # @return [Time, nil] + required :started_at, Time, nil?: true + + # @!attribute status + # + # @return [Symbol, FinchAPI::Models::Jobs::AutomatedAsyncJob::Status] + required :status, enum: -> { FinchAPI::Models::Jobs::AutomatedAsyncJob::Status } + + # @!attribute type + # The type of automated job + # + # @return [Symbol, FinchAPI::Models::Jobs::AutomatedAsyncJob::Type] + required :type, enum: -> { FinchAPI::Models::Jobs::AutomatedAsyncJob::Type } + + # @!parse + # # @param completed_at [Time, nil] + # # @param created_at [Time] + # # @param job_id [String] + # # @param job_url [String] + # # @param params [FinchAPI::Models::Jobs::AutomatedAsyncJob::Params, nil] + # # @param scheduled_at [Time, nil] + # # @param started_at [Time, nil] + # # @param status [Symbol, FinchAPI::Models::Jobs::AutomatedAsyncJob::Status] + # # @param type [Symbol, FinchAPI::Models::Jobs::AutomatedAsyncJob::Type] + # # + # def initialize(completed_at:, created_at:, job_id:, job_url:, params:, scheduled_at:, started_at:, status:, type:, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Params < FinchAPI::BaseModel + # @!attribute [r] individual_id + # The ID of the individual that the job was completed for. + # + # @return [String, nil] + optional :individual_id, String + + # @!parse + # # @return [String] + # attr_writer :individual_id + + # @!parse + # # The input parameters for the job. + # # + # # @param individual_id [String] + # # + # def initialize(individual_id: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case status + # in :pending + # # ... + # in :in_progress + # # ... + # in :complete + # # ... + # in :error + # # ... + # in :reauth_error + # # ... + # in ... + # #... + # end + # ``` + class Status < FinchAPI::Enum + PENDING = :pending + IN_PROGRESS = :in_progress + COMPLETE = :complete + ERROR = :error + REAUTH_ERROR = :reauth_error + PERMISSIONS_ERROR = :permissions_error + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @abstract + # + # The type of automated job + # + # @example + # ```ruby + # case type + # in :data_sync_all + # # ... + # in :w4_form_employee_sync + # # ... + # end + # ``` + class Type < FinchAPI::Enum + DATA_SYNC_ALL = :data_sync_all + W4_FORM_EMPLOYEE_SYNC = :w4_form_employee_sync + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end +end diff --git a/lib/finch-api/models/jobs/automated_create_params.rb b/lib/finch-api/models/jobs/automated_create_params.rb new file mode 100644 index 00000000..b4fdf4a1 --- /dev/null +++ b/lib/finch-api/models/jobs/automated_create_params.rb @@ -0,0 +1,70 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module Jobs + class AutomatedCreateParams < FinchAPI::BaseModel + # @!parse + # extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + # @!attribute type + # The type of job to start. + # + # @return [Symbol, FinchAPI::Models::Jobs::AutomatedCreateParams::Type] + required :type, enum: -> { FinchAPI::Models::Jobs::AutomatedCreateParams::Type } + + # @!attribute params + # + # @return [FinchAPI::Models::Jobs::AutomatedCreateParams::Params] + required :params, -> { FinchAPI::Models::Jobs::AutomatedCreateParams::Params } + + # @!parse + # # @param type [Symbol, FinchAPI::Models::Jobs::AutomatedCreateParams::Type] + # # @param params [FinchAPI::Models::Jobs::AutomatedCreateParams::Params] + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(type:, params:, request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # The type of job to start. + # + # @example + # ```ruby + # case type + # in :w4_form_employee_sync + # # ... + # end + # ``` + class Type < FinchAPI::Enum + W4_FORM_EMPLOYEE_SYNC = :w4_form_employee_sync + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + class Params < FinchAPI::BaseModel + # @!attribute individual_id + # The unique ID of the individual for W-4 data sync. + # + # @return [String] + required :individual_id, String + + # @!parse + # # @param individual_id [String] + # # + # def initialize(individual_id:, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end + end +end diff --git a/lib/finch-api/models/jobs/automated_create_response.rb b/lib/finch-api/models/jobs/automated_create_response.rb new file mode 100644 index 00000000..508b7f55 --- /dev/null +++ b/lib/finch-api/models/jobs/automated_create_response.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module Jobs + class AutomatedCreateResponse < FinchAPI::BaseModel + # @!attribute allowed_refreshes + # The number of allowed refreshes per hour (per hour, fixed window) + # + # @return [Integer] + required :allowed_refreshes, Integer + + # @!attribute job_id + # The id of the job that has been created. + # + # @return [String] + required :job_id, String + + # @!attribute job_url + # The url that can be used to retrieve the job status + # + # @return [String] + required :job_url, String + + # @!attribute remaining_refreshes + # The number of remaining refreshes available (per hour, fixed window) + # + # @return [Integer] + required :remaining_refreshes, Integer + + # @!parse + # # @param allowed_refreshes [Integer] + # # @param job_id [String] + # # @param job_url [String] + # # @param remaining_refreshes [Integer] + # # + # def initialize(allowed_refreshes:, job_id:, job_url:, remaining_refreshes:, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end +end diff --git a/lib/finch-api/models/jobs/automated_list_params.rb b/lib/finch-api/models/jobs/automated_list_params.rb new file mode 100644 index 00000000..8ed6809e --- /dev/null +++ b/lib/finch-api/models/jobs/automated_list_params.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module Jobs + class AutomatedListParams < FinchAPI::BaseModel + # @!parse + # extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + # @!attribute [r] limit + # Number of items to return + # + # @return [Integer, nil] + optional :limit, Integer + + # @!parse + # # @return [Integer] + # attr_writer :limit + + # @!attribute [r] offset + # Index to start from (defaults to 0) + # + # @return [Integer, nil] + optional :offset, Integer + + # @!parse + # # @return [Integer] + # attr_writer :offset + + # @!parse + # # @param limit [Integer] + # # @param offset [Integer] + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(limit: nil, offset: nil, request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end +end diff --git a/lib/finch-api/models/jobs/automated_retrieve_params.rb b/lib/finch-api/models/jobs/automated_retrieve_params.rb new file mode 100644 index 00000000..bf115a42 --- /dev/null +++ b/lib/finch-api/models/jobs/automated_retrieve_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module Jobs + class AutomatedRetrieveParams < FinchAPI::BaseModel + # @!parse + # extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + # @!parse + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end +end diff --git a/lib/finch-api/models/jobs/manual_async_job.rb b/lib/finch-api/models/jobs/manual_async_job.rb new file mode 100644 index 00000000..f16a6248 --- /dev/null +++ b/lib/finch-api/models/jobs/manual_async_job.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module Jobs + class ManualAsyncJob < FinchAPI::BaseModel + # @!attribute body + # Specific information about the job, such as individual statuses for batch jobs. + # + # @return [Array, nil] + required :body, FinchAPI::ArrayOf[FinchAPI::Unknown], nil?: true + + # @!attribute job_id + # + # @return [String] + required :job_id, String + + # @!attribute status + # + # @return [Symbol, FinchAPI::Models::Jobs::ManualAsyncJob::Status] + required :status, enum: -> { FinchAPI::Models::Jobs::ManualAsyncJob::Status } + + # @!parse + # # @param body [Array, nil] + # # @param job_id [String] + # # @param status [Symbol, FinchAPI::Models::Jobs::ManualAsyncJob::Status] + # # + # def initialize(body:, job_id:, status:, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case status + # in :pending + # # ... + # in :in_progress + # # ... + # in :error + # # ... + # in :complete + # # ... + # end + # ``` + class Status < FinchAPI::Enum + PENDING = :pending + IN_PROGRESS = :in_progress + ERROR = :error + COMPLETE = :complete + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end +end diff --git a/lib/finch-api/models/jobs/manual_retrieve_params.rb b/lib/finch-api/models/jobs/manual_retrieve_params.rb new file mode 100644 index 00000000..175d6ac3 --- /dev/null +++ b/lib/finch-api/models/jobs/manual_retrieve_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module Jobs + class ManualRetrieveParams < FinchAPI::BaseModel + # @!parse + # extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + # @!parse + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end +end diff --git a/lib/finch-api/models/location.rb b/lib/finch-api/models/location.rb new file mode 100644 index 00000000..5fe8f107 --- /dev/null +++ b/lib/finch-api/models/location.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + class Location < FinchAPI::BaseModel + # @!attribute city + # City, district, suburb, town, or village. + # + # @return [String, nil] + optional :city, String, nil?: true + + # @!attribute country + # The 2-letter ISO 3166 country code. + # + # @return [String, nil] + optional :country, String, nil?: true + + # @!attribute line1 + # Street address or PO box. + # + # @return [String, nil] + optional :line1, String, nil?: true + + # @!attribute line2 + # Apartment, suite, unit, or building. + # + # @return [String, nil] + optional :line2, String, nil?: true + + # @!attribute name + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute postal_code + # The postal code or zip code. + # + # @return [String, nil] + optional :postal_code, String, nil?: true + + # @!attribute source_id + # + # @return [String, nil] + optional :source_id, String, nil?: true + + # @!attribute state + # The state code. + # + # @return [String, nil] + optional :state, String, nil?: true + + # @!parse + # # @param city [String, nil] + # # @param country [String, nil] + # # @param line1 [String, nil] + # # @param line2 [String, nil] + # # @param name [String, nil] + # # @param postal_code [String, nil] + # # @param source_id [String, nil] + # # @param state [String, nil] + # # + # def initialize( + # city: nil, + # country: nil, + # line1: nil, + # line2: nil, + # name: nil, + # postal_code: nil, + # source_id: nil, + # state: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end +end diff --git a/lib/finch-api/models/money.rb b/lib/finch-api/models/money.rb new file mode 100644 index 00000000..bd1f254e --- /dev/null +++ b/lib/finch-api/models/money.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + class Money < FinchAPI::BaseModel + # @!attribute amount + # Amount for money object (in cents) + # + # @return [Integer, nil] + optional :amount, Integer, nil?: true + + # @!attribute [r] currency + # + # @return [String, nil] + optional :currency, String + + # @!parse + # # @return [String] + # attr_writer :currency + + # @!parse + # # @param amount [Integer, nil] + # # @param currency [String] + # # + # def initialize(amount: nil, currency: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end +end diff --git a/lib/finch-api/models/operation_support.rb b/lib/finch-api/models/operation_support.rb new file mode 100644 index 00000000..b886afc8 --- /dev/null +++ b/lib/finch-api/models/operation_support.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + # @abstract + # + # - `supported`: This operation is supported by both the provider and Finch + # - `not_supported_by_finch`: This operation is not supported by Finch but + # supported by the provider + # - `not_supported_by_provider`: This operation is not supported by the provider, + # so Finch cannot support + # - `client_access_only`: This behavior is supported by the provider, but only + # available to the client and not to Finch + # + # @example + # ```ruby + # case operation_support + # in :supported + # # ... + # in :not_supported_by_finch + # # ... + # in :not_supported_by_provider + # # ... + # in :client_access_only + # # ... + # end + # ``` + class OperationSupport < FinchAPI::Enum + SUPPORTED = :supported + NOT_SUPPORTED_BY_FINCH = :not_supported_by_finch + NOT_SUPPORTED_BY_PROVIDER = :not_supported_by_provider + CLIENT_ACCESS_ONLY = :client_access_only + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end +end diff --git a/lib/finch-api/models/operation_support_matrix.rb b/lib/finch-api/models/operation_support_matrix.rb new file mode 100644 index 00000000..3a41278d --- /dev/null +++ b/lib/finch-api/models/operation_support_matrix.rb @@ -0,0 +1,81 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + class OperationSupportMatrix < FinchAPI::BaseModel + # @!attribute [r] create + # - `supported`: This operation is supported by both the provider and Finch + # - `not_supported_by_finch`: This operation is not supported by Finch but + # supported by the provider + # - `not_supported_by_provider`: This operation is not supported by the provider, + # so Finch cannot support + # - `client_access_only`: This behavior is supported by the provider, but only + # available to the client and not to Finch + # + # @return [Symbol, FinchAPI::Models::OperationSupport, nil] + optional :create, enum: -> { FinchAPI::Models::OperationSupport } + + # @!parse + # # @return [Symbol, FinchAPI::Models::OperationSupport] + # attr_writer :create + + # @!attribute [r] delete + # - `supported`: This operation is supported by both the provider and Finch + # - `not_supported_by_finch`: This operation is not supported by Finch but + # supported by the provider + # - `not_supported_by_provider`: This operation is not supported by the provider, + # so Finch cannot support + # - `client_access_only`: This behavior is supported by the provider, but only + # available to the client and not to Finch + # + # @return [Symbol, FinchAPI::Models::OperationSupport, nil] + optional :delete, enum: -> { FinchAPI::Models::OperationSupport } + + # @!parse + # # @return [Symbol, FinchAPI::Models::OperationSupport] + # attr_writer :delete + + # @!attribute [r] read + # - `supported`: This operation is supported by both the provider and Finch + # - `not_supported_by_finch`: This operation is not supported by Finch but + # supported by the provider + # - `not_supported_by_provider`: This operation is not supported by the provider, + # so Finch cannot support + # - `client_access_only`: This behavior is supported by the provider, but only + # available to the client and not to Finch + # + # @return [Symbol, FinchAPI::Models::OperationSupport, nil] + optional :read, enum: -> { FinchAPI::Models::OperationSupport } + + # @!parse + # # @return [Symbol, FinchAPI::Models::OperationSupport] + # attr_writer :read + + # @!attribute [r] update + # - `supported`: This operation is supported by both the provider and Finch + # - `not_supported_by_finch`: This operation is not supported by Finch but + # supported by the provider + # - `not_supported_by_provider`: This operation is not supported by the provider, + # so Finch cannot support + # - `client_access_only`: This behavior is supported by the provider, but only + # available to the client and not to Finch + # + # @return [Symbol, FinchAPI::Models::OperationSupport, nil] + optional :update, enum: -> { FinchAPI::Models::OperationSupport } + + # @!parse + # # @return [Symbol, FinchAPI::Models::OperationSupport] + # attr_writer :update + + # @!parse + # # @param create [Symbol, FinchAPI::Models::OperationSupport] + # # @param delete [Symbol, FinchAPI::Models::OperationSupport] + # # @param read [Symbol, FinchAPI::Models::OperationSupport] + # # @param update [Symbol, FinchAPI::Models::OperationSupport] + # # + # def initialize(create: nil, delete: nil, read: nil, update: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end +end diff --git a/lib/finch-api/models/paging.rb b/lib/finch-api/models/paging.rb new file mode 100644 index 00000000..c540e2c9 --- /dev/null +++ b/lib/finch-api/models/paging.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + class Paging < FinchAPI::BaseModel + # @!attribute [r] count + # The total number of elements for the entire query (not just the given page) + # + # @return [Integer, nil] + optional :count, Integer + + # @!parse + # # @return [Integer] + # attr_writer :count + + # @!attribute [r] offset + # The current start index of the returned list of elements + # + # @return [Integer, nil] + optional :offset, Integer + + # @!parse + # # @return [Integer] + # attr_writer :offset + + # @!parse + # # @param count [Integer] + # # @param offset [Integer] + # # + # def initialize(count: nil, offset: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end +end diff --git a/lib/finch-api/models/pay_statement_event.rb b/lib/finch-api/models/pay_statement_event.rb new file mode 100644 index 00000000..a336948a --- /dev/null +++ b/lib/finch-api/models/pay_statement_event.rb @@ -0,0 +1,89 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + class PayStatementEvent < FinchAPI::Models::BaseWebhookEvent + # @!attribute [r] data + # + # @return [FinchAPI::Models::PayStatementEvent::Data, nil] + optional :data, -> { FinchAPI::Models::PayStatementEvent::Data } + + # @!parse + # # @return [FinchAPI::Models::PayStatementEvent::Data] + # attr_writer :data + + # @!attribute [r] event_type + # + # @return [Symbol, FinchAPI::Models::PayStatementEvent::EventType, nil] + optional :event_type, enum: -> { FinchAPI::Models::PayStatementEvent::EventType } + + # @!parse + # # @return [Symbol, FinchAPI::Models::PayStatementEvent::EventType] + # attr_writer :event_type + + # @!parse + # # @param data [FinchAPI::Models::PayStatementEvent::Data] + # # @param event_type [Symbol, FinchAPI::Models::PayStatementEvent::EventType] + # # + # def initialize(data: nil, event_type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Data < FinchAPI::BaseModel + # @!attribute [r] individual_id + # The ID of the individual associated with the pay statement. + # + # @return [String, nil] + optional :individual_id, String + + # @!parse + # # @return [String] + # attr_writer :individual_id + + # @!attribute [r] payment_id + # The ID of the payment associated with the pay statement. + # + # @return [String, nil] + optional :payment_id, String + + # @!parse + # # @return [String] + # attr_writer :payment_id + + # @!parse + # # @param individual_id [String] + # # @param payment_id [String] + # # + # def initialize(individual_id: nil, payment_id: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case event_type + # in :"pay_statement.created" + # # ... + # in :"pay_statement.updated" + # # ... + # in :"pay_statement.deleted" + # # ... + # end + # ``` + class EventType < FinchAPI::Enum + PAY_STATEMENT_CREATED = :"pay_statement.created" + PAY_STATEMENT_UPDATED = :"pay_statement.updated" + PAY_STATEMENT_DELETED = :"pay_statement.deleted" + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end +end diff --git a/lib/finch-api/models/payment_event.rb b/lib/finch-api/models/payment_event.rb new file mode 100644 index 00000000..8a976da6 --- /dev/null +++ b/lib/finch-api/models/payment_event.rb @@ -0,0 +1,81 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + class PaymentEvent < FinchAPI::Models::BaseWebhookEvent + # @!attribute [r] data + # + # @return [FinchAPI::Models::PaymentEvent::Data, nil] + optional :data, -> { FinchAPI::Models::PaymentEvent::Data } + + # @!parse + # # @return [FinchAPI::Models::PaymentEvent::Data] + # attr_writer :data + + # @!attribute [r] event_type + # + # @return [Symbol, FinchAPI::Models::PaymentEvent::EventType, nil] + optional :event_type, enum: -> { FinchAPI::Models::PaymentEvent::EventType } + + # @!parse + # # @return [Symbol, FinchAPI::Models::PaymentEvent::EventType] + # attr_writer :event_type + + # @!parse + # # @param data [FinchAPI::Models::PaymentEvent::Data] + # # @param event_type [Symbol, FinchAPI::Models::PaymentEvent::EventType] + # # + # def initialize(data: nil, event_type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Data < FinchAPI::BaseModel + # @!attribute pay_date + # The date of the payment. + # + # @return [String] + required :pay_date, String + + # @!attribute payment_id + # The ID of the payment. + # + # @return [String] + required :payment_id, String + + # @!parse + # # @param pay_date [String] + # # @param payment_id [String] + # # + # def initialize(pay_date:, payment_id:, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + # @abstract + # + # @example + # ```ruby + # case event_type + # in :"payment.created" + # # ... + # in :"payment.updated" + # # ... + # in :"payment.deleted" + # # ... + # end + # ``` + class EventType < FinchAPI::Enum + PAYMENT_CREATED = :"payment.created" + PAYMENT_UPDATED = :"payment.updated" + PAYMENT_DELETED = :"payment.deleted" + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end +end diff --git a/lib/finch-api/models/payroll/pay_group_list_params.rb b/lib/finch-api/models/payroll/pay_group_list_params.rb new file mode 100644 index 00000000..91a45f81 --- /dev/null +++ b/lib/finch-api/models/payroll/pay_group_list_params.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module Payroll + class PayGroupListParams < FinchAPI::BaseModel + # @!parse + # extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + # @!attribute [r] individual_id + # + # @return [String, nil] + optional :individual_id, String + + # @!parse + # # @return [String] + # attr_writer :individual_id + + # @!attribute [r] pay_frequencies + # + # @return [Array, nil] + optional :pay_frequencies, FinchAPI::ArrayOf[String] + + # @!parse + # # @return [Array] + # attr_writer :pay_frequencies + + # @!parse + # # @param individual_id [String] + # # @param pay_frequencies [Array] + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(individual_id: nil, pay_frequencies: nil, request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end +end diff --git a/lib/finch-api/models/payroll/pay_group_list_response.rb b/lib/finch-api/models/payroll/pay_group_list_response.rb new file mode 100644 index 00000000..524a6aae --- /dev/null +++ b/lib/finch-api/models/payroll/pay_group_list_response.rb @@ -0,0 +1,87 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module Payroll + class PayGroupListResponse < FinchAPI::BaseModel + # @!attribute [r] id + # Finch id (uuidv4) for the pay group + # + # @return [String, nil] + optional :id, String + + # @!parse + # # @return [String] + # attr_writer :id + + # @!attribute [r] name + # Name of the pay group + # + # @return [String, nil] + optional :name, String + + # @!parse + # # @return [String] + # attr_writer :name + + # @!attribute [r] pay_frequencies + # List of pay frequencies associated with this pay group + # + # @return [Array, nil] + optional :pay_frequencies, + -> { FinchAPI::ArrayOf[enum: FinchAPI::Models::Payroll::PayGroupListResponse::PayFrequency] } + + # @!parse + # # @return [Array] + # attr_writer :pay_frequencies + + # @!parse + # # @param id [String] + # # @param name [String] + # # @param pay_frequencies [Array] + # # + # def initialize(id: nil, name: nil, pay_frequencies: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case pay_frequency + # in :annually + # # ... + # in :semi_annually + # # ... + # in :quarterly + # # ... + # in :monthly + # # ... + # in :semi_monthly + # # ... + # in ... + # #... + # end + # ``` + class PayFrequency < FinchAPI::Enum + ANNUALLY = :annually + SEMI_ANNUALLY = :semi_annually + QUARTERLY = :quarterly + MONTHLY = :monthly + SEMI_MONTHLY = :semi_monthly + BI_WEEKLY = :bi_weekly + WEEKLY = :weekly + DAILY = :daily + OTHER = :other + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end +end diff --git a/lib/finch-api/models/payroll/pay_group_retrieve_params.rb b/lib/finch-api/models/payroll/pay_group_retrieve_params.rb new file mode 100644 index 00000000..2a79cfa7 --- /dev/null +++ b/lib/finch-api/models/payroll/pay_group_retrieve_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module Payroll + class PayGroupRetrieveParams < FinchAPI::BaseModel + # @!parse + # extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + # @!parse + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end +end diff --git a/lib/finch-api/models/payroll/pay_group_retrieve_response.rb b/lib/finch-api/models/payroll/pay_group_retrieve_response.rb new file mode 100644 index 00000000..7220ce13 --- /dev/null +++ b/lib/finch-api/models/payroll/pay_group_retrieve_response.rb @@ -0,0 +1,81 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module Payroll + class PayGroupRetrieveResponse < FinchAPI::BaseModel + # @!attribute id + # Finch id (uuidv4) for the pay group + # + # @return [String] + required :id, String + + # @!attribute individual_ids + # + # @return [Array] + required :individual_ids, FinchAPI::ArrayOf[String] + + # @!attribute name + # Name of the pay group + # + # @return [String] + required :name, String + + # @!attribute pay_frequencies + # List of pay frequencies associated with this pay group + # + # @return [Array] + required :pay_frequencies, + -> { FinchAPI::ArrayOf[enum: FinchAPI::Models::Payroll::PayGroupRetrieveResponse::PayFrequency] } + + # @!parse + # # @param id [String] + # # @param individual_ids [Array] + # # @param name [String] + # # @param pay_frequencies [Array] + # # + # def initialize(id:, individual_ids:, name:, pay_frequencies:, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case pay_frequency + # in :annually + # # ... + # in :semi_annually + # # ... + # in :quarterly + # # ... + # in :monthly + # # ... + # in :semi_monthly + # # ... + # in ... + # #... + # end + # ``` + class PayFrequency < FinchAPI::Enum + ANNUALLY = :annually + SEMI_ANNUALLY = :semi_annually + QUARTERLY = :quarterly + MONTHLY = :monthly + SEMI_MONTHLY = :semi_monthly + BI_WEEKLY = :bi_weekly + WEEKLY = :weekly + DAILY = :daily + OTHER = :other + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end +end diff --git a/lib/finch-api/models/provider.rb b/lib/finch-api/models/provider.rb new file mode 100644 index 00000000..b246e22d --- /dev/null +++ b/lib/finch-api/models/provider.rb @@ -0,0 +1,2039 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + class Provider < FinchAPI::BaseModel + # @!attribute [r] id + # The id of the payroll provider used in Connect. + # + # @return [String, nil] + optional :id, String + + # @!parse + # # @return [String] + # attr_writer :id + + # @!attribute [r] authentication_methods + # The list of authentication methods supported by the provider. + # + # @return [Array, nil] + optional :authentication_methods, + -> { FinchAPI::ArrayOf[FinchAPI::Models::Provider::AuthenticationMethod] } + + # @!parse + # # @return [Array] + # attr_writer :authentication_methods + + # @!attribute [r] beta + # `true` if the integration is in a beta state, `false` otherwise + # + # @return [Boolean, nil] + optional :beta, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :beta + + # @!attribute [r] display_name + # The display name of the payroll provider. + # + # @return [String, nil] + optional :display_name, String + + # @!parse + # # @return [String] + # attr_writer :display_name + + # @!attribute [r] icon + # The url to the official icon of the payroll provider. + # + # @return [String, nil] + optional :icon, String + + # @!parse + # # @return [String] + # attr_writer :icon + + # @!attribute [r] logo + # The url to the official logo of the payroll provider. + # + # @return [String, nil] + optional :logo, String + + # @!parse + # # @return [String] + # attr_writer :logo + + # @!attribute [r] manual + # [DEPRECATED] Whether the Finch integration with this provider uses the Assisted + # Connect Flow by default. This field is now deprecated. Please check for a `type` + # of `assisted` in the `authentication_methods` field instead. + # + # @return [Boolean, nil] + optional :manual, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :manual + + # @!attribute [r] mfa_required + # whether MFA is required for the provider. + # + # @return [Boolean, nil] + optional :mfa_required, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :mfa_required + + # @!attribute [r] primary_color + # The hex code for the primary color of the payroll provider. + # + # @return [String, nil] + optional :primary_color, String + + # @!parse + # # @return [String] + # attr_writer :primary_color + + # @!attribute [r] products + # The list of Finch products supported on this payroll provider. + # + # @return [Array, nil] + optional :products, FinchAPI::ArrayOf[String] + + # @!parse + # # @return [Array] + # attr_writer :products + + # @!parse + # # @param id [String] + # # @param authentication_methods [Array] + # # @param beta [Boolean] + # # @param display_name [String] + # # @param icon [String] + # # @param logo [String] + # # @param manual [Boolean] + # # @param mfa_required [Boolean] + # # @param primary_color [String] + # # @param products [Array] + # # + # def initialize( + # id: nil, + # authentication_methods: nil, + # beta: nil, + # display_name: nil, + # icon: nil, + # logo: nil, + # manual: nil, + # mfa_required: nil, + # primary_color: nil, + # products: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class AuthenticationMethod < FinchAPI::BaseModel + # @!attribute benefits_support + # Each benefit type and their supported features. If the benefit type is not + # supported, the property will be null + # + # @return [FinchAPI::Models::HRIS::BenefitsSupport, nil] + optional :benefits_support, -> { FinchAPI::Models::HRIS::BenefitsSupport }, nil?: true + + # @!attribute supported_fields + # The supported data fields returned by our HR and payroll endpoints + # + # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields, nil] + optional :supported_fields, + -> { FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields }, + nil?: true + + # @!attribute [r] type + # The type of authentication method. + # + # @return [Symbol, FinchAPI::Models::Provider::AuthenticationMethod::Type, nil] + optional :type, enum: -> { FinchAPI::Models::Provider::AuthenticationMethod::Type } + + # @!parse + # # @return [Symbol, FinchAPI::Models::Provider::AuthenticationMethod::Type] + # attr_writer :type + + # @!parse + # # @param benefits_support [FinchAPI::Models::HRIS::BenefitsSupport, nil] + # # @param supported_fields [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields, nil] + # # @param type [Symbol, FinchAPI::Models::Provider::AuthenticationMethod::Type] + # # + # def initialize(benefits_support: nil, supported_fields: nil, type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class SupportedFields < FinchAPI::BaseModel + # @!attribute [r] company + # + # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company, nil] + optional :company, -> { FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company } + + # @!parse + # # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company] + # attr_writer :company + + # @!attribute [r] directory + # + # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory, nil] + optional :directory, -> { FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory } + + # @!parse + # # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory] + # attr_writer :directory + + # @!attribute [r] employment + # + # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment, nil] + optional :employment, -> { FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment } + + # @!parse + # # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment] + # attr_writer :employment + + # @!attribute [r] individual + # + # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual, nil] + optional :individual, -> { FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual } + + # @!parse + # # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual] + # attr_writer :individual + + # @!attribute [r] pay_group + # + # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayGroup, nil] + optional :pay_group, -> { FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayGroup } + + # @!parse + # # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayGroup] + # attr_writer :pay_group + + # @!attribute [r] pay_statement + # + # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement, nil] + optional :pay_statement, + -> { FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement } + + # @!parse + # # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement] + # attr_writer :pay_statement + + # @!attribute [r] payment + # + # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment, nil] + optional :payment, -> { FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment } + + # @!parse + # # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment] + # attr_writer :payment + + # @!parse + # # The supported data fields returned by our HR and payroll endpoints + # # + # # @param company [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company] + # # @param directory [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory] + # # @param employment [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment] + # # @param individual [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual] + # # @param pay_group [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayGroup] + # # @param pay_statement [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement] + # # @param payment [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment] + # # + # def initialize( + # company: nil, + # directory: nil, + # employment: nil, + # individual: nil, + # pay_group: nil, + # pay_statement: nil, + # payment: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Company < FinchAPI::BaseModel + # @!attribute [r] id + # + # @return [Boolean, nil] + optional :id, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :id + + # @!attribute [r] accounts + # + # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Accounts, nil] + optional :accounts, + -> { FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Accounts } + + # @!parse + # # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Accounts] + # attr_writer :accounts + + # @!attribute [r] departments + # + # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments, nil] + optional :departments, + -> { FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments } + + # @!parse + # # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments] + # attr_writer :departments + + # @!attribute [r] ein + # + # @return [Boolean, nil] + optional :ein, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :ein + + # @!attribute [r] entity + # + # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Entity, nil] + optional :entity, + -> { FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Entity } + + # @!parse + # # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Entity] + # attr_writer :entity + + # @!attribute [r] legal_name + # + # @return [Boolean, nil] + optional :legal_name, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :legal_name + + # @!attribute [r] locations + # + # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Locations, nil] + optional :locations, + -> { FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Locations } + + # @!parse + # # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Locations] + # attr_writer :locations + + # @!attribute [r] primary_email + # + # @return [Boolean, nil] + optional :primary_email, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :primary_email + + # @!attribute [r] primary_phone_number + # + # @return [Boolean, nil] + optional :primary_phone_number, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :primary_phone_number + + # @!parse + # # @param id [Boolean] + # # @param accounts [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Accounts] + # # @param departments [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments] + # # @param ein [Boolean] + # # @param entity [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Entity] + # # @param legal_name [Boolean] + # # @param locations [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Locations] + # # @param primary_email [Boolean] + # # @param primary_phone_number [Boolean] + # # + # def initialize( + # id: nil, + # accounts: nil, + # departments: nil, + # ein: nil, + # entity: nil, + # legal_name: nil, + # locations: nil, + # primary_email: nil, + # primary_phone_number: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Accounts < FinchAPI::BaseModel + # @!attribute [r] account_name + # + # @return [Boolean, nil] + optional :account_name, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :account_name + + # @!attribute [r] account_number + # + # @return [Boolean, nil] + optional :account_number, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :account_number + + # @!attribute [r] account_type + # + # @return [Boolean, nil] + optional :account_type, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :account_type + + # @!attribute [r] institution_name + # + # @return [Boolean, nil] + optional :institution_name, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :institution_name + + # @!attribute [r] routing_number + # + # @return [Boolean, nil] + optional :routing_number, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :routing_number + + # @!parse + # # @param account_name [Boolean] + # # @param account_number [Boolean] + # # @param account_type [Boolean] + # # @param institution_name [Boolean] + # # @param routing_number [Boolean] + # # + # def initialize(account_name: nil, account_number: nil, account_type: nil, institution_name: nil, routing_number: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + class Departments < FinchAPI::BaseModel + # @!attribute [r] name + # + # @return [Boolean, nil] + optional :name, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :name + + # @!attribute [r] parent + # + # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments::Parent, nil] + optional :parent, + -> { FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments::Parent } + + # @!parse + # # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments::Parent] + # attr_writer :parent + + # @!parse + # # @param name [Boolean] + # # @param parent [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments::Parent] + # # + # def initialize(name: nil, parent: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Parent < FinchAPI::BaseModel + # @!attribute [r] name + # + # @return [Boolean, nil] + optional :name, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :name + + # @!parse + # # @param name [Boolean] + # # + # def initialize(name: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + + class Entity < FinchAPI::BaseModel + # @!attribute [r] subtype + # + # @return [Boolean, nil] + optional :subtype, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :subtype + + # @!attribute [r] type + # + # @return [Boolean, nil] + optional :type, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :type + + # @!parse + # # @param subtype [Boolean] + # # @param type [Boolean] + # # + # def initialize(subtype: nil, type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + class Locations < FinchAPI::BaseModel + # @!attribute [r] city + # + # @return [Boolean, nil] + optional :city, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :city + + # @!attribute [r] country + # + # @return [Boolean, nil] + optional :country, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :country + + # @!attribute [r] line1 + # + # @return [Boolean, nil] + optional :line1, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :line1 + + # @!attribute [r] line2 + # + # @return [Boolean, nil] + optional :line2, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :line2 + + # @!attribute [r] postal_code + # + # @return [Boolean, nil] + optional :postal_code, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :postal_code + + # @!attribute [r] state + # + # @return [Boolean, nil] + optional :state, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :state + + # @!parse + # # @param city [Boolean] + # # @param country [Boolean] + # # @param line1 [Boolean] + # # @param line2 [Boolean] + # # @param postal_code [Boolean] + # # @param state [Boolean] + # # + # def initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + + class Directory < FinchAPI::BaseModel + # @!attribute [r] individuals + # + # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals, nil] + optional :individuals, + -> { FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals } + + # @!parse + # # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals] + # attr_writer :individuals + + # @!attribute [r] paging + # + # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Paging, nil] + optional :paging, + -> { FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Paging } + + # @!parse + # # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Paging] + # attr_writer :paging + + # @!parse + # # @param individuals [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals] + # # @param paging [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Paging] + # # + # def initialize(individuals: nil, paging: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Individuals < FinchAPI::BaseModel + # @!attribute [r] id + # + # @return [Boolean, nil] + optional :id, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :id + + # @!attribute [r] department + # + # @return [Boolean, nil] + optional :department, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :department + + # @!attribute [r] first_name + # + # @return [Boolean, nil] + optional :first_name, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :first_name + + # @!attribute [r] is_active + # + # @return [Boolean, nil] + optional :is_active, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :is_active + + # @!attribute [r] last_name + # + # @return [Boolean, nil] + optional :last_name, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :last_name + + # @!attribute [r] manager + # + # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager, nil] + optional :manager, + -> { FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager } + + # @!parse + # # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager] + # attr_writer :manager + + # @!attribute [r] middle_name + # + # @return [Boolean, nil] + optional :middle_name, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :middle_name + + # @!parse + # # @param id [Boolean] + # # @param department [Boolean] + # # @param first_name [Boolean] + # # @param is_active [Boolean] + # # @param last_name [Boolean] + # # @param manager [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager] + # # @param middle_name [Boolean] + # # + # def initialize( + # id: nil, + # department: nil, + # first_name: nil, + # is_active: nil, + # last_name: nil, + # manager: nil, + # middle_name: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Manager < FinchAPI::BaseModel + # @!attribute [r] id + # + # @return [Boolean, nil] + optional :id, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :id + + # @!parse + # # @param id [Boolean] + # # + # def initialize(id: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + + class Paging < FinchAPI::BaseModel + # @!attribute [r] count + # + # @return [Boolean, nil] + optional :count, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :count + + # @!attribute [r] offset + # + # @return [Boolean, nil] + optional :offset, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :offset + + # @!parse + # # @param count [Boolean] + # # @param offset [Boolean] + # # + # def initialize(count: nil, offset: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + + class Employment < FinchAPI::BaseModel + # @!attribute [r] id + # + # @return [Boolean, nil] + optional :id, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :id + + # @!attribute [r] class_code + # + # @return [Boolean, nil] + optional :class_code, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :class_code + + # @!attribute [r] custom_fields + # + # @return [Boolean, nil] + optional :custom_fields, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :custom_fields + + # @!attribute [r] department + # + # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Department, nil] + optional :department, + -> { FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Department } + + # @!parse + # # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Department] + # attr_writer :department + + # @!attribute [r] employment + # + # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Employment, nil] + optional :employment, + -> { FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Employment } + + # @!parse + # # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Employment] + # attr_writer :employment + + # @!attribute [r] employment_status + # + # @return [Boolean, nil] + optional :employment_status, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :employment_status + + # @!attribute [r] end_date + # + # @return [Boolean, nil] + optional :end_date, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :end_date + + # @!attribute [r] first_name + # + # @return [Boolean, nil] + optional :first_name, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :first_name + + # @!attribute [r] income + # + # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Income, nil] + optional :income, + -> { FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Income } + + # @!parse + # # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Income] + # attr_writer :income + + # @!attribute [r] income_history + # + # @return [Boolean, nil] + optional :income_history, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :income_history + + # @!attribute [r] is_active + # + # @return [Boolean, nil] + optional :is_active, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :is_active + + # @!attribute [r] last_name + # + # @return [Boolean, nil] + optional :last_name, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :last_name + + # @!attribute [r] location + # + # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Location, nil] + optional :location, + -> { FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Location } + + # @!parse + # # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Location] + # attr_writer :location + + # @!attribute [r] manager + # + # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Manager, nil] + optional :manager, + -> { FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Manager } + + # @!parse + # # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Manager] + # attr_writer :manager + + # @!attribute [r] middle_name + # + # @return [Boolean, nil] + optional :middle_name, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :middle_name + + # @!attribute [r] start_date + # + # @return [Boolean, nil] + optional :start_date, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :start_date + + # @!attribute [r] title + # + # @return [Boolean, nil] + optional :title, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :title + + # @!parse + # # @param id [Boolean] + # # @param class_code [Boolean] + # # @param custom_fields [Boolean] + # # @param department [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Department] + # # @param employment [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Employment] + # # @param employment_status [Boolean] + # # @param end_date [Boolean] + # # @param first_name [Boolean] + # # @param income [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Income] + # # @param income_history [Boolean] + # # @param is_active [Boolean] + # # @param last_name [Boolean] + # # @param location [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Location] + # # @param manager [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Manager] + # # @param middle_name [Boolean] + # # @param start_date [Boolean] + # # @param title [Boolean] + # # + # def initialize( + # id: nil, + # class_code: nil, + # custom_fields: nil, + # department: nil, + # employment: nil, + # employment_status: nil, + # end_date: nil, + # first_name: nil, + # income: nil, + # income_history: nil, + # is_active: nil, + # last_name: nil, + # location: nil, + # manager: nil, + # middle_name: nil, + # start_date: nil, + # title: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Department < FinchAPI::BaseModel + # @!attribute [r] name + # + # @return [Boolean, nil] + optional :name, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :name + + # @!parse + # # @param name [Boolean] + # # + # def initialize(name: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + class Employment < FinchAPI::BaseModel + # @!attribute [r] subtype + # + # @return [Boolean, nil] + optional :subtype, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :subtype + + # @!attribute [r] type + # + # @return [Boolean, nil] + optional :type, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :type + + # @!parse + # # @param subtype [Boolean] + # # @param type [Boolean] + # # + # def initialize(subtype: nil, type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + class Income < FinchAPI::BaseModel + # @!attribute [r] amount + # + # @return [Boolean, nil] + optional :amount, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :amount + + # @!attribute [r] currency + # + # @return [Boolean, nil] + optional :currency, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :currency + + # @!attribute [r] unit + # + # @return [Boolean, nil] + optional :unit, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :unit + + # @!parse + # # @param amount [Boolean] + # # @param currency [Boolean] + # # @param unit [Boolean] + # # + # def initialize(amount: nil, currency: nil, unit: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + class Location < FinchAPI::BaseModel + # @!attribute [r] city + # + # @return [Boolean, nil] + optional :city, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :city + + # @!attribute [r] country + # + # @return [Boolean, nil] + optional :country, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :country + + # @!attribute [r] line1 + # + # @return [Boolean, nil] + optional :line1, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :line1 + + # @!attribute [r] line2 + # + # @return [Boolean, nil] + optional :line2, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :line2 + + # @!attribute [r] postal_code + # + # @return [Boolean, nil] + optional :postal_code, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :postal_code + + # @!attribute [r] state + # + # @return [Boolean, nil] + optional :state, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :state + + # @!parse + # # @param city [Boolean] + # # @param country [Boolean] + # # @param line1 [Boolean] + # # @param line2 [Boolean] + # # @param postal_code [Boolean] + # # @param state [Boolean] + # # + # def initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + class Manager < FinchAPI::BaseModel + # @!attribute [r] id + # + # @return [Boolean, nil] + optional :id, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :id + + # @!parse + # # @param id [Boolean] + # # + # def initialize(id: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + + class Individual < FinchAPI::BaseModel + # @!attribute [r] id + # + # @return [Boolean, nil] + optional :id, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :id + + # @!attribute [r] dob + # + # @return [Boolean, nil] + optional :dob, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :dob + + # @!attribute [r] emails + # + # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Emails, nil] + optional :emails, + -> { FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Emails } + + # @!parse + # # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Emails] + # attr_writer :emails + + # @!attribute [r] encrypted_ssn + # + # @return [Boolean, nil] + optional :encrypted_ssn, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :encrypted_ssn + + # @!attribute [r] ethnicity + # + # @return [Boolean, nil] + optional :ethnicity, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :ethnicity + + # @!attribute [r] first_name + # + # @return [Boolean, nil] + optional :first_name, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :first_name + + # @!attribute [r] gender + # + # @return [Boolean, nil] + optional :gender, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :gender + + # @!attribute [r] last_name + # + # @return [Boolean, nil] + optional :last_name, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :last_name + + # @!attribute [r] middle_name + # + # @return [Boolean, nil] + optional :middle_name, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :middle_name + + # @!attribute [r] phone_numbers + # + # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::PhoneNumbers, nil] + optional :phone_numbers, + -> { FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::PhoneNumbers } + + # @!parse + # # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::PhoneNumbers] + # attr_writer :phone_numbers + + # @!attribute [r] preferred_name + # + # @return [Boolean, nil] + optional :preferred_name, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :preferred_name + + # @!attribute [r] residence + # + # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Residence, nil] + optional :residence, + -> { FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Residence } + + # @!parse + # # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Residence] + # attr_writer :residence + + # @!attribute [r] ssn + # + # @return [Boolean, nil] + optional :ssn, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :ssn + + # @!parse + # # @param id [Boolean] + # # @param dob [Boolean] + # # @param emails [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Emails] + # # @param encrypted_ssn [Boolean] + # # @param ethnicity [Boolean] + # # @param first_name [Boolean] + # # @param gender [Boolean] + # # @param last_name [Boolean] + # # @param middle_name [Boolean] + # # @param phone_numbers [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::PhoneNumbers] + # # @param preferred_name [Boolean] + # # @param residence [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Residence] + # # @param ssn [Boolean] + # # + # def initialize( + # id: nil, + # dob: nil, + # emails: nil, + # encrypted_ssn: nil, + # ethnicity: nil, + # first_name: nil, + # gender: nil, + # last_name: nil, + # middle_name: nil, + # phone_numbers: nil, + # preferred_name: nil, + # residence: nil, + # ssn: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Emails < FinchAPI::BaseModel + # @!attribute [r] data + # + # @return [Boolean, nil] + optional :data, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :data + + # @!attribute [r] type + # + # @return [Boolean, nil] + optional :type, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :type + + # @!parse + # # @param data [Boolean] + # # @param type [Boolean] + # # + # def initialize(data: nil, type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + class PhoneNumbers < FinchAPI::BaseModel + # @!attribute [r] data + # + # @return [Boolean, nil] + optional :data, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :data + + # @!attribute [r] type + # + # @return [Boolean, nil] + optional :type, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :type + + # @!parse + # # @param data [Boolean] + # # @param type [Boolean] + # # + # def initialize(data: nil, type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + class Residence < FinchAPI::BaseModel + # @!attribute [r] city + # + # @return [Boolean, nil] + optional :city, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :city + + # @!attribute [r] country + # + # @return [Boolean, nil] + optional :country, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :country + + # @!attribute [r] line1 + # + # @return [Boolean, nil] + optional :line1, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :line1 + + # @!attribute [r] line2 + # + # @return [Boolean, nil] + optional :line2, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :line2 + + # @!attribute [r] postal_code + # + # @return [Boolean, nil] + optional :postal_code, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :postal_code + + # @!attribute [r] state + # + # @return [Boolean, nil] + optional :state, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :state + + # @!parse + # # @param city [Boolean] + # # @param country [Boolean] + # # @param line1 [Boolean] + # # @param line2 [Boolean] + # # @param postal_code [Boolean] + # # @param state [Boolean] + # # + # def initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + + class PayGroup < FinchAPI::BaseModel + # @!attribute [r] id + # + # @return [Boolean, nil] + optional :id, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :id + + # @!attribute [r] individual_ids + # + # @return [Boolean, nil] + optional :individual_ids, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :individual_ids + + # @!attribute [r] name + # + # @return [Boolean, nil] + optional :name, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :name + + # @!attribute [r] pay_frequencies + # + # @return [Boolean, nil] + optional :pay_frequencies, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :pay_frequencies + + # @!parse + # # @param id [Boolean] + # # @param individual_ids [Boolean] + # # @param name [Boolean] + # # @param pay_frequencies [Boolean] + # # + # def initialize(id: nil, individual_ids: nil, name: nil, pay_frequencies: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + class PayStatement < FinchAPI::BaseModel + # @!attribute [r] paging + # + # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::Paging, nil] + optional :paging, + -> { FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::Paging } + + # @!parse + # # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::Paging] + # attr_writer :paging + + # @!attribute [r] pay_statements + # + # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements, nil] + optional :pay_statements, + -> { FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements } + + # @!parse + # # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements] + # attr_writer :pay_statements + + # @!parse + # # @param paging [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::Paging] + # # @param pay_statements [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements] + # # + # def initialize(paging: nil, pay_statements: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Paging < FinchAPI::BaseModel + # @!attribute count + # + # @return [Boolean] + required :count, FinchAPI::BooleanModel + + # @!attribute offset + # + # @return [Boolean] + required :offset, FinchAPI::BooleanModel + + # @!parse + # # @param count [Boolean] + # # @param offset [Boolean] + # # + # def initialize(count:, offset:, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + class PayStatements < FinchAPI::BaseModel + # @!attribute [r] earnings + # + # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings, nil] + optional :earnings, + -> { FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings } + + # @!parse + # # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings] + # attr_writer :earnings + + # @!attribute [r] employee_deductions + # + # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployeeDeductions, nil] + optional :employee_deductions, + -> { FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployeeDeductions } + + # @!parse + # # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployeeDeductions] + # attr_writer :employee_deductions + + # @!attribute [r] employer_contributions + # + # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployerContributions, nil] + optional :employer_contributions, + -> { FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployerContributions } + + # @!parse + # # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployerContributions] + # attr_writer :employer_contributions + + # @!attribute [r] gross_pay + # + # @return [Boolean, nil] + optional :gross_pay, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :gross_pay + + # @!attribute [r] individual_id + # + # @return [Boolean, nil] + optional :individual_id, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :individual_id + + # @!attribute [r] net_pay + # + # @return [Boolean, nil] + optional :net_pay, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :net_pay + + # @!attribute [r] payment_method + # + # @return [Boolean, nil] + optional :payment_method, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :payment_method + + # @!attribute [r] taxes + # + # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Taxes, nil] + optional :taxes, + -> { FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Taxes } + + # @!parse + # # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Taxes] + # attr_writer :taxes + + # @!attribute [r] total_hours + # + # @return [Boolean, nil] + optional :total_hours, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :total_hours + + # @!attribute [r] type + # + # @return [Boolean, nil] + optional :type, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :type + + # @!parse + # # @param earnings [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings] + # # @param employee_deductions [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployeeDeductions] + # # @param employer_contributions [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployerContributions] + # # @param gross_pay [Boolean] + # # @param individual_id [Boolean] + # # @param net_pay [Boolean] + # # @param payment_method [Boolean] + # # @param taxes [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Taxes] + # # @param total_hours [Boolean] + # # @param type [Boolean] + # # + # def initialize( + # earnings: nil, + # employee_deductions: nil, + # employer_contributions: nil, + # gross_pay: nil, + # individual_id: nil, + # net_pay: nil, + # payment_method: nil, + # taxes: nil, + # total_hours: nil, + # type: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Earnings < FinchAPI::BaseModel + # @!attribute [r] amount + # + # @return [Boolean, nil] + optional :amount, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :amount + + # @!attribute [r] currency + # + # @return [Boolean, nil] + optional :currency, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :currency + + # @!attribute [r] name + # + # @return [Boolean, nil] + optional :name, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :name + + # @!attribute [r] type + # + # @return [Boolean, nil] + optional :type, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :type + + # @!parse + # # @param amount [Boolean] + # # @param currency [Boolean] + # # @param name [Boolean] + # # @param type [Boolean] + # # + # def initialize(amount: nil, currency: nil, name: nil, type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + class EmployeeDeductions < FinchAPI::BaseModel + # @!attribute [r] amount + # + # @return [Boolean, nil] + optional :amount, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :amount + + # @!attribute [r] currency + # + # @return [Boolean, nil] + optional :currency, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :currency + + # @!attribute [r] name + # + # @return [Boolean, nil] + optional :name, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :name + + # @!attribute [r] pre_tax + # + # @return [Boolean, nil] + optional :pre_tax, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :pre_tax + + # @!attribute [r] type + # + # @return [Boolean, nil] + optional :type, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :type + + # @!parse + # # @param amount [Boolean] + # # @param currency [Boolean] + # # @param name [Boolean] + # # @param pre_tax [Boolean] + # # @param type [Boolean] + # # + # def initialize(amount: nil, currency: nil, name: nil, pre_tax: nil, type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + class EmployerContributions < FinchAPI::BaseModel + # @!attribute [r] amount + # + # @return [Boolean, nil] + optional :amount, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :amount + + # @!attribute [r] currency + # + # @return [Boolean, nil] + optional :currency, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :currency + + # @!attribute [r] name + # + # @return [Boolean, nil] + optional :name, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :name + + # @!parse + # # @param amount [Boolean] + # # @param currency [Boolean] + # # @param name [Boolean] + # # + # def initialize(amount: nil, currency: nil, name: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + class Taxes < FinchAPI::BaseModel + # @!attribute [r] amount + # + # @return [Boolean, nil] + optional :amount, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :amount + + # @!attribute [r] currency + # + # @return [Boolean, nil] + optional :currency, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :currency + + # @!attribute [r] employer + # + # @return [Boolean, nil] + optional :employer, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :employer + + # @!attribute [r] name + # + # @return [Boolean, nil] + optional :name, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :name + + # @!attribute [r] type + # + # @return [Boolean, nil] + optional :type, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :type + + # @!parse + # # @param amount [Boolean] + # # @param currency [Boolean] + # # @param employer [Boolean] + # # @param name [Boolean] + # # @param type [Boolean] + # # + # def initialize(amount: nil, currency: nil, employer: nil, name: nil, type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end + + class Payment < FinchAPI::BaseModel + # @!attribute [r] id + # + # @return [Boolean, nil] + optional :id, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :id + + # @!attribute [r] company_debit + # + # @return [Boolean, nil] + optional :company_debit, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :company_debit + + # @!attribute [r] debit_date + # + # @return [Boolean, nil] + optional :debit_date, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :debit_date + + # @!attribute [r] employee_taxes + # + # @return [Boolean, nil] + optional :employee_taxes, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :employee_taxes + + # @!attribute [r] employer_taxes + # + # @return [Boolean, nil] + optional :employer_taxes, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :employer_taxes + + # @!attribute [r] gross_pay + # + # @return [Boolean, nil] + optional :gross_pay, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :gross_pay + + # @!attribute [r] individual_ids + # + # @return [Boolean, nil] + optional :individual_ids, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :individual_ids + + # @!attribute [r] net_pay + # + # @return [Boolean, nil] + optional :net_pay, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :net_pay + + # @!attribute [r] pay_date + # + # @return [Boolean, nil] + optional :pay_date, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :pay_date + + # @!attribute [r] pay_frequencies + # + # @return [Boolean, nil] + optional :pay_frequencies, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :pay_frequencies + + # @!attribute [r] pay_group_ids + # + # @return [Boolean, nil] + optional :pay_group_ids, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :pay_group_ids + + # @!attribute [r] pay_period + # + # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment::PayPeriod, nil] + optional :pay_period, + -> { FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment::PayPeriod } + + # @!parse + # # @return [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment::PayPeriod] + # attr_writer :pay_period + + # @!parse + # # @param id [Boolean] + # # @param company_debit [Boolean] + # # @param debit_date [Boolean] + # # @param employee_taxes [Boolean] + # # @param employer_taxes [Boolean] + # # @param gross_pay [Boolean] + # # @param individual_ids [Boolean] + # # @param net_pay [Boolean] + # # @param pay_date [Boolean] + # # @param pay_frequencies [Boolean] + # # @param pay_group_ids [Boolean] + # # @param pay_period [FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment::PayPeriod] + # # + # def initialize( + # id: nil, + # company_debit: nil, + # debit_date: nil, + # employee_taxes: nil, + # employer_taxes: nil, + # gross_pay: nil, + # individual_ids: nil, + # net_pay: nil, + # pay_date: nil, + # pay_frequencies: nil, + # pay_group_ids: nil, + # pay_period: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class PayPeriod < FinchAPI::BaseModel + # @!attribute [r] end_date + # + # @return [Boolean, nil] + optional :end_date, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :end_date + + # @!attribute [r] start_date + # + # @return [Boolean, nil] + optional :start_date, FinchAPI::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :start_date + + # @!parse + # # @param end_date [Boolean] + # # @param start_date [Boolean] + # # + # def initialize(end_date: nil, start_date: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end + + # @abstract + # + # The type of authentication method. + # + # @example + # ```ruby + # case type + # in :assisted + # # ... + # in :credential + # # ... + # in :api_token + # # ... + # in :api_credential + # # ... + # in :oauth + # # ... + # end + # ``` + class Type < FinchAPI::Enum + ASSISTED = :assisted + CREDENTIAL = :credential + API_TOKEN = :api_token + API_CREDENTIAL = :api_credential + OAUTH = :oauth + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end +end diff --git a/lib/finch-api/models/provider_list_params.rb b/lib/finch-api/models/provider_list_params.rb new file mode 100644 index 00000000..9de4c3f3 --- /dev/null +++ b/lib/finch-api/models/provider_list_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + class ProviderListParams < FinchAPI::BaseModel + # @!parse + # extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + # @!parse + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end +end diff --git a/lib/finch-api/models/request_forwarding_forward_params.rb b/lib/finch-api/models/request_forwarding_forward_params.rb new file mode 100644 index 00000000..a95f7ad7 --- /dev/null +++ b/lib/finch-api/models/request_forwarding_forward_params.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + class RequestForwardingForwardParams < FinchAPI::BaseModel + # @!parse + # extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + # @!attribute method_ + # The HTTP method for the forwarded request. Valid values include: `GET` , `POST` + # , `PUT` , `DELETE` , and `PATCH`. + # + # @return [String] + required :method_, String, api_name: :method + + # @!attribute route + # The URL route path for the forwarded request. This value must begin with a + # forward-slash ( / ) and may only contain alphanumeric characters, hyphens, and + # underscores. + # + # @return [String] + required :route, String + + # @!attribute data + # The body for the forwarded request. This value must be specified as either a + # string or a valid JSON object. + # + # @return [String, nil] + optional :data, String, nil?: true + + # @!attribute headers + # The HTTP headers to include on the forwarded request. This value must be + # specified as an object of key-value pairs. Example: + # `{"Content-Type": "application/xml", "X-API-Version": "v1" }` + # + # @return [Object, nil] + optional :headers, FinchAPI::Unknown, nil?: true + + # @!attribute params + # The query parameters for the forwarded request. This value must be specified as + # a valid JSON object rather than a query string. + # + # @return [Object, nil] + optional :params, FinchAPI::Unknown, nil?: true + + # @!parse + # # @param method_ [String] + # # @param route [String] + # # @param data [String, nil] + # # @param headers [Object, nil] + # # @param params [Object, nil] + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(method_:, route:, data: nil, headers: nil, params: nil, request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end +end diff --git a/lib/finch-api/models/request_forwarding_forward_response.rb b/lib/finch-api/models/request_forwarding_forward_response.rb new file mode 100644 index 00000000..9cac3161 --- /dev/null +++ b/lib/finch-api/models/request_forwarding_forward_response.rb @@ -0,0 +1,97 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + class RequestForwardingForwardResponse < FinchAPI::BaseModel + # @!attribute data + # A string representation of the HTTP response body of the forwarded request’s + # response received from the underlying integration’s API. This field may be null + # in the case where the upstream system’s response is empty. + # + # @return [String, nil] + required :data, String, nil?: true + + # @!attribute headers + # The HTTP headers of the forwarded request’s response, exactly as received from + # the underlying integration’s API. + # + # @return [Object, nil] + required :headers, FinchAPI::Unknown, nil?: true + + # @!attribute request + # An object containing details of your original forwarded request, for your ease + # of reference. + # + # @return [FinchAPI::Models::RequestForwardingForwardResponse::Request] + required :request, -> { FinchAPI::Models::RequestForwardingForwardResponse::Request } + + # @!attribute status_code + # The HTTP status code of the forwarded request’s response, exactly received from + # the underlying integration’s API. This value will be returned as an integer. + # + # @return [Integer] + required :status_code, Integer, api_name: :statusCode + + # @!parse + # # @param data [String, nil] + # # @param headers [Object, nil] + # # @param request [FinchAPI::Models::RequestForwardingForwardResponse::Request] + # # @param status_code [Integer] + # # + # def initialize(data:, headers:, request:, status_code:, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Request < FinchAPI::BaseModel + # @!attribute data + # The body that was specified for the forwarded request. If a value was not + # specified in the original request, this value will be returned as null ; + # otherwise, this value will always be returned as a string. + # + # @return [String, nil] + required :data, String, nil?: true + + # @!attribute headers + # The specified HTTP headers that were included in the forwarded request. If no + # headers were specified, this will be returned as `null`. + # + # @return [Object, nil] + required :headers, FinchAPI::Unknown, nil?: true + + # @!attribute method_ + # The HTTP method that was specified for the forwarded request. Valid values + # include: `GET` , `POST` , `PUT` , `DELETE` , and `PATCH`. + # + # @return [String] + required :method_, String, api_name: :method + + # @!attribute params + # The query parameters that were included in the forwarded request. If no query + # parameters were specified, this will be returned as `null`. + # + # @return [Object, nil] + required :params, FinchAPI::Unknown, nil?: true + + # @!attribute route + # The URL route path that was specified for the forwarded request. + # + # @return [String] + required :route, String + + # @!parse + # # An object containing details of your original forwarded request, for your ease + # # of reference. + # # + # # @param data [String, nil] + # # @param headers [Object, nil] + # # @param method_ [String] + # # @param params [Object, nil] + # # @param route [String] + # # + # def initialize(data:, headers:, method_:, params:, route:, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end +end diff --git a/lib/finch-api/models/sandbox/company_update_params.rb b/lib/finch-api/models/sandbox/company_update_params.rb new file mode 100644 index 00000000..3307ee2f --- /dev/null +++ b/lib/finch-api/models/sandbox/company_update_params.rb @@ -0,0 +1,294 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module Sandbox + class CompanyUpdateParams < FinchAPI::BaseModel + # @!parse + # extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + # @!attribute accounts + # An array of bank account objects associated with the payroll/HRIS system. + # + # @return [Array, nil] + required :accounts, + -> { FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::CompanyUpdateParams::Account] }, + nil?: true + + # @!attribute departments + # The array of company departments. + # + # @return [Array, nil] + required :departments, + -> { FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::CompanyUpdateParams::Department, nil?: true] }, + nil?: true + + # @!attribute ein + # The employer identification number. + # + # @return [String, nil] + required :ein, String, nil?: true + + # @!attribute entity + # The entity type object. + # + # @return [FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity, nil] + required :entity, -> { FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity }, nil?: true + + # @!attribute legal_name + # The legal name of the company. + # + # @return [String, nil] + required :legal_name, String, nil?: true + + # @!attribute locations + # + # @return [Array, nil] + required :locations, -> { FinchAPI::ArrayOf[FinchAPI::Models::Location, nil?: true] }, nil?: true + + # @!attribute primary_email + # The email of the main administrator on the account. + # + # @return [String, nil] + required :primary_email, String, nil?: true + + # @!attribute primary_phone_number + # The phone number of the main administrator on the account. Format: `XXXXXXXXXX` + # + # @return [String, nil] + required :primary_phone_number, String, nil?: true + + # @!parse + # # @param accounts [Array, nil] + # # @param departments [Array, nil] + # # @param ein [String, nil] + # # @param entity [FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity, nil] + # # @param legal_name [String, nil] + # # @param locations [Array, nil] + # # @param primary_email [String, nil] + # # @param primary_phone_number [String, nil] + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # accounts:, + # departments:, + # ein:, + # entity:, + # legal_name:, + # locations:, + # primary_email:, + # primary_phone_number:, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Account < FinchAPI::BaseModel + # @!attribute account_name + # The name of the bank associated in the payroll/HRIS system. + # + # @return [String, nil] + optional :account_name, String, nil?: true + + # @!attribute account_number + # 10-12 digit number to specify the bank account + # + # @return [String, nil] + optional :account_number, String, nil?: true + + # @!attribute account_type + # The type of bank account. + # + # @return [Symbol, FinchAPI::Models::Sandbox::CompanyUpdateParams::Account::AccountType, nil] + optional :account_type, + enum: -> { FinchAPI::Models::Sandbox::CompanyUpdateParams::Account::AccountType }, + nil?: true + + # @!attribute institution_name + # Name of the banking institution. + # + # @return [String, nil] + optional :institution_name, String, nil?: true + + # @!attribute routing_number + # A nine-digit code that's based on the U.S. Bank location where your account was + # opened. + # + # @return [String, nil] + optional :routing_number, String, nil?: true + + # @!parse + # # @param account_name [String, nil] + # # @param account_number [String, nil] + # # @param account_type [Symbol, FinchAPI::Models::Sandbox::CompanyUpdateParams::Account::AccountType, nil] + # # @param institution_name [String, nil] + # # @param routing_number [String, nil] + # # + # def initialize(account_name: nil, account_number: nil, account_type: nil, institution_name: nil, routing_number: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # The type of bank account. + # + # @example + # ```ruby + # case account_type + # in :checking + # # ... + # in :savings + # # ... + # end + # ``` + class AccountType < FinchAPI::Enum + CHECKING = :checking + SAVINGS = :savings + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + class Department < FinchAPI::BaseModel + # @!attribute name + # The department name. + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute parent + # The parent department, if present. + # + # @return [FinchAPI::Models::Sandbox::CompanyUpdateParams::Department::Parent, nil] + optional :parent, -> { FinchAPI::Models::Sandbox::CompanyUpdateParams::Department::Parent }, nil?: true + + # @!parse + # # @param name [String, nil] + # # @param parent [FinchAPI::Models::Sandbox::CompanyUpdateParams::Department::Parent, nil] + # # + # def initialize(name: nil, parent: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Parent < FinchAPI::BaseModel + # @!attribute name + # The parent department's name. + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!parse + # # The parent department, if present. + # # + # # @param name [String, nil] + # # + # def initialize(name: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + + class Entity < FinchAPI::BaseModel + # @!attribute subtype + # The tax payer subtype of the company. + # + # @return [Symbol, FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::Subtype, nil] + optional :subtype, + enum: -> { FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::Subtype }, + nil?: true + + # @!attribute type + # The tax payer type of the company. + # + # @return [Symbol, FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::Type, nil] + optional :type, enum: -> { FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::Type }, nil?: true + + # @!parse + # # The entity type object. + # # + # # @param subtype [Symbol, FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::Subtype, nil] + # # @param type [Symbol, FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::Type, nil] + # # + # def initialize(subtype: nil, type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # The tax payer subtype of the company. + # + # @example + # ```ruby + # case subtype + # in :s_corporation + # # ... + # in :c_corporation + # # ... + # in :b_corporation + # # ... + # end + # ``` + class Subtype < FinchAPI::Enum + S_CORPORATION = :s_corporation + C_CORPORATION = :c_corporation + B_CORPORATION = :b_corporation + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @abstract + # + # The tax payer type of the company. + # + # @example + # ```ruby + # case type + # in :llc + # # ... + # in :lp + # # ... + # in :corporation + # # ... + # in :sole_proprietor + # # ... + # in :non_profit + # # ... + # in ... + # #... + # end + # ``` + class Type < FinchAPI::Enum + LLC = :llc + LP = :lp + CORPORATION = :corporation + SOLE_PROPRIETOR = :sole_proprietor + NON_PROFIT = :non_profit + PARTNERSHIP = :partnership + COOPERATIVE = :cooperative + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end + end +end diff --git a/lib/finch-api/models/sandbox/company_update_response.rb b/lib/finch-api/models/sandbox/company_update_response.rb new file mode 100644 index 00000000..e5799b21 --- /dev/null +++ b/lib/finch-api/models/sandbox/company_update_response.rb @@ -0,0 +1,276 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module Sandbox + class CompanyUpdateResponse < FinchAPI::BaseModel + # @!attribute accounts + # An array of bank account objects associated with the payroll/HRIS system. + # + # @return [Array, nil] + required :accounts, + -> { FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::CompanyUpdateResponse::Account] }, + nil?: true + + # @!attribute departments + # The array of company departments. + # + # @return [Array, nil] + required :departments, + -> { FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department, nil?: true] }, + nil?: true + + # @!attribute ein + # The employer identification number. + # + # @return [String, nil] + required :ein, String, nil?: true + + # @!attribute entity + # The entity type object. + # + # @return [FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity, nil] + required :entity, -> { FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity }, nil?: true + + # @!attribute legal_name + # The legal name of the company. + # + # @return [String, nil] + required :legal_name, String, nil?: true + + # @!attribute locations + # + # @return [Array, nil] + required :locations, -> { FinchAPI::ArrayOf[FinchAPI::Models::Location, nil?: true] }, nil?: true + + # @!attribute primary_email + # The email of the main administrator on the account. + # + # @return [String, nil] + required :primary_email, String, nil?: true + + # @!attribute primary_phone_number + # The phone number of the main administrator on the account. Format: `XXXXXXXXXX` + # + # @return [String, nil] + required :primary_phone_number, String, nil?: true + + # @!parse + # # @param accounts [Array, nil] + # # @param departments [Array, nil] + # # @param ein [String, nil] + # # @param entity [FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity, nil] + # # @param legal_name [String, nil] + # # @param locations [Array, nil] + # # @param primary_email [String, nil] + # # @param primary_phone_number [String, nil] + # # + # def initialize(accounts:, departments:, ein:, entity:, legal_name:, locations:, primary_email:, primary_phone_number:, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Account < FinchAPI::BaseModel + # @!attribute account_name + # The name of the bank associated in the payroll/HRIS system. + # + # @return [String, nil] + optional :account_name, String, nil?: true + + # @!attribute account_number + # 10-12 digit number to specify the bank account + # + # @return [String, nil] + optional :account_number, String, nil?: true + + # @!attribute account_type + # The type of bank account. + # + # @return [Symbol, FinchAPI::Models::Sandbox::CompanyUpdateResponse::Account::AccountType, nil] + optional :account_type, + enum: -> { FinchAPI::Models::Sandbox::CompanyUpdateResponse::Account::AccountType }, + nil?: true + + # @!attribute institution_name + # Name of the banking institution. + # + # @return [String, nil] + optional :institution_name, String, nil?: true + + # @!attribute routing_number + # A nine-digit code that's based on the U.S. Bank location where your account was + # opened. + # + # @return [String, nil] + optional :routing_number, String, nil?: true + + # @!parse + # # @param account_name [String, nil] + # # @param account_number [String, nil] + # # @param account_type [Symbol, FinchAPI::Models::Sandbox::CompanyUpdateResponse::Account::AccountType, nil] + # # @param institution_name [String, nil] + # # @param routing_number [String, nil] + # # + # def initialize(account_name: nil, account_number: nil, account_type: nil, institution_name: nil, routing_number: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # The type of bank account. + # + # @example + # ```ruby + # case account_type + # in :checking + # # ... + # in :savings + # # ... + # end + # ``` + class AccountType < FinchAPI::Enum + CHECKING = :checking + SAVINGS = :savings + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + class Department < FinchAPI::BaseModel + # @!attribute name + # The department name. + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute parent + # The parent department, if present. + # + # @return [FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department::Parent, nil] + optional :parent, -> { FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department::Parent }, nil?: true + + # @!parse + # # @param name [String, nil] + # # @param parent [FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department::Parent, nil] + # # + # def initialize(name: nil, parent: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Parent < FinchAPI::BaseModel + # @!attribute name + # The parent department's name. + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!parse + # # The parent department, if present. + # # + # # @param name [String, nil] + # # + # def initialize(name: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + + class Entity < FinchAPI::BaseModel + # @!attribute subtype + # The tax payer subtype of the company. + # + # @return [Symbol, FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::Subtype, nil] + optional :subtype, + enum: -> { FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::Subtype }, + nil?: true + + # @!attribute type + # The tax payer type of the company. + # + # @return [Symbol, FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::Type, nil] + optional :type, enum: -> { FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::Type }, nil?: true + + # @!parse + # # The entity type object. + # # + # # @param subtype [Symbol, FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::Subtype, nil] + # # @param type [Symbol, FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::Type, nil] + # # + # def initialize(subtype: nil, type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # The tax payer subtype of the company. + # + # @example + # ```ruby + # case subtype + # in :s_corporation + # # ... + # in :c_corporation + # # ... + # in :b_corporation + # # ... + # end + # ``` + class Subtype < FinchAPI::Enum + S_CORPORATION = :s_corporation + C_CORPORATION = :c_corporation + B_CORPORATION = :b_corporation + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @abstract + # + # The tax payer type of the company. + # + # @example + # ```ruby + # case type + # in :llc + # # ... + # in :lp + # # ... + # in :corporation + # # ... + # in :sole_proprietor + # # ... + # in :non_profit + # # ... + # in ... + # #... + # end + # ``` + class Type < FinchAPI::Enum + LLC = :llc + LP = :lp + CORPORATION = :corporation + SOLE_PROPRIETOR = :sole_proprietor + NON_PROFIT = :non_profit + PARTNERSHIP = :partnership + COOPERATIVE = :cooperative + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end + end +end diff --git a/lib/finch-api/models/sandbox/connection_create_params.rb b/lib/finch-api/models/sandbox/connection_create_params.rb new file mode 100644 index 00000000..3ab58352 --- /dev/null +++ b/lib/finch-api/models/sandbox/connection_create_params.rb @@ -0,0 +1,90 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module Sandbox + class ConnectionCreateParams < FinchAPI::BaseModel + # @!parse + # extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + # @!attribute provider_id + # The provider associated with the connection + # + # @return [String] + required :provider_id, String + + # @!attribute [r] authentication_type + # + # @return [Symbol, FinchAPI::Models::Sandbox::ConnectionCreateParams::AuthenticationType, nil] + optional :authentication_type, + enum: -> { FinchAPI::Models::Sandbox::ConnectionCreateParams::AuthenticationType } + + # @!parse + # # @return [Symbol, FinchAPI::Models::Sandbox::ConnectionCreateParams::AuthenticationType] + # attr_writer :authentication_type + + # @!attribute [r] employee_size + # Optional: the size of the employer to be created with this connection. Defaults + # to 20. Note that if this is higher than 100, historical payroll data will not be + # generated, and instead only one pay period will be created. + # + # @return [Integer, nil] + optional :employee_size, Integer + + # @!parse + # # @return [Integer] + # attr_writer :employee_size + + # @!attribute [r] products + # + # @return [Array, nil] + optional :products, FinchAPI::ArrayOf[String] + + # @!parse + # # @return [Array] + # attr_writer :products + + # @!parse + # # @param provider_id [String] + # # @param authentication_type [Symbol, FinchAPI::Models::Sandbox::ConnectionCreateParams::AuthenticationType] + # # @param employee_size [Integer] + # # @param products [Array] + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(provider_id:, authentication_type: nil, employee_size: nil, products: nil, request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case authentication_type + # in :credential + # # ... + # in :api_token + # # ... + # in :oauth + # # ... + # in :assisted + # # ... + # end + # ``` + class AuthenticationType < FinchAPI::Enum + CREDENTIAL = :credential + API_TOKEN = :api_token + OAUTH = :oauth + ASSISTED = :assisted + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end +end diff --git a/lib/finch-api/models/sandbox/connection_create_response.rb b/lib/finch-api/models/sandbox/connection_create_response.rb new file mode 100644 index 00000000..97ec669f --- /dev/null +++ b/lib/finch-api/models/sandbox/connection_create_response.rb @@ -0,0 +1,113 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module Sandbox + class ConnectionCreateResponse < FinchAPI::BaseModel + # @!attribute access_token + # + # @return [String] + required :access_token, String + + # @!attribute account_id + # [DEPRECATED] Use `connection_id` to associate a connection with an access token + # + # @return [String] + required :account_id, String + + # @!attribute authentication_type + # + # @return [Symbol, FinchAPI::Models::Sandbox::ConnectionCreateResponse::AuthenticationType] + required :authentication_type, + enum: -> { FinchAPI::Models::Sandbox::ConnectionCreateResponse::AuthenticationType } + + # @!attribute company_id + # [DEPRECATED] Use `connection_id` to associate a connection with an access token + # + # @return [String] + required :company_id, String + + # @!attribute connection_id + # The ID of the new connection + # + # @return [String] + required :connection_id, String + + # @!attribute products + # + # @return [Array] + required :products, FinchAPI::ArrayOf[String] + + # @!attribute provider_id + # The ID of the provider associated with the `access_token`. + # + # @return [String] + required :provider_id, String + + # @!attribute [r] token_type + # + # @return [String, nil] + optional :token_type, String + + # @!parse + # # @return [String] + # attr_writer :token_type + + # @!parse + # # @param access_token [String] + # # @param account_id [String] + # # @param authentication_type [Symbol, FinchAPI::Models::Sandbox::ConnectionCreateResponse::AuthenticationType] + # # @param company_id [String] + # # @param connection_id [String] + # # @param products [Array] + # # @param provider_id [String] + # # @param token_type [String] + # # + # def initialize( + # access_token:, + # account_id:, + # authentication_type:, + # company_id:, + # connection_id:, + # products:, + # provider_id:, + # token_type: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case authentication_type + # in :credential + # # ... + # in :api_token + # # ... + # in :oauth + # # ... + # in :assisted + # # ... + # end + # ``` + class AuthenticationType < FinchAPI::Enum + CREDENTIAL = :credential + API_TOKEN = :api_token + OAUTH = :oauth + ASSISTED = :assisted + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end +end diff --git a/lib/finch-api/models/sandbox/connections/account_create_params.rb b/lib/finch-api/models/sandbox/connections/account_create_params.rb new file mode 100644 index 00000000..4ab7c58b --- /dev/null +++ b/lib/finch-api/models/sandbox/connections/account_create_params.rb @@ -0,0 +1,87 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module Sandbox + module Connections + class AccountCreateParams < FinchAPI::BaseModel + # @!parse + # extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + # @!attribute company_id + # + # @return [String] + required :company_id, String + + # @!attribute provider_id + # The provider associated with the `access_token` + # + # @return [String] + required :provider_id, String + + # @!attribute [r] authentication_type + # + # @return [Symbol, FinchAPI::Models::Sandbox::Connections::AccountCreateParams::AuthenticationType, nil] + optional :authentication_type, + enum: -> { FinchAPI::Models::Sandbox::Connections::AccountCreateParams::AuthenticationType } + + # @!parse + # # @return [Symbol, FinchAPI::Models::Sandbox::Connections::AccountCreateParams::AuthenticationType] + # attr_writer :authentication_type + + # @!attribute [r] products + # Optional, defaults to Organization products (`company`, `directory`, + # `employment`, `individual`) + # + # @return [Array, nil] + optional :products, FinchAPI::ArrayOf[String] + + # @!parse + # # @return [Array] + # attr_writer :products + + # @!parse + # # @param company_id [String] + # # @param provider_id [String] + # # @param authentication_type [Symbol, FinchAPI::Models::Sandbox::Connections::AccountCreateParams::AuthenticationType] + # # @param products [Array] + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(company_id:, provider_id:, authentication_type: nil, products: nil, request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case authentication_type + # in :credential + # # ... + # in :api_token + # # ... + # in :oauth + # # ... + # in :assisted + # # ... + # end + # ``` + class AuthenticationType < FinchAPI::Enum + CREDENTIAL = :credential + API_TOKEN = :api_token + OAUTH = :oauth + ASSISTED = :assisted + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end + end +end diff --git a/lib/finch-api/models/sandbox/connections/account_create_response.rb b/lib/finch-api/models/sandbox/connections/account_create_response.rb new file mode 100644 index 00000000..5914f541 --- /dev/null +++ b/lib/finch-api/models/sandbox/connections/account_create_response.rb @@ -0,0 +1,93 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module Sandbox + module Connections + class AccountCreateResponse < FinchAPI::BaseModel + # @!attribute access_token + # + # @return [String] + required :access_token, String + + # @!attribute account_id + # [DEPRECATED] Use `connection_id` to associate a connection with an access token + # + # @return [String] + required :account_id, String + + # @!attribute authentication_type + # + # @return [Symbol, FinchAPI::Models::Sandbox::Connections::AccountCreateResponse::AuthenticationType] + required :authentication_type, + enum: -> { FinchAPI::Models::Sandbox::Connections::AccountCreateResponse::AuthenticationType } + + # @!attribute company_id + # [DEPRECATED] Use `connection_id` to associate a connection with an access token + # + # @return [String] + required :company_id, String + + # @!attribute connection_id + # The ID of the new connection + # + # @return [String] + required :connection_id, String + + # @!attribute products + # + # @return [Array] + required :products, FinchAPI::ArrayOf[String] + + # @!attribute provider_id + # The ID of the provider associated with the `access_token` + # + # @return [String] + required :provider_id, String + + # @!parse + # # @param access_token [String] + # # @param account_id [String] + # # @param authentication_type [Symbol, FinchAPI::Models::Sandbox::Connections::AccountCreateResponse::AuthenticationType] + # # @param company_id [String] + # # @param connection_id [String] + # # @param products [Array] + # # @param provider_id [String] + # # + # def initialize(access_token:, account_id:, authentication_type:, company_id:, connection_id:, products:, provider_id:, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case authentication_type + # in :credential + # # ... + # in :api_token + # # ... + # in :oauth + # # ... + # in :assisted + # # ... + # end + # ``` + class AuthenticationType < FinchAPI::Enum + CREDENTIAL = :credential + API_TOKEN = :api_token + OAUTH = :oauth + ASSISTED = :assisted + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end + end +end diff --git a/lib/finch-api/models/sandbox/connections/account_update_params.rb b/lib/finch-api/models/sandbox/connections/account_update_params.rb new file mode 100644 index 00000000..65e12214 --- /dev/null +++ b/lib/finch-api/models/sandbox/connections/account_update_params.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module Sandbox + module Connections + class AccountUpdateParams < FinchAPI::BaseModel + # @!parse + # extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + # @!attribute [r] connection_status + # + # @return [Symbol, FinchAPI::Models::ConnectionStatusType, nil] + optional :connection_status, enum: -> { FinchAPI::Models::ConnectionStatusType } + + # @!parse + # # @return [Symbol, FinchAPI::Models::ConnectionStatusType] + # attr_writer :connection_status + + # @!parse + # # @param connection_status [Symbol, FinchAPI::Models::ConnectionStatusType] + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(connection_status: nil, request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end + end +end diff --git a/lib/finch-api/models/sandbox/connections/account_update_response.rb b/lib/finch-api/models/sandbox/connections/account_update_response.rb new file mode 100644 index 00000000..148377e3 --- /dev/null +++ b/lib/finch-api/models/sandbox/connections/account_update_response.rb @@ -0,0 +1,91 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module Sandbox + module Connections + class AccountUpdateResponse < FinchAPI::BaseModel + # @!attribute account_id + # [DEPRECATED] Use `connection_id` to associate a connection with an access token + # + # @return [String] + required :account_id, String + + # @!attribute authentication_type + # + # @return [Symbol, FinchAPI::Models::Sandbox::Connections::AccountUpdateResponse::AuthenticationType] + required :authentication_type, + enum: -> { FinchAPI::Models::Sandbox::Connections::AccountUpdateResponse::AuthenticationType } + + # @!attribute company_id + # [DEPRECATED] Use `connection_id` to associate a connection with an access token + # + # @return [String] + required :company_id, String + + # @!attribute products + # + # @return [Array] + required :products, FinchAPI::ArrayOf[String] + + # @!attribute provider_id + # The ID of the provider associated with the `access_token` + # + # @return [String] + required :provider_id, String + + # @!attribute [r] connection_id + # The ID of the new connection + # + # @return [String, nil] + optional :connection_id, String + + # @!parse + # # @return [String] + # attr_writer :connection_id + + # @!parse + # # @param account_id [String] + # # @param authentication_type [Symbol, FinchAPI::Models::Sandbox::Connections::AccountUpdateResponse::AuthenticationType] + # # @param company_id [String] + # # @param products [Array] + # # @param provider_id [String] + # # @param connection_id [String] + # # + # def initialize(account_id:, authentication_type:, company_id:, products:, provider_id:, connection_id: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case authentication_type + # in :credential + # # ... + # in :api_token + # # ... + # in :oauth + # # ... + # in :assisted + # # ... + # end + # ``` + class AuthenticationType < FinchAPI::Enum + CREDENTIAL = :credential + API_TOKEN = :api_token + OAUTH = :oauth + ASSISTED = :assisted + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end + end +end diff --git a/lib/finch-api/models/sandbox/directory_create_params.rb b/lib/finch-api/models/sandbox/directory_create_params.rb new file mode 100644 index 00000000..b9e88d1d --- /dev/null +++ b/lib/finch-api/models/sandbox/directory_create_params.rb @@ -0,0 +1,642 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module Sandbox + class DirectoryCreateParams < FinchAPI::BaseModel + # @!parse + # extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + # @!attribute [r] body + # Array of individuals to create. Takes all combined fields from `/individual` and + # `/employment` endpoints. All fields are optional. + # + # @return [Array, nil] + optional :body, -> { FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body] } + + # @!parse + # # @return [Array] + # attr_writer :body + + # @!parse + # # @param body [Array] + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(body: nil, request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Body < FinchAPI::BaseModel + # @!attribute class_code + # Worker's compensation classification code for this employee + # + # @return [String, nil] + optional :class_code, String, nil?: true + + # @!attribute [r] custom_fields + # Custom fields for the individual. These are fields which are defined by the + # employer in the system. Custom fields are not currently supported for assisted + # connections. + # + # @return [Array, nil] + optional :custom_fields, + -> { FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::CustomField] } + + # @!parse + # # @return [Array] + # attr_writer :custom_fields + + # @!attribute department + # The department object. + # + # @return [FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Department, nil] + optional :department, + -> { FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Department }, + nil?: true + + # @!attribute dob + # + # @return [String, nil] + optional :dob, String, nil?: true + + # @!attribute emails + # + # @return [Array, nil] + optional :emails, + -> { FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Email] }, + nil?: true + + # @!attribute employment + # The employment object. + # + # @return [FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment, nil] + optional :employment, + -> { FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment }, + nil?: true + + # @!attribute employment_status + # The detailed employment status of the individual. + # + # @return [Symbol, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::EmploymentStatus, nil] + optional :employment_status, + enum: -> { FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::EmploymentStatus }, + nil?: true + + # @!attribute encrypted_ssn + # Social Security Number of the individual in **encrypted** format. This field is + # only available with the `ssn` scope enabled and the + # `options: { include: ['ssn'] }` param set in the body. + # + # @return [String, nil] + optional :encrypted_ssn, String, nil?: true + + # @!attribute end_date + # + # @return [String, nil] + optional :end_date, String, nil?: true + + # @!attribute ethnicity + # The EEOC-defined ethnicity of the individual. + # + # @return [Symbol, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Ethnicity, nil] + optional :ethnicity, + enum: -> { FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Ethnicity }, + nil?: true + + # @!attribute first_name + # The legal first name of the individual. + # + # @return [String, nil] + optional :first_name, String, nil?: true + + # @!attribute gender + # The gender of the individual. + # + # @return [Symbol, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Gender, nil] + optional :gender, enum: -> { FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Gender }, nil?: true + + # @!attribute income + # 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. + # + # @return [FinchAPI::Models::Income, nil] + optional :income, -> { FinchAPI::Models::Income }, nil?: true + + # @!attribute income_history + # The array of income history. + # + # @return [Array, nil] + optional :income_history, -> { FinchAPI::ArrayOf[FinchAPI::Models::Income, nil?: true] }, nil?: true + + # @!attribute is_active + # `true` if the individual an an active employee or contractor at the company. + # + # @return [Boolean, nil] + optional :is_active, FinchAPI::BooleanModel, nil?: true + + # @!attribute last_name + # The legal last name of the individual. + # + # @return [String, nil] + optional :last_name, String, nil?: true + + # @!attribute latest_rehire_date + # + # @return [String, nil] + optional :latest_rehire_date, String, nil?: true + + # @!attribute location + # + # @return [FinchAPI::Models::Location, nil] + optional :location, -> { FinchAPI::Models::Location }, nil?: true + + # @!attribute manager + # The manager object representing the manager of the individual within the org. + # + # @return [FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Manager, nil] + optional :manager, -> { FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Manager }, nil?: true + + # @!attribute middle_name + # The legal middle name of the individual. + # + # @return [String, nil] + optional :middle_name, String, nil?: true + + # @!attribute phone_numbers + # + # @return [Array, nil] + optional :phone_numbers, + -> { FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::PhoneNumber, nil?: true] }, + nil?: true + + # @!attribute preferred_name + # The preferred name of the individual. + # + # @return [String, nil] + optional :preferred_name, String, nil?: true + + # @!attribute residence + # + # @return [FinchAPI::Models::Location, nil] + optional :residence, -> { FinchAPI::Models::Location }, nil?: true + + # @!attribute [r] source_id + # The source system's unique employment identifier for this individual + # + # @return [String, nil] + optional :source_id, String + + # @!parse + # # @return [String] + # attr_writer :source_id + + # @!attribute ssn + # Social Security Number of the individual. This field is only available with the + # `ssn` scope enabled and the `options: { include: ['ssn'] }` param set in the + # body. + # [Click here to learn more about enabling the SSN field](/developer-resources/Enable-SSN-Field). + # + # @return [String, nil] + optional :ssn, String, nil?: true + + # @!attribute start_date + # + # @return [String, nil] + optional :start_date, String, nil?: true + + # @!attribute title + # The current title of the individual. + # + # @return [String, nil] + optional :title, String, nil?: true + + # @!parse + # # @param class_code [String, nil] + # # @param custom_fields [Array] + # # @param department [FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Department, nil] + # # @param dob [String, nil] + # # @param emails [Array, nil] + # # @param employment [FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment, nil] + # # @param employment_status [Symbol, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::EmploymentStatus, nil] + # # @param encrypted_ssn [String, nil] + # # @param end_date [String, nil] + # # @param ethnicity [Symbol, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Ethnicity, nil] + # # @param first_name [String, nil] + # # @param gender [Symbol, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Gender, nil] + # # @param income [FinchAPI::Models::Income, nil] + # # @param income_history [Array, nil] + # # @param is_active [Boolean, nil] + # # @param last_name [String, nil] + # # @param latest_rehire_date [String, nil] + # # @param location [FinchAPI::Models::Location, nil] + # # @param manager [FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Manager, nil] + # # @param middle_name [String, nil] + # # @param phone_numbers [Array, nil] + # # @param preferred_name [String, nil] + # # @param residence [FinchAPI::Models::Location, nil] + # # @param source_id [String] + # # @param ssn [String, nil] + # # @param start_date [String, nil] + # # @param title [String, nil] + # # + # def initialize( + # class_code: nil, + # custom_fields: nil, + # department: nil, + # dob: nil, + # emails: nil, + # employment: nil, + # employment_status: nil, + # encrypted_ssn: nil, + # end_date: nil, + # ethnicity: nil, + # first_name: nil, + # gender: nil, + # income: nil, + # income_history: nil, + # is_active: nil, + # last_name: nil, + # latest_rehire_date: nil, + # location: nil, + # manager: nil, + # middle_name: nil, + # phone_numbers: nil, + # preferred_name: nil, + # residence: nil, + # source_id: nil, + # ssn: nil, + # start_date: nil, + # title: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class CustomField < FinchAPI::BaseModel + # @!attribute name + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute [r] value + # + # @return [Object, nil] + optional :value, FinchAPI::Unknown + + # @!parse + # # @return [Object] + # attr_writer :value + + # @!parse + # # @param name [String, nil] + # # @param value [Object] + # # + # def initialize(name: nil, value: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + class Department < FinchAPI::BaseModel + # @!attribute name + # The name of the department associated with the individual. + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!parse + # # The department object. + # # + # # @param name [String, nil] + # # + # def initialize(name: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + class Email < FinchAPI::BaseModel + # @!attribute [r] data + # + # @return [String, nil] + optional :data, String + + # @!parse + # # @return [String] + # attr_writer :data + + # @!attribute type + # + # @return [Symbol, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Email::Type, nil] + optional :type, + enum: -> { FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Email::Type }, + nil?: true + + # @!parse + # # @param data [String] + # # @param type [Symbol, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Email::Type, nil] + # # + # def initialize(data: nil, type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case type + # in :work + # # ... + # in :personal + # # ... + # end + # ``` + class Type < FinchAPI::Enum + WORK = :work + PERSONAL = :personal + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + class Employment < FinchAPI::BaseModel + # @!attribute subtype + # The secondary employment type of the individual. Options: `full_time`, + # `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`. + # + # @return [Symbol, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::Subtype, nil] + optional :subtype, + enum: -> { FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::Subtype }, + nil?: true + + # @!attribute type + # The main employment type of the individual. + # + # @return [Symbol, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::Type, nil] + optional :type, + enum: -> { FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::Type }, + nil?: true + + # @!parse + # # The employment object. + # # + # # @param subtype [Symbol, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::Subtype, nil] + # # @param type [Symbol, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::Type, nil] + # # + # def initialize(subtype: nil, type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # The secondary employment type of the individual. Options: `full_time`, + # `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`. + # + # @example + # ```ruby + # case subtype + # in :full_time + # # ... + # in :intern + # # ... + # in :part_time + # # ... + # in :temp + # # ... + # in :seasonal + # # ... + # in ... + # #... + # end + # ``` + class Subtype < FinchAPI::Enum + FULL_TIME = :full_time + INTERN = :intern + PART_TIME = :part_time + TEMP = :temp + SEASONAL = :seasonal + INDIVIDUAL_CONTRACTOR = :individual_contractor + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @abstract + # + # The main employment type of the individual. + # + # @example + # ```ruby + # case type + # in :employee + # # ... + # in :contractor + # # ... + # end + # ``` + class Type < FinchAPI::Enum + EMPLOYEE = :employee + CONTRACTOR = :contractor + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @abstract + # + # The detailed employment status of the individual. + # + # @example + # ```ruby + # case employment_status + # in :active + # # ... + # in :deceased + # # ... + # in :leave + # # ... + # in :onboarding + # # ... + # in :prehire + # # ... + # in ... + # #... + # end + # ``` + class EmploymentStatus < FinchAPI::Enum + ACTIVE = :active + DECEASED = :deceased + LEAVE = :leave + ONBOARDING = :onboarding + PREHIRE = :prehire + RETIRED = :retired + TERMINATED = :terminated + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @abstract + # + # The EEOC-defined ethnicity of the individual. + # + # @example + # ```ruby + # case ethnicity + # in :asian + # # ... + # in :white + # # ... + # in :black_or_african_american + # # ... + # in :native_hawaiian_or_pacific_islander + # # ... + # in :american_indian_or_alaska_native + # # ... + # in ... + # #... + # end + # ``` + class Ethnicity < FinchAPI::Enum + ASIAN = :asian + WHITE = :white + BLACK_OR_AFRICAN_AMERICAN = :black_or_african_american + NATIVE_HAWAIIAN_OR_PACIFIC_ISLANDER = :native_hawaiian_or_pacific_islander + AMERICAN_INDIAN_OR_ALASKA_NATIVE = :american_indian_or_alaska_native + HISPANIC_OR_LATINO = :hispanic_or_latino + TWO_OR_MORE_RACES = :two_or_more_races + DECLINE_TO_SPECIFY = :decline_to_specify + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @abstract + # + # The gender of the individual. + # + # @example + # ```ruby + # case gender + # in :female + # # ... + # in :male + # # ... + # in :other + # # ... + # in :decline_to_specify + # # ... + # end + # ``` + class Gender < FinchAPI::Enum + FEMALE = :female + MALE = :male + OTHER = :other + DECLINE_TO_SPECIFY = :decline_to_specify + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + class Manager < FinchAPI::BaseModel + # @!attribute [r] id + # A stable Finch `id` (UUID v4) for an individual in the company. + # + # @return [String, nil] + optional :id, String + + # @!parse + # # @return [String] + # attr_writer :id + + # @!parse + # # The manager object representing the manager of the individual within the org. + # # + # # @param id [String] + # # + # def initialize(id: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + class PhoneNumber < FinchAPI::BaseModel + # @!attribute [r] data + # + # @return [String, nil] + optional :data, String + + # @!parse + # # @return [String] + # attr_writer :data + + # @!attribute type + # + # @return [Symbol, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::PhoneNumber::Type, nil] + optional :type, + enum: -> { FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::PhoneNumber::Type }, + nil?: true + + # @!parse + # # @param data [String] + # # @param type [Symbol, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::PhoneNumber::Type, nil] + # # + # def initialize(data: nil, type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case type + # in :work + # # ... + # in :personal + # # ... + # end + # ``` + class Type < FinchAPI::Enum + WORK = :work + PERSONAL = :personal + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end + end + end +end diff --git a/lib/finch-api/models/sandbox/directory_create_response.rb b/lib/finch-api/models/sandbox/directory_create_response.rb new file mode 100644 index 00000000..f166aabb --- /dev/null +++ b/lib/finch-api/models/sandbox/directory_create_response.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module Sandbox + DirectoryCreateResponse = FinchAPI::ArrayOf[FinchAPI::Unknown] + end + end +end diff --git a/lib/finch-api/models/sandbox/employment_update_params.rb b/lib/finch-api/models/sandbox/employment_update_params.rb new file mode 100644 index 00000000..b1c95cff --- /dev/null +++ b/lib/finch-api/models/sandbox/employment_update_params.rb @@ -0,0 +1,372 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module Sandbox + class EmploymentUpdateParams < FinchAPI::BaseModel + # @!parse + # extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + # @!attribute class_code + # Worker's compensation classification code for this employee + # + # @return [String, nil] + optional :class_code, String, nil?: true + + # @!attribute [r] custom_fields + # Custom fields for the individual. These are fields which are defined by the + # employer in the system. Custom fields are not currently supported for assisted + # connections. + # + # @return [Array, nil] + optional :custom_fields, + -> { FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::EmploymentUpdateParams::CustomField] } + + # @!parse + # # @return [Array] + # attr_writer :custom_fields + + # @!attribute department + # The department object. + # + # @return [FinchAPI::Models::Sandbox::EmploymentUpdateParams::Department, nil] + optional :department, -> { FinchAPI::Models::Sandbox::EmploymentUpdateParams::Department }, nil?: true + + # @!attribute employment + # The employment object. + # + # @return [FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment, nil] + optional :employment, -> { FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment }, nil?: true + + # @!attribute employment_status + # The detailed employment status of the individual. + # + # @return [Symbol, FinchAPI::Models::Sandbox::EmploymentUpdateParams::EmploymentStatus, nil] + optional :employment_status, + enum: -> { FinchAPI::Models::Sandbox::EmploymentUpdateParams::EmploymentStatus }, + nil?: true + + # @!attribute end_date + # + # @return [String, nil] + optional :end_date, String, nil?: true + + # @!attribute first_name + # The legal first name of the individual. + # + # @return [String, nil] + optional :first_name, String, nil?: true + + # @!attribute income + # 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. + # + # @return [FinchAPI::Models::Income, nil] + optional :income, -> { FinchAPI::Models::Income }, nil?: true + + # @!attribute income_history + # The array of income history. + # + # @return [Array, nil] + optional :income_history, -> { FinchAPI::ArrayOf[FinchAPI::Models::Income, nil?: true] }, nil?: true + + # @!attribute is_active + # `true` if the individual an an active employee or contractor at the company. + # + # @return [Boolean, nil] + optional :is_active, FinchAPI::BooleanModel, nil?: true + + # @!attribute last_name + # The legal last name of the individual. + # + # @return [String, nil] + optional :last_name, String, nil?: true + + # @!attribute latest_rehire_date + # + # @return [String, nil] + optional :latest_rehire_date, String, nil?: true + + # @!attribute location + # + # @return [FinchAPI::Models::Location, nil] + optional :location, -> { FinchAPI::Models::Location }, nil?: true + + # @!attribute manager + # The manager object representing the manager of the individual within the org. + # + # @return [FinchAPI::Models::Sandbox::EmploymentUpdateParams::Manager, nil] + optional :manager, -> { FinchAPI::Models::Sandbox::EmploymentUpdateParams::Manager }, nil?: true + + # @!attribute middle_name + # The legal middle name of the individual. + # + # @return [String, nil] + optional :middle_name, String, nil?: true + + # @!attribute [r] source_id + # The source system's unique employment identifier for this individual + # + # @return [String, nil] + optional :source_id, String + + # @!parse + # # @return [String] + # attr_writer :source_id + + # @!attribute start_date + # + # @return [String, nil] + optional :start_date, String, nil?: true + + # @!attribute title + # The current title of the individual. + # + # @return [String, nil] + optional :title, String, nil?: true + + # @!parse + # # @param class_code [String, nil] + # # @param custom_fields [Array] + # # @param department [FinchAPI::Models::Sandbox::EmploymentUpdateParams::Department, nil] + # # @param employment [FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment, nil] + # # @param employment_status [Symbol, FinchAPI::Models::Sandbox::EmploymentUpdateParams::EmploymentStatus, nil] + # # @param end_date [String, nil] + # # @param first_name [String, nil] + # # @param income [FinchAPI::Models::Income, nil] + # # @param income_history [Array, nil] + # # @param is_active [Boolean, nil] + # # @param last_name [String, nil] + # # @param latest_rehire_date [String, nil] + # # @param location [FinchAPI::Models::Location, nil] + # # @param manager [FinchAPI::Models::Sandbox::EmploymentUpdateParams::Manager, nil] + # # @param middle_name [String, nil] + # # @param source_id [String] + # # @param start_date [String, nil] + # # @param title [String, nil] + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # class_code: nil, + # custom_fields: nil, + # department: nil, + # employment: nil, + # employment_status: nil, + # end_date: nil, + # first_name: nil, + # income: nil, + # income_history: nil, + # is_active: nil, + # last_name: nil, + # latest_rehire_date: nil, + # location: nil, + # manager: nil, + # middle_name: nil, + # source_id: nil, + # start_date: nil, + # title: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class CustomField < FinchAPI::BaseModel + # @!attribute name + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute [r] value + # + # @return [Object, nil] + optional :value, FinchAPI::Unknown + + # @!parse + # # @return [Object] + # attr_writer :value + + # @!parse + # # @param name [String, nil] + # # @param value [Object] + # # + # def initialize(name: nil, value: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + class Department < FinchAPI::BaseModel + # @!attribute name + # The name of the department associated with the individual. + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!parse + # # The department object. + # # + # # @param name [String, nil] + # # + # def initialize(name: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + class Employment < FinchAPI::BaseModel + # @!attribute subtype + # The secondary employment type of the individual. Options: `full_time`, + # `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`. + # + # @return [Symbol, FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::Subtype, nil] + optional :subtype, + enum: -> { FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::Subtype }, + nil?: true + + # @!attribute type + # The main employment type of the individual. + # + # @return [Symbol, FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::Type, nil] + optional :type, + enum: -> { FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::Type }, + nil?: true + + # @!parse + # # The employment object. + # # + # # @param subtype [Symbol, FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::Subtype, nil] + # # @param type [Symbol, FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::Type, nil] + # # + # def initialize(subtype: nil, type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # The secondary employment type of the individual. Options: `full_time`, + # `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`. + # + # @example + # ```ruby + # case subtype + # in :full_time + # # ... + # in :intern + # # ... + # in :part_time + # # ... + # in :temp + # # ... + # in :seasonal + # # ... + # in ... + # #... + # end + # ``` + class Subtype < FinchAPI::Enum + FULL_TIME = :full_time + INTERN = :intern + PART_TIME = :part_time + TEMP = :temp + SEASONAL = :seasonal + INDIVIDUAL_CONTRACTOR = :individual_contractor + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @abstract + # + # The main employment type of the individual. + # + # @example + # ```ruby + # case type + # in :employee + # # ... + # in :contractor + # # ... + # end + # ``` + class Type < FinchAPI::Enum + EMPLOYEE = :employee + CONTRACTOR = :contractor + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @abstract + # + # The detailed employment status of the individual. + # + # @example + # ```ruby + # case employment_status + # in :active + # # ... + # in :deceased + # # ... + # in :leave + # # ... + # in :onboarding + # # ... + # in :prehire + # # ... + # in ... + # #... + # end + # ``` + class EmploymentStatus < FinchAPI::Enum + ACTIVE = :active + DECEASED = :deceased + LEAVE = :leave + ONBOARDING = :onboarding + PREHIRE = :prehire + RETIRED = :retired + TERMINATED = :terminated + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + class Manager < FinchAPI::BaseModel + # @!attribute [r] id + # A stable Finch `id` (UUID v4) for an individual in the company. + # + # @return [String, nil] + optional :id, String + + # @!parse + # # @return [String] + # attr_writer :id + + # @!parse + # # The manager object representing the manager of the individual within the org. + # # + # # @param id [String] + # # + # def initialize(id: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end + end +end diff --git a/lib/finch-api/models/sandbox/employment_update_response.rb b/lib/finch-api/models/sandbox/employment_update_response.rb new file mode 100644 index 00000000..dcd77e86 --- /dev/null +++ b/lib/finch-api/models/sandbox/employment_update_response.rb @@ -0,0 +1,378 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module Sandbox + class EmploymentUpdateResponse < FinchAPI::BaseModel + # @!attribute [r] id + # A stable Finch `id` (UUID v4) for an individual in the company. + # + # @return [String, nil] + optional :id, String + + # @!parse + # # @return [String] + # attr_writer :id + + # @!attribute class_code + # Worker's compensation classification code for this employee + # + # @return [String, nil] + optional :class_code, String, nil?: true + + # @!attribute [r] custom_fields + # Custom fields for the individual. These are fields which are defined by the + # employer in the system. Custom fields are not currently supported for assisted + # connections. + # + # @return [Array, nil] + optional :custom_fields, + -> { FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::EmploymentUpdateResponse::CustomField] } + + # @!parse + # # @return [Array] + # attr_writer :custom_fields + + # @!attribute department + # The department object. + # + # @return [FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Department, nil] + optional :department, -> { FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Department }, nil?: true + + # @!attribute employment + # The employment object. + # + # @return [FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment, nil] + optional :employment, -> { FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment }, nil?: true + + # @!attribute employment_status + # The detailed employment status of the individual. + # + # @return [Symbol, FinchAPI::Models::Sandbox::EmploymentUpdateResponse::EmploymentStatus, nil] + optional :employment_status, + enum: -> { FinchAPI::Models::Sandbox::EmploymentUpdateResponse::EmploymentStatus }, + nil?: true + + # @!attribute end_date + # + # @return [String, nil] + optional :end_date, String, nil?: true + + # @!attribute first_name + # The legal first name of the individual. + # + # @return [String, nil] + optional :first_name, String, nil?: true + + # @!attribute income + # 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. + # + # @return [FinchAPI::Models::Income, nil] + optional :income, -> { FinchAPI::Models::Income }, nil?: true + + # @!attribute income_history + # The array of income history. + # + # @return [Array, nil] + optional :income_history, -> { FinchAPI::ArrayOf[FinchAPI::Models::Income, nil?: true] }, nil?: true + + # @!attribute is_active + # `true` if the individual an an active employee or contractor at the company. + # + # @return [Boolean, nil] + optional :is_active, FinchAPI::BooleanModel, nil?: true + + # @!attribute last_name + # The legal last name of the individual. + # + # @return [String, nil] + optional :last_name, String, nil?: true + + # @!attribute latest_rehire_date + # + # @return [String, nil] + optional :latest_rehire_date, String, nil?: true + + # @!attribute location + # + # @return [FinchAPI::Models::Location, nil] + optional :location, -> { FinchAPI::Models::Location }, nil?: true + + # @!attribute manager + # The manager object representing the manager of the individual within the org. + # + # @return [FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Manager, nil] + optional :manager, -> { FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Manager }, nil?: true + + # @!attribute middle_name + # The legal middle name of the individual. + # + # @return [String, nil] + optional :middle_name, String, nil?: true + + # @!attribute [r] source_id + # The source system's unique employment identifier for this individual + # + # @return [String, nil] + optional :source_id, String + + # @!parse + # # @return [String] + # attr_writer :source_id + + # @!attribute start_date + # + # @return [String, nil] + optional :start_date, String, nil?: true + + # @!attribute title + # The current title of the individual. + # + # @return [String, nil] + optional :title, String, nil?: true + + # @!parse + # # @param id [String] + # # @param class_code [String, nil] + # # @param custom_fields [Array] + # # @param department [FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Department, nil] + # # @param employment [FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment, nil] + # # @param employment_status [Symbol, FinchAPI::Models::Sandbox::EmploymentUpdateResponse::EmploymentStatus, nil] + # # @param end_date [String, nil] + # # @param first_name [String, nil] + # # @param income [FinchAPI::Models::Income, nil] + # # @param income_history [Array, nil] + # # @param is_active [Boolean, nil] + # # @param last_name [String, nil] + # # @param latest_rehire_date [String, nil] + # # @param location [FinchAPI::Models::Location, nil] + # # @param manager [FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Manager, nil] + # # @param middle_name [String, nil] + # # @param source_id [String] + # # @param start_date [String, nil] + # # @param title [String, nil] + # # + # def initialize( + # id: nil, + # class_code: nil, + # custom_fields: nil, + # department: nil, + # employment: nil, + # employment_status: nil, + # end_date: nil, + # first_name: nil, + # income: nil, + # income_history: nil, + # is_active: nil, + # last_name: nil, + # latest_rehire_date: nil, + # location: nil, + # manager: nil, + # middle_name: nil, + # source_id: nil, + # start_date: nil, + # title: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class CustomField < FinchAPI::BaseModel + # @!attribute name + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute [r] value + # + # @return [Object, nil] + optional :value, FinchAPI::Unknown + + # @!parse + # # @return [Object] + # attr_writer :value + + # @!parse + # # @param name [String, nil] + # # @param value [Object] + # # + # def initialize(name: nil, value: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + class Department < FinchAPI::BaseModel + # @!attribute name + # The name of the department associated with the individual. + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!parse + # # The department object. + # # + # # @param name [String, nil] + # # + # def initialize(name: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + + class Employment < FinchAPI::BaseModel + # @!attribute subtype + # The secondary employment type of the individual. Options: `full_time`, + # `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`. + # + # @return [Symbol, FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::Subtype, nil] + optional :subtype, + enum: -> { FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::Subtype }, + nil?: true + + # @!attribute type + # The main employment type of the individual. + # + # @return [Symbol, FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::Type, nil] + optional :type, + enum: -> { FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::Type }, + nil?: true + + # @!parse + # # The employment object. + # # + # # @param subtype [Symbol, FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::Subtype, nil] + # # @param type [Symbol, FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::Type, nil] + # # + # def initialize(subtype: nil, type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # The secondary employment type of the individual. Options: `full_time`, + # `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`. + # + # @example + # ```ruby + # case subtype + # in :full_time + # # ... + # in :intern + # # ... + # in :part_time + # # ... + # in :temp + # # ... + # in :seasonal + # # ... + # in ... + # #... + # end + # ``` + class Subtype < FinchAPI::Enum + FULL_TIME = :full_time + INTERN = :intern + PART_TIME = :part_time + TEMP = :temp + SEASONAL = :seasonal + INDIVIDUAL_CONTRACTOR = :individual_contractor + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @abstract + # + # The main employment type of the individual. + # + # @example + # ```ruby + # case type + # in :employee + # # ... + # in :contractor + # # ... + # end + # ``` + class Type < FinchAPI::Enum + EMPLOYEE = :employee + CONTRACTOR = :contractor + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @abstract + # + # The detailed employment status of the individual. + # + # @example + # ```ruby + # case employment_status + # in :active + # # ... + # in :deceased + # # ... + # in :leave + # # ... + # in :onboarding + # # ... + # in :prehire + # # ... + # in ... + # #... + # end + # ``` + class EmploymentStatus < FinchAPI::Enum + ACTIVE = :active + DECEASED = :deceased + LEAVE = :leave + ONBOARDING = :onboarding + PREHIRE = :prehire + RETIRED = :retired + TERMINATED = :terminated + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + class Manager < FinchAPI::BaseModel + # @!attribute [r] id + # A stable Finch `id` (UUID v4) for an individual in the company. + # + # @return [String, nil] + optional :id, String + + # @!parse + # # @return [String] + # attr_writer :id + + # @!parse + # # The manager object representing the manager of the individual within the org. + # # + # # @param id [String] + # # + # def initialize(id: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end + end +end diff --git a/lib/finch-api/models/sandbox/individual_update_params.rb b/lib/finch-api/models/sandbox/individual_update_params.rb new file mode 100644 index 00000000..9ebf2475 --- /dev/null +++ b/lib/finch-api/models/sandbox/individual_update_params.rb @@ -0,0 +1,292 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module Sandbox + class IndividualUpdateParams < FinchAPI::BaseModel + # @!parse + # extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + # @!attribute dob + # + # @return [String, nil] + optional :dob, String, nil?: true + + # @!attribute emails + # + # @return [Array, nil] + optional :emails, + -> { FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::IndividualUpdateParams::Email] }, + nil?: true + + # @!attribute encrypted_ssn + # Social Security Number of the individual in **encrypted** format. This field is + # only available with the `ssn` scope enabled and the + # `options: { include: ['ssn'] }` param set in the body. + # + # @return [String, nil] + optional :encrypted_ssn, String, nil?: true + + # @!attribute ethnicity + # The EEOC-defined ethnicity of the individual. + # + # @return [Symbol, FinchAPI::Models::Sandbox::IndividualUpdateParams::Ethnicity, nil] + optional :ethnicity, enum: -> { FinchAPI::Models::Sandbox::IndividualUpdateParams::Ethnicity }, nil?: true + + # @!attribute first_name + # The legal first name of the individual. + # + # @return [String, nil] + optional :first_name, String, nil?: true + + # @!attribute gender + # The gender of the individual. + # + # @return [Symbol, FinchAPI::Models::Sandbox::IndividualUpdateParams::Gender, nil] + optional :gender, enum: -> { FinchAPI::Models::Sandbox::IndividualUpdateParams::Gender }, nil?: true + + # @!attribute last_name + # The legal last name of the individual. + # + # @return [String, nil] + optional :last_name, String, nil?: true + + # @!attribute middle_name + # The legal middle name of the individual. + # + # @return [String, nil] + optional :middle_name, String, nil?: true + + # @!attribute phone_numbers + # + # @return [Array, nil] + optional :phone_numbers, + -> { FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber, nil?: true] }, + nil?: true + + # @!attribute preferred_name + # The preferred name of the individual. + # + # @return [String, nil] + optional :preferred_name, String, nil?: true + + # @!attribute residence + # + # @return [FinchAPI::Models::Location, nil] + optional :residence, -> { FinchAPI::Models::Location }, nil?: true + + # @!attribute ssn + # Social Security Number of the individual. This field is only available with the + # `ssn` scope enabled and the `options: { include: ['ssn'] }` param set in the + # body. + # [Click here to learn more about enabling the SSN field](/developer-resources/Enable-SSN-Field). + # + # @return [String, nil] + optional :ssn, String, nil?: true + + # @!parse + # # @param dob [String, nil] + # # @param emails [Array, nil] + # # @param encrypted_ssn [String, nil] + # # @param ethnicity [Symbol, FinchAPI::Models::Sandbox::IndividualUpdateParams::Ethnicity, nil] + # # @param first_name [String, nil] + # # @param gender [Symbol, FinchAPI::Models::Sandbox::IndividualUpdateParams::Gender, nil] + # # @param last_name [String, nil] + # # @param middle_name [String, nil] + # # @param phone_numbers [Array, nil] + # # @param preferred_name [String, nil] + # # @param residence [FinchAPI::Models::Location, nil] + # # @param ssn [String, nil] + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # dob: nil, + # emails: nil, + # encrypted_ssn: nil, + # ethnicity: nil, + # first_name: nil, + # gender: nil, + # last_name: nil, + # middle_name: nil, + # phone_numbers: nil, + # preferred_name: nil, + # residence: nil, + # ssn: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Email < FinchAPI::BaseModel + # @!attribute [r] data + # + # @return [String, nil] + optional :data, String + + # @!parse + # # @return [String] + # attr_writer :data + + # @!attribute type + # + # @return [Symbol, FinchAPI::Models::Sandbox::IndividualUpdateParams::Email::Type, nil] + optional :type, enum: -> { FinchAPI::Models::Sandbox::IndividualUpdateParams::Email::Type }, nil?: true + + # @!parse + # # @param data [String] + # # @param type [Symbol, FinchAPI::Models::Sandbox::IndividualUpdateParams::Email::Type, nil] + # # + # def initialize(data: nil, type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case type + # in :work + # # ... + # in :personal + # # ... + # end + # ``` + class Type < FinchAPI::Enum + WORK = :work + PERSONAL = :personal + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @abstract + # + # The EEOC-defined ethnicity of the individual. + # + # @example + # ```ruby + # case ethnicity + # in :asian + # # ... + # in :white + # # ... + # in :black_or_african_american + # # ... + # in :native_hawaiian_or_pacific_islander + # # ... + # in :american_indian_or_alaska_native + # # ... + # in ... + # #... + # end + # ``` + class Ethnicity < FinchAPI::Enum + ASIAN = :asian + WHITE = :white + BLACK_OR_AFRICAN_AMERICAN = :black_or_african_american + NATIVE_HAWAIIAN_OR_PACIFIC_ISLANDER = :native_hawaiian_or_pacific_islander + AMERICAN_INDIAN_OR_ALASKA_NATIVE = :american_indian_or_alaska_native + HISPANIC_OR_LATINO = :hispanic_or_latino + TWO_OR_MORE_RACES = :two_or_more_races + DECLINE_TO_SPECIFY = :decline_to_specify + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @abstract + # + # The gender of the individual. + # + # @example + # ```ruby + # case gender + # in :female + # # ... + # in :male + # # ... + # in :other + # # ... + # in :decline_to_specify + # # ... + # end + # ``` + class Gender < FinchAPI::Enum + FEMALE = :female + MALE = :male + OTHER = :other + DECLINE_TO_SPECIFY = :decline_to_specify + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + class PhoneNumber < FinchAPI::BaseModel + # @!attribute [r] data + # + # @return [String, nil] + optional :data, String + + # @!parse + # # @return [String] + # attr_writer :data + + # @!attribute type + # + # @return [Symbol, FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber::Type, nil] + optional :type, + enum: -> { FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber::Type }, + nil?: true + + # @!parse + # # @param data [String] + # # @param type [Symbol, FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber::Type, nil] + # # + # def initialize(data: nil, type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case type + # in :work + # # ... + # in :personal + # # ... + # end + # ``` + class Type < FinchAPI::Enum + WORK = :work + PERSONAL = :personal + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end + end +end diff --git a/lib/finch-api/models/sandbox/individual_update_response.rb b/lib/finch-api/models/sandbox/individual_update_response.rb new file mode 100644 index 00000000..10b86276 --- /dev/null +++ b/lib/finch-api/models/sandbox/individual_update_response.rb @@ -0,0 +1,300 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module Sandbox + class IndividualUpdateResponse < FinchAPI::BaseModel + # @!attribute [r] id + # A stable Finch `id` (UUID v4) for an individual in the company. + # + # @return [String, nil] + optional :id, String + + # @!parse + # # @return [String] + # attr_writer :id + + # @!attribute dob + # + # @return [String, nil] + optional :dob, String, nil?: true + + # @!attribute emails + # + # @return [Array, nil] + optional :emails, + -> { FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::IndividualUpdateResponse::Email] }, + nil?: true + + # @!attribute encrypted_ssn + # Social Security Number of the individual in **encrypted** format. This field is + # only available with the `ssn` scope enabled and the + # `options: { include: ['ssn'] }` param set in the body. + # + # @return [String, nil] + optional :encrypted_ssn, String, nil?: true + + # @!attribute ethnicity + # The EEOC-defined ethnicity of the individual. + # + # @return [Symbol, FinchAPI::Models::Sandbox::IndividualUpdateResponse::Ethnicity, nil] + optional :ethnicity, + enum: -> { FinchAPI::Models::Sandbox::IndividualUpdateResponse::Ethnicity }, + nil?: true + + # @!attribute first_name + # The legal first name of the individual. + # + # @return [String, nil] + optional :first_name, String, nil?: true + + # @!attribute gender + # The gender of the individual. + # + # @return [Symbol, FinchAPI::Models::Sandbox::IndividualUpdateResponse::Gender, nil] + optional :gender, enum: -> { FinchAPI::Models::Sandbox::IndividualUpdateResponse::Gender }, nil?: true + + # @!attribute last_name + # The legal last name of the individual. + # + # @return [String, nil] + optional :last_name, String, nil?: true + + # @!attribute middle_name + # The legal middle name of the individual. + # + # @return [String, nil] + optional :middle_name, String, nil?: true + + # @!attribute phone_numbers + # + # @return [Array, nil] + optional :phone_numbers, + -> { FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::IndividualUpdateResponse::PhoneNumber, nil?: true] }, + nil?: true + + # @!attribute preferred_name + # The preferred name of the individual. + # + # @return [String, nil] + optional :preferred_name, String, nil?: true + + # @!attribute residence + # + # @return [FinchAPI::Models::Location, nil] + optional :residence, -> { FinchAPI::Models::Location }, nil?: true + + # @!attribute ssn + # Social Security Number of the individual. This field is only available with the + # `ssn` scope enabled and the `options: { include: ['ssn'] }` param set in the + # body. + # [Click here to learn more about enabling the SSN field](/developer-resources/Enable-SSN-Field). + # + # @return [String, nil] + optional :ssn, String, nil?: true + + # @!parse + # # @param id [String] + # # @param dob [String, nil] + # # @param emails [Array, nil] + # # @param encrypted_ssn [String, nil] + # # @param ethnicity [Symbol, FinchAPI::Models::Sandbox::IndividualUpdateResponse::Ethnicity, nil] + # # @param first_name [String, nil] + # # @param gender [Symbol, FinchAPI::Models::Sandbox::IndividualUpdateResponse::Gender, nil] + # # @param last_name [String, nil] + # # @param middle_name [String, nil] + # # @param phone_numbers [Array, nil] + # # @param preferred_name [String, nil] + # # @param residence [FinchAPI::Models::Location, nil] + # # @param ssn [String, nil] + # # + # def initialize( + # id: nil, + # dob: nil, + # emails: nil, + # encrypted_ssn: nil, + # ethnicity: nil, + # first_name: nil, + # gender: nil, + # last_name: nil, + # middle_name: nil, + # phone_numbers: nil, + # preferred_name: nil, + # residence: nil, + # ssn: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Email < FinchAPI::BaseModel + # @!attribute [r] data + # + # @return [String, nil] + optional :data, String + + # @!parse + # # @return [String] + # attr_writer :data + + # @!attribute type + # + # @return [Symbol, FinchAPI::Models::Sandbox::IndividualUpdateResponse::Email::Type, nil] + optional :type, enum: -> { FinchAPI::Models::Sandbox::IndividualUpdateResponse::Email::Type }, nil?: true + + # @!parse + # # @param data [String] + # # @param type [Symbol, FinchAPI::Models::Sandbox::IndividualUpdateResponse::Email::Type, nil] + # # + # def initialize(data: nil, type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case type + # in :work + # # ... + # in :personal + # # ... + # end + # ``` + class Type < FinchAPI::Enum + WORK = :work + PERSONAL = :personal + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @abstract + # + # The EEOC-defined ethnicity of the individual. + # + # @example + # ```ruby + # case ethnicity + # in :asian + # # ... + # in :white + # # ... + # in :black_or_african_american + # # ... + # in :native_hawaiian_or_pacific_islander + # # ... + # in :american_indian_or_alaska_native + # # ... + # in ... + # #... + # end + # ``` + class Ethnicity < FinchAPI::Enum + ASIAN = :asian + WHITE = :white + BLACK_OR_AFRICAN_AMERICAN = :black_or_african_american + NATIVE_HAWAIIAN_OR_PACIFIC_ISLANDER = :native_hawaiian_or_pacific_islander + AMERICAN_INDIAN_OR_ALASKA_NATIVE = :american_indian_or_alaska_native + HISPANIC_OR_LATINO = :hispanic_or_latino + TWO_OR_MORE_RACES = :two_or_more_races + DECLINE_TO_SPECIFY = :decline_to_specify + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @abstract + # + # The gender of the individual. + # + # @example + # ```ruby + # case gender + # in :female + # # ... + # in :male + # # ... + # in :other + # # ... + # in :decline_to_specify + # # ... + # end + # ``` + class Gender < FinchAPI::Enum + FEMALE = :female + MALE = :male + OTHER = :other + DECLINE_TO_SPECIFY = :decline_to_specify + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + class PhoneNumber < FinchAPI::BaseModel + # @!attribute [r] data + # + # @return [String, nil] + optional :data, String + + # @!parse + # # @return [String] + # attr_writer :data + + # @!attribute type + # + # @return [Symbol, FinchAPI::Models::Sandbox::IndividualUpdateResponse::PhoneNumber::Type, nil] + optional :type, + enum: -> { FinchAPI::Models::Sandbox::IndividualUpdateResponse::PhoneNumber::Type }, + nil?: true + + # @!parse + # # @param data [String] + # # @param type [Symbol, FinchAPI::Models::Sandbox::IndividualUpdateResponse::PhoneNumber::Type, nil] + # # + # def initialize(data: nil, type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case type + # in :work + # # ... + # in :personal + # # ... + # end + # ``` + class Type < FinchAPI::Enum + WORK = :work + PERSONAL = :personal + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end + end +end diff --git a/lib/finch-api/models/sandbox/job_create_params.rb b/lib/finch-api/models/sandbox/job_create_params.rb new file mode 100644 index 00000000..1d6b7205 --- /dev/null +++ b/lib/finch-api/models/sandbox/job_create_params.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module Sandbox + class JobCreateParams < FinchAPI::BaseModel + # @!parse + # extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + # @!attribute type + # The type of job to start. Currently the only supported type is `data_sync_all` + # + # @return [Symbol, FinchAPI::Models::Sandbox::JobCreateParams::Type] + required :type, enum: -> { FinchAPI::Models::Sandbox::JobCreateParams::Type } + + # @!parse + # # @param type [Symbol, FinchAPI::Models::Sandbox::JobCreateParams::Type] + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(type:, request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # The type of job to start. Currently the only supported type is `data_sync_all` + # + # @example + # ```ruby + # case type + # in :data_sync_all + # # ... + # end + # ``` + class Type < FinchAPI::Enum + DATA_SYNC_ALL = :data_sync_all + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end +end diff --git a/lib/finch-api/models/sandbox/job_create_response.rb b/lib/finch-api/models/sandbox/job_create_response.rb new file mode 100644 index 00000000..111f3a40 --- /dev/null +++ b/lib/finch-api/models/sandbox/job_create_response.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module Sandbox + class JobCreateResponse < FinchAPI::BaseModel + # @!attribute allowed_refreshes + # The number of allowed refreshes per hour (per hour, fixed window) + # + # @return [Integer] + required :allowed_refreshes, Integer + + # @!attribute job_id + # The id of the job that has been created. + # + # @return [String] + required :job_id, String + + # @!attribute job_url + # The url that can be used to retrieve the job status + # + # @return [String] + required :job_url, String + + # @!attribute remaining_refreshes + # The number of remaining refreshes available (per hour, fixed window) + # + # @return [Integer] + required :remaining_refreshes, Integer + + # @!parse + # # @param allowed_refreshes [Integer] + # # @param job_id [String] + # # @param job_url [String] + # # @param remaining_refreshes [Integer] + # # + # def initialize(allowed_refreshes:, job_id:, job_url:, remaining_refreshes:, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end +end diff --git a/lib/finch-api/models/sandbox/jobs/configuration_retrieve_params.rb b/lib/finch-api/models/sandbox/jobs/configuration_retrieve_params.rb new file mode 100644 index 00000000..a88f09f2 --- /dev/null +++ b/lib/finch-api/models/sandbox/jobs/configuration_retrieve_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module Sandbox + module Jobs + class ConfigurationRetrieveParams < FinchAPI::BaseModel + # @!parse + # extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + # @!parse + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end + end +end diff --git a/lib/finch-api/models/sandbox/jobs/configuration_retrieve_response.rb b/lib/finch-api/models/sandbox/jobs/configuration_retrieve_response.rb new file mode 100644 index 00000000..bb2a4b46 --- /dev/null +++ b/lib/finch-api/models/sandbox/jobs/configuration_retrieve_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module Sandbox + module Jobs + ConfigurationRetrieveResponse = FinchAPI::ArrayOf[-> { FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration }] + end + end + end +end diff --git a/lib/finch-api/models/sandbox/jobs/configuration_update_params.rb b/lib/finch-api/models/sandbox/jobs/configuration_update_params.rb new file mode 100644 index 00000000..7237bcd9 --- /dev/null +++ b/lib/finch-api/models/sandbox/jobs/configuration_update_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module Sandbox + module Jobs + class ConfigurationUpdateParams < FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration + # @!parse + # extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + # @!parse + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end + end +end diff --git a/lib/finch-api/models/sandbox/jobs/sandbox_job_configuration.rb b/lib/finch-api/models/sandbox/jobs/sandbox_job_configuration.rb new file mode 100644 index 00000000..74375558 --- /dev/null +++ b/lib/finch-api/models/sandbox/jobs/sandbox_job_configuration.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module Sandbox + module Jobs + class SandboxJobConfiguration < FinchAPI::BaseModel + # @!attribute completion_status + # + # @return [Symbol, FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::CompletionStatus] + required :completion_status, + enum: -> { FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::CompletionStatus } + + # @!attribute type + # + # @return [Symbol, FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::Type] + required :type, enum: -> { FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::Type } + + # @!parse + # # @param completion_status [Symbol, FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::CompletionStatus] + # # @param type [Symbol, FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::Type] + # # + # def initialize(completion_status:, type:, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + # @abstract + # + # @example + # ```ruby + # case completion_status + # in :complete + # # ... + # in :reauth_error + # # ... + # in :permissions_error + # # ... + # in :error + # # ... + # end + # ``` + class CompletionStatus < FinchAPI::Enum + COMPLETE = :complete + REAUTH_ERROR = :reauth_error + PERMISSIONS_ERROR = :permissions_error + ERROR = :error + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + # @abstract + # + # @example + # ```ruby + # case type + # in :data_sync_all + # # ... + # end + # ``` + class Type < FinchAPI::Enum + DATA_SYNC_ALL = :data_sync_all + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end + end +end diff --git a/lib/finch-api/models/sandbox/payment_create_params.rb b/lib/finch-api/models/sandbox/payment_create_params.rb new file mode 100644 index 00000000..df02a216 --- /dev/null +++ b/lib/finch-api/models/sandbox/payment_create_params.rb @@ -0,0 +1,646 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module Sandbox + class PaymentCreateParams < FinchAPI::BaseModel + # @!parse + # extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + # @!attribute [r] end_date + # + # @return [String, nil] + optional :end_date, String + + # @!parse + # # @return [String] + # attr_writer :end_date + + # @!attribute [r] pay_statements + # + # @return [Array, nil] + optional :pay_statements, + -> { FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement] } + + # @!parse + # # @return [Array] + # attr_writer :pay_statements + + # @!attribute [r] start_date + # + # @return [String, nil] + optional :start_date, String + + # @!parse + # # @return [String] + # attr_writer :start_date + + # @!parse + # # @param end_date [String] + # # @param pay_statements [Array] + # # @param start_date [String] + # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(end_date: nil, pay_statements: nil, start_date: nil, request_options: {}, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class PayStatement < FinchAPI::BaseModel + # @!attribute earnings + # The array of earnings objects associated with this pay statement + # + # @return [Array, nil] + optional :earnings, + -> { FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning, nil?: true] }, + nil?: true + + # @!attribute employee_deductions + # The array of deductions objects associated with this pay statement. + # + # @return [Array, nil] + optional :employee_deductions, + -> { FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction, nil?: true] }, + nil?: true + + # @!attribute employer_contributions + # + # @return [Array, nil] + optional :employer_contributions, + -> { FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution, nil?: true] }, + nil?: true + + # @!attribute gross_pay + # + # @return [FinchAPI::Models::Money, nil] + optional :gross_pay, -> { FinchAPI::Models::Money }, nil?: true + + # @!attribute [r] individual_id + # A stable Finch `id` (UUID v4) for an individual in the company + # + # @return [String, nil] + optional :individual_id, String + + # @!parse + # # @return [String] + # attr_writer :individual_id + + # @!attribute net_pay + # + # @return [FinchAPI::Models::Money, nil] + optional :net_pay, -> { FinchAPI::Models::Money }, nil?: true + + # @!attribute payment_method + # The payment method. + # + # @return [Symbol, FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::PaymentMethod, nil] + optional :payment_method, + enum: -> { FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::PaymentMethod }, + nil?: true + + # @!attribute taxes + # The array of taxes objects associated with this pay statement. + # + # @return [Array, nil] + optional :taxes, + -> { FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax, nil?: true] }, + nil?: true + + # @!attribute total_hours + # The number of hours worked for this pay period + # + # @return [Float, nil] + optional :total_hours, Float, nil?: true + + # @!attribute type + # The type of the payment associated with the pay statement. + # + # @return [Symbol, FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Type, nil] + optional :type, + enum: -> { FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Type }, + nil?: true + + # @!parse + # # @param earnings [Array, nil] + # # @param employee_deductions [Array, nil] + # # @param employer_contributions [Array, nil] + # # @param gross_pay [FinchAPI::Models::Money, nil] + # # @param individual_id [String] + # # @param net_pay [FinchAPI::Models::Money, nil] + # # @param payment_method [Symbol, FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::PaymentMethod, nil] + # # @param taxes [Array, nil] + # # @param total_hours [Float, nil] + # # @param type [Symbol, FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Type, nil] + # # + # def initialize( + # earnings: nil, + # employee_deductions: nil, + # employer_contributions: nil, + # gross_pay: nil, + # individual_id: nil, + # net_pay: nil, + # payment_method: nil, + # taxes: nil, + # total_hours: nil, + # type: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Earning < FinchAPI::BaseModel + # @!attribute amount + # The earnings amount in cents. + # + # @return [Integer, nil] + optional :amount, Integer, nil?: true + + # @!attribute attributes + # + # @return [FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes, nil] + optional :attributes, + -> { FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes }, + nil?: true + + # @!attribute currency + # The earnings currency code. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute hours + # The number of hours associated with this earning. (For salaried employees, this + # could be hours per pay period, `0` or `null`, depending on the provider). + # + # @return [Float, nil] + optional :hours, Float, nil?: true + + # @!attribute name + # The exact name of the deduction from the pay statement. + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute type + # The type of earning. + # + # @return [Symbol, FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Type, nil] + optional :type, + enum: -> { FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Type }, + nil?: true + + # @!parse + # # @param amount [Integer, nil] + # # @param attributes [FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes, nil] + # # @param currency [String, nil] + # # @param hours [Float, nil] + # # @param name [String, nil] + # # @param type [Symbol, FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Type, nil] + # # + # def initialize(amount: nil, attributes: nil, currency: nil, hours: nil, name: nil, type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Attributes < FinchAPI::BaseModel + # @!attribute [r] metadata + # + # @return [FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes::Metadata, nil] + optional :metadata, + -> { FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes::Metadata } + + # @!parse + # # @return [FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes::Metadata] + # attr_writer :metadata + + # @!parse + # # @param metadata [FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes::Metadata] + # # + # def initialize(metadata: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Metadata < FinchAPI::BaseModel + # @!attribute [r] metadata + # The metadata to be attached to the entity by existing rules. It is a key-value + # pairs where the values can be of any type (string, number, boolean, object, + # array, etc.). + # + # @return [Hash{Symbol=>Object}, nil] + optional :metadata, FinchAPI::HashOf[FinchAPI::Unknown] + + # @!parse + # # @return [Hash{Symbol=>Object}] + # attr_writer :metadata + + # @!parse + # # @param metadata [Hash{Symbol=>Object}] + # # + # def initialize(metadata: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + + # @abstract + # + # The type of earning. + # + # @example + # ```ruby + # case type + # in :salary + # # ... + # in :wage + # # ... + # in :reimbursement + # # ... + # in :overtime + # # ... + # in :severance + # # ... + # in ... + # #... + # end + # ``` + class Type < FinchAPI::Enum + SALARY = :salary + WAGE = :wage + REIMBURSEMENT = :reimbursement + OVERTIME = :overtime + SEVERANCE = :severance + DOUBLE_OVERTIME = :double_overtime + PTO = :pto + SICK = :sick + BONUS = :bonus + COMMISSION = :commission + TIPS = :tips + NUMBER_1099 = :"1099" + OTHER = :other + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + class EmployeeDeduction < FinchAPI::BaseModel + # @!attribute amount + # The deduction amount in cents. + # + # @return [Integer, nil] + optional :amount, Integer, nil?: true + + # @!attribute attributes + # + # @return [FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes, nil] + optional :attributes, + -> { FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes }, + nil?: true + + # @!attribute currency + # The deduction currency. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute name + # The deduction name from the pay statement. + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute pre_tax + # Boolean indicating if the deduction is pre-tax. + # + # @return [Boolean, nil] + optional :pre_tax, FinchAPI::BooleanModel, nil?: true + + # @!attribute type + # Type of benefit. + # + # @return [Symbol, FinchAPI::Models::HRIS::BenefitType, nil] + optional :type, enum: -> { FinchAPI::Models::HRIS::BenefitType }, nil?: true + + # @!parse + # # @param amount [Integer, nil] + # # @param attributes [FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes, nil] + # # @param currency [String, nil] + # # @param name [String, nil] + # # @param pre_tax [Boolean, nil] + # # @param type [Symbol, FinchAPI::Models::HRIS::BenefitType, nil] + # # + # def initialize(amount: nil, attributes: nil, currency: nil, name: nil, pre_tax: nil, type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Attributes < FinchAPI::BaseModel + # @!attribute [r] metadata + # + # @return [FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes::Metadata, nil] + optional :metadata, + -> { FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes::Metadata } + + # @!parse + # # @return [FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes::Metadata] + # attr_writer :metadata + + # @!parse + # # @param metadata [FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes::Metadata] + # # + # def initialize(metadata: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Metadata < FinchAPI::BaseModel + # @!attribute [r] metadata + # The metadata to be attached to the entity by existing rules. It is a key-value + # pairs where the values can be of any type (string, number, boolean, object, + # array, etc.). + # + # @return [Hash{Symbol=>Object}, nil] + optional :metadata, FinchAPI::HashOf[FinchAPI::Unknown] + + # @!parse + # # @return [Hash{Symbol=>Object}] + # attr_writer :metadata + + # @!parse + # # @param metadata [Hash{Symbol=>Object}] + # # + # def initialize(metadata: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end + + class EmployerContribution < FinchAPI::BaseModel + # @!attribute amount + # The contribution amount in cents. + # + # @return [Integer, nil] + optional :amount, Integer, nil?: true + + # @!attribute attributes + # + # @return [FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes, nil] + optional :attributes, + -> { FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes }, + nil?: true + + # @!attribute currency + # The contribution currency. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute name + # The contribution name from the pay statement. + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute type + # Type of benefit. + # + # @return [Symbol, FinchAPI::Models::HRIS::BenefitType, nil] + optional :type, enum: -> { FinchAPI::Models::HRIS::BenefitType }, nil?: true + + # @!parse + # # @param amount [Integer, nil] + # # @param attributes [FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes, nil] + # # @param currency [String, nil] + # # @param name [String, nil] + # # @param type [Symbol, FinchAPI::Models::HRIS::BenefitType, nil] + # # + # def initialize(amount: nil, attributes: nil, currency: nil, name: nil, type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Attributes < FinchAPI::BaseModel + # @!attribute [r] metadata + # + # @return [FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes::Metadata, nil] + optional :metadata, + -> { FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes::Metadata } + + # @!parse + # # @return [FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes::Metadata] + # attr_writer :metadata + + # @!parse + # # @param metadata [FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes::Metadata] + # # + # def initialize(metadata: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Metadata < FinchAPI::BaseModel + # @!attribute [r] metadata + # The metadata to be attached to the entity by existing rules. It is a key-value + # pairs where the values can be of any type (string, number, boolean, object, + # array, etc.). + # + # @return [Hash{Symbol=>Object}, nil] + optional :metadata, FinchAPI::HashOf[FinchAPI::Unknown] + + # @!parse + # # @return [Hash{Symbol=>Object}] + # attr_writer :metadata + + # @!parse + # # @param metadata [Hash{Symbol=>Object}] + # # + # def initialize(metadata: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end + + # @abstract + # + # The payment method. + # + # @example + # ```ruby + # case payment_method + # in :check + # # ... + # in :direct_deposit + # # ... + # end + # ``` + class PaymentMethod < FinchAPI::Enum + CHECK = :check + DIRECT_DEPOSIT = :direct_deposit + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + + class Tax < FinchAPI::BaseModel + # @!attribute amount + # The tax amount in cents. + # + # @return [Integer, nil] + optional :amount, Integer, nil?: true + + # @!attribute attributes + # + # @return [FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes, nil] + optional :attributes, + -> { FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes }, + nil?: true + + # @!attribute currency + # The currency code. + # + # @return [String, nil] + optional :currency, String, nil?: true + + # @!attribute employer + # `true` if the amount is paid by the employers. + # + # @return [Boolean, nil] + optional :employer, FinchAPI::BooleanModel, nil?: true + + # @!attribute name + # The exact name of tax from the pay statement. + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute type + # The type of taxes. + # + # @return [Symbol, FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Type, nil] + optional :type, + enum: -> { FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Type }, + nil?: true + + # @!parse + # # @param amount [Integer, nil] + # # @param attributes [FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes, nil] + # # @param currency [String, nil] + # # @param employer [Boolean, nil] + # # @param name [String, nil] + # # @param type [Symbol, FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Type, nil] + # # + # def initialize(amount: nil, attributes: nil, currency: nil, employer: nil, name: nil, type: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Attributes < FinchAPI::BaseModel + # @!attribute [r] metadata + # + # @return [FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes::Metadata, nil] + optional :metadata, + -> { FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes::Metadata } + + # @!parse + # # @return [FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes::Metadata] + # attr_writer :metadata + + # @!parse + # # @param metadata [FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes::Metadata] + # # + # def initialize(metadata: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Metadata < FinchAPI::BaseModel + # @!attribute [r] metadata + # The metadata to be attached to the entity by existing rules. It is a key-value + # pairs where the values can be of any type (string, number, boolean, object, + # array, etc.). + # + # @return [Hash{Symbol=>Object}, nil] + optional :metadata, FinchAPI::HashOf[FinchAPI::Unknown] + + # @!parse + # # @return [Hash{Symbol=>Object}] + # attr_writer :metadata + + # @!parse + # # @param metadata [Hash{Symbol=>Object}] + # # + # def initialize(metadata: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + + # @abstract + # + # The type of taxes. + # + # @example + # ```ruby + # case type + # in :state + # # ... + # in :federal + # # ... + # in :local + # # ... + # in :fica + # # ... + # end + # ``` + class Type < FinchAPI::Enum + STATE = :state + FEDERAL = :federal + LOCAL = :local + FICA = :fica + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + + # @abstract + # + # The type of the payment associated with the pay statement. + # + # @example + # ```ruby + # case type + # in :regular_payroll + # # ... + # in :off_cycle_payroll + # # ... + # in :one_time_payment + # # ... + # end + # ``` + class Type < FinchAPI::Enum + REGULAR_PAYROLL = :regular_payroll + OFF_CYCLE_PAYROLL = :off_cycle_payroll + ONE_TIME_PAYMENT = :one_time_payment + + finalize! + + # @!parse + # # @return [Array] + # # + # def self.values; end + end + end + end + end + end +end diff --git a/lib/finch-api/models/sandbox/payment_create_response.rb b/lib/finch-api/models/sandbox/payment_create_response.rb new file mode 100644 index 00000000..cffe6d95 --- /dev/null +++ b/lib/finch-api/models/sandbox/payment_create_response.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module Sandbox + class PaymentCreateResponse < FinchAPI::BaseModel + # @!attribute pay_date + # The date of the payment. + # + # @return [String] + required :pay_date, String + + # @!attribute payment_id + # The ID of the payment. + # + # @return [String] + required :payment_id, String + + # @!parse + # # @param pay_date [String] + # # @param payment_id [String] + # # + # def initialize(pay_date:, payment_id:, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end +end diff --git a/lib/finch-api/models/webhook_event.rb b/lib/finch-api/models/webhook_event.rb new file mode 100644 index 00000000..3b4914ad --- /dev/null +++ b/lib/finch-api/models/webhook_event.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + # @abstract + # + # @example + # ```ruby + # case webhook_event + # in FinchAPI::Models::AccountUpdateEvent + # # ... + # in FinchAPI::Models::JobCompletionEvent + # # ... + # in FinchAPI::Models::CompanyEvent + # # ... + # in FinchAPI::Models::DirectoryEvent + # # ... + # in FinchAPI::Models::EmploymentEvent + # # ... + # in FinchAPI::Models::IndividualEvent + # # ... + # in FinchAPI::Models::PaymentEvent + # # ... + # in FinchAPI::Models::PayStatementEvent + # # ... + # end + # ``` + class WebhookEvent < FinchAPI::Union + discriminator :event_type + + variant -> { FinchAPI::Models::AccountUpdateEvent } + + variant -> { FinchAPI::Models::JobCompletionEvent } + + variant -> { FinchAPI::Models::CompanyEvent } + + variant -> { FinchAPI::Models::DirectoryEvent } + + variant -> { FinchAPI::Models::EmploymentEvent } + + variant -> { FinchAPI::Models::IndividualEvent } + + variant -> { FinchAPI::Models::PaymentEvent } + + variant -> { FinchAPI::Models::PayStatementEvent } + end + end +end diff --git a/lib/finch-api/page.rb b/lib/finch-api/page.rb new file mode 100644 index 00000000..167eedd3 --- /dev/null +++ b/lib/finch-api/page.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +module FinchAPI + # @example + # ```ruby + # if page.has_next? + # page = page.next_page + # end + # ``` + # + # @example + # ```ruby + # page.auto_paging_each do |item| + # # item ... + # end + # ``` + # + # @example + # ```ruby + # items = page.to_enum.take(2) + # + # items => Array + # ``` + class Page + include FinchAPI::BasePage + + # @return [Array] + attr_accessor :data + + # @return [FinchAPI::Models::Paging] + attr_accessor :paging + + # rubocop:disable Lint/UnusedMethodArgument + # @private + # + # @param client [FinchAPI::BaseClient] + # @param req [Hash{Symbol=>Object}] + # @param headers [Hash{String=>String}, Net::HTTPHeader] + # @param unwrapped [Hash{Symbol=>Object}] + # + def initialize(client:, req:, headers:, unwrapped:) + @client = client + @req = req + model = req.fetch(:model) + + case unwrapped + in {data: Array | nil => data} + @data = data&.map { model.coerce(_1) } + else + end + + case unwrapped + in {paging: Hash | nil => paging} + @paging = FinchAPI::Models::Paging.coerce(paging) + else + end + end + # rubocop:enable Lint/UnusedMethodArgument + + # @return [Boolean] + # + def next_page? + paging&.offset.to_i + data.size < paging&.count.to_i + end + + # @raise [FinchAPI::HTTP::Error] + # @return [FinchAPI::Page] + # + def next_page + unless next_page? + raise RuntimeError.new("No more pages available; please check #next_page? before calling #next_page") + end + + req = FinchAPI::Util.deep_merge(@req, {query: {offset: paging&.offset.to_i + data.size}}) + @client.request(req) + end + + # @param blk [Proc] + # + def auto_paging_each(&blk) + unless block_given? + raise ArgumentError.new("A block must be given to #auto_paging_each") + end + page = self + loop do + page.data&.each { blk.call(_1) } + break unless page.next_page? + page = page.next_page + end + end + + # @return [String] + # + def inspect + "#<#{self.class}:0x#{object_id.to_s(16)} data=#{data.inspect} paging=#{paging.inspect}>" + end + end +end diff --git a/lib/finch-api/pooled_net_requester.rb b/lib/finch-api/pooled_net_requester.rb new file mode 100644 index 00000000..0087f71d --- /dev/null +++ b/lib/finch-api/pooled_net_requester.rb @@ -0,0 +1,175 @@ +# frozen_string_literal: true + +module FinchAPI + # @private + # + class PooledNetRequester + class << self + # @private + # + # @param url [URI::Generic] + # + # @return [Net::HTTP] + # + def connect(url) + port = + case [url.port, url.scheme] + in [Integer, _] + url.port + in [nil, "http" | "ws"] + Net::HTTP.http_default_port + in [nil, "https" | "wss"] + Net::HTTP.https_default_port + end + + Net::HTTP.new(url.host, port).tap do + _1.use_ssl = %w[https wss].include?(url.scheme) + _1.max_retries = 0 + end + end + + # @private + # + # @param conn [Net::HTTP] + # @param deadline [Float] + # + def calibrate_socket_timeout(conn, deadline) + timeout = deadline - FinchAPI::Util.monotonic_secs + conn.open_timeout = conn.read_timeout = conn.write_timeout = conn.continue_timeout = timeout + end + + # @private + # + # @param request [Hash{Symbol=>Object}] . + # + # @option request [Symbol] :method + # + # @option request [URI::Generic] :url + # + # @option request [Hash{String=>String}] :headers + # + # @return [Net::HTTPGenericRequest] + # + def build_request(request) + method, url, headers, body = request.fetch_values(:method, :url, :headers, :body) + req = Net::HTTPGenericRequest.new( + method.to_s.upcase, + !body.nil?, + method != :head, + url.to_s + ) + + headers.each { req[_1] = _2 } + + case body + in nil + in String + req.body = body + in StringIO + req.body = body.string + in IO + body.rewind + req.body_stream = body + end + + req + end + end + + # @private + # + # @param url [URI::Generic] + # @param blk [Proc] + # + private def with_pool(url, &blk) + origin = FinchAPI::Util.uri_origin(url) + th = Thread.current + key = :"#{object_id}-#{self.class.name}-connection_in_use_for_#{origin}" + + if th[key] + tap do + conn = self.class.connect(url) + return blk.call(conn) + ensure + conn.finish if conn&.started? + end + end + + pool = + @mutex.synchronize do + @pools[origin] ||= ConnectionPool.new(size: Etc.nprocessors) do + self.class.connect(url) + end + end + + pool.with do |conn| + th[key] = true + blk.call(conn) + ensure + th[key] = nil + end + end + + # @private + # + # @param request [Hash{Symbol=>Object}] . + # + # @option request [Symbol] :method + # + # @option request [URI::Generic] :url + # + # @option request [Hash{String=>String}] :headers + # + # @option request [Object] :body + # + # @option request [Float] :deadline + # + # @return [Array(Net::HTTPResponse, Enumerable)] + # + def execute(request) + url, deadline = request.fetch_values(:url, :deadline) + req = self.class.build_request(request) + + eof = false + finished = false + enum = Enumerator.new do |y| + with_pool(url) do |conn| + next if finished + + self.class.calibrate_socket_timeout(conn, deadline) + conn.start unless conn.started? + + self.class.calibrate_socket_timeout(conn, deadline) + conn.request(req) do |rsp| + y << [conn, rsp] + break if finished + + rsp.read_body do |bytes| + y << bytes + break if finished + + self.class.calibrate_socket_timeout(conn, deadline) + end + eof = true + end + end + end + + conn, response = enum.next + body = FinchAPI::Util.fused_enum(enum) do + finished = true + tap do + enum.next + rescue StopIteration + end + conn.finish if !eof && conn&.started? + end + [response, (response.body = body)] + end + + def initialize + @mutex = Mutex.new + @pools = {} + end + end +end diff --git a/lib/finch-api/request_options.rb b/lib/finch-api/request_options.rb new file mode 100644 index 00000000..2bb2b387 --- /dev/null +++ b/lib/finch-api/request_options.rb @@ -0,0 +1,115 @@ +# frozen_string_literal: true + +module FinchAPI + # @private + # + # @abstract + # + module RequestParameters + # @!parse + # # Options to specify HTTP behaviour for this request. + # # @return [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # attr_accessor :request_options + + # @param mod [Module] + # + def self.included(mod) + return unless mod <= FinchAPI::BaseModel + + mod.extend(FinchAPI::RequestParameters::Converter) + mod.optional(:request_options, FinchAPI::RequestOptions) + end + + # @private + # + module Converter + # @private + # + # @param params [Object] + # + # @return [Array(Object, Hash{Symbol=>Object})] + # + def dump_request(params) + case (dumped = dump(params)) + in Hash + [dumped.except(:request_options), dumped[:request_options]] + else + [dumped, nil] + end + end + end + end + + # Specify HTTP behaviour to use for a specific request. These options supplement + # or override those provided at the client level. + # + # When making a request, you can pass an actual {RequestOptions} instance, or + # simply pass a Hash with symbol keys matching the attributes on this class. + class RequestOptions < FinchAPI::BaseModel + # @private + # + # @param opts [FinchAPI::RequestOptions, Hash{Symbol=>Object}] + # + # @raise [ArgumentError] + # + def self.validate!(opts) + case opts + in FinchAPI::RequestOptions | Hash + opts.to_h.each_key do |k| + unless fields.include?(k) + raise ArgumentError.new("Request `opts` keys must be one of #{fields.keys}, got #{k.inspect}") + end + end + else + raise ArgumentError.new("Request `opts` must be a Hash or RequestOptions, got #{opts.inspect}") + end + end + + # @!attribute idempotency_key + # Idempotency key to send with request and all associated retries. Will only be + # sent for write requests. + # + # @return [String, nil] + optional :idempotency_key, String + + # @!attribute extra_query + # Extra query params to send with the request. These are `.merge`’d into any + # `query` given at the client level. + # + # @return [Hash{String=>Array, String, nil}, nil] + optional :extra_query, FinchAPI::HashOf[FinchAPI::ArrayOf[String]] + + # @!attribute extra_headers + # Extra headers to send with the request. These are `.merged`’d into any + # `extra_headers` given at the client level. + # + # @return [Hash{String=>String, nil}, nil] + optional :extra_headers, FinchAPI::HashOf[String, nil?: true] + + # @!attribute extra_body + # Extra data to send with the request. These are deep merged into any data + # generated as part of the normal request. + # + # @return [Hash{Symbol=>Object}, nil] + optional :extra_body, FinchAPI::HashOf[FinchAPI::Unknown] + + # @!attribute max_retries + # Maximum number of retries to attempt after a failed initial request. + # + # @return [Integer, nil] + optional :max_retries, Integer + + # @!attribute timeout + # Request timeout in seconds. + # + # @return [Float, nil] + optional :timeout, Float + + # @!parse + # # Returns a new instance of RequestOptions. + # # + # # @param values [Hash{Symbol=>Object}] + # # + # def initialize(values = {}) = super + end +end diff --git a/lib/finch-api/resources/access_tokens.rb b/lib/finch-api/resources/access_tokens.rb new file mode 100644 index 00000000..d760f881 --- /dev/null +++ b/lib/finch-api/resources/access_tokens.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +module FinchAPI + module Resources + class AccessTokens + # Exchange the authorization code for an access token + # + # @param params [FinchAPI::Models::AccessTokenCreateParams, Hash{Symbol=>Object}] . + # + # @option params [String] :code + # + # @option params [String] :client_id + # + # @option params [String] :client_secret + # + # @option params [String] :redirect_uri + # + # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [FinchAPI::Models::CreateAccessTokenResponse] + # + def create(params) + parsed, options = FinchAPI::Models::AccessTokenCreateParams.dump_request(params) + @client.request( + method: :post, + path: "auth/token", + body: parsed, + model: FinchAPI::Models::CreateAccessTokenResponse, + options: options + ) + end + + # @param client [FinchAPI::Client] + # + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/finch-api/resources/account.rb b/lib/finch-api/resources/account.rb new file mode 100644 index 00000000..8f7e3f6a --- /dev/null +++ b/lib/finch-api/resources/account.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +module FinchAPI + module Resources + class Account + # Disconnect one or more `access_token`s from your application. + # + # @param params [FinchAPI::Models::AccountDisconnectParams, Hash{Symbol=>Object}] . + # + # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [FinchAPI::Models::DisconnectResponse] + # + def disconnect(params = {}) + @client.request( + method: :post, + path: "disconnect", + model: FinchAPI::Models::DisconnectResponse, + options: params[:request_options] + ) + end + + # Read account information associated with an `access_token` + # + # @param params [FinchAPI::Models::AccountIntrospectParams, Hash{Symbol=>Object}] . + # + # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [FinchAPI::Models::Introspection] + # + def introspect(params = {}) + @client.request( + method: :get, + path: "introspect", + model: FinchAPI::Models::Introspection, + options: params[:request_options] + ) + end + + # @param client [FinchAPI::Client] + # + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/finch-api/resources/connect.rb b/lib/finch-api/resources/connect.rb new file mode 100644 index 00000000..538d30a8 --- /dev/null +++ b/lib/finch-api/resources/connect.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module FinchAPI + module Resources + class Connect + # @return [FinchAPI::Resources::Connect::Sessions] + attr_reader :sessions + + # @param client [FinchAPI::Client] + # + def initialize(client:) + @client = client + @sessions = FinchAPI::Resources::Connect::Sessions.new(client: client) + end + end + end +end diff --git a/lib/finch-api/resources/connect/sessions.rb b/lib/finch-api/resources/connect/sessions.rb new file mode 100644 index 00000000..f490b350 --- /dev/null +++ b/lib/finch-api/resources/connect/sessions.rb @@ -0,0 +1,81 @@ +# frozen_string_literal: true + +module FinchAPI + module Resources + class Connect + class Sessions + # Create a new connect session for an employer + # + # @param params [FinchAPI::Models::Connect::SessionNewParams, Hash{Symbol=>Object}] . + # + # @option params [String] :customer_id + # + # @option params [String] :customer_name + # + # @option params [Array] :products + # + # @option params [String, nil] :customer_email + # + # @option params [FinchAPI::Models::Connect::SessionNewParams::Integration, nil] :integration + # + # @option params [Boolean, nil] :manual + # + # @option params [Float, nil] :minutes_to_expire The number of minutes until the session expires (defaults to 43,200, which is 30 + # days) + # + # @option params [String, nil] :redirect_uri + # + # @option params [Symbol, FinchAPI::Models::Connect::SessionNewParams::Sandbox, nil] :sandbox + # + # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [FinchAPI::Models::Connect::SessionNewResponse] + # + def new(params) + parsed, options = FinchAPI::Models::Connect::SessionNewParams.dump_request(params) + @client.request( + method: :post, + path: "connect/sessions", + body: parsed, + model: FinchAPI::Models::Connect::SessionNewResponse, + options: options + ) + end + + # Create a new Connect session for reauthenticating an existing connection + # + # @param params [FinchAPI::Models::Connect::SessionReauthenticateParams, Hash{Symbol=>Object}] . + # + # @option params [String] :connection_id The ID of the existing connection to reauthenticate + # + # @option params [Integer, nil] :minutes_to_expire The number of minutes until the session expires (defaults to 43,200, which is 30 + # days) + # + # @option params [Array, nil] :products The products to request access to (optional for reauthentication) + # + # @option params [String, nil] :redirect_uri The URI to redirect to after the Connect flow is completed + # + # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [FinchAPI::Models::Connect::SessionReauthenticateResponse] + # + def reauthenticate(params) + parsed, options = FinchAPI::Models::Connect::SessionReauthenticateParams.dump_request(params) + @client.request( + method: :post, + path: "connect/sessions/reauthenticate", + body: parsed, + model: FinchAPI::Models::Connect::SessionReauthenticateResponse, + options: options + ) + end + + # @param client [FinchAPI::Client] + # + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/finch-api/resources/hris.rb b/lib/finch-api/resources/hris.rb new file mode 100644 index 00000000..635afd0a --- /dev/null +++ b/lib/finch-api/resources/hris.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +module FinchAPI + module Resources + class HRIS + # @return [FinchAPI::Resources::HRIS::Company] + attr_reader :company + + # @return [FinchAPI::Resources::HRIS::Directory] + attr_reader :directory + + # @return [FinchAPI::Resources::HRIS::Individuals] + attr_reader :individuals + + # @return [FinchAPI::Resources::HRIS::Employments] + attr_reader :employments + + # @return [FinchAPI::Resources::HRIS::Payments] + attr_reader :payments + + # @return [FinchAPI::Resources::HRIS::PayStatements] + attr_reader :pay_statements + + # @return [FinchAPI::Resources::HRIS::Documents] + attr_reader :documents + + # @return [FinchAPI::Resources::HRIS::Benefits] + attr_reader :benefits + + # @param client [FinchAPI::Client] + # + def initialize(client:) + @client = client + @company = FinchAPI::Resources::HRIS::Company.new(client: client) + @directory = FinchAPI::Resources::HRIS::Directory.new(client: client) + @individuals = FinchAPI::Resources::HRIS::Individuals.new(client: client) + @employments = FinchAPI::Resources::HRIS::Employments.new(client: client) + @payments = FinchAPI::Resources::HRIS::Payments.new(client: client) + @pay_statements = FinchAPI::Resources::HRIS::PayStatements.new(client: client) + @documents = FinchAPI::Resources::HRIS::Documents.new(client: client) + @benefits = FinchAPI::Resources::HRIS::Benefits.new(client: client) + end + end + end +end diff --git a/lib/finch-api/resources/hris/benefits.rb b/lib/finch-api/resources/hris/benefits.rb new file mode 100644 index 00000000..6db28fd4 --- /dev/null +++ b/lib/finch-api/resources/hris/benefits.rb @@ -0,0 +1,125 @@ +# frozen_string_literal: true + +module FinchAPI + module Resources + class HRIS + class Benefits + # @return [FinchAPI::Resources::HRIS::Benefits::Individuals] + attr_reader :individuals + + # Creates a new company-wide deduction or contribution. Please use the + # `/providers` endpoint to view available types for each provider. + # + # @param params [FinchAPI::Models::HRIS::BenefitCreateParams, Hash{Symbol=>Object}] . + # + # @option params [String] :description Name of the benefit as it appears in the provider and pay statements. Recommend + # limiting this to <30 characters due to limitations in specific providers (e.g. + # Justworks). + # + # @option params [Symbol, FinchAPI::Models::HRIS::BenefitFrequency, nil] :frequency + # + # @option params [Symbol, FinchAPI::Models::HRIS::BenefitType, nil] :type Type of benefit. + # + # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [FinchAPI::Models::HRIS::CreateCompanyBenefitsResponse] + # + def create(params = {}) + parsed, options = FinchAPI::Models::HRIS::BenefitCreateParams.dump_request(params) + @client.request( + method: :post, + path: "employer/benefits", + body: parsed, + model: FinchAPI::Models::HRIS::CreateCompanyBenefitsResponse, + options: options + ) + end + + # Lists deductions and contributions information for a given item + # + # @param benefit_id [String] + # + # @param params [FinchAPI::Models::HRIS::BenefitRetrieveParams, Hash{Symbol=>Object}] . + # + # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [FinchAPI::Models::HRIS::CompanyBenefit] + # + def retrieve(benefit_id, params = {}) + @client.request( + method: :get, + path: ["employer/benefits/%0s", benefit_id], + model: FinchAPI::Models::HRIS::CompanyBenefit, + options: params[:request_options] + ) + end + + # Updates an existing company-wide deduction or contribution + # + # @param benefit_id [String] + # + # @param params [FinchAPI::Models::HRIS::BenefitUpdateParams, Hash{Symbol=>Object}] . + # + # @option params [String] :description Updated name or description. + # + # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [FinchAPI::Models::HRIS::UpdateCompanyBenefitResponse] + # + def update(benefit_id, params = {}) + parsed, options = FinchAPI::Models::HRIS::BenefitUpdateParams.dump_request(params) + @client.request( + method: :post, + path: ["employer/benefits/%0s", benefit_id], + body: parsed, + model: FinchAPI::Models::HRIS::UpdateCompanyBenefitResponse, + options: options + ) + end + + # List all company-wide deductions and contributions. + # + # @param params [FinchAPI::Models::HRIS::BenefitListParams, Hash{Symbol=>Object}] . + # + # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [FinchAPI::SinglePage] + # + def list(params = {}) + @client.request( + method: :get, + path: "employer/benefits", + page: FinchAPI::SinglePage, + model: FinchAPI::Models::HRIS::CompanyBenefit, + options: params[:request_options] + ) + end + + # Get deductions metadata + # + # @param params [FinchAPI::Models::HRIS::BenefitListSupportedBenefitsParams, Hash{Symbol=>Object}] . + # + # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [FinchAPI::SinglePage] + # + def list_supported_benefits(params = {}) + @client.request( + method: :get, + path: "employer/benefits/meta", + page: FinchAPI::SinglePage, + model: FinchAPI::Models::HRIS::SupportedBenefit, + options: params[:request_options] + ) + end + + # @param client [FinchAPI::Client] + # + def initialize(client:) + @client = client + @individuals = FinchAPI::Resources::HRIS::Benefits::Individuals.new(client: client) + end + end + end + end +end diff --git a/lib/finch-api/resources/hris/benefits/individuals.rb b/lib/finch-api/resources/hris/benefits/individuals.rb new file mode 100644 index 00000000..81988f39 --- /dev/null +++ b/lib/finch-api/resources/hris/benefits/individuals.rb @@ -0,0 +1,112 @@ +# frozen_string_literal: true + +module FinchAPI + module Resources + class HRIS + class Benefits + class Individuals + # Enroll an individual into a deduction or contribution. This is an overwrite + # operation. If the employee is already enrolled, the enrollment amounts will be + # adjusted. Making the same request multiple times will not create new + # enrollments, but will continue to set the state of the existing enrollment. + # + # @param benefit_id [String] + # + # @param params [FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams, Hash{Symbol=>Object}] . + # + # @option params [Array] :individuals Array of the individual_id to enroll and a configuration object. + # + # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [FinchAPI::SinglePage] + # + def enroll_many(benefit_id, params = {}) + parsed, options = FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams.dump_request(params) + @client.request( + method: :post, + path: ["employer/benefits/%0s/individuals", benefit_id], + body: parsed[:individuals], + page: FinchAPI::SinglePage, + model: FinchAPI::Models::HRIS::Benefits::EnrolledIndividual, + options: options + ) + end + + # Lists individuals currently enrolled in a given deduction. + # + # @param benefit_id [String] + # + # @param params [FinchAPI::Models::HRIS::Benefits::IndividualEnrolledIDsParams, Hash{Symbol=>Object}] . + # + # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [FinchAPI::Models::HRIS::Benefits::IndividualEnrolledIDsResponse] + # + def enrolled_ids(benefit_id, params = {}) + @client.request( + method: :get, + path: ["employer/benefits/%0s/enrolled", benefit_id], + model: FinchAPI::Models::HRIS::Benefits::IndividualEnrolledIDsResponse, + options: params[:request_options] + ) + end + + # Get enrollment information for the given individuals. + # + # @param benefit_id [String] + # + # @param params [FinchAPI::Models::HRIS::Benefits::IndividualRetrieveManyBenefitsParams, Hash{Symbol=>Object}] . + # + # @option params [String] :individual_ids comma-delimited list of stable Finch uuids for each individual. If empty, + # defaults to all individuals + # + # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [FinchAPI::SinglePage] + # + def retrieve_many_benefits(benefit_id, params = {}) + parsed, options = FinchAPI::Models::HRIS::Benefits::IndividualRetrieveManyBenefitsParams.dump_request(params) + @client.request( + method: :get, + path: ["employer/benefits/%0s/individuals", benefit_id], + query: parsed, + page: FinchAPI::SinglePage, + model: FinchAPI::Models::HRIS::Benefits::IndividualBenefit, + options: options + ) + end + + # Unenroll individuals from a deduction or contribution + # + # @param benefit_id [String] + # + # @param params [FinchAPI::Models::HRIS::Benefits::IndividualUnenrollManyParams, Hash{Symbol=>Object}] . + # + # @option params [Array] :individual_ids Array of individual_ids to unenroll. + # + # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [FinchAPI::SinglePage] + # + def unenroll_many(benefit_id, params = {}) + parsed, options = FinchAPI::Models::HRIS::Benefits::IndividualUnenrollManyParams.dump_request(params) + @client.request( + method: :delete, + path: ["employer/benefits/%0s/individuals", benefit_id], + body: parsed, + page: FinchAPI::SinglePage, + model: FinchAPI::Models::HRIS::Benefits::UnenrolledIndividual, + options: options + ) + end + + # @param client [FinchAPI::Client] + # + def initialize(client:) + @client = client + end + end + end + end + end +end diff --git a/lib/finch-api/resources/hris/company.rb b/lib/finch-api/resources/hris/company.rb new file mode 100644 index 00000000..c9901cfa --- /dev/null +++ b/lib/finch-api/resources/hris/company.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +module FinchAPI + module Resources + class HRIS + class Company + # Read basic company data + # + # @param params [FinchAPI::Models::HRIS::CompanyRetrieveParams, Hash{Symbol=>Object}] . + # + # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [FinchAPI::Models::HRIS::HRISCompany] + # + def retrieve(params = {}) + @client.request( + method: :get, + path: "employer/company", + model: FinchAPI::Models::HRIS::HRISCompany, + options: params[:request_options] + ) + end + + # @param client [FinchAPI::Client] + # + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/finch-api/resources/hris/directory.rb b/lib/finch-api/resources/hris/directory.rb new file mode 100644 index 00000000..88b8fa41 --- /dev/null +++ b/lib/finch-api/resources/hris/directory.rb @@ -0,0 +1,65 @@ +# frozen_string_literal: true + +module FinchAPI + module Resources + class HRIS + class Directory + # Read company directory and organization structure + # + # @param params [FinchAPI::Models::HRIS::DirectoryListParams, Hash{Symbol=>Object}] . + # + # @option params [Integer] :limit Number of employees to return (defaults to all) + # + # @option params [Integer] :offset Index to start from (defaults to 0) + # + # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [FinchAPI::IndividualsPage] + # + def list(params = {}) + parsed, options = FinchAPI::Models::HRIS::DirectoryListParams.dump_request(params) + @client.request( + method: :get, + path: "employer/directory", + query: parsed, + page: FinchAPI::IndividualsPage, + model: FinchAPI::Models::HRIS::IndividualInDirectory, + options: options + ) + end + + # @deprecated use `list` instead + # + # Read company directory and organization structure + # + # @param params [FinchAPI::Models::HRIS::DirectoryListIndividualsParams, Hash{Symbol=>Object}] . + # + # @option params [Integer] :limit Number of employees to return (defaults to all) + # + # @option params [Integer] :offset Index to start from (defaults to 0) + # + # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [FinchAPI::IndividualsPage] + # + def list_individuals(params = {}) + parsed, options = FinchAPI::Models::HRIS::DirectoryListIndividualsParams.dump_request(params) + @client.request( + method: :get, + path: "employer/directory", + query: parsed, + page: FinchAPI::IndividualsPage, + model: FinchAPI::Models::HRIS::IndividualInDirectory, + options: options + ) + end + + # @param client [FinchAPI::Client] + # + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/finch-api/resources/hris/documents.rb b/lib/finch-api/resources/hris/documents.rb new file mode 100644 index 00000000..5a7aa50b --- /dev/null +++ b/lib/finch-api/resources/hris/documents.rb @@ -0,0 +1,65 @@ +# frozen_string_literal: true + +module FinchAPI + module Resources + class HRIS + class Documents + # **Beta:** This endpoint is in beta and may change. + # Retrieve a list of company-wide documents. + # + # @param params [FinchAPI::Models::HRIS::DocumentListParams, Hash{Symbol=>Object}] . + # + # @option params [Array] :individual_ids Comma-delimited list of stable Finch uuids for each individual. If empty, + # defaults to all individuals + # + # @option params [Integer] :limit Number of documents to return (defaults to all) + # + # @option params [Integer] :offset Index to start from (defaults to 0) + # + # @option params [Array] :types Comma-delimited list of document types to filter on. If empty, defaults to all + # types + # + # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [FinchAPI::Models::HRIS::DocumentListResponse] + # + def list(params = {}) + parsed, options = FinchAPI::Models::HRIS::DocumentListParams.dump_request(params) + @client.request( + method: :get, + path: "employer/documents", + query: parsed, + model: FinchAPI::Models::HRIS::DocumentListResponse, + options: options + ) + end + + # **Beta:** This endpoint is in beta and may change. + # Retrieve details of a specific document by its ID. + # + # @param document_id [String] The unique identifier of the document. + # + # @param params [FinchAPI::Models::HRIS::DocumentRetreiveParams, Hash{Symbol=>Object}] . + # + # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [FinchAPI::Models::HRIS::W42020, FinchAPI::Models::HRIS::W42005] + # + def retreive(document_id, params = {}) + @client.request( + method: :get, + path: ["employer/documents/%0s", document_id], + model: FinchAPI::Models::HRIS::DocumentRetreiveResponse, + options: params[:request_options] + ) + end + + # @param client [FinchAPI::Client] + # + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/finch-api/resources/hris/employments.rb b/lib/finch-api/resources/hris/employments.rb new file mode 100644 index 00000000..de3c9938 --- /dev/null +++ b/lib/finch-api/resources/hris/employments.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +module FinchAPI + module Resources + class HRIS + class Employments + # Read individual employment and income data + # + # @param params [FinchAPI::Models::HRIS::EmploymentRetrieveManyParams, Hash{Symbol=>Object}] . + # + # @option params [Array] :requests The array of batch requests. + # + # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [FinchAPI::ResponsesPage] + # + def retrieve_many(params) + parsed, options = FinchAPI::Models::HRIS::EmploymentRetrieveManyParams.dump_request(params) + @client.request( + method: :post, + path: "employer/employment", + body: parsed, + page: FinchAPI::ResponsesPage, + model: FinchAPI::Models::HRIS::EmploymentDataResponse, + options: options + ) + end + + # @param client [FinchAPI::Client] + # + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/finch-api/resources/hris/individuals.rb b/lib/finch-api/resources/hris/individuals.rb new file mode 100644 index 00000000..336d2549 --- /dev/null +++ b/lib/finch-api/resources/hris/individuals.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module FinchAPI + module Resources + class HRIS + class Individuals + # Read individual data, excluding income and employment data + # + # @param params [FinchAPI::Models::HRIS::IndividualRetrieveManyParams, Hash{Symbol=>Object}] . + # + # @option params [FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Options, nil] :options + # + # @option params [Array] :requests + # + # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [FinchAPI::ResponsesPage] + # + def retrieve_many(params = {}) + parsed, options = FinchAPI::Models::HRIS::IndividualRetrieveManyParams.dump_request(params) + @client.request( + method: :post, + path: "employer/individual", + body: parsed, + page: FinchAPI::ResponsesPage, + model: FinchAPI::Models::HRIS::IndividualResponse, + options: options + ) + end + + # @param client [FinchAPI::Client] + # + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/finch-api/resources/hris/pay_statements.rb b/lib/finch-api/resources/hris/pay_statements.rb new file mode 100644 index 00000000..963734af --- /dev/null +++ b/lib/finch-api/resources/hris/pay_statements.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +module FinchAPI + module Resources + class HRIS + class PayStatements + # Read detailed pay statements for each individual. + # + # Deduction and contribution types are supported by the payroll systems that + # supports Benefits. + # + # @param params [FinchAPI::Models::HRIS::PayStatementRetrieveManyParams, Hash{Symbol=>Object}] . + # + # @option params [Array] :requests The array of batch requests. + # + # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [FinchAPI::ResponsesPage] + # + def retrieve_many(params) + parsed, options = FinchAPI::Models::HRIS::PayStatementRetrieveManyParams.dump_request(params) + @client.request( + method: :post, + path: "employer/pay-statement", + body: parsed, + page: FinchAPI::ResponsesPage, + model: FinchAPI::Models::HRIS::PayStatementResponse, + options: options + ) + end + + # @param client [FinchAPI::Client] + # + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/finch-api/resources/hris/payments.rb b/lib/finch-api/resources/hris/payments.rb new file mode 100644 index 00000000..6bb93ed0 --- /dev/null +++ b/lib/finch-api/resources/hris/payments.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +module FinchAPI + module Resources + class HRIS + class Payments + # Read payroll and contractor related payments by the company. + # + # @param params [FinchAPI::Models::HRIS::PaymentListParams, Hash{Symbol=>Object}] . + # + # @option params [Date] :end_date The end date to retrieve payments by a company (inclusive) in `YYYY-MM-DD` + # format. + # + # @option params [Date] :start_date The start date to retrieve payments by a company (inclusive) in `YYYY-MM-DD` + # format. + # + # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [FinchAPI::SinglePage] + # + def list(params) + parsed, options = FinchAPI::Models::HRIS::PaymentListParams.dump_request(params) + @client.request( + method: :get, + path: "employer/payment", + query: parsed, + page: FinchAPI::SinglePage, + model: FinchAPI::Models::HRIS::Payment, + options: options + ) + end + + # @param client [FinchAPI::Client] + # + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/finch-api/resources/jobs.rb b/lib/finch-api/resources/jobs.rb new file mode 100644 index 00000000..ba33b43b --- /dev/null +++ b/lib/finch-api/resources/jobs.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module FinchAPI + module Resources + class Jobs + # @return [FinchAPI::Resources::Jobs::Automated] + attr_reader :automated + + # @return [FinchAPI::Resources::Jobs::Manual] + attr_reader :manual + + # @param client [FinchAPI::Client] + # + def initialize(client:) + @client = client + @automated = FinchAPI::Resources::Jobs::Automated.new(client: client) + @manual = FinchAPI::Resources::Jobs::Manual.new(client: client) + end + end + end +end diff --git a/lib/finch-api/resources/jobs/automated.rb b/lib/finch-api/resources/jobs/automated.rb new file mode 100644 index 00000000..d91cbd90 --- /dev/null +++ b/lib/finch-api/resources/jobs/automated.rb @@ -0,0 +1,96 @@ +# frozen_string_literal: true + +module FinchAPI + module Resources + class Jobs + class Automated + # Enqueue an automated job. + # + # `data_sync_all`: Enqueue a job to re-sync all data for a connection. + # `data_sync_all` has a concurrency limit of 1 job at a time per connection. This + # means that if this endpoint is called while a job is already in progress for + # this connection, Finch will return the `job_id` of the job that is currently in + # progress. Finch allows a fixed window rate limit of 1 forced refresh per hour + # per connection. + # + # `w4_form_employee_sync`: Enqueues a job for sync W-4 data for a particular + # individual, identified by `individual_id`. This feature is currently in beta. + # + # This endpoint is available for _Scale_ tier customers as an add-on. To request + # access to this endpoint, please contact your Finch account manager. + # + # @param params [FinchAPI::Models::Jobs::AutomatedCreateParams, Hash{Symbol=>Object}] . + # + # @option params [Symbol, FinchAPI::Models::Jobs::AutomatedCreateParams::Type] :type The type of job to start. + # + # @option params [FinchAPI::Models::Jobs::AutomatedCreateParams::Params] :params + # + # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [FinchAPI::Models::Jobs::AutomatedCreateResponse] + # + def create(params) + parsed, options = FinchAPI::Models::Jobs::AutomatedCreateParams.dump_request(params) + @client.request( + method: :post, + path: "jobs/automated", + body: parsed, + model: FinchAPI::Models::Jobs::AutomatedCreateResponse, + options: options + ) + end + + # Get an automated job by `job_id`. + # + # @param job_id [String] + # + # @param params [FinchAPI::Models::Jobs::AutomatedRetrieveParams, Hash{Symbol=>Object}] . + # + # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [FinchAPI::Models::Jobs::AutomatedAsyncJob] + # + def retrieve(job_id, params = {}) + @client.request( + method: :get, + path: ["jobs/automated/%0s", job_id], + model: FinchAPI::Models::Jobs::AutomatedAsyncJob, + options: params[:request_options] + ) + end + + # Get all automated jobs. Automated jobs are completed by a machine. By default, + # jobs are sorted in descending order by submission time. For scheduled jobs such + # as data syncs, only the next scheduled job is shown. + # + # @param params [FinchAPI::Models::Jobs::AutomatedListParams, Hash{Symbol=>Object}] . + # + # @option params [Integer] :limit Number of items to return + # + # @option params [Integer] :offset Index to start from (defaults to 0) + # + # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [FinchAPI::Page] + # + def list(params = {}) + parsed, options = FinchAPI::Models::Jobs::AutomatedListParams.dump_request(params) + @client.request( + method: :get, + path: "jobs/automated", + query: parsed, + page: FinchAPI::Page, + model: FinchAPI::Models::Jobs::AutomatedAsyncJob, + options: options + ) + end + + # @param client [FinchAPI::Client] + # + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/finch-api/resources/jobs/manual.rb b/lib/finch-api/resources/jobs/manual.rb new file mode 100644 index 00000000..bb9d7ac5 --- /dev/null +++ b/lib/finch-api/resources/jobs/manual.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module FinchAPI + module Resources + class Jobs + class Manual + # Get a manual job by `job_id`. Manual jobs are completed by a human and include + # Assisted Benefits jobs. + # + # @param job_id [String] + # + # @param params [FinchAPI::Models::Jobs::ManualRetrieveParams, Hash{Symbol=>Object}] . + # + # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [FinchAPI::Models::Jobs::ManualAsyncJob] + # + def retrieve(job_id, params = {}) + @client.request( + method: :get, + path: ["jobs/manual/%0s", job_id], + model: FinchAPI::Models::Jobs::ManualAsyncJob, + options: params[:request_options] + ) + end + + # @param client [FinchAPI::Client] + # + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/finch-api/resources/payroll.rb b/lib/finch-api/resources/payroll.rb new file mode 100644 index 00000000..57884396 --- /dev/null +++ b/lib/finch-api/resources/payroll.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module FinchAPI + module Resources + class Payroll + # @return [FinchAPI::Resources::Payroll::PayGroups] + attr_reader :pay_groups + + # @param client [FinchAPI::Client] + # + def initialize(client:) + @client = client + @pay_groups = FinchAPI::Resources::Payroll::PayGroups.new(client: client) + end + end + end +end diff --git a/lib/finch-api/resources/payroll/pay_groups.rb b/lib/finch-api/resources/payroll/pay_groups.rb new file mode 100644 index 00000000..4b792392 --- /dev/null +++ b/lib/finch-api/resources/payroll/pay_groups.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +module FinchAPI + module Resources + class Payroll + class PayGroups + # Read information from a single pay group + # + # @param pay_group_id [String] + # + # @param params [FinchAPI::Models::Payroll::PayGroupRetrieveParams, Hash{Symbol=>Object}] . + # + # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [FinchAPI::Models::Payroll::PayGroupRetrieveResponse] + # + def retrieve(pay_group_id, params = {}) + @client.request( + method: :get, + path: ["employer/pay-groups/%0s", pay_group_id], + model: FinchAPI::Models::Payroll::PayGroupRetrieveResponse, + options: params[:request_options] + ) + end + + # Read company pay groups and frequencies + # + # @param params [FinchAPI::Models::Payroll::PayGroupListParams, Hash{Symbol=>Object}] . + # + # @option params [String] :individual_id + # + # @option params [Array] :pay_frequencies + # + # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [FinchAPI::SinglePage] + # + def list(params = {}) + parsed, options = FinchAPI::Models::Payroll::PayGroupListParams.dump_request(params) + @client.request( + method: :get, + path: "employer/pay-groups", + query: parsed, + page: FinchAPI::SinglePage, + model: FinchAPI::Models::Payroll::PayGroupListResponse, + options: options + ) + end + + # @param client [FinchAPI::Client] + # + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/finch-api/resources/providers.rb b/lib/finch-api/resources/providers.rb new file mode 100644 index 00000000..ce6daa52 --- /dev/null +++ b/lib/finch-api/resources/providers.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +module FinchAPI + module Resources + class Providers + # Return details on all available payroll and HR systems. + # + # @param params [FinchAPI::Models::ProviderListParams, Hash{Symbol=>Object}] . + # + # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [FinchAPI::SinglePage] + # + def list(params = {}) + @client.request( + method: :get, + path: "providers", + page: FinchAPI::SinglePage, + model: FinchAPI::Models::Provider, + options: params[:request_options] + ) + end + + # @param client [FinchAPI::Client] + # + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/finch-api/resources/request_forwarding.rb b/lib/finch-api/resources/request_forwarding.rb new file mode 100644 index 00000000..c41cd81a --- /dev/null +++ b/lib/finch-api/resources/request_forwarding.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +module FinchAPI + module Resources + class RequestForwarding + # The Forward API allows you to make direct requests to an employment system. If + # Finch’s unified API doesn’t have a data model that cleanly fits your needs, then + # Forward allows you to push or pull data models directly against an integration’s + # API. + # + # @param params [FinchAPI::Models::RequestForwardingForwardParams, Hash{Symbol=>Object}] . + # + # @option params [String] :method_ The HTTP method for the forwarded request. Valid values include: `GET` , `POST` + # , `PUT` , `DELETE` , and `PATCH`. + # + # @option params [String] :route The URL route path for the forwarded request. This value must begin with a + # forward-slash ( / ) and may only contain alphanumeric characters, hyphens, and + # underscores. + # + # @option params [String, nil] :data The body for the forwarded request. This value must be specified as either a + # string or a valid JSON object. + # + # @option params [Object, nil] :headers The HTTP headers to include on the forwarded request. This value must be + # specified as an object of key-value pairs. Example: + # `{"Content-Type": "application/xml", "X-API-Version": "v1" }` + # + # @option params [Object, nil] :params The query parameters for the forwarded request. This value must be specified as + # a valid JSON object rather than a query string. + # + # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [FinchAPI::Models::RequestForwardingForwardResponse] + # + def forward(params) + parsed, options = FinchAPI::Models::RequestForwardingForwardParams.dump_request(params) + @client.request( + method: :post, + path: "forward", + body: parsed, + model: FinchAPI::Models::RequestForwardingForwardResponse, + options: options + ) + end + + # @param client [FinchAPI::Client] + # + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/finch-api/resources/sandbox.rb b/lib/finch-api/resources/sandbox.rb new file mode 100644 index 00000000..ebde5169 --- /dev/null +++ b/lib/finch-api/resources/sandbox.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +module FinchAPI + module Resources + class Sandbox + # @return [FinchAPI::Resources::Sandbox::Connections] + attr_reader :connections + + # @return [FinchAPI::Resources::Sandbox::Company] + attr_reader :company + + # @return [FinchAPI::Resources::Sandbox::Directory] + attr_reader :directory + + # @return [FinchAPI::Resources::Sandbox::Individual] + attr_reader :individual + + # @return [FinchAPI::Resources::Sandbox::Employment] + attr_reader :employment + + # @return [FinchAPI::Resources::Sandbox::Payment] + attr_reader :payment + + # @return [FinchAPI::Resources::Sandbox::Jobs] + attr_reader :jobs + + # @param client [FinchAPI::Client] + # + def initialize(client:) + @client = client + @connections = FinchAPI::Resources::Sandbox::Connections.new(client: client) + @company = FinchAPI::Resources::Sandbox::Company.new(client: client) + @directory = FinchAPI::Resources::Sandbox::Directory.new(client: client) + @individual = FinchAPI::Resources::Sandbox::Individual.new(client: client) + @employment = FinchAPI::Resources::Sandbox::Employment.new(client: client) + @payment = FinchAPI::Resources::Sandbox::Payment.new(client: client) + @jobs = FinchAPI::Resources::Sandbox::Jobs.new(client: client) + end + end + end +end diff --git a/lib/finch-api/resources/sandbox/company.rb b/lib/finch-api/resources/sandbox/company.rb new file mode 100644 index 00000000..140a7b50 --- /dev/null +++ b/lib/finch-api/resources/sandbox/company.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +module FinchAPI + module Resources + class Sandbox + class Company + # Update a sandbox company's data + # + # @param params [FinchAPI::Models::Sandbox::CompanyUpdateParams, Hash{Symbol=>Object}] . + # + # @option params [Array, nil] :accounts An array of bank account objects associated with the payroll/HRIS system. + # + # @option params [Array, nil] :departments The array of company departments. + # + # @option params [String, nil] :ein The employer identification number. + # + # @option params [FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity, nil] :entity The entity type object. + # + # @option params [String, nil] :legal_name The legal name of the company. + # + # @option params [Array, nil] :locations + # + # @option params [String, nil] :primary_email The email of the main administrator on the account. + # + # @option params [String, nil] :primary_phone_number The phone number of the main administrator on the account. Format: `XXXXXXXXXX` + # + # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [FinchAPI::Models::Sandbox::CompanyUpdateResponse] + # + def update(params) + parsed, options = FinchAPI::Models::Sandbox::CompanyUpdateParams.dump_request(params) + @client.request( + method: :put, + path: "sandbox/company", + body: parsed, + model: FinchAPI::Models::Sandbox::CompanyUpdateResponse, + options: options + ) + end + + # @param client [FinchAPI::Client] + # + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/finch-api/resources/sandbox/connections.rb b/lib/finch-api/resources/sandbox/connections.rb new file mode 100644 index 00000000..80f00bc1 --- /dev/null +++ b/lib/finch-api/resources/sandbox/connections.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +module FinchAPI + module Resources + class Sandbox + class Connections + # @return [FinchAPI::Resources::Sandbox::Connections::Accounts] + attr_reader :accounts + + # Create a new connection (new company/provider pair) with a new account + # + # @param params [FinchAPI::Models::Sandbox::ConnectionCreateParams, Hash{Symbol=>Object}] . + # + # @option params [String] :provider_id The provider associated with the connection + # + # @option params [Symbol, FinchAPI::Models::Sandbox::ConnectionCreateParams::AuthenticationType] :authentication_type + # + # @option params [Integer] :employee_size Optional: the size of the employer to be created with this connection. Defaults + # to 20. Note that if this is higher than 100, historical payroll data will not be + # generated, and instead only one pay period will be created. + # + # @option params [Array] :products + # + # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [FinchAPI::Models::Sandbox::ConnectionCreateResponse] + # + def create(params) + parsed, options = FinchAPI::Models::Sandbox::ConnectionCreateParams.dump_request(params) + @client.request( + method: :post, + path: "sandbox/connections", + body: parsed, + model: FinchAPI::Models::Sandbox::ConnectionCreateResponse, + options: options + ) + end + + # @param client [FinchAPI::Client] + # + def initialize(client:) + @client = client + @accounts = FinchAPI::Resources::Sandbox::Connections::Accounts.new(client: client) + end + end + end + end +end diff --git a/lib/finch-api/resources/sandbox/connections/accounts.rb b/lib/finch-api/resources/sandbox/connections/accounts.rb new file mode 100644 index 00000000..f3e7997a --- /dev/null +++ b/lib/finch-api/resources/sandbox/connections/accounts.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +module FinchAPI + module Resources + class Sandbox + class Connections + class Accounts + # Create a new account for an existing connection (company/provider pair) + # + # @param params [FinchAPI::Models::Sandbox::Connections::AccountCreateParams, Hash{Symbol=>Object}] . + # + # @option params [String] :company_id + # + # @option params [String] :provider_id The provider associated with the `access_token` + # + # @option params [Symbol, FinchAPI::Models::Sandbox::Connections::AccountCreateParams::AuthenticationType] :authentication_type + # + # @option params [Array] :products Optional, defaults to Organization products (`company`, `directory`, + # `employment`, `individual`) + # + # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [FinchAPI::Models::Sandbox::Connections::AccountCreateResponse] + # + def create(params) + parsed, options = FinchAPI::Models::Sandbox::Connections::AccountCreateParams.dump_request(params) + @client.request( + method: :post, + path: "sandbox/connections/accounts", + body: parsed, + model: FinchAPI::Models::Sandbox::Connections::AccountCreateResponse, + options: options + ) + end + + # Update an existing sandbox account. Change the connection status to understand + # how the Finch API responds. + # + # @param params [FinchAPI::Models::Sandbox::Connections::AccountUpdateParams, Hash{Symbol=>Object}] . + # + # @option params [Symbol, FinchAPI::Models::ConnectionStatusType] :connection_status + # + # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [FinchAPI::Models::Sandbox::Connections::AccountUpdateResponse] + # + def update(params = {}) + parsed, options = FinchAPI::Models::Sandbox::Connections::AccountUpdateParams.dump_request(params) + @client.request( + method: :put, + path: "sandbox/connections/accounts", + body: parsed, + model: FinchAPI::Models::Sandbox::Connections::AccountUpdateResponse, + options: options + ) + end + + # @param client [FinchAPI::Client] + # + def initialize(client:) + @client = client + end + end + end + end + end +end diff --git a/lib/finch-api/resources/sandbox/directory.rb b/lib/finch-api/resources/sandbox/directory.rb new file mode 100644 index 00000000..26fd4156 --- /dev/null +++ b/lib/finch-api/resources/sandbox/directory.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +module FinchAPI + module Resources + class Sandbox + class Directory + # Add new individuals to a sandbox company + # + # @param params [FinchAPI::Models::Sandbox::DirectoryCreateParams, Hash{Symbol=>Object}] . + # + # @option params [Array] :body Array of individuals to create. Takes all combined fields from `/individual` and + # `/employment` endpoints. All fields are optional. + # + # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Array] + # + def create(params = {}) + parsed, options = FinchAPI::Models::Sandbox::DirectoryCreateParams.dump_request(params) + @client.request( + method: :post, + path: "sandbox/directory", + body: parsed[:body], + model: FinchAPI::ArrayOf[FinchAPI::Unknown], + options: options + ) + end + + # @param client [FinchAPI::Client] + # + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/finch-api/resources/sandbox/employment.rb b/lib/finch-api/resources/sandbox/employment.rb new file mode 100644 index 00000000..3fc0520a --- /dev/null +++ b/lib/finch-api/resources/sandbox/employment.rb @@ -0,0 +1,76 @@ +# frozen_string_literal: true + +module FinchAPI + module Resources + class Sandbox + class Employment + # Update sandbox employment + # + # @param individual_id [String] + # + # @param params [FinchAPI::Models::Sandbox::EmploymentUpdateParams, Hash{Symbol=>Object}] . + # + # @option params [String, nil] :class_code Worker's compensation classification code for this employee + # + # @option params [Array] :custom_fields Custom fields for the individual. These are fields which are defined by the + # employer in the system. Custom fields are not currently supported for assisted + # connections. + # + # @option params [FinchAPI::Models::Sandbox::EmploymentUpdateParams::Department, nil] :department The department object. + # + # @option params [FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment, nil] :employment The employment object. + # + # @option params [Symbol, FinchAPI::Models::Sandbox::EmploymentUpdateParams::EmploymentStatus, nil] :employment_status The detailed employment status of the individual. + # + # @option params [String, nil] :end_date + # + # @option params [String, nil] :first_name The legal first name of the individual. + # + # @option params [FinchAPI::Models::Income, nil] :income 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. + # + # @option params [Array, nil] :income_history The array of income history. + # + # @option params [Boolean, nil] :is_active `true` if the individual an an active employee or contractor at the company. + # + # @option params [String, nil] :last_name The legal last name of the individual. + # + # @option params [String, nil] :latest_rehire_date + # + # @option params [FinchAPI::Models::Location, nil] :location + # + # @option params [FinchAPI::Models::Sandbox::EmploymentUpdateParams::Manager, nil] :manager The manager object representing the manager of the individual within the org. + # + # @option params [String, nil] :middle_name The legal middle name of the individual. + # + # @option params [String] :source_id The source system's unique employment identifier for this individual + # + # @option params [String, nil] :start_date + # + # @option params [String, nil] :title The current title of the individual. + # + # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [FinchAPI::Models::Sandbox::EmploymentUpdateResponse] + # + def update(individual_id, params = {}) + parsed, options = FinchAPI::Models::Sandbox::EmploymentUpdateParams.dump_request(params) + @client.request( + method: :put, + path: ["sandbox/employment/%0s", individual_id], + body: parsed, + model: FinchAPI::Models::Sandbox::EmploymentUpdateResponse, + options: options + ) + end + + # @param client [FinchAPI::Client] + # + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/finch-api/resources/sandbox/individual.rb b/lib/finch-api/resources/sandbox/individual.rb new file mode 100644 index 00000000..19065cfd --- /dev/null +++ b/lib/finch-api/resources/sandbox/individual.rb @@ -0,0 +1,65 @@ +# frozen_string_literal: true + +module FinchAPI + module Resources + class Sandbox + class Individual + # Update sandbox individual + # + # @param individual_id [String] + # + # @param params [FinchAPI::Models::Sandbox::IndividualUpdateParams, Hash{Symbol=>Object}] . + # + # @option params [String, nil] :dob + # + # @option params [Array, nil] :emails + # + # @option params [String, nil] :encrypted_ssn Social Security Number of the individual in **encrypted** format. This field is + # only available with the `ssn` scope enabled and the + # `options: { include: ['ssn'] }` param set in the body. + # + # @option params [Symbol, FinchAPI::Models::Sandbox::IndividualUpdateParams::Ethnicity, nil] :ethnicity The EEOC-defined ethnicity of the individual. + # + # @option params [String, nil] :first_name The legal first name of the individual. + # + # @option params [Symbol, FinchAPI::Models::Sandbox::IndividualUpdateParams::Gender, nil] :gender The gender of the individual. + # + # @option params [String, nil] :last_name The legal last name of the individual. + # + # @option params [String, nil] :middle_name The legal middle name of the individual. + # + # @option params [Array, nil] :phone_numbers + # + # @option params [String, nil] :preferred_name The preferred name of the individual. + # + # @option params [FinchAPI::Models::Location, nil] :residence + # + # @option params [String, nil] :ssn Social Security Number of the individual. This field is only available with the + # `ssn` scope enabled and the `options: { include: ['ssn'] }` param set in the + # body. + # [Click here to learn more about enabling the SSN field](/developer-resources/Enable-SSN-Field). + # + # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [FinchAPI::Models::Sandbox::IndividualUpdateResponse] + # + def update(individual_id, params = {}) + parsed, options = FinchAPI::Models::Sandbox::IndividualUpdateParams.dump_request(params) + @client.request( + method: :put, + path: ["sandbox/individual/%0s", individual_id], + body: parsed, + model: FinchAPI::Models::Sandbox::IndividualUpdateResponse, + options: options + ) + end + + # @param client [FinchAPI::Client] + # + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/finch-api/resources/sandbox/jobs.rb b/lib/finch-api/resources/sandbox/jobs.rb new file mode 100644 index 00000000..08859b39 --- /dev/null +++ b/lib/finch-api/resources/sandbox/jobs.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +module FinchAPI + module Resources + class Sandbox + class Jobs + # @return [FinchAPI::Resources::Sandbox::Jobs::Configuration] + attr_reader :configuration + + # Enqueue a new sandbox job + # + # @param params [FinchAPI::Models::Sandbox::JobCreateParams, Hash{Symbol=>Object}] . + # + # @option params [Symbol, FinchAPI::Models::Sandbox::JobCreateParams::Type] :type The type of job to start. Currently the only supported type is `data_sync_all` + # + # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [FinchAPI::Models::Sandbox::JobCreateResponse] + # + def create(params) + parsed, options = FinchAPI::Models::Sandbox::JobCreateParams.dump_request(params) + @client.request( + method: :post, + path: "sandbox/jobs", + body: parsed, + model: FinchAPI::Models::Sandbox::JobCreateResponse, + options: options + ) + end + + # @param client [FinchAPI::Client] + # + def initialize(client:) + @client = client + @configuration = FinchAPI::Resources::Sandbox::Jobs::Configuration.new(client: client) + end + end + end + end +end diff --git a/lib/finch-api/resources/sandbox/jobs/configuration.rb b/lib/finch-api/resources/sandbox/jobs/configuration.rb new file mode 100644 index 00000000..cc8cb27f --- /dev/null +++ b/lib/finch-api/resources/sandbox/jobs/configuration.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +module FinchAPI + module Resources + class Sandbox + class Jobs + class Configuration + # Get configurations for sandbox jobs + # + # @param params [FinchAPI::Models::Sandbox::Jobs::ConfigurationRetrieveParams, Hash{Symbol=>Object}] . + # + # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Array] + # + def retrieve(params = {}) + @client.request( + method: :get, + path: "sandbox/jobs/configuration", + model: FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration], + options: params[:request_options] + ) + end + + # Update configurations for sandbox jobs + # + # @param params [FinchAPI::Models::Sandbox::Jobs::ConfigurationUpdateParams, Hash{Symbol=>Object}] . + # + # @option params [Symbol, FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::CompletionStatus] :completion_status + # + # @option params [Symbol, FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::Type] :type + # + # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration] + # + def update(params) + parsed, options = FinchAPI::Models::Sandbox::Jobs::ConfigurationUpdateParams.dump_request(params) + @client.request( + method: :put, + path: "sandbox/jobs/configuration", + body: parsed, + model: FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration, + options: options + ) + end + + # @param client [FinchAPI::Client] + # + def initialize(client:) + @client = client + end + end + end + end + end +end diff --git a/lib/finch-api/resources/sandbox/payment.rb b/lib/finch-api/resources/sandbox/payment.rb new file mode 100644 index 00000000..da0669ea --- /dev/null +++ b/lib/finch-api/resources/sandbox/payment.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +module FinchAPI + module Resources + class Sandbox + class Payment + # Add a new sandbox payment + # + # @param params [FinchAPI::Models::Sandbox::PaymentCreateParams, Hash{Symbol=>Object}] . + # + # @option params [String] :end_date + # + # @option params [Array] :pay_statements + # + # @option params [String] :start_date + # + # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [FinchAPI::Models::Sandbox::PaymentCreateResponse] + # + def create(params = {}) + parsed, options = FinchAPI::Models::Sandbox::PaymentCreateParams.dump_request(params) + @client.request( + method: :post, + path: "sandbox/payment", + body: parsed, + model: FinchAPI::Models::Sandbox::PaymentCreateResponse, + options: options + ) + end + + # @param client [FinchAPI::Client] + # + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/finch-api/resources/webhooks.rb b/lib/finch-api/resources/webhooks.rb new file mode 100644 index 00000000..6a8781e0 --- /dev/null +++ b/lib/finch-api/resources/webhooks.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module FinchAPI + module Resources + class Webhooks + # @param client [FinchAPI::Client] + # + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/finch-api/responses_page.rb b/lib/finch-api/responses_page.rb new file mode 100644 index 00000000..c041c8b0 --- /dev/null +++ b/lib/finch-api/responses_page.rb @@ -0,0 +1,84 @@ +# frozen_string_literal: true + +module FinchAPI + # @example + # ```ruby + # if responses_page.has_next? + # page = responses_page.next_page + # end + # ``` + # + # @example + # ```ruby + # responses_page.auto_paging_each do |item| + # # item ... + # end + # ``` + # + # @example + # ```ruby + # items = responses_page.to_enum.take(2) + # + # items => Array + # ``` + class ResponsesPage + include FinchAPI::BasePage + + # @return [Array] + attr_accessor :responses + + # rubocop:disable Lint/UnusedMethodArgument + # @private + # + # @param client [FinchAPI::BaseClient] + # @param req [Hash{Symbol=>Object}] + # @param headers [Hash{String=>String}, Net::HTTPHeader] + # @param unwrapped [Array] + # + def initialize(client:, req:, headers:, unwrapped:) + @client = client + @req = req + model = req.fetch(:model) + + case unwrapped + in {responses: Array | nil => responses} + @responses = responses&.map { model.coerce(_1) } + else + end + end + # rubocop:enable Lint/UnusedMethodArgument + + # @return [Boolean] + # + def next_page? + false + end + + # @raise [FinchAPI::HTTP::Error] + # @return [FinchAPI::ResponsesPage] + # + def next_page + raise NotImplementedError + end + + # @param blk [Proc] + # + def auto_paging_each(&blk) + unless block_given? + raise ArgumentError.new("A block must be given to #auto_paging_each") + end + page = self + loop do + page.responses&.each { blk.call(_1) } + break unless page.next_page? + page = page.next_page + end + end + + # @return [String] + # + def inspect + "#<#{self.class}:0x#{object_id.to_s(16)} responses=#{responses.inspect}>" + end + end +end diff --git a/lib/finch-api/single_page.rb b/lib/finch-api/single_page.rb new file mode 100644 index 00000000..3cf33206 --- /dev/null +++ b/lib/finch-api/single_page.rb @@ -0,0 +1,82 @@ +# frozen_string_literal: true + +module FinchAPI + # @example + # ```ruby + # if single_page.has_next? + # page = single_page.next_page + # end + # ``` + # + # @example + # ```ruby + # single_page.auto_paging_each do |item| + # # item ... + # end + # ``` + # + # @example + # ```ruby + # items = single_page.to_enum.take(2) + # + # items => Array + # ``` + class SinglePage < ::Array + include FinchAPI::BasePage + + # rubocop:disable Lint/UnusedMethodArgument + # @private + # + # @param client [FinchAPI::BaseClient] + # @param req [Hash{Symbol=>Object}] + # @param headers [Hash{String=>String}, Net::HTTPHeader] + # @param unwrapped [Array] + # + def initialize(client:, req:, headers:, unwrapped:) + @client = client + @req = req + model = req.fetch(:model) + + case unwrapped + in Array + super(unwrapped&.map { model.coerce(_1) }) + else + super([]) + end + end + # rubocop:enable Lint/UnusedMethodArgument + + # @return [Boolean] + # + def next_page? + false + end + + # @raise [FinchAPI::HTTP::Error] + # @return [FinchAPI::SinglePage] + # + def next_page + raise NotImplementedError + end + + # @param blk [Proc] + # + def auto_paging_each(&blk) + unless block_given? + raise ArgumentError.new("A block must be given to #auto_paging_each") + end + page = self + loop do + page.each { blk.call(_1) } + break unless page.next_page? + page = page.next_page + end + end + + # @return [String] + # + def inspect + "#<#{self.class}:0x#{object_id.to_s(16)}>" + end + end +end diff --git a/lib/finch-api/util.rb b/lib/finch-api/util.rb new file mode 100644 index 00000000..4cf22db3 --- /dev/null +++ b/lib/finch-api/util.rb @@ -0,0 +1,636 @@ +# frozen_string_literal: true + +module FinchAPI + # rubocop:disable Metrics/ModuleLength + + # @private + # + module Util + # @private + # + # @return [Float] + # + def self.monotonic_secs = Process.clock_gettime(Process::CLOCK_MONOTONIC) + + class << self + # @private + # + # @return [String] + # + def arch + case (arch = RbConfig::CONFIG["arch"])&.downcase + in nil + "unknown" + in /aarch64|arm64/ + "arm64" + in /x86_64/ + "x64" + in /arm/ + "arm" + else + "other:#{arch}" + end + end + + # @private + # + # @return [String] + # + def os + case (host = RbConfig::CONFIG["host_os"])&.downcase + in nil + "Unknown" + in /linux/ + "Linux" + in /darwin/ + "MacOS" + in /freebsd/ + "FreeBSD" + in /openbsd/ + "OpenBSD" + in /mswin|mingw|cygwin|ucrt/ + "Windows" + else + "Other:#{host}" + end + end + end + + class << self + # @private + # + # @param input [Object] + # + # @return [Boolean, Object] + # + def primitive?(input) + case input + in true | false | Integer | Float | Symbol | String + true + else + false + end + end + + # @private + # + # @param input [Object] + # + # @return [Boolean, Object] + # + def coerce_boolean(input) + case input.is_a?(String) ? input.downcase : input + in Numeric + !input.zero? + in "true" + true + in "false" + false + else + input + end + end + + # @private + # + # @param input [Object] + # + # @raise [ArgumentError] + # @return [Boolean, nil] + # + def coerce_boolean!(input) + case coerce_boolean(input) + in true | false | nil => coerced + coerced + else + raise ArgumentError.new("Unable to coerce #{input.inspect} into boolean value") + end + end + + # @private + # + # @param input [Object] + # + # @return [Integer, Object] + # + def coerce_integer(input) + case input + in true + 1 + in false + 0 + else + Integer(input, exception: false) || input + end + end + + # @private + # + # @param input [Object] + # + # @return [Float, Object] + # + def coerce_float(input) + case input + in true + 1.0 + in false + 0.0 + else + Float(input, exception: false) || input + end + end + + # @private + # + # @param input [Object] + # + # @return [Hash{Object=>Object}, Object] + # + def coerce_hash(input) + case input + in NilClass | Array | Set | Enumerator + input + else + input.respond_to?(:to_h) ? input.to_h : input + end + end + end + + # Use this to indicate that a value should be explicitly removed from a data + # structure when using `FinchAPI::Util.deep_merge`. + # + # e.g. merging `{a: 1}` and `{a: OMIT}` should produce `{}`, where merging + # `{a: 1}` and `{}` would produce `{a: 1}`. + OMIT = Object.new.freeze + + class << self + # @private + # + # @param lhs [Object] + # @param rhs [Object] + # @param concat [Boolean] + # + # @return [Object] + # + private def deep_merge_lr(lhs, rhs, concat: false) + case [lhs, rhs, concat] + in [Hash, Hash, _] + # rubocop:disable Style/YodaCondition + rhs_cleaned = rhs.reject { |_, val| OMIT == val } + lhs + .reject { |key, _| OMIT == rhs[key] } + .merge(rhs_cleaned) do |_, old_val, new_val| + deep_merge_lr(old_val, new_val, concat: concat) + end + # rubocop:enable Style/YodaCondition + in [Array, Array, true] + lhs.concat(rhs) + else + rhs + end + end + + # @private + # + # Recursively merge one hash with another. If the values at a given key are not + # both hashes, just take the new value. + # + # @param values [Array] + # + # @param sentinel [Object, nil] the value to return if no values are provided. + # + # @param concat [Boolean] whether to merge sequences by concatenation. + # + # @return [Object] + # + def deep_merge(*values, sentinel: nil, concat: false) + case values + in [value, *values] + values.reduce(value) do |acc, val| + deep_merge_lr(acc, val, concat: concat) + end + else + sentinel + end + end + + # @private + # + # @param data [Hash{Symbol=>Object}, Array, Object] + # @param pick [Symbol, Integer, Array, nil] + # @param sentinel [Object, nil] + # @param blk [Proc, nil] + # + # @return [Object, nil] + # + def dig(data, pick, sentinel = nil, &blk) + case [data, pick, blk] + in [_, nil, nil] + data + in [Hash, Symbol, _] | [Array, Integer, _] + blk.nil? ? data.fetch(pick, sentinel) : data.fetch(pick, &blk) + in [Hash | Array, Array, _] + pick.reduce(data) do |acc, key| + case acc + in Hash if acc.key?(key) + acc.fetch(key) + in Array if key.is_a?(Integer) && key < acc.length + acc[key] + else + return blk.nil? ? sentinel : blk.call + end + end + in _ + blk.nil? ? sentinel : blk.call + end + end + end + + class << self + # @private + # + # @param uri [URI::Generic] + # + # @return [String] + # + def uri_origin(uri) + "#{uri.scheme}://#{uri.host}#{uri.port == uri.default_port ? '' : ":#{uri.port}"}" + end + + # @private + # + # @param path [String, Array] + # + # @return [String] + # + def interpolate_path(path) + case path + in String + path + in [] + "" + in [String, *interpolations] + encoded = interpolations.map { ERB::Util.url_encode(_1) } + path.first % encoded + end + end + end + + class << self + # @private + # + # @param query [String, nil] + # + # @return [Hash{String=>Array}] + # + def decode_query(query) + CGI.parse(query.to_s) + end + + # @private + # + # @param query [Hash{String=>Array, String, nil}, nil] + # + # @return [String, nil] + # + def encode_query(query) + query.to_h.empty? ? nil : URI.encode_www_form(query) + end + end + + class << self + # @private + # + # @param url [URI::Generic, String] + # + # @return [Hash{Symbol=>String, Integer, nil}] + # + def parse_uri(url) + parsed = URI::Generic.component.zip(URI.split(url)).to_h + {**parsed, query: decode_query(parsed.fetch(:query))} + end + + # @private + # + # @param parsed [Hash{Symbol=>String, Integer, nil}] . + # + # @option parsed [String, nil] :scheme + # + # @option parsed [String, nil] :host + # + # @option parsed [Integer, nil] :port + # + # @option parsed [String, nil] :path + # + # @option parsed [Hash{String=>Array}] :query + # + # @return [URI::Generic] + # + def unparse_uri(parsed) + URI::Generic.build(**parsed, query: encode_query(parsed.fetch(:query))) + end + + # @private + # + # @param lhs [Hash{Symbol=>String, Integer, nil}] . + # + # @option lhs [String, nil] :scheme + # + # @option lhs [String, nil] :host + # + # @option lhs [Integer, nil] :port + # + # @option lhs [String, nil] :path + # + # @option lhs [Hash{String=>Array}] :query + # + # @param rhs [Hash{Symbol=>String, Integer, nil}] . + # + # @option rhs [String, nil] :scheme + # + # @option rhs [String, nil] :host + # + # @option rhs [Integer, nil] :port + # + # @option rhs [String, nil] :path + # + # @option rhs [Hash{String=>Array}] :query + # + # @return [URI::Generic] + # + def join_parsed_uri(lhs, rhs) + base_path, base_query = lhs.fetch_values(:path, :query) + slashed = base_path.end_with?("/") ? base_path : "#{base_path}/" + + parsed_path, parsed_query = parse_uri(rhs.fetch(:path)).fetch_values(:path, :query) + override = URI::Generic.build(**rhs.slice(:scheme, :host, :port), path: parsed_path) + + joined = URI.join(URI::Generic.build(lhs.except(:path, :query)), slashed, override) + query = deep_merge( + joined.path == base_path ? base_query : {}, + parsed_query, + rhs[:query].to_h, + concat: true + ) + + joined.query = encode_query(query) + joined + end + end + + class << self + # @private + # + # @param headers [Hash{String=>String, Integer, Array, nil}] + # + # @return [Hash{String=>String}] + # + def normalized_headers(*headers) + {}.merge(*headers.compact).to_h do |key, val| + case val + in Array + val.map { _1.to_s.strip }.join(", ") + else + val&.to_s&.strip + end + [key.downcase, val] + end + end + end + + class << self + # @private + # + # @param io [StringIO] + # @param boundary [String] + # @param key [Symbol, String] + # @param val [Object] + # + private def encode_multipart_formdata(io, boundary:, key:, val:) + io << "--#{boundary}\r\n" + io << "Content-Disposition: form-data" + unless key.nil? + name = ERB::Util.url_encode(key.to_s) + io << "; name=\"#{name}\"" + end + if val.is_a?(IO) + filename = ERB::Util.url_encode(File.basename(val.to_path)) + io << "; filename=\"#{filename}\"" + end + io << "\r\n" + case val + in IO | StringIO + io << "Content-Type: application/octet-stream\r\n\r\n" + IO.copy_stream(val, io) + in String + io << "Content-Type: application/octet-stream\r\n\r\n" + io << val.to_s + in true | false | Integer | Float | Symbol + io << "Content-Type: text/plain\r\n\r\n" + io << val.to_s + else + io << "Content-Type: application/json\r\n\r\n" + io << JSON.fast_generate(val) + end + io << "\r\n" + end + + # @private + # + # @param headers [Hash{String=>String}] + # @param body [Object] + # + # @return [Object] + # + def encode_content(headers, body) + content_type = headers["content-type"] + case [content_type, body] + in ["application/json", Hash | Array] + [headers, JSON.fast_generate(body)] + in [%r{^multipart/form-data}, Hash | IO | StringIO] + boundary = SecureRandom.urlsafe_base64(60) + strio = StringIO.new.tap do |io| + case body + in Hash + body.each do |key, val| + case val + in Array if val.all? { primitive?(_1) } + val.each do |v| + encode_multipart_formdata(io, boundary: boundary, key: key, val: v) + end + else + encode_multipart_formdata(io, boundary: boundary, key: key, val: val) + end + end + else + encode_multipart_formdata(io, boundary: boundary, key: nil, val: body) + end + io << "--#{boundary}--\r\n" + io.rewind + end + headers = { + **headers, + "content-type" => "#{content_type}; boundary=#{boundary}", + "transfer-encoding" => "chunked" + } + [headers, strio] + in [_, StringIO] + [headers, body.string] + in [_, IO] + headers = {**headers, "transfer-encoding" => "chunked"} + [headers, body] + else + [headers, body] + end + end + + # @private + # + # @param headers [Hash{String=>String}, Net::HTTPHeader] + # @param stream [Enumerable] + # @param suppress_error [Boolean] + # + # @raise [JSON::ParserError] + # @return [Object] + # + def decode_content(headers, stream:, suppress_error: false) + case headers["content-type"] + in %r{^text/event-stream} + lines = enum_lines(stream) + parse_sse(lines) + in %r{^application/json} + json = stream.to_a.join + begin + JSON.parse(json, symbolize_names: true) + rescue JSON::ParserError => e + raise e unless suppress_error + json + end + in %r{^text/} + stream.to_a.join + else + # TODO: parsing other response types + StringIO.new(stream.to_a.join) + end + end + end + + class << self + # @private + # + # https://doc.rust-lang.org/std/iter/trait.FusedIterator.html + # + # @param enum [Enumerable] + # @param close [Proc] + # + # @return [Enumerable] + # + def fused_enum(enum, &close) + fused = false + iter = Enumerator.new do |y| + next if fused + + fused = true + loop { y << enum.next } + ensure + close&.call + close = nil + end + + iter.define_singleton_method(:rewind) do + fused = true + self + end + iter + end + + # @private + # + # @param enum [Enumerable, nil] + # + def close_fused!(enum) + return unless enum.is_a?(Enumerator) + + # rubocop:disable Lint/UnreachableLoop + enum.rewind.each { break } + # rubocop:enable Lint/UnreachableLoop + end + + # @private + # + # @param enum [Enumerable, nil] + # @param blk [Proc] + # + def chain_fused(enum, &blk) + iter = Enumerator.new { blk.call(_1) } + fused_enum(iter) { close_fused!(enum) } + end + end + + class << self + # @private + # + # @param enum [Enumerable] + # + # @return [Enumerable] + # + def enum_lines(enum) + chain_fused(enum) do |y| + buffer = String.new + enum.each do |row| + buffer << row + while (idx = buffer.index("\n")) + y << buffer.slice!(..idx) + end + end + y << buffer unless buffer.empty? + end + end + + # @private + # + # https://html.spec.whatwg.org/multipage/server-sent-events.html#parsing-an-event-stream + # + # @param lines [Enumerable] + # + # @return [Hash{Symbol=>Object}] + # + def parse_sse(lines) + chain_fused(lines) do |y| + blank = {event: nil, data: nil, id: nil, retry: nil} + current = {} + + lines.each do |line| + case line.strip + in "" + next if current.empty? + y << {**blank, **current} + current = {} + in /^:/ + next + in /^([^:]+):\s?(.*)$/ + _, field, value = Regexp.last_match.to_a + case field + in "event" + current.merge!(event: value) + in "data" + (current[:data] ||= String.new) << value << "\n" + in "id" unless value.include?("\0") + current.merge!(id: value) + in "retry" if /^\d+$/ =~ value + current.merge!(retry: Integer(value)) + else + end + else + end + end + + y << {**blank, **current} unless current.empty? + end + end + end + end + + # rubocop:enable Metrics/ModuleLength +end diff --git a/lib/finch-api/version.rb b/lib/finch-api/version.rb new file mode 100644 index 00000000..4ac9a633 --- /dev/null +++ b/lib/finch-api/version.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +module FinchAPI + VERSION = "0.0.1-alpha.0" +end diff --git a/manifest.yaml b/manifest.yaml new file mode 100644 index 00000000..e2306edd --- /dev/null +++ b/manifest.yaml @@ -0,0 +1,13 @@ +dependencies: + - cgi + - date + - erb + - etc + - json + - net/http + - rbconfig + - securerandom + - set + - stringio + - time + - uri diff --git a/rbi/lib/finch-api/base_client.rbi b/rbi/lib/finch-api/base_client.rbi new file mode 100644 index 00000000..f72fad18 --- /dev/null +++ b/rbi/lib/finch-api/base_client.rbi @@ -0,0 +1,173 @@ +# typed: strong + +module FinchAPI + class BaseClient + abstract! + + RequestComponentsShape = T.type_alias do + { + method: Symbol, + path: T.any(String, T::Array[String]), + query: T.nilable(T::Hash[String, T.nilable(T.any(T::Array[String], String))]), + headers: T.nilable( + T::Hash[String, + T.nilable( + T.any( + String, + Integer, + T::Array[T.nilable(T.any(String, Integer))] + ) + )] + ), + body: T.nilable(T.anything), + unwrap: T.nilable(Symbol), + page: T.nilable(T::Class[FinchAPI::BasePage[FinchAPI::BaseModel]]), + stream: T.nilable(T::Class[T.anything]), + model: T.nilable(FinchAPI::Converter::Input), + options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + } + end + + RequestInputShape = T.type_alias do + { + method: Symbol, + url: URI::Generic, + headers: T::Hash[String, String], + body: T.anything, + max_retries: Integer, + timeout: Float + } + end + + MAX_REDIRECTS = 20 + + PLATFORM_HEADERS = T::Hash[String, String] + + sig { params(req: FinchAPI::BaseClient::RequestComponentsShape).void } + def self.validate!(req) + end + + sig do + params(status: Integer, headers: T.any(T::Hash[String, String], Net::HTTPHeader)).returns(T::Boolean) + end + def self.should_retry?(status, headers:) + end + + sig do + params( + request: FinchAPI::BaseClient::RequestInputShape, + status: Integer, + response_headers: T.any(T::Hash[String, String], Net::HTTPHeader) + ) + .returns(FinchAPI::BaseClient::RequestInputShape) + end + def self.follow_redirect(request, status:, response_headers:) + end + + sig { returns(T.anything) } + def requester + end + + sig { params(_: T.anything).returns(T.anything) } + def requester=(_) + end + + sig do + params( + base_url: String, + timeout: Float, + max_retries: Integer, + initial_retry_delay: Float, + max_retry_delay: Float, + headers: T::Hash[String, + T.nilable(T.any(String, Integer, T::Array[T.nilable(T.any(String, Integer))]))], + idempotency_header: T.nilable(String) + ) + .void + end + def initialize( + base_url:, + timeout: 0.0, + max_retries: 0, + initial_retry_delay: 0.0, + max_retry_delay: 0.0, + headers: {}, + idempotency_header: nil + ) + end + + sig { overridable.returns(T::Hash[String, String]) } + private def auth_headers + end + + sig { returns(String) } + private def generate_idempotency_key + end + + sig do + overridable + .params(req: FinchAPI::BaseClient::RequestComponentsShape, opts: T::Hash[Symbol, T.anything]) + .returns(FinchAPI::BaseClient::RequestInputShape) + end + private def build_request(req, opts) + end + + sig { params(headers: T::Hash[String, String], retry_count: Integer).returns(Float) } + private def retry_delay(headers, retry_count:) + end + + sig do + params( + request: FinchAPI::BaseClient::RequestInputShape, + redirect_count: Integer, + retry_count: Integer, + send_retry_header: T::Boolean + ) + .returns([Integer, Net::HTTPResponse, T::Enumerable[String]]) + end + private def send_request(request, redirect_count:, retry_count:, send_retry_header:) + end + + sig do + params( + method: Symbol, + path: T.any(String, T::Array[String]), + query: T.nilable(T::Hash[String, T.nilable(T.any(T::Array[String], String))]), + headers: T.nilable( + T::Hash[String, + T.nilable( + T.any( + String, + Integer, + T::Array[T.nilable(T.any(String, Integer))] + ) + )] + ), + body: T.nilable(T.anything), + unwrap: T.nilable(Symbol), + page: T.nilable(T::Class[FinchAPI::BasePage[FinchAPI::BaseModel]]), + stream: T.nilable(T::Class[T.anything]), + model: T.nilable(FinchAPI::Converter::Input), + options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + ) + .returns(T.anything) + end + def request( + method, + path, + query: {}, + headers: {}, + body: nil, + unwrap: nil, + page: nil, + stream: nil, + model: FinchAPI::Unknown, + options: {} + ) + end + + sig { returns(String) } + def inspect + end + end +end diff --git a/rbi/lib/finch-api/base_model.rbi b/rbi/lib/finch-api/base_model.rbi new file mode 100644 index 00000000..35b4ce59 --- /dev/null +++ b/rbi/lib/finch-api/base_model.rbi @@ -0,0 +1,476 @@ +# typed: strong + +module FinchAPI + module Converter + abstract! + + Input = T.type_alias { T.any(FinchAPI::Converter, T::Class[T.anything]) } + + sig { overridable.params(value: T.anything).returns(T.anything) } + def coerce(value) + end + + sig { overridable.params(value: T.anything).returns(T.anything) } + def dump(value) + end + + sig do + overridable + .params(value: T.anything) + .returns(T.any([T::Boolean, T.anything, NilClass], [T::Boolean, T::Boolean, Integer])) + end + def try_strict_coerce(value) + end + + sig do + params( + spec: T.any( + { + const: T.nilable(T.any(NilClass, T::Boolean, Integer, Float, Symbol)), + enum: T.nilable(T.proc.returns(FinchAPI::Converter::Input)), + union: T.nilable(T.proc.returns(FinchAPI::Converter::Input)) + }, + T.proc.returns(FinchAPI::Converter::Input), + FinchAPI::Converter::Input + ) + ) + .returns(T.proc.returns(T.anything).void) + end + def self.type_info(spec) + end + + sig { params(target: FinchAPI::Converter::Input, value: T.anything).returns(T.anything) } + def self.coerce(target, value) + end + + sig { params(target: FinchAPI::Converter::Input, value: T.anything).returns(T.anything) } + def self.dump(target, value) + end + + sig { params(target: FinchAPI::Converter::Input, value: T.anything).returns(T.anything) } + def self.try_strict_coerce(target, value) + end + end + + class Unknown + abstract! + + extend FinchAPI::Converter + + sig { params(other: T.anything).returns(T::Boolean) } + def self.===(other) + end + + sig { params(other: T.anything).returns(T::Boolean) } + def self.==(other) + end + + sig { override.params(value: T.anything).returns(T.anything) } + def self.coerce(value) + end + + sig { override.params(value: T.anything).returns(T.anything) } + def self.dump(value) + end + + sig do + override + .params(value: T.anything) + .returns(T.any([T::Boolean, T.anything, NilClass], [T::Boolean, T::Boolean, Integer])) + end + def self.try_strict_coerce(value) + end + end + + class BooleanModel + abstract! + + extend FinchAPI::Converter + + sig { params(other: T.anything).returns(T::Boolean) } + def self.===(other) + end + + sig { params(other: T.anything).returns(T::Boolean) } + def self.==(other) + end + + sig { override.params(value: T.any(T::Boolean, T.anything)).returns(T.any(T::Boolean, T.anything)) } + def self.coerce(value) + end + + sig { override.params(value: T.any(T::Boolean, T.anything)).returns(T.any(T::Boolean, T.anything)) } + def self.dump(value) + end + + sig do + override + .params(value: T.anything) + .returns(T.any([T::Boolean, T.anything, NilClass], [T::Boolean, T::Boolean, Integer])) + end + def self.try_strict_coerce(value) + end + end + + class Enum + abstract! + + extend FinchAPI::Converter + + sig { overridable.returns(T::Array[T.any(NilClass, T::Boolean, Integer, Float, Symbol)]) } + def self.values + end + + sig { void } + private_class_method def self.finalize! + end + + sig { params(other: T.anything).returns(T::Boolean) } + def self.===(other) + end + + sig { params(other: T.anything).returns(T::Boolean) } + def self.==(other) + end + + sig { override.params(value: T.any(String, Symbol, T.anything)).returns(T.any(Symbol, T.anything)) } + def self.coerce(value) + end + + sig { override.params(value: T.any(Symbol, T.anything)).returns(T.any(Symbol, T.anything)) } + def self.dump(value) + end + + sig do + override + .params(value: T.anything) + .returns(T.any([T::Boolean, T.anything, NilClass], [T::Boolean, T::Boolean, Integer])) + end + def self.try_strict_coerce(value) + end + end + + class Union + abstract! + + extend FinchAPI::Converter + + sig { returns(T::Array[[T.nilable(Symbol), Proc]]) } + private_class_method def self.known_variants + end + + sig { overridable.returns(T::Array[[T.nilable(Symbol), T.anything]]) } + private_class_method def self.variants + end + + sig { params(property: Symbol).void } + private_class_method def self.discriminator(property) + end + + sig do + params( + key: T.any( + Symbol, + T::Hash[Symbol, T.anything], + T.proc.returns(FinchAPI::Converter::Input), + FinchAPI::Converter::Input + ), + spec: T.any( + T::Hash[Symbol, T.anything], + T.proc.returns(FinchAPI::Converter::Input), + FinchAPI::Converter::Input + ) + ) + .void + end + private_class_method def self.variant(key, spec = nil) + end + + sig { params(value: T.anything).returns(T.nilable(FinchAPI::Converter::Input)) } + private_class_method def self.resolve_variant(value) + end + + sig { params(other: T.anything).returns(T::Boolean) } + def self.===(other) + end + + sig { params(other: T.anything).returns(T::Boolean) } + def self.==(other) + end + + sig { override.params(value: T.anything).returns(T.anything) } + def self.coerce(value) + end + + sig { override.params(value: T.anything).returns(T.anything) } + def self.dump(value) + end + + sig do + override + .params(value: T.anything) + .returns(T.any([T::Boolean, T.anything, NilClass], [T::Boolean, T::Boolean, Integer])) + end + def self.try_strict_coerce(value) + end + end + + class ArrayOf + abstract! + + include FinchAPI::Converter + + sig { params(other: T.anything).returns(T::Boolean) } + def ===(other) + end + + sig { params(other: T.anything).returns(T::Boolean) } + def ==(other) + end + + sig do + override + .params(value: T.any(T::Enumerable[T.anything], T.anything)) + .returns(T.any(T::Array[T.anything], T.anything)) + end + def coerce(value) + end + + sig do + override + .params(value: T.any(T::Enumerable[T.anything], T.anything)) + .returns(T.any(T::Array[T.anything], T.anything)) + end + def dump(value) + end + + sig do + override + .params(value: T.anything) + .returns(T.any([T::Boolean, T.anything, NilClass], [T::Boolean, T::Boolean, Integer])) + end + def try_strict_coerce(value) + end + + sig { returns(FinchAPI::Converter::Input) } + protected def item_type + end + + sig do + params( + type_info: T.any( + T::Hash[Symbol, T.anything], + T.proc.returns(FinchAPI::Converter::Input), + FinchAPI::Converter::Input + ), + spec: T::Hash[Symbol, T.anything] + ) + .void + end + def initialize(type_info, spec = {}) + end + end + + class HashOf + abstract! + + include FinchAPI::Converter + + sig { params(other: T.anything).returns(T::Boolean) } + def ===(other) + end + + sig { params(other: T.anything).returns(T::Boolean) } + def ==(other) + end + + sig do + override + .params(value: T.any(T::Hash[T.anything, T.anything], T.anything)) + .returns(T.any(T::Hash[Symbol, T.anything], T.anything)) + end + def coerce(value) + end + + sig do + override + .params(value: T.any(T::Hash[T.anything, T.anything], T.anything)) + .returns(T.any(T::Hash[Symbol, T.anything], T.anything)) + end + def dump(value) + end + + sig do + override + .params(value: T.anything) + .returns(T.any([T::Boolean, T.anything, NilClass], [T::Boolean, T::Boolean, Integer])) + end + def try_strict_coerce(value) + end + + sig { returns(FinchAPI::Converter::Input) } + protected def item_type + end + + sig do + params( + type_info: T.any( + T::Hash[Symbol, T.anything], + T.proc.returns(FinchAPI::Converter::Input), + FinchAPI::Converter::Input + ), + spec: T::Hash[Symbol, T.anything] + ) + .void + end + def initialize(type_info, spec = {}) + end + end + + class BaseModel + abstract! + + extend FinchAPI::Converter + + KnownFieldShape = T.type_alias { {mode: T.nilable(Symbol), required: T::Boolean} } + + sig do + returns( + T::Hash[Symbol, + T.all( + FinchAPI::BaseModel::KnownFieldShape, + {type_fn: T.proc.returns(FinchAPI::Converter::Input)} + )] + ) + end + def self.known_fields + end + + sig do + returns( + T::Hash[Symbol, + T.all(FinchAPI::BaseModel::KnownFieldShape, {type: FinchAPI::Converter::Input})] + ) + end + def self.fields + end + + sig { returns(T::Hash[Symbol, T.proc.returns(T::Class[T.anything])]) } + def self.defaults + end + + sig do + params( + name_sym: Symbol, + required: T::Boolean, + type_info: T.any( + { + const: T.nilable(T.any(NilClass, T::Boolean, Integer, Float, Symbol)), + enum: T.nilable(T.proc.returns(FinchAPI::Converter::Input)), + union: T.nilable(T.proc.returns(FinchAPI::Converter::Input)), + api_name: Symbol, + nil?: T::Boolean + }, + T.proc.returns(FinchAPI::Converter::Input), + FinchAPI::Converter::Input + ), + spec: T::Hash[Symbol, T.anything] + ) + .void + end + private_class_method def self.add_field(name_sym, required:, type_info:, spec:) + end + + sig do + params( + name_sym: Symbol, + type_info: T.any( + T::Hash[Symbol, T.anything], + T.proc.returns(FinchAPI::Converter::Input), + FinchAPI::Converter::Input + ), + spec: T::Hash[Symbol, T.anything] + ) + .void + end + def self.required(name_sym, type_info, spec = {}) + end + + sig do + params( + name_sym: Symbol, + type_info: T.any( + T::Hash[Symbol, T.anything], + T.proc.returns(FinchAPI::Converter::Input), + FinchAPI::Converter::Input + ), + spec: T::Hash[Symbol, T.anything] + ) + .void + end + def self.optional(name_sym, type_info, spec = {}) + end + + sig { params(blk: T.proc.void).void } + private_class_method def self.request_only(&blk) + end + + sig { params(blk: T.proc.void).void } + private_class_method def self.response_only(&blk) + end + + sig { params(other: T.anything).returns(T::Boolean) } + def ==(other) + end + + sig do + override + .params(value: T.any(FinchAPI::BaseModel, T::Hash[T.anything, T.anything], T.anything)) + .returns(T.any(T.attached_class, T.anything)) + end + def self.coerce(value) + end + + sig do + override + .params(value: T.any(T.attached_class, T.anything)) + .returns(T.any(T::Hash[T.anything, T.anything], T.anything)) + end + def self.dump(value) + end + + sig do + override + .params(value: T.anything) + .returns(T.any([T::Boolean, T.anything, NilClass], [T::Boolean, T::Boolean, Integer])) + end + def self.try_strict_coerce(value) + end + + sig { params(key: Symbol).returns(T.nilable(T.anything)) } + def [](key) + end + + sig { overridable.returns(T::Hash[Symbol, T.anything]) } + def to_h + end + + alias_method :to_hash, :to_h + + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.anything]) } + def deconstruct_keys(keys) + end + + sig { params(data: T.any(T::Hash[Symbol, T.anything], T.self_type)).void } + def initialize(data = {}) + end + + sig { returns(String) } + def to_s + end + + sig { returns(String) } + def inspect + end + end +end diff --git a/rbi/lib/finch-api/base_page.rbi b/rbi/lib/finch-api/base_page.rbi new file mode 100644 index 00000000..ef4c814e --- /dev/null +++ b/rbi/lib/finch-api/base_page.rbi @@ -0,0 +1,39 @@ +# typed: strong + +module FinchAPI + module BasePage + abstract! + + Elem = type_member(:out) + + sig { overridable.returns(T::Boolean) } + def next_page? + end + + sig { overridable.returns(T.self_type) } + def next_page + end + + sig { overridable.params(blk: T.proc.params(arg0: Elem).void).void } + def auto_paging_each(&blk) + end + + sig { returns(T::Enumerable[Elem]) } + def to_enum + end + + alias_method :enum_for, :to_enum + + sig do + params( + client: FinchAPI::BaseClient, + req: FinchAPI::BaseClient::RequestComponentsShape, + headers: T.any(T::Hash[String, String], Net::HTTPHeader), + unwrapped: T.anything + ) + .void + end + def initialize(client:, req:, headers:, unwrapped:) + end + end +end diff --git a/rbi/lib/finch-api/client.rbi b/rbi/lib/finch-api/client.rbi new file mode 100644 index 00000000..c8e4dd05 --- /dev/null +++ b/rbi/lib/finch-api/client.rbi @@ -0,0 +1,102 @@ +# typed: strong + +module FinchAPI + class Client < FinchAPI::BaseClient + DEFAULT_MAX_RETRIES = 2 + + DEFAULT_TIMEOUT_IN_SECONDS = T.let(60.0, Float) + + DEFAULT_INITIAL_RETRY_DELAY = T.let(0.5, Float) + + DEFAULT_MAX_RETRY_DELAY = T.let(8.0, Float) + + sig { returns(T.nilable(String)) } + def access_token + end + + sig { returns(T.nilable(String)) } + def client_id + end + + sig { returns(T.nilable(String)) } + def client_secret + end + + sig { returns(FinchAPI::Resources::AccessTokens) } + def access_tokens + end + + sig { returns(FinchAPI::Resources::HRIS) } + def hris + end + + sig { returns(FinchAPI::Resources::Providers) } + def providers + end + + sig { returns(FinchAPI::Resources::Account) } + def account + end + + sig { returns(FinchAPI::Resources::Webhooks) } + def webhooks + end + + sig { returns(FinchAPI::Resources::RequestForwarding) } + def request_forwarding + end + + sig { returns(FinchAPI::Resources::Jobs) } + def jobs + end + + sig { returns(FinchAPI::Resources::Sandbox) } + def sandbox + end + + sig { returns(FinchAPI::Resources::Payroll) } + def payroll + end + + sig { returns(FinchAPI::Resources::Connect) } + def connect + end + + sig { override.returns(T::Hash[String, String]) } + private def auth_headers + end + + sig { returns(T::Hash[String, String]) } + private def bearer_auth + end + + sig { returns(T::Hash[String, String]) } + private def basic_auth + end + + sig do + params( + base_url: T.nilable(String), + access_token: T.nilable(String), + client_id: T.nilable(String), + client_secret: T.nilable(String), + max_retries: Integer, + timeout: Float, + initial_retry_delay: Float, + max_retry_delay: Float + ) + .void + end + def initialize( + base_url: nil, + access_token: nil, + client_id: ENV["FINCH_CLIENT_ID"], + client_secret: ENV["FINCH_CLIENT_SECRET"], + max_retries: DEFAULT_MAX_RETRIES, + timeout: DEFAULT_TIMEOUT_IN_SECONDS, + initial_retry_delay: DEFAULT_INITIAL_RETRY_DELAY, + max_retry_delay: DEFAULT_MAX_RETRY_DELAY + ) + end + end +end diff --git a/rbi/lib/finch-api/errors.rbi b/rbi/lib/finch-api/errors.rbi new file mode 100644 index 00000000..da720877 --- /dev/null +++ b/rbi/lib/finch-api/errors.rbi @@ -0,0 +1,146 @@ +# typed: strong + +module FinchAPI + class Error < StandardError + sig { returns(T.nilable(StandardError)) } + def cause + end + end + + class ConversionError < FinchAPI::Error + end + + class APIError < FinchAPI::Error + sig { returns(URI::Generic) } + def url + end + + sig { returns(T.nilable(Integer)) } + def status + end + + sig { returns(T.nilable(T.anything)) } + def body + end + + sig do + params( + url: URI::Generic, + status: T.nilable(Integer), + body: T.nilable(Object), + request: NilClass, + response: NilClass, + message: T.nilable(String) + ) + .void + end + def initialize(url:, status: nil, body: nil, request: nil, response: nil, message: nil) + end + end + + class APIConnectionError < FinchAPI::APIError + sig { void } + def status + end + + sig { void } + def body + end + + sig do + params( + url: URI::Generic, + status: NilClass, + body: NilClass, + request: NilClass, + response: NilClass, + message: T.nilable(String) + ) + .void + end + def initialize(url:, status: nil, body: nil, request: nil, response: nil, message: "Connection error.") + end + end + + class APITimeoutError < FinchAPI::APIConnectionError + sig do + params( + url: URI::Generic, + status: NilClass, + body: NilClass, + request: NilClass, + response: NilClass, + message: T.nilable(String) + ) + .void + end + def initialize(url:, status: nil, body: nil, request: nil, response: nil, message: "Request timed out.") + end + end + + class APIStatusError < FinchAPI::APIError + sig do + params( + url: URI::Generic, + status: Integer, + body: T.nilable(Object), + request: NilClass, + response: NilClass, + message: T.nilable(String) + ) + .returns(T.attached_class) + end + def self.for(url:, status:, body:, request:, response:, message: nil) + end + + sig { returns(Integer) } + def status + end + + sig do + params( + url: URI::Generic, + status: Integer, + body: T.nilable(Object), + request: NilClass, + response: NilClass, + message: T.nilable(String) + ) + .void + end + def initialize(url:, status:, body:, request:, response:, message: nil) + end + end + + class BadRequestError < FinchAPI::APIStatusError + HTTP_STATUS = 400 + end + + class AuthenticationError < FinchAPI::APIStatusError + HTTP_STATUS = 401 + end + + class PermissionDeniedError < FinchAPI::APIStatusError + HTTP_STATUS = 403 + end + + class NotFoundError < FinchAPI::APIStatusError + HTTP_STATUS = 404 + end + + class ConflictError < FinchAPI::APIStatusError + HTTP_STATUS = 409 + end + + class UnprocessableEntityError < FinchAPI::APIStatusError + HTTP_STATUS = 422 + end + + class RateLimitError < FinchAPI::APIStatusError + HTTP_STATUS = 429 + end + + class InternalServerError < FinchAPI::APIStatusError + HTTP_STATUS = T.let((500..), T::Range[Integer]) + end +end diff --git a/rbi/lib/finch-api/extern.rbi b/rbi/lib/finch-api/extern.rbi new file mode 100644 index 00000000..2affab87 --- /dev/null +++ b/rbi/lib/finch-api/extern.rbi @@ -0,0 +1,7 @@ +# typed: strong + +module FinchAPI + module Extern + abstract! + end +end diff --git a/rbi/lib/finch-api/individuals_page.rbi b/rbi/lib/finch-api/individuals_page.rbi new file mode 100644 index 00000000..3209623f --- /dev/null +++ b/rbi/lib/finch-api/individuals_page.rbi @@ -0,0 +1,37 @@ +# typed: strong + +module FinchAPI + class IndividualsPage + include FinchAPI::BasePage + + Elem = type_member + + sig { returns(T::Array[Elem]) } + def individuals + end + + sig { params(_: T::Array[Elem]).returns(T::Array[Elem]) } + def individuals=(_) + end + + sig { returns(FinchAPI::Models::Paging) } + def paging + end + + sig { params(_: FinchAPI::Models::Paging).returns(FinchAPI::Models::Paging) } + def paging=(_) + end + + sig do + params( + client: FinchAPI::BaseClient, + req: FinchAPI::BaseClient::RequestComponentsShape, + headers: T.any(T::Hash[String, String], Net::HTTPHeader), + unwrapped: T::Hash[Symbol, T.anything] + ) + .void + end + def initialize(client:, req:, headers:, unwrapped:) + end + end +end diff --git a/rbi/lib/finch-api/models/access_token_create_params.rbi b/rbi/lib/finch-api/models/access_token_create_params.rbi new file mode 100644 index 00000000..690fa5a9 --- /dev/null +++ b/rbi/lib/finch-api/models/access_token_create_params.rbi @@ -0,0 +1,70 @@ +# typed: strong + +module FinchAPI + module Models + class AccessTokenCreateParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + sig { returns(String) } + def code + end + + sig { params(_: String).returns(String) } + def code=(_) + end + + sig { returns(T.nilable(String)) } + def client_id + end + + sig { params(_: String).returns(String) } + def client_id=(_) + end + + sig { returns(T.nilable(String)) } + def client_secret + end + + sig { params(_: String).returns(String) } + def client_secret=(_) + end + + sig { returns(T.nilable(String)) } + def redirect_uri + end + + sig { params(_: String).returns(String) } + def redirect_uri=(_) + end + + sig do + params( + code: String, + client_id: String, + client_secret: String, + redirect_uri: String, + request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + ) + .void + end + def initialize(code:, client_id: nil, client_secret: nil, redirect_uri: nil, request_options: {}) + end + + sig do + override + .returns( + { + code: String, + client_id: String, + client_secret: String, + redirect_uri: String, + request_options: FinchAPI::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lib/finch-api/models/account_disconnect_params.rbi b/rbi/lib/finch-api/models/account_disconnect_params.rbi new file mode 100644 index 00000000..1eb51817 --- /dev/null +++ b/rbi/lib/finch-api/models/account_disconnect_params.rbi @@ -0,0 +1,18 @@ +# typed: strong + +module FinchAPI + module Models + class AccountDisconnectParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + sig { params(request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])).void } + def initialize(request_options: {}) + end + + sig { override.returns({request_options: FinchAPI::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/finch-api/models/account_introspect_params.rbi b/rbi/lib/finch-api/models/account_introspect_params.rbi new file mode 100644 index 00000000..b3aa30db --- /dev/null +++ b/rbi/lib/finch-api/models/account_introspect_params.rbi @@ -0,0 +1,18 @@ +# typed: strong + +module FinchAPI + module Models + class AccountIntrospectParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + sig { params(request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])).void } + def initialize(request_options: {}) + end + + sig { override.returns({request_options: FinchAPI::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/finch-api/models/account_update_event.rbi b/rbi/lib/finch-api/models/account_update_event.rbi new file mode 100644 index 00000000..812c9003 --- /dev/null +++ b/rbi/lib/finch-api/models/account_update_event.rbi @@ -0,0 +1,2479 @@ +# typed: strong + +module FinchAPI + module Models + class AccountUpdateEvent < FinchAPI::Models::BaseWebhookEvent + sig { returns(T.nilable(FinchAPI::Models::AccountUpdateEvent::Data)) } + def data + end + + sig { params(_: FinchAPI::Models::AccountUpdateEvent::Data).returns(FinchAPI::Models::AccountUpdateEvent::Data) } + def data=(_) + end + + sig { returns(T.nilable(Symbol)) } + def event_type + end + + sig { params(_: Symbol).returns(Symbol) } + def event_type=(_) + end + + sig { params(data: FinchAPI::Models::AccountUpdateEvent::Data, event_type: Symbol).void } + def initialize(data: nil, event_type: nil) + end + + sig { override.returns({data: FinchAPI::Models::AccountUpdateEvent::Data, event_type: Symbol}) } + def to_hash + end + + class Data < FinchAPI::BaseModel + sig { returns(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod) } + def authentication_method + end + + sig do + params(_: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod) + .returns(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod) + end + def authentication_method=(_) + end + + sig { returns(Symbol) } + def status + end + + sig { params(_: Symbol).returns(Symbol) } + def status=(_) + end + + sig do + params( + authentication_method: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod, + status: Symbol + ) + .void + end + def initialize(authentication_method:, status:) + end + + sig do + override + .returns( + {authentication_method: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod, status: Symbol} + ) + end + def to_hash + end + + class AuthenticationMethod < FinchAPI::BaseModel + sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitsSupport)) } + def benefits_support + end + + sig do + params(_: T.nilable(FinchAPI::Models::HRIS::BenefitsSupport)) + .returns(T.nilable(FinchAPI::Models::HRIS::BenefitsSupport)) + end + def benefits_support=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields)) } + def supported_fields + end + + sig do + params(_: T.nilable(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields)) + .returns(T.nilable(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields)) + end + def supported_fields=(_) + end + + sig { returns(T.nilable(Symbol)) } + def type + end + + sig { params(_: Symbol).returns(Symbol) } + def type=(_) + end + + sig do + params( + benefits_support: T.nilable(FinchAPI::Models::HRIS::BenefitsSupport), + supported_fields: T.nilable(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields), + type: Symbol + ) + .void + end + def initialize(benefits_support: nil, supported_fields: nil, type: nil) + end + + sig do + override + .returns( + { + benefits_support: T.nilable(FinchAPI::Models::HRIS::BenefitsSupport), + supported_fields: T.nilable(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields), + type: Symbol + } + ) + end + def to_hash + end + + class SupportedFields < FinchAPI::BaseModel + sig do + returns( + T.nilable(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company) + ) + end + def company + end + + sig do + params(_: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company) + .returns(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company) + end + def company=(_) + end + + sig do + returns( + T.nilable(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory) + ) + end + def directory + end + + sig do + params(_: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory) + .returns(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory) + end + def directory=(_) + end + + sig do + returns( + T.nilable(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment) + ) + end + def employment + end + + sig do + params(_: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment) + .returns(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment) + end + def employment=(_) + end + + sig do + returns( + T.nilable(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual) + ) + end + def individual + end + + sig do + params(_: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual) + .returns(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual) + end + def individual=(_) + end + + sig do + returns( + T.nilable(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayGroup) + ) + end + def pay_group + end + + sig do + params(_: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayGroup) + .returns(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayGroup) + end + def pay_group=(_) + end + + sig do + returns( + T.nilable(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement) + ) + end + def pay_statement + end + + sig do + params(_: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement) + .returns(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement) + end + def pay_statement=(_) + end + + sig do + returns( + T.nilable(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment) + ) + end + def payment + end + + sig do + params(_: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment) + .returns(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment) + end + def payment=(_) + end + + sig do + params( + company: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company, + directory: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory, + employment: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment, + individual: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual, + pay_group: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayGroup, + pay_statement: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement, + payment: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment + ) + .void + end + def initialize( + company: nil, + directory: nil, + employment: nil, + individual: nil, + pay_group: nil, + pay_statement: nil, + payment: nil + ) + end + + sig do + override + .returns( + { + company: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company, + directory: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory, + employment: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment, + individual: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual, + pay_group: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayGroup, + pay_statement: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement, + payment: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment + } + ) + end + def to_hash + end + + class Company < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def id + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def id=(_) + end + + sig do + returns( + T.nilable( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Accounts + ) + ) + end + def accounts + end + + sig do + params( + _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Accounts + ) + .returns( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Accounts + ) + end + def accounts=(_) + end + + sig do + returns( + T.nilable( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments + ) + ) + end + def departments + end + + sig do + params( + _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments + ) + .returns( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments + ) + end + def departments=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def ein + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def ein=(_) + end + + sig do + returns( + T.nilable( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Entity + ) + ) + end + def entity + end + + sig do + params( + _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Entity + ) + .returns( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Entity + ) + end + def entity=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def legal_name + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def legal_name=(_) + end + + sig do + returns( + T.nilable( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Locations + ) + ) + end + def locations + end + + sig do + params( + _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Locations + ) + .returns( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Locations + ) + end + def locations=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def primary_email + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def primary_email=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def primary_phone_number + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def primary_phone_number=(_) + end + + sig do + params( + id: T::Boolean, + accounts: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Accounts, + departments: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments, + ein: T::Boolean, + entity: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Entity, + legal_name: T::Boolean, + locations: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Locations, + primary_email: T::Boolean, + primary_phone_number: T::Boolean + ) + .void + end + def initialize( + id: nil, + accounts: nil, + departments: nil, + ein: nil, + entity: nil, + legal_name: nil, + locations: nil, + primary_email: nil, + primary_phone_number: nil + ) + end + + sig do + override + .returns( + { + id: T::Boolean, + accounts: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Accounts, + departments: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments, + ein: T::Boolean, + entity: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Entity, + legal_name: T::Boolean, + locations: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Locations, + primary_email: T::Boolean, + primary_phone_number: T::Boolean + } + ) + end + def to_hash + end + + class Accounts < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def account_name + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def account_name=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def account_number + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def account_number=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def account_type + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def account_type=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def institution_name + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def institution_name=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def routing_number + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def routing_number=(_) + end + + sig do + params( + account_name: T::Boolean, + account_number: T::Boolean, + account_type: T::Boolean, + institution_name: T::Boolean, + routing_number: T::Boolean + ) + .void + end + def initialize( + account_name: nil, + account_number: nil, + account_type: nil, + institution_name: nil, + routing_number: nil + ) + end + + sig do + override + .returns( + { + account_name: T::Boolean, + account_number: T::Boolean, + account_type: T::Boolean, + institution_name: T::Boolean, + routing_number: T::Boolean + } + ) + end + def to_hash + end + end + + class Departments < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def name + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def name=(_) + end + + sig do + returns( + T.nilable( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments::Parent + ) + ) + end + def parent + end + + sig do + params( + _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments::Parent + ) + .returns( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments::Parent + ) + end + def parent=(_) + end + + sig do + params( + name: T::Boolean, + parent: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments::Parent + ) + .void + end + def initialize(name: nil, parent: nil) + end + + sig do + override + .returns( + { + name: T::Boolean, + parent: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments::Parent + } + ) + end + def to_hash + end + + class Parent < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def name + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def name=(_) + end + + sig { params(name: T::Boolean).void } + def initialize(name: nil) + end + + sig { override.returns({name: T::Boolean}) } + def to_hash + end + end + end + + class Entity < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def subtype + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def subtype=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def type + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def type=(_) + end + + sig { params(subtype: T::Boolean, type: T::Boolean).void } + def initialize(subtype: nil, type: nil) + end + + sig { override.returns({subtype: T::Boolean, type: T::Boolean}) } + def to_hash + end + end + + class Locations < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def city + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def city=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def country + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def country=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def line1 + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def line1=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def line2 + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def line2=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def postal_code + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def postal_code=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def state + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def state=(_) + end + + sig do + params( + city: T::Boolean, + country: T::Boolean, + line1: T::Boolean, + line2: T::Boolean, + postal_code: T::Boolean, + state: T::Boolean + ) + .void + end + def initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil) + end + + sig do + override + .returns( + { + city: T::Boolean, + country: T::Boolean, + line1: T::Boolean, + line2: T::Boolean, + postal_code: T::Boolean, + state: T::Boolean + } + ) + end + def to_hash + end + end + end + + class Directory < FinchAPI::BaseModel + sig do + returns( + T.nilable( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals + ) + ) + end + def individuals + end + + sig do + params( + _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals + ) + .returns( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals + ) + end + def individuals=(_) + end + + sig do + returns( + T.nilable( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Paging + ) + ) + end + def paging + end + + sig do + params( + _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Paging + ) + .returns( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Paging + ) + end + def paging=(_) + end + + sig do + params( + individuals: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals, + paging: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Paging + ) + .void + end + def initialize(individuals: nil, paging: nil) + end + + sig do + override + .returns( + { + individuals: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals, + paging: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Paging + } + ) + end + def to_hash + end + + class Individuals < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def id + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def id=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def department + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def department=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def first_name + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def first_name=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def is_active + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def is_active=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def last_name + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def last_name=(_) + end + + sig do + returns( + T.nilable( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager + ) + ) + end + def manager + end + + sig do + params( + _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager + ) + .returns( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager + ) + end + def manager=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def middle_name + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def middle_name=(_) + end + + sig do + params( + id: T::Boolean, + department: T::Boolean, + first_name: T::Boolean, + is_active: T::Boolean, + last_name: T::Boolean, + manager: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager, + middle_name: T::Boolean + ) + .void + end + def initialize( + id: nil, + department: nil, + first_name: nil, + is_active: nil, + last_name: nil, + manager: nil, + middle_name: nil + ) + end + + sig do + override + .returns( + { + id: T::Boolean, + department: T::Boolean, + first_name: T::Boolean, + is_active: T::Boolean, + last_name: T::Boolean, + manager: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager, + middle_name: T::Boolean + } + ) + end + def to_hash + end + + class Manager < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def id + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def id=(_) + end + + sig { params(id: T::Boolean).void } + def initialize(id: nil) + end + + sig { override.returns({id: T::Boolean}) } + def to_hash + end + end + end + + class Paging < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def count + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def count=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def offset + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def offset=(_) + end + + sig { params(count: T::Boolean, offset: T::Boolean).void } + def initialize(count: nil, offset: nil) + end + + sig { override.returns({count: T::Boolean, offset: T::Boolean}) } + def to_hash + end + end + end + + class Employment < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def id + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def id=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def class_code + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def class_code=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def custom_fields + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def custom_fields=(_) + end + + sig do + returns( + T.nilable( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Department + ) + ) + end + def department + end + + sig do + params( + _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Department + ) + .returns( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Department + ) + end + def department=(_) + end + + sig do + returns( + T.nilable( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Employment + ) + ) + end + def employment + end + + sig do + params( + _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Employment + ) + .returns( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Employment + ) + end + def employment=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def employment_status + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def employment_status=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def end_date + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def end_date=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def first_name + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def first_name=(_) + end + + sig do + returns( + T.nilable( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Income + ) + ) + end + def income + end + + sig do + params( + _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Income + ) + .returns( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Income + ) + end + def income=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def income_history + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def income_history=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def is_active + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def is_active=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def last_name + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def last_name=(_) + end + + sig do + returns( + T.nilable( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Location + ) + ) + end + def location + end + + sig do + params( + _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Location + ) + .returns( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Location + ) + end + def location=(_) + end + + sig do + returns( + T.nilable( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Manager + ) + ) + end + def manager + end + + sig do + params( + _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Manager + ) + .returns( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Manager + ) + end + def manager=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def middle_name + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def middle_name=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def start_date + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def start_date=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def title + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def title=(_) + end + + sig do + params( + id: T::Boolean, + class_code: T::Boolean, + custom_fields: T::Boolean, + department: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Department, + employment: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Employment, + employment_status: T::Boolean, + end_date: T::Boolean, + first_name: T::Boolean, + income: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Income, + income_history: T::Boolean, + is_active: T::Boolean, + last_name: T::Boolean, + location: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Location, + manager: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Manager, + middle_name: T::Boolean, + start_date: T::Boolean, + title: T::Boolean + ) + .void + end + def initialize( + id: nil, + class_code: nil, + custom_fields: nil, + department: nil, + employment: nil, + employment_status: nil, + end_date: nil, + first_name: nil, + income: nil, + income_history: nil, + is_active: nil, + last_name: nil, + location: nil, + manager: nil, + middle_name: nil, + start_date: nil, + title: nil + ) + end + + sig do + override + .returns( + { + id: T::Boolean, + class_code: T::Boolean, + custom_fields: T::Boolean, + department: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Department, + employment: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Employment, + employment_status: T::Boolean, + end_date: T::Boolean, + first_name: T::Boolean, + income: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Income, + income_history: T::Boolean, + is_active: T::Boolean, + last_name: T::Boolean, + location: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Location, + manager: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Manager, + middle_name: T::Boolean, + start_date: T::Boolean, + title: T::Boolean + } + ) + end + def to_hash + end + + class Department < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def name + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def name=(_) + end + + sig { params(name: T::Boolean).void } + def initialize(name: nil) + end + + sig { override.returns({name: T::Boolean}) } + def to_hash + end + end + + class Employment < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def subtype + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def subtype=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def type + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def type=(_) + end + + sig { params(subtype: T::Boolean, type: T::Boolean).void } + def initialize(subtype: nil, type: nil) + end + + sig { override.returns({subtype: T::Boolean, type: T::Boolean}) } + def to_hash + end + end + + class Income < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def amount + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def amount=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def currency + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def currency=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def unit + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def unit=(_) + end + + sig { params(amount: T::Boolean, currency: T::Boolean, unit: T::Boolean).void } + def initialize(amount: nil, currency: nil, unit: nil) + end + + sig { override.returns({amount: T::Boolean, currency: T::Boolean, unit: T::Boolean}) } + def to_hash + end + end + + class Location < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def city + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def city=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def country + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def country=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def line1 + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def line1=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def line2 + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def line2=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def postal_code + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def postal_code=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def state + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def state=(_) + end + + sig do + params( + city: T::Boolean, + country: T::Boolean, + line1: T::Boolean, + line2: T::Boolean, + postal_code: T::Boolean, + state: T::Boolean + ) + .void + end + def initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil) + end + + sig do + override + .returns( + { + city: T::Boolean, + country: T::Boolean, + line1: T::Boolean, + line2: T::Boolean, + postal_code: T::Boolean, + state: T::Boolean + } + ) + end + def to_hash + end + end + + class Manager < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def id + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def id=(_) + end + + sig { params(id: T::Boolean).void } + def initialize(id: nil) + end + + sig { override.returns({id: T::Boolean}) } + def to_hash + end + end + end + + class Individual < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def id + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def id=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def dob + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def dob=(_) + end + + sig do + returns( + T.nilable( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::Emails + ) + ) + end + def emails + end + + sig do + params( + _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::Emails + ) + .returns( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::Emails + ) + end + def emails=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def encrypted_ssn + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def encrypted_ssn=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def ethnicity + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def ethnicity=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def first_name + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def first_name=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def gender + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def gender=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def last_name + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def last_name=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def middle_name + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def middle_name=(_) + end + + sig do + returns( + T.nilable( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::PhoneNumbers + ) + ) + end + def phone_numbers + end + + sig do + params( + _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::PhoneNumbers + ) + .returns( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::PhoneNumbers + ) + end + def phone_numbers=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def preferred_name + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def preferred_name=(_) + end + + sig do + returns( + T.nilable( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::Residence + ) + ) + end + def residence + end + + sig do + params( + _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::Residence + ) + .returns( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::Residence + ) + end + def residence=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def ssn + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def ssn=(_) + end + + sig do + params( + id: T::Boolean, + dob: T::Boolean, + emails: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::Emails, + encrypted_ssn: T::Boolean, + ethnicity: T::Boolean, + first_name: T::Boolean, + gender: T::Boolean, + last_name: T::Boolean, + middle_name: T::Boolean, + phone_numbers: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::PhoneNumbers, + preferred_name: T::Boolean, + residence: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::Residence, + ssn: T::Boolean + ) + .void + end + def initialize( + id: nil, + dob: nil, + emails: nil, + encrypted_ssn: nil, + ethnicity: nil, + first_name: nil, + gender: nil, + last_name: nil, + middle_name: nil, + phone_numbers: nil, + preferred_name: nil, + residence: nil, + ssn: nil + ) + end + + sig do + override + .returns( + { + id: T::Boolean, + dob: T::Boolean, + emails: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::Emails, + encrypted_ssn: T::Boolean, + ethnicity: T::Boolean, + first_name: T::Boolean, + gender: T::Boolean, + last_name: T::Boolean, + middle_name: T::Boolean, + phone_numbers: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::PhoneNumbers, + preferred_name: T::Boolean, + residence: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::Residence, + ssn: T::Boolean + } + ) + end + def to_hash + end + + class Emails < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def data + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def data=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def type + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def type=(_) + end + + sig { params(data: T::Boolean, type: T::Boolean).void } + def initialize(data: nil, type: nil) + end + + sig { override.returns({data: T::Boolean, type: T::Boolean}) } + def to_hash + end + end + + class PhoneNumbers < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def data + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def data=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def type + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def type=(_) + end + + sig { params(data: T::Boolean, type: T::Boolean).void } + def initialize(data: nil, type: nil) + end + + sig { override.returns({data: T::Boolean, type: T::Boolean}) } + def to_hash + end + end + + class Residence < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def city + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def city=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def country + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def country=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def line1 + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def line1=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def line2 + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def line2=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def postal_code + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def postal_code=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def state + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def state=(_) + end + + sig do + params( + city: T::Boolean, + country: T::Boolean, + line1: T::Boolean, + line2: T::Boolean, + postal_code: T::Boolean, + state: T::Boolean + ) + .void + end + def initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil) + end + + sig do + override + .returns( + { + city: T::Boolean, + country: T::Boolean, + line1: T::Boolean, + line2: T::Boolean, + postal_code: T::Boolean, + state: T::Boolean + } + ) + end + def to_hash + end + end + end + + class PayGroup < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def id + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def id=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def individual_ids + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def individual_ids=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def name + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def name=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def pay_frequencies + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def pay_frequencies=(_) + end + + sig do + params( + id: T::Boolean, + individual_ids: T::Boolean, + name: T::Boolean, + pay_frequencies: T::Boolean + ).void + end + def initialize(id: nil, individual_ids: nil, name: nil, pay_frequencies: nil) + end + + sig do + override + .returns({ + id: T::Boolean, + individual_ids: T::Boolean, + name: T::Boolean, + pay_frequencies: T::Boolean + }) + end + def to_hash + end + end + + class PayStatement < FinchAPI::BaseModel + sig do + returns( + T.nilable( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::Paging + ) + ) + end + def paging + end + + sig do + params( + _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::Paging + ) + .returns( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::Paging + ) + end + def paging=(_) + end + + sig do + returns( + T.nilable( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements + ) + ) + end + def pay_statements + end + + sig do + params( + _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements + ) + .returns( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements + ) + end + def pay_statements=(_) + end + + sig do + params( + paging: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::Paging, + pay_statements: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements + ) + .void + end + def initialize(paging: nil, pay_statements: nil) + end + + sig do + override + .returns( + { + paging: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::Paging, + pay_statements: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements + } + ) + end + def to_hash + end + + class Paging < FinchAPI::BaseModel + sig { returns(T::Boolean) } + def count + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def count=(_) + end + + sig { returns(T::Boolean) } + def offset + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def offset=(_) + end + + sig { params(count: T::Boolean, offset: T::Boolean).void } + def initialize(count:, offset:) + end + + sig { override.returns({count: T::Boolean, offset: T::Boolean}) } + def to_hash + end + end + + class PayStatements < FinchAPI::BaseModel + sig do + returns( + T.nilable( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings + ) + ) + end + def earnings + end + + sig do + params( + _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings + ) + .returns( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings + ) + end + def earnings=(_) + end + + sig do + returns( + T.nilable( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployeeDeductions + ) + ) + end + def employee_deductions + end + + sig do + params( + _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployeeDeductions + ) + .returns( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployeeDeductions + ) + end + def employee_deductions=(_) + end + + sig do + returns( + T.nilable( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployerContributions + ) + ) + end + def employer_contributions + end + + sig do + params( + _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployerContributions + ) + .returns( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployerContributions + ) + end + def employer_contributions=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def gross_pay + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def gross_pay=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def individual_id + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def individual_id=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def net_pay + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def net_pay=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def payment_method + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def payment_method=(_) + end + + sig do + returns( + T.nilable( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Taxes + ) + ) + end + def taxes + end + + sig do + params( + _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Taxes + ) + .returns( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Taxes + ) + end + def taxes=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def total_hours + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def total_hours=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def type + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def type=(_) + end + + sig do + params( + earnings: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings, + employee_deductions: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployeeDeductions, + employer_contributions: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployerContributions, + gross_pay: T::Boolean, + individual_id: T::Boolean, + net_pay: T::Boolean, + payment_method: T::Boolean, + taxes: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Taxes, + total_hours: T::Boolean, + type: T::Boolean + ) + .void + end + def initialize( + earnings: nil, + employee_deductions: nil, + employer_contributions: nil, + gross_pay: nil, + individual_id: nil, + net_pay: nil, + payment_method: nil, + taxes: nil, + total_hours: nil, + type: nil + ) + end + + sig do + override + .returns( + { + earnings: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings, + employee_deductions: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployeeDeductions, + employer_contributions: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployerContributions, + gross_pay: T::Boolean, + individual_id: T::Boolean, + net_pay: T::Boolean, + payment_method: T::Boolean, + taxes: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Taxes, + total_hours: T::Boolean, + type: T::Boolean + } + ) + end + def to_hash + end + + class Earnings < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def amount + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def amount=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def currency + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def currency=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def name + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def name=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def type + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def type=(_) + end + + sig do + params(amount: T::Boolean, currency: T::Boolean, name: T::Boolean, type: T::Boolean).void + end + def initialize(amount: nil, currency: nil, name: nil, type: nil) + end + + sig do + override.returns( + { + amount: T::Boolean, + currency: T::Boolean, + name: T::Boolean, + type: T::Boolean + } + ) + end + def to_hash + end + end + + class EmployeeDeductions < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def amount + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def amount=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def currency + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def currency=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def name + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def name=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def pre_tax + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def pre_tax=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def type + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def type=(_) + end + + sig do + params( + amount: T::Boolean, + currency: T::Boolean, + name: T::Boolean, + pre_tax: T::Boolean, + type: T::Boolean + ) + .void + end + def initialize(amount: nil, currency: nil, name: nil, pre_tax: nil, type: nil) + end + + sig do + override + .returns( + { + amount: T::Boolean, + currency: T::Boolean, + name: T::Boolean, + pre_tax: T::Boolean, + type: T::Boolean + } + ) + end + def to_hash + end + end + + class EmployerContributions < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def amount + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def amount=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def currency + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def currency=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def name + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def name=(_) + end + + sig { params(amount: T::Boolean, currency: T::Boolean, name: T::Boolean).void } + def initialize(amount: nil, currency: nil, name: nil) + end + + sig { override.returns({amount: T::Boolean, currency: T::Boolean, name: T::Boolean}) } + def to_hash + end + end + + class Taxes < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def amount + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def amount=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def currency + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def currency=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def employer + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def employer=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def name + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def name=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def type + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def type=(_) + end + + sig do + params( + amount: T::Boolean, + currency: T::Boolean, + employer: T::Boolean, + name: T::Boolean, + type: T::Boolean + ) + .void + end + def initialize(amount: nil, currency: nil, employer: nil, name: nil, type: nil) + end + + sig do + override + .returns( + { + amount: T::Boolean, + currency: T::Boolean, + employer: T::Boolean, + name: T::Boolean, + type: T::Boolean + } + ) + end + def to_hash + end + end + end + end + + class Payment < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def id + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def id=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def company_debit + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def company_debit=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def debit_date + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def debit_date=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def employee_taxes + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def employee_taxes=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def employer_taxes + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def employer_taxes=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def gross_pay + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def gross_pay=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def individual_ids + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def individual_ids=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def net_pay + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def net_pay=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def pay_date + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def pay_date=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def pay_frequencies + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def pay_frequencies=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def pay_group_ids + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def pay_group_ids=(_) + end + + sig do + returns( + T.nilable( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment::PayPeriod + ) + ) + end + def pay_period + end + + sig do + params( + _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment::PayPeriod + ) + .returns( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment::PayPeriod + ) + end + def pay_period=(_) + end + + sig do + params( + id: T::Boolean, + company_debit: T::Boolean, + debit_date: T::Boolean, + employee_taxes: T::Boolean, + employer_taxes: T::Boolean, + gross_pay: T::Boolean, + individual_ids: T::Boolean, + net_pay: T::Boolean, + pay_date: T::Boolean, + pay_frequencies: T::Boolean, + pay_group_ids: T::Boolean, + pay_period: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment::PayPeriod + ) + .void + end + def initialize( + id: nil, + company_debit: nil, + debit_date: nil, + employee_taxes: nil, + employer_taxes: nil, + gross_pay: nil, + individual_ids: nil, + net_pay: nil, + pay_date: nil, + pay_frequencies: nil, + pay_group_ids: nil, + pay_period: nil + ) + end + + sig do + override + .returns( + { + id: T::Boolean, + company_debit: T::Boolean, + debit_date: T::Boolean, + employee_taxes: T::Boolean, + employer_taxes: T::Boolean, + gross_pay: T::Boolean, + individual_ids: T::Boolean, + net_pay: T::Boolean, + pay_date: T::Boolean, + pay_frequencies: T::Boolean, + pay_group_ids: T::Boolean, + pay_period: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment::PayPeriod + } + ) + end + def to_hash + end + + class PayPeriod < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def end_date + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def end_date=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def start_date + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def start_date=(_) + end + + sig { params(end_date: T::Boolean, start_date: T::Boolean).void } + def initialize(end_date: nil, start_date: nil) + end + + sig { override.returns({end_date: T::Boolean, start_date: T::Boolean}) } + def to_hash + end + end + end + end + + class Type < FinchAPI::Enum + abstract! + + ASSISTED = :assisted + CREDENTIAL = :credential + API_TOKEN = :api_token + API_CREDENTIAL = :api_credential + OAUTH = :oauth + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end + + class EventType < FinchAPI::Enum + abstract! + + ACCOUNT_UPDATED = :"account.updated" + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/base_webhook_event.rbi b/rbi/lib/finch-api/models/base_webhook_event.rbi new file mode 100644 index 00000000..dbf35f17 --- /dev/null +++ b/rbi/lib/finch-api/models/base_webhook_event.rbi @@ -0,0 +1,39 @@ +# typed: strong + +module FinchAPI + module Models + class BaseWebhookEvent < FinchAPI::BaseModel + sig { returns(String) } + def account_id + end + + sig { params(_: String).returns(String) } + def account_id=(_) + end + + sig { returns(String) } + def company_id + end + + sig { params(_: String).returns(String) } + def company_id=(_) + end + + sig { returns(T.nilable(String)) } + def connection_id + end + + sig { params(_: String).returns(String) } + def connection_id=(_) + end + + sig { params(account_id: String, company_id: String, connection_id: String).void } + def initialize(account_id:, company_id:, connection_id: nil) + end + + sig { override.returns({account_id: String, company_id: String, connection_id: String}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/finch-api/models/company_event.rbi b/rbi/lib/finch-api/models/company_event.rbi new file mode 100644 index 00000000..2c38858d --- /dev/null +++ b/rbi/lib/finch-api/models/company_event.rbi @@ -0,0 +1,43 @@ +# typed: strong + +module FinchAPI + module Models + class CompanyEvent < FinchAPI::Models::BaseWebhookEvent + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + def data + end + + sig do + params(_: T.nilable(T::Hash[Symbol, T.anything])).returns(T.nilable(T::Hash[Symbol, T.anything])) + end + def data=(_) + end + + sig { returns(T.nilable(Symbol)) } + def event_type + end + + sig { params(_: Symbol).returns(Symbol) } + def event_type=(_) + end + + sig { params(data: T.nilable(T::Hash[Symbol, T.anything]), event_type: Symbol).void } + def initialize(data: nil, event_type: nil) + end + + sig { override.returns({data: T.nilable(T::Hash[Symbol, T.anything]), event_type: Symbol}) } + def to_hash + end + + class EventType < FinchAPI::Enum + abstract! + + COMPANY_UPDATED = :"company.updated" + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/connect/session_new_params.rbi b/rbi/lib/finch-api/models/connect/session_new_params.rbi new file mode 100644 index 00000000..5ea91e8d --- /dev/null +++ b/rbi/lib/finch-api/models/connect/session_new_params.rbi @@ -0,0 +1,203 @@ +# typed: strong + +module FinchAPI + module Models + module Connect + class SessionNewParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + sig { returns(String) } + def customer_id + end + + sig { params(_: String).returns(String) } + def customer_id=(_) + end + + sig { returns(String) } + def customer_name + end + + sig { params(_: String).returns(String) } + def customer_name=(_) + end + + sig { returns(T::Array[Symbol]) } + def products + end + + sig { params(_: T::Array[Symbol]).returns(T::Array[Symbol]) } + def products=(_) + end + + sig { returns(T.nilable(String)) } + def customer_email + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def customer_email=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Connect::SessionNewParams::Integration)) } + def integration + end + + sig do + params(_: T.nilable(FinchAPI::Models::Connect::SessionNewParams::Integration)) + .returns(T.nilable(FinchAPI::Models::Connect::SessionNewParams::Integration)) + end + def integration=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def manual + end + + sig { params(_: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } + def manual=(_) + end + + sig { returns(T.nilable(Float)) } + def minutes_to_expire + end + + sig { params(_: T.nilable(Float)).returns(T.nilable(Float)) } + def minutes_to_expire=(_) + end + + sig { returns(T.nilable(String)) } + def redirect_uri + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def redirect_uri=(_) + end + + sig { returns(T.nilable(Symbol)) } + def sandbox + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def sandbox=(_) + end + + sig do + params( + customer_id: String, + customer_name: String, + products: T::Array[Symbol], + customer_email: T.nilable(String), + integration: T.nilable(FinchAPI::Models::Connect::SessionNewParams::Integration), + manual: T.nilable(T::Boolean), + minutes_to_expire: T.nilable(Float), + redirect_uri: T.nilable(String), + sandbox: T.nilable(Symbol), + request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + ) + .void + end + def initialize( + customer_id:, + customer_name:, + products:, + customer_email: nil, + integration: nil, + manual: nil, + minutes_to_expire: nil, + redirect_uri: nil, + sandbox: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + customer_id: String, + customer_name: String, + products: T::Array[Symbol], + customer_email: T.nilable(String), + integration: T.nilable(FinchAPI::Models::Connect::SessionNewParams::Integration), + manual: T.nilable(T::Boolean), + minutes_to_expire: T.nilable(Float), + redirect_uri: T.nilable(String), + sandbox: T.nilable(Symbol), + request_options: FinchAPI::RequestOptions + } + ) + end + def to_hash + end + + class Product < FinchAPI::Enum + abstract! + + COMPANY = :company + DIRECTORY = :directory + INDIVIDUAL = :individual + EMPLOYMENT = :employment + PAYMENT = :payment + PAY_STATEMENT = :pay_statement + BENEFITS = :benefits + SSN = :ssn + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + + class Integration < FinchAPI::BaseModel + sig { returns(T.nilable(Symbol)) } + def auth_method + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def auth_method=(_) + end + + sig { returns(T.nilable(String)) } + def provider + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def provider=(_) + end + + sig { params(auth_method: T.nilable(Symbol), provider: T.nilable(String)).void } + def initialize(auth_method: nil, provider: nil) + end + + sig { override.returns({auth_method: T.nilable(Symbol), provider: T.nilable(String)}) } + def to_hash + end + + class AuthMethod < FinchAPI::Enum + abstract! + + ASSISTED = T.let(:assisted, T.nilable(Symbol)) + CREDENTIAL = T.let(:credential, T.nilable(Symbol)) + OAUTH = T.let(:oauth, T.nilable(Symbol)) + API_TOKEN = T.let(:api_token, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + + class Sandbox < FinchAPI::Enum + abstract! + + FINCH = T.let(:finch, T.nilable(Symbol)) + PROVIDER = T.let(:provider, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/connect/session_new_response.rbi b/rbi/lib/finch-api/models/connect/session_new_response.rbi new file mode 100644 index 00000000..9dbeb488 --- /dev/null +++ b/rbi/lib/finch-api/models/connect/session_new_response.rbi @@ -0,0 +1,33 @@ +# typed: strong + +module FinchAPI + module Models + module Connect + class SessionNewResponse < FinchAPI::BaseModel + sig { returns(String) } + def connect_url + end + + sig { params(_: String).returns(String) } + def connect_url=(_) + end + + sig { returns(String) } + def session_id + end + + sig { params(_: String).returns(String) } + def session_id=(_) + end + + sig { params(connect_url: String, session_id: String).void } + def initialize(connect_url:, session_id:) + end + + sig { override.returns({connect_url: String, session_id: String}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/connect/session_reauthenticate_params.rbi b/rbi/lib/finch-api/models/connect/session_reauthenticate_params.rbi new file mode 100644 index 00000000..582cb438 --- /dev/null +++ b/rbi/lib/finch-api/models/connect/session_reauthenticate_params.rbi @@ -0,0 +1,95 @@ +# typed: strong + +module FinchAPI + module Models + module Connect + class SessionReauthenticateParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + sig { returns(String) } + def connection_id + end + + sig { params(_: String).returns(String) } + def connection_id=(_) + end + + sig { returns(T.nilable(Integer)) } + def minutes_to_expire + end + + sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } + def minutes_to_expire=(_) + end + + sig { returns(T.nilable(T::Array[Symbol])) } + def products + end + + sig { params(_: T.nilable(T::Array[Symbol])).returns(T.nilable(T::Array[Symbol])) } + def products=(_) + end + + sig { returns(T.nilable(String)) } + def redirect_uri + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def redirect_uri=(_) + end + + sig do + params( + connection_id: String, + minutes_to_expire: T.nilable(Integer), + products: T.nilable(T::Array[Symbol]), + redirect_uri: T.nilable(String), + request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + ) + .void + end + def initialize( + connection_id:, + minutes_to_expire: nil, + products: nil, + redirect_uri: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + connection_id: String, + minutes_to_expire: T.nilable(Integer), + products: T.nilable(T::Array[Symbol]), + redirect_uri: T.nilable(String), + request_options: FinchAPI::RequestOptions + } + ) + end + def to_hash + end + + class Product < FinchAPI::Enum + abstract! + + COMPANY = :company + DIRECTORY = :directory + INDIVIDUAL = :individual + EMPLOYMENT = :employment + PAYMENT = :payment + PAY_STATEMENT = :pay_statement + BENEFITS = :benefits + SSN = :ssn + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/connect/session_reauthenticate_response.rbi b/rbi/lib/finch-api/models/connect/session_reauthenticate_response.rbi new file mode 100644 index 00000000..e7344c65 --- /dev/null +++ b/rbi/lib/finch-api/models/connect/session_reauthenticate_response.rbi @@ -0,0 +1,33 @@ +# typed: strong + +module FinchAPI + module Models + module Connect + class SessionReauthenticateResponse < FinchAPI::BaseModel + sig { returns(String) } + def connect_url + end + + sig { params(_: String).returns(String) } + def connect_url=(_) + end + + sig { returns(String) } + def session_id + end + + sig { params(_: String).returns(String) } + def session_id=(_) + end + + sig { params(connect_url: String, session_id: String).void } + def initialize(connect_url:, session_id:) + end + + sig { override.returns({connect_url: String, session_id: String}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/connection_status_type.rbi b/rbi/lib/finch-api/models/connection_status_type.rbi new file mode 100644 index 00000000..fb495a37 --- /dev/null +++ b/rbi/lib/finch-api/models/connection_status_type.rbi @@ -0,0 +1,20 @@ +# typed: strong + +module FinchAPI + module Models + class ConnectionStatusType < FinchAPI::Enum + abstract! + + PENDING = :pending + PROCESSING = :processing + CONNECTED = :connected + ERROR_NO_ACCOUNT_SETUP = :error_no_account_setup + ERROR_PERMISSIONS = :error_permissions + REAUTH = :reauth + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end +end diff --git a/rbi/lib/finch-api/models/create_access_token_response.rbi b/rbi/lib/finch-api/models/create_access_token_response.rbi new file mode 100644 index 00000000..341c7933 --- /dev/null +++ b/rbi/lib/finch-api/models/create_access_token_response.rbi @@ -0,0 +1,159 @@ +# typed: strong + +module FinchAPI + module Models + class CreateAccessTokenResponse < FinchAPI::BaseModel + sig { returns(String) } + def access_token + end + + sig { params(_: String).returns(String) } + def access_token=(_) + end + + sig { returns(String) } + def account_id + end + + sig { params(_: String).returns(String) } + def account_id=(_) + end + + sig { returns(Symbol) } + def client_type + end + + sig { params(_: Symbol).returns(Symbol) } + def client_type=(_) + end + + sig { returns(String) } + def company_id + end + + sig { params(_: String).returns(String) } + def company_id=(_) + end + + sig { returns(String) } + def connection_id + end + + sig { params(_: String).returns(String) } + def connection_id=(_) + end + + sig { returns(Symbol) } + def connection_type + end + + sig { params(_: Symbol).returns(Symbol) } + def connection_type=(_) + end + + sig { returns(T::Array[String]) } + def products + end + + sig { params(_: T::Array[String]).returns(T::Array[String]) } + def products=(_) + end + + sig { returns(String) } + def provider_id + end + + sig { params(_: String).returns(String) } + def provider_id=(_) + end + + sig { returns(T.nilable(String)) } + def customer_id + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def customer_id=(_) + end + + sig { returns(T.nilable(String)) } + def token_type + end + + sig { params(_: String).returns(String) } + def token_type=(_) + end + + sig do + params( + access_token: String, + account_id: String, + client_type: Symbol, + company_id: String, + connection_id: String, + connection_type: Symbol, + products: T::Array[String], + provider_id: String, + customer_id: T.nilable(String), + token_type: String + ) + .void + end + def initialize( + access_token:, + account_id:, + client_type:, + company_id:, + connection_id:, + connection_type:, + products:, + provider_id:, + customer_id: nil, + token_type: nil + ) + end + + sig do + override + .returns( + { + access_token: String, + account_id: String, + client_type: Symbol, + company_id: String, + connection_id: String, + connection_type: Symbol, + products: T::Array[String], + provider_id: String, + customer_id: T.nilable(String), + token_type: String + } + ) + end + def to_hash + end + + class ClientType < FinchAPI::Enum + abstract! + + PRODUCTION = :production + DEVELOPMENT = :development + SANDBOX = :sandbox + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + + class ConnectionType < FinchAPI::Enum + abstract! + + PROVIDER = :provider + FINCH = :finch + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/directory_event.rbi b/rbi/lib/finch-api/models/directory_event.rbi new file mode 100644 index 00000000..bb7e3bfb --- /dev/null +++ b/rbi/lib/finch-api/models/directory_event.rbi @@ -0,0 +1,61 @@ +# typed: strong + +module FinchAPI + module Models + class DirectoryEvent < FinchAPI::Models::BaseWebhookEvent + sig { returns(T.nilable(FinchAPI::Models::DirectoryEvent::Data)) } + def data + end + + sig { params(_: FinchAPI::Models::DirectoryEvent::Data).returns(FinchAPI::Models::DirectoryEvent::Data) } + def data=(_) + end + + sig { returns(T.nilable(Symbol)) } + def event_type + end + + sig { params(_: Symbol).returns(Symbol) } + def event_type=(_) + end + + sig { params(data: FinchAPI::Models::DirectoryEvent::Data, event_type: Symbol).void } + def initialize(data: nil, event_type: nil) + end + + sig { override.returns({data: FinchAPI::Models::DirectoryEvent::Data, event_type: Symbol}) } + def to_hash + end + + class Data < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def individual_id + end + + sig { params(_: String).returns(String) } + def individual_id=(_) + end + + sig { params(individual_id: String).void } + def initialize(individual_id: nil) + end + + sig { override.returns({individual_id: String}) } + def to_hash + end + end + + class EventType < FinchAPI::Enum + abstract! + + DIRECTORY_CREATED = :"directory.created" + DIRECTORY_UPDATED = :"directory.updated" + DIRECTORY_DELETED = :"directory.deleted" + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/disconnect_response.rbi b/rbi/lib/finch-api/models/disconnect_response.rbi new file mode 100644 index 00000000..16d35b15 --- /dev/null +++ b/rbi/lib/finch-api/models/disconnect_response.rbi @@ -0,0 +1,23 @@ +# typed: strong + +module FinchAPI + module Models + class DisconnectResponse < FinchAPI::BaseModel + sig { returns(String) } + def status + end + + sig { params(_: String).returns(String) } + def status=(_) + end + + sig { params(status: String).void } + def initialize(status:) + end + + sig { override.returns({status: String}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/finch-api/models/employment_event.rbi b/rbi/lib/finch-api/models/employment_event.rbi new file mode 100644 index 00000000..96cc16e3 --- /dev/null +++ b/rbi/lib/finch-api/models/employment_event.rbi @@ -0,0 +1,61 @@ +# typed: strong + +module FinchAPI + module Models + class EmploymentEvent < FinchAPI::Models::BaseWebhookEvent + sig { returns(T.nilable(FinchAPI::Models::EmploymentEvent::Data)) } + def data + end + + sig { params(_: FinchAPI::Models::EmploymentEvent::Data).returns(FinchAPI::Models::EmploymentEvent::Data) } + def data=(_) + end + + sig { returns(T.nilable(Symbol)) } + def event_type + end + + sig { params(_: Symbol).returns(Symbol) } + def event_type=(_) + end + + sig { params(data: FinchAPI::Models::EmploymentEvent::Data, event_type: Symbol).void } + def initialize(data: nil, event_type: nil) + end + + sig { override.returns({data: FinchAPI::Models::EmploymentEvent::Data, event_type: Symbol}) } + def to_hash + end + + class Data < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def individual_id + end + + sig { params(_: String).returns(String) } + def individual_id=(_) + end + + sig { params(individual_id: String).void } + def initialize(individual_id: nil) + end + + sig { override.returns({individual_id: String}) } + def to_hash + end + end + + class EventType < FinchAPI::Enum + abstract! + + EMPLOYMENT_CREATED = :"employment.created" + EMPLOYMENT_UPDATED = :"employment.updated" + EMPLOYMENT_DELETED = :"employment.deleted" + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/benefit_contribution.rbi b/rbi/lib/finch-api/models/hris/benefit_contribution.rbi new file mode 100644 index 00000000..6ec99ded --- /dev/null +++ b/rbi/lib/finch-api/models/hris/benefit_contribution.rbi @@ -0,0 +1,44 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + class BenefitContribution < FinchAPI::BaseModel + sig { returns(T.nilable(Integer)) } + def amount + end + + sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } + def amount=(_) + end + + sig { returns(T.nilable(Symbol)) } + def type + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def type=(_) + end + + sig { params(amount: T.nilable(Integer), type: T.nilable(Symbol)).void } + def initialize(amount: nil, type: nil) + end + + sig { override.returns({amount: T.nilable(Integer), type: T.nilable(Symbol)}) } + def to_hash + end + + class Type < FinchAPI::Enum + abstract! + + FIXED = T.let(:fixed, T.nilable(Symbol)) + PERCENT = T.let(:percent, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/benefit_create_params.rbi b/rbi/lib/finch-api/models/hris/benefit_create_params.rbi new file mode 100644 index 00000000..23bcb010 --- /dev/null +++ b/rbi/lib/finch-api/models/hris/benefit_create_params.rbi @@ -0,0 +1,62 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + class BenefitCreateParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + sig { returns(T.nilable(String)) } + def description + end + + sig { params(_: String).returns(String) } + def description=(_) + end + + sig { returns(T.nilable(Symbol)) } + def frequency + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def frequency=(_) + end + + sig { returns(T.nilable(Symbol)) } + def type + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def type=(_) + end + + sig do + params( + description: String, + frequency: T.nilable(Symbol), + type: T.nilable(Symbol), + request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + ) + .void + end + def initialize(description: nil, frequency: nil, type: nil, request_options: {}) + end + + sig do + override + .returns( + { + description: String, + frequency: T.nilable(Symbol), + type: T.nilable(Symbol), + request_options: FinchAPI::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/benefit_features_and_operations.rbi b/rbi/lib/finch-api/models/hris/benefit_features_and_operations.rbi new file mode 100644 index 00000000..6d5c8163 --- /dev/null +++ b/rbi/lib/finch-api/models/hris/benefit_features_and_operations.rbi @@ -0,0 +1,190 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + class BenefitFeaturesAndOperations < FinchAPI::BaseModel + sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures)) } + def supported_features + end + + sig do + params(_: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures) + .returns(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures) + end + def supported_features=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::HRIS::SupportPerBenefitType)) } + def supported_operations + end + + sig do + params(_: FinchAPI::Models::HRIS::SupportPerBenefitType) + .returns(FinchAPI::Models::HRIS::SupportPerBenefitType) + end + def supported_operations=(_) + end + + sig do + params( + supported_features: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures, + supported_operations: FinchAPI::Models::HRIS::SupportPerBenefitType + ) + .void + end + def initialize(supported_features: nil, supported_operations: nil) + end + + sig do + override + .returns( + { + supported_features: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures, + supported_operations: FinchAPI::Models::HRIS::SupportPerBenefitType + } + ) + end + def to_hash + end + + class SupportedFeatures < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def annual_maximum + end + + sig { params(_: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } + def annual_maximum=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def catch_up + end + + sig { params(_: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } + def catch_up=(_) + end + + sig { returns(T.nilable(T::Array[T.nilable(Symbol)])) } + def company_contribution + end + + sig do + params(_: T.nilable(T::Array[T.nilable(Symbol)])).returns(T.nilable(T::Array[T.nilable(Symbol)])) + end + def company_contribution=(_) + end + + sig { returns(T.nilable(String)) } + def description + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def description=(_) + end + + sig { returns(T.nilable(T::Array[T.nilable(Symbol)])) } + def employee_deduction + end + + sig do + params(_: T.nilable(T::Array[T.nilable(Symbol)])).returns(T.nilable(T::Array[T.nilable(Symbol)])) + end + def employee_deduction=(_) + end + + sig { returns(T.nilable(T::Array[T.nilable(Symbol)])) } + def frequencies + end + + sig { params(_: T::Array[T.nilable(Symbol)]).returns(T::Array[T.nilable(Symbol)]) } + def frequencies=(_) + end + + sig { returns(T.nilable(T::Array[T.nilable(Symbol)])) } + def hsa_contribution_limit + end + + sig do + params(_: T.nilable(T::Array[T.nilable(Symbol)])).returns(T.nilable(T::Array[T.nilable(Symbol)])) + end + def hsa_contribution_limit=(_) + end + + sig do + params( + annual_maximum: T.nilable(T::Boolean), + catch_up: T.nilable(T::Boolean), + company_contribution: T.nilable(T::Array[T.nilable(Symbol)]), + description: T.nilable(String), + employee_deduction: T.nilable(T::Array[T.nilable(Symbol)]), + frequencies: T::Array[T.nilable(Symbol)], + hsa_contribution_limit: T.nilable(T::Array[T.nilable(Symbol)]) + ) + .void + end + def initialize( + annual_maximum: nil, + catch_up: nil, + company_contribution: nil, + description: nil, + employee_deduction: nil, + frequencies: nil, + hsa_contribution_limit: nil + ) + end + + sig do + override + .returns( + { + annual_maximum: T.nilable(T::Boolean), + catch_up: T.nilable(T::Boolean), + company_contribution: T.nilable(T::Array[T.nilable(Symbol)]), + description: T.nilable(String), + employee_deduction: T.nilable(T::Array[T.nilable(Symbol)]), + frequencies: T::Array[T.nilable(Symbol)], + hsa_contribution_limit: T.nilable(T::Array[T.nilable(Symbol)]) + } + ) + end + def to_hash + end + + class CompanyContribution < FinchAPI::Enum + abstract! + + FIXED = T.let(:fixed, T.nilable(Symbol)) + PERCENT = T.let(:percent, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + + class EmployeeDeduction < FinchAPI::Enum + abstract! + + FIXED = T.let(:fixed, T.nilable(Symbol)) + PERCENT = T.let(:percent, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + + class HsaContributionLimit < FinchAPI::Enum + abstract! + + INDIVIDUAL = T.let(:individual, T.nilable(Symbol)) + FAMILY = T.let(:family, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/benefit_frequency.rbi b/rbi/lib/finch-api/models/hris/benefit_frequency.rbi new file mode 100644 index 00000000..ccd5d033 --- /dev/null +++ b/rbi/lib/finch-api/models/hris/benefit_frequency.rbi @@ -0,0 +1,19 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + class BenefitFrequency < FinchAPI::Enum + abstract! + + ONE_TIME = T.let(:one_time, T.nilable(Symbol)) + EVERY_PAYCHECK = T.let(:every_paycheck, T.nilable(Symbol)) + MONTHLY = T.let(:monthly, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/benefit_list_params.rbi b/rbi/lib/finch-api/models/hris/benefit_list_params.rbi new file mode 100644 index 00000000..90e4e917 --- /dev/null +++ b/rbi/lib/finch-api/models/hris/benefit_list_params.rbi @@ -0,0 +1,20 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + class BenefitListParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + sig { params(request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])).void } + def initialize(request_options: {}) + end + + sig { override.returns({request_options: FinchAPI::RequestOptions}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/benefit_list_supported_benefits_params.rbi b/rbi/lib/finch-api/models/hris/benefit_list_supported_benefits_params.rbi new file mode 100644 index 00000000..a37943fb --- /dev/null +++ b/rbi/lib/finch-api/models/hris/benefit_list_supported_benefits_params.rbi @@ -0,0 +1,20 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + class BenefitListSupportedBenefitsParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + sig { params(request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])).void } + def initialize(request_options: {}) + end + + sig { override.returns({request_options: FinchAPI::RequestOptions}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/benefit_retrieve_params.rbi b/rbi/lib/finch-api/models/hris/benefit_retrieve_params.rbi new file mode 100644 index 00000000..7219ab5d --- /dev/null +++ b/rbi/lib/finch-api/models/hris/benefit_retrieve_params.rbi @@ -0,0 +1,20 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + class BenefitRetrieveParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + sig { params(request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])).void } + def initialize(request_options: {}) + end + + sig { override.returns({request_options: FinchAPI::RequestOptions}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/benefit_type.rbi b/rbi/lib/finch-api/models/hris/benefit_type.rbi new file mode 100644 index 00000000..98b48853 --- /dev/null +++ b/rbi/lib/finch-api/models/hris/benefit_type.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + class BenefitType < FinchAPI::Enum + abstract! + + NUMBER_401K = T.let(:"401k", T.nilable(Symbol)) + NUMBER_401K_ROTH = T.let(:"401k_roth", T.nilable(Symbol)) + NUMBER_401K_LOAN = T.let(:"401k_loan", T.nilable(Symbol)) + NUMBER_403B = T.let(:"403b", T.nilable(Symbol)) + NUMBER_403B_ROTH = T.let(:"403b_roth", T.nilable(Symbol)) + NUMBER_457 = T.let(:"457", T.nilable(Symbol)) + NUMBER_457_ROTH = T.let(:"457_roth", T.nilable(Symbol)) + S125_MEDICAL = T.let(:s125_medical, T.nilable(Symbol)) + S125_DENTAL = T.let(:s125_dental, T.nilable(Symbol)) + S125_VISION = T.let(:s125_vision, T.nilable(Symbol)) + HSA_PRE = T.let(:hsa_pre, T.nilable(Symbol)) + HSA_POST = T.let(:hsa_post, T.nilable(Symbol)) + FSA_MEDICAL = T.let(:fsa_medical, T.nilable(Symbol)) + FSA_DEPENDENT_CARE = T.let(:fsa_dependent_care, T.nilable(Symbol)) + SIMPLE_IRA = T.let(:simple_ira, T.nilable(Symbol)) + SIMPLE = T.let(:simple, T.nilable(Symbol)) + COMMUTER = T.let(:commuter, T.nilable(Symbol)) + CUSTOM_POST_TAX = T.let(:custom_post_tax, T.nilable(Symbol)) + CUSTOM_PRE_TAX = T.let(:custom_pre_tax, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/benefit_update_params.rbi b/rbi/lib/finch-api/models/hris/benefit_update_params.rbi new file mode 100644 index 00000000..58f79cb6 --- /dev/null +++ b/rbi/lib/finch-api/models/hris/benefit_update_params.rbi @@ -0,0 +1,37 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + class BenefitUpdateParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + sig { returns(T.nilable(String)) } + def description + end + + sig { params(_: String).returns(String) } + def description=(_) + end + + sig do + params( + description: String, + request_options: T.any( + FinchAPI::RequestOptions, + T::Hash[Symbol, T.anything] + ) + ) + .void + end + def initialize(description: nil, request_options: {}) + end + + sig { override.returns({description: String, request_options: FinchAPI::RequestOptions}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/benefits/enrolled_individual.rbi b/rbi/lib/finch-api/models/hris/benefits/enrolled_individual.rbi new file mode 100644 index 00000000..d814a30e --- /dev/null +++ b/rbi/lib/finch-api/models/hris/benefits/enrolled_individual.rbi @@ -0,0 +1,115 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + module Benefits + class EnrolledIndividual < FinchAPI::BaseModel + sig { returns(T.nilable(FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Body)) } + def body + end + + sig do + params(_: FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Body) + .returns(FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Body) + end + def body=(_) + end + + sig { returns(T.nilable(Integer)) } + def code + end + + sig { params(_: Integer).returns(Integer) } + def code=(_) + end + + sig { returns(T.nilable(String)) } + def individual_id + end + + sig { params(_: String).returns(String) } + def individual_id=(_) + end + + sig do + params( + body: FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Body, + code: Integer, + individual_id: String + ) + .void + end + def initialize(body: nil, code: nil, individual_id: nil) + end + + sig do + override + .returns( + {body: FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Body, code: Integer, individual_id: String} + ) + end + def to_hash + end + + class Body < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def finch_code + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def finch_code=(_) + end + + sig { returns(T.nilable(String)) } + def message + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def message=(_) + end + + sig { returns(T.nilable(String)) } + def name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def name=(_) + end + + sig do + params(finch_code: T.nilable(String), message: T.nilable(String), name: T.nilable(String)).void + end + def initialize(finch_code: nil, message: nil, name: nil) + end + + sig do + override.returns( + { + finch_code: T.nilable(String), + message: T.nilable(String), + name: T.nilable(String) + } + ) + end + def to_hash + end + end + + class Code < FinchAPI::Enum + abstract! + + OK = 200 + CREATED = 201 + NOT_FOUND = 404 + FORBIDDEN = 403 + + sig { override.returns(T::Array[Integer]) } + def self.values + end + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/benefits/individual_benefit.rbi b/rbi/lib/finch-api/models/hris/benefits/individual_benefit.rbi new file mode 100644 index 00000000..8121a4a0 --- /dev/null +++ b/rbi/lib/finch-api/models/hris/benefits/individual_benefit.rbi @@ -0,0 +1,153 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + IndividualBenefit = T.type_alias { Benefits::IndividualBenefit } + + module Benefits + class IndividualBenefit < FinchAPI::BaseModel + sig { returns(T.nilable(FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body)) } + def body + end + + sig do + params(_: FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body) + .returns(FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body) + end + def body=(_) + end + + sig { returns(T.nilable(Integer)) } + def code + end + + sig { params(_: Integer).returns(Integer) } + def code=(_) + end + + sig { returns(T.nilable(String)) } + def individual_id + end + + sig { params(_: String).returns(String) } + def individual_id=(_) + end + + sig do + params( + body: FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body, + code: Integer, + individual_id: String + ) + .void + end + def initialize(body: nil, code: nil, individual_id: nil) + end + + sig do + override + .returns( + {body: FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body, code: Integer, individual_id: String} + ) + end + def to_hash + end + + class Body < FinchAPI::BaseModel + sig { returns(T.nilable(Integer)) } + def annual_maximum + end + + sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } + def annual_maximum=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def catch_up + end + + sig { params(_: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } + def catch_up=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitContribution)) } + def company_contribution + end + + sig do + params(_: T.nilable(FinchAPI::Models::HRIS::BenefitContribution)) + .returns(T.nilable(FinchAPI::Models::HRIS::BenefitContribution)) + end + def company_contribution=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitContribution)) } + def employee_deduction + end + + sig do + params(_: T.nilable(FinchAPI::Models::HRIS::BenefitContribution)) + .returns(T.nilable(FinchAPI::Models::HRIS::BenefitContribution)) + end + def employee_deduction=(_) + end + + sig { returns(T.nilable(Symbol)) } + def hsa_contribution_limit + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def hsa_contribution_limit=(_) + end + + sig do + params( + annual_maximum: T.nilable(Integer), + catch_up: T.nilable(T::Boolean), + company_contribution: T.nilable(FinchAPI::Models::HRIS::BenefitContribution), + employee_deduction: T.nilable(FinchAPI::Models::HRIS::BenefitContribution), + hsa_contribution_limit: T.nilable(Symbol) + ) + .void + end + def initialize( + annual_maximum: nil, + catch_up: nil, + company_contribution: nil, + employee_deduction: nil, + hsa_contribution_limit: nil + ) + end + + sig do + override + .returns( + { + annual_maximum: T.nilable(Integer), + catch_up: T.nilable(T::Boolean), + company_contribution: T.nilable(FinchAPI::Models::HRIS::BenefitContribution), + employee_deduction: T.nilable(FinchAPI::Models::HRIS::BenefitContribution), + hsa_contribution_limit: T.nilable(Symbol) + } + ) + end + def to_hash + end + + class HsaContributionLimit < FinchAPI::Enum + abstract! + + INDIVIDUAL = T.let(:individual, T.nilable(Symbol)) + FAMILY = T.let(:family, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/benefits/individual_enroll_many_params.rbi b/rbi/lib/finch-api/models/hris/benefits/individual_enroll_many_params.rbi new file mode 100644 index 00000000..a5eedd15 --- /dev/null +++ b/rbi/lib/finch-api/models/hris/benefits/individual_enroll_many_params.rbi @@ -0,0 +1,281 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + module Benefits + class IndividualEnrollManyParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + sig { returns(T.nilable(T::Array[FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual])) } + def individuals + end + + sig do + params(_: T::Array[FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual]) + .returns(T::Array[FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual]) + end + def individuals=(_) + end + + sig do + params( + individuals: T::Array[FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual], + request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + ) + .void + end + def initialize(individuals: nil, request_options: {}) + end + + sig do + override + .returns( + { + individuals: T::Array[FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual], + request_options: FinchAPI::RequestOptions + } + ) + end + def to_hash + end + + class Individual < FinchAPI::BaseModel + sig do + returns( + T.nilable(FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration) + ) + end + def configuration + end + + sig do + params(_: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration) + .returns(FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration) + end + def configuration=(_) + end + + sig { returns(T.nilable(String)) } + def individual_id + end + + sig { params(_: String).returns(String) } + def individual_id=(_) + end + + sig do + params( + configuration: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration, + individual_id: String + ) + .void + end + def initialize(configuration: nil, individual_id: nil) + end + + sig do + override + .returns( + { + configuration: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration, + individual_id: String + } + ) + end + def to_hash + end + + class Configuration < FinchAPI::BaseModel + sig { returns(T.nilable(Symbol)) } + def annual_contribution_limit + end + + sig { params(_: Symbol).returns(Symbol) } + def annual_contribution_limit=(_) + end + + sig { returns(T.nilable(Integer)) } + def annual_maximum + end + + sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } + def annual_maximum=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def catch_up + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def catch_up=(_) + end + + sig do + returns( + T.nilable( + FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution + ) + ) + end + def company_contribution + end + + sig do + params( + _: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution + ) + .returns( + FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution + ) + end + def company_contribution=(_) + end + + sig do + returns( + T.nilable( + FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction + ) + ) + end + def employee_deduction + end + + sig do + params( + _: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction + ) + .returns( + FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction + ) + end + def employee_deduction=(_) + end + + sig do + params( + annual_contribution_limit: Symbol, + annual_maximum: T.nilable(Integer), + catch_up: T::Boolean, + company_contribution: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution, + employee_deduction: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction + ) + .void + end + def initialize( + annual_contribution_limit: nil, + annual_maximum: nil, + catch_up: nil, + company_contribution: nil, + employee_deduction: nil + ) + end + + sig do + override + .returns( + { + annual_contribution_limit: Symbol, + annual_maximum: T.nilable(Integer), + catch_up: T::Boolean, + company_contribution: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution, + employee_deduction: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction + } + ) + end + def to_hash + end + + class AnnualContributionLimit < FinchAPI::Enum + abstract! + + INDIVIDUAL = :individual + FAMILY = :family + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + + class CompanyContribution < FinchAPI::BaseModel + sig { returns(T.nilable(Integer)) } + def amount + end + + sig { params(_: Integer).returns(Integer) } + def amount=(_) + end + + sig { returns(T.nilable(Symbol)) } + def type + end + + sig { params(_: Symbol).returns(Symbol) } + def type=(_) + end + + sig { params(amount: Integer, type: Symbol).void } + def initialize(amount: nil, type: nil) + end + + sig { override.returns({amount: Integer, type: Symbol}) } + def to_hash + end + + class Type < FinchAPI::Enum + abstract! + + FIXED = :fixed + PERCENT = :percent + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + + class EmployeeDeduction < FinchAPI::BaseModel + sig { returns(T.nilable(Integer)) } + def amount + end + + sig { params(_: Integer).returns(Integer) } + def amount=(_) + end + + sig { returns(T.nilable(Symbol)) } + def type + end + + sig { params(_: Symbol).returns(Symbol) } + def type=(_) + end + + sig { params(amount: Integer, type: Symbol).void } + def initialize(amount: nil, type: nil) + end + + sig { override.returns({amount: Integer, type: Symbol}) } + def to_hash + end + + class Type < FinchAPI::Enum + abstract! + + FIXED = :fixed + PERCENT = :percent + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/benefits/individual_enrolled_ids_params.rbi b/rbi/lib/finch-api/models/hris/benefits/individual_enrolled_ids_params.rbi new file mode 100644 index 00000000..9bc56fac --- /dev/null +++ b/rbi/lib/finch-api/models/hris/benefits/individual_enrolled_ids_params.rbi @@ -0,0 +1,22 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + module Benefits + class IndividualEnrolledIDsParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + sig { params(request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])).void } + def initialize(request_options: {}) + end + + sig { override.returns({request_options: FinchAPI::RequestOptions}) } + def to_hash + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/benefits/individual_enrolled_ids_response.rbi b/rbi/lib/finch-api/models/hris/benefits/individual_enrolled_ids_response.rbi new file mode 100644 index 00000000..403bd593 --- /dev/null +++ b/rbi/lib/finch-api/models/hris/benefits/individual_enrolled_ids_response.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + module Benefits + class IndividualEnrolledIDsResponse < FinchAPI::BaseModel + sig { returns(String) } + def benefit_id + end + + sig { params(_: String).returns(String) } + def benefit_id=(_) + end + + sig { returns(T::Array[String]) } + def individual_ids + end + + sig { params(_: T::Array[String]).returns(T::Array[String]) } + def individual_ids=(_) + end + + sig { params(benefit_id: String, individual_ids: T::Array[String]).void } + def initialize(benefit_id:, individual_ids:) + end + + sig { override.returns({benefit_id: String, individual_ids: T::Array[String]}) } + def to_hash + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/benefits/individual_retrieve_many_benefits_params.rbi b/rbi/lib/finch-api/models/hris/benefits/individual_retrieve_many_benefits_params.rbi new file mode 100644 index 00000000..8f9e56fa --- /dev/null +++ b/rbi/lib/finch-api/models/hris/benefits/individual_retrieve_many_benefits_params.rbi @@ -0,0 +1,36 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + module Benefits + class IndividualRetrieveManyBenefitsParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + sig { returns(T.nilable(String)) } + def individual_ids + end + + sig { params(_: String).returns(String) } + def individual_ids=(_) + end + + sig do + params( + individual_ids: String, + request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + ) + .void + end + def initialize(individual_ids: nil, request_options: {}) + end + + sig { override.returns({individual_ids: String, request_options: FinchAPI::RequestOptions}) } + def to_hash + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/benefits/individual_unenroll_many_params.rbi b/rbi/lib/finch-api/models/hris/benefits/individual_unenroll_many_params.rbi new file mode 100644 index 00000000..54f6a304 --- /dev/null +++ b/rbi/lib/finch-api/models/hris/benefits/individual_unenroll_many_params.rbi @@ -0,0 +1,38 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + module Benefits + class IndividualUnenrollManyParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + sig { returns(T.nilable(T::Array[String])) } + def individual_ids + end + + sig { params(_: T::Array[String]).returns(T::Array[String]) } + def individual_ids=(_) + end + + sig do + params( + individual_ids: T::Array[String], + request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + ) + .void + end + def initialize(individual_ids: nil, request_options: {}) + end + + sig do + override.returns({individual_ids: T::Array[String], request_options: FinchAPI::RequestOptions}) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/benefits/unenrolled_individual.rbi b/rbi/lib/finch-api/models/hris/benefits/unenrolled_individual.rbi new file mode 100644 index 00000000..dd3d1062 --- /dev/null +++ b/rbi/lib/finch-api/models/hris/benefits/unenrolled_individual.rbi @@ -0,0 +1,102 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + module Benefits + class UnenrolledIndividual < FinchAPI::BaseModel + sig { returns(T.nilable(FinchAPI::Models::HRIS::Benefits::UnenrolledIndividual::Body)) } + def body + end + + sig do + params(_: FinchAPI::Models::HRIS::Benefits::UnenrolledIndividual::Body) + .returns(FinchAPI::Models::HRIS::Benefits::UnenrolledIndividual::Body) + end + def body=(_) + end + + sig { returns(T.nilable(Integer)) } + def code + end + + sig { params(_: Integer).returns(Integer) } + def code=(_) + end + + sig { returns(T.nilable(String)) } + def individual_id + end + + sig { params(_: String).returns(String) } + def individual_id=(_) + end + + sig do + params( + body: FinchAPI::Models::HRIS::Benefits::UnenrolledIndividual::Body, + code: Integer, + individual_id: String + ) + .void + end + def initialize(body: nil, code: nil, individual_id: nil) + end + + sig do + override + .returns( + {body: FinchAPI::Models::HRIS::Benefits::UnenrolledIndividual::Body, code: Integer, individual_id: String} + ) + end + def to_hash + end + + class Body < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def finch_code + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def finch_code=(_) + end + + sig { returns(T.nilable(String)) } + def message + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def message=(_) + end + + sig { returns(T.nilable(String)) } + def name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def name=(_) + end + + sig do + params(finch_code: T.nilable(String), message: T.nilable(String), name: T.nilable(String)).void + end + def initialize(finch_code: nil, message: nil, name: nil) + end + + sig do + override.returns( + { + finch_code: T.nilable(String), + message: T.nilable(String), + name: T.nilable(String) + } + ) + end + def to_hash + end + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/benefits_support.rbi b/rbi/lib/finch-api/models/hris/benefits_support.rbi new file mode 100644 index 00000000..4bd2a008 --- /dev/null +++ b/rbi/lib/finch-api/models/hris/benefits_support.rbi @@ -0,0 +1,196 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + class BenefitsSupport < FinchAPI::BaseModel + sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) } + def commuter + end + + sig do + params(_: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) + .returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) + end + def commuter=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) } + def custom_post_tax + end + + sig do + params(_: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) + .returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) + end + def custom_post_tax=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) } + def custom_pre_tax + end + + sig do + params(_: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) + .returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) + end + def custom_pre_tax=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) } + def fsa_dependent_care + end + + sig do + params(_: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) + .returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) + end + def fsa_dependent_care=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) } + def fsa_medical + end + + sig do + params(_: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) + .returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) + end + def fsa_medical=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) } + def hsa_post + end + + sig do + params(_: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) + .returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) + end + def hsa_post=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) } + def hsa_pre + end + + sig do + params(_: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) + .returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) + end + def hsa_pre=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) } + def s125_dental + end + + sig do + params(_: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) + .returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) + end + def s125_dental=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) } + def s125_medical + end + + sig do + params(_: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) + .returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) + end + def s125_medical=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) } + def s125_vision + end + + sig do + params(_: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) + .returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) + end + def s125_vision=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) } + def simple + end + + sig do + params(_: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) + .returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) + end + def simple=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) } + def simple_ira + end + + sig do + params(_: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) + .returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) + end + def simple_ira=(_) + end + + sig do + params( + commuter: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations), + custom_post_tax: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations), + custom_pre_tax: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations), + fsa_dependent_care: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations), + fsa_medical: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations), + hsa_post: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations), + hsa_pre: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations), + s125_dental: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations), + s125_medical: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations), + s125_vision: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations), + simple: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations), + simple_ira: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations) + ) + .void + end + def initialize( + commuter: nil, + custom_post_tax: nil, + custom_pre_tax: nil, + fsa_dependent_care: nil, + fsa_medical: nil, + hsa_post: nil, + hsa_pre: nil, + s125_dental: nil, + s125_medical: nil, + s125_vision: nil, + simple: nil, + simple_ira: nil + ) + end + + sig do + override + .returns( + { + commuter: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations), + custom_post_tax: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations), + custom_pre_tax: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations), + fsa_dependent_care: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations), + fsa_medical: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations), + hsa_post: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations), + hsa_pre: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations), + s125_dental: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations), + s125_medical: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations), + s125_vision: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations), + simple: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations), + simple_ira: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations) + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/benfit_contribution.rbi b/rbi/lib/finch-api/models/hris/benfit_contribution.rbi new file mode 100644 index 00000000..19833876 --- /dev/null +++ b/rbi/lib/finch-api/models/hris/benfit_contribution.rbi @@ -0,0 +1,9 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + BenfitContribution = T.type_alias { FinchAPI::Models::HRIS::BenefitContribution } + end + end +end diff --git a/rbi/lib/finch-api/models/hris/company.rbi b/rbi/lib/finch-api/models/hris/company.rbi new file mode 100644 index 00000000..a07708a8 --- /dev/null +++ b/rbi/lib/finch-api/models/hris/company.rbi @@ -0,0 +1,338 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + class HRISCompany < FinchAPI::BaseModel + sig { returns(String) } + def id + end + + sig { params(_: String).returns(String) } + def id=(_) + end + + sig { returns(T.nilable(T::Array[FinchAPI::Models::HRIS::HRISCompany::Account])) } + def accounts + end + + sig do + params(_: T.nilable(T::Array[FinchAPI::Models::HRIS::HRISCompany::Account])) + .returns(T.nilable(T::Array[FinchAPI::Models::HRIS::HRISCompany::Account])) + end + def accounts=(_) + end + + sig { returns(T.nilable(T::Array[T.nilable(FinchAPI::Models::HRIS::HRISCompany::Department)])) } + def departments + end + + sig do + params(_: T.nilable(T::Array[T.nilable(FinchAPI::Models::HRIS::HRISCompany::Department)])) + .returns(T.nilable(T::Array[T.nilable(FinchAPI::Models::HRIS::HRISCompany::Department)])) + end + def departments=(_) + end + + sig { returns(T.nilable(String)) } + def ein + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def ein=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::HRIS::HRISCompany::Entity)) } + def entity + end + + sig do + params(_: T.nilable(FinchAPI::Models::HRIS::HRISCompany::Entity)) + .returns(T.nilable(FinchAPI::Models::HRIS::HRISCompany::Entity)) + end + def entity=(_) + end + + sig { returns(T.nilable(String)) } + def legal_name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def legal_name=(_) + end + + sig { returns(T.nilable(T::Array[T.nilable(FinchAPI::Models::Location)])) } + def locations + end + + sig do + params(_: T.nilable(T::Array[T.nilable(FinchAPI::Models::Location)])) + .returns(T.nilable(T::Array[T.nilable(FinchAPI::Models::Location)])) + end + def locations=(_) + end + + sig { returns(T.nilable(String)) } + def primary_email + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def primary_email=(_) + end + + sig { returns(T.nilable(String)) } + def primary_phone_number + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def primary_phone_number=(_) + end + + sig do + params( + id: String, + accounts: T.nilable(T::Array[FinchAPI::Models::HRIS::HRISCompany::Account]), + departments: T.nilable(T::Array[T.nilable(FinchAPI::Models::HRIS::HRISCompany::Department)]), + ein: T.nilable(String), + entity: T.nilable(FinchAPI::Models::HRIS::HRISCompany::Entity), + legal_name: T.nilable(String), + locations: T.nilable(T::Array[T.nilable(FinchAPI::Models::Location)]), + primary_email: T.nilable(String), + primary_phone_number: T.nilable(String) + ) + .void + end + def initialize( + id:, + accounts:, + departments:, + ein:, + entity:, + legal_name:, + locations:, + primary_email:, + primary_phone_number: + ) + end + + sig do + override + .returns( + { + id: String, + accounts: T.nilable(T::Array[FinchAPI::Models::HRIS::HRISCompany::Account]), + departments: T.nilable(T::Array[T.nilable(FinchAPI::Models::HRIS::HRISCompany::Department)]), + ein: T.nilable(String), + entity: T.nilable(FinchAPI::Models::HRIS::HRISCompany::Entity), + legal_name: T.nilable(String), + locations: T.nilable(T::Array[T.nilable(FinchAPI::Models::Location)]), + primary_email: T.nilable(String), + primary_phone_number: T.nilable(String) + } + ) + end + def to_hash + end + + class Account < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def account_name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def account_name=(_) + end + + sig { returns(T.nilable(String)) } + def account_number + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def account_number=(_) + end + + sig { returns(T.nilable(Symbol)) } + def account_type + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def account_type=(_) + end + + sig { returns(T.nilable(String)) } + def institution_name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def institution_name=(_) + end + + sig { returns(T.nilable(String)) } + def routing_number + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def routing_number=(_) + end + + sig do + params( + account_name: T.nilable(String), + account_number: T.nilable(String), + account_type: T.nilable(Symbol), + institution_name: T.nilable(String), + routing_number: T.nilable(String) + ) + .void + end + def initialize( + account_name: nil, + account_number: nil, + account_type: nil, + institution_name: nil, + routing_number: nil + ) + end + + sig do + override + .returns( + { + account_name: T.nilable(String), + account_number: T.nilable(String), + account_type: T.nilable(Symbol), + institution_name: T.nilable(String), + routing_number: T.nilable(String) + } + ) + end + def to_hash + end + + class AccountType < FinchAPI::Enum + abstract! + + CHECKING = T.let(:checking, T.nilable(Symbol)) + SAVINGS = T.let(:savings, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + + class Department < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def name=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::HRIS::HRISCompany::Department::Parent)) } + def parent + end + + sig do + params(_: T.nilable(FinchAPI::Models::HRIS::HRISCompany::Department::Parent)) + .returns(T.nilable(FinchAPI::Models::HRIS::HRISCompany::Department::Parent)) + end + def parent=(_) + end + + sig do + params( + name: T.nilable(String), + parent: T.nilable(FinchAPI::Models::HRIS::HRISCompany::Department::Parent) + ) + .void + end + def initialize(name: nil, parent: nil) + end + + sig do + override + .returns( + {name: T.nilable(String), parent: T.nilable(FinchAPI::Models::HRIS::HRISCompany::Department::Parent)} + ) + end + def to_hash + end + + class Parent < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def name=(_) + end + + sig { params(name: T.nilable(String)).void } + def initialize(name: nil) + end + + sig { override.returns({name: T.nilable(String)}) } + def to_hash + end + end + end + + class Entity < FinchAPI::BaseModel + sig { returns(T.nilable(Symbol)) } + def subtype + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def subtype=(_) + end + + sig { returns(T.nilable(Symbol)) } + def type + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def type=(_) + end + + sig { params(subtype: T.nilable(Symbol), type: T.nilable(Symbol)).void } + def initialize(subtype: nil, type: nil) + end + + sig { override.returns({subtype: T.nilable(Symbol), type: T.nilable(Symbol)}) } + def to_hash + end + + class Subtype < FinchAPI::Enum + abstract! + + S_CORPORATION = T.let(:s_corporation, T.nilable(Symbol)) + C_CORPORATION = T.let(:c_corporation, T.nilable(Symbol)) + B_CORPORATION = T.let(:b_corporation, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + + class Type < FinchAPI::Enum + abstract! + + LLC = T.let(:llc, T.nilable(Symbol)) + LP = T.let(:lp, T.nilable(Symbol)) + CORPORATION = T.let(:corporation, T.nilable(Symbol)) + SOLE_PROPRIETOR = T.let(:sole_proprietor, T.nilable(Symbol)) + NON_PROFIT = T.let(:non_profit, T.nilable(Symbol)) + PARTNERSHIP = T.let(:partnership, T.nilable(Symbol)) + COOPERATIVE = T.let(:cooperative, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/company_benefit.rbi b/rbi/lib/finch-api/models/hris/company_benefit.rbi new file mode 100644 index 00000000..f677e92b --- /dev/null +++ b/rbi/lib/finch-api/models/hris/company_benefit.rbi @@ -0,0 +1,67 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + class CompanyBenefit < FinchAPI::BaseModel + sig { returns(String) } + def benefit_id + end + + sig { params(_: String).returns(String) } + def benefit_id=(_) + end + + sig { returns(T.nilable(String)) } + def description + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def description=(_) + end + + sig { returns(T.nilable(Symbol)) } + def frequency + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def frequency=(_) + end + + sig { returns(T.nilable(Symbol)) } + def type + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def type=(_) + end + + sig do + params( + benefit_id: String, + description: T.nilable(String), + frequency: T.nilable(Symbol), + type: T.nilable(Symbol) + ) + .void + end + def initialize(benefit_id:, description:, frequency:, type:) + end + + sig do + override + .returns( + { + benefit_id: String, + description: T.nilable(String), + frequency: T.nilable(Symbol), + type: T.nilable(Symbol) + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/company_retrieve_params.rbi b/rbi/lib/finch-api/models/hris/company_retrieve_params.rbi new file mode 100644 index 00000000..ebbd2c49 --- /dev/null +++ b/rbi/lib/finch-api/models/hris/company_retrieve_params.rbi @@ -0,0 +1,20 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + class CompanyRetrieveParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + sig { params(request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])).void } + def initialize(request_options: {}) + end + + sig { override.returns({request_options: FinchAPI::RequestOptions}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/create_company_benefits_response.rbi b/rbi/lib/finch-api/models/hris/create_company_benefits_response.rbi new file mode 100644 index 00000000..c397c8b7 --- /dev/null +++ b/rbi/lib/finch-api/models/hris/create_company_benefits_response.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + class CreateCompanyBenefitsResponse < FinchAPI::BaseModel + sig { returns(String) } + def benefit_id + end + + sig { params(_: String).returns(String) } + def benefit_id=(_) + end + + sig { params(benefit_id: String).void } + def initialize(benefit_id:) + end + + sig { override.returns({benefit_id: String}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/directory_list_individuals_params.rbi b/rbi/lib/finch-api/models/hris/directory_list_individuals_params.rbi new file mode 100644 index 00000000..1af6722d --- /dev/null +++ b/rbi/lib/finch-api/models/hris/directory_list_individuals_params.rbi @@ -0,0 +1,43 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + class DirectoryListIndividualsParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + sig { returns(T.nilable(Integer)) } + def limit + end + + sig { params(_: Integer).returns(Integer) } + def limit=(_) + end + + sig { returns(T.nilable(Integer)) } + def offset + end + + sig { params(_: Integer).returns(Integer) } + def offset=(_) + end + + sig do + params( + limit: Integer, + offset: Integer, + request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + ) + .void + end + def initialize(limit: nil, offset: nil, request_options: {}) + end + + sig { override.returns({limit: Integer, offset: Integer, request_options: FinchAPI::RequestOptions}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/directory_list_params.rbi b/rbi/lib/finch-api/models/hris/directory_list_params.rbi new file mode 100644 index 00000000..f8dc2476 --- /dev/null +++ b/rbi/lib/finch-api/models/hris/directory_list_params.rbi @@ -0,0 +1,43 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + class DirectoryListParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + sig { returns(T.nilable(Integer)) } + def limit + end + + sig { params(_: Integer).returns(Integer) } + def limit=(_) + end + + sig { returns(T.nilable(Integer)) } + def offset + end + + sig { params(_: Integer).returns(Integer) } + def offset=(_) + end + + sig do + params( + limit: Integer, + offset: Integer, + request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + ) + .void + end + def initialize(limit: nil, offset: nil, request_options: {}) + end + + sig { override.returns({limit: Integer, offset: Integer, request_options: FinchAPI::RequestOptions}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/document_list_params.rbi b/rbi/lib/finch-api/models/hris/document_list_params.rbi new file mode 100644 index 00000000..9f8761d3 --- /dev/null +++ b/rbi/lib/finch-api/models/hris/document_list_params.rbi @@ -0,0 +1,83 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + class DocumentListParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + sig { returns(T.nilable(T::Array[String])) } + def individual_ids + end + + sig { params(_: T::Array[String]).returns(T::Array[String]) } + def individual_ids=(_) + end + + sig { returns(T.nilable(Integer)) } + def limit + end + + sig { params(_: Integer).returns(Integer) } + def limit=(_) + end + + sig { returns(T.nilable(Integer)) } + def offset + end + + sig { params(_: Integer).returns(Integer) } + def offset=(_) + end + + sig { returns(T.nilable(T::Array[Symbol])) } + def types + end + + sig { params(_: T::Array[Symbol]).returns(T::Array[Symbol]) } + def types=(_) + end + + sig do + params( + individual_ids: T::Array[String], + limit: Integer, + offset: Integer, + types: T::Array[Symbol], + request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + ) + .void + end + def initialize(individual_ids: nil, limit: nil, offset: nil, types: nil, request_options: {}) + end + + sig do + override + .returns( + { + individual_ids: T::Array[String], + limit: Integer, + offset: Integer, + types: T::Array[Symbol], + request_options: FinchAPI::RequestOptions + } + ) + end + def to_hash + end + + class Type < FinchAPI::Enum + abstract! + + W4_2020 = :w4_2020 + W4_2005 = :w4_2005 + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/document_list_response.rbi b/rbi/lib/finch-api/models/hris/document_list_response.rbi new file mode 100644 index 00000000..29a4abae --- /dev/null +++ b/rbi/lib/finch-api/models/hris/document_list_response.rbi @@ -0,0 +1,42 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + class DocumentListResponse < FinchAPI::BaseModel + sig { returns(T::Array[FinchAPI::Models::HRIS::DocumentResponse]) } + def documents + end + + sig do + params(_: T::Array[FinchAPI::Models::HRIS::DocumentResponse]) + .returns(T::Array[FinchAPI::Models::HRIS::DocumentResponse]) + end + def documents=(_) + end + + sig { returns(FinchAPI::Models::Paging) } + def paging + end + + sig { params(_: FinchAPI::Models::Paging).returns(FinchAPI::Models::Paging) } + def paging=(_) + end + + sig do + params(documents: T::Array[FinchAPI::Models::HRIS::DocumentResponse], paging: FinchAPI::Models::Paging) + .void + end + def initialize(documents:, paging:) + end + + sig do + override + .returns({documents: T::Array[FinchAPI::Models::HRIS::DocumentResponse], paging: FinchAPI::Models::Paging}) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/document_response.rbi b/rbi/lib/finch-api/models/hris/document_response.rbi new file mode 100644 index 00000000..bd3fbbf5 --- /dev/null +++ b/rbi/lib/finch-api/models/hris/document_response.rbi @@ -0,0 +1,86 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + class DocumentResponse < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def id + end + + sig { params(_: String).returns(String) } + def id=(_) + end + + sig { returns(T.nilable(String)) } + def individual_id + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def individual_id=(_) + end + + sig { returns(T.nilable(Symbol)) } + def type + end + + sig { params(_: Symbol).returns(Symbol) } + def type=(_) + end + + sig { returns(T.nilable(String)) } + def url + end + + sig { params(_: String).returns(String) } + def url=(_) + end + + sig { returns(T.nilable(Float)) } + def year + end + + sig { params(_: T.nilable(Float)).returns(T.nilable(Float)) } + def year=(_) + end + + sig do + params( + id: String, + individual_id: T.nilable(String), + type: Symbol, + url: String, + year: T.nilable(Float) + ) + .void + end + def initialize(id: nil, individual_id: nil, type: nil, url: nil, year: nil) + end + + sig do + override + .returns({ + id: String, + individual_id: T.nilable(String), + type: Symbol, + url: String, + year: T.nilable(Float) + }) + end + def to_hash + end + + class Type < FinchAPI::Enum + abstract! + + W4_2020 = :w4_2020 + W4_2005 = :w4_2005 + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/document_retreive_params.rbi b/rbi/lib/finch-api/models/hris/document_retreive_params.rbi new file mode 100644 index 00000000..ec5025f8 --- /dev/null +++ b/rbi/lib/finch-api/models/hris/document_retreive_params.rbi @@ -0,0 +1,20 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + class DocumentRetreiveParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + sig { params(request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])).void } + def initialize(request_options: {}) + end + + sig { override.returns({request_options: FinchAPI::RequestOptions}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/document_retreive_response.rbi b/rbi/lib/finch-api/models/hris/document_retreive_response.rbi new file mode 100644 index 00000000..526e6ccb --- /dev/null +++ b/rbi/lib/finch-api/models/hris/document_retreive_response.rbi @@ -0,0 +1,15 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + class DocumentRetreiveResponse < FinchAPI::Union + abstract! + + sig { override.returns([[Symbol, FinchAPI::Models::HRIS::W42020], [Symbol, FinchAPI::Models::HRIS::W42005]]) } + private_class_method def self.variants + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/employment_data.rbi b/rbi/lib/finch-api/models/hris/employment_data.rbi new file mode 100644 index 00000000..1c8c47d4 --- /dev/null +++ b/rbi/lib/finch-api/models/hris/employment_data.rbi @@ -0,0 +1,393 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + class EmploymentData < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def id + end + + sig { params(_: String).returns(String) } + def id=(_) + end + + sig { returns(T.nilable(String)) } + def class_code + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def class_code=(_) + end + + sig { returns(T.nilable(T::Array[FinchAPI::Models::HRIS::EmploymentData::CustomField])) } + def custom_fields + end + + sig do + params(_: T.nilable(T::Array[FinchAPI::Models::HRIS::EmploymentData::CustomField])) + .returns(T.nilable(T::Array[FinchAPI::Models::HRIS::EmploymentData::CustomField])) + end + def custom_fields=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::HRIS::EmploymentData::Department)) } + def department + end + + sig do + params(_: T.nilable(FinchAPI::Models::HRIS::EmploymentData::Department)) + .returns(T.nilable(FinchAPI::Models::HRIS::EmploymentData::Department)) + end + def department=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::HRIS::EmploymentData::Employment)) } + def employment + end + + sig do + params(_: T.nilable(FinchAPI::Models::HRIS::EmploymentData::Employment)) + .returns(T.nilable(FinchAPI::Models::HRIS::EmploymentData::Employment)) + end + def employment=(_) + end + + sig { returns(T.nilable(Symbol)) } + def employment_status + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def employment_status=(_) + end + + sig { returns(T.nilable(String)) } + def end_date + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def end_date=(_) + end + + sig { returns(T.nilable(String)) } + def first_name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def first_name=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Income)) } + def income + end + + sig { params(_: T.nilable(FinchAPI::Models::Income)).returns(T.nilable(FinchAPI::Models::Income)) } + def income=(_) + end + + sig { returns(T.nilable(T::Array[T.nilable(FinchAPI::Models::Income)])) } + def income_history + end + + sig do + params(_: T.nilable(T::Array[T.nilable(FinchAPI::Models::Income)])) + .returns(T.nilable(T::Array[T.nilable(FinchAPI::Models::Income)])) + end + def income_history=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def is_active + end + + sig { params(_: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } + def is_active=(_) + end + + sig { returns(T.nilable(String)) } + def last_name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def last_name=(_) + end + + sig { returns(T.nilable(String)) } + def latest_rehire_date + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def latest_rehire_date=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Location)) } + def location + end + + sig { params(_: T.nilable(FinchAPI::Models::Location)).returns(T.nilable(FinchAPI::Models::Location)) } + def location=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::HRIS::EmploymentData::Manager)) } + def manager + end + + sig do + params(_: T.nilable(FinchAPI::Models::HRIS::EmploymentData::Manager)) + .returns(T.nilable(FinchAPI::Models::HRIS::EmploymentData::Manager)) + end + def manager=(_) + end + + sig { returns(T.nilable(String)) } + def middle_name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def middle_name=(_) + end + + sig { returns(T.nilable(String)) } + def source_id + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def source_id=(_) + end + + sig { returns(T.nilable(String)) } + def start_date + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def start_date=(_) + end + + sig { returns(T.nilable(String)) } + def title + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def title=(_) + end + + sig { returns(T.nilable(String)) } + def work_id + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def work_id=(_) + end + + sig do + params( + id: String, + class_code: T.nilable(String), + custom_fields: T.nilable(T::Array[FinchAPI::Models::HRIS::EmploymentData::CustomField]), + department: T.nilable(FinchAPI::Models::HRIS::EmploymentData::Department), + employment: T.nilable(FinchAPI::Models::HRIS::EmploymentData::Employment), + employment_status: T.nilable(Symbol), + end_date: T.nilable(String), + first_name: T.nilable(String), + income: T.nilable(FinchAPI::Models::Income), + income_history: T.nilable(T::Array[T.nilable(FinchAPI::Models::Income)]), + is_active: T.nilable(T::Boolean), + last_name: T.nilable(String), + latest_rehire_date: T.nilable(String), + location: T.nilable(FinchAPI::Models::Location), + manager: T.nilable(FinchAPI::Models::HRIS::EmploymentData::Manager), + middle_name: T.nilable(String), + source_id: T.nilable(String), + start_date: T.nilable(String), + title: T.nilable(String), + work_id: T.nilable(String) + ) + .void + end + def initialize( + id: nil, + class_code: nil, + custom_fields: nil, + department: nil, + employment: nil, + employment_status: nil, + end_date: nil, + first_name: nil, + income: nil, + income_history: nil, + is_active: nil, + last_name: nil, + latest_rehire_date: nil, + location: nil, + manager: nil, + middle_name: nil, + source_id: nil, + start_date: nil, + title: nil, + work_id: nil + ) + end + + sig do + override + .returns( + { + id: String, + class_code: T.nilable(String), + custom_fields: T.nilable(T::Array[FinchAPI::Models::HRIS::EmploymentData::CustomField]), + department: T.nilable(FinchAPI::Models::HRIS::EmploymentData::Department), + employment: T.nilable(FinchAPI::Models::HRIS::EmploymentData::Employment), + employment_status: T.nilable(Symbol), + end_date: T.nilable(String), + first_name: T.nilable(String), + income: T.nilable(FinchAPI::Models::Income), + income_history: T.nilable(T::Array[T.nilable(FinchAPI::Models::Income)]), + is_active: T.nilable(T::Boolean), + last_name: T.nilable(String), + latest_rehire_date: T.nilable(String), + location: T.nilable(FinchAPI::Models::Location), + manager: T.nilable(FinchAPI::Models::HRIS::EmploymentData::Manager), + middle_name: T.nilable(String), + source_id: T.nilable(String), + start_date: T.nilable(String), + title: T.nilable(String), + work_id: T.nilable(String) + } + ) + end + def to_hash + end + + class CustomField < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def name + end + + sig { params(_: String).returns(String) } + def name=(_) + end + + sig { returns(T.nilable(T.anything)) } + def value + end + + sig { params(_: T.anything).returns(T.anything) } + def value=(_) + end + + sig { params(name: String, value: T.anything).void } + def initialize(name: nil, value: nil) + end + + sig { override.returns({name: String, value: T.anything}) } + def to_hash + end + end + + class Department < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def name=(_) + end + + sig { params(name: T.nilable(String)).void } + def initialize(name: nil) + end + + sig { override.returns({name: T.nilable(String)}) } + def to_hash + end + end + + class Employment < FinchAPI::BaseModel + sig { returns(T.nilable(Symbol)) } + def subtype + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def subtype=(_) + end + + sig { returns(T.nilable(Symbol)) } + def type + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def type=(_) + end + + sig { params(subtype: T.nilable(Symbol), type: T.nilable(Symbol)).void } + def initialize(subtype: nil, type: nil) + end + + sig { override.returns({subtype: T.nilable(Symbol), type: T.nilable(Symbol)}) } + def to_hash + end + + class Subtype < FinchAPI::Enum + abstract! + + FULL_TIME = T.let(:full_time, T.nilable(Symbol)) + INTERN = T.let(:intern, T.nilable(Symbol)) + PART_TIME = T.let(:part_time, T.nilable(Symbol)) + TEMP = T.let(:temp, T.nilable(Symbol)) + SEASONAL = T.let(:seasonal, T.nilable(Symbol)) + INDIVIDUAL_CONTRACTOR = T.let(:individual_contractor, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + + class Type < FinchAPI::Enum + abstract! + + EMPLOYEE = T.let(:employee, T.nilable(Symbol)) + CONTRACTOR = T.let(:contractor, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + + class EmploymentStatus < FinchAPI::Enum + abstract! + + ACTIVE = T.let(:active, T.nilable(Symbol)) + DECEASED = T.let(:deceased, T.nilable(Symbol)) + LEAVE = T.let(:leave, T.nilable(Symbol)) + ONBOARDING = T.let(:onboarding, T.nilable(Symbol)) + PREHIRE = T.let(:prehire, T.nilable(Symbol)) + RETIRED = T.let(:retired, T.nilable(Symbol)) + TERMINATED = T.let(:terminated, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + + class Manager < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def id + end + + sig { params(_: String).returns(String) } + def id=(_) + end + + sig { params(id: String).void } + def initialize(id: nil) + end + + sig { override.returns({id: String}) } + def to_hash + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/employment_data_response.rbi b/rbi/lib/finch-api/models/hris/employment_data_response.rbi new file mode 100644 index 00000000..90a1c460 --- /dev/null +++ b/rbi/lib/finch-api/models/hris/employment_data_response.rbi @@ -0,0 +1,41 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + class EmploymentDataResponse < FinchAPI::BaseModel + sig { returns(T.nilable(FinchAPI::Models::HRIS::EmploymentData)) } + def body + end + + sig { params(_: FinchAPI::Models::HRIS::EmploymentData).returns(FinchAPI::Models::HRIS::EmploymentData) } + def body=(_) + end + + sig { returns(T.nilable(Integer)) } + def code + end + + sig { params(_: Integer).returns(Integer) } + def code=(_) + end + + sig { returns(T.nilable(String)) } + def individual_id + end + + sig { params(_: String).returns(String) } + def individual_id=(_) + end + + sig { params(body: FinchAPI::Models::HRIS::EmploymentData, code: Integer, individual_id: String).void } + def initialize(body: nil, code: nil, individual_id: nil) + end + + sig { override.returns({body: FinchAPI::Models::HRIS::EmploymentData, code: Integer, individual_id: String}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/employment_retrieve_many_params.rbi b/rbi/lib/finch-api/models/hris/employment_retrieve_many_params.rbi new file mode 100644 index 00000000..c5609a7c --- /dev/null +++ b/rbi/lib/finch-api/models/hris/employment_retrieve_many_params.rbi @@ -0,0 +1,63 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + class EmploymentRetrieveManyParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + sig { returns(T::Array[FinchAPI::Models::HRIS::EmploymentRetrieveManyParams::Request]) } + def requests + end + + sig do + params(_: T::Array[FinchAPI::Models::HRIS::EmploymentRetrieveManyParams::Request]) + .returns(T::Array[FinchAPI::Models::HRIS::EmploymentRetrieveManyParams::Request]) + end + def requests=(_) + end + + sig do + params( + requests: T::Array[FinchAPI::Models::HRIS::EmploymentRetrieveManyParams::Request], + request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + ) + .void + end + def initialize(requests:, request_options: {}) + end + + sig do + override + .returns( + { + requests: T::Array[FinchAPI::Models::HRIS::EmploymentRetrieveManyParams::Request], + request_options: FinchAPI::RequestOptions + } + ) + end + def to_hash + end + + class Request < FinchAPI::BaseModel + sig { returns(String) } + def individual_id + end + + sig { params(_: String).returns(String) } + def individual_id=(_) + end + + sig { params(individual_id: String).void } + def initialize(individual_id:) + end + + sig { override.returns({individual_id: String}) } + def to_hash + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/individual.rbi b/rbi/lib/finch-api/models/hris/individual.rbi new file mode 100644 index 00000000..a0c7e992 --- /dev/null +++ b/rbi/lib/finch-api/models/hris/individual.rbi @@ -0,0 +1,281 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + class Individual < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def id + end + + sig { params(_: String).returns(String) } + def id=(_) + end + + sig { returns(T.nilable(String)) } + def dob + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def dob=(_) + end + + sig { returns(T.nilable(T::Array[FinchAPI::Models::HRIS::Individual::Email])) } + def emails + end + + sig do + params(_: T.nilable(T::Array[FinchAPI::Models::HRIS::Individual::Email])) + .returns(T.nilable(T::Array[FinchAPI::Models::HRIS::Individual::Email])) + end + def emails=(_) + end + + sig { returns(T.nilable(String)) } + def encrypted_ssn + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def encrypted_ssn=(_) + end + + sig { returns(T.nilable(Symbol)) } + def ethnicity + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def ethnicity=(_) + end + + sig { returns(T.nilable(String)) } + def first_name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def first_name=(_) + end + + sig { returns(T.nilable(Symbol)) } + def gender + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def gender=(_) + end + + sig { returns(T.nilable(String)) } + def last_name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def last_name=(_) + end + + sig { returns(T.nilable(String)) } + def middle_name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def middle_name=(_) + end + + sig { returns(T.nilable(T::Array[T.nilable(FinchAPI::Models::HRIS::Individual::PhoneNumber)])) } + def phone_numbers + end + + sig do + params(_: T.nilable(T::Array[T.nilable(FinchAPI::Models::HRIS::Individual::PhoneNumber)])) + .returns(T.nilable(T::Array[T.nilable(FinchAPI::Models::HRIS::Individual::PhoneNumber)])) + end + def phone_numbers=(_) + end + + sig { returns(T.nilable(String)) } + def preferred_name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def preferred_name=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Location)) } + def residence + end + + sig { params(_: T.nilable(FinchAPI::Models::Location)).returns(T.nilable(FinchAPI::Models::Location)) } + def residence=(_) + end + + sig { returns(T.nilable(String)) } + def ssn + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def ssn=(_) + end + + sig do + params( + id: String, + dob: T.nilable(String), + emails: T.nilable(T::Array[FinchAPI::Models::HRIS::Individual::Email]), + encrypted_ssn: T.nilable(String), + ethnicity: T.nilable(Symbol), + first_name: T.nilable(String), + gender: T.nilable(Symbol), + last_name: T.nilable(String), + middle_name: T.nilable(String), + phone_numbers: T.nilable(T::Array[T.nilable(FinchAPI::Models::HRIS::Individual::PhoneNumber)]), + preferred_name: T.nilable(String), + residence: T.nilable(FinchAPI::Models::Location), + ssn: T.nilable(String) + ) + .void + end + def initialize( + id: nil, + dob: nil, + emails: nil, + encrypted_ssn: nil, + ethnicity: nil, + first_name: nil, + gender: nil, + last_name: nil, + middle_name: nil, + phone_numbers: nil, + preferred_name: nil, + residence: nil, + ssn: nil + ) + end + + sig do + override + .returns( + { + id: String, + dob: T.nilable(String), + emails: T.nilable(T::Array[FinchAPI::Models::HRIS::Individual::Email]), + encrypted_ssn: T.nilable(String), + ethnicity: T.nilable(Symbol), + first_name: T.nilable(String), + gender: T.nilable(Symbol), + last_name: T.nilable(String), + middle_name: T.nilable(String), + phone_numbers: T.nilable(T::Array[T.nilable(FinchAPI::Models::HRIS::Individual::PhoneNumber)]), + preferred_name: T.nilable(String), + residence: T.nilable(FinchAPI::Models::Location), + ssn: T.nilable(String) + } + ) + end + def to_hash + end + + class Email < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def data + end + + sig { params(_: String).returns(String) } + def data=(_) + end + + sig { returns(T.nilable(Symbol)) } + def type + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def type=(_) + end + + sig { params(data: String, type: T.nilable(Symbol)).void } + def initialize(data: nil, type: nil) + end + + sig { override.returns({data: String, type: T.nilable(Symbol)}) } + def to_hash + end + + class Type < FinchAPI::Enum + abstract! + + WORK = T.let(:work, T.nilable(Symbol)) + PERSONAL = T.let(:personal, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + + class Ethnicity < FinchAPI::Enum + abstract! + + ASIAN = T.let(:asian, T.nilable(Symbol)) + WHITE = T.let(:white, T.nilable(Symbol)) + BLACK_OR_AFRICAN_AMERICAN = T.let(:black_or_african_american, T.nilable(Symbol)) + NATIVE_HAWAIIAN_OR_PACIFIC_ISLANDER = T.let(:native_hawaiian_or_pacific_islander, T.nilable(Symbol)) + AMERICAN_INDIAN_OR_ALASKA_NATIVE = T.let(:american_indian_or_alaska_native, T.nilable(Symbol)) + HISPANIC_OR_LATINO = T.let(:hispanic_or_latino, T.nilable(Symbol)) + TWO_OR_MORE_RACES = T.let(:two_or_more_races, T.nilable(Symbol)) + DECLINE_TO_SPECIFY = T.let(:decline_to_specify, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + + class Gender < FinchAPI::Enum + abstract! + + FEMALE = T.let(:female, T.nilable(Symbol)) + MALE = T.let(:male, T.nilable(Symbol)) + OTHER = T.let(:other, T.nilable(Symbol)) + DECLINE_TO_SPECIFY = T.let(:decline_to_specify, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + + class PhoneNumber < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def data + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def data=(_) + end + + sig { returns(T.nilable(Symbol)) } + def type + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def type=(_) + end + + sig { params(data: T.nilable(String), type: T.nilable(Symbol)).void } + def initialize(data: nil, type: nil) + end + + sig { override.returns({data: T.nilable(String), type: T.nilable(Symbol)}) } + def to_hash + end + + class Type < FinchAPI::Enum + abstract! + + WORK = T.let(:work, T.nilable(Symbol)) + PERSONAL = T.let(:personal, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/individual_in_directory.rbi b/rbi/lib/finch-api/models/hris/individual_in_directory.rbi new file mode 100644 index 00000000..1ca71c73 --- /dev/null +++ b/rbi/lib/finch-api/models/hris/individual_in_directory.rbi @@ -0,0 +1,147 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + class IndividualInDirectory < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def id + end + + sig { params(_: String).returns(String) } + def id=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::HRIS::IndividualInDirectory::Department)) } + def department + end + + sig do + params(_: T.nilable(FinchAPI::Models::HRIS::IndividualInDirectory::Department)) + .returns(T.nilable(FinchAPI::Models::HRIS::IndividualInDirectory::Department)) + end + def department=(_) + end + + sig { returns(T.nilable(String)) } + def first_name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def first_name=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def is_active + end + + sig { params(_: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } + def is_active=(_) + end + + sig { returns(T.nilable(String)) } + def last_name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def last_name=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::HRIS::IndividualInDirectory::Manager)) } + def manager + end + + sig do + params(_: T.nilable(FinchAPI::Models::HRIS::IndividualInDirectory::Manager)) + .returns(T.nilable(FinchAPI::Models::HRIS::IndividualInDirectory::Manager)) + end + def manager=(_) + end + + sig { returns(T.nilable(String)) } + def middle_name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def middle_name=(_) + end + + sig do + params( + id: String, + department: T.nilable(FinchAPI::Models::HRIS::IndividualInDirectory::Department), + first_name: T.nilable(String), + is_active: T.nilable(T::Boolean), + last_name: T.nilable(String), + manager: T.nilable(FinchAPI::Models::HRIS::IndividualInDirectory::Manager), + middle_name: T.nilable(String) + ) + .void + end + def initialize( + id: nil, + department: nil, + first_name: nil, + is_active: nil, + last_name: nil, + manager: nil, + middle_name: nil + ) + end + + sig do + override + .returns( + { + id: String, + department: T.nilable(FinchAPI::Models::HRIS::IndividualInDirectory::Department), + first_name: T.nilable(String), + is_active: T.nilable(T::Boolean), + last_name: T.nilable(String), + manager: T.nilable(FinchAPI::Models::HRIS::IndividualInDirectory::Manager), + middle_name: T.nilable(String) + } + ) + end + def to_hash + end + + class Department < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def name=(_) + end + + sig { params(name: T.nilable(String)).void } + def initialize(name: nil) + end + + sig { override.returns({name: T.nilable(String)}) } + def to_hash + end + end + + class Manager < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def id + end + + sig { params(_: String).returns(String) } + def id=(_) + end + + sig { params(id: String).void } + def initialize(id: nil) + end + + sig { override.returns({id: String}) } + def to_hash + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/individual_response.rbi b/rbi/lib/finch-api/models/hris/individual_response.rbi new file mode 100644 index 00000000..3f4d6195 --- /dev/null +++ b/rbi/lib/finch-api/models/hris/individual_response.rbi @@ -0,0 +1,41 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + class IndividualResponse < FinchAPI::BaseModel + sig { returns(T.nilable(FinchAPI::Models::HRIS::Individual)) } + def body + end + + sig { params(_: FinchAPI::Models::HRIS::Individual).returns(FinchAPI::Models::HRIS::Individual) } + def body=(_) + end + + sig { returns(T.nilable(Integer)) } + def code + end + + sig { params(_: Integer).returns(Integer) } + def code=(_) + end + + sig { returns(T.nilable(String)) } + def individual_id + end + + sig { params(_: String).returns(String) } + def individual_id=(_) + end + + sig { params(body: FinchAPI::Models::HRIS::Individual, code: Integer, individual_id: String).void } + def initialize(body: nil, code: nil, individual_id: nil) + end + + sig { override.returns({body: FinchAPI::Models::HRIS::Individual, code: Integer, individual_id: String}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/individual_retrieve_many_params.rbi b/rbi/lib/finch-api/models/hris/individual_retrieve_many_params.rbi new file mode 100644 index 00000000..b0d55cf0 --- /dev/null +++ b/rbi/lib/finch-api/models/hris/individual_retrieve_many_params.rbi @@ -0,0 +1,94 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + class IndividualRetrieveManyParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + sig { returns(T.nilable(FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Options)) } + def options + end + + sig do + params(_: T.nilable(FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Options)) + .returns(T.nilable(FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Options)) + end + def options=(_) + end + + sig { returns(T.nilable(T::Array[FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Request])) } + def requests + end + + sig do + params(_: T::Array[FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Request]) + .returns(T::Array[FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Request]) + end + def requests=(_) + end + + sig do + params( + options: T.nilable(FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Options), + requests: T::Array[FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Request], + request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + ) + .void + end + def initialize(options: nil, requests: nil, request_options: {}) + end + + sig do + override + .returns( + { + options: T.nilable(FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Options), + requests: T::Array[FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Request], + request_options: FinchAPI::RequestOptions + } + ) + end + def to_hash + end + + class Options < FinchAPI::BaseModel + sig { returns(T.nilable(T::Array[String])) } + def include + end + + sig { params(_: T::Array[String]).returns(T::Array[String]) } + def include=(_) + end + + sig { params(include: T::Array[String]).void } + def initialize(include: nil) + end + + sig { override.returns({include: T::Array[String]}) } + def to_hash + end + end + + class Request < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def individual_id + end + + sig { params(_: String).returns(String) } + def individual_id=(_) + end + + sig { params(individual_id: String).void } + def initialize(individual_id: nil) + end + + sig { override.returns({individual_id: String}) } + def to_hash + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/pay_statement.rbi b/rbi/lib/finch-api/models/hris/pay_statement.rbi new file mode 100644 index 00000000..8f17bf18 --- /dev/null +++ b/rbi/lib/finch-api/models/hris/pay_statement.rbi @@ -0,0 +1,691 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + class PayStatement < FinchAPI::BaseModel + sig { returns(T.nilable(T::Array[T.nilable(FinchAPI::Models::HRIS::PayStatement::Earning)])) } + def earnings + end + + sig do + params(_: T.nilable(T::Array[T.nilable(FinchAPI::Models::HRIS::PayStatement::Earning)])) + .returns(T.nilable(T::Array[T.nilable(FinchAPI::Models::HRIS::PayStatement::Earning)])) + end + def earnings=(_) + end + + sig { returns(T.nilable(T::Array[T.nilable(FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction)])) } + def employee_deductions + end + + sig do + params(_: T.nilable(T::Array[T.nilable(FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction)])) + .returns(T.nilable(T::Array[T.nilable(FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction)])) + end + def employee_deductions=(_) + end + + sig { returns(T.nilable(T::Array[T.nilable(FinchAPI::Models::HRIS::PayStatement::EmployerContribution)])) } + def employer_contributions + end + + sig do + params(_: T.nilable(T::Array[T.nilable(FinchAPI::Models::HRIS::PayStatement::EmployerContribution)])) + .returns(T.nilable(T::Array[T.nilable(FinchAPI::Models::HRIS::PayStatement::EmployerContribution)])) + end + def employer_contributions=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Money)) } + def gross_pay + end + + sig { params(_: T.nilable(FinchAPI::Models::Money)).returns(T.nilable(FinchAPI::Models::Money)) } + def gross_pay=(_) + end + + sig { returns(T.nilable(String)) } + def individual_id + end + + sig { params(_: String).returns(String) } + def individual_id=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Money)) } + def net_pay + end + + sig { params(_: T.nilable(FinchAPI::Models::Money)).returns(T.nilable(FinchAPI::Models::Money)) } + def net_pay=(_) + end + + sig { returns(T.nilable(Symbol)) } + def payment_method + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def payment_method=(_) + end + + sig { returns(T.nilable(T::Array[T.nilable(FinchAPI::Models::HRIS::PayStatement::Tax)])) } + def taxes + end + + sig do + params(_: T.nilable(T::Array[T.nilable(FinchAPI::Models::HRIS::PayStatement::Tax)])) + .returns(T.nilable(T::Array[T.nilable(FinchAPI::Models::HRIS::PayStatement::Tax)])) + end + def taxes=(_) + end + + sig { returns(T.nilable(Float)) } + def total_hours + end + + sig { params(_: T.nilable(Float)).returns(T.nilable(Float)) } + def total_hours=(_) + end + + sig { returns(T.nilable(Symbol)) } + def type + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def type=(_) + end + + sig do + params( + earnings: T.nilable(T::Array[T.nilable(FinchAPI::Models::HRIS::PayStatement::Earning)]), + employee_deductions: T.nilable(T::Array[T.nilable(FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction)]), + employer_contributions: T.nilable(T::Array[T.nilable(FinchAPI::Models::HRIS::PayStatement::EmployerContribution)]), + gross_pay: T.nilable(FinchAPI::Models::Money), + individual_id: String, + net_pay: T.nilable(FinchAPI::Models::Money), + payment_method: T.nilable(Symbol), + taxes: T.nilable(T::Array[T.nilable(FinchAPI::Models::HRIS::PayStatement::Tax)]), + total_hours: T.nilable(Float), + type: T.nilable(Symbol) + ) + .void + end + def initialize( + earnings: nil, + employee_deductions: nil, + employer_contributions: nil, + gross_pay: nil, + individual_id: nil, + net_pay: nil, + payment_method: nil, + taxes: nil, + total_hours: nil, + type: nil + ) + end + + sig do + override + .returns( + { + earnings: T.nilable(T::Array[T.nilable(FinchAPI::Models::HRIS::PayStatement::Earning)]), + employee_deductions: T.nilable(T::Array[T.nilable(FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction)]), + employer_contributions: T.nilable(T::Array[T.nilable(FinchAPI::Models::HRIS::PayStatement::EmployerContribution)]), + gross_pay: T.nilable(FinchAPI::Models::Money), + individual_id: String, + net_pay: T.nilable(FinchAPI::Models::Money), + payment_method: T.nilable(Symbol), + taxes: T.nilable(T::Array[T.nilable(FinchAPI::Models::HRIS::PayStatement::Tax)]), + total_hours: T.nilable(Float), + type: T.nilable(Symbol) + } + ) + end + def to_hash + end + + class Earning < FinchAPI::BaseModel + sig { returns(T.nilable(Integer)) } + def amount + end + + sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } + def amount=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::HRIS::PayStatement::Earning::Attributes)) } + def attributes + end + + sig do + params(_: T.nilable(FinchAPI::Models::HRIS::PayStatement::Earning::Attributes)) + .returns(T.nilable(FinchAPI::Models::HRIS::PayStatement::Earning::Attributes)) + end + def attributes=(_) + end + + sig { returns(T.nilable(String)) } + def currency + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def currency=(_) + end + + sig { returns(T.nilable(Float)) } + def hours + end + + sig { params(_: T.nilable(Float)).returns(T.nilable(Float)) } + def hours=(_) + end + + sig { returns(T.nilable(String)) } + def name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def name=(_) + end + + sig { returns(T.nilable(Symbol)) } + def type + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def type=(_) + end + + sig do + params( + amount: T.nilable(Integer), + attributes: T.nilable(FinchAPI::Models::HRIS::PayStatement::Earning::Attributes), + currency: T.nilable(String), + hours: T.nilable(Float), + name: T.nilable(String), + type: T.nilable(Symbol) + ) + .void + end + def initialize(amount: nil, attributes: nil, currency: nil, hours: nil, name: nil, type: nil) + end + + sig do + override + .returns( + { + amount: T.nilable(Integer), + attributes: T.nilable(FinchAPI::Models::HRIS::PayStatement::Earning::Attributes), + currency: T.nilable(String), + hours: T.nilable(Float), + name: T.nilable(String), + type: T.nilable(Symbol) + } + ) + end + def to_hash + end + + class Attributes < FinchAPI::BaseModel + sig { returns(T.nilable(FinchAPI::Models::HRIS::PayStatement::Earning::Attributes::Metadata)) } + def metadata + end + + sig do + params(_: FinchAPI::Models::HRIS::PayStatement::Earning::Attributes::Metadata) + .returns(FinchAPI::Models::HRIS::PayStatement::Earning::Attributes::Metadata) + end + def metadata=(_) + end + + sig { params(metadata: FinchAPI::Models::HRIS::PayStatement::Earning::Attributes::Metadata).void } + def initialize(metadata: nil) + end + + sig { override.returns({metadata: FinchAPI::Models::HRIS::PayStatement::Earning::Attributes::Metadata}) } + def to_hash + end + + class Metadata < FinchAPI::BaseModel + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + def metadata + end + + sig { params(_: T::Hash[Symbol, T.anything]).returns(T::Hash[Symbol, T.anything]) } + def metadata=(_) + end + + sig { params(metadata: T::Hash[Symbol, T.anything]).void } + def initialize(metadata: nil) + end + + sig { override.returns({metadata: T::Hash[Symbol, T.anything]}) } + def to_hash + end + end + end + + class Type < FinchAPI::Enum + abstract! + + SALARY = T.let(:salary, T.nilable(Symbol)) + WAGE = T.let(:wage, T.nilable(Symbol)) + REIMBURSEMENT = T.let(:reimbursement, T.nilable(Symbol)) + OVERTIME = T.let(:overtime, T.nilable(Symbol)) + SEVERANCE = T.let(:severance, T.nilable(Symbol)) + DOUBLE_OVERTIME = T.let(:double_overtime, T.nilable(Symbol)) + PTO = T.let(:pto, T.nilable(Symbol)) + SICK = T.let(:sick, T.nilable(Symbol)) + BONUS = T.let(:bonus, T.nilable(Symbol)) + COMMISSION = T.let(:commission, T.nilable(Symbol)) + TIPS = T.let(:tips, T.nilable(Symbol)) + NUMBER_1099 = T.let(:"1099", T.nilable(Symbol)) + OTHER = T.let(:other, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + + class EmployeeDeduction < FinchAPI::BaseModel + sig { returns(T.nilable(Integer)) } + def amount + end + + sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } + def amount=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes)) } + def attributes + end + + sig do + params(_: T.nilable(FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes)) + .returns(T.nilable(FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes)) + end + def attributes=(_) + end + + sig { returns(T.nilable(String)) } + def currency + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def currency=(_) + end + + sig { returns(T.nilable(String)) } + def name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def name=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def pre_tax + end + + sig { params(_: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } + def pre_tax=(_) + end + + sig { returns(T.nilable(Symbol)) } + def type + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def type=(_) + end + + sig do + params( + amount: T.nilable(Integer), + attributes: T.nilable(FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes), + currency: T.nilable(String), + name: T.nilable(String), + pre_tax: T.nilable(T::Boolean), + type: T.nilable(Symbol) + ) + .void + end + def initialize(amount: nil, attributes: nil, currency: nil, name: nil, pre_tax: nil, type: nil) + end + + sig do + override + .returns( + { + amount: T.nilable(Integer), + attributes: T.nilable(FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes), + currency: T.nilable(String), + name: T.nilable(String), + pre_tax: T.nilable(T::Boolean), + type: T.nilable(Symbol) + } + ) + end + def to_hash + end + + class Attributes < FinchAPI::BaseModel + sig { returns(T.nilable(FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes::Metadata)) } + def metadata + end + + sig do + params(_: FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes::Metadata) + .returns(FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes::Metadata) + end + def metadata=(_) + end + + sig { params(metadata: FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes::Metadata).void } + def initialize(metadata: nil) + end + + sig do + override.returns({metadata: FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes::Metadata}) + end + def to_hash + end + + class Metadata < FinchAPI::BaseModel + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + def metadata + end + + sig { params(_: T::Hash[Symbol, T.anything]).returns(T::Hash[Symbol, T.anything]) } + def metadata=(_) + end + + sig { params(metadata: T::Hash[Symbol, T.anything]).void } + def initialize(metadata: nil) + end + + sig { override.returns({metadata: T::Hash[Symbol, T.anything]}) } + def to_hash + end + end + end + end + + class EmployerContribution < FinchAPI::BaseModel + sig { returns(T.nilable(Integer)) } + def amount + end + + sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } + def amount=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes)) } + def attributes + end + + sig do + params(_: T.nilable(FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes)) + .returns(T.nilable(FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes)) + end + def attributes=(_) + end + + sig { returns(T.nilable(String)) } + def currency + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def currency=(_) + end + + sig { returns(T.nilable(String)) } + def name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def name=(_) + end + + sig { returns(T.nilable(Symbol)) } + def type + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def type=(_) + end + + sig do + params( + amount: T.nilable(Integer), + attributes: T.nilable(FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes), + currency: T.nilable(String), + name: T.nilable(String), + type: T.nilable(Symbol) + ) + .void + end + def initialize(amount: nil, attributes: nil, currency: nil, name: nil, type: nil) + end + + sig do + override + .returns( + { + amount: T.nilable(Integer), + attributes: T.nilable(FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes), + currency: T.nilable(String), + name: T.nilable(String), + type: T.nilable(Symbol) + } + ) + end + def to_hash + end + + class Attributes < FinchAPI::BaseModel + sig { returns(T.nilable(FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes::Metadata)) } + def metadata + end + + sig do + params(_: FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes::Metadata) + .returns(FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes::Metadata) + end + def metadata=(_) + end + + sig { params(metadata: FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes::Metadata).void } + def initialize(metadata: nil) + end + + sig do + override + .returns({metadata: FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes::Metadata}) + end + def to_hash + end + + class Metadata < FinchAPI::BaseModel + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + def metadata + end + + sig { params(_: T::Hash[Symbol, T.anything]).returns(T::Hash[Symbol, T.anything]) } + def metadata=(_) + end + + sig { params(metadata: T::Hash[Symbol, T.anything]).void } + def initialize(metadata: nil) + end + + sig { override.returns({metadata: T::Hash[Symbol, T.anything]}) } + def to_hash + end + end + end + end + + class PaymentMethod < FinchAPI::Enum + abstract! + + CHECK = T.let(:check, T.nilable(Symbol)) + DIRECT_DEPOSIT = T.let(:direct_deposit, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + + class Tax < FinchAPI::BaseModel + sig { returns(T.nilable(Integer)) } + def amount + end + + sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } + def amount=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::HRIS::PayStatement::Tax::Attributes)) } + def attributes + end + + sig do + params(_: T.nilable(FinchAPI::Models::HRIS::PayStatement::Tax::Attributes)) + .returns(T.nilable(FinchAPI::Models::HRIS::PayStatement::Tax::Attributes)) + end + def attributes=(_) + end + + sig { returns(T.nilable(String)) } + def currency + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def currency=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def employer + end + + sig { params(_: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } + def employer=(_) + end + + sig { returns(T.nilable(String)) } + def name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def name=(_) + end + + sig { returns(T.nilable(Symbol)) } + def type + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def type=(_) + end + + sig do + params( + amount: T.nilable(Integer), + attributes: T.nilable(FinchAPI::Models::HRIS::PayStatement::Tax::Attributes), + currency: T.nilable(String), + employer: T.nilable(T::Boolean), + name: T.nilable(String), + type: T.nilable(Symbol) + ) + .void + end + def initialize(amount: nil, attributes: nil, currency: nil, employer: nil, name: nil, type: nil) + end + + sig do + override + .returns( + { + amount: T.nilable(Integer), + attributes: T.nilable(FinchAPI::Models::HRIS::PayStatement::Tax::Attributes), + currency: T.nilable(String), + employer: T.nilable(T::Boolean), + name: T.nilable(String), + type: T.nilable(Symbol) + } + ) + end + def to_hash + end + + class Attributes < FinchAPI::BaseModel + sig { returns(T.nilable(FinchAPI::Models::HRIS::PayStatement::Tax::Attributes::Metadata)) } + def metadata + end + + sig do + params(_: FinchAPI::Models::HRIS::PayStatement::Tax::Attributes::Metadata) + .returns(FinchAPI::Models::HRIS::PayStatement::Tax::Attributes::Metadata) + end + def metadata=(_) + end + + sig { params(metadata: FinchAPI::Models::HRIS::PayStatement::Tax::Attributes::Metadata).void } + def initialize(metadata: nil) + end + + sig { override.returns({metadata: FinchAPI::Models::HRIS::PayStatement::Tax::Attributes::Metadata}) } + def to_hash + end + + class Metadata < FinchAPI::BaseModel + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + def metadata + end + + sig { params(_: T::Hash[Symbol, T.anything]).returns(T::Hash[Symbol, T.anything]) } + def metadata=(_) + end + + sig { params(metadata: T::Hash[Symbol, T.anything]).void } + def initialize(metadata: nil) + end + + sig { override.returns({metadata: T::Hash[Symbol, T.anything]}) } + def to_hash + end + end + end + + class Type < FinchAPI::Enum + abstract! + + STATE = T.let(:state, T.nilable(Symbol)) + FEDERAL = T.let(:federal, T.nilable(Symbol)) + LOCAL = T.let(:local, T.nilable(Symbol)) + FICA = T.let(:fica, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + + class Type < FinchAPI::Enum + abstract! + + REGULAR_PAYROLL = T.let(:regular_payroll, T.nilable(Symbol)) + OFF_CYCLE_PAYROLL = T.let(:off_cycle_payroll, T.nilable(Symbol)) + ONE_TIME_PAYMENT = T.let(:one_time_payment, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/pay_statement_response.rbi b/rbi/lib/finch-api/models/hris/pay_statement_response.rbi new file mode 100644 index 00000000..53e22ac0 --- /dev/null +++ b/rbi/lib/finch-api/models/hris/pay_statement_response.rbi @@ -0,0 +1,47 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + class PayStatementResponse < FinchAPI::BaseModel + sig { returns(T.nilable(FinchAPI::Models::HRIS::PayStatementResponseBody)) } + def body + end + + sig do + params(_: FinchAPI::Models::HRIS::PayStatementResponseBody) + .returns(FinchAPI::Models::HRIS::PayStatementResponseBody) + end + def body=(_) + end + + sig { returns(T.nilable(Integer)) } + def code + end + + sig { params(_: Integer).returns(Integer) } + def code=(_) + end + + sig { returns(T.nilable(String)) } + def payment_id + end + + sig { params(_: String).returns(String) } + def payment_id=(_) + end + + sig { params(body: FinchAPI::Models::HRIS::PayStatementResponseBody, code: Integer, payment_id: String).void } + def initialize(body: nil, code: nil, payment_id: nil) + end + + sig do + override + .returns({body: FinchAPI::Models::HRIS::PayStatementResponseBody, code: Integer, payment_id: String}) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/pay_statement_response_body.rbi b/rbi/lib/finch-api/models/hris/pay_statement_response_body.rbi new file mode 100644 index 00000000..7a7a8f37 --- /dev/null +++ b/rbi/lib/finch-api/models/hris/pay_statement_response_body.rbi @@ -0,0 +1,44 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + class PayStatementResponseBody < FinchAPI::BaseModel + sig { returns(T.nilable(FinchAPI::Models::Paging)) } + def paging + end + + sig { params(_: FinchAPI::Models::Paging).returns(FinchAPI::Models::Paging) } + def paging=(_) + end + + sig { returns(T.nilable(T::Array[FinchAPI::Models::HRIS::PayStatement])) } + def pay_statements + end + + sig do + params(_: T::Array[FinchAPI::Models::HRIS::PayStatement]) + .returns(T::Array[FinchAPI::Models::HRIS::PayStatement]) + end + def pay_statements=(_) + end + + sig do + params(paging: FinchAPI::Models::Paging, pay_statements: T::Array[FinchAPI::Models::HRIS::PayStatement]) + .void + end + def initialize(paging: nil, pay_statements: nil) + end + + sig do + override + .returns( + {paging: FinchAPI::Models::Paging, pay_statements: T::Array[FinchAPI::Models::HRIS::PayStatement]} + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/pay_statement_retrieve_many_params.rbi b/rbi/lib/finch-api/models/hris/pay_statement_retrieve_many_params.rbi new file mode 100644 index 00000000..fae3af84 --- /dev/null +++ b/rbi/lib/finch-api/models/hris/pay_statement_retrieve_many_params.rbi @@ -0,0 +1,79 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + class PayStatementRetrieveManyParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + sig { returns(T::Array[FinchAPI::Models::HRIS::PayStatementRetrieveManyParams::Request]) } + def requests + end + + sig do + params(_: T::Array[FinchAPI::Models::HRIS::PayStatementRetrieveManyParams::Request]) + .returns(T::Array[FinchAPI::Models::HRIS::PayStatementRetrieveManyParams::Request]) + end + def requests=(_) + end + + sig do + params( + requests: T::Array[FinchAPI::Models::HRIS::PayStatementRetrieveManyParams::Request], + request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + ) + .void + end + def initialize(requests:, request_options: {}) + end + + sig do + override + .returns( + { + requests: T::Array[FinchAPI::Models::HRIS::PayStatementRetrieveManyParams::Request], + request_options: FinchAPI::RequestOptions + } + ) + end + def to_hash + end + + class Request < FinchAPI::BaseModel + sig { returns(String) } + def payment_id + end + + sig { params(_: String).returns(String) } + def payment_id=(_) + end + + sig { returns(T.nilable(Integer)) } + def limit + end + + sig { params(_: Integer).returns(Integer) } + def limit=(_) + end + + sig { returns(T.nilable(Integer)) } + def offset + end + + sig { params(_: Integer).returns(Integer) } + def offset=(_) + end + + sig { params(payment_id: String, limit: Integer, offset: Integer).void } + def initialize(payment_id:, limit: nil, offset: nil) + end + + sig { override.returns({payment_id: String, limit: Integer, offset: Integer}) } + def to_hash + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/payment.rbi b/rbi/lib/finch-api/models/hris/payment.rbi new file mode 100644 index 00000000..600beb6f --- /dev/null +++ b/rbi/lib/finch-api/models/hris/payment.rbi @@ -0,0 +1,207 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + class Payment < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def id + end + + sig { params(_: String).returns(String) } + def id=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Money)) } + def company_debit + end + + sig { params(_: T.nilable(FinchAPI::Models::Money)).returns(T.nilable(FinchAPI::Models::Money)) } + def company_debit=(_) + end + + sig { returns(T.nilable(String)) } + def debit_date + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def debit_date=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Money)) } + def employee_taxes + end + + sig { params(_: T.nilable(FinchAPI::Models::Money)).returns(T.nilable(FinchAPI::Models::Money)) } + def employee_taxes=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Money)) } + def employer_taxes + end + + sig { params(_: T.nilable(FinchAPI::Models::Money)).returns(T.nilable(FinchAPI::Models::Money)) } + def employer_taxes=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Money)) } + def gross_pay + end + + sig { params(_: T.nilable(FinchAPI::Models::Money)).returns(T.nilable(FinchAPI::Models::Money)) } + def gross_pay=(_) + end + + sig { returns(T.nilable(T::Array[String])) } + def individual_ids + end + + sig { params(_: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) } + def individual_ids=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Money)) } + def net_pay + end + + sig { params(_: T.nilable(FinchAPI::Models::Money)).returns(T.nilable(FinchAPI::Models::Money)) } + def net_pay=(_) + end + + sig { returns(T.nilable(String)) } + def pay_date + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def pay_date=(_) + end + + sig { returns(T.nilable(T::Array[Symbol])) } + def pay_frequencies + end + + sig { params(_: T.nilable(T::Array[Symbol])).returns(T.nilable(T::Array[Symbol])) } + def pay_frequencies=(_) + end + + sig { returns(T.nilable(T::Array[String])) } + def pay_group_ids + end + + sig { params(_: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) } + def pay_group_ids=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::HRIS::Payment::PayPeriod)) } + def pay_period + end + + sig do + params(_: T.nilable(FinchAPI::Models::HRIS::Payment::PayPeriod)) + .returns(T.nilable(FinchAPI::Models::HRIS::Payment::PayPeriod)) + end + def pay_period=(_) + end + + sig do + params( + id: String, + company_debit: T.nilable(FinchAPI::Models::Money), + debit_date: T.nilable(String), + employee_taxes: T.nilable(FinchAPI::Models::Money), + employer_taxes: T.nilable(FinchAPI::Models::Money), + gross_pay: T.nilable(FinchAPI::Models::Money), + individual_ids: T.nilable(T::Array[String]), + net_pay: T.nilable(FinchAPI::Models::Money), + pay_date: T.nilable(String), + pay_frequencies: T.nilable(T::Array[Symbol]), + pay_group_ids: T.nilable(T::Array[String]), + pay_period: T.nilable(FinchAPI::Models::HRIS::Payment::PayPeriod) + ) + .void + end + def initialize( + id: nil, + company_debit: nil, + debit_date: nil, + employee_taxes: nil, + employer_taxes: nil, + gross_pay: nil, + individual_ids: nil, + net_pay: nil, + pay_date: nil, + pay_frequencies: nil, + pay_group_ids: nil, + pay_period: nil + ) + end + + sig do + override + .returns( + { + id: String, + company_debit: T.nilable(FinchAPI::Models::Money), + debit_date: T.nilable(String), + employee_taxes: T.nilable(FinchAPI::Models::Money), + employer_taxes: T.nilable(FinchAPI::Models::Money), + gross_pay: T.nilable(FinchAPI::Models::Money), + individual_ids: T.nilable(T::Array[String]), + net_pay: T.nilable(FinchAPI::Models::Money), + pay_date: T.nilable(String), + pay_frequencies: T.nilable(T::Array[Symbol]), + pay_group_ids: T.nilable(T::Array[String]), + pay_period: T.nilable(FinchAPI::Models::HRIS::Payment::PayPeriod) + } + ) + end + def to_hash + end + + class PayFrequency < FinchAPI::Enum + abstract! + + ANNUALLY = :annually + SEMI_ANNUALLY = :semi_annually + QUARTERLY = :quarterly + MONTHLY = :monthly + SEMI_MONTHLY = :semi_monthly + BI_WEEKLY = :bi_weekly + WEEKLY = :weekly + DAILY = :daily + OTHER = :other + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + + class PayPeriod < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def end_date + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def end_date=(_) + end + + sig { returns(T.nilable(String)) } + def start_date + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def start_date=(_) + end + + sig { params(end_date: T.nilable(String), start_date: T.nilable(String)).void } + def initialize(end_date: nil, start_date: nil) + end + + sig { override.returns({end_date: T.nilable(String), start_date: T.nilable(String)}) } + def to_hash + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/payment_list_params.rbi b/rbi/lib/finch-api/models/hris/payment_list_params.rbi new file mode 100644 index 00000000..8c986cc1 --- /dev/null +++ b/rbi/lib/finch-api/models/hris/payment_list_params.rbi @@ -0,0 +1,45 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + class PaymentListParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + sig { returns(Date) } + def end_date + end + + sig { params(_: Date).returns(Date) } + def end_date=(_) + end + + sig { returns(Date) } + def start_date + end + + sig { params(_: Date).returns(Date) } + def start_date=(_) + end + + sig do + params( + end_date: Date, + start_date: Date, + request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + ) + .void + end + def initialize(end_date:, start_date:, request_options: {}) + end + + sig do + override.returns({end_date: Date, start_date: Date, request_options: FinchAPI::RequestOptions}) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/support_per_benefit_type.rbi b/rbi/lib/finch-api/models/hris/support_per_benefit_type.rbi new file mode 100644 index 00000000..b685b6eb --- /dev/null +++ b/rbi/lib/finch-api/models/hris/support_per_benefit_type.rbi @@ -0,0 +1,47 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + class SupportPerBenefitType < FinchAPI::BaseModel + sig { returns(T.nilable(FinchAPI::Models::OperationSupportMatrix)) } + def company_benefits + end + + sig { params(_: FinchAPI::Models::OperationSupportMatrix).returns(FinchAPI::Models::OperationSupportMatrix) } + def company_benefits=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::OperationSupportMatrix)) } + def individual_benefits + end + + sig { params(_: FinchAPI::Models::OperationSupportMatrix).returns(FinchAPI::Models::OperationSupportMatrix) } + def individual_benefits=(_) + end + + sig do + params( + company_benefits: FinchAPI::Models::OperationSupportMatrix, + individual_benefits: FinchAPI::Models::OperationSupportMatrix + ) + .void + end + def initialize(company_benefits: nil, individual_benefits: nil) + end + + sig do + override + .returns( + { + company_benefits: FinchAPI::Models::OperationSupportMatrix, + individual_benefits: FinchAPI::Models::OperationSupportMatrix + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/supported_benefit.rbi b/rbi/lib/finch-api/models/hris/supported_benefit.rbi new file mode 100644 index 00000000..ea88e4f7 --- /dev/null +++ b/rbi/lib/finch-api/models/hris/supported_benefit.rbi @@ -0,0 +1,155 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + class SupportedBenefit < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def annual_maximum + end + + sig { params(_: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } + def annual_maximum=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def catch_up + end + + sig { params(_: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } + def catch_up=(_) + end + + sig { returns(T.nilable(T::Array[T.nilable(Symbol)])) } + def company_contribution + end + + sig do + params(_: T.nilable(T::Array[T.nilable(Symbol)])).returns(T.nilable(T::Array[T.nilable(Symbol)])) + end + def company_contribution=(_) + end + + sig { returns(T.nilable(String)) } + def description + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def description=(_) + end + + sig { returns(T.nilable(T::Array[T.nilable(Symbol)])) } + def employee_deduction + end + + sig do + params(_: T.nilable(T::Array[T.nilable(Symbol)])).returns(T.nilable(T::Array[T.nilable(Symbol)])) + end + def employee_deduction=(_) + end + + sig { returns(T.nilable(T::Array[T.nilable(Symbol)])) } + def frequencies + end + + sig { params(_: T::Array[T.nilable(Symbol)]).returns(T::Array[T.nilable(Symbol)]) } + def frequencies=(_) + end + + sig { returns(T.nilable(T::Array[T.nilable(Symbol)])) } + def hsa_contribution_limit + end + + sig do + params(_: T.nilable(T::Array[T.nilable(Symbol)])).returns(T.nilable(T::Array[T.nilable(Symbol)])) + end + def hsa_contribution_limit=(_) + end + + sig { returns(T.nilable(Symbol)) } + def type + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def type=(_) + end + + sig do + params( + annual_maximum: T.nilable(T::Boolean), + catch_up: T.nilable(T::Boolean), + company_contribution: T.nilable(T::Array[T.nilable(Symbol)]), + description: T.nilable(String), + employee_deduction: T.nilable(T::Array[T.nilable(Symbol)]), + frequencies: T::Array[T.nilable(Symbol)], + hsa_contribution_limit: T.nilable(T::Array[T.nilable(Symbol)]), + type: T.nilable(Symbol) + ) + .void + end + def initialize( + annual_maximum: nil, + catch_up: nil, + company_contribution: nil, + description: nil, + employee_deduction: nil, + frequencies: nil, + hsa_contribution_limit: nil, + type: nil + ) + end + + sig do + override + .returns( + { + annual_maximum: T.nilable(T::Boolean), + catch_up: T.nilable(T::Boolean), + company_contribution: T.nilable(T::Array[T.nilable(Symbol)]), + description: T.nilable(String), + employee_deduction: T.nilable(T::Array[T.nilable(Symbol)]), + frequencies: T::Array[T.nilable(Symbol)], + hsa_contribution_limit: T.nilable(T::Array[T.nilable(Symbol)]), + type: T.nilable(Symbol) + } + ) + end + def to_hash + end + + class CompanyContribution < FinchAPI::Enum + abstract! + + FIXED = T.let(:fixed, T.nilable(Symbol)) + PERCENT = T.let(:percent, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + + class EmployeeDeduction < FinchAPI::Enum + abstract! + + FIXED = T.let(:fixed, T.nilable(Symbol)) + PERCENT = T.let(:percent, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + + class HsaContributionLimit < FinchAPI::Enum + abstract! + + INDIVIDUAL = T.let(:individual, T.nilable(Symbol)) + FAMILY = T.let(:family, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/update_company_benefit_response.rbi b/rbi/lib/finch-api/models/hris/update_company_benefit_response.rbi new file mode 100644 index 00000000..dc95d139 --- /dev/null +++ b/rbi/lib/finch-api/models/hris/update_company_benefit_response.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + class UpdateCompanyBenefitResponse < FinchAPI::BaseModel + sig { returns(String) } + def benefit_id + end + + sig { params(_: String).returns(String) } + def benefit_id=(_) + end + + sig { params(benefit_id: String).void } + def initialize(benefit_id:) + end + + sig { override.returns({benefit_id: String}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/w42005.rbi b/rbi/lib/finch-api/models/hris/w42005.rbi new file mode 100644 index 00000000..f05a7c9b --- /dev/null +++ b/rbi/lib/finch-api/models/hris/w42005.rbi @@ -0,0 +1,150 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + class W42005 < FinchAPI::BaseModel + sig { returns(T.nilable(FinchAPI::Models::HRIS::W42005::Data)) } + def data + end + + sig { params(_: FinchAPI::Models::HRIS::W42005::Data).returns(FinchAPI::Models::HRIS::W42005::Data) } + def data=(_) + end + + sig { returns(T.nilable(Symbol)) } + def type + end + + sig { params(_: Symbol).returns(Symbol) } + def type=(_) + end + + sig { returns(T.nilable(Float)) } + def year + end + + sig { params(_: T.nilable(Float)).returns(T.nilable(Float)) } + def year=(_) + end + + sig { params(data: FinchAPI::Models::HRIS::W42005::Data, type: Symbol, year: T.nilable(Float)).void } + def initialize(data: nil, type: nil, year: nil) + end + + sig { override.returns({data: FinchAPI::Models::HRIS::W42005::Data, type: Symbol, year: T.nilable(Float)}) } + def to_hash + end + + class Data < FinchAPI::BaseModel + sig { returns(T.nilable(Integer)) } + def additional_withholding + end + + sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } + def additional_withholding=(_) + end + + sig { returns(T.nilable(Symbol)) } + def exemption + end + + sig { params(_: Symbol).returns(Symbol) } + def exemption=(_) + end + + sig { returns(T.nilable(Symbol)) } + def filing_status + end + + sig { params(_: Symbol).returns(Symbol) } + def filing_status=(_) + end + + sig { returns(T.nilable(String)) } + def individual_id + end + + sig { params(_: String).returns(String) } + def individual_id=(_) + end + + sig { returns(T.nilable(Integer)) } + def total_number_of_allowances + end + + sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } + def total_number_of_allowances=(_) + end + + sig do + params( + additional_withholding: T.nilable(Integer), + exemption: Symbol, + filing_status: Symbol, + individual_id: String, + total_number_of_allowances: T.nilable(Integer) + ) + .void + end + def initialize( + additional_withholding: nil, + exemption: nil, + filing_status: nil, + individual_id: nil, + total_number_of_allowances: nil + ) + end + + sig do + override + .returns( + { + additional_withholding: T.nilable(Integer), + exemption: Symbol, + filing_status: Symbol, + individual_id: String, + total_number_of_allowances: T.nilable(Integer) + } + ) + end + def to_hash + end + + class Exemption < FinchAPI::Enum + abstract! + + EXEMPT = :exempt + NON_EXEMPT = :non_exempt + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + + class FilingStatus < FinchAPI::Enum + abstract! + + MARRIED = :married + MARRIED_BUT_WITHHOLD_AT_HIGHER_SINGLE_RATE = :married_but_withhold_at_higher_single_rate + SINGLE = :single + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + + class Type < FinchAPI::Enum + abstract! + + W4_2005 = :w4_2005 + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/hris/w42020.rbi b/rbi/lib/finch-api/models/hris/w42020.rbi new file mode 100644 index 00000000..43d18748 --- /dev/null +++ b/rbi/lib/finch-api/models/hris/w42020.rbi @@ -0,0 +1,177 @@ +# typed: strong + +module FinchAPI + module Models + module HRIS + class W42020 < FinchAPI::BaseModel + sig { returns(T.nilable(FinchAPI::Models::HRIS::W42020::Data)) } + def data + end + + sig { params(_: FinchAPI::Models::HRIS::W42020::Data).returns(FinchAPI::Models::HRIS::W42020::Data) } + def data=(_) + end + + sig { returns(T.nilable(Symbol)) } + def type + end + + sig { params(_: Symbol).returns(Symbol) } + def type=(_) + end + + sig { returns(T.nilable(Float)) } + def year + end + + sig { params(_: T.nilable(Float)).returns(T.nilable(Float)) } + def year=(_) + end + + sig { params(data: FinchAPI::Models::HRIS::W42020::Data, type: Symbol, year: T.nilable(Float)).void } + def initialize(data: nil, type: nil, year: nil) + end + + sig { override.returns({data: FinchAPI::Models::HRIS::W42020::Data, type: Symbol, year: T.nilable(Float)}) } + def to_hash + end + + class Data < FinchAPI::BaseModel + sig { returns(T.nilable(Integer)) } + def amount_for_other_dependents + end + + sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } + def amount_for_other_dependents=(_) + end + + sig { returns(T.nilable(Integer)) } + def amount_for_qualifying_children_under_17 + end + + sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } + def amount_for_qualifying_children_under_17=(_) + end + + sig { returns(T.nilable(Integer)) } + def deductions + end + + sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } + def deductions=(_) + end + + sig { returns(T.nilable(Integer)) } + def extra_withholding + end + + sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } + def extra_withholding=(_) + end + + sig { returns(T.nilable(Symbol)) } + def filing_status + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def filing_status=(_) + end + + sig { returns(T.nilable(String)) } + def individual_id + end + + sig { params(_: String).returns(String) } + def individual_id=(_) + end + + sig { returns(T.nilable(Integer)) } + def other_income + end + + sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } + def other_income=(_) + end + + sig { returns(T.nilable(Integer)) } + def total_claim_dependent_and_other_credits + end + + sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } + def total_claim_dependent_and_other_credits=(_) + end + + sig do + params( + amount_for_other_dependents: T.nilable(Integer), + amount_for_qualifying_children_under_17: T.nilable(Integer), + deductions: T.nilable(Integer), + extra_withholding: T.nilable(Integer), + filing_status: T.nilable(Symbol), + individual_id: String, + other_income: T.nilable(Integer), + total_claim_dependent_and_other_credits: T.nilable(Integer) + ) + .void + end + def initialize( + amount_for_other_dependents: nil, + amount_for_qualifying_children_under_17: nil, + deductions: nil, + extra_withholding: nil, + filing_status: nil, + individual_id: nil, + other_income: nil, + total_claim_dependent_and_other_credits: nil + ) + end + + sig do + override + .returns( + { + amount_for_other_dependents: T.nilable(Integer), + amount_for_qualifying_children_under_17: T.nilable(Integer), + deductions: T.nilable(Integer), + extra_withholding: T.nilable(Integer), + filing_status: T.nilable(Symbol), + individual_id: String, + other_income: T.nilable(Integer), + total_claim_dependent_and_other_credits: T.nilable(Integer) + } + ) + end + def to_hash + end + + class FilingStatus < FinchAPI::Enum + abstract! + + HEAD_OF_HOUSEHOLD = T.let(:head_of_household, T.nilable(Symbol)) + MARRIED_FILING_JOINTLY_OR_QUALIFYING_SURVIVING_SPOUSE = T.let( + :married_filing_jointly_or_qualifying_surviving_spouse, T.nilable(Symbol) + ) + SINGLE_OR_MARRIED_FILING_SEPARATELY = T.let( + :single_or_married_filing_separately, + T.nilable(Symbol) + ) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + + class Type < FinchAPI::Enum + abstract! + + W4_2020 = :w4_2020 + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/income.rbi b/rbi/lib/finch-api/models/income.rbi new file mode 100644 index 00000000..5c93bb0e --- /dev/null +++ b/rbi/lib/finch-api/models/income.rbi @@ -0,0 +1,83 @@ +# typed: strong + +module FinchAPI + module Models + class Income < FinchAPI::BaseModel + sig { returns(T.nilable(Integer)) } + def amount + end + + sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } + def amount=(_) + end + + sig { returns(T.nilable(String)) } + def currency + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def currency=(_) + end + + sig { returns(T.nilable(String)) } + def effective_date + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def effective_date=(_) + end + + sig { returns(T.nilable(Symbol)) } + def unit + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def unit=(_) + end + + sig do + params( + amount: T.nilable(Integer), + currency: T.nilable(String), + effective_date: T.nilable(String), + unit: T.nilable(Symbol) + ) + .void + end + def initialize(amount: nil, currency: nil, effective_date: nil, unit: nil) + end + + sig do + override + .returns( + { + amount: T.nilable(Integer), + currency: T.nilable(String), + effective_date: T.nilable(String), + unit: T.nilable(Symbol) + } + ) + end + def to_hash + end + + class Unit < FinchAPI::Enum + abstract! + + YEARLY = T.let(:yearly, T.nilable(Symbol)) + QUARTERLY = T.let(:quarterly, T.nilable(Symbol)) + MONTHLY = T.let(:monthly, T.nilable(Symbol)) + SEMI_MONTHLY = T.let(:semi_monthly, T.nilable(Symbol)) + BI_WEEKLY = T.let(:bi_weekly, T.nilable(Symbol)) + WEEKLY = T.let(:weekly, T.nilable(Symbol)) + DAILY = T.let(:daily, T.nilable(Symbol)) + HOURLY = T.let(:hourly, T.nilable(Symbol)) + FIXED = T.let(:fixed, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/individual_event.rbi b/rbi/lib/finch-api/models/individual_event.rbi new file mode 100644 index 00000000..c4eeb27b --- /dev/null +++ b/rbi/lib/finch-api/models/individual_event.rbi @@ -0,0 +1,61 @@ +# typed: strong + +module FinchAPI + module Models + class IndividualEvent < FinchAPI::Models::BaseWebhookEvent + sig { returns(T.nilable(FinchAPI::Models::IndividualEvent::Data)) } + def data + end + + sig { params(_: FinchAPI::Models::IndividualEvent::Data).returns(FinchAPI::Models::IndividualEvent::Data) } + def data=(_) + end + + sig { returns(T.nilable(Symbol)) } + def event_type + end + + sig { params(_: Symbol).returns(Symbol) } + def event_type=(_) + end + + sig { params(data: FinchAPI::Models::IndividualEvent::Data, event_type: Symbol).void } + def initialize(data: nil, event_type: nil) + end + + sig { override.returns({data: FinchAPI::Models::IndividualEvent::Data, event_type: Symbol}) } + def to_hash + end + + class Data < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def individual_id + end + + sig { params(_: String).returns(String) } + def individual_id=(_) + end + + sig { params(individual_id: String).void } + def initialize(individual_id: nil) + end + + sig { override.returns({individual_id: String}) } + def to_hash + end + end + + class EventType < FinchAPI::Enum + abstract! + + INDIVIDUAL_CREATED = :"individual.created" + INDIVIDUAL_UPDATED = :"individual.updated" + INDIVIDUAL_DELETED = :"individual.deleted" + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/introspection.rbi b/rbi/lib/finch-api/models/introspection.rbi new file mode 100644 index 00000000..a8ca675f --- /dev/null +++ b/rbi/lib/finch-api/models/introspection.rbi @@ -0,0 +1,350 @@ +# typed: strong + +module FinchAPI + module Models + class Introspection < FinchAPI::BaseModel + sig { returns(String) } + def account_id + end + + sig { params(_: String).returns(String) } + def account_id=(_) + end + + sig { returns(T::Array[FinchAPI::Models::Introspection::AuthenticationMethod]) } + def authentication_methods + end + + sig do + params(_: T::Array[FinchAPI::Models::Introspection::AuthenticationMethod]) + .returns(T::Array[FinchAPI::Models::Introspection::AuthenticationMethod]) + end + def authentication_methods=(_) + end + + sig { returns(String) } + def client_id + end + + sig { params(_: String).returns(String) } + def client_id=(_) + end + + sig { returns(Symbol) } + def client_type + end + + sig { params(_: Symbol).returns(Symbol) } + def client_type=(_) + end + + sig { returns(String) } + def company_id + end + + sig { params(_: String).returns(String) } + def company_id=(_) + end + + sig { returns(String) } + def connection_id + end + + sig { params(_: String).returns(String) } + def connection_id=(_) + end + + sig { returns(FinchAPI::Models::Introspection::ConnectionStatus) } + def connection_status + end + + sig do + params(_: FinchAPI::Models::Introspection::ConnectionStatus) + .returns(FinchAPI::Models::Introspection::ConnectionStatus) + end + def connection_status=(_) + end + + sig { returns(Symbol) } + def connection_type + end + + sig { params(_: Symbol).returns(Symbol) } + def connection_type=(_) + end + + sig { returns(T.nilable(String)) } + def customer_email + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def customer_email=(_) + end + + sig { returns(T.nilable(String)) } + def customer_id + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def customer_id=(_) + end + + sig { returns(T.nilable(String)) } + def customer_name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def customer_name=(_) + end + + sig { returns(T::Boolean) } + def manual + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def manual=(_) + end + + sig { returns(String) } + def payroll_provider_id + end + + sig { params(_: String).returns(String) } + def payroll_provider_id=(_) + end + + sig { returns(T::Array[String]) } + def products + end + + sig { params(_: T::Array[String]).returns(T::Array[String]) } + def products=(_) + end + + sig { returns(String) } + def provider_id + end + + sig { params(_: String).returns(String) } + def provider_id=(_) + end + + sig { returns(String) } + def username + end + + sig { params(_: String).returns(String) } + def username=(_) + end + + sig do + params( + account_id: String, + authentication_methods: T::Array[FinchAPI::Models::Introspection::AuthenticationMethod], + client_id: String, + client_type: Symbol, + company_id: String, + connection_id: String, + connection_status: FinchAPI::Models::Introspection::ConnectionStatus, + connection_type: Symbol, + customer_email: T.nilable(String), + customer_id: T.nilable(String), + customer_name: T.nilable(String), + manual: T::Boolean, + payroll_provider_id: String, + products: T::Array[String], + provider_id: String, + username: String + ) + .void + end + def initialize( + account_id:, + authentication_methods:, + client_id:, + client_type:, + company_id:, + connection_id:, + connection_status:, + connection_type:, + customer_email:, + customer_id:, + customer_name:, + manual:, + payroll_provider_id:, + products:, + provider_id:, + username: + ) + end + + sig do + override + .returns( + { + account_id: String, + authentication_methods: T::Array[FinchAPI::Models::Introspection::AuthenticationMethod], + client_id: String, + client_type: Symbol, + company_id: String, + connection_id: String, + connection_status: FinchAPI::Models::Introspection::ConnectionStatus, + connection_type: Symbol, + customer_email: T.nilable(String), + customer_id: T.nilable(String), + customer_name: T.nilable(String), + manual: T::Boolean, + payroll_provider_id: String, + products: T::Array[String], + provider_id: String, + username: String + } + ) + end + def to_hash + end + + class AuthenticationMethod < FinchAPI::BaseModel + sig { returns(T.nilable(FinchAPI::Models::Introspection::AuthenticationMethod::ConnectionStatus)) } + def connection_status + end + + sig do + params(_: FinchAPI::Models::Introspection::AuthenticationMethod::ConnectionStatus) + .returns(FinchAPI::Models::Introspection::AuthenticationMethod::ConnectionStatus) + end + def connection_status=(_) + end + + sig { returns(T.nilable(T::Array[String])) } + def products + end + + sig { params(_: T::Array[String]).returns(T::Array[String]) } + def products=(_) + end + + sig { returns(T.nilable(Symbol)) } + def type + end + + sig { params(_: Symbol).returns(Symbol) } + def type=(_) + end + + sig do + params( + connection_status: FinchAPI::Models::Introspection::AuthenticationMethod::ConnectionStatus, + products: T::Array[String], + type: Symbol + ) + .void + end + def initialize(connection_status: nil, products: nil, type: nil) + end + + sig do + override + .returns( + { + connection_status: FinchAPI::Models::Introspection::AuthenticationMethod::ConnectionStatus, + products: T::Array[String], + type: Symbol + } + ) + end + def to_hash + end + + class ConnectionStatus < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def message + end + + sig { params(_: String).returns(String) } + def message=(_) + end + + sig { returns(T.nilable(Symbol)) } + def status + end + + sig { params(_: Symbol).returns(Symbol) } + def status=(_) + end + + sig { params(message: String, status: Symbol).void } + def initialize(message: nil, status: nil) + end + + sig { override.returns({message: String, status: Symbol}) } + def to_hash + end + end + + class Type < FinchAPI::Enum + abstract! + + ASSISTED = :assisted + CREDENTIAL = :credential + API_TOKEN = :api_token + API_CREDENTIAL = :api_credential + OAUTH = :oauth + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + + class ClientType < FinchAPI::Enum + abstract! + + PRODUCTION = :production + DEVELOPMENT = :development + SANDBOX = :sandbox + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + + class ConnectionStatus < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def message + end + + sig { params(_: String).returns(String) } + def message=(_) + end + + sig { returns(T.nilable(Symbol)) } + def status + end + + sig { params(_: Symbol).returns(Symbol) } + def status=(_) + end + + sig { params(message: String, status: Symbol).void } + def initialize(message: nil, status: nil) + end + + sig { override.returns({message: String, status: Symbol}) } + def to_hash + end + end + + class ConnectionType < FinchAPI::Enum + abstract! + + PROVIDER = :provider + FINCH = :finch + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/job_completion_event.rbi b/rbi/lib/finch-api/models/job_completion_event.rbi new file mode 100644 index 00000000..66bf53f7 --- /dev/null +++ b/rbi/lib/finch-api/models/job_completion_event.rbi @@ -0,0 +1,72 @@ +# typed: strong + +module FinchAPI + module Models + class JobCompletionEvent < FinchAPI::Models::BaseWebhookEvent + sig { returns(T.nilable(FinchAPI::Models::JobCompletionEvent::Data)) } + def data + end + + sig { params(_: FinchAPI::Models::JobCompletionEvent::Data).returns(FinchAPI::Models::JobCompletionEvent::Data) } + def data=(_) + end + + sig { returns(T.nilable(Symbol)) } + def event_type + end + + sig { params(_: Symbol).returns(Symbol) } + def event_type=(_) + end + + sig { params(data: FinchAPI::Models::JobCompletionEvent::Data, event_type: Symbol).void } + def initialize(data: nil, event_type: nil) + end + + sig { override.returns({data: FinchAPI::Models::JobCompletionEvent::Data, event_type: Symbol}) } + def to_hash + end + + class Data < FinchAPI::BaseModel + sig { returns(String) } + def job_id + end + + sig { params(_: String).returns(String) } + def job_id=(_) + end + + sig { returns(String) } + def job_url + end + + sig { params(_: String).returns(String) } + def job_url=(_) + end + + sig { params(job_id: String, job_url: String).void } + def initialize(job_id:, job_url:) + end + + sig { override.returns({job_id: String, job_url: String}) } + def to_hash + end + end + + class EventType < FinchAPI::Enum + abstract! + + JOB_BENEFIT_CREATE_COMPLETED = :"job.benefit_create.completed" + JOB_BENEFIT_ENROLL_COMPLETED = :"job.benefit_enroll.completed" + JOB_BENEFIT_REGISTER_COMPLETED = :"job.benefit_register.completed" + JOB_BENEFIT_UNENROLL_COMPLETED = :"job.benefit_unenroll.completed" + JOB_BENEFIT_UPDATE_COMPLETED = :"job.benefit_update.completed" + JOB_DATA_SYNC_ALL_COMPLETED = :"job.data_sync_all.completed" + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/jobs/automated_async_job.rbi b/rbi/lib/finch-api/models/jobs/automated_async_job.rbi new file mode 100644 index 00000000..ed1d0b60 --- /dev/null +++ b/rbi/lib/finch-api/models/jobs/automated_async_job.rbi @@ -0,0 +1,174 @@ +# typed: strong + +module FinchAPI + module Models + module Jobs + class AutomatedAsyncJob < FinchAPI::BaseModel + sig { returns(T.nilable(Time)) } + def completed_at + end + + sig { params(_: T.nilable(Time)).returns(T.nilable(Time)) } + def completed_at=(_) + end + + sig { returns(Time) } + def created_at + end + + sig { params(_: Time).returns(Time) } + def created_at=(_) + end + + sig { returns(String) } + def job_id + end + + sig { params(_: String).returns(String) } + def job_id=(_) + end + + sig { returns(String) } + def job_url + end + + sig { params(_: String).returns(String) } + def job_url=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Jobs::AutomatedAsyncJob::Params)) } + def params + end + + sig do + params(_: T.nilable(FinchAPI::Models::Jobs::AutomatedAsyncJob::Params)) + .returns(T.nilable(FinchAPI::Models::Jobs::AutomatedAsyncJob::Params)) + end + def params=(_) + end + + sig { returns(T.nilable(Time)) } + def scheduled_at + end + + sig { params(_: T.nilable(Time)).returns(T.nilable(Time)) } + def scheduled_at=(_) + end + + sig { returns(T.nilable(Time)) } + def started_at + end + + sig { params(_: T.nilable(Time)).returns(T.nilable(Time)) } + def started_at=(_) + end + + sig { returns(Symbol) } + def status + end + + sig { params(_: Symbol).returns(Symbol) } + def status=(_) + end + + sig { returns(Symbol) } + def type + end + + sig { params(_: Symbol).returns(Symbol) } + def type=(_) + end + + sig do + params( + completed_at: T.nilable(Time), + created_at: Time, + job_id: String, + job_url: String, + params: T.nilable(FinchAPI::Models::Jobs::AutomatedAsyncJob::Params), + scheduled_at: T.nilable(Time), + started_at: T.nilable(Time), + status: Symbol, + type: Symbol + ) + .void + end + def initialize( + completed_at:, + created_at:, + job_id:, + job_url:, + params:, + scheduled_at:, + started_at:, + status:, + type: + ) + end + + sig do + override + .returns( + { + completed_at: T.nilable(Time), + created_at: Time, + job_id: String, + job_url: String, + params: T.nilable(FinchAPI::Models::Jobs::AutomatedAsyncJob::Params), + scheduled_at: T.nilable(Time), + started_at: T.nilable(Time), + status: Symbol, + type: Symbol + } + ) + end + def to_hash + end + + class Params < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def individual_id + end + + sig { params(_: String).returns(String) } + def individual_id=(_) + end + + sig { params(individual_id: String).void } + def initialize(individual_id: nil) + end + + sig { override.returns({individual_id: String}) } + def to_hash + end + end + + class Status < FinchAPI::Enum + abstract! + + PENDING = :pending + IN_PROGRESS = :in_progress + COMPLETE = :complete + ERROR = :error + REAUTH_ERROR = :reauth_error + PERMISSIONS_ERROR = :permissions_error + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + + class Type < FinchAPI::Enum + abstract! + + DATA_SYNC_ALL = :data_sync_all + W4_FORM_EMPLOYEE_SYNC = :w4_form_employee_sync + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/jobs/automated_create_params.rbi b/rbi/lib/finch-api/models/jobs/automated_create_params.rbi new file mode 100644 index 00000000..05af55bd --- /dev/null +++ b/rbi/lib/finch-api/models/jobs/automated_create_params.rbi @@ -0,0 +1,83 @@ +# typed: strong + +module FinchAPI + module Models + module Jobs + class AutomatedCreateParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + sig { returns(Symbol) } + def type + end + + sig { params(_: Symbol).returns(Symbol) } + def type=(_) + end + + sig { returns(FinchAPI::Models::Jobs::AutomatedCreateParams::Params) } + def params + end + + sig do + params(_: FinchAPI::Models::Jobs::AutomatedCreateParams::Params) + .returns(FinchAPI::Models::Jobs::AutomatedCreateParams::Params) + end + def params=(_) + end + + sig do + params( + type: Symbol, + params: FinchAPI::Models::Jobs::AutomatedCreateParams::Params, + request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + ) + .void + end + def initialize(type:, params:, request_options: {}) + end + + sig do + override + .returns( + { + type: Symbol, + params: FinchAPI::Models::Jobs::AutomatedCreateParams::Params, + request_options: FinchAPI::RequestOptions + } + ) + end + def to_hash + end + + class Type < FinchAPI::Enum + abstract! + + W4_FORM_EMPLOYEE_SYNC = :w4_form_employee_sync + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + + class Params < FinchAPI::BaseModel + sig { returns(String) } + def individual_id + end + + sig { params(_: String).returns(String) } + def individual_id=(_) + end + + sig { params(individual_id: String).void } + def initialize(individual_id:) + end + + sig { override.returns({individual_id: String}) } + def to_hash + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/jobs/automated_create_response.rbi b/rbi/lib/finch-api/models/jobs/automated_create_response.rbi new file mode 100644 index 00000000..43308533 --- /dev/null +++ b/rbi/lib/finch-api/models/jobs/automated_create_response.rbi @@ -0,0 +1,64 @@ +# typed: strong + +module FinchAPI + module Models + module Jobs + class AutomatedCreateResponse < FinchAPI::BaseModel + sig { returns(Integer) } + def allowed_refreshes + end + + sig { params(_: Integer).returns(Integer) } + def allowed_refreshes=(_) + end + + sig { returns(String) } + def job_id + end + + sig { params(_: String).returns(String) } + def job_id=(_) + end + + sig { returns(String) } + def job_url + end + + sig { params(_: String).returns(String) } + def job_url=(_) + end + + sig { returns(Integer) } + def remaining_refreshes + end + + sig { params(_: Integer).returns(Integer) } + def remaining_refreshes=(_) + end + + sig do + params( + allowed_refreshes: Integer, + job_id: String, + job_url: String, + remaining_refreshes: Integer + ).void + end + def initialize(allowed_refreshes:, job_id:, job_url:, remaining_refreshes:) + end + + sig do + override + .returns({ + allowed_refreshes: Integer, + job_id: String, + job_url: String, + remaining_refreshes: Integer + }) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/jobs/automated_list_params.rbi b/rbi/lib/finch-api/models/jobs/automated_list_params.rbi new file mode 100644 index 00000000..7343edb5 --- /dev/null +++ b/rbi/lib/finch-api/models/jobs/automated_list_params.rbi @@ -0,0 +1,43 @@ +# typed: strong + +module FinchAPI + module Models + module Jobs + class AutomatedListParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + sig { returns(T.nilable(Integer)) } + def limit + end + + sig { params(_: Integer).returns(Integer) } + def limit=(_) + end + + sig { returns(T.nilable(Integer)) } + def offset + end + + sig { params(_: Integer).returns(Integer) } + def offset=(_) + end + + sig do + params( + limit: Integer, + offset: Integer, + request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + ) + .void + end + def initialize(limit: nil, offset: nil, request_options: {}) + end + + sig { override.returns({limit: Integer, offset: Integer, request_options: FinchAPI::RequestOptions}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/jobs/automated_retrieve_params.rbi b/rbi/lib/finch-api/models/jobs/automated_retrieve_params.rbi new file mode 100644 index 00000000..df84a332 --- /dev/null +++ b/rbi/lib/finch-api/models/jobs/automated_retrieve_params.rbi @@ -0,0 +1,20 @@ +# typed: strong + +module FinchAPI + module Models + module Jobs + class AutomatedRetrieveParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + sig { params(request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])).void } + def initialize(request_options: {}) + end + + sig { override.returns({request_options: FinchAPI::RequestOptions}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/jobs/manual_async_job.rbi b/rbi/lib/finch-api/models/jobs/manual_async_job.rbi new file mode 100644 index 00000000..cbf87fd5 --- /dev/null +++ b/rbi/lib/finch-api/models/jobs/manual_async_job.rbi @@ -0,0 +1,54 @@ +# typed: strong + +module FinchAPI + module Models + module Jobs + class ManualAsyncJob < FinchAPI::BaseModel + sig { returns(T.nilable(T::Array[T.anything])) } + def body + end + + sig { params(_: T.nilable(T::Array[T.anything])).returns(T.nilable(T::Array[T.anything])) } + def body=(_) + end + + sig { returns(String) } + def job_id + end + + sig { params(_: String).returns(String) } + def job_id=(_) + end + + sig { returns(Symbol) } + def status + end + + sig { params(_: Symbol).returns(Symbol) } + def status=(_) + end + + sig { params(body: T.nilable(T::Array[T.anything]), job_id: String, status: Symbol).void } + def initialize(body:, job_id:, status:) + end + + sig { override.returns({body: T.nilable(T::Array[T.anything]), job_id: String, status: Symbol}) } + def to_hash + end + + class Status < FinchAPI::Enum + abstract! + + PENDING = :pending + IN_PROGRESS = :in_progress + ERROR = :error + COMPLETE = :complete + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/jobs/manual_retrieve_params.rbi b/rbi/lib/finch-api/models/jobs/manual_retrieve_params.rbi new file mode 100644 index 00000000..480e3614 --- /dev/null +++ b/rbi/lib/finch-api/models/jobs/manual_retrieve_params.rbi @@ -0,0 +1,20 @@ +# typed: strong + +module FinchAPI + module Models + module Jobs + class ManualRetrieveParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + sig { params(request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])).void } + def initialize(request_options: {}) + end + + sig { override.returns({request_options: FinchAPI::RequestOptions}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/location.rbi b/rbi/lib/finch-api/models/location.rbi new file mode 100644 index 00000000..a79e7d3b --- /dev/null +++ b/rbi/lib/finch-api/models/location.rbi @@ -0,0 +1,114 @@ +# typed: strong + +module FinchAPI + module Models + class Location < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def city + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def city=(_) + end + + sig { returns(T.nilable(String)) } + def country + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def country=(_) + end + + sig { returns(T.nilable(String)) } + def line1 + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def line1=(_) + end + + sig { returns(T.nilable(String)) } + def line2 + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def line2=(_) + end + + sig { returns(T.nilable(String)) } + def name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def name=(_) + end + + sig { returns(T.nilable(String)) } + def postal_code + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def postal_code=(_) + end + + sig { returns(T.nilable(String)) } + def source_id + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def source_id=(_) + end + + sig { returns(T.nilable(String)) } + def state + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def state=(_) + end + + sig do + params( + city: T.nilable(String), + country: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + name: T.nilable(String), + postal_code: T.nilable(String), + source_id: T.nilable(String), + state: T.nilable(String) + ) + .void + end + def initialize( + city: nil, + country: nil, + line1: nil, + line2: nil, + name: nil, + postal_code: nil, + source_id: nil, + state: nil + ) + end + + sig do + override + .returns( + { + city: T.nilable(String), + country: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + name: T.nilable(String), + postal_code: T.nilable(String), + source_id: T.nilable(String), + state: T.nilable(String) + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lib/finch-api/models/money.rbi b/rbi/lib/finch-api/models/money.rbi new file mode 100644 index 00000000..64e1b602 --- /dev/null +++ b/rbi/lib/finch-api/models/money.rbi @@ -0,0 +1,31 @@ +# typed: strong + +module FinchAPI + module Models + class Money < FinchAPI::BaseModel + sig { returns(T.nilable(Integer)) } + def amount + end + + sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } + def amount=(_) + end + + sig { returns(T.nilable(String)) } + def currency + end + + sig { params(_: String).returns(String) } + def currency=(_) + end + + sig { params(amount: T.nilable(Integer), currency: String).void } + def initialize(amount: nil, currency: nil) + end + + sig { override.returns({amount: T.nilable(Integer), currency: String}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/finch-api/models/operation_support.rbi b/rbi/lib/finch-api/models/operation_support.rbi new file mode 100644 index 00000000..04720507 --- /dev/null +++ b/rbi/lib/finch-api/models/operation_support.rbi @@ -0,0 +1,18 @@ +# typed: strong + +module FinchAPI + module Models + class OperationSupport < FinchAPI::Enum + abstract! + + SUPPORTED = :supported + NOT_SUPPORTED_BY_FINCH = :not_supported_by_finch + NOT_SUPPORTED_BY_PROVIDER = :not_supported_by_provider + CLIENT_ACCESS_ONLY = :client_access_only + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end +end diff --git a/rbi/lib/finch-api/models/operation_support_matrix.rbi b/rbi/lib/finch-api/models/operation_support_matrix.rbi new file mode 100644 index 00000000..4b88a1bb --- /dev/null +++ b/rbi/lib/finch-api/models/operation_support_matrix.rbi @@ -0,0 +1,47 @@ +# typed: strong + +module FinchAPI + module Models + class OperationSupportMatrix < FinchAPI::BaseModel + sig { returns(T.nilable(Symbol)) } + def create + end + + sig { params(_: Symbol).returns(Symbol) } + def create=(_) + end + + sig { returns(T.nilable(Symbol)) } + def delete + end + + sig { params(_: Symbol).returns(Symbol) } + def delete=(_) + end + + sig { returns(T.nilable(Symbol)) } + def read + end + + sig { params(_: Symbol).returns(Symbol) } + def read=(_) + end + + sig { returns(T.nilable(Symbol)) } + def update + end + + sig { params(_: Symbol).returns(Symbol) } + def update=(_) + end + + sig { params(create: Symbol, delete: Symbol, read: Symbol, update: Symbol).void } + def initialize(create: nil, delete: nil, read: nil, update: nil) + end + + sig { override.returns({create: Symbol, delete: Symbol, read: Symbol, update: Symbol}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/finch-api/models/paging.rbi b/rbi/lib/finch-api/models/paging.rbi new file mode 100644 index 00000000..7de9992a --- /dev/null +++ b/rbi/lib/finch-api/models/paging.rbi @@ -0,0 +1,31 @@ +# typed: strong + +module FinchAPI + module Models + class Paging < FinchAPI::BaseModel + sig { returns(T.nilable(Integer)) } + def count + end + + sig { params(_: Integer).returns(Integer) } + def count=(_) + end + + sig { returns(T.nilable(Integer)) } + def offset + end + + sig { params(_: Integer).returns(Integer) } + def offset=(_) + end + + sig { params(count: Integer, offset: Integer).void } + def initialize(count: nil, offset: nil) + end + + sig { override.returns({count: Integer, offset: Integer}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/finch-api/models/pay_statement_event.rbi b/rbi/lib/finch-api/models/pay_statement_event.rbi new file mode 100644 index 00000000..3393d442 --- /dev/null +++ b/rbi/lib/finch-api/models/pay_statement_event.rbi @@ -0,0 +1,69 @@ +# typed: strong + +module FinchAPI + module Models + class PayStatementEvent < FinchAPI::Models::BaseWebhookEvent + sig { returns(T.nilable(FinchAPI::Models::PayStatementEvent::Data)) } + def data + end + + sig { params(_: FinchAPI::Models::PayStatementEvent::Data).returns(FinchAPI::Models::PayStatementEvent::Data) } + def data=(_) + end + + sig { returns(T.nilable(Symbol)) } + def event_type + end + + sig { params(_: Symbol).returns(Symbol) } + def event_type=(_) + end + + sig { params(data: FinchAPI::Models::PayStatementEvent::Data, event_type: Symbol).void } + def initialize(data: nil, event_type: nil) + end + + sig { override.returns({data: FinchAPI::Models::PayStatementEvent::Data, event_type: Symbol}) } + def to_hash + end + + class Data < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def individual_id + end + + sig { params(_: String).returns(String) } + def individual_id=(_) + end + + sig { returns(T.nilable(String)) } + def payment_id + end + + sig { params(_: String).returns(String) } + def payment_id=(_) + end + + sig { params(individual_id: String, payment_id: String).void } + def initialize(individual_id: nil, payment_id: nil) + end + + sig { override.returns({individual_id: String, payment_id: String}) } + def to_hash + end + end + + class EventType < FinchAPI::Enum + abstract! + + PAY_STATEMENT_CREATED = :"pay_statement.created" + PAY_STATEMENT_UPDATED = :"pay_statement.updated" + PAY_STATEMENT_DELETED = :"pay_statement.deleted" + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/payment_event.rbi b/rbi/lib/finch-api/models/payment_event.rbi new file mode 100644 index 00000000..bc50e386 --- /dev/null +++ b/rbi/lib/finch-api/models/payment_event.rbi @@ -0,0 +1,69 @@ +# typed: strong + +module FinchAPI + module Models + class PaymentEvent < FinchAPI::Models::BaseWebhookEvent + sig { returns(T.nilable(FinchAPI::Models::PaymentEvent::Data)) } + def data + end + + sig { params(_: FinchAPI::Models::PaymentEvent::Data).returns(FinchAPI::Models::PaymentEvent::Data) } + def data=(_) + end + + sig { returns(T.nilable(Symbol)) } + def event_type + end + + sig { params(_: Symbol).returns(Symbol) } + def event_type=(_) + end + + sig { params(data: FinchAPI::Models::PaymentEvent::Data, event_type: Symbol).void } + def initialize(data: nil, event_type: nil) + end + + sig { override.returns({data: FinchAPI::Models::PaymentEvent::Data, event_type: Symbol}) } + def to_hash + end + + class Data < FinchAPI::BaseModel + sig { returns(String) } + def pay_date + end + + sig { params(_: String).returns(String) } + def pay_date=(_) + end + + sig { returns(String) } + def payment_id + end + + sig { params(_: String).returns(String) } + def payment_id=(_) + end + + sig { params(pay_date: String, payment_id: String).void } + def initialize(pay_date:, payment_id:) + end + + sig { override.returns({pay_date: String, payment_id: String}) } + def to_hash + end + end + + class EventType < FinchAPI::Enum + abstract! + + PAYMENT_CREATED = :"payment.created" + PAYMENT_UPDATED = :"payment.updated" + PAYMENT_DELETED = :"payment.deleted" + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/payroll/pay_group_list_params.rbi b/rbi/lib/finch-api/models/payroll/pay_group_list_params.rbi new file mode 100644 index 00000000..26870e63 --- /dev/null +++ b/rbi/lib/finch-api/models/payroll/pay_group_list_params.rbi @@ -0,0 +1,52 @@ +# typed: strong + +module FinchAPI + module Models + module Payroll + class PayGroupListParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + sig { returns(T.nilable(String)) } + def individual_id + end + + sig { params(_: String).returns(String) } + def individual_id=(_) + end + + sig { returns(T.nilable(T::Array[String])) } + def pay_frequencies + end + + sig { params(_: T::Array[String]).returns(T::Array[String]) } + def pay_frequencies=(_) + end + + sig do + params( + individual_id: String, + pay_frequencies: T::Array[String], + request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + ) + .void + end + def initialize(individual_id: nil, pay_frequencies: nil, request_options: {}) + end + + sig do + override + .returns( + { + individual_id: String, + pay_frequencies: T::Array[String], + request_options: FinchAPI::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/payroll/pay_group_list_response.rbi b/rbi/lib/finch-api/models/payroll/pay_group_list_response.rbi new file mode 100644 index 00000000..8b0c4239 --- /dev/null +++ b/rbi/lib/finch-api/models/payroll/pay_group_list_response.rbi @@ -0,0 +1,59 @@ +# typed: strong + +module FinchAPI + module Models + module Payroll + class PayGroupListResponse < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def id + end + + sig { params(_: String).returns(String) } + def id=(_) + end + + sig { returns(T.nilable(String)) } + def name + end + + sig { params(_: String).returns(String) } + def name=(_) + end + + sig { returns(T.nilable(T::Array[Symbol])) } + def pay_frequencies + end + + sig { params(_: T::Array[Symbol]).returns(T::Array[Symbol]) } + def pay_frequencies=(_) + end + + sig { params(id: String, name: String, pay_frequencies: T::Array[Symbol]).void } + def initialize(id: nil, name: nil, pay_frequencies: nil) + end + + sig { override.returns({id: String, name: String, pay_frequencies: T::Array[Symbol]}) } + def to_hash + end + + class PayFrequency < FinchAPI::Enum + abstract! + + ANNUALLY = :annually + SEMI_ANNUALLY = :semi_annually + QUARTERLY = :quarterly + MONTHLY = :monthly + SEMI_MONTHLY = :semi_monthly + BI_WEEKLY = :bi_weekly + WEEKLY = :weekly + DAILY = :daily + OTHER = :other + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/payroll/pay_group_retrieve_params.rbi b/rbi/lib/finch-api/models/payroll/pay_group_retrieve_params.rbi new file mode 100644 index 00000000..42a0b78a --- /dev/null +++ b/rbi/lib/finch-api/models/payroll/pay_group_retrieve_params.rbi @@ -0,0 +1,20 @@ +# typed: strong + +module FinchAPI + module Models + module Payroll + class PayGroupRetrieveParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + sig { params(request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])).void } + def initialize(request_options: {}) + end + + sig { override.returns({request_options: FinchAPI::RequestOptions}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/payroll/pay_group_retrieve_response.rbi b/rbi/lib/finch-api/models/payroll/pay_group_retrieve_response.rbi new file mode 100644 index 00000000..9c9ee374 --- /dev/null +++ b/rbi/lib/finch-api/models/payroll/pay_group_retrieve_response.rbi @@ -0,0 +1,82 @@ +# typed: strong + +module FinchAPI + module Models + module Payroll + class PayGroupRetrieveResponse < FinchAPI::BaseModel + sig { returns(String) } + def id + end + + sig { params(_: String).returns(String) } + def id=(_) + end + + sig { returns(T::Array[String]) } + def individual_ids + end + + sig { params(_: T::Array[String]).returns(T::Array[String]) } + def individual_ids=(_) + end + + sig { returns(String) } + def name + end + + sig { params(_: String).returns(String) } + def name=(_) + end + + sig { returns(T::Array[Symbol]) } + def pay_frequencies + end + + sig { params(_: T::Array[Symbol]).returns(T::Array[Symbol]) } + def pay_frequencies=(_) + end + + sig do + params( + id: String, + individual_ids: T::Array[String], + name: String, + pay_frequencies: T::Array[Symbol] + ).void + end + def initialize(id:, individual_ids:, name:, pay_frequencies:) + end + + sig do + override + .returns({ + id: String, + individual_ids: T::Array[String], + name: String, + pay_frequencies: T::Array[Symbol] + }) + end + def to_hash + end + + class PayFrequency < FinchAPI::Enum + abstract! + + ANNUALLY = :annually + SEMI_ANNUALLY = :semi_annually + QUARTERLY = :quarterly + MONTHLY = :monthly + SEMI_MONTHLY = :semi_monthly + BI_WEEKLY = :bi_weekly + WEEKLY = :weekly + DAILY = :daily + OTHER = :other + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/provider.rbi b/rbi/lib/finch-api/models/provider.rbi new file mode 100644 index 00000000..8bda9b52 --- /dev/null +++ b/rbi/lib/finch-api/models/provider.rbi @@ -0,0 +1,2369 @@ +# typed: strong + +module FinchAPI + module Models + class Provider < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def id + end + + sig { params(_: String).returns(String) } + def id=(_) + end + + sig { returns(T.nilable(T::Array[FinchAPI::Models::Provider::AuthenticationMethod])) } + def authentication_methods + end + + sig do + params(_: T::Array[FinchAPI::Models::Provider::AuthenticationMethod]) + .returns(T::Array[FinchAPI::Models::Provider::AuthenticationMethod]) + end + def authentication_methods=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def beta + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def beta=(_) + end + + sig { returns(T.nilable(String)) } + def display_name + end + + sig { params(_: String).returns(String) } + def display_name=(_) + end + + sig { returns(T.nilable(String)) } + def icon + end + + sig { params(_: String).returns(String) } + def icon=(_) + end + + sig { returns(T.nilable(String)) } + def logo + end + + sig { params(_: String).returns(String) } + def logo=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def manual + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def manual=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def mfa_required + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def mfa_required=(_) + end + + sig { returns(T.nilable(String)) } + def primary_color + end + + sig { params(_: String).returns(String) } + def primary_color=(_) + end + + sig { returns(T.nilable(T::Array[String])) } + def products + end + + sig { params(_: T::Array[String]).returns(T::Array[String]) } + def products=(_) + end + + sig do + params( + id: String, + authentication_methods: T::Array[FinchAPI::Models::Provider::AuthenticationMethod], + beta: T::Boolean, + display_name: String, + icon: String, + logo: String, + manual: T::Boolean, + mfa_required: T::Boolean, + primary_color: String, + products: T::Array[String] + ) + .void + end + def initialize( + id: nil, + authentication_methods: nil, + beta: nil, + display_name: nil, + icon: nil, + logo: nil, + manual: nil, + mfa_required: nil, + primary_color: nil, + products: nil + ) + end + + sig do + override + .returns( + { + id: String, + authentication_methods: T::Array[FinchAPI::Models::Provider::AuthenticationMethod], + beta: T::Boolean, + display_name: String, + icon: String, + logo: String, + manual: T::Boolean, + mfa_required: T::Boolean, + primary_color: String, + products: T::Array[String] + } + ) + end + def to_hash + end + + class AuthenticationMethod < FinchAPI::BaseModel + sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitsSupport)) } + def benefits_support + end + + sig do + params(_: T.nilable(FinchAPI::Models::HRIS::BenefitsSupport)) + .returns(T.nilable(FinchAPI::Models::HRIS::BenefitsSupport)) + end + def benefits_support=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields)) } + def supported_fields + end + + sig do + params(_: T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields)) + .returns(T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields)) + end + def supported_fields=(_) + end + + sig { returns(T.nilable(Symbol)) } + def type + end + + sig { params(_: Symbol).returns(Symbol) } + def type=(_) + end + + sig do + params( + benefits_support: T.nilable(FinchAPI::Models::HRIS::BenefitsSupport), + supported_fields: T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields), + type: Symbol + ) + .void + end + def initialize(benefits_support: nil, supported_fields: nil, type: nil) + end + + sig do + override + .returns( + { + benefits_support: T.nilable(FinchAPI::Models::HRIS::BenefitsSupport), + supported_fields: T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields), + type: Symbol + } + ) + end + def to_hash + end + + class SupportedFields < FinchAPI::BaseModel + sig { returns(T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company)) } + def company + end + + sig do + params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company) + .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company) + end + def company=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory)) } + def directory + end + + sig do + params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory) + .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory) + end + def directory=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment)) } + def employment + end + + sig do + params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment) + .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment) + end + def employment=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual)) } + def individual + end + + sig do + params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual) + .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual) + end + def individual=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayGroup)) } + def pay_group + end + + sig do + params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayGroup) + .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayGroup) + end + def pay_group=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement)) } + def pay_statement + end + + sig do + params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement) + .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement) + end + def pay_statement=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment)) } + def payment + end + + sig do + params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment) + .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment) + end + def payment=(_) + end + + sig do + params( + company: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company, + directory: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory, + employment: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment, + individual: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual, + pay_group: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayGroup, + pay_statement: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement, + payment: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment + ) + .void + end + def initialize( + company: nil, + directory: nil, + employment: nil, + individual: nil, + pay_group: nil, + pay_statement: nil, + payment: nil + ) + end + + sig do + override + .returns( + { + company: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company, + directory: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory, + employment: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment, + individual: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual, + pay_group: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayGroup, + pay_statement: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement, + payment: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment + } + ) + end + def to_hash + end + + class Company < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def id + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def id=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Accounts)) } + def accounts + end + + sig do + params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Accounts) + .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Accounts) + end + def accounts=(_) + end + + sig do + returns( + T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments) + ) + end + def departments + end + + sig do + params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments) + .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments) + end + def departments=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def ein + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def ein=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Entity)) } + def entity + end + + sig do + params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Entity) + .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Entity) + end + def entity=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def legal_name + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def legal_name=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Locations)) } + def locations + end + + sig do + params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Locations) + .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Locations) + end + def locations=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def primary_email + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def primary_email=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def primary_phone_number + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def primary_phone_number=(_) + end + + sig do + params( + id: T::Boolean, + accounts: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Accounts, + departments: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments, + ein: T::Boolean, + entity: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Entity, + legal_name: T::Boolean, + locations: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Locations, + primary_email: T::Boolean, + primary_phone_number: T::Boolean + ) + .void + end + def initialize( + id: nil, + accounts: nil, + departments: nil, + ein: nil, + entity: nil, + legal_name: nil, + locations: nil, + primary_email: nil, + primary_phone_number: nil + ) + end + + sig do + override + .returns( + { + id: T::Boolean, + accounts: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Accounts, + departments: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments, + ein: T::Boolean, + entity: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Entity, + legal_name: T::Boolean, + locations: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Locations, + primary_email: T::Boolean, + primary_phone_number: T::Boolean + } + ) + end + def to_hash + end + + class Accounts < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def account_name + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def account_name=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def account_number + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def account_number=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def account_type + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def account_type=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def institution_name + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def institution_name=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def routing_number + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def routing_number=(_) + end + + sig do + params( + account_name: T::Boolean, + account_number: T::Boolean, + account_type: T::Boolean, + institution_name: T::Boolean, + routing_number: T::Boolean + ) + .void + end + def initialize( + account_name: nil, + account_number: nil, + account_type: nil, + institution_name: nil, + routing_number: nil + ) + end + + sig do + override + .returns( + { + account_name: T::Boolean, + account_number: T::Boolean, + account_type: T::Boolean, + institution_name: T::Boolean, + routing_number: T::Boolean + } + ) + end + def to_hash + end + end + + class Departments < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def name + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def name=(_) + end + + sig do + returns( + T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments::Parent) + ) + end + def parent + end + + sig do + params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments::Parent) + .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments::Parent) + end + def parent=(_) + end + + sig do + params( + name: T::Boolean, + parent: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments::Parent + ) + .void + end + def initialize(name: nil, parent: nil) + end + + sig do + override + .returns( + { + name: T::Boolean, + parent: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments::Parent + } + ) + end + def to_hash + end + + class Parent < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def name + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def name=(_) + end + + sig { params(name: T::Boolean).void } + def initialize(name: nil) + end + + sig { override.returns({name: T::Boolean}) } + def to_hash + end + end + end + + class Entity < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def subtype + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def subtype=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def type + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def type=(_) + end + + sig { params(subtype: T::Boolean, type: T::Boolean).void } + def initialize(subtype: nil, type: nil) + end + + sig { override.returns({subtype: T::Boolean, type: T::Boolean}) } + def to_hash + end + end + + class Locations < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def city + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def city=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def country + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def country=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def line1 + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def line1=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def line2 + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def line2=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def postal_code + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def postal_code=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def state + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def state=(_) + end + + sig do + params( + city: T::Boolean, + country: T::Boolean, + line1: T::Boolean, + line2: T::Boolean, + postal_code: T::Boolean, + state: T::Boolean + ) + .void + end + def initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil) + end + + sig do + override + .returns( + { + city: T::Boolean, + country: T::Boolean, + line1: T::Boolean, + line2: T::Boolean, + postal_code: T::Boolean, + state: T::Boolean + } + ) + end + def to_hash + end + end + end + + class Directory < FinchAPI::BaseModel + sig do + returns( + T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals) + ) + end + def individuals + end + + sig do + params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals) + .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals) + end + def individuals=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Paging)) } + def paging + end + + sig do + params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Paging) + .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Paging) + end + def paging=(_) + end + + sig do + params( + individuals: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals, + paging: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Paging + ) + .void + end + def initialize(individuals: nil, paging: nil) + end + + sig do + override + .returns( + { + individuals: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals, + paging: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Paging + } + ) + end + def to_hash + end + + class Individuals < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def id + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def id=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def department + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def department=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def first_name + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def first_name=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def is_active + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def is_active=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def last_name + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def last_name=(_) + end + + sig do + returns( + T.nilable( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager + ) + ) + end + def manager + end + + sig do + params( + _: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager + ) + .returns( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager + ) + end + def manager=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def middle_name + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def middle_name=(_) + end + + sig do + params( + id: T::Boolean, + department: T::Boolean, + first_name: T::Boolean, + is_active: T::Boolean, + last_name: T::Boolean, + manager: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager, + middle_name: T::Boolean + ) + .void + end + def initialize( + id: nil, + department: nil, + first_name: nil, + is_active: nil, + last_name: nil, + manager: nil, + middle_name: nil + ) + end + + sig do + override + .returns( + { + id: T::Boolean, + department: T::Boolean, + first_name: T::Boolean, + is_active: T::Boolean, + last_name: T::Boolean, + manager: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager, + middle_name: T::Boolean + } + ) + end + def to_hash + end + + class Manager < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def id + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def id=(_) + end + + sig { params(id: T::Boolean).void } + def initialize(id: nil) + end + + sig { override.returns({id: T::Boolean}) } + def to_hash + end + end + end + + class Paging < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def count + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def count=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def offset + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def offset=(_) + end + + sig { params(count: T::Boolean, offset: T::Boolean).void } + def initialize(count: nil, offset: nil) + end + + sig { override.returns({count: T::Boolean, offset: T::Boolean}) } + def to_hash + end + end + end + + class Employment < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def id + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def id=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def class_code + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def class_code=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def custom_fields + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def custom_fields=(_) + end + + sig do + returns( + T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Department) + ) + end + def department + end + + sig do + params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Department) + .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Department) + end + def department=(_) + end + + sig do + returns( + T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Employment) + ) + end + def employment + end + + sig do + params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Employment) + .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Employment) + end + def employment=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def employment_status + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def employment_status=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def end_date + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def end_date=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def first_name + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def first_name=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Income)) } + def income + end + + sig do + params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Income) + .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Income) + end + def income=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def income_history + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def income_history=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def is_active + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def is_active=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def last_name + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def last_name=(_) + end + + sig do + returns( + T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Location) + ) + end + def location + end + + sig do + params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Location) + .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Location) + end + def location=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Manager)) } + def manager + end + + sig do + params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Manager) + .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Manager) + end + def manager=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def middle_name + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def middle_name=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def start_date + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def start_date=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def title + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def title=(_) + end + + sig do + params( + id: T::Boolean, + class_code: T::Boolean, + custom_fields: T::Boolean, + department: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Department, + employment: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Employment, + employment_status: T::Boolean, + end_date: T::Boolean, + first_name: T::Boolean, + income: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Income, + income_history: T::Boolean, + is_active: T::Boolean, + last_name: T::Boolean, + location: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Location, + manager: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Manager, + middle_name: T::Boolean, + start_date: T::Boolean, + title: T::Boolean + ) + .void + end + def initialize( + id: nil, + class_code: nil, + custom_fields: nil, + department: nil, + employment: nil, + employment_status: nil, + end_date: nil, + first_name: nil, + income: nil, + income_history: nil, + is_active: nil, + last_name: nil, + location: nil, + manager: nil, + middle_name: nil, + start_date: nil, + title: nil + ) + end + + sig do + override + .returns( + { + id: T::Boolean, + class_code: T::Boolean, + custom_fields: T::Boolean, + department: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Department, + employment: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Employment, + employment_status: T::Boolean, + end_date: T::Boolean, + first_name: T::Boolean, + income: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Income, + income_history: T::Boolean, + is_active: T::Boolean, + last_name: T::Boolean, + location: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Location, + manager: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Manager, + middle_name: T::Boolean, + start_date: T::Boolean, + title: T::Boolean + } + ) + end + def to_hash + end + + class Department < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def name + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def name=(_) + end + + sig { params(name: T::Boolean).void } + def initialize(name: nil) + end + + sig { override.returns({name: T::Boolean}) } + def to_hash + end + end + + class Employment < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def subtype + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def subtype=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def type + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def type=(_) + end + + sig { params(subtype: T::Boolean, type: T::Boolean).void } + def initialize(subtype: nil, type: nil) + end + + sig { override.returns({subtype: T::Boolean, type: T::Boolean}) } + def to_hash + end + end + + class Income < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def amount + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def amount=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def currency + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def currency=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def unit + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def unit=(_) + end + + sig { params(amount: T::Boolean, currency: T::Boolean, unit: T::Boolean).void } + def initialize(amount: nil, currency: nil, unit: nil) + end + + sig { override.returns({amount: T::Boolean, currency: T::Boolean, unit: T::Boolean}) } + def to_hash + end + end + + class Location < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def city + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def city=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def country + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def country=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def line1 + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def line1=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def line2 + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def line2=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def postal_code + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def postal_code=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def state + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def state=(_) + end + + sig do + params( + city: T::Boolean, + country: T::Boolean, + line1: T::Boolean, + line2: T::Boolean, + postal_code: T::Boolean, + state: T::Boolean + ) + .void + end + def initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil) + end + + sig do + override + .returns( + { + city: T::Boolean, + country: T::Boolean, + line1: T::Boolean, + line2: T::Boolean, + postal_code: T::Boolean, + state: T::Boolean + } + ) + end + def to_hash + end + end + + class Manager < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def id + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def id=(_) + end + + sig { params(id: T::Boolean).void } + def initialize(id: nil) + end + + sig { override.returns({id: T::Boolean}) } + def to_hash + end + end + end + + class Individual < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def id + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def id=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def dob + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def dob=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Emails)) } + def emails + end + + sig do + params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Emails) + .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Emails) + end + def emails=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def encrypted_ssn + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def encrypted_ssn=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def ethnicity + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def ethnicity=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def first_name + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def first_name=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def gender + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def gender=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def last_name + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def last_name=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def middle_name + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def middle_name=(_) + end + + sig do + returns( + T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::PhoneNumbers) + ) + end + def phone_numbers + end + + sig do + params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::PhoneNumbers) + .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::PhoneNumbers) + end + def phone_numbers=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def preferred_name + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def preferred_name=(_) + end + + sig do + returns( + T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Residence) + ) + end + def residence + end + + sig do + params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Residence) + .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Residence) + end + def residence=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def ssn + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def ssn=(_) + end + + sig do + params( + id: T::Boolean, + dob: T::Boolean, + emails: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Emails, + encrypted_ssn: T::Boolean, + ethnicity: T::Boolean, + first_name: T::Boolean, + gender: T::Boolean, + last_name: T::Boolean, + middle_name: T::Boolean, + phone_numbers: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::PhoneNumbers, + preferred_name: T::Boolean, + residence: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Residence, + ssn: T::Boolean + ) + .void + end + def initialize( + id: nil, + dob: nil, + emails: nil, + encrypted_ssn: nil, + ethnicity: nil, + first_name: nil, + gender: nil, + last_name: nil, + middle_name: nil, + phone_numbers: nil, + preferred_name: nil, + residence: nil, + ssn: nil + ) + end + + sig do + override + .returns( + { + id: T::Boolean, + dob: T::Boolean, + emails: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Emails, + encrypted_ssn: T::Boolean, + ethnicity: T::Boolean, + first_name: T::Boolean, + gender: T::Boolean, + last_name: T::Boolean, + middle_name: T::Boolean, + phone_numbers: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::PhoneNumbers, + preferred_name: T::Boolean, + residence: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Residence, + ssn: T::Boolean + } + ) + end + def to_hash + end + + class Emails < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def data + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def data=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def type + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def type=(_) + end + + sig { params(data: T::Boolean, type: T::Boolean).void } + def initialize(data: nil, type: nil) + end + + sig { override.returns({data: T::Boolean, type: T::Boolean}) } + def to_hash + end + end + + class PhoneNumbers < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def data + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def data=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def type + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def type=(_) + end + + sig { params(data: T::Boolean, type: T::Boolean).void } + def initialize(data: nil, type: nil) + end + + sig { override.returns({data: T::Boolean, type: T::Boolean}) } + def to_hash + end + end + + class Residence < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def city + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def city=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def country + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def country=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def line1 + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def line1=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def line2 + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def line2=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def postal_code + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def postal_code=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def state + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def state=(_) + end + + sig do + params( + city: T::Boolean, + country: T::Boolean, + line1: T::Boolean, + line2: T::Boolean, + postal_code: T::Boolean, + state: T::Boolean + ) + .void + end + def initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil) + end + + sig do + override + .returns( + { + city: T::Boolean, + country: T::Boolean, + line1: T::Boolean, + line2: T::Boolean, + postal_code: T::Boolean, + state: T::Boolean + } + ) + end + def to_hash + end + end + end + + class PayGroup < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def id + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def id=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def individual_ids + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def individual_ids=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def name + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def name=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def pay_frequencies + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def pay_frequencies=(_) + end + + sig do + params( + id: T::Boolean, + individual_ids: T::Boolean, + name: T::Boolean, + pay_frequencies: T::Boolean + ).void + end + def initialize(id: nil, individual_ids: nil, name: nil, pay_frequencies: nil) + end + + sig do + override + .returns({ + id: T::Boolean, + individual_ids: T::Boolean, + name: T::Boolean, + pay_frequencies: T::Boolean + }) + end + def to_hash + end + end + + class PayStatement < FinchAPI::BaseModel + sig do + returns( + T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::Paging) + ) + end + def paging + end + + sig do + params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::Paging) + .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::Paging) + end + def paging=(_) + end + + sig do + returns( + T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements) + ) + end + def pay_statements + end + + sig do + params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements) + .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements) + end + def pay_statements=(_) + end + + sig do + params( + paging: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::Paging, + pay_statements: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements + ) + .void + end + def initialize(paging: nil, pay_statements: nil) + end + + sig do + override + .returns( + { + paging: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::Paging, + pay_statements: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements + } + ) + end + def to_hash + end + + class Paging < FinchAPI::BaseModel + sig { returns(T::Boolean) } + def count + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def count=(_) + end + + sig { returns(T::Boolean) } + def offset + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def offset=(_) + end + + sig { params(count: T::Boolean, offset: T::Boolean).void } + def initialize(count:, offset:) + end + + sig { override.returns({count: T::Boolean, offset: T::Boolean}) } + def to_hash + end + end + + class PayStatements < FinchAPI::BaseModel + sig do + returns( + T.nilable( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings + ) + ) + end + def earnings + end + + sig do + params( + _: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings + ) + .returns( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings + ) + end + def earnings=(_) + end + + sig do + returns( + T.nilable( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployeeDeductions + ) + ) + end + def employee_deductions + end + + sig do + params( + _: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployeeDeductions + ) + .returns( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployeeDeductions + ) + end + def employee_deductions=(_) + end + + sig do + returns( + T.nilable( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployerContributions + ) + ) + end + def employer_contributions + end + + sig do + params( + _: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployerContributions + ) + .returns( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployerContributions + ) + end + def employer_contributions=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def gross_pay + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def gross_pay=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def individual_id + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def individual_id=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def net_pay + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def net_pay=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def payment_method + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def payment_method=(_) + end + + sig do + returns( + T.nilable( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Taxes + ) + ) + end + def taxes + end + + sig do + params( + _: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Taxes + ) + .returns( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Taxes + ) + end + def taxes=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def total_hours + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def total_hours=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def type + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def type=(_) + end + + sig do + params( + earnings: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings, + employee_deductions: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployeeDeductions, + employer_contributions: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployerContributions, + gross_pay: T::Boolean, + individual_id: T::Boolean, + net_pay: T::Boolean, + payment_method: T::Boolean, + taxes: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Taxes, + total_hours: T::Boolean, + type: T::Boolean + ) + .void + end + def initialize( + earnings: nil, + employee_deductions: nil, + employer_contributions: nil, + gross_pay: nil, + individual_id: nil, + net_pay: nil, + payment_method: nil, + taxes: nil, + total_hours: nil, + type: nil + ) + end + + sig do + override + .returns( + { + earnings: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings, + employee_deductions: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployeeDeductions, + employer_contributions: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployerContributions, + gross_pay: T::Boolean, + individual_id: T::Boolean, + net_pay: T::Boolean, + payment_method: T::Boolean, + taxes: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Taxes, + total_hours: T::Boolean, + type: T::Boolean + } + ) + end + def to_hash + end + + class Earnings < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def amount + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def amount=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def currency + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def currency=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def name + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def name=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def type + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def type=(_) + end + + sig do + params(amount: T::Boolean, currency: T::Boolean, name: T::Boolean, type: T::Boolean).void + end + def initialize(amount: nil, currency: nil, name: nil, type: nil) + end + + sig do + override.returns( + { + amount: T::Boolean, + currency: T::Boolean, + name: T::Boolean, + type: T::Boolean + } + ) + end + def to_hash + end + end + + class EmployeeDeductions < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def amount + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def amount=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def currency + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def currency=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def name + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def name=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def pre_tax + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def pre_tax=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def type + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def type=(_) + end + + sig do + params( + amount: T::Boolean, + currency: T::Boolean, + name: T::Boolean, + pre_tax: T::Boolean, + type: T::Boolean + ) + .void + end + def initialize(amount: nil, currency: nil, name: nil, pre_tax: nil, type: nil) + end + + sig do + override + .returns( + { + amount: T::Boolean, + currency: T::Boolean, + name: T::Boolean, + pre_tax: T::Boolean, + type: T::Boolean + } + ) + end + def to_hash + end + end + + class EmployerContributions < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def amount + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def amount=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def currency + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def currency=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def name + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def name=(_) + end + + sig { params(amount: T::Boolean, currency: T::Boolean, name: T::Boolean).void } + def initialize(amount: nil, currency: nil, name: nil) + end + + sig { override.returns({amount: T::Boolean, currency: T::Boolean, name: T::Boolean}) } + def to_hash + end + end + + class Taxes < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def amount + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def amount=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def currency + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def currency=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def employer + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def employer=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def name + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def name=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def type + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def type=(_) + end + + sig do + params( + amount: T::Boolean, + currency: T::Boolean, + employer: T::Boolean, + name: T::Boolean, + type: T::Boolean + ) + .void + end + def initialize(amount: nil, currency: nil, employer: nil, name: nil, type: nil) + end + + sig do + override + .returns( + { + amount: T::Boolean, + currency: T::Boolean, + employer: T::Boolean, + name: T::Boolean, + type: T::Boolean + } + ) + end + def to_hash + end + end + end + end + + class Payment < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def id + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def id=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def company_debit + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def company_debit=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def debit_date + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def debit_date=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def employee_taxes + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def employee_taxes=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def employer_taxes + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def employer_taxes=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def gross_pay + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def gross_pay=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def individual_ids + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def individual_ids=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def net_pay + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def net_pay=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def pay_date + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def pay_date=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def pay_frequencies + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def pay_frequencies=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def pay_group_ids + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def pay_group_ids=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment::PayPeriod)) } + def pay_period + end + + sig do + params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment::PayPeriod) + .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment::PayPeriod) + end + def pay_period=(_) + end + + sig do + params( + id: T::Boolean, + company_debit: T::Boolean, + debit_date: T::Boolean, + employee_taxes: T::Boolean, + employer_taxes: T::Boolean, + gross_pay: T::Boolean, + individual_ids: T::Boolean, + net_pay: T::Boolean, + pay_date: T::Boolean, + pay_frequencies: T::Boolean, + pay_group_ids: T::Boolean, + pay_period: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment::PayPeriod + ) + .void + end + def initialize( + id: nil, + company_debit: nil, + debit_date: nil, + employee_taxes: nil, + employer_taxes: nil, + gross_pay: nil, + individual_ids: nil, + net_pay: nil, + pay_date: nil, + pay_frequencies: nil, + pay_group_ids: nil, + pay_period: nil + ) + end + + sig do + override + .returns( + { + id: T::Boolean, + company_debit: T::Boolean, + debit_date: T::Boolean, + employee_taxes: T::Boolean, + employer_taxes: T::Boolean, + gross_pay: T::Boolean, + individual_ids: T::Boolean, + net_pay: T::Boolean, + pay_date: T::Boolean, + pay_frequencies: T::Boolean, + pay_group_ids: T::Boolean, + pay_period: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment::PayPeriod + } + ) + end + def to_hash + end + + class PayPeriod < FinchAPI::BaseModel + sig { returns(T.nilable(T::Boolean)) } + def end_date + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def end_date=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def start_date + end + + sig { params(_: T::Boolean).returns(T::Boolean) } + def start_date=(_) + end + + sig { params(end_date: T::Boolean, start_date: T::Boolean).void } + def initialize(end_date: nil, start_date: nil) + end + + sig { override.returns({end_date: T::Boolean, start_date: T::Boolean}) } + def to_hash + end + end + end + end + + class Type < FinchAPI::Enum + abstract! + + ASSISTED = :assisted + CREDENTIAL = :credential + API_TOKEN = :api_token + API_CREDENTIAL = :api_credential + OAUTH = :oauth + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/provider_list_params.rbi b/rbi/lib/finch-api/models/provider_list_params.rbi new file mode 100644 index 00000000..f4339070 --- /dev/null +++ b/rbi/lib/finch-api/models/provider_list_params.rbi @@ -0,0 +1,18 @@ +# typed: strong + +module FinchAPI + module Models + class ProviderListParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + sig { params(request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])).void } + def initialize(request_options: {}) + end + + sig { override.returns({request_options: FinchAPI::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/finch-api/models/request_forwarding_forward_params.rbi b/rbi/lib/finch-api/models/request_forwarding_forward_params.rbi new file mode 100644 index 00000000..ec90cff9 --- /dev/null +++ b/rbi/lib/finch-api/models/request_forwarding_forward_params.rbi @@ -0,0 +1,80 @@ +# typed: strong + +module FinchAPI + module Models + class RequestForwardingForwardParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + sig { returns(String) } + def method_ + end + + sig { params(_: String).returns(String) } + def method_=(_) + end + + sig { returns(String) } + def route + end + + sig { params(_: String).returns(String) } + def route=(_) + end + + sig { returns(T.nilable(String)) } + def data + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def data=(_) + end + + sig { returns(T.nilable(T.anything)) } + def headers + end + + sig { params(_: T.nilable(T.anything)).returns(T.nilable(T.anything)) } + def headers=(_) + end + + sig { returns(T.nilable(T.anything)) } + def params + end + + sig { params(_: T.nilable(T.anything)).returns(T.nilable(T.anything)) } + def params=(_) + end + + sig do + params( + method_: String, + route: String, + data: T.nilable(String), + headers: T.nilable(T.anything), + params: T.nilable(T.anything), + request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + ) + .void + end + def initialize(method_:, route:, data: nil, headers: nil, params: nil, request_options: {}) + end + + sig do + override + .returns( + { + method_: String, + route: String, + data: T.nilable(String), + headers: T.nilable(T.anything), + params: T.nilable(T.anything), + request_options: FinchAPI::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lib/finch-api/models/request_forwarding_forward_response.rbi b/rbi/lib/finch-api/models/request_forwarding_forward_response.rbi new file mode 100644 index 00000000..653c39c3 --- /dev/null +++ b/rbi/lib/finch-api/models/request_forwarding_forward_response.rbi @@ -0,0 +1,138 @@ +# typed: strong + +module FinchAPI + module Models + class RequestForwardingForwardResponse < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def data + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def data=(_) + end + + sig { returns(T.nilable(T.anything)) } + def headers + end + + sig { params(_: T.nilable(T.anything)).returns(T.nilable(T.anything)) } + def headers=(_) + end + + sig { returns(FinchAPI::Models::RequestForwardingForwardResponse::Request) } + def request + end + + sig do + params(_: FinchAPI::Models::RequestForwardingForwardResponse::Request) + .returns(FinchAPI::Models::RequestForwardingForwardResponse::Request) + end + def request=(_) + end + + sig { returns(Integer) } + def status_code + end + + sig { params(_: Integer).returns(Integer) } + def status_code=(_) + end + + sig do + params( + data: T.nilable(String), + headers: T.nilable(T.anything), + request: FinchAPI::Models::RequestForwardingForwardResponse::Request, + status_code: Integer + ) + .void + end + def initialize(data:, headers:, request:, status_code:) + end + + sig do + override + .returns( + { + data: T.nilable(String), + headers: T.nilable(T.anything), + request: FinchAPI::Models::RequestForwardingForwardResponse::Request, + status_code: Integer + } + ) + end + def to_hash + end + + class Request < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def data + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def data=(_) + end + + sig { returns(T.nilable(T.anything)) } + def headers + end + + sig { params(_: T.nilable(T.anything)).returns(T.nilable(T.anything)) } + def headers=(_) + end + + sig { returns(String) } + def method_ + end + + sig { params(_: String).returns(String) } + def method_=(_) + end + + sig { returns(T.nilable(T.anything)) } + def params + end + + sig { params(_: T.nilable(T.anything)).returns(T.nilable(T.anything)) } + def params=(_) + end + + sig { returns(String) } + def route + end + + sig { params(_: String).returns(String) } + def route=(_) + end + + sig do + params( + data: T.nilable(String), + headers: T.nilable(T.anything), + method_: String, + params: T.nilable(T.anything), + route: String + ) + .void + end + def initialize(data:, headers:, method_:, params:, route:) + end + + sig do + override + .returns( + { + data: T.nilable(String), + headers: T.nilable(T.anything), + method_: String, + params: T.nilable(T.anything), + route: String + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/sandbox/company_update_params.rbi b/rbi/lib/finch-api/models/sandbox/company_update_params.rbi new file mode 100644 index 00000000..086cbf4d --- /dev/null +++ b/rbi/lib/finch-api/models/sandbox/company_update_params.rbi @@ -0,0 +1,336 @@ +# typed: strong + +module FinchAPI + module Models + module Sandbox + class CompanyUpdateParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + sig { returns(T.nilable(T::Array[FinchAPI::Models::Sandbox::CompanyUpdateParams::Account])) } + def accounts + end + + sig do + params(_: T.nilable(T::Array[FinchAPI::Models::Sandbox::CompanyUpdateParams::Account])) + .returns(T.nilable(T::Array[FinchAPI::Models::Sandbox::CompanyUpdateParams::Account])) + end + def accounts=(_) + end + + sig { returns(T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateParams::Department)])) } + def departments + end + + sig do + params(_: T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateParams::Department)])) + .returns(T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateParams::Department)])) + end + def departments=(_) + end + + sig { returns(T.nilable(String)) } + def ein + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def ein=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity)) } + def entity + end + + sig do + params(_: T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity)) + .returns(T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity)) + end + def entity=(_) + end + + sig { returns(T.nilable(String)) } + def legal_name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def legal_name=(_) + end + + sig { returns(T.nilable(T::Array[T.nilable(FinchAPI::Models::Location)])) } + def locations + end + + sig do + params(_: T.nilable(T::Array[T.nilable(FinchAPI::Models::Location)])) + .returns(T.nilable(T::Array[T.nilable(FinchAPI::Models::Location)])) + end + def locations=(_) + end + + sig { returns(T.nilable(String)) } + def primary_email + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def primary_email=(_) + end + + sig { returns(T.nilable(String)) } + def primary_phone_number + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def primary_phone_number=(_) + end + + sig do + params( + accounts: T.nilable(T::Array[FinchAPI::Models::Sandbox::CompanyUpdateParams::Account]), + departments: T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateParams::Department)]), + ein: T.nilable(String), + entity: T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity), + legal_name: T.nilable(String), + locations: T.nilable(T::Array[T.nilable(FinchAPI::Models::Location)]), + primary_email: T.nilable(String), + primary_phone_number: T.nilable(String), + request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + ) + .void + end + def initialize( + accounts:, + departments:, + ein:, + entity:, + legal_name:, + locations:, + primary_email:, + primary_phone_number:, + request_options: {} + ) + end + + sig do + override + .returns( + { + accounts: T.nilable(T::Array[FinchAPI::Models::Sandbox::CompanyUpdateParams::Account]), + departments: T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateParams::Department)]), + ein: T.nilable(String), + entity: T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity), + legal_name: T.nilable(String), + locations: T.nilable(T::Array[T.nilable(FinchAPI::Models::Location)]), + primary_email: T.nilable(String), + primary_phone_number: T.nilable(String), + request_options: FinchAPI::RequestOptions + } + ) + end + def to_hash + end + + class Account < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def account_name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def account_name=(_) + end + + sig { returns(T.nilable(String)) } + def account_number + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def account_number=(_) + end + + sig { returns(T.nilable(Symbol)) } + def account_type + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def account_type=(_) + end + + sig { returns(T.nilable(String)) } + def institution_name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def institution_name=(_) + end + + sig { returns(T.nilable(String)) } + def routing_number + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def routing_number=(_) + end + + sig do + params( + account_name: T.nilable(String), + account_number: T.nilable(String), + account_type: T.nilable(Symbol), + institution_name: T.nilable(String), + routing_number: T.nilable(String) + ) + .void + end + def initialize( + account_name: nil, + account_number: nil, + account_type: nil, + institution_name: nil, + routing_number: nil + ) + end + + sig do + override + .returns( + { + account_name: T.nilable(String), + account_number: T.nilable(String), + account_type: T.nilable(Symbol), + institution_name: T.nilable(String), + routing_number: T.nilable(String) + } + ) + end + def to_hash + end + + class AccountType < FinchAPI::Enum + abstract! + + CHECKING = T.let(:checking, T.nilable(Symbol)) + SAVINGS = T.let(:savings, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + + class Department < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def name=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateParams::Department::Parent)) } + def parent + end + + sig do + params(_: T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateParams::Department::Parent)) + .returns(T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateParams::Department::Parent)) + end + def parent=(_) + end + + sig do + params( + name: T.nilable(String), + parent: T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateParams::Department::Parent) + ) + .void + end + def initialize(name: nil, parent: nil) + end + + sig do + override + .returns( + { + name: T.nilable(String), + parent: T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateParams::Department::Parent) + } + ) + end + def to_hash + end + + class Parent < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def name=(_) + end + + sig { params(name: T.nilable(String)).void } + def initialize(name: nil) + end + + sig { override.returns({name: T.nilable(String)}) } + def to_hash + end + end + end + + class Entity < FinchAPI::BaseModel + sig { returns(T.nilable(Symbol)) } + def subtype + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def subtype=(_) + end + + sig { returns(T.nilable(Symbol)) } + def type + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def type=(_) + end + + sig { params(subtype: T.nilable(Symbol), type: T.nilable(Symbol)).void } + def initialize(subtype: nil, type: nil) + end + + sig { override.returns({subtype: T.nilable(Symbol), type: T.nilable(Symbol)}) } + def to_hash + end + + class Subtype < FinchAPI::Enum + abstract! + + S_CORPORATION = T.let(:s_corporation, T.nilable(Symbol)) + C_CORPORATION = T.let(:c_corporation, T.nilable(Symbol)) + B_CORPORATION = T.let(:b_corporation, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + + class Type < FinchAPI::Enum + abstract! + + LLC = T.let(:llc, T.nilable(Symbol)) + LP = T.let(:lp, T.nilable(Symbol)) + CORPORATION = T.let(:corporation, T.nilable(Symbol)) + SOLE_PROPRIETOR = T.let(:sole_proprietor, T.nilable(Symbol)) + NON_PROFIT = T.let(:non_profit, T.nilable(Symbol)) + PARTNERSHIP = T.let(:partnership, T.nilable(Symbol)) + COOPERATIVE = T.let(:cooperative, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/sandbox/company_update_response.rbi b/rbi/lib/finch-api/models/sandbox/company_update_response.rbi new file mode 100644 index 00000000..5f86de5e --- /dev/null +++ b/rbi/lib/finch-api/models/sandbox/company_update_response.rbi @@ -0,0 +1,330 @@ +# typed: strong + +module FinchAPI + module Models + module Sandbox + class CompanyUpdateResponse < FinchAPI::BaseModel + sig { returns(T.nilable(T::Array[FinchAPI::Models::Sandbox::CompanyUpdateResponse::Account])) } + def accounts + end + + sig do + params(_: T.nilable(T::Array[FinchAPI::Models::Sandbox::CompanyUpdateResponse::Account])) + .returns(T.nilable(T::Array[FinchAPI::Models::Sandbox::CompanyUpdateResponse::Account])) + end + def accounts=(_) + end + + sig { returns(T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department)])) } + def departments + end + + sig do + params(_: T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department)])) + .returns(T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department)])) + end + def departments=(_) + end + + sig { returns(T.nilable(String)) } + def ein + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def ein=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity)) } + def entity + end + + sig do + params(_: T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity)) + .returns(T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity)) + end + def entity=(_) + end + + sig { returns(T.nilable(String)) } + def legal_name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def legal_name=(_) + end + + sig { returns(T.nilable(T::Array[T.nilable(FinchAPI::Models::Location)])) } + def locations + end + + sig do + params(_: T.nilable(T::Array[T.nilable(FinchAPI::Models::Location)])) + .returns(T.nilable(T::Array[T.nilable(FinchAPI::Models::Location)])) + end + def locations=(_) + end + + sig { returns(T.nilable(String)) } + def primary_email + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def primary_email=(_) + end + + sig { returns(T.nilable(String)) } + def primary_phone_number + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def primary_phone_number=(_) + end + + sig do + params( + accounts: T.nilable(T::Array[FinchAPI::Models::Sandbox::CompanyUpdateResponse::Account]), + departments: T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department)]), + ein: T.nilable(String), + entity: T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity), + legal_name: T.nilable(String), + locations: T.nilable(T::Array[T.nilable(FinchAPI::Models::Location)]), + primary_email: T.nilable(String), + primary_phone_number: T.nilable(String) + ) + .void + end + def initialize( + accounts:, + departments:, + ein:, + entity:, + legal_name:, + locations:, + primary_email:, + primary_phone_number: + ) + end + + sig do + override + .returns( + { + accounts: T.nilable(T::Array[FinchAPI::Models::Sandbox::CompanyUpdateResponse::Account]), + departments: T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department)]), + ein: T.nilable(String), + entity: T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity), + legal_name: T.nilable(String), + locations: T.nilable(T::Array[T.nilable(FinchAPI::Models::Location)]), + primary_email: T.nilable(String), + primary_phone_number: T.nilable(String) + } + ) + end + def to_hash + end + + class Account < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def account_name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def account_name=(_) + end + + sig { returns(T.nilable(String)) } + def account_number + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def account_number=(_) + end + + sig { returns(T.nilable(Symbol)) } + def account_type + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def account_type=(_) + end + + sig { returns(T.nilable(String)) } + def institution_name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def institution_name=(_) + end + + sig { returns(T.nilable(String)) } + def routing_number + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def routing_number=(_) + end + + sig do + params( + account_name: T.nilable(String), + account_number: T.nilable(String), + account_type: T.nilable(Symbol), + institution_name: T.nilable(String), + routing_number: T.nilable(String) + ) + .void + end + def initialize( + account_name: nil, + account_number: nil, + account_type: nil, + institution_name: nil, + routing_number: nil + ) + end + + sig do + override + .returns( + { + account_name: T.nilable(String), + account_number: T.nilable(String), + account_type: T.nilable(Symbol), + institution_name: T.nilable(String), + routing_number: T.nilable(String) + } + ) + end + def to_hash + end + + class AccountType < FinchAPI::Enum + abstract! + + CHECKING = T.let(:checking, T.nilable(Symbol)) + SAVINGS = T.let(:savings, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + + class Department < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def name=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department::Parent)) } + def parent + end + + sig do + params(_: T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department::Parent)) + .returns(T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department::Parent)) + end + def parent=(_) + end + + sig do + params( + name: T.nilable(String), + parent: T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department::Parent) + ) + .void + end + def initialize(name: nil, parent: nil) + end + + sig do + override + .returns( + { + name: T.nilable(String), + parent: T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department::Parent) + } + ) + end + def to_hash + end + + class Parent < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def name=(_) + end + + sig { params(name: T.nilable(String)).void } + def initialize(name: nil) + end + + sig { override.returns({name: T.nilable(String)}) } + def to_hash + end + end + end + + class Entity < FinchAPI::BaseModel + sig { returns(T.nilable(Symbol)) } + def subtype + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def subtype=(_) + end + + sig { returns(T.nilable(Symbol)) } + def type + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def type=(_) + end + + sig { params(subtype: T.nilable(Symbol), type: T.nilable(Symbol)).void } + def initialize(subtype: nil, type: nil) + end + + sig { override.returns({subtype: T.nilable(Symbol), type: T.nilable(Symbol)}) } + def to_hash + end + + class Subtype < FinchAPI::Enum + abstract! + + S_CORPORATION = T.let(:s_corporation, T.nilable(Symbol)) + C_CORPORATION = T.let(:c_corporation, T.nilable(Symbol)) + B_CORPORATION = T.let(:b_corporation, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + + class Type < FinchAPI::Enum + abstract! + + LLC = T.let(:llc, T.nilable(Symbol)) + LP = T.let(:lp, T.nilable(Symbol)) + CORPORATION = T.let(:corporation, T.nilable(Symbol)) + SOLE_PROPRIETOR = T.let(:sole_proprietor, T.nilable(Symbol)) + NON_PROFIT = T.let(:non_profit, T.nilable(Symbol)) + PARTNERSHIP = T.let(:partnership, T.nilable(Symbol)) + COOPERATIVE = T.let(:cooperative, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/sandbox/connection_create_params.rbi b/rbi/lib/finch-api/models/sandbox/connection_create_params.rbi new file mode 100644 index 00000000..8f2ad1a0 --- /dev/null +++ b/rbi/lib/finch-api/models/sandbox/connection_create_params.rbi @@ -0,0 +1,91 @@ +# typed: strong + +module FinchAPI + module Models + module Sandbox + class ConnectionCreateParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + sig { returns(String) } + def provider_id + end + + sig { params(_: String).returns(String) } + def provider_id=(_) + end + + sig { returns(T.nilable(Symbol)) } + def authentication_type + end + + sig { params(_: Symbol).returns(Symbol) } + def authentication_type=(_) + end + + sig { returns(T.nilable(Integer)) } + def employee_size + end + + sig { params(_: Integer).returns(Integer) } + def employee_size=(_) + end + + sig { returns(T.nilable(T::Array[String])) } + def products + end + + sig { params(_: T::Array[String]).returns(T::Array[String]) } + def products=(_) + end + + sig do + params( + provider_id: String, + authentication_type: Symbol, + employee_size: Integer, + products: T::Array[String], + request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + ) + .void + end + def initialize( + provider_id:, + authentication_type: nil, + employee_size: nil, + products: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + provider_id: String, + authentication_type: Symbol, + employee_size: Integer, + products: T::Array[String], + request_options: FinchAPI::RequestOptions + } + ) + end + def to_hash + end + + class AuthenticationType < FinchAPI::Enum + abstract! + + CREDENTIAL = :credential + API_TOKEN = :api_token + OAUTH = :oauth + ASSISTED = :assisted + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/sandbox/connection_create_response.rbi b/rbi/lib/finch-api/models/sandbox/connection_create_response.rbi new file mode 100644 index 00000000..21a1d9ad --- /dev/null +++ b/rbi/lib/finch-api/models/sandbox/connection_create_response.rbi @@ -0,0 +1,129 @@ +# typed: strong + +module FinchAPI + module Models + module Sandbox + class ConnectionCreateResponse < FinchAPI::BaseModel + sig { returns(String) } + def access_token + end + + sig { params(_: String).returns(String) } + def access_token=(_) + end + + sig { returns(String) } + def account_id + end + + sig { params(_: String).returns(String) } + def account_id=(_) + end + + sig { returns(Symbol) } + def authentication_type + end + + sig { params(_: Symbol).returns(Symbol) } + def authentication_type=(_) + end + + sig { returns(String) } + def company_id + end + + sig { params(_: String).returns(String) } + def company_id=(_) + end + + sig { returns(String) } + def connection_id + end + + sig { params(_: String).returns(String) } + def connection_id=(_) + end + + sig { returns(T::Array[String]) } + def products + end + + sig { params(_: T::Array[String]).returns(T::Array[String]) } + def products=(_) + end + + sig { returns(String) } + def provider_id + end + + sig { params(_: String).returns(String) } + def provider_id=(_) + end + + sig { returns(T.nilable(String)) } + def token_type + end + + sig { params(_: String).returns(String) } + def token_type=(_) + end + + sig do + params( + access_token: String, + account_id: String, + authentication_type: Symbol, + company_id: String, + connection_id: String, + products: T::Array[String], + provider_id: String, + token_type: String + ) + .void + end + def initialize( + access_token:, + account_id:, + authentication_type:, + company_id:, + connection_id:, + products:, + provider_id:, + token_type: nil + ) + end + + sig do + override + .returns( + { + access_token: String, + account_id: String, + authentication_type: Symbol, + company_id: String, + connection_id: String, + products: T::Array[String], + provider_id: String, + token_type: String + } + ) + end + def to_hash + end + + class AuthenticationType < FinchAPI::Enum + abstract! + + CREDENTIAL = :credential + API_TOKEN = :api_token + OAUTH = :oauth + ASSISTED = :assisted + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/sandbox/connections/account_create_params.rbi b/rbi/lib/finch-api/models/sandbox/connections/account_create_params.rbi new file mode 100644 index 00000000..9022f32e --- /dev/null +++ b/rbi/lib/finch-api/models/sandbox/connections/account_create_params.rbi @@ -0,0 +1,93 @@ +# typed: strong + +module FinchAPI + module Models + module Sandbox + module Connections + class AccountCreateParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + sig { returns(String) } + def company_id + end + + sig { params(_: String).returns(String) } + def company_id=(_) + end + + sig { returns(String) } + def provider_id + end + + sig { params(_: String).returns(String) } + def provider_id=(_) + end + + sig { returns(T.nilable(Symbol)) } + def authentication_type + end + + sig { params(_: Symbol).returns(Symbol) } + def authentication_type=(_) + end + + sig { returns(T.nilable(T::Array[String])) } + def products + end + + sig { params(_: T::Array[String]).returns(T::Array[String]) } + def products=(_) + end + + sig do + params( + company_id: String, + provider_id: String, + authentication_type: Symbol, + products: T::Array[String], + request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + ) + .void + end + def initialize( + company_id:, + provider_id:, + authentication_type: nil, + products: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + company_id: String, + provider_id: String, + authentication_type: Symbol, + products: T::Array[String], + request_options: FinchAPI::RequestOptions + } + ) + end + def to_hash + end + + class AuthenticationType < FinchAPI::Enum + abstract! + + CREDENTIAL = :credential + API_TOKEN = :api_token + OAUTH = :oauth + ASSISTED = :assisted + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/sandbox/connections/account_create_response.rbi b/rbi/lib/finch-api/models/sandbox/connections/account_create_response.rbi new file mode 100644 index 00000000..dc7eb0cd --- /dev/null +++ b/rbi/lib/finch-api/models/sandbox/connections/account_create_response.rbi @@ -0,0 +1,120 @@ +# typed: strong + +module FinchAPI + module Models + module Sandbox + module Connections + class AccountCreateResponse < FinchAPI::BaseModel + sig { returns(String) } + def access_token + end + + sig { params(_: String).returns(String) } + def access_token=(_) + end + + sig { returns(String) } + def account_id + end + + sig { params(_: String).returns(String) } + def account_id=(_) + end + + sig { returns(Symbol) } + def authentication_type + end + + sig { params(_: Symbol).returns(Symbol) } + def authentication_type=(_) + end + + sig { returns(String) } + def company_id + end + + sig { params(_: String).returns(String) } + def company_id=(_) + end + + sig { returns(String) } + def connection_id + end + + sig { params(_: String).returns(String) } + def connection_id=(_) + end + + sig { returns(T::Array[String]) } + def products + end + + sig { params(_: T::Array[String]).returns(T::Array[String]) } + def products=(_) + end + + sig { returns(String) } + def provider_id + end + + sig { params(_: String).returns(String) } + def provider_id=(_) + end + + sig do + params( + access_token: String, + account_id: String, + authentication_type: Symbol, + company_id: String, + connection_id: String, + products: T::Array[String], + provider_id: String + ) + .void + end + def initialize( + access_token:, + account_id:, + authentication_type:, + company_id:, + connection_id:, + products:, + provider_id: + ) + end + + sig do + override + .returns( + { + access_token: String, + account_id: String, + authentication_type: Symbol, + company_id: String, + connection_id: String, + products: T::Array[String], + provider_id: String + } + ) + end + def to_hash + end + + class AuthenticationType < FinchAPI::Enum + abstract! + + CREDENTIAL = :credential + API_TOKEN = :api_token + OAUTH = :oauth + ASSISTED = :assisted + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/sandbox/connections/account_update_params.rbi b/rbi/lib/finch-api/models/sandbox/connections/account_update_params.rbi new file mode 100644 index 00000000..68e7e533 --- /dev/null +++ b/rbi/lib/finch-api/models/sandbox/connections/account_update_params.rbi @@ -0,0 +1,36 @@ +# typed: strong + +module FinchAPI + module Models + module Sandbox + module Connections + class AccountUpdateParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + sig { returns(T.nilable(Symbol)) } + def connection_status + end + + sig { params(_: Symbol).returns(Symbol) } + def connection_status=(_) + end + + sig do + params( + connection_status: Symbol, + request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + ) + .void + end + def initialize(connection_status: nil, request_options: {}) + end + + sig { override.returns({connection_status: Symbol, request_options: FinchAPI::RequestOptions}) } + def to_hash + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/sandbox/connections/account_update_response.rbi b/rbi/lib/finch-api/models/sandbox/connections/account_update_response.rbi new file mode 100644 index 00000000..a78fca46 --- /dev/null +++ b/rbi/lib/finch-api/models/sandbox/connections/account_update_response.rbi @@ -0,0 +1,109 @@ +# typed: strong + +module FinchAPI + module Models + module Sandbox + module Connections + class AccountUpdateResponse < FinchAPI::BaseModel + sig { returns(String) } + def account_id + end + + sig { params(_: String).returns(String) } + def account_id=(_) + end + + sig { returns(Symbol) } + def authentication_type + end + + sig { params(_: Symbol).returns(Symbol) } + def authentication_type=(_) + end + + sig { returns(String) } + def company_id + end + + sig { params(_: String).returns(String) } + def company_id=(_) + end + + sig { returns(T::Array[String]) } + def products + end + + sig { params(_: T::Array[String]).returns(T::Array[String]) } + def products=(_) + end + + sig { returns(String) } + def provider_id + end + + sig { params(_: String).returns(String) } + def provider_id=(_) + end + + sig { returns(T.nilable(String)) } + def connection_id + end + + sig { params(_: String).returns(String) } + def connection_id=(_) + end + + sig do + params( + account_id: String, + authentication_type: Symbol, + company_id: String, + products: T::Array[String], + provider_id: String, + connection_id: String + ) + .void + end + def initialize( + account_id:, + authentication_type:, + company_id:, + products:, + provider_id:, + connection_id: nil + ) + end + + sig do + override + .returns( + { + account_id: String, + authentication_type: Symbol, + company_id: String, + products: T::Array[String], + provider_id: String, + connection_id: String + } + ) + end + def to_hash + end + + class AuthenticationType < FinchAPI::Enum + abstract! + + CREDENTIAL = :credential + API_TOKEN = :api_token + OAUTH = :oauth + ASSISTED = :assisted + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/sandbox/directory_create_params.rbi b/rbi/lib/finch-api/models/sandbox/directory_create_params.rbi new file mode 100644 index 00000000..9b66a4da --- /dev/null +++ b/rbi/lib/finch-api/models/sandbox/directory_create_params.rbi @@ -0,0 +1,629 @@ +# typed: strong + +module FinchAPI + module Models + module Sandbox + class DirectoryCreateParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + sig { returns(T.nilable(T::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body])) } + def body + end + + sig do + params(_: T::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body]) + .returns(T::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body]) + end + def body=(_) + end + + sig do + params( + body: T::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body], + request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + ) + .void + end + def initialize(body: nil, request_options: {}) + end + + sig do + override + .returns( + { + body: T::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body], + request_options: FinchAPI::RequestOptions + } + ) + end + def to_hash + end + + class Body < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def class_code + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def class_code=(_) + end + + sig { returns(T.nilable(T::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::CustomField])) } + def custom_fields + end + + sig do + params(_: T::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::CustomField]) + .returns(T::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::CustomField]) + end + def custom_fields=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Department)) } + def department + end + + sig do + params(_: T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Department)) + .returns(T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Department)) + end + def department=(_) + end + + sig { returns(T.nilable(String)) } + def dob + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def dob=(_) + end + + sig { returns(T.nilable(T::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Email])) } + def emails + end + + sig do + params(_: T.nilable(T::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Email])) + .returns(T.nilable(T::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Email])) + end + def emails=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment)) } + def employment + end + + sig do + params(_: T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment)) + .returns(T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment)) + end + def employment=(_) + end + + sig { returns(T.nilable(Symbol)) } + def employment_status + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def employment_status=(_) + end + + sig { returns(T.nilable(String)) } + def encrypted_ssn + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def encrypted_ssn=(_) + end + + sig { returns(T.nilable(String)) } + def end_date + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def end_date=(_) + end + + sig { returns(T.nilable(Symbol)) } + def ethnicity + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def ethnicity=(_) + end + + sig { returns(T.nilable(String)) } + def first_name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def first_name=(_) + end + + sig { returns(T.nilable(Symbol)) } + def gender + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def gender=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Income)) } + def income + end + + sig { params(_: T.nilable(FinchAPI::Models::Income)).returns(T.nilable(FinchAPI::Models::Income)) } + def income=(_) + end + + sig { returns(T.nilable(T::Array[T.nilable(FinchAPI::Models::Income)])) } + def income_history + end + + sig do + params(_: T.nilable(T::Array[T.nilable(FinchAPI::Models::Income)])) + .returns(T.nilable(T::Array[T.nilable(FinchAPI::Models::Income)])) + end + def income_history=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def is_active + end + + sig { params(_: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } + def is_active=(_) + end + + sig { returns(T.nilable(String)) } + def last_name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def last_name=(_) + end + + sig { returns(T.nilable(String)) } + def latest_rehire_date + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def latest_rehire_date=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Location)) } + def location + end + + sig { params(_: T.nilable(FinchAPI::Models::Location)).returns(T.nilable(FinchAPI::Models::Location)) } + def location=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Manager)) } + def manager + end + + sig do + params(_: T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Manager)) + .returns(T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Manager)) + end + def manager=(_) + end + + sig { returns(T.nilable(String)) } + def middle_name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def middle_name=(_) + end + + sig do + returns( + T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::PhoneNumber)]) + ) + end + def phone_numbers + end + + sig do + params( + _: T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::PhoneNumber)]) + ) + .returns( + T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::PhoneNumber)]) + ) + end + def phone_numbers=(_) + end + + sig { returns(T.nilable(String)) } + def preferred_name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def preferred_name=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Location)) } + def residence + end + + sig { params(_: T.nilable(FinchAPI::Models::Location)).returns(T.nilable(FinchAPI::Models::Location)) } + def residence=(_) + end + + sig { returns(T.nilable(String)) } + def source_id + end + + sig { params(_: String).returns(String) } + def source_id=(_) + end + + sig { returns(T.nilable(String)) } + def ssn + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def ssn=(_) + end + + sig { returns(T.nilable(String)) } + def start_date + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def start_date=(_) + end + + sig { returns(T.nilable(String)) } + def title + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def title=(_) + end + + sig do + params( + class_code: T.nilable(String), + custom_fields: T::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::CustomField], + department: T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Department), + dob: T.nilable(String), + emails: T.nilable(T::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Email]), + employment: T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment), + employment_status: T.nilable(Symbol), + encrypted_ssn: T.nilable(String), + end_date: T.nilable(String), + ethnicity: T.nilable(Symbol), + first_name: T.nilable(String), + gender: T.nilable(Symbol), + income: T.nilable(FinchAPI::Models::Income), + income_history: T.nilable(T::Array[T.nilable(FinchAPI::Models::Income)]), + is_active: T.nilable(T::Boolean), + last_name: T.nilable(String), + latest_rehire_date: T.nilable(String), + location: T.nilable(FinchAPI::Models::Location), + manager: T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Manager), + middle_name: T.nilable(String), + phone_numbers: T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::PhoneNumber)]), + preferred_name: T.nilable(String), + residence: T.nilable(FinchAPI::Models::Location), + source_id: String, + ssn: T.nilable(String), + start_date: T.nilable(String), + title: T.nilable(String) + ) + .void + end + def initialize( + class_code: nil, + custom_fields: nil, + department: nil, + dob: nil, + emails: nil, + employment: nil, + employment_status: nil, + encrypted_ssn: nil, + end_date: nil, + ethnicity: nil, + first_name: nil, + gender: nil, + income: nil, + income_history: nil, + is_active: nil, + last_name: nil, + latest_rehire_date: nil, + location: nil, + manager: nil, + middle_name: nil, + phone_numbers: nil, + preferred_name: nil, + residence: nil, + source_id: nil, + ssn: nil, + start_date: nil, + title: nil + ) + end + + sig do + override + .returns( + { + class_code: T.nilable(String), + custom_fields: T::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::CustomField], + department: T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Department), + dob: T.nilable(String), + emails: T.nilable(T::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Email]), + employment: T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment), + employment_status: T.nilable(Symbol), + encrypted_ssn: T.nilable(String), + end_date: T.nilable(String), + ethnicity: T.nilable(Symbol), + first_name: T.nilable(String), + gender: T.nilable(Symbol), + income: T.nilable(FinchAPI::Models::Income), + income_history: T.nilable(T::Array[T.nilable(FinchAPI::Models::Income)]), + is_active: T.nilable(T::Boolean), + last_name: T.nilable(String), + latest_rehire_date: T.nilable(String), + location: T.nilable(FinchAPI::Models::Location), + manager: T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Manager), + middle_name: T.nilable(String), + phone_numbers: T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::PhoneNumber)]), + preferred_name: T.nilable(String), + residence: T.nilable(FinchAPI::Models::Location), + source_id: String, + ssn: T.nilable(String), + start_date: T.nilable(String), + title: T.nilable(String) + } + ) + end + def to_hash + end + + class CustomField < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def name=(_) + end + + sig { returns(T.nilable(T.anything)) } + def value + end + + sig { params(_: T.anything).returns(T.anything) } + def value=(_) + end + + sig { params(name: T.nilable(String), value: T.anything).void } + def initialize(name: nil, value: nil) + end + + sig { override.returns({name: T.nilable(String), value: T.anything}) } + def to_hash + end + end + + class Department < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def name=(_) + end + + sig { params(name: T.nilable(String)).void } + def initialize(name: nil) + end + + sig { override.returns({name: T.nilable(String)}) } + def to_hash + end + end + + class Email < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def data + end + + sig { params(_: String).returns(String) } + def data=(_) + end + + sig { returns(T.nilable(Symbol)) } + def type + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def type=(_) + end + + sig { params(data: String, type: T.nilable(Symbol)).void } + def initialize(data: nil, type: nil) + end + + sig { override.returns({data: String, type: T.nilable(Symbol)}) } + def to_hash + end + + class Type < FinchAPI::Enum + abstract! + + WORK = T.let(:work, T.nilable(Symbol)) + PERSONAL = T.let(:personal, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + + class Employment < FinchAPI::BaseModel + sig { returns(T.nilable(Symbol)) } + def subtype + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def subtype=(_) + end + + sig { returns(T.nilable(Symbol)) } + def type + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def type=(_) + end + + sig { params(subtype: T.nilable(Symbol), type: T.nilable(Symbol)).void } + def initialize(subtype: nil, type: nil) + end + + sig { override.returns({subtype: T.nilable(Symbol), type: T.nilable(Symbol)}) } + def to_hash + end + + class Subtype < FinchAPI::Enum + abstract! + + FULL_TIME = T.let(:full_time, T.nilable(Symbol)) + INTERN = T.let(:intern, T.nilable(Symbol)) + PART_TIME = T.let(:part_time, T.nilable(Symbol)) + TEMP = T.let(:temp, T.nilable(Symbol)) + SEASONAL = T.let(:seasonal, T.nilable(Symbol)) + INDIVIDUAL_CONTRACTOR = T.let(:individual_contractor, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + + class Type < FinchAPI::Enum + abstract! + + EMPLOYEE = T.let(:employee, T.nilable(Symbol)) + CONTRACTOR = T.let(:contractor, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + + class EmploymentStatus < FinchAPI::Enum + abstract! + + ACTIVE = T.let(:active, T.nilable(Symbol)) + DECEASED = T.let(:deceased, T.nilable(Symbol)) + LEAVE = T.let(:leave, T.nilable(Symbol)) + ONBOARDING = T.let(:onboarding, T.nilable(Symbol)) + PREHIRE = T.let(:prehire, T.nilable(Symbol)) + RETIRED = T.let(:retired, T.nilable(Symbol)) + TERMINATED = T.let(:terminated, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + + class Ethnicity < FinchAPI::Enum + abstract! + + ASIAN = T.let(:asian, T.nilable(Symbol)) + WHITE = T.let(:white, T.nilable(Symbol)) + BLACK_OR_AFRICAN_AMERICAN = T.let(:black_or_african_american, T.nilable(Symbol)) + NATIVE_HAWAIIAN_OR_PACIFIC_ISLANDER = T.let( + :native_hawaiian_or_pacific_islander, + T.nilable(Symbol) + ) + AMERICAN_INDIAN_OR_ALASKA_NATIVE = T.let(:american_indian_or_alaska_native, T.nilable(Symbol)) + HISPANIC_OR_LATINO = T.let(:hispanic_or_latino, T.nilable(Symbol)) + TWO_OR_MORE_RACES = T.let(:two_or_more_races, T.nilable(Symbol)) + DECLINE_TO_SPECIFY = T.let(:decline_to_specify, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + + class Gender < FinchAPI::Enum + abstract! + + FEMALE = T.let(:female, T.nilable(Symbol)) + MALE = T.let(:male, T.nilable(Symbol)) + OTHER = T.let(:other, T.nilable(Symbol)) + DECLINE_TO_SPECIFY = T.let(:decline_to_specify, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + + class Manager < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def id + end + + sig { params(_: String).returns(String) } + def id=(_) + end + + sig { params(id: String).void } + def initialize(id: nil) + end + + sig { override.returns({id: String}) } + def to_hash + end + end + + class PhoneNumber < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def data + end + + sig { params(_: String).returns(String) } + def data=(_) + end + + sig { returns(T.nilable(Symbol)) } + def type + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def type=(_) + end + + sig { params(data: String, type: T.nilable(Symbol)).void } + def initialize(data: nil, type: nil) + end + + sig { override.returns({data: String, type: T.nilable(Symbol)}) } + def to_hash + end + + class Type < FinchAPI::Enum + abstract! + + WORK = T.let(:work, T.nilable(Symbol)) + PERSONAL = T.let(:personal, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/sandbox/directory_create_response.rbi b/rbi/lib/finch-api/models/sandbox/directory_create_response.rbi new file mode 100644 index 00000000..5098437d --- /dev/null +++ b/rbi/lib/finch-api/models/sandbox/directory_create_response.rbi @@ -0,0 +1,9 @@ +# typed: strong + +module FinchAPI + module Models + module Sandbox + DirectoryCreateResponse = T.type_alias { T::Array[T.anything] } + end + end +end diff --git a/rbi/lib/finch-api/models/sandbox/employment_update_params.rbi b/rbi/lib/finch-api/models/sandbox/employment_update_params.rbi new file mode 100644 index 00000000..97e7af6b --- /dev/null +++ b/rbi/lib/finch-api/models/sandbox/employment_update_params.rbi @@ -0,0 +1,377 @@ +# typed: strong + +module FinchAPI + module Models + module Sandbox + class EmploymentUpdateParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + sig { returns(T.nilable(String)) } + def class_code + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def class_code=(_) + end + + sig { returns(T.nilable(T::Array[FinchAPI::Models::Sandbox::EmploymentUpdateParams::CustomField])) } + def custom_fields + end + + sig do + params(_: T::Array[FinchAPI::Models::Sandbox::EmploymentUpdateParams::CustomField]) + .returns(T::Array[FinchAPI::Models::Sandbox::EmploymentUpdateParams::CustomField]) + end + def custom_fields=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Department)) } + def department + end + + sig do + params(_: T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Department)) + .returns(T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Department)) + end + def department=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment)) } + def employment + end + + sig do + params(_: T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment)) + .returns(T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment)) + end + def employment=(_) + end + + sig { returns(T.nilable(Symbol)) } + def employment_status + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def employment_status=(_) + end + + sig { returns(T.nilable(String)) } + def end_date + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def end_date=(_) + end + + sig { returns(T.nilable(String)) } + def first_name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def first_name=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Income)) } + def income + end + + sig { params(_: T.nilable(FinchAPI::Models::Income)).returns(T.nilable(FinchAPI::Models::Income)) } + def income=(_) + end + + sig { returns(T.nilable(T::Array[T.nilable(FinchAPI::Models::Income)])) } + def income_history + end + + sig do + params(_: T.nilable(T::Array[T.nilable(FinchAPI::Models::Income)])) + .returns(T.nilable(T::Array[T.nilable(FinchAPI::Models::Income)])) + end + def income_history=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def is_active + end + + sig { params(_: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } + def is_active=(_) + end + + sig { returns(T.nilable(String)) } + def last_name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def last_name=(_) + end + + sig { returns(T.nilable(String)) } + def latest_rehire_date + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def latest_rehire_date=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Location)) } + def location + end + + sig { params(_: T.nilable(FinchAPI::Models::Location)).returns(T.nilable(FinchAPI::Models::Location)) } + def location=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Manager)) } + def manager + end + + sig do + params(_: T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Manager)) + .returns(T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Manager)) + end + def manager=(_) + end + + sig { returns(T.nilable(String)) } + def middle_name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def middle_name=(_) + end + + sig { returns(T.nilable(String)) } + def source_id + end + + sig { params(_: String).returns(String) } + def source_id=(_) + end + + sig { returns(T.nilable(String)) } + def start_date + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def start_date=(_) + end + + sig { returns(T.nilable(String)) } + def title + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def title=(_) + end + + sig do + params( + class_code: T.nilable(String), + custom_fields: T::Array[FinchAPI::Models::Sandbox::EmploymentUpdateParams::CustomField], + department: T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Department), + employment: T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment), + employment_status: T.nilable(Symbol), + end_date: T.nilable(String), + first_name: T.nilable(String), + income: T.nilable(FinchAPI::Models::Income), + income_history: T.nilable(T::Array[T.nilable(FinchAPI::Models::Income)]), + is_active: T.nilable(T::Boolean), + last_name: T.nilable(String), + latest_rehire_date: T.nilable(String), + location: T.nilable(FinchAPI::Models::Location), + manager: T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Manager), + middle_name: T.nilable(String), + source_id: String, + start_date: T.nilable(String), + title: T.nilable(String), + request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + ) + .void + end + def initialize( + class_code: nil, + custom_fields: nil, + department: nil, + employment: nil, + employment_status: nil, + end_date: nil, + first_name: nil, + income: nil, + income_history: nil, + is_active: nil, + last_name: nil, + latest_rehire_date: nil, + location: nil, + manager: nil, + middle_name: nil, + source_id: nil, + start_date: nil, + title: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + class_code: T.nilable(String), + custom_fields: T::Array[FinchAPI::Models::Sandbox::EmploymentUpdateParams::CustomField], + department: T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Department), + employment: T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment), + employment_status: T.nilable(Symbol), + end_date: T.nilable(String), + first_name: T.nilable(String), + income: T.nilable(FinchAPI::Models::Income), + income_history: T.nilable(T::Array[T.nilable(FinchAPI::Models::Income)]), + is_active: T.nilable(T::Boolean), + last_name: T.nilable(String), + latest_rehire_date: T.nilable(String), + location: T.nilable(FinchAPI::Models::Location), + manager: T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Manager), + middle_name: T.nilable(String), + source_id: String, + start_date: T.nilable(String), + title: T.nilable(String), + request_options: FinchAPI::RequestOptions + } + ) + end + def to_hash + end + + class CustomField < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def name=(_) + end + + sig { returns(T.nilable(T.anything)) } + def value + end + + sig { params(_: T.anything).returns(T.anything) } + def value=(_) + end + + sig { params(name: T.nilable(String), value: T.anything).void } + def initialize(name: nil, value: nil) + end + + sig { override.returns({name: T.nilable(String), value: T.anything}) } + def to_hash + end + end + + class Department < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def name=(_) + end + + sig { params(name: T.nilable(String)).void } + def initialize(name: nil) + end + + sig { override.returns({name: T.nilable(String)}) } + def to_hash + end + end + + class Employment < FinchAPI::BaseModel + sig { returns(T.nilable(Symbol)) } + def subtype + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def subtype=(_) + end + + sig { returns(T.nilable(Symbol)) } + def type + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def type=(_) + end + + sig { params(subtype: T.nilable(Symbol), type: T.nilable(Symbol)).void } + def initialize(subtype: nil, type: nil) + end + + sig { override.returns({subtype: T.nilable(Symbol), type: T.nilable(Symbol)}) } + def to_hash + end + + class Subtype < FinchAPI::Enum + abstract! + + FULL_TIME = T.let(:full_time, T.nilable(Symbol)) + INTERN = T.let(:intern, T.nilable(Symbol)) + PART_TIME = T.let(:part_time, T.nilable(Symbol)) + TEMP = T.let(:temp, T.nilable(Symbol)) + SEASONAL = T.let(:seasonal, T.nilable(Symbol)) + INDIVIDUAL_CONTRACTOR = T.let(:individual_contractor, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + + class Type < FinchAPI::Enum + abstract! + + EMPLOYEE = T.let(:employee, T.nilable(Symbol)) + CONTRACTOR = T.let(:contractor, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + + class EmploymentStatus < FinchAPI::Enum + abstract! + + ACTIVE = T.let(:active, T.nilable(Symbol)) + DECEASED = T.let(:deceased, T.nilable(Symbol)) + LEAVE = T.let(:leave, T.nilable(Symbol)) + ONBOARDING = T.let(:onboarding, T.nilable(Symbol)) + PREHIRE = T.let(:prehire, T.nilable(Symbol)) + RETIRED = T.let(:retired, T.nilable(Symbol)) + TERMINATED = T.let(:terminated, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + + class Manager < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def id + end + + sig { params(_: String).returns(String) } + def id=(_) + end + + sig { params(id: String).void } + def initialize(id: nil) + end + + sig { override.returns({id: String}) } + def to_hash + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/sandbox/employment_update_response.rbi b/rbi/lib/finch-api/models/sandbox/employment_update_response.rbi new file mode 100644 index 00000000..8b3d459d --- /dev/null +++ b/rbi/lib/finch-api/models/sandbox/employment_update_response.rbi @@ -0,0 +1,382 @@ +# typed: strong + +module FinchAPI + module Models + module Sandbox + class EmploymentUpdateResponse < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def id + end + + sig { params(_: String).returns(String) } + def id=(_) + end + + sig { returns(T.nilable(String)) } + def class_code + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def class_code=(_) + end + + sig { returns(T.nilable(T::Array[FinchAPI::Models::Sandbox::EmploymentUpdateResponse::CustomField])) } + def custom_fields + end + + sig do + params(_: T::Array[FinchAPI::Models::Sandbox::EmploymentUpdateResponse::CustomField]) + .returns(T::Array[FinchAPI::Models::Sandbox::EmploymentUpdateResponse::CustomField]) + end + def custom_fields=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Department)) } + def department + end + + sig do + params(_: T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Department)) + .returns(T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Department)) + end + def department=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment)) } + def employment + end + + sig do + params(_: T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment)) + .returns(T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment)) + end + def employment=(_) + end + + sig { returns(T.nilable(Symbol)) } + def employment_status + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def employment_status=(_) + end + + sig { returns(T.nilable(String)) } + def end_date + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def end_date=(_) + end + + sig { returns(T.nilable(String)) } + def first_name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def first_name=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Income)) } + def income + end + + sig { params(_: T.nilable(FinchAPI::Models::Income)).returns(T.nilable(FinchAPI::Models::Income)) } + def income=(_) + end + + sig { returns(T.nilable(T::Array[T.nilable(FinchAPI::Models::Income)])) } + def income_history + end + + sig do + params(_: T.nilable(T::Array[T.nilable(FinchAPI::Models::Income)])) + .returns(T.nilable(T::Array[T.nilable(FinchAPI::Models::Income)])) + end + def income_history=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def is_active + end + + sig { params(_: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } + def is_active=(_) + end + + sig { returns(T.nilable(String)) } + def last_name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def last_name=(_) + end + + sig { returns(T.nilable(String)) } + def latest_rehire_date + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def latest_rehire_date=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Location)) } + def location + end + + sig { params(_: T.nilable(FinchAPI::Models::Location)).returns(T.nilable(FinchAPI::Models::Location)) } + def location=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Manager)) } + def manager + end + + sig do + params(_: T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Manager)) + .returns(T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Manager)) + end + def manager=(_) + end + + sig { returns(T.nilable(String)) } + def middle_name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def middle_name=(_) + end + + sig { returns(T.nilable(String)) } + def source_id + end + + sig { params(_: String).returns(String) } + def source_id=(_) + end + + sig { returns(T.nilable(String)) } + def start_date + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def start_date=(_) + end + + sig { returns(T.nilable(String)) } + def title + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def title=(_) + end + + sig do + params( + id: String, + class_code: T.nilable(String), + custom_fields: T::Array[FinchAPI::Models::Sandbox::EmploymentUpdateResponse::CustomField], + department: T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Department), + employment: T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment), + employment_status: T.nilable(Symbol), + end_date: T.nilable(String), + first_name: T.nilable(String), + income: T.nilable(FinchAPI::Models::Income), + income_history: T.nilable(T::Array[T.nilable(FinchAPI::Models::Income)]), + is_active: T.nilable(T::Boolean), + last_name: T.nilable(String), + latest_rehire_date: T.nilable(String), + location: T.nilable(FinchAPI::Models::Location), + manager: T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Manager), + middle_name: T.nilable(String), + source_id: String, + start_date: T.nilable(String), + title: T.nilable(String) + ) + .void + end + def initialize( + id: nil, + class_code: nil, + custom_fields: nil, + department: nil, + employment: nil, + employment_status: nil, + end_date: nil, + first_name: nil, + income: nil, + income_history: nil, + is_active: nil, + last_name: nil, + latest_rehire_date: nil, + location: nil, + manager: nil, + middle_name: nil, + source_id: nil, + start_date: nil, + title: nil + ) + end + + sig do + override + .returns( + { + id: String, + class_code: T.nilable(String), + custom_fields: T::Array[FinchAPI::Models::Sandbox::EmploymentUpdateResponse::CustomField], + department: T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Department), + employment: T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment), + employment_status: T.nilable(Symbol), + end_date: T.nilable(String), + first_name: T.nilable(String), + income: T.nilable(FinchAPI::Models::Income), + income_history: T.nilable(T::Array[T.nilable(FinchAPI::Models::Income)]), + is_active: T.nilable(T::Boolean), + last_name: T.nilable(String), + latest_rehire_date: T.nilable(String), + location: T.nilable(FinchAPI::Models::Location), + manager: T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Manager), + middle_name: T.nilable(String), + source_id: String, + start_date: T.nilable(String), + title: T.nilable(String) + } + ) + end + def to_hash + end + + class CustomField < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def name=(_) + end + + sig { returns(T.nilable(T.anything)) } + def value + end + + sig { params(_: T.anything).returns(T.anything) } + def value=(_) + end + + sig { params(name: T.nilable(String), value: T.anything).void } + def initialize(name: nil, value: nil) + end + + sig { override.returns({name: T.nilable(String), value: T.anything}) } + def to_hash + end + end + + class Department < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def name=(_) + end + + sig { params(name: T.nilable(String)).void } + def initialize(name: nil) + end + + sig { override.returns({name: T.nilable(String)}) } + def to_hash + end + end + + class Employment < FinchAPI::BaseModel + sig { returns(T.nilable(Symbol)) } + def subtype + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def subtype=(_) + end + + sig { returns(T.nilable(Symbol)) } + def type + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def type=(_) + end + + sig { params(subtype: T.nilable(Symbol), type: T.nilable(Symbol)).void } + def initialize(subtype: nil, type: nil) + end + + sig { override.returns({subtype: T.nilable(Symbol), type: T.nilable(Symbol)}) } + def to_hash + end + + class Subtype < FinchAPI::Enum + abstract! + + FULL_TIME = T.let(:full_time, T.nilable(Symbol)) + INTERN = T.let(:intern, T.nilable(Symbol)) + PART_TIME = T.let(:part_time, T.nilable(Symbol)) + TEMP = T.let(:temp, T.nilable(Symbol)) + SEASONAL = T.let(:seasonal, T.nilable(Symbol)) + INDIVIDUAL_CONTRACTOR = T.let(:individual_contractor, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + + class Type < FinchAPI::Enum + abstract! + + EMPLOYEE = T.let(:employee, T.nilable(Symbol)) + CONTRACTOR = T.let(:contractor, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + + class EmploymentStatus < FinchAPI::Enum + abstract! + + ACTIVE = T.let(:active, T.nilable(Symbol)) + DECEASED = T.let(:deceased, T.nilable(Symbol)) + LEAVE = T.let(:leave, T.nilable(Symbol)) + ONBOARDING = T.let(:onboarding, T.nilable(Symbol)) + PREHIRE = T.let(:prehire, T.nilable(Symbol)) + RETIRED = T.let(:retired, T.nilable(Symbol)) + TERMINATED = T.let(:terminated, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + + class Manager < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def id + end + + sig { params(_: String).returns(String) } + def id=(_) + end + + sig { params(id: String).void } + def initialize(id: nil) + end + + sig { override.returns({id: String}) } + def to_hash + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/sandbox/individual_update_params.rbi b/rbi/lib/finch-api/models/sandbox/individual_update_params.rbi new file mode 100644 index 00000000..f6d5c048 --- /dev/null +++ b/rbi/lib/finch-api/models/sandbox/individual_update_params.rbi @@ -0,0 +1,276 @@ +# typed: strong + +module FinchAPI + module Models + module Sandbox + class IndividualUpdateParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + sig { returns(T.nilable(String)) } + def dob + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def dob=(_) + end + + sig { returns(T.nilable(T::Array[FinchAPI::Models::Sandbox::IndividualUpdateParams::Email])) } + def emails + end + + sig do + params(_: T.nilable(T::Array[FinchAPI::Models::Sandbox::IndividualUpdateParams::Email])) + .returns(T.nilable(T::Array[FinchAPI::Models::Sandbox::IndividualUpdateParams::Email])) + end + def emails=(_) + end + + sig { returns(T.nilable(String)) } + def encrypted_ssn + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def encrypted_ssn=(_) + end + + sig { returns(T.nilable(Symbol)) } + def ethnicity + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def ethnicity=(_) + end + + sig { returns(T.nilable(String)) } + def first_name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def first_name=(_) + end + + sig { returns(T.nilable(Symbol)) } + def gender + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def gender=(_) + end + + sig { returns(T.nilable(String)) } + def last_name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def last_name=(_) + end + + sig { returns(T.nilable(String)) } + def middle_name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def middle_name=(_) + end + + sig { returns(T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber)])) } + def phone_numbers + end + + sig do + params(_: T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber)])) + .returns(T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber)])) + end + def phone_numbers=(_) + end + + sig { returns(T.nilable(String)) } + def preferred_name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def preferred_name=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Location)) } + def residence + end + + sig { params(_: T.nilable(FinchAPI::Models::Location)).returns(T.nilable(FinchAPI::Models::Location)) } + def residence=(_) + end + + sig { returns(T.nilable(String)) } + def ssn + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def ssn=(_) + end + + sig do + params( + dob: T.nilable(String), + emails: T.nilable(T::Array[FinchAPI::Models::Sandbox::IndividualUpdateParams::Email]), + encrypted_ssn: T.nilable(String), + ethnicity: T.nilable(Symbol), + first_name: T.nilable(String), + gender: T.nilable(Symbol), + last_name: T.nilable(String), + middle_name: T.nilable(String), + phone_numbers: T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber)]), + preferred_name: T.nilable(String), + residence: T.nilable(FinchAPI::Models::Location), + ssn: T.nilable(String), + request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + ) + .void + end + def initialize( + dob: nil, + emails: nil, + encrypted_ssn: nil, + ethnicity: nil, + first_name: nil, + gender: nil, + last_name: nil, + middle_name: nil, + phone_numbers: nil, + preferred_name: nil, + residence: nil, + ssn: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + dob: T.nilable(String), + emails: T.nilable(T::Array[FinchAPI::Models::Sandbox::IndividualUpdateParams::Email]), + encrypted_ssn: T.nilable(String), + ethnicity: T.nilable(Symbol), + first_name: T.nilable(String), + gender: T.nilable(Symbol), + last_name: T.nilable(String), + middle_name: T.nilable(String), + phone_numbers: T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber)]), + preferred_name: T.nilable(String), + residence: T.nilable(FinchAPI::Models::Location), + ssn: T.nilable(String), + request_options: FinchAPI::RequestOptions + } + ) + end + def to_hash + end + + class Email < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def data + end + + sig { params(_: String).returns(String) } + def data=(_) + end + + sig { returns(T.nilable(Symbol)) } + def type + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def type=(_) + end + + sig { params(data: String, type: T.nilable(Symbol)).void } + def initialize(data: nil, type: nil) + end + + sig { override.returns({data: String, type: T.nilable(Symbol)}) } + def to_hash + end + + class Type < FinchAPI::Enum + abstract! + + WORK = T.let(:work, T.nilable(Symbol)) + PERSONAL = T.let(:personal, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + + class Ethnicity < FinchAPI::Enum + abstract! + + ASIAN = T.let(:asian, T.nilable(Symbol)) + WHITE = T.let(:white, T.nilable(Symbol)) + BLACK_OR_AFRICAN_AMERICAN = T.let(:black_or_african_american, T.nilable(Symbol)) + NATIVE_HAWAIIAN_OR_PACIFIC_ISLANDER = T.let(:native_hawaiian_or_pacific_islander, T.nilable(Symbol)) + AMERICAN_INDIAN_OR_ALASKA_NATIVE = T.let(:american_indian_or_alaska_native, T.nilable(Symbol)) + HISPANIC_OR_LATINO = T.let(:hispanic_or_latino, T.nilable(Symbol)) + TWO_OR_MORE_RACES = T.let(:two_or_more_races, T.nilable(Symbol)) + DECLINE_TO_SPECIFY = T.let(:decline_to_specify, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + + class Gender < FinchAPI::Enum + abstract! + + FEMALE = T.let(:female, T.nilable(Symbol)) + MALE = T.let(:male, T.nilable(Symbol)) + OTHER = T.let(:other, T.nilable(Symbol)) + DECLINE_TO_SPECIFY = T.let(:decline_to_specify, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + + class PhoneNumber < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def data + end + + sig { params(_: String).returns(String) } + def data=(_) + end + + sig { returns(T.nilable(Symbol)) } + def type + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def type=(_) + end + + sig { params(data: String, type: T.nilable(Symbol)).void } + def initialize(data: nil, type: nil) + end + + sig { override.returns({data: String, type: T.nilable(Symbol)}) } + def to_hash + end + + class Type < FinchAPI::Enum + abstract! + + WORK = T.let(:work, T.nilable(Symbol)) + PERSONAL = T.let(:personal, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/sandbox/individual_update_response.rbi b/rbi/lib/finch-api/models/sandbox/individual_update_response.rbi new file mode 100644 index 00000000..ff29b8b1 --- /dev/null +++ b/rbi/lib/finch-api/models/sandbox/individual_update_response.rbi @@ -0,0 +1,283 @@ +# typed: strong + +module FinchAPI + module Models + module Sandbox + class IndividualUpdateResponse < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def id + end + + sig { params(_: String).returns(String) } + def id=(_) + end + + sig { returns(T.nilable(String)) } + def dob + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def dob=(_) + end + + sig { returns(T.nilable(T::Array[FinchAPI::Models::Sandbox::IndividualUpdateResponse::Email])) } + def emails + end + + sig do + params(_: T.nilable(T::Array[FinchAPI::Models::Sandbox::IndividualUpdateResponse::Email])) + .returns(T.nilable(T::Array[FinchAPI::Models::Sandbox::IndividualUpdateResponse::Email])) + end + def emails=(_) + end + + sig { returns(T.nilable(String)) } + def encrypted_ssn + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def encrypted_ssn=(_) + end + + sig { returns(T.nilable(Symbol)) } + def ethnicity + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def ethnicity=(_) + end + + sig { returns(T.nilable(String)) } + def first_name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def first_name=(_) + end + + sig { returns(T.nilable(Symbol)) } + def gender + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def gender=(_) + end + + sig { returns(T.nilable(String)) } + def last_name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def last_name=(_) + end + + sig { returns(T.nilable(String)) } + def middle_name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def middle_name=(_) + end + + sig { returns(T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateResponse::PhoneNumber)])) } + def phone_numbers + end + + sig do + params( + _: T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateResponse::PhoneNumber)]) + ) + .returns(T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateResponse::PhoneNumber)])) + end + def phone_numbers=(_) + end + + sig { returns(T.nilable(String)) } + def preferred_name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def preferred_name=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Location)) } + def residence + end + + sig { params(_: T.nilable(FinchAPI::Models::Location)).returns(T.nilable(FinchAPI::Models::Location)) } + def residence=(_) + end + + sig { returns(T.nilable(String)) } + def ssn + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def ssn=(_) + end + + sig do + params( + id: String, + dob: T.nilable(String), + emails: T.nilable(T::Array[FinchAPI::Models::Sandbox::IndividualUpdateResponse::Email]), + encrypted_ssn: T.nilable(String), + ethnicity: T.nilable(Symbol), + first_name: T.nilable(String), + gender: T.nilable(Symbol), + last_name: T.nilable(String), + middle_name: T.nilable(String), + phone_numbers: T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateResponse::PhoneNumber)]), + preferred_name: T.nilable(String), + residence: T.nilable(FinchAPI::Models::Location), + ssn: T.nilable(String) + ) + .void + end + def initialize( + id: nil, + dob: nil, + emails: nil, + encrypted_ssn: nil, + ethnicity: nil, + first_name: nil, + gender: nil, + last_name: nil, + middle_name: nil, + phone_numbers: nil, + preferred_name: nil, + residence: nil, + ssn: nil + ) + end + + sig do + override + .returns( + { + id: String, + dob: T.nilable(String), + emails: T.nilable(T::Array[FinchAPI::Models::Sandbox::IndividualUpdateResponse::Email]), + encrypted_ssn: T.nilable(String), + ethnicity: T.nilable(Symbol), + first_name: T.nilable(String), + gender: T.nilable(Symbol), + last_name: T.nilable(String), + middle_name: T.nilable(String), + phone_numbers: T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateResponse::PhoneNumber)]), + preferred_name: T.nilable(String), + residence: T.nilable(FinchAPI::Models::Location), + ssn: T.nilable(String) + } + ) + end + def to_hash + end + + class Email < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def data + end + + sig { params(_: String).returns(String) } + def data=(_) + end + + sig { returns(T.nilable(Symbol)) } + def type + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def type=(_) + end + + sig { params(data: String, type: T.nilable(Symbol)).void } + def initialize(data: nil, type: nil) + end + + sig { override.returns({data: String, type: T.nilable(Symbol)}) } + def to_hash + end + + class Type < FinchAPI::Enum + abstract! + + WORK = T.let(:work, T.nilable(Symbol)) + PERSONAL = T.let(:personal, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + + class Ethnicity < FinchAPI::Enum + abstract! + + ASIAN = T.let(:asian, T.nilable(Symbol)) + WHITE = T.let(:white, T.nilable(Symbol)) + BLACK_OR_AFRICAN_AMERICAN = T.let(:black_or_african_american, T.nilable(Symbol)) + NATIVE_HAWAIIAN_OR_PACIFIC_ISLANDER = T.let(:native_hawaiian_or_pacific_islander, T.nilable(Symbol)) + AMERICAN_INDIAN_OR_ALASKA_NATIVE = T.let(:american_indian_or_alaska_native, T.nilable(Symbol)) + HISPANIC_OR_LATINO = T.let(:hispanic_or_latino, T.nilable(Symbol)) + TWO_OR_MORE_RACES = T.let(:two_or_more_races, T.nilable(Symbol)) + DECLINE_TO_SPECIFY = T.let(:decline_to_specify, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + + class Gender < FinchAPI::Enum + abstract! + + FEMALE = T.let(:female, T.nilable(Symbol)) + MALE = T.let(:male, T.nilable(Symbol)) + OTHER = T.let(:other, T.nilable(Symbol)) + DECLINE_TO_SPECIFY = T.let(:decline_to_specify, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + + class PhoneNumber < FinchAPI::BaseModel + sig { returns(T.nilable(String)) } + def data + end + + sig { params(_: String).returns(String) } + def data=(_) + end + + sig { returns(T.nilable(Symbol)) } + def type + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def type=(_) + end + + sig { params(data: String, type: T.nilable(Symbol)).void } + def initialize(data: nil, type: nil) + end + + sig { override.returns({data: String, type: T.nilable(Symbol)}) } + def to_hash + end + + class Type < FinchAPI::Enum + abstract! + + WORK = T.let(:work, T.nilable(Symbol)) + PERSONAL = T.let(:personal, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/sandbox/job_create_params.rbi b/rbi/lib/finch-api/models/sandbox/job_create_params.rbi new file mode 100644 index 00000000..732117ba --- /dev/null +++ b/rbi/lib/finch-api/models/sandbox/job_create_params.rbi @@ -0,0 +1,46 @@ +# typed: strong + +module FinchAPI + module Models + module Sandbox + class JobCreateParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + sig { returns(Symbol) } + def type + end + + sig { params(_: Symbol).returns(Symbol) } + def type=(_) + end + + sig do + params( + type: Symbol, + request_options: T.any( + FinchAPI::RequestOptions, + T::Hash[Symbol, T.anything] + ) + ).void + end + def initialize(type:, request_options: {}) + end + + sig { override.returns({type: Symbol, request_options: FinchAPI::RequestOptions}) } + def to_hash + end + + class Type < FinchAPI::Enum + abstract! + + DATA_SYNC_ALL = :data_sync_all + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/sandbox/job_create_response.rbi b/rbi/lib/finch-api/models/sandbox/job_create_response.rbi new file mode 100644 index 00000000..cdbcda55 --- /dev/null +++ b/rbi/lib/finch-api/models/sandbox/job_create_response.rbi @@ -0,0 +1,64 @@ +# typed: strong + +module FinchAPI + module Models + module Sandbox + class JobCreateResponse < FinchAPI::BaseModel + sig { returns(Integer) } + def allowed_refreshes + end + + sig { params(_: Integer).returns(Integer) } + def allowed_refreshes=(_) + end + + sig { returns(String) } + def job_id + end + + sig { params(_: String).returns(String) } + def job_id=(_) + end + + sig { returns(String) } + def job_url + end + + sig { params(_: String).returns(String) } + def job_url=(_) + end + + sig { returns(Integer) } + def remaining_refreshes + end + + sig { params(_: Integer).returns(Integer) } + def remaining_refreshes=(_) + end + + sig do + params( + allowed_refreshes: Integer, + job_id: String, + job_url: String, + remaining_refreshes: Integer + ).void + end + def initialize(allowed_refreshes:, job_id:, job_url:, remaining_refreshes:) + end + + sig do + override + .returns({ + allowed_refreshes: Integer, + job_id: String, + job_url: String, + remaining_refreshes: Integer + }) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/sandbox/jobs/configuration_retrieve_params.rbi b/rbi/lib/finch-api/models/sandbox/jobs/configuration_retrieve_params.rbi new file mode 100644 index 00000000..3c2ebe25 --- /dev/null +++ b/rbi/lib/finch-api/models/sandbox/jobs/configuration_retrieve_params.rbi @@ -0,0 +1,22 @@ +# typed: strong + +module FinchAPI + module Models + module Sandbox + module Jobs + class ConfigurationRetrieveParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + sig { params(request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])).void } + def initialize(request_options: {}) + end + + sig { override.returns({request_options: FinchAPI::RequestOptions}) } + def to_hash + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/sandbox/jobs/configuration_retrieve_response.rbi b/rbi/lib/finch-api/models/sandbox/jobs/configuration_retrieve_response.rbi new file mode 100644 index 00000000..98458307 --- /dev/null +++ b/rbi/lib/finch-api/models/sandbox/jobs/configuration_retrieve_response.rbi @@ -0,0 +1,11 @@ +# typed: strong + +module FinchAPI + module Models + module Sandbox + module Jobs + ConfigurationRetrieveResponse = T.type_alias { T::Array[FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration] } + end + end + end +end diff --git a/rbi/lib/finch-api/models/sandbox/jobs/configuration_update_params.rbi b/rbi/lib/finch-api/models/sandbox/jobs/configuration_update_params.rbi new file mode 100644 index 00000000..e4437abf --- /dev/null +++ b/rbi/lib/finch-api/models/sandbox/jobs/configuration_update_params.rbi @@ -0,0 +1,22 @@ +# typed: strong + +module FinchAPI + module Models + module Sandbox + module Jobs + class ConfigurationUpdateParams < FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + sig { params(request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])).void } + def initialize(request_options: {}) + end + + sig { override.returns({request_options: FinchAPI::RequestOptions}) } + def to_hash + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/sandbox/jobs/sandbox_job_configuration.rbi b/rbi/lib/finch-api/models/sandbox/jobs/sandbox_job_configuration.rbi new file mode 100644 index 00000000..24b3eae4 --- /dev/null +++ b/rbi/lib/finch-api/models/sandbox/jobs/sandbox_job_configuration.rbi @@ -0,0 +1,58 @@ +# typed: strong + +module FinchAPI + module Models + module Sandbox + module Jobs + class SandboxJobConfiguration < FinchAPI::BaseModel + sig { returns(Symbol) } + def completion_status + end + + sig { params(_: Symbol).returns(Symbol) } + def completion_status=(_) + end + + sig { returns(Symbol) } + def type + end + + sig { params(_: Symbol).returns(Symbol) } + def type=(_) + end + + sig { params(completion_status: Symbol, type: Symbol).void } + def initialize(completion_status:, type:) + end + + sig { override.returns({completion_status: Symbol, type: Symbol}) } + def to_hash + end + + class CompletionStatus < FinchAPI::Enum + abstract! + + COMPLETE = :complete + REAUTH_ERROR = :reauth_error + PERMISSIONS_ERROR = :permissions_error + ERROR = :error + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + + class Type < FinchAPI::Enum + abstract! + + DATA_SYNC_ALL = :data_sync_all + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/sandbox/payment_create_params.rbi b/rbi/lib/finch-api/models/sandbox/payment_create_params.rbi new file mode 100644 index 00000000..57fdc6e4 --- /dev/null +++ b/rbi/lib/finch-api/models/sandbox/payment_create_params.rbi @@ -0,0 +1,876 @@ +# typed: strong + +module FinchAPI + module Models + module Sandbox + class PaymentCreateParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + sig { returns(T.nilable(String)) } + def end_date + end + + sig { params(_: String).returns(String) } + def end_date=(_) + end + + sig { returns(T.nilable(T::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement])) } + def pay_statements + end + + sig do + params(_: T::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement]) + .returns(T::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement]) + end + def pay_statements=(_) + end + + sig { returns(T.nilable(String)) } + def start_date + end + + sig { params(_: String).returns(String) } + def start_date=(_) + end + + sig do + params( + end_date: String, + pay_statements: T::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement], + start_date: String, + request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + ) + .void + end + def initialize(end_date: nil, pay_statements: nil, start_date: nil, request_options: {}) + end + + sig do + override + .returns( + { + end_date: String, + pay_statements: T::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement], + start_date: String, + request_options: FinchAPI::RequestOptions + } + ) + end + def to_hash + end + + class PayStatement < FinchAPI::BaseModel + sig do + returns( + T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning)]) + ) + end + def earnings + end + + sig do + params( + _: T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning)]) + ) + .returns( + T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning)]) + ) + end + def earnings=(_) + end + + sig do + returns( + T.nilable( + T::Array[T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction)] + ) + ) + end + def employee_deductions + end + + sig do + params( + _: T.nilable( + T::Array[T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction)] + ) + ) + .returns( + T.nilable( + T::Array[T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction)] + ) + ) + end + def employee_deductions=(_) + end + + sig do + returns( + T.nilable( + T::Array[T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution)] + ) + ) + end + def employer_contributions + end + + sig do + params( + _: T.nilable( + T::Array[T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution)] + ) + ) + .returns( + T.nilable( + T::Array[T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution)] + ) + ) + end + def employer_contributions=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Money)) } + def gross_pay + end + + sig { params(_: T.nilable(FinchAPI::Models::Money)).returns(T.nilable(FinchAPI::Models::Money)) } + def gross_pay=(_) + end + + sig { returns(T.nilable(String)) } + def individual_id + end + + sig { params(_: String).returns(String) } + def individual_id=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Money)) } + def net_pay + end + + sig { params(_: T.nilable(FinchAPI::Models::Money)).returns(T.nilable(FinchAPI::Models::Money)) } + def net_pay=(_) + end + + sig { returns(T.nilable(Symbol)) } + def payment_method + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def payment_method=(_) + end + + sig { returns(T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax)])) } + def taxes + end + + sig do + params( + _: T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax)]) + ) + .returns(T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax)])) + end + def taxes=(_) + end + + sig { returns(T.nilable(Float)) } + def total_hours + end + + sig { params(_: T.nilable(Float)).returns(T.nilable(Float)) } + def total_hours=(_) + end + + sig { returns(T.nilable(Symbol)) } + def type + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def type=(_) + end + + sig do + params( + earnings: T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning)]), + employee_deductions: T.nilable( + T::Array[T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction)] + ), + employer_contributions: T.nilable( + T::Array[T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution)] + ), + gross_pay: T.nilable(FinchAPI::Models::Money), + individual_id: String, + net_pay: T.nilable(FinchAPI::Models::Money), + payment_method: T.nilable(Symbol), + taxes: T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax)]), + total_hours: T.nilable(Float), + type: T.nilable(Symbol) + ) + .void + end + def initialize( + earnings: nil, + employee_deductions: nil, + employer_contributions: nil, + gross_pay: nil, + individual_id: nil, + net_pay: nil, + payment_method: nil, + taxes: nil, + total_hours: nil, + type: nil + ) + end + + sig do + override + .returns( + { + earnings: T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning)]), + employee_deductions: T.nilable( + T::Array[T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction)] + ), + employer_contributions: T.nilable( + T::Array[T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution)] + ), + gross_pay: T.nilable(FinchAPI::Models::Money), + individual_id: String, + net_pay: T.nilable(FinchAPI::Models::Money), + payment_method: T.nilable(Symbol), + taxes: T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax)]), + total_hours: T.nilable(Float), + type: T.nilable(Symbol) + } + ) + end + def to_hash + end + + class Earning < FinchAPI::BaseModel + sig { returns(T.nilable(Integer)) } + def amount + end + + sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } + def amount=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes)) } + def attributes + end + + sig do + params(_: T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes)) + .returns(T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes)) + end + def attributes=(_) + end + + sig { returns(T.nilable(String)) } + def currency + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def currency=(_) + end + + sig { returns(T.nilable(Float)) } + def hours + end + + sig { params(_: T.nilable(Float)).returns(T.nilable(Float)) } + def hours=(_) + end + + sig { returns(T.nilable(String)) } + def name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def name=(_) + end + + sig { returns(T.nilable(Symbol)) } + def type + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def type=(_) + end + + sig do + params( + amount: T.nilable(Integer), + attributes: T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes), + currency: T.nilable(String), + hours: T.nilable(Float), + name: T.nilable(String), + type: T.nilable(Symbol) + ) + .void + end + def initialize(amount: nil, attributes: nil, currency: nil, hours: nil, name: nil, type: nil) + end + + sig do + override + .returns( + { + amount: T.nilable(Integer), + attributes: T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes), + currency: T.nilable(String), + hours: T.nilable(Float), + name: T.nilable(String), + type: T.nilable(Symbol) + } + ) + end + def to_hash + end + + class Attributes < FinchAPI::BaseModel + sig do + returns( + T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes::Metadata) + ) + end + def metadata + end + + sig do + params(_: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes::Metadata) + .returns(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes::Metadata) + end + def metadata=(_) + end + + sig do + params( + metadata: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes::Metadata + ) + .void + end + def initialize(metadata: nil) + end + + sig do + override + .returns( + {metadata: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes::Metadata} + ) + end + def to_hash + end + + class Metadata < FinchAPI::BaseModel + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + def metadata + end + + sig { params(_: T::Hash[Symbol, T.anything]).returns(T::Hash[Symbol, T.anything]) } + def metadata=(_) + end + + sig { params(metadata: T::Hash[Symbol, T.anything]).void } + def initialize(metadata: nil) + end + + sig { override.returns({metadata: T::Hash[Symbol, T.anything]}) } + def to_hash + end + end + end + + class Type < FinchAPI::Enum + abstract! + + SALARY = T.let(:salary, T.nilable(Symbol)) + WAGE = T.let(:wage, T.nilable(Symbol)) + REIMBURSEMENT = T.let(:reimbursement, T.nilable(Symbol)) + OVERTIME = T.let(:overtime, T.nilable(Symbol)) + SEVERANCE = T.let(:severance, T.nilable(Symbol)) + DOUBLE_OVERTIME = T.let(:double_overtime, T.nilable(Symbol)) + PTO = T.let(:pto, T.nilable(Symbol)) + SICK = T.let(:sick, T.nilable(Symbol)) + BONUS = T.let(:bonus, T.nilable(Symbol)) + COMMISSION = T.let(:commission, T.nilable(Symbol)) + TIPS = T.let(:tips, T.nilable(Symbol)) + NUMBER_1099 = T.let(:"1099", T.nilable(Symbol)) + OTHER = T.let(:other, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + + class EmployeeDeduction < FinchAPI::BaseModel + sig { returns(T.nilable(Integer)) } + def amount + end + + sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } + def amount=(_) + end + + sig do + returns( + T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes) + ) + end + def attributes + end + + sig do + params( + _: T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes) + ) + .returns( + T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes) + ) + end + def attributes=(_) + end + + sig { returns(T.nilable(String)) } + def currency + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def currency=(_) + end + + sig { returns(T.nilable(String)) } + def name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def name=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def pre_tax + end + + sig { params(_: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } + def pre_tax=(_) + end + + sig { returns(T.nilable(Symbol)) } + def type + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def type=(_) + end + + sig do + params( + amount: T.nilable(Integer), + attributes: T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes), + currency: T.nilable(String), + name: T.nilable(String), + pre_tax: T.nilable(T::Boolean), + type: T.nilable(Symbol) + ) + .void + end + def initialize(amount: nil, attributes: nil, currency: nil, name: nil, pre_tax: nil, type: nil) + end + + sig do + override + .returns( + { + amount: T.nilable(Integer), + attributes: T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes), + currency: T.nilable(String), + name: T.nilable(String), + pre_tax: T.nilable(T::Boolean), + type: T.nilable(Symbol) + } + ) + end + def to_hash + end + + class Attributes < FinchAPI::BaseModel + sig do + returns( + T.nilable( + FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes::Metadata + ) + ) + end + def metadata + end + + sig do + params( + _: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes::Metadata + ) + .returns( + FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes::Metadata + ) + end + def metadata=(_) + end + + sig do + params( + metadata: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes::Metadata + ) + .void + end + def initialize(metadata: nil) + end + + sig do + override + .returns( + { + metadata: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes::Metadata + } + ) + end + def to_hash + end + + class Metadata < FinchAPI::BaseModel + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + def metadata + end + + sig { params(_: T::Hash[Symbol, T.anything]).returns(T::Hash[Symbol, T.anything]) } + def metadata=(_) + end + + sig { params(metadata: T::Hash[Symbol, T.anything]).void } + def initialize(metadata: nil) + end + + sig { override.returns({metadata: T::Hash[Symbol, T.anything]}) } + def to_hash + end + end + end + end + + class EmployerContribution < FinchAPI::BaseModel + sig { returns(T.nilable(Integer)) } + def amount + end + + sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } + def amount=(_) + end + + sig do + returns( + T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes) + ) + end + def attributes + end + + sig do + params( + _: T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes) + ) + .returns( + T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes) + ) + end + def attributes=(_) + end + + sig { returns(T.nilable(String)) } + def currency + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def currency=(_) + end + + sig { returns(T.nilable(String)) } + def name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def name=(_) + end + + sig { returns(T.nilable(Symbol)) } + def type + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def type=(_) + end + + sig do + params( + amount: T.nilable(Integer), + attributes: T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes), + currency: T.nilable(String), + name: T.nilable(String), + type: T.nilable(Symbol) + ) + .void + end + def initialize(amount: nil, attributes: nil, currency: nil, name: nil, type: nil) + end + + sig do + override + .returns( + { + amount: T.nilable(Integer), + attributes: T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes), + currency: T.nilable(String), + name: T.nilable(String), + type: T.nilable(Symbol) + } + ) + end + def to_hash + end + + class Attributes < FinchAPI::BaseModel + sig do + returns( + T.nilable( + FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes::Metadata + ) + ) + end + def metadata + end + + sig do + params( + _: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes::Metadata + ) + .returns( + FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes::Metadata + ) + end + def metadata=(_) + end + + sig do + params( + metadata: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes::Metadata + ) + .void + end + def initialize(metadata: nil) + end + + sig do + override + .returns( + { + metadata: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes::Metadata + } + ) + end + def to_hash + end + + class Metadata < FinchAPI::BaseModel + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + def metadata + end + + sig { params(_: T::Hash[Symbol, T.anything]).returns(T::Hash[Symbol, T.anything]) } + def metadata=(_) + end + + sig { params(metadata: T::Hash[Symbol, T.anything]).void } + def initialize(metadata: nil) + end + + sig { override.returns({metadata: T::Hash[Symbol, T.anything]}) } + def to_hash + end + end + end + end + + class PaymentMethod < FinchAPI::Enum + abstract! + + CHECK = T.let(:check, T.nilable(Symbol)) + DIRECT_DEPOSIT = T.let(:direct_deposit, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + + class Tax < FinchAPI::BaseModel + sig { returns(T.nilable(Integer)) } + def amount + end + + sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } + def amount=(_) + end + + sig { returns(T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes)) } + def attributes + end + + sig do + params(_: T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes)) + .returns(T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes)) + end + def attributes=(_) + end + + sig { returns(T.nilable(String)) } + def currency + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def currency=(_) + end + + sig { returns(T.nilable(T::Boolean)) } + def employer + end + + sig { params(_: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } + def employer=(_) + end + + sig { returns(T.nilable(String)) } + def name + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def name=(_) + end + + sig { returns(T.nilable(Symbol)) } + def type + end + + sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def type=(_) + end + + sig do + params( + amount: T.nilable(Integer), + attributes: T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes), + currency: T.nilable(String), + employer: T.nilable(T::Boolean), + name: T.nilable(String), + type: T.nilable(Symbol) + ) + .void + end + def initialize(amount: nil, attributes: nil, currency: nil, employer: nil, name: nil, type: nil) + end + + sig do + override + .returns( + { + amount: T.nilable(Integer), + attributes: T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes), + currency: T.nilable(String), + employer: T.nilable(T::Boolean), + name: T.nilable(String), + type: T.nilable(Symbol) + } + ) + end + def to_hash + end + + class Attributes < FinchAPI::BaseModel + sig do + returns( + T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes::Metadata) + ) + end + def metadata + end + + sig do + params(_: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes::Metadata) + .returns(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes::Metadata) + end + def metadata=(_) + end + + sig do + params(metadata: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes::Metadata) + .void + end + def initialize(metadata: nil) + end + + sig do + override + .returns( + {metadata: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes::Metadata} + ) + end + def to_hash + end + + class Metadata < FinchAPI::BaseModel + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + def metadata + end + + sig { params(_: T::Hash[Symbol, T.anything]).returns(T::Hash[Symbol, T.anything]) } + def metadata=(_) + end + + sig { params(metadata: T::Hash[Symbol, T.anything]).void } + def initialize(metadata: nil) + end + + sig { override.returns({metadata: T::Hash[Symbol, T.anything]}) } + def to_hash + end + end + end + + class Type < FinchAPI::Enum + abstract! + + STATE = T.let(:state, T.nilable(Symbol)) + FEDERAL = T.let(:federal, T.nilable(Symbol)) + LOCAL = T.let(:local, T.nilable(Symbol)) + FICA = T.let(:fica, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + + class Type < FinchAPI::Enum + abstract! + + REGULAR_PAYROLL = T.let(:regular_payroll, T.nilable(Symbol)) + OFF_CYCLE_PAYROLL = T.let(:off_cycle_payroll, T.nilable(Symbol)) + ONE_TIME_PAYMENT = T.let(:one_time_payment, T.nilable(Symbol)) + + sig { override.returns(T::Array[Symbol]) } + def self.values + end + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/sandbox/payment_create_response.rbi b/rbi/lib/finch-api/models/sandbox/payment_create_response.rbi new file mode 100644 index 00000000..a0321cec --- /dev/null +++ b/rbi/lib/finch-api/models/sandbox/payment_create_response.rbi @@ -0,0 +1,33 @@ +# typed: strong + +module FinchAPI + module Models + module Sandbox + class PaymentCreateResponse < FinchAPI::BaseModel + sig { returns(String) } + def pay_date + end + + sig { params(_: String).returns(String) } + def pay_date=(_) + end + + sig { returns(String) } + def payment_id + end + + sig { params(_: String).returns(String) } + def payment_id=(_) + end + + sig { params(pay_date: String, payment_id: String).void } + def initialize(pay_date:, payment_id:) + end + + sig { override.returns({pay_date: String, payment_id: String}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/finch-api/models/webhook_event.rbi b/rbi/lib/finch-api/models/webhook_event.rbi new file mode 100644 index 00000000..432e6317 --- /dev/null +++ b/rbi/lib/finch-api/models/webhook_event.rbi @@ -0,0 +1,18 @@ +# typed: strong + +module FinchAPI + module Models + class WebhookEvent < FinchAPI::Union + abstract! + + sig do + override + .returns( + [[NilClass, FinchAPI::Models::AccountUpdateEvent], [NilClass, FinchAPI::Models::JobCompletionEvent], [NilClass, FinchAPI::Models::CompanyEvent], [NilClass, FinchAPI::Models::DirectoryEvent], [NilClass, FinchAPI::Models::EmploymentEvent], [NilClass, FinchAPI::Models::IndividualEvent], [NilClass, FinchAPI::Models::PaymentEvent], [NilClass, FinchAPI::Models::PayStatementEvent]] + ) + end + private_class_method def self.variants + end + end + end +end diff --git a/rbi/lib/finch-api/page.rbi b/rbi/lib/finch-api/page.rbi new file mode 100644 index 00000000..3ff8f43e --- /dev/null +++ b/rbi/lib/finch-api/page.rbi @@ -0,0 +1,37 @@ +# typed: strong + +module FinchAPI + class Page + include FinchAPI::BasePage + + Elem = type_member + + sig { returns(T::Array[Elem]) } + def data + end + + sig { params(_: T::Array[Elem]).returns(T::Array[Elem]) } + def data=(_) + end + + sig { returns(FinchAPI::Models::Paging) } + def paging + end + + sig { params(_: FinchAPI::Models::Paging).returns(FinchAPI::Models::Paging) } + def paging=(_) + end + + sig do + params( + client: FinchAPI::BaseClient, + req: FinchAPI::BaseClient::RequestComponentsShape, + headers: T.any(T::Hash[String, String], Net::HTTPHeader), + unwrapped: T::Hash[Symbol, T.anything] + ) + .void + end + def initialize(client:, req:, headers:, unwrapped:) + end + end +end diff --git a/rbi/lib/finch-api/pooled_net_requester.rbi b/rbi/lib/finch-api/pooled_net_requester.rbi new file mode 100644 index 00000000..3d103567 --- /dev/null +++ b/rbi/lib/finch-api/pooled_net_requester.rbi @@ -0,0 +1,36 @@ +# typed: strong + +module FinchAPI + class PooledNetRequester + RequestShape = T.type_alias do + {method: Symbol, url: URI::Generic, headers: T::Hash[String, String], body: T.anything, deadline: Float} + end + + sig { params(url: URI::Generic).returns(Net::HTTP) } + def self.connect(url) + end + + sig { params(conn: Net::HTTP, deadline: Float).void } + def self.calibrate_socket_timeout(conn, deadline) + end + + sig { params(request: FinchAPI::PooledNetRequester::RequestShape).returns(Net::HTTPGenericRequest) } + def self.build_request(request) + end + + sig { params(url: URI::Generic, blk: T.proc.params(arg0: Net::HTTP).void).void } + private def with_pool(url, &blk) + end + + sig do + params(request: FinchAPI::PooledNetRequester::RequestShape) + .returns([Net::HTTPResponse, T::Enumerable[String]]) + end + def execute(request) + end + + sig { void } + def initialize + end + end +end diff --git a/rbi/lib/finch-api/request_options.rbi b/rbi/lib/finch-api/request_options.rbi new file mode 100644 index 00000000..68b232aa --- /dev/null +++ b/rbi/lib/finch-api/request_options.rbi @@ -0,0 +1,84 @@ +# typed: strong + +module FinchAPI + module RequestParameters + abstract! + + sig { returns(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) } + def request_options + end + + sig do + params(_: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + .returns(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + end + def request_options=(_) + end + + module Converter + sig { params(params: T.anything).returns([T.anything, T::Hash[Symbol, T.anything]]) } + def dump_request(params) + end + end + end + + class RequestOptions < FinchAPI::BaseModel + sig { params(opts: T.any(T.self_type, T::Hash[Symbol, T.anything])).void } + def self.validate!(opts) + end + + sig { returns(T.nilable(String)) } + def idempotency_key + end + + sig { params(_: T.nilable(String)).returns(T.nilable(String)) } + def idempotency_key=(_) + end + + sig { returns(T.nilable(T::Hash[String, T.nilable(T.any(T::Array[String], String))])) } + def extra_query + end + + sig do + params(_: T.nilable(T::Hash[String, T.nilable(T.any(T::Array[String], String))])) + .returns(T.nilable(T::Hash[String, T.nilable(T.any(T::Array[String], String))])) + end + def extra_query=(_) + end + + sig { returns(T.nilable(T::Hash[String, T.nilable(String)])) } + def extra_headers + end + + sig do + params(_: T.nilable(T::Hash[String, T.nilable(String)])) + .returns(T.nilable(T::Hash[String, T.nilable(String)])) + end + def extra_headers=(_) + end + + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + def extra_body + end + + sig { params(_: T.nilable(T::Hash[Symbol, T.anything])).returns(T.nilable(T::Hash[Symbol, T.anything])) } + def extra_body=(_) + end + + sig { returns(T.nilable(Integer)) } + def max_retries + end + + sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } + def max_retries=(_) + end + + sig { returns(T.nilable(Float)) } + def timeout + end + + sig { params(_: T.nilable(Float)).returns(T.nilable(Float)) } + def timeout=(_) + end + end +end diff --git a/rbi/lib/finch-api/resources/access_tokens.rbi b/rbi/lib/finch-api/resources/access_tokens.rbi new file mode 100644 index 00000000..2f4987c0 --- /dev/null +++ b/rbi/lib/finch-api/resources/access_tokens.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module FinchAPI + module Resources + class AccessTokens + sig do + params( + code: String, + client_id: String, + client_secret: String, + redirect_uri: String, + request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + ) + .returns(FinchAPI::Models::CreateAccessTokenResponse) + end + def create(code:, client_id: nil, client_secret: nil, redirect_uri: nil, request_options: {}) + end + + sig { params(client: FinchAPI::Client).void } + def initialize(client:) + end + end + end +end diff --git a/rbi/lib/finch-api/resources/account.rbi b/rbi/lib/finch-api/resources/account.rbi new file mode 100644 index 00000000..f38446bf --- /dev/null +++ b/rbi/lib/finch-api/resources/account.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module FinchAPI + module Resources + class Account + sig do + params(request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]))) + .returns(FinchAPI::Models::DisconnectResponse) + end + def disconnect(request_options: {}) + end + + sig do + params(request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]))) + .returns(FinchAPI::Models::Introspection) + end + def introspect(request_options: {}) + end + + sig { params(client: FinchAPI::Client).void } + def initialize(client:) + end + end + end +end diff --git a/rbi/lib/finch-api/resources/connect.rbi b/rbi/lib/finch-api/resources/connect.rbi new file mode 100644 index 00000000..40e87df2 --- /dev/null +++ b/rbi/lib/finch-api/resources/connect.rbi @@ -0,0 +1,15 @@ +# typed: strong + +module FinchAPI + module Resources + class Connect + sig { returns(FinchAPI::Resources::Connect::Sessions) } + def sessions + end + + sig { params(client: FinchAPI::Client).void } + def initialize(client:) + end + end + end +end diff --git a/rbi/lib/finch-api/resources/connect/sessions.rbi b/rbi/lib/finch-api/resources/connect/sessions.rbi new file mode 100644 index 00000000..e4f411dc --- /dev/null +++ b/rbi/lib/finch-api/resources/connect/sessions.rbi @@ -0,0 +1,61 @@ +# typed: strong + +module FinchAPI + module Resources + class Connect + class Sessions + sig do + params( + customer_id: String, + customer_name: String, + products: T::Array[Symbol], + customer_email: T.nilable(String), + integration: T.nilable(FinchAPI::Models::Connect::SessionNewParams::Integration), + manual: T.nilable(T::Boolean), + minutes_to_expire: T.nilable(Float), + redirect_uri: T.nilable(String), + sandbox: T.nilable(Symbol), + request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + ) + .returns(FinchAPI::Models::Connect::SessionNewResponse) + end + def new( + customer_id:, + customer_name:, + products:, + customer_email: nil, + integration: nil, + manual: nil, + minutes_to_expire: nil, + redirect_uri: nil, + sandbox: nil, + request_options: {} + ) + end + + sig do + params( + connection_id: String, + minutes_to_expire: T.nilable(Integer), + products: T.nilable(T::Array[Symbol]), + redirect_uri: T.nilable(String), + request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + ) + .returns(FinchAPI::Models::Connect::SessionReauthenticateResponse) + end + def reauthenticate( + connection_id:, + minutes_to_expire: nil, + products: nil, + redirect_uri: nil, + request_options: {} + ) + end + + sig { params(client: FinchAPI::Client).void } + def initialize(client:) + end + end + end + end +end diff --git a/rbi/lib/finch-api/resources/hris.rbi b/rbi/lib/finch-api/resources/hris.rbi new file mode 100644 index 00000000..dbb1355d --- /dev/null +++ b/rbi/lib/finch-api/resources/hris.rbi @@ -0,0 +1,43 @@ +# typed: strong + +module FinchAPI + module Resources + class HRIS + sig { returns(FinchAPI::Resources::HRIS::Company) } + def company + end + + sig { returns(FinchAPI::Resources::HRIS::Directory) } + def directory + end + + sig { returns(FinchAPI::Resources::HRIS::Individuals) } + def individuals + end + + sig { returns(FinchAPI::Resources::HRIS::Employments) } + def employments + end + + sig { returns(FinchAPI::Resources::HRIS::Payments) } + def payments + end + + sig { returns(FinchAPI::Resources::HRIS::PayStatements) } + def pay_statements + end + + sig { returns(FinchAPI::Resources::HRIS::Documents) } + def documents + end + + sig { returns(FinchAPI::Resources::HRIS::Benefits) } + def benefits + end + + sig { params(client: FinchAPI::Client).void } + def initialize(client:) + end + end + end +end diff --git a/rbi/lib/finch-api/resources/hris/benefits.rbi b/rbi/lib/finch-api/resources/hris/benefits.rbi new file mode 100644 index 00000000..25af1e23 --- /dev/null +++ b/rbi/lib/finch-api/resources/hris/benefits.rbi @@ -0,0 +1,64 @@ +# typed: strong + +module FinchAPI + module Resources + class HRIS + class Benefits + sig { returns(FinchAPI::Resources::HRIS::Benefits::Individuals) } + def individuals + end + + sig do + params( + description: String, + frequency: T.nilable(Symbol), + type: T.nilable(Symbol), + request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + ) + .returns(FinchAPI::Models::HRIS::CreateCompanyBenefitsResponse) + end + def create(description: nil, frequency: nil, type: nil, request_options: {}) + end + + sig do + params( + benefit_id: String, + request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + ) + .returns(FinchAPI::Models::HRIS::CompanyBenefit) + end + def retrieve(benefit_id, request_options: {}) + end + + sig do + params( + benefit_id: String, + description: String, + request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + ) + .returns(FinchAPI::Models::HRIS::UpdateCompanyBenefitResponse) + end + def update(benefit_id, description: nil, request_options: {}) + end + + sig do + params(request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]))) + .returns(FinchAPI::SinglePage[FinchAPI::Models::HRIS::CompanyBenefit]) + end + def list(request_options: {}) + end + + sig do + params(request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]))) + .returns(FinchAPI::SinglePage[FinchAPI::Models::HRIS::SupportedBenefit]) + end + def list_supported_benefits(request_options: {}) + end + + sig { params(client: FinchAPI::Client).void } + def initialize(client:) + end + end + end + end +end diff --git a/rbi/lib/finch-api/resources/hris/benefits/individuals.rbi b/rbi/lib/finch-api/resources/hris/benefits/individuals.rbi new file mode 100644 index 00000000..b4afcec1 --- /dev/null +++ b/rbi/lib/finch-api/resources/hris/benefits/individuals.rbi @@ -0,0 +1,58 @@ +# typed: strong + +module FinchAPI + module Resources + class HRIS + class Benefits + class Individuals + sig do + params( + benefit_id: String, + individuals: T::Array[FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual], + request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + ) + .returns(FinchAPI::SinglePage[FinchAPI::Models::HRIS::Benefits::EnrolledIndividual]) + end + def enroll_many(benefit_id, individuals: nil, request_options: {}) + end + + sig do + params( + benefit_id: String, + request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + ) + .returns(FinchAPI::Models::HRIS::Benefits::IndividualEnrolledIDsResponse) + end + def enrolled_ids(benefit_id, request_options: {}) + end + + sig do + params( + benefit_id: String, + individual_ids: String, + request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + ) + .returns(FinchAPI::SinglePage[FinchAPI::Models::HRIS::Benefits::IndividualBenefit]) + end + def retrieve_many_benefits(benefit_id, individual_ids: nil, request_options: {}) + end + + sig do + params( + benefit_id: String, + individual_ids: T::Array[String], + request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + ) + .returns(FinchAPI::SinglePage[FinchAPI::Models::HRIS::Benefits::UnenrolledIndividual]) + end + def unenroll_many(benefit_id, individual_ids: nil, request_options: {}) + end + + sig { params(client: FinchAPI::Client).void } + def initialize(client:) + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/resources/hris/company.rbi b/rbi/lib/finch-api/resources/hris/company.rbi new file mode 100644 index 00000000..ea45c69e --- /dev/null +++ b/rbi/lib/finch-api/resources/hris/company.rbi @@ -0,0 +1,20 @@ +# typed: strong + +module FinchAPI + module Resources + class HRIS + class Company + sig do + params(request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]))) + .returns(FinchAPI::Models::HRIS::HRISCompany) + end + def retrieve(request_options: {}) + end + + sig { params(client: FinchAPI::Client).void } + def initialize(client:) + end + end + end + end +end diff --git a/rbi/lib/finch-api/resources/hris/directory.rbi b/rbi/lib/finch-api/resources/hris/directory.rbi new file mode 100644 index 00000000..e6f9b8ab --- /dev/null +++ b/rbi/lib/finch-api/resources/hris/directory.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module FinchAPI + module Resources + class HRIS + class Directory + sig do + params( + limit: Integer, + offset: Integer, + request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + ) + .returns(FinchAPI::IndividualsPage[FinchAPI::Models::HRIS::IndividualInDirectory]) + end + def list(limit: nil, offset: nil, request_options: {}) + end + + sig do + params( + limit: Integer, + offset: Integer, + request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + ) + .returns(FinchAPI::IndividualsPage[FinchAPI::Models::HRIS::IndividualInDirectory]) + end + def list_individuals(limit: nil, offset: nil, request_options: {}) + end + + sig { params(client: FinchAPI::Client).void } + def initialize(client:) + end + end + end + end +end diff --git a/rbi/lib/finch-api/resources/hris/documents.rbi b/rbi/lib/finch-api/resources/hris/documents.rbi new file mode 100644 index 00000000..67236063 --- /dev/null +++ b/rbi/lib/finch-api/resources/hris/documents.rbi @@ -0,0 +1,36 @@ +# typed: strong + +module FinchAPI + module Resources + class HRIS + class Documents + sig do + params( + individual_ids: T::Array[String], + limit: Integer, + offset: Integer, + types: T::Array[Symbol], + request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + ) + .returns(FinchAPI::Models::HRIS::DocumentListResponse) + end + def list(individual_ids: nil, limit: nil, offset: nil, types: nil, request_options: {}) + end + + sig do + params( + document_id: String, + request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + ) + .returns(T.any(FinchAPI::Models::HRIS::W42020, FinchAPI::Models::HRIS::W42005)) + end + def retreive(document_id, request_options: {}) + end + + sig { params(client: FinchAPI::Client).void } + def initialize(client:) + end + end + end + end +end diff --git a/rbi/lib/finch-api/resources/hris/employments.rbi b/rbi/lib/finch-api/resources/hris/employments.rbi new file mode 100644 index 00000000..bf594782 --- /dev/null +++ b/rbi/lib/finch-api/resources/hris/employments.rbi @@ -0,0 +1,23 @@ +# typed: strong + +module FinchAPI + module Resources + class HRIS + class Employments + sig do + params( + requests: T::Array[FinchAPI::Models::HRIS::EmploymentRetrieveManyParams::Request], + request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + ) + .returns(FinchAPI::ResponsesPage[FinchAPI::Models::HRIS::EmploymentDataResponse]) + end + def retrieve_many(requests:, request_options: {}) + end + + sig { params(client: FinchAPI::Client).void } + def initialize(client:) + end + end + end + end +end diff --git a/rbi/lib/finch-api/resources/hris/individuals.rbi b/rbi/lib/finch-api/resources/hris/individuals.rbi new file mode 100644 index 00000000..f13687c9 --- /dev/null +++ b/rbi/lib/finch-api/resources/hris/individuals.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module FinchAPI + module Resources + class HRIS + class Individuals + sig do + params( + options: T.nilable(FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Options), + requests: T::Array[FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Request], + request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + ) + .returns(FinchAPI::ResponsesPage[FinchAPI::Models::HRIS::IndividualResponse]) + end + def retrieve_many(options: nil, requests: nil, request_options: {}) + end + + sig { params(client: FinchAPI::Client).void } + def initialize(client:) + end + end + end + end +end diff --git a/rbi/lib/finch-api/resources/hris/pay_statements.rbi b/rbi/lib/finch-api/resources/hris/pay_statements.rbi new file mode 100644 index 00000000..6e317654 --- /dev/null +++ b/rbi/lib/finch-api/resources/hris/pay_statements.rbi @@ -0,0 +1,23 @@ +# typed: strong + +module FinchAPI + module Resources + class HRIS + class PayStatements + sig do + params( + requests: T::Array[FinchAPI::Models::HRIS::PayStatementRetrieveManyParams::Request], + request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + ) + .returns(FinchAPI::ResponsesPage[FinchAPI::Models::HRIS::PayStatementResponse]) + end + def retrieve_many(requests:, request_options: {}) + end + + sig { params(client: FinchAPI::Client).void } + def initialize(client:) + end + end + end + end +end diff --git a/rbi/lib/finch-api/resources/hris/payments.rbi b/rbi/lib/finch-api/resources/hris/payments.rbi new file mode 100644 index 00000000..dfe5b0b0 --- /dev/null +++ b/rbi/lib/finch-api/resources/hris/payments.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module FinchAPI + module Resources + class HRIS + class Payments + sig do + params( + end_date: Date, + start_date: Date, + request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + ) + .returns(FinchAPI::SinglePage[FinchAPI::Models::HRIS::Payment]) + end + def list(end_date:, start_date:, request_options: {}) + end + + sig { params(client: FinchAPI::Client).void } + def initialize(client:) + end + end + end + end +end diff --git a/rbi/lib/finch-api/resources/jobs.rbi b/rbi/lib/finch-api/resources/jobs.rbi new file mode 100644 index 00000000..f5213482 --- /dev/null +++ b/rbi/lib/finch-api/resources/jobs.rbi @@ -0,0 +1,19 @@ +# typed: strong + +module FinchAPI + module Resources + class Jobs + sig { returns(FinchAPI::Resources::Jobs::Automated) } + def automated + end + + sig { returns(FinchAPI::Resources::Jobs::Manual) } + def manual + end + + sig { params(client: FinchAPI::Client).void } + def initialize(client:) + end + end + end +end diff --git a/rbi/lib/finch-api/resources/jobs/automated.rbi b/rbi/lib/finch-api/resources/jobs/automated.rbi new file mode 100644 index 00000000..cfe326ca --- /dev/null +++ b/rbi/lib/finch-api/resources/jobs/automated.rbi @@ -0,0 +1,45 @@ +# typed: strong + +module FinchAPI + module Resources + class Jobs + class Automated + sig do + params( + type: Symbol, + params: FinchAPI::Models::Jobs::AutomatedCreateParams::Params, + request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + ) + .returns(FinchAPI::Models::Jobs::AutomatedCreateResponse) + end + def create(type:, params:, request_options: {}) + end + + sig do + params( + job_id: String, + request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + ) + .returns(FinchAPI::Models::Jobs::AutomatedAsyncJob) + end + def retrieve(job_id, request_options: {}) + end + + sig do + params( + limit: Integer, + offset: Integer, + request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + ) + .returns(FinchAPI::Page[FinchAPI::Models::Jobs::AutomatedAsyncJob]) + end + def list(limit: nil, offset: nil, request_options: {}) + end + + sig { params(client: FinchAPI::Client).void } + def initialize(client:) + end + end + end + end +end diff --git a/rbi/lib/finch-api/resources/jobs/manual.rbi b/rbi/lib/finch-api/resources/jobs/manual.rbi new file mode 100644 index 00000000..da55b586 --- /dev/null +++ b/rbi/lib/finch-api/resources/jobs/manual.rbi @@ -0,0 +1,23 @@ +# typed: strong + +module FinchAPI + module Resources + class Jobs + class Manual + sig do + params( + job_id: String, + request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + ) + .returns(FinchAPI::Models::Jobs::ManualAsyncJob) + end + def retrieve(job_id, request_options: {}) + end + + sig { params(client: FinchAPI::Client).void } + def initialize(client:) + end + end + end + end +end diff --git a/rbi/lib/finch-api/resources/payroll.rbi b/rbi/lib/finch-api/resources/payroll.rbi new file mode 100644 index 00000000..d3dacfd8 --- /dev/null +++ b/rbi/lib/finch-api/resources/payroll.rbi @@ -0,0 +1,15 @@ +# typed: strong + +module FinchAPI + module Resources + class Payroll + sig { returns(FinchAPI::Resources::Payroll::PayGroups) } + def pay_groups + end + + sig { params(client: FinchAPI::Client).void } + def initialize(client:) + end + end + end +end diff --git a/rbi/lib/finch-api/resources/payroll/pay_groups.rbi b/rbi/lib/finch-api/resources/payroll/pay_groups.rbi new file mode 100644 index 00000000..b3584857 --- /dev/null +++ b/rbi/lib/finch-api/resources/payroll/pay_groups.rbi @@ -0,0 +1,34 @@ +# typed: strong + +module FinchAPI + module Resources + class Payroll + class PayGroups + sig do + params( + pay_group_id: String, + request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + ) + .returns(FinchAPI::Models::Payroll::PayGroupRetrieveResponse) + end + def retrieve(pay_group_id, request_options: {}) + end + + sig do + params( + individual_id: String, + pay_frequencies: T::Array[String], + request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + ) + .returns(FinchAPI::SinglePage[FinchAPI::Models::Payroll::PayGroupListResponse]) + end + def list(individual_id: nil, pay_frequencies: nil, request_options: {}) + end + + sig { params(client: FinchAPI::Client).void } + def initialize(client:) + end + end + end + end +end diff --git a/rbi/lib/finch-api/resources/providers.rbi b/rbi/lib/finch-api/resources/providers.rbi new file mode 100644 index 00000000..716c3454 --- /dev/null +++ b/rbi/lib/finch-api/resources/providers.rbi @@ -0,0 +1,18 @@ +# typed: strong + +module FinchAPI + module Resources + class Providers + sig do + params(request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]))) + .returns(FinchAPI::SinglePage[FinchAPI::Models::Provider]) + end + def list(request_options: {}) + end + + sig { params(client: FinchAPI::Client).void } + def initialize(client:) + end + end + end +end diff --git a/rbi/lib/finch-api/resources/request_forwarding.rbi b/rbi/lib/finch-api/resources/request_forwarding.rbi new file mode 100644 index 00000000..998c93e6 --- /dev/null +++ b/rbi/lib/finch-api/resources/request_forwarding.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module FinchAPI + module Resources + class RequestForwarding + sig do + params( + method_: String, + route: String, + data: T.nilable(String), + headers: T.nilable(T.anything), + params: T.nilable(T.anything), + request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + ) + .returns(FinchAPI::Models::RequestForwardingForwardResponse) + end + def forward(method_:, route:, data: nil, headers: nil, params: nil, request_options: {}) + end + + sig { params(client: FinchAPI::Client).void } + def initialize(client:) + end + end + end +end diff --git a/rbi/lib/finch-api/resources/sandbox.rbi b/rbi/lib/finch-api/resources/sandbox.rbi new file mode 100644 index 00000000..39fb2ff4 --- /dev/null +++ b/rbi/lib/finch-api/resources/sandbox.rbi @@ -0,0 +1,39 @@ +# typed: strong + +module FinchAPI + module Resources + class Sandbox + sig { returns(FinchAPI::Resources::Sandbox::Connections) } + def connections + end + + sig { returns(FinchAPI::Resources::Sandbox::Company) } + def company + end + + sig { returns(FinchAPI::Resources::Sandbox::Directory) } + def directory + end + + sig { returns(FinchAPI::Resources::Sandbox::Individual) } + def individual + end + + sig { returns(FinchAPI::Resources::Sandbox::Employment) } + def employment + end + + sig { returns(FinchAPI::Resources::Sandbox::Payment) } + def payment + end + + sig { returns(FinchAPI::Resources::Sandbox::Jobs) } + def jobs + end + + sig { params(client: FinchAPI::Client).void } + def initialize(client:) + end + end + end +end diff --git a/rbi/lib/finch-api/resources/sandbox/company.rbi b/rbi/lib/finch-api/resources/sandbox/company.rbi new file mode 100644 index 00000000..483d2c4c --- /dev/null +++ b/rbi/lib/finch-api/resources/sandbox/company.rbi @@ -0,0 +1,40 @@ +# typed: strong + +module FinchAPI + module Resources + class Sandbox + class Company + sig do + params( + accounts: T.nilable(T::Array[FinchAPI::Models::Sandbox::CompanyUpdateParams::Account]), + departments: T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateParams::Department)]), + ein: T.nilable(String), + entity: T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity), + legal_name: T.nilable(String), + locations: T.nilable(T::Array[T.nilable(FinchAPI::Models::Location)]), + primary_email: T.nilable(String), + primary_phone_number: T.nilable(String), + request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + ) + .returns(FinchAPI::Models::Sandbox::CompanyUpdateResponse) + end + def update( + accounts:, + departments:, + ein:, + entity:, + legal_name:, + locations:, + primary_email:, + primary_phone_number:, + request_options: {} + ) + end + + sig { params(client: FinchAPI::Client).void } + def initialize(client:) + end + end + end + end +end diff --git a/rbi/lib/finch-api/resources/sandbox/connections.rbi b/rbi/lib/finch-api/resources/sandbox/connections.rbi new file mode 100644 index 00000000..be9afce1 --- /dev/null +++ b/rbi/lib/finch-api/resources/sandbox/connections.rbi @@ -0,0 +1,36 @@ +# typed: strong + +module FinchAPI + module Resources + class Sandbox + class Connections + sig { returns(FinchAPI::Resources::Sandbox::Connections::Accounts) } + def accounts + end + + sig do + params( + provider_id: String, + authentication_type: Symbol, + employee_size: Integer, + products: T::Array[String], + request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + ) + .returns(FinchAPI::Models::Sandbox::ConnectionCreateResponse) + end + def create( + provider_id:, + authentication_type: nil, + employee_size: nil, + products: nil, + request_options: {} + ) + end + + sig { params(client: FinchAPI::Client).void } + def initialize(client:) + end + end + end + end +end diff --git a/rbi/lib/finch-api/resources/sandbox/connections/accounts.rbi b/rbi/lib/finch-api/resources/sandbox/connections/accounts.rbi new file mode 100644 index 00000000..bd825c8c --- /dev/null +++ b/rbi/lib/finch-api/resources/sandbox/connections/accounts.rbi @@ -0,0 +1,38 @@ +# typed: strong + +module FinchAPI + module Resources + class Sandbox + class Connections + class Accounts + sig do + params( + company_id: String, + provider_id: String, + authentication_type: Symbol, + products: T::Array[String], + request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + ) + .returns(FinchAPI::Models::Sandbox::Connections::AccountCreateResponse) + end + def create(company_id:, provider_id:, authentication_type: nil, products: nil, request_options: {}) + end + + sig do + params( + connection_status: Symbol, + request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + ) + .returns(FinchAPI::Models::Sandbox::Connections::AccountUpdateResponse) + end + def update(connection_status: nil, request_options: {}) + end + + sig { params(client: FinchAPI::Client).void } + def initialize(client:) + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/resources/sandbox/directory.rbi b/rbi/lib/finch-api/resources/sandbox/directory.rbi new file mode 100644 index 00000000..b2e56c8f --- /dev/null +++ b/rbi/lib/finch-api/resources/sandbox/directory.rbi @@ -0,0 +1,23 @@ +# typed: strong + +module FinchAPI + module Resources + class Sandbox + class Directory + sig do + params( + body: T::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body], + request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + ) + .returns(FinchAPI::Models::Sandbox::DirectoryCreateResponse) + end + def create(body: nil, request_options: {}) + end + + sig { params(client: FinchAPI::Client).void } + def initialize(client:) + end + end + end + end +end diff --git a/rbi/lib/finch-api/resources/sandbox/employment.rbi b/rbi/lib/finch-api/resources/sandbox/employment.rbi new file mode 100644 index 00000000..55ace8c4 --- /dev/null +++ b/rbi/lib/finch-api/resources/sandbox/employment.rbi @@ -0,0 +1,62 @@ +# typed: strong + +module FinchAPI + module Resources + class Sandbox + class Employment + sig do + params( + individual_id: String, + class_code: T.nilable(String), + custom_fields: T::Array[FinchAPI::Models::Sandbox::EmploymentUpdateParams::CustomField], + department: T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Department), + employment: T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment), + employment_status: T.nilable(Symbol), + end_date: T.nilable(String), + first_name: T.nilable(String), + income: T.nilable(FinchAPI::Models::Income), + income_history: T.nilable(T::Array[T.nilable(FinchAPI::Models::Income)]), + is_active: T.nilable(T::Boolean), + last_name: T.nilable(String), + latest_rehire_date: T.nilable(String), + location: T.nilable(FinchAPI::Models::Location), + manager: T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Manager), + middle_name: T.nilable(String), + source_id: String, + start_date: T.nilable(String), + title: T.nilable(String), + request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + ) + .returns(FinchAPI::Models::Sandbox::EmploymentUpdateResponse) + end + def update( + individual_id, + class_code: nil, + custom_fields: nil, + department: nil, + employment: nil, + employment_status: nil, + end_date: nil, + first_name: nil, + income: nil, + income_history: nil, + is_active: nil, + last_name: nil, + latest_rehire_date: nil, + location: nil, + manager: nil, + middle_name: nil, + source_id: nil, + start_date: nil, + title: nil, + request_options: {} + ) + end + + sig { params(client: FinchAPI::Client).void } + def initialize(client:) + end + end + end + end +end diff --git a/rbi/lib/finch-api/resources/sandbox/individual.rbi b/rbi/lib/finch-api/resources/sandbox/individual.rbi new file mode 100644 index 00000000..5826ec6c --- /dev/null +++ b/rbi/lib/finch-api/resources/sandbox/individual.rbi @@ -0,0 +1,50 @@ +# typed: strong + +module FinchAPI + module Resources + class Sandbox + class Individual + sig do + params( + individual_id: String, + dob: T.nilable(String), + emails: T.nilable(T::Array[FinchAPI::Models::Sandbox::IndividualUpdateParams::Email]), + encrypted_ssn: T.nilable(String), + ethnicity: T.nilable(Symbol), + first_name: T.nilable(String), + gender: T.nilable(Symbol), + last_name: T.nilable(String), + middle_name: T.nilable(String), + phone_numbers: T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber)]), + preferred_name: T.nilable(String), + residence: T.nilable(FinchAPI::Models::Location), + ssn: T.nilable(String), + request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + ) + .returns(FinchAPI::Models::Sandbox::IndividualUpdateResponse) + end + def update( + individual_id, + dob: nil, + emails: nil, + encrypted_ssn: nil, + ethnicity: nil, + first_name: nil, + gender: nil, + last_name: nil, + middle_name: nil, + phone_numbers: nil, + preferred_name: nil, + residence: nil, + ssn: nil, + request_options: {} + ) + end + + sig { params(client: FinchAPI::Client).void } + def initialize(client:) + end + end + end + end +end diff --git a/rbi/lib/finch-api/resources/sandbox/jobs.rbi b/rbi/lib/finch-api/resources/sandbox/jobs.rbi new file mode 100644 index 00000000..da174818 --- /dev/null +++ b/rbi/lib/finch-api/resources/sandbox/jobs.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module FinchAPI + module Resources + class Sandbox + class Jobs + sig { returns(FinchAPI::Resources::Sandbox::Jobs::Configuration) } + def configuration + end + + sig do + params( + type: Symbol, + request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + ) + .returns(FinchAPI::Models::Sandbox::JobCreateResponse) + end + def create(type:, request_options: {}) + end + + sig { params(client: FinchAPI::Client).void } + def initialize(client:) + end + end + end + end +end diff --git a/rbi/lib/finch-api/resources/sandbox/jobs/configuration.rbi b/rbi/lib/finch-api/resources/sandbox/jobs/configuration.rbi new file mode 100644 index 00000000..8cc6491d --- /dev/null +++ b/rbi/lib/finch-api/resources/sandbox/jobs/configuration.rbi @@ -0,0 +1,33 @@ +# typed: strong + +module FinchAPI + module Resources + class Sandbox + class Jobs + class Configuration + sig do + params(request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]))) + .returns(FinchAPI::Models::Sandbox::Jobs::ConfigurationRetrieveResponse) + end + def retrieve(request_options: {}) + end + + sig do + params( + completion_status: Symbol, + type: Symbol, + request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + ) + .returns(FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration) + end + def update(completion_status:, type:, request_options: {}) + end + + sig { params(client: FinchAPI::Client).void } + def initialize(client:) + end + end + end + end + end +end diff --git a/rbi/lib/finch-api/resources/sandbox/payment.rbi b/rbi/lib/finch-api/resources/sandbox/payment.rbi new file mode 100644 index 00000000..9cca17f8 --- /dev/null +++ b/rbi/lib/finch-api/resources/sandbox/payment.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module FinchAPI + module Resources + class Sandbox + class Payment + sig do + params( + end_date: String, + pay_statements: T::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement], + start_date: String, + request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + ) + .returns(FinchAPI::Models::Sandbox::PaymentCreateResponse) + end + def create(end_date: nil, pay_statements: nil, start_date: nil, request_options: {}) + end + + sig { params(client: FinchAPI::Client).void } + def initialize(client:) + end + end + end + end +end diff --git a/rbi/lib/finch-api/resources/webhooks.rbi b/rbi/lib/finch-api/resources/webhooks.rbi new file mode 100644 index 00000000..ea96b9fa --- /dev/null +++ b/rbi/lib/finch-api/resources/webhooks.rbi @@ -0,0 +1,11 @@ +# typed: strong + +module FinchAPI + module Resources + class Webhooks + sig { params(client: FinchAPI::Client).void } + def initialize(client:) + end + end + end +end diff --git a/rbi/lib/finch-api/responses_page.rbi b/rbi/lib/finch-api/responses_page.rbi new file mode 100644 index 00000000..a2d3aefe --- /dev/null +++ b/rbi/lib/finch-api/responses_page.rbi @@ -0,0 +1,29 @@ +# typed: strong + +module FinchAPI + class ResponsesPage + include FinchAPI::BasePage + + Elem = type_member + + sig { returns(T::Array[Elem]) } + def responses + end + + sig { params(_: T::Array[Elem]).returns(T::Array[Elem]) } + def responses=(_) + end + + sig do + params( + client: FinchAPI::BaseClient, + req: FinchAPI::BaseClient::RequestComponentsShape, + headers: T.any(T::Hash[String, String], Net::HTTPHeader), + unwrapped: T::Array[T.anything] + ) + .void + end + def initialize(client:, req:, headers:, unwrapped:) + end + end +end diff --git a/rbi/lib/finch-api/single_page.rbi b/rbi/lib/finch-api/single_page.rbi new file mode 100644 index 00000000..25050792 --- /dev/null +++ b/rbi/lib/finch-api/single_page.rbi @@ -0,0 +1,33 @@ +# typed: strong + +module FinchAPI + class SinglePage < ::Array + include FinchAPI::BasePage + + Elem = type_member + + sig do + params( + client: FinchAPI::BaseClient, + req: FinchAPI::BaseClient::RequestComponentsShape, + headers: T.any(T::Hash[String, String], Net::HTTPHeader), + unwrapped: T::Array[T.anything] + ) + .void + end + def initialize(client:, req:, headers:, unwrapped:) + end + + sig { override.returns(T::Boolean) } + def next_page? + end + + sig { override.returns(T.self_type) } + def next_page + end + + sig { override.params(blk: T.proc.params(arg0: Elem).void).void } + def auto_paging_each(&blk) + end + end +end diff --git a/rbi/lib/finch-api/util.rbi b/rbi/lib/finch-api/util.rbi new file mode 100644 index 00000000..ccc5b64c --- /dev/null +++ b/rbi/lib/finch-api/util.rbi @@ -0,0 +1,167 @@ +# typed: strong + +module FinchAPI + module Util + sig { returns(Float) } + def self.monotonic_secs + end + + sig { returns(String) } + def self.arch + end + + sig { returns(String) } + def self.os + end + + sig { params(input: T.anything).returns(T.any(T::Boolean, T.anything)) } + def self.primitive?(input) + end + + sig { params(input: T.anything).returns(T.any(T::Boolean, T.anything)) } + def self.coerce_boolean(input) + end + + sig { params(input: T.anything).returns(T.nilable(T::Boolean)) } + def self.coerce_boolean!(input) + end + + sig { params(input: T.anything).returns(T.any(Integer, T.anything)) } + def self.coerce_integer(input) + end + + sig { params(input: T.anything).returns(T.any(Float, T.anything)) } + def self.coerce_float(input) + end + + sig { params(input: T.anything).returns(T.any(T::Hash[T.anything, T.anything], T.anything)) } + def self.coerce_hash(input) + end + + OMIT = T.let(T.anything, T.anything) + + sig { params(lhs: T.anything, rhs: T.anything, concat: T::Boolean).returns(T.anything) } + private_class_method def self.deep_merge_lr(lhs, rhs, concat: false) + end + + sig do + params(values: T::Array[T.anything], sentinel: T.nilable(T.anything), concat: T::Boolean) + .returns(T.anything) + end + def self.deep_merge(*values, sentinel: nil, concat: false) + end + + sig do + params( + data: T.any(T::Hash[Symbol, T.anything], T::Array[T.anything], T.anything), + pick: T.nilable(T.any(Symbol, Integer, T::Array[T.any(Symbol, Integer)])), + sentinel: T.nilable(T.anything), + blk: T.nilable(T.proc.returns(T.anything)) + ) + .returns(T.nilable(T.anything)) + end + def self.dig(data, pick, sentinel = nil, &blk) + end + + sig { params(uri: URI::Generic).returns(String) } + def self.uri_origin(uri) + end + + sig { params(path: T.any(String, T::Array[String])).returns(String) } + def self.interpolate_path(path) + end + + sig { params(query: T.nilable(String)).returns(T::Hash[String, T::Array[String]]) } + def self.decode_query(query) + end + + sig do + params(query: T.nilable(T::Hash[String, T.nilable(T.any(T::Array[String], String))])) + .returns(T.nilable(String)) + end + def self.encode_query(query) + end + + ParsedUriShape = T.type_alias do + { + scheme: T.nilable(String), + host: T.nilable(String), + port: T.nilable(Integer), + path: T.nilable(String), + query: T::Hash[String, T::Array[String]] + } + end + + sig { params(url: T.any(URI::Generic, String)).returns(FinchAPI::Util::ParsedUriShape) } + def self.parse_uri(url) + end + + sig { params(parsed: FinchAPI::Util::ParsedUriShape).returns(URI::Generic) } + def self.unparse_uri(parsed) + end + + sig do + params(lhs: FinchAPI::Util::ParsedUriShape, rhs: FinchAPI::Util::ParsedUriShape).returns(URI::Generic) + end + def self.join_parsed_uri(lhs, rhs) + end + + sig do + params( + headers: T::Hash[String, + T.nilable(T.any(String, Integer, T::Array[T.nilable(T.any(String, Integer))]))] + ) + .returns(T::Hash[String, String]) + end + def self.normalized_headers(*headers) + end + + sig { params(io: StringIO, boundary: String, key: T.any(Symbol, String), val: T.anything).void } + private_class_method def self.encode_multipart_formdata(io, boundary:, key:, val:) + end + + sig { params(headers: T::Hash[String, String], body: T.anything).returns(T.anything) } + def self.encode_content(headers, body) + end + + sig do + params( + headers: T.any(T::Hash[String, String], Net::HTTPHeader), + stream: T::Enumerable[String], + suppress_error: T::Boolean + ) + .returns(T.anything) + end + def self.decode_content(headers, stream:, suppress_error: false) + end + + sig { params(enum: T::Enumerable[T.anything], close: T.proc.void).returns(T::Enumerable[T.anything]) } + def self.fused_enum(enum, &close) + end + + sig { params(enum: T.nilable(T::Enumerable[T.anything])).void } + def self.close_fused!(enum) + end + + sig do + params( + enum: T.nilable(T::Enumerable[T.anything]), + blk: T.proc.params(arg0: Enumerator::Yielder).void + ).void + end + def self.chain_fused(enum, &blk) + end + + SSEMessage = T.type_alias do + {event: T.nilable(String), data: T.nilable(String), id: T.nilable(String), retry: T.nilable(Integer)} + end + + sig { params(enum: T::Enumerable[String]).returns(T::Enumerable[String]) } + def self.enum_lines(enum) + end + + sig { params(lines: T::Enumerable[String]).returns(FinchAPI::Util::SSEMessage) } + def self.parse_sse(lines) + end + end +end diff --git a/rbi/lib/finch-api/version.rbi b/rbi/lib/finch-api/version.rbi new file mode 100644 index 00000000..a9a8c777 --- /dev/null +++ b/rbi/lib/finch-api/version.rbi @@ -0,0 +1,5 @@ +# typed: strong + +module FinchAPI + VERSION = "0.0.1-alpha.0" +end diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 00000000..e8b8e8c3 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,68 @@ +{ + "packages": { + ".": {} + }, + "$schema": "https://raw.githubusercontent.com/stainless-api/release-please/main/schemas/config.json", + "include-v-in-tag": true, + "include-component-in-tag": false, + "versioning": "prerelease", + "prerelease": true, + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": false, + "pull-request-header": "Automated Release PR", + "pull-request-title-pattern": "release: ${version}", + "changelog-sections": [ + { + "type": "feat", + "section": "Features" + }, + { + "type": "fix", + "section": "Bug Fixes" + }, + { + "type": "perf", + "section": "Performance Improvements" + }, + { + "type": "revert", + "section": "Reverts" + }, + { + "type": "chore", + "section": "Chores" + }, + { + "type": "docs", + "section": "Documentation" + }, + { + "type": "style", + "section": "Styles" + }, + { + "type": "refactor", + "section": "Refactors" + }, + { + "type": "test", + "section": "Tests", + "hidden": true + }, + { + "type": "build", + "section": "Build System" + }, + { + "type": "ci", + "section": "Continuous Integration", + "hidden": true + } + ], + "reviewers": [ + "jordanbrauer", + "minupalaniappan" + ], + "release-type": "ruby", + "version-file": "lib/finch-api/version.rb" +} \ No newline at end of file diff --git a/scripts/bootstrap b/scripts/bootstrap new file mode 100755 index 00000000..0b65ccb0 --- /dev/null +++ b/scripts/bootstrap @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then + brew bundle check >/dev/null 2>&1 || { + echo "==> Installing Homebrew dependencies…" + brew bundle + } +fi + +echo "==> Installing Ruby dependencies…" + +bundle install diff --git a/scripts/format b/scripts/format new file mode 100755 index 00000000..67b400de --- /dev/null +++ b/scripts/format @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -e + +cd -- "$(dirname -- "$0")/.." + +echo "==> Running formatters" +exec -- bundle exec rake format "$@" diff --git a/scripts/lint b/scripts/lint new file mode 100755 index 00000000..39581dc1 --- /dev/null +++ b/scripts/lint @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +set -e + +cd -- "$(dirname -- "$0")/.." + +exec -- bundle exec rake lint "$@" diff --git a/scripts/mock b/scripts/mock new file mode 100755 index 00000000..d2814ae6 --- /dev/null +++ b/scripts/mock @@ -0,0 +1,41 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +if [[ -n "$1" && "$1" != '--'* ]]; then + URL="$1" + shift +else + URL="$(grep 'openapi_spec_url' .stats.yml | cut -d' ' -f2)" +fi + +# Check if the URL is empty +if [ -z "$URL" ]; then + echo "Error: No OpenAPI spec path/url provided or found in .stats.yml" + exit 1 +fi + +echo "==> Starting mock server with URL ${URL}" + +# Run prism mock on the given spec +if [ "$1" == "--daemon" ]; then + npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" &> .prism.log & + + # Wait for server to come online + echo -n "Waiting for server" + while ! grep -q "✖ fatal\|Prism is listening" ".prism.log" ; do + echo -n "." + sleep 0.1 + done + + if grep -q "✖ fatal" ".prism.log"; then + cat .prism.log + exit 1 + fi + + echo +else + npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" +fi diff --git a/scripts/test b/scripts/test new file mode 100755 index 00000000..2e1fe093 --- /dev/null +++ b/scripts/test @@ -0,0 +1,56 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[0;33m' +NC='\033[0m' # No Color + +function prism_is_running() { + curl --silent "http://localhost:4010" >/dev/null 2>&1 +} + +kill_server_on_port() { + pids=$(lsof -t -i tcp:"$1" || echo "") + if [ "$pids" != "" ]; then + kill "$pids" + echo "Stopped $pids." + fi +} + +function is_overriding_api_base_url() { + [ -n "$TEST_API_BASE_URL" ] +} + +if ! is_overriding_api_base_url && ! prism_is_running ; then + # When we exit this script, make sure to kill the background mock server process + trap 'kill_server_on_port 4010' EXIT + + # Start the dev server + ./scripts/mock --daemon +fi + +if is_overriding_api_base_url ; then + echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}" + echo +elif ! prism_is_running ; then + echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server" + echo -e "running against your OpenAPI spec." + echo + echo -e "To run the server, pass in the path or url of your OpenAPI" + echo -e "spec to the prism command:" + echo + echo -e " \$ ${YELLOW}npm exec --package=@stoplight/prism-cli@~5.3.2 -- prism mock path/to/your.openapi.yml${NC}" + echo + + exit 1 +else + echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}" + echo +fi + +echo "==> Running tests" +bundle exec rake test "$@" diff --git a/sig/finch-api/base_client.rbs b/sig/finch-api/base_client.rbs new file mode 100644 index 00000000..f6581c39 --- /dev/null +++ b/sig/finch-api/base_client.rbs @@ -0,0 +1,101 @@ +module FinchAPI + class BaseClient + type request_components = + { + method: Symbol, + path: String | ::Array[String], + query: ::Hash[String, (::Array[String] | String)?]?, + headers: ::Hash[String, (String + | Integer + | ::Array[(String | Integer)?])?]?, + body: top?, + unwrap: Symbol?, + page: Class?, + stream: Class?, + model: FinchAPI::Converter::input?, + options: FinchAPI::request_opts? + } + + type request_input = + { + method: Symbol, + url: URI::Generic, + headers: ::Hash[String, String], + body: top, + max_retries: Integer, + timeout: Float + } + + MAX_REDIRECTS: 20 + + PLATFORM_HEADERS: ::Hash[String, String] + + def self.validate!: (FinchAPI::BaseClient::request_components req) -> void + + def self.should_retry?: ( + Integer status, + headers: ::Hash[String, String] + ) -> bool + + def self.follow_redirect: ( + FinchAPI::BaseClient::request_input request, + status: Integer, + response_headers: ::Hash[String, String] + ) -> FinchAPI::BaseClient::request_input + + # @private + attr_accessor requester: top + + def initialize: ( + base_url: String, + timeout: Float, + max_retries: Integer, + initial_retry_delay: Float, + max_retry_delay: Float, + headers: ::Hash[String, (String + | Integer + | ::Array[(String | Integer)?])?], + idempotency_header: String? + ) -> void + + private def auth_headers: -> ::Hash[String, String] + + private def generate_idempotency_key: -> String + + private def build_request: ( + FinchAPI::BaseClient::request_components req, + FinchAPI::request_options opts + ) -> FinchAPI::BaseClient::request_input + + private def retry_delay: ( + ::Hash[String, String] headers, + retry_count: Integer + ) -> Float + + private def send_request: ( + FinchAPI::BaseClient::request_input request, + redirect_count: Integer, + retry_count: Integer, + send_retry_header: bool + ) -> [Integer, top, Enumerable[String]] + + def request: + ( + Symbol method, + String | ::Array[String] path, + query: ::Hash[String, (::Array[String] | String)?]?, + headers: ::Hash[String, (String + | Integer + | ::Array[(String | Integer)?])?]?, + body: top?, + unwrap: Symbol?, + page: Class?, + stream: Class?, + model: FinchAPI::Converter::input?, + options: FinchAPI::request_opts? + ) -> top + | (FinchAPI::BaseClient::request_components req) -> top + + def inspect: -> String + end +end diff --git a/sig/finch-api/base_model.rbs b/sig/finch-api/base_model.rbs new file mode 100644 index 00000000..a535259c --- /dev/null +++ b/sig/finch-api/base_model.rbs @@ -0,0 +1,242 @@ +module FinchAPI + module Converter + type input = FinchAPI::Converter | Class + + def coerce: (top value) -> top + + def dump: (top value) -> top + + def try_strict_coerce: ( + top value + ) -> ([true, top, nil] | [false, bool, Integer]) + + def self.type_info: ( + { + const: (nil | bool | Integer | Float | Symbol)?, + enum: ^-> FinchAPI::Converter::input?, + union: ^-> FinchAPI::Converter::input? + } + | ^-> FinchAPI::Converter::input + | FinchAPI::Converter::input spec + ) -> (^-> top) + + def self.coerce: (FinchAPI::Converter::input target, top value) -> top + + def self.dump: (FinchAPI::Converter::input target, top value) -> top + + def self.try_strict_coerce: ( + FinchAPI::Converter::input target, + top value + ) -> top + end + + class Unknown + extend FinchAPI::Converter + + def self.===: (top other) -> bool + + def self.==: (top other) -> bool + + def self.coerce: (top value) -> top + + def self.dump: (top value) -> top + + def self.try_strict_coerce: ( + top value + ) -> ([true, top, nil] | [false, bool, Integer]) + end + + class BooleanModel + extend FinchAPI::Converter + + def self.===: (top other) -> bool + + def self.==: (top other) -> bool + + def self.coerce: (bool | top value) -> (bool | top) + + def self.dump: (bool | top value) -> (bool | top) + + def self.try_strict_coerce: ( + top value + ) -> ([true, top, nil] | [false, bool, Integer]) + end + + class Enum + extend FinchAPI::Converter + + def self.values: -> ::Array[(nil | bool | Integer | Float | Symbol)] + + private def self.finalize!: -> void + + def self.===: (top other) -> bool + + def self.==: (top other) -> bool + + def self.coerce: (String | Symbol | top value) -> (Symbol | top) + + def self.dump: (Symbol | top value) -> (Symbol | top) + + def self.try_strict_coerce: ( + top value + ) -> ([true, top, nil] | [false, bool, Integer]) + end + + class Union + extend FinchAPI::Converter + + private def self.known_variants: -> ::Array[[Symbol?, Proc]] + + def self.variants: -> ::Array[[Symbol?, top]] + + private def self.discriminator: (Symbol property) -> void + + private def self.variant: ( + Symbol + | ::Hash[Symbol, top] + | ^-> FinchAPI::Converter::input + | FinchAPI::Converter::input key, + ?::Hash[Symbol, top] + | ^-> FinchAPI::Converter::input + | FinchAPI::Converter::input spec + ) -> void + + private def self.resolve_variant: (top value) -> FinchAPI::Converter::input? + + def self.===: (top other) -> bool + + def self.==: (top other) -> bool + + def self.coerce: (top value) -> top + + def self.dump: (top value) -> top + + def self.try_strict_coerce: ( + top value + ) -> ([true, top, nil] | [false, bool, Integer]) + end + + class ArrayOf + include FinchAPI::Converter + + def ===: (top other) -> bool + + def ==: (top other) -> bool + + def coerce: (Enumerable[top] | top value) -> (::Array[top] | top) + + def dump: (Enumerable[top] | top value) -> (::Array[top] | top) + + def try_strict_coerce: ( + top value + ) -> ([true, top, nil] | [false, bool, Integer]) + + def item_type: -> FinchAPI::Converter::input + + def initialize: ( + ::Hash[Symbol, top] + | ^-> FinchAPI::Converter::input + | FinchAPI::Converter::input type_info, + ?::Hash[Symbol, top] spec + ) -> void + end + + class HashOf + include FinchAPI::Converter + + def ===: (top other) -> bool + + def ==: (top other) -> bool + + def coerce: (::Hash[top, top] | top value) -> (::Hash[Symbol, top] | top) + + def dump: (::Hash[top, top] | top value) -> (::Hash[Symbol, top] | top) + + def try_strict_coerce: ( + top value + ) -> ([true, top, nil] | [false, bool, Integer]) + + def item_type: -> FinchAPI::Converter::input + + def initialize: ( + ::Hash[Symbol, top] + | ^-> FinchAPI::Converter::input + | FinchAPI::Converter::input type_info, + ?::Hash[Symbol, top] spec + ) -> void + end + + class BaseModel + extend FinchAPI::Converter + + type known_field = { mode: (:coerce | :dump)?, required: bool } + + def self.known_fields: -> ::Hash[Symbol, (FinchAPI::BaseModel::known_field + & { type_fn: (^-> FinchAPI::Converter::input) })] + + def self.fields: -> ::Hash[Symbol, (FinchAPI::BaseModel::known_field + & { type: FinchAPI::Converter::input })] + + def self.defaults: -> ::Hash[Symbol, (^-> Class)] + + private def self.add_field: ( + Symbol name_sym, + required: bool, + type_info: { + const: (nil | bool | Integer | Float | Symbol)?, + enum: ^-> FinchAPI::Converter::input?, + union: ^-> FinchAPI::Converter::input?, + api_name: Symbol + } + | ^-> FinchAPI::Converter::input + | FinchAPI::Converter::input, + spec: ::Hash[Symbol, top] + ) -> void + + def self.required: ( + Symbol name_sym, + ::Hash[Symbol, top] + | ^-> FinchAPI::Converter::input + | FinchAPI::Converter::input type_info, + ?::Hash[Symbol, top] spec + ) -> void + + def self.optional: ( + Symbol name_sym, + ::Hash[Symbol, top] + | ^-> FinchAPI::Converter::input + | FinchAPI::Converter::input type_info, + ?::Hash[Symbol, top] spec + ) -> void + + private def self.request_only: { -> void } -> void + + private def self.response_only: { -> void } -> void + + def ==: (top other) -> bool + + def self.coerce: ( + FinchAPI::BaseModel | ::Hash[top, top] | top value + ) -> (instance | top) + + def self.dump: (instance | top value) -> (::Hash[top, top] | top) + + def self.try_strict_coerce: ( + top value + ) -> ([true, top, nil] | [false, bool, Integer]) + + def []: (Symbol key) -> top? + + def to_h: -> ::Hash[Symbol, top] + + alias to_hash to_h + + def deconstruct_keys: (::Array[Symbol]? keys) -> ::Hash[Symbol, top] + + def initialize: (?::Hash[Symbol, top] | self data) -> void + + def to_s: -> String + + def inspect: -> String + end +end diff --git a/sig/finch-api/base_page.rbs b/sig/finch-api/base_page.rbs new file mode 100644 index 00000000..1ba129aa --- /dev/null +++ b/sig/finch-api/base_page.rbs @@ -0,0 +1,20 @@ +module FinchAPI + module BasePage[Elem] + def next_page?: -> bool + + def next_page: -> self + + def auto_paging_each: { (Elem arg0) -> void } -> void + + def to_enum: -> Enumerable[Elem] + + alias enum_for to_enum + + def initialize: ( + client: FinchAPI::BaseClient, + req: FinchAPI::BaseClient::request_components, + headers: ::Hash[String, String], + unwrapped: top + ) -> void + end +end diff --git a/sig/finch-api/client.rbs b/sig/finch-api/client.rbs new file mode 100644 index 00000000..48cde6a1 --- /dev/null +++ b/sig/finch-api/client.rbs @@ -0,0 +1,54 @@ +module FinchAPI + class Client < FinchAPI::BaseClient + DEFAULT_MAX_RETRIES: 2 + + DEFAULT_TIMEOUT_IN_SECONDS: Float + + DEFAULT_INITIAL_RETRY_DELAY: Float + + DEFAULT_MAX_RETRY_DELAY: Float + + attr_reader access_token: String? + + attr_reader client_id: String? + + attr_reader client_secret: String? + + attr_reader access_tokens: FinchAPI::Resources::AccessTokens + + attr_reader hris: FinchAPI::Resources::HRIS + + attr_reader providers: FinchAPI::Resources::Providers + + attr_reader account: FinchAPI::Resources::Account + + attr_reader webhooks: FinchAPI::Resources::Webhooks + + attr_reader request_forwarding: FinchAPI::Resources::RequestForwarding + + attr_reader jobs: FinchAPI::Resources::Jobs + + attr_reader sandbox: FinchAPI::Resources::Sandbox + + attr_reader payroll: FinchAPI::Resources::Payroll + + attr_reader connect: FinchAPI::Resources::Connect + + private def auth_headers: -> ::Hash[String, String] + + private def bearer_auth: -> ::Hash[String, String] + + private def basic_auth: -> ::Hash[String, String] + + def initialize: ( + base_url: String?, + access_token: String?, + client_id: String?, + client_secret: String?, + max_retries: Integer, + timeout: Float, + initial_retry_delay: Float, + max_retry_delay: Float + ) -> void + end +end diff --git a/sig/finch-api/errors.rbs b/sig/finch-api/errors.rbs new file mode 100644 index 00000000..933a0b2d --- /dev/null +++ b/sig/finch-api/errors.rbs @@ -0,0 +1,99 @@ +module FinchAPI + class Error < StandardError + attr_reader cause: StandardError? + end + + class ConversionError < FinchAPI::Error + end + + class APIError < FinchAPI::Error + attr_reader url: URI::Generic + + attr_reader status: Integer? + + attr_reader body: top? + + def initialize: ( + url: URI::Generic, + status: Integer?, + body: Object?, + request: nil, + response: nil, + message: String? + ) -> void + end + + class APIConnectionError < FinchAPI::APIError + def initialize: ( + url: URI::Generic, + status: nil, + body: nil, + request: nil, + response: nil, + message: String? + ) -> void + end + + class APITimeoutError < FinchAPI::APIConnectionError + def initialize: ( + url: URI::Generic, + status: nil, + body: nil, + request: nil, + response: nil, + message: String? + ) -> void + end + + class APIStatusError < FinchAPI::APIError + def self.for: ( + url: URI::Generic, + status: Integer, + body: Object?, + request: nil, + response: nil, + message: String? + ) -> instance + + def initialize: ( + url: URI::Generic, + status: Integer, + body: Object?, + request: nil, + response: nil, + message: String? + ) -> void + end + + class BadRequestError < FinchAPI::APIStatusError + HTTP_STATUS: 400 + end + + class AuthenticationError < FinchAPI::APIStatusError + HTTP_STATUS: 401 + end + + class PermissionDeniedError < FinchAPI::APIStatusError + HTTP_STATUS: 403 + end + + class NotFoundError < FinchAPI::APIStatusError + HTTP_STATUS: 404 + end + + class ConflictError < FinchAPI::APIStatusError + HTTP_STATUS: 409 + end + + class UnprocessableEntityError < FinchAPI::APIStatusError + HTTP_STATUS: 422 + end + + class RateLimitError < FinchAPI::APIStatusError + HTTP_STATUS: 429 + end + + class InternalServerError < FinchAPI::APIStatusError + HTTP_STATUS: Range[Integer] + end +end diff --git a/sig/finch-api/extern.rbs b/sig/finch-api/extern.rbs new file mode 100644 index 00000000..3122cf04 --- /dev/null +++ b/sig/finch-api/extern.rbs @@ -0,0 +1,4 @@ +module FinchAPI + module Extern + end +end diff --git a/sig/finch-api/individuals_page.rbs b/sig/finch-api/individuals_page.rbs new file mode 100644 index 00000000..c9e6da1e --- /dev/null +++ b/sig/finch-api/individuals_page.rbs @@ -0,0 +1,16 @@ +module FinchAPI + class IndividualsPage[Elem] + include FinchAPI::BasePage[Elem] + + attr_accessor individuals: ::Array[Elem] + + attr_accessor paging: FinchAPI::Models::Paging + + def initialize: ( + client: FinchAPI::BaseClient, + req: FinchAPI::BaseClient::request_components, + headers: ::Hash[String, String], + unwrapped: ::Hash[Symbol, top] + ) -> void + end +end diff --git a/sig/finch-api/models/access_token_create_params.rbs b/sig/finch-api/models/access_token_create_params.rbs new file mode 100644 index 00000000..8a2d5ac9 --- /dev/null +++ b/sig/finch-api/models/access_token_create_params.rbs @@ -0,0 +1,46 @@ +module FinchAPI + module Models + type access_token_create_params = + { + code: String, + client_id: String, + client_secret: String, + redirect_uri: String + } + & FinchAPI::request_parameters + + class AccessTokenCreateParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + attr_accessor code: String + + attr_reader client_id: String? + + def client_id=: (String) -> String + + attr_reader client_secret: String? + + def client_secret=: (String) -> String + + attr_reader redirect_uri: String? + + def redirect_uri=: (String) -> String + + def initialize: + ( + code: String, + client_id: String, + client_secret: String, + redirect_uri: String, + request_options: FinchAPI::request_opts + ) -> void + | ( + ?FinchAPI::Models::access_token_create_params + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::access_token_create_params + end + end +end diff --git a/sig/finch-api/models/account_disconnect_params.rbs b/sig/finch-api/models/account_disconnect_params.rbs new file mode 100644 index 00000000..58661542 --- /dev/null +++ b/sig/finch-api/models/account_disconnect_params.rbs @@ -0,0 +1,19 @@ +module FinchAPI + module Models + type account_disconnect_params = { } & FinchAPI::request_parameters + + class AccountDisconnectParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + def initialize: + (request_options: FinchAPI::request_opts) -> void + | ( + ?FinchAPI::Models::account_disconnect_params + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::account_disconnect_params + end + end +end diff --git a/sig/finch-api/models/account_introspect_params.rbs b/sig/finch-api/models/account_introspect_params.rbs new file mode 100644 index 00000000..278c1428 --- /dev/null +++ b/sig/finch-api/models/account_introspect_params.rbs @@ -0,0 +1,19 @@ +module FinchAPI + module Models + type account_introspect_params = { } & FinchAPI::request_parameters + + class AccountIntrospectParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + def initialize: + (request_options: FinchAPI::request_opts) -> void + | ( + ?FinchAPI::Models::account_introspect_params + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::account_introspect_params + end + end +end diff --git a/sig/finch-api/models/account_update_event.rbs b/sig/finch-api/models/account_update_event.rbs new file mode 100644 index 00000000..9e10be9e --- /dev/null +++ b/sig/finch-api/models/account_update_event.rbs @@ -0,0 +1,1448 @@ +module FinchAPI + module Models + type account_update_event = + { + data: FinchAPI::Models::AccountUpdateEvent::Data, + event_type: FinchAPI::Models::AccountUpdateEvent::event_type + } + + class AccountUpdateEvent < FinchAPI::Models::BaseWebhookEvent + attr_reader data: FinchAPI::Models::AccountUpdateEvent::Data? + + def data=: ( + FinchAPI::Models::AccountUpdateEvent::Data + ) -> FinchAPI::Models::AccountUpdateEvent::Data + + attr_reader event_type: FinchAPI::Models::AccountUpdateEvent::event_type? + + def event_type=: ( + FinchAPI::Models::AccountUpdateEvent::event_type + ) -> FinchAPI::Models::AccountUpdateEvent::event_type + + def initialize: + ( + data: FinchAPI::Models::AccountUpdateEvent::Data, + event_type: FinchAPI::Models::AccountUpdateEvent::event_type + ) -> void + | ( + ?FinchAPI::Models::account_update_event | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::account_update_event + + type data = + { + authentication_method: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod, + status: FinchAPI::Models::connection_status_type + } + + class Data < FinchAPI::BaseModel + attr_accessor authentication_method: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod + + attr_accessor status: FinchAPI::Models::connection_status_type + + def initialize: + ( + authentication_method: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod, + status: FinchAPI::Models::connection_status_type + ) -> void + | ( + ?FinchAPI::Models::AccountUpdateEvent::data + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::AccountUpdateEvent::data + + type authentication_method = + { + benefits_support: FinchAPI::Models::HRIS::BenefitsSupport?, + supported_fields: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields?, + type: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::type_ + } + + class AuthenticationMethod < FinchAPI::BaseModel + attr_accessor benefits_support: FinchAPI::Models::HRIS::BenefitsSupport? + + attr_accessor supported_fields: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields? + + attr_reader type: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::type_? + + def type=: ( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::type_ + ) -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::type_ + + def initialize: + ( + benefits_support: FinchAPI::Models::HRIS::BenefitsSupport?, + supported_fields: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields?, + type: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::type_ + ) -> void + | ( + ?FinchAPI::Models::AccountUpdateEvent::Data::authentication_method + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::authentication_method + + type supported_fields = + { + company: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company, + directory: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory, + employment: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment, + individual: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual, + pay_group: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayGroup, + pay_statement: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement, + payment: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment + } + + class SupportedFields < FinchAPI::BaseModel + attr_reader company: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company? + + def company=: ( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company + ) -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company + + attr_reader directory: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory? + + def directory=: ( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory + ) -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory + + attr_reader employment: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment? + + def employment=: ( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment + ) -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment + + attr_reader individual: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual? + + def individual=: ( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual + ) -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual + + attr_reader pay_group: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayGroup? + + def pay_group=: ( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayGroup + ) -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayGroup + + attr_reader pay_statement: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement? + + def pay_statement=: ( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement + ) -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement + + attr_reader payment: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment? + + def payment=: ( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment + ) -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment + + def initialize: + ( + company: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company, + directory: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory, + employment: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment, + individual: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual, + pay_group: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayGroup, + pay_statement: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement, + payment: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment + ) -> void + | ( + ?FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::supported_fields + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::supported_fields + + type company = + { + id: bool, + accounts: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Accounts, + departments: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments, + ein: bool, + entity: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Entity, + legal_name: bool, + locations: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Locations, + primary_email: bool, + primary_phone_number: bool + } + + class Company < FinchAPI::BaseModel + attr_reader id: bool? + + def id=: (bool) -> bool + + attr_reader accounts: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Accounts? + + def accounts=: ( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Accounts + ) -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Accounts + + attr_reader departments: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments? + + def departments=: ( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments + ) -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments + + attr_reader ein: bool? + + def ein=: (bool) -> bool + + attr_reader entity: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Entity? + + def entity=: ( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Entity + ) -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Entity + + attr_reader legal_name: bool? + + def legal_name=: (bool) -> bool + + attr_reader locations: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Locations? + + def locations=: ( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Locations + ) -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Locations + + attr_reader primary_email: bool? + + def primary_email=: (bool) -> bool + + attr_reader primary_phone_number: bool? + + def primary_phone_number=: (bool) -> bool + + def initialize: + ( + id: bool, + accounts: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Accounts, + departments: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments, + ein: bool, + entity: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Entity, + legal_name: bool, + locations: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Locations, + primary_email: bool, + primary_phone_number: bool + ) -> void + | ( + ?FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::company + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::company + + type accounts = + { + account_name: bool, + account_number: bool, + account_type: bool, + institution_name: bool, + routing_number: bool + } + + class Accounts < FinchAPI::BaseModel + attr_reader account_name: bool? + + def account_name=: (bool) -> bool + + attr_reader account_number: bool? + + def account_number=: (bool) -> bool + + attr_reader account_type: bool? + + def account_type=: (bool) -> bool + + attr_reader institution_name: bool? + + def institution_name=: (bool) -> bool + + attr_reader routing_number: bool? + + def routing_number=: (bool) -> bool + + def initialize: + ( + account_name: bool, + account_number: bool, + account_type: bool, + institution_name: bool, + routing_number: bool + ) -> void + | ( + ?FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::accounts + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::accounts + end + + type departments = + { + name: bool, + parent: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments::Parent + } + + class Departments < FinchAPI::BaseModel + attr_reader name: bool? + + def name=: (bool) -> bool + + attr_reader parent: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments::Parent? + + def parent=: ( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments::Parent + ) -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments::Parent + + def initialize: + ( + name: bool, + parent: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments::Parent + ) -> void + | ( + ?FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::departments + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::departments + + type parent = { name: bool } + + class Parent < FinchAPI::BaseModel + attr_reader name: bool? + + def name=: (bool) -> bool + + def initialize: + (name: bool) -> void + | ( + ?FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments::parent + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments::parent + end + end + + type entity = { subtype: bool, type: bool } + + class Entity < FinchAPI::BaseModel + attr_reader subtype: bool? + + def subtype=: (bool) -> bool + + attr_reader type: bool? + + def type=: (bool) -> bool + + def initialize: + (subtype: bool, type: bool) -> void + | ( + ?FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::entity + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::entity + end + + type locations = + { + city: bool, + country: bool, + :line1 => bool, + :line2 => bool, + postal_code: bool, + state: bool + } + + class Locations < FinchAPI::BaseModel + attr_reader city: bool? + + def city=: (bool) -> bool + + attr_reader country: bool? + + def country=: (bool) -> bool + + attr_reader line1: bool? + + def line1=: (bool) -> bool + + attr_reader line2: bool? + + def line2=: (bool) -> bool + + attr_reader postal_code: bool? + + def postal_code=: (bool) -> bool + + attr_reader state: bool? + + def state=: (bool) -> bool + + def initialize: + ( + city: bool, + country: bool, + line1: bool, + line2: bool, + postal_code: bool, + state: bool + ) -> void + | ( + ?FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::locations + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::locations + end + end + + type directory = + { + individuals: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals, + paging: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Paging + } + + class Directory < FinchAPI::BaseModel + attr_reader individuals: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals? + + def individuals=: ( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals + ) -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals + + attr_reader paging: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Paging? + + def paging=: ( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Paging + ) -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Paging + + def initialize: + ( + individuals: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals, + paging: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Paging + ) -> void + | ( + ?FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::directory + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::directory + + type individuals = + { + id: bool, + department: bool, + first_name: bool, + is_active: bool, + last_name: bool, + manager: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager, + middle_name: bool + } + + class Individuals < FinchAPI::BaseModel + attr_reader id: bool? + + def id=: (bool) -> bool + + attr_reader department: bool? + + def department=: (bool) -> bool + + attr_reader first_name: bool? + + def first_name=: (bool) -> bool + + attr_reader is_active: bool? + + def is_active=: (bool) -> bool + + attr_reader last_name: bool? + + def last_name=: (bool) -> bool + + attr_reader manager: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager? + + def manager=: ( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager + ) -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager + + attr_reader middle_name: bool? + + def middle_name=: (bool) -> bool + + def initialize: + ( + id: bool, + department: bool, + first_name: bool, + is_active: bool, + last_name: bool, + manager: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager, + middle_name: bool + ) -> void + | ( + ?FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::individuals + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::individuals + + type manager = { id: bool } + + class Manager < FinchAPI::BaseModel + attr_reader id: bool? + + def id=: (bool) -> bool + + def initialize: + (id: bool) -> void + | ( + ?FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals::manager + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals::manager + end + end + + type paging = { count: bool, offset: bool } + + class Paging < FinchAPI::BaseModel + attr_reader count: bool? + + def count=: (bool) -> bool + + attr_reader offset: bool? + + def offset=: (bool) -> bool + + def initialize: + (count: bool, offset: bool) -> void + | ( + ?FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::paging + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::paging + end + end + + type employment = + { + id: bool, + class_code: bool, + custom_fields: bool, + department: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Department, + employment: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Employment, + employment_status: bool, + end_date: bool, + first_name: bool, + income: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Income, + income_history: bool, + is_active: bool, + last_name: bool, + location: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Location, + manager: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Manager, + middle_name: bool, + start_date: bool, + title: bool + } + + class Employment < FinchAPI::BaseModel + attr_reader id: bool? + + def id=: (bool) -> bool + + attr_reader class_code: bool? + + def class_code=: (bool) -> bool + + attr_reader custom_fields: bool? + + def custom_fields=: (bool) -> bool + + attr_reader department: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Department? + + def department=: ( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Department + ) -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Department + + attr_reader employment: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Employment? + + def employment=: ( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Employment + ) -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Employment + + attr_reader employment_status: bool? + + def employment_status=: (bool) -> bool + + attr_reader end_date: bool? + + def end_date=: (bool) -> bool + + attr_reader first_name: bool? + + def first_name=: (bool) -> bool + + attr_reader income: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Income? + + def income=: ( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Income + ) -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Income + + attr_reader income_history: bool? + + def income_history=: (bool) -> bool + + attr_reader is_active: bool? + + def is_active=: (bool) -> bool + + attr_reader last_name: bool? + + def last_name=: (bool) -> bool + + attr_reader location: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Location? + + def location=: ( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Location + ) -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Location + + attr_reader manager: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Manager? + + def manager=: ( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Manager + ) -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Manager + + attr_reader middle_name: bool? + + def middle_name=: (bool) -> bool + + attr_reader start_date: bool? + + def start_date=: (bool) -> bool + + attr_reader title: bool? + + def title=: (bool) -> bool + + def initialize: + ( + id: bool, + class_code: bool, + custom_fields: bool, + department: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Department, + employment: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Employment, + employment_status: bool, + end_date: bool, + first_name: bool, + income: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Income, + income_history: bool, + is_active: bool, + last_name: bool, + location: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Location, + manager: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Manager, + middle_name: bool, + start_date: bool, + title: bool + ) -> void + | ( + ?FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::employment + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::employment + + type department = { name: bool } + + class Department < FinchAPI::BaseModel + attr_reader name: bool? + + def name=: (bool) -> bool + + def initialize: + (name: bool) -> void + | ( + ?FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::department + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::department + end + + type employment = { subtype: bool, type: bool } + + class Employment < FinchAPI::BaseModel + attr_reader subtype: bool? + + def subtype=: (bool) -> bool + + attr_reader type: bool? + + def type=: (bool) -> bool + + def initialize: + (subtype: bool, type: bool) -> void + | ( + ?FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::employment + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::employment + end + + type income = { amount: bool, currency: bool, unit: bool } + + class Income < FinchAPI::BaseModel + attr_reader amount: bool? + + def amount=: (bool) -> bool + + attr_reader currency: bool? + + def currency=: (bool) -> bool + + attr_reader unit: bool? + + def unit=: (bool) -> bool + + def initialize: + (amount: bool, currency: bool, unit: bool) -> void + | ( + ?FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::income + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::income + end + + type location = + { + city: bool, + country: bool, + :line1 => bool, + :line2 => bool, + postal_code: bool, + state: bool + } + + class Location < FinchAPI::BaseModel + attr_reader city: bool? + + def city=: (bool) -> bool + + attr_reader country: bool? + + def country=: (bool) -> bool + + attr_reader line1: bool? + + def line1=: (bool) -> bool + + attr_reader line2: bool? + + def line2=: (bool) -> bool + + attr_reader postal_code: bool? + + def postal_code=: (bool) -> bool + + attr_reader state: bool? + + def state=: (bool) -> bool + + def initialize: + ( + city: bool, + country: bool, + line1: bool, + line2: bool, + postal_code: bool, + state: bool + ) -> void + | ( + ?FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::location + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::location + end + + type manager = { id: bool } + + class Manager < FinchAPI::BaseModel + attr_reader id: bool? + + def id=: (bool) -> bool + + def initialize: + (id: bool) -> void + | ( + ?FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::manager + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::manager + end + end + + type individual = + { + id: bool, + dob: bool, + emails: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::Emails, + encrypted_ssn: bool, + ethnicity: bool, + first_name: bool, + gender: bool, + last_name: bool, + middle_name: bool, + phone_numbers: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::PhoneNumbers, + preferred_name: bool, + residence: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::Residence, + ssn: bool + } + + class Individual < FinchAPI::BaseModel + attr_reader id: bool? + + def id=: (bool) -> bool + + attr_reader dob: bool? + + def dob=: (bool) -> bool + + attr_reader emails: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::Emails? + + def emails=: ( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::Emails + ) -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::Emails + + attr_reader encrypted_ssn: bool? + + def encrypted_ssn=: (bool) -> bool + + attr_reader ethnicity: bool? + + def ethnicity=: (bool) -> bool + + attr_reader first_name: bool? + + def first_name=: (bool) -> bool + + attr_reader gender: bool? + + def gender=: (bool) -> bool + + attr_reader last_name: bool? + + def last_name=: (bool) -> bool + + attr_reader middle_name: bool? + + def middle_name=: (bool) -> bool + + attr_reader phone_numbers: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::PhoneNumbers? + + def phone_numbers=: ( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::PhoneNumbers + ) -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::PhoneNumbers + + attr_reader preferred_name: bool? + + def preferred_name=: (bool) -> bool + + attr_reader residence: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::Residence? + + def residence=: ( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::Residence + ) -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::Residence + + attr_reader ssn: bool? + + def ssn=: (bool) -> bool + + def initialize: + ( + id: bool, + dob: bool, + emails: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::Emails, + encrypted_ssn: bool, + ethnicity: bool, + first_name: bool, + gender: bool, + last_name: bool, + middle_name: bool, + phone_numbers: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::PhoneNumbers, + preferred_name: bool, + residence: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::Residence, + ssn: bool + ) -> void + | ( + ?FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::individual + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::individual + + type emails = { data: bool, type: bool } + + class Emails < FinchAPI::BaseModel + attr_reader data: bool? + + def data=: (bool) -> bool + + attr_reader type: bool? + + def type=: (bool) -> bool + + def initialize: + (data: bool, type: bool) -> void + | ( + ?FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::emails + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::emails + end + + type phone_numbers = { data: bool, type: bool } + + class PhoneNumbers < FinchAPI::BaseModel + attr_reader data: bool? + + def data=: (bool) -> bool + + attr_reader type: bool? + + def type=: (bool) -> bool + + def initialize: + (data: bool, type: bool) -> void + | ( + ?FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::phone_numbers + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::phone_numbers + end + + type residence = + { + city: bool, + country: bool, + :line1 => bool, + :line2 => bool, + postal_code: bool, + state: bool + } + + class Residence < FinchAPI::BaseModel + attr_reader city: bool? + + def city=: (bool) -> bool + + attr_reader country: bool? + + def country=: (bool) -> bool + + attr_reader line1: bool? + + def line1=: (bool) -> bool + + attr_reader line2: bool? + + def line2=: (bool) -> bool + + attr_reader postal_code: bool? + + def postal_code=: (bool) -> bool + + attr_reader state: bool? + + def state=: (bool) -> bool + + def initialize: + ( + city: bool, + country: bool, + line1: bool, + line2: bool, + postal_code: bool, + state: bool + ) -> void + | ( + ?FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::residence + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::residence + end + end + + type pay_group = + { + id: bool, + individual_ids: bool, + name: bool, + pay_frequencies: bool + } + + class PayGroup < FinchAPI::BaseModel + attr_reader id: bool? + + def id=: (bool) -> bool + + attr_reader individual_ids: bool? + + def individual_ids=: (bool) -> bool + + attr_reader name: bool? + + def name=: (bool) -> bool + + attr_reader pay_frequencies: bool? + + def pay_frequencies=: (bool) -> bool + + def initialize: + ( + id: bool, + individual_ids: bool, + name: bool, + pay_frequencies: bool + ) -> void + | ( + ?FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::pay_group + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::pay_group + end + + type pay_statement = + { + paging: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::Paging, + pay_statements: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements + } + + class PayStatement < FinchAPI::BaseModel + attr_reader paging: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::Paging? + + def paging=: ( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::Paging + ) -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::Paging + + attr_reader pay_statements: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements? + + def pay_statements=: ( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements + ) -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements + + def initialize: + ( + paging: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::Paging, + pay_statements: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements + ) -> void + | ( + ?FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::pay_statement + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::pay_statement + + type paging = { count: bool, offset: bool } + + class Paging < FinchAPI::BaseModel + attr_accessor count: bool + + attr_accessor offset: bool + + def initialize: + (count: bool, offset: bool) -> void + | ( + ?FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::paging + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::paging + end + + type pay_statements = + { + earnings: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings, + employee_deductions: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployeeDeductions, + employer_contributions: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployerContributions, + gross_pay: bool, + individual_id: bool, + net_pay: bool, + payment_method: bool, + taxes: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Taxes, + total_hours: bool, + type: bool + } + + class PayStatements < FinchAPI::BaseModel + attr_reader earnings: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings? + + def earnings=: ( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings + ) -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings + + attr_reader employee_deductions: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployeeDeductions? + + def employee_deductions=: ( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployeeDeductions + ) -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployeeDeductions + + attr_reader employer_contributions: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployerContributions? + + def employer_contributions=: ( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployerContributions + ) -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployerContributions + + attr_reader gross_pay: bool? + + def gross_pay=: (bool) -> bool + + attr_reader individual_id: bool? + + def individual_id=: (bool) -> bool + + attr_reader net_pay: bool? + + def net_pay=: (bool) -> bool + + attr_reader payment_method: bool? + + def payment_method=: (bool) -> bool + + attr_reader taxes: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Taxes? + + def taxes=: ( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Taxes + ) -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Taxes + + attr_reader total_hours: bool? + + def total_hours=: (bool) -> bool + + attr_reader type: bool? + + def type=: (bool) -> bool + + def initialize: + ( + earnings: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings, + employee_deductions: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployeeDeductions, + employer_contributions: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployerContributions, + gross_pay: bool, + individual_id: bool, + net_pay: bool, + payment_method: bool, + taxes: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Taxes, + total_hours: bool, + type: bool + ) -> void + | ( + ?FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::pay_statements + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::pay_statements + + type earnings = + { amount: bool, currency: bool, name: bool, type: bool } + + class Earnings < FinchAPI::BaseModel + attr_reader amount: bool? + + def amount=: (bool) -> bool + + attr_reader currency: bool? + + def currency=: (bool) -> bool + + attr_reader name: bool? + + def name=: (bool) -> bool + + attr_reader type: bool? + + def type=: (bool) -> bool + + def initialize: + ( + amount: bool, + currency: bool, + name: bool, + type: bool + ) -> void + | ( + ?FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::earnings + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::earnings + end + + type employee_deductions = + { + amount: bool, + currency: bool, + name: bool, + pre_tax: bool, + type: bool + } + + class EmployeeDeductions < FinchAPI::BaseModel + attr_reader amount: bool? + + def amount=: (bool) -> bool + + attr_reader currency: bool? + + def currency=: (bool) -> bool + + attr_reader name: bool? + + def name=: (bool) -> bool + + attr_reader pre_tax: bool? + + def pre_tax=: (bool) -> bool + + attr_reader type: bool? + + def type=: (bool) -> bool + + def initialize: + ( + amount: bool, + currency: bool, + name: bool, + pre_tax: bool, + type: bool + ) -> void + | ( + ?FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::employee_deductions + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::employee_deductions + end + + type employer_contributions = + { amount: bool, currency: bool, name: bool } + + class EmployerContributions < FinchAPI::BaseModel + attr_reader amount: bool? + + def amount=: (bool) -> bool + + attr_reader currency: bool? + + def currency=: (bool) -> bool + + attr_reader name: bool? + + def name=: (bool) -> bool + + def initialize: + (amount: bool, currency: bool, name: bool) -> void + | ( + ?FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::employer_contributions + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::employer_contributions + end + + type taxes = + { + amount: bool, + currency: bool, + employer: bool, + name: bool, + type: bool + } + + class Taxes < FinchAPI::BaseModel + attr_reader amount: bool? + + def amount=: (bool) -> bool + + attr_reader currency: bool? + + def currency=: (bool) -> bool + + attr_reader employer: bool? + + def employer=: (bool) -> bool + + attr_reader name: bool? + + def name=: (bool) -> bool + + attr_reader type: bool? + + def type=: (bool) -> bool + + def initialize: + ( + amount: bool, + currency: bool, + employer: bool, + name: bool, + type: bool + ) -> void + | ( + ?FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::taxes + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::taxes + end + end + end + + type payment = + { + id: bool, + company_debit: bool, + debit_date: bool, + employee_taxes: bool, + employer_taxes: bool, + gross_pay: bool, + individual_ids: bool, + net_pay: bool, + pay_date: bool, + pay_frequencies: bool, + pay_group_ids: bool, + pay_period: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment::PayPeriod + } + + class Payment < FinchAPI::BaseModel + attr_reader id: bool? + + def id=: (bool) -> bool + + attr_reader company_debit: bool? + + def company_debit=: (bool) -> bool + + attr_reader debit_date: bool? + + def debit_date=: (bool) -> bool + + attr_reader employee_taxes: bool? + + def employee_taxes=: (bool) -> bool + + attr_reader employer_taxes: bool? + + def employer_taxes=: (bool) -> bool + + attr_reader gross_pay: bool? + + def gross_pay=: (bool) -> bool + + attr_reader individual_ids: bool? + + def individual_ids=: (bool) -> bool + + attr_reader net_pay: bool? + + def net_pay=: (bool) -> bool + + attr_reader pay_date: bool? + + def pay_date=: (bool) -> bool + + attr_reader pay_frequencies: bool? + + def pay_frequencies=: (bool) -> bool + + attr_reader pay_group_ids: bool? + + def pay_group_ids=: (bool) -> bool + + attr_reader pay_period: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment::PayPeriod? + + def pay_period=: ( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment::PayPeriod + ) -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment::PayPeriod + + def initialize: + ( + id: bool, + company_debit: bool, + debit_date: bool, + employee_taxes: bool, + employer_taxes: bool, + gross_pay: bool, + individual_ids: bool, + net_pay: bool, + pay_date: bool, + pay_frequencies: bool, + pay_group_ids: bool, + pay_period: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment::PayPeriod + ) -> void + | ( + ?FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::payment + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::payment + + type pay_period = { end_date: bool, start_date: bool } + + class PayPeriod < FinchAPI::BaseModel + attr_reader end_date: bool? + + def end_date=: (bool) -> bool + + attr_reader start_date: bool? + + def start_date=: (bool) -> bool + + def initialize: + (end_date: bool, start_date: bool) -> void + | ( + ?FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment::pay_period + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment::pay_period + end + end + end + + type type_ = + :assisted | :credential | :api_token | :api_credential | :oauth + + class Type < FinchAPI::Enum + ASSISTED: :assisted + CREDENTIAL: :credential + API_TOKEN: :api_token + API_CREDENTIAL: :api_credential + OAUTH: :oauth + + def self.values: -> ::Array[FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::type_] + end + end + end + + type event_type = :"account.updated" + + class EventType < FinchAPI::Enum + ACCOUNT_UPDATED: :"account.updated" + + def self.values: -> ::Array[FinchAPI::Models::AccountUpdateEvent::event_type] + end + end + end +end diff --git a/sig/finch-api/models/base_webhook_event.rbs b/sig/finch-api/models/base_webhook_event.rbs new file mode 100644 index 00000000..a7d4c2b9 --- /dev/null +++ b/sig/finch-api/models/base_webhook_event.rbs @@ -0,0 +1,24 @@ +module FinchAPI + module Models + type base_webhook_event = + { account_id: String, company_id: String, connection_id: String } + + class BaseWebhookEvent < FinchAPI::BaseModel + attr_accessor account_id: String + + attr_accessor company_id: String + + attr_reader connection_id: String? + + def connection_id=: (String) -> String + + def initialize: + (account_id: String, company_id: String, connection_id: String) -> void + | ( + ?FinchAPI::Models::base_webhook_event | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::base_webhook_event + end + end +end diff --git a/sig/finch-api/models/company_event.rbs b/sig/finch-api/models/company_event.rbs new file mode 100644 index 00000000..508fd63f --- /dev/null +++ b/sig/finch-api/models/company_event.rbs @@ -0,0 +1,36 @@ +module FinchAPI + module Models + type company_event = + { + data: ::Hash[Symbol, top]?, + event_type: FinchAPI::Models::CompanyEvent::event_type + } + + class CompanyEvent < FinchAPI::Models::BaseWebhookEvent + attr_accessor data: ::Hash[Symbol, top]? + + attr_reader event_type: FinchAPI::Models::CompanyEvent::event_type? + + def event_type=: ( + FinchAPI::Models::CompanyEvent::event_type + ) -> FinchAPI::Models::CompanyEvent::event_type + + def initialize: + ( + data: ::Hash[Symbol, top]?, + event_type: FinchAPI::Models::CompanyEvent::event_type + ) -> void + | (?FinchAPI::Models::company_event | FinchAPI::BaseModel data) -> void + + def to_hash: -> FinchAPI::Models::company_event + + type event_type = :"company.updated" + + class EventType < FinchAPI::Enum + COMPANY_UPDATED: :"company.updated" + + def self.values: -> ::Array[FinchAPI::Models::CompanyEvent::event_type] + end + end + end +end diff --git a/sig/finch-api/models/connect/session_new_params.rbs b/sig/finch-api/models/connect/session_new_params.rbs new file mode 100644 index 00000000..dc87fe43 --- /dev/null +++ b/sig/finch-api/models/connect/session_new_params.rbs @@ -0,0 +1,129 @@ +module FinchAPI + module Models + module Connect + type session_new_params = + { + customer_id: String, + customer_name: String, + products: ::Array[FinchAPI::Models::Connect::SessionNewParams::product], + customer_email: String?, + integration: FinchAPI::Models::Connect::SessionNewParams::Integration?, + manual: bool?, + minutes_to_expire: Float?, + redirect_uri: String?, + sandbox: FinchAPI::Models::Connect::SessionNewParams::sandbox? + } + & FinchAPI::request_parameters + + class SessionNewParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + attr_accessor customer_id: String + + attr_accessor customer_name: String + + attr_accessor products: ::Array[FinchAPI::Models::Connect::SessionNewParams::product] + + attr_accessor customer_email: String? + + attr_accessor integration: FinchAPI::Models::Connect::SessionNewParams::Integration? + + attr_accessor manual: bool? + + attr_accessor minutes_to_expire: Float? + + attr_accessor redirect_uri: String? + + attr_accessor sandbox: FinchAPI::Models::Connect::SessionNewParams::sandbox? + + def initialize: + ( + customer_id: String, + customer_name: String, + products: ::Array[FinchAPI::Models::Connect::SessionNewParams::product], + customer_email: String?, + integration: FinchAPI::Models::Connect::SessionNewParams::Integration?, + manual: bool?, + minutes_to_expire: Float?, + redirect_uri: String?, + sandbox: FinchAPI::Models::Connect::SessionNewParams::sandbox?, + request_options: FinchAPI::request_opts + ) -> void + | ( + ?FinchAPI::Models::Connect::session_new_params + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Connect::session_new_params + + type product = + :company + | :directory + | :individual + | :employment + | :payment + | :pay_statement + | :benefits + | :ssn + + class Product < FinchAPI::Enum + COMPANY: :company + DIRECTORY: :directory + INDIVIDUAL: :individual + EMPLOYMENT: :employment + PAYMENT: :payment + PAY_STATEMENT: :pay_statement + BENEFITS: :benefits + SSN: :ssn + + def self.values: -> ::Array[FinchAPI::Models::Connect::SessionNewParams::product] + end + + type integration = + { + auth_method: FinchAPI::Models::Connect::SessionNewParams::Integration::auth_method?, + provider: String? + } + + class Integration < FinchAPI::BaseModel + attr_accessor auth_method: FinchAPI::Models::Connect::SessionNewParams::Integration::auth_method? + + attr_accessor provider: String? + + def initialize: + ( + auth_method: FinchAPI::Models::Connect::SessionNewParams::Integration::auth_method?, + provider: String? + ) -> void + | ( + ?FinchAPI::Models::Connect::SessionNewParams::integration + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Connect::SessionNewParams::integration + + type auth_method = :assisted | :credential | :oauth | :api_token + + class AuthMethod < FinchAPI::Enum + ASSISTED: :assisted + CREDENTIAL: :credential + OAUTH: :oauth + API_TOKEN: :api_token + + def self.values: -> ::Array[FinchAPI::Models::Connect::SessionNewParams::Integration::auth_method] + end + end + + type sandbox = :finch | :provider + + class Sandbox < FinchAPI::Enum + FINCH: :finch + PROVIDER: :provider + + def self.values: -> ::Array[FinchAPI::Models::Connect::SessionNewParams::sandbox] + end + end + end + end +end diff --git a/sig/finch-api/models/connect/session_new_response.rbs b/sig/finch-api/models/connect/session_new_response.rbs new file mode 100644 index 00000000..fe604178 --- /dev/null +++ b/sig/finch-api/models/connect/session_new_response.rbs @@ -0,0 +1,22 @@ +module FinchAPI + module Models + module Connect + type session_new_response = { connect_url: String, session_id: String } + + class SessionNewResponse < FinchAPI::BaseModel + attr_accessor connect_url: String + + attr_accessor session_id: String + + def initialize: + (connect_url: String, session_id: String) -> void + | ( + ?FinchAPI::Models::Connect::session_new_response + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Connect::session_new_response + end + end + end +end diff --git a/sig/finch-api/models/connect/session_reauthenticate_params.rbs b/sig/finch-api/models/connect/session_reauthenticate_params.rbs new file mode 100644 index 00000000..bedefb51 --- /dev/null +++ b/sig/finch-api/models/connect/session_reauthenticate_params.rbs @@ -0,0 +1,65 @@ +module FinchAPI + module Models + module Connect + type session_reauthenticate_params = + { + connection_id: String, + minutes_to_expire: Integer?, + products: ::Array[FinchAPI::Models::Connect::SessionReauthenticateParams::product]?, + redirect_uri: String? + } + & FinchAPI::request_parameters + + class SessionReauthenticateParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + attr_accessor connection_id: String + + attr_accessor minutes_to_expire: Integer? + + attr_accessor products: ::Array[FinchAPI::Models::Connect::SessionReauthenticateParams::product]? + + attr_accessor redirect_uri: String? + + def initialize: + ( + connection_id: String, + minutes_to_expire: Integer?, + products: ::Array[FinchAPI::Models::Connect::SessionReauthenticateParams::product]?, + redirect_uri: String?, + request_options: FinchAPI::request_opts + ) -> void + | ( + ?FinchAPI::Models::Connect::session_reauthenticate_params + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Connect::session_reauthenticate_params + + type product = + :company + | :directory + | :individual + | :employment + | :payment + | :pay_statement + | :benefits + | :ssn + + class Product < FinchAPI::Enum + COMPANY: :company + DIRECTORY: :directory + INDIVIDUAL: :individual + EMPLOYMENT: :employment + PAYMENT: :payment + PAY_STATEMENT: :pay_statement + BENEFITS: :benefits + SSN: :ssn + + def self.values: -> ::Array[FinchAPI::Models::Connect::SessionReauthenticateParams::product] + end + end + end + end +end diff --git a/sig/finch-api/models/connect/session_reauthenticate_response.rbs b/sig/finch-api/models/connect/session_reauthenticate_response.rbs new file mode 100644 index 00000000..dc1c9b89 --- /dev/null +++ b/sig/finch-api/models/connect/session_reauthenticate_response.rbs @@ -0,0 +1,23 @@ +module FinchAPI + module Models + module Connect + type session_reauthenticate_response = + { connect_url: String, session_id: String } + + class SessionReauthenticateResponse < FinchAPI::BaseModel + attr_accessor connect_url: String + + attr_accessor session_id: String + + def initialize: + (connect_url: String, session_id: String) -> void + | ( + ?FinchAPI::Models::Connect::session_reauthenticate_response + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Connect::session_reauthenticate_response + end + end + end +end diff --git a/sig/finch-api/models/connection_status_type.rbs b/sig/finch-api/models/connection_status_type.rbs new file mode 100644 index 00000000..61e10a78 --- /dev/null +++ b/sig/finch-api/models/connection_status_type.rbs @@ -0,0 +1,22 @@ +module FinchAPI + module Models + type connection_status_type = + :pending + | :processing + | :connected + | :error_no_account_setup + | :error_permissions + | :reauth + + class ConnectionStatusType < FinchAPI::Enum + PENDING: :pending + PROCESSING: :processing + CONNECTED: :connected + ERROR_NO_ACCOUNT_SETUP: :error_no_account_setup + ERROR_PERMISSIONS: :error_permissions + REAUTH: :reauth + + def self.values: -> ::Array[FinchAPI::Models::connection_status_type] + end + end +end diff --git a/sig/finch-api/models/create_access_token_response.rbs b/sig/finch-api/models/create_access_token_response.rbs new file mode 100644 index 00000000..d35b63b9 --- /dev/null +++ b/sig/finch-api/models/create_access_token_response.rbs @@ -0,0 +1,80 @@ +module FinchAPI + module Models + type create_access_token_response = + { + access_token: String, + account_id: String, + client_type: FinchAPI::Models::CreateAccessTokenResponse::client_type, + company_id: String, + connection_id: String, + connection_type: FinchAPI::Models::CreateAccessTokenResponse::connection_type, + products: ::Array[String], + provider_id: String, + customer_id: String?, + token_type: String + } + + class CreateAccessTokenResponse < FinchAPI::BaseModel + attr_accessor access_token: String + + attr_accessor account_id: String + + attr_accessor client_type: FinchAPI::Models::CreateAccessTokenResponse::client_type + + attr_accessor company_id: String + + attr_accessor connection_id: String + + attr_accessor connection_type: FinchAPI::Models::CreateAccessTokenResponse::connection_type + + attr_accessor products: ::Array[String] + + attr_accessor provider_id: String + + attr_accessor customer_id: String? + + attr_reader token_type: String? + + def token_type=: (String) -> String + + def initialize: + ( + access_token: String, + account_id: String, + client_type: FinchAPI::Models::CreateAccessTokenResponse::client_type, + company_id: String, + connection_id: String, + connection_type: FinchAPI::Models::CreateAccessTokenResponse::connection_type, + products: ::Array[String], + provider_id: String, + customer_id: String?, + token_type: String + ) -> void + | ( + ?FinchAPI::Models::create_access_token_response + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::create_access_token_response + + type client_type = :production | :development | :sandbox + + class ClientType < FinchAPI::Enum + PRODUCTION: :production + DEVELOPMENT: :development + SANDBOX: :sandbox + + def self.values: -> ::Array[FinchAPI::Models::CreateAccessTokenResponse::client_type] + end + + type connection_type = :provider | :finch + + class ConnectionType < FinchAPI::Enum + PROVIDER: :provider + FINCH: :finch + + def self.values: -> ::Array[FinchAPI::Models::CreateAccessTokenResponse::connection_type] + end + end + end +end diff --git a/sig/finch-api/models/directory_event.rbs b/sig/finch-api/models/directory_event.rbs new file mode 100644 index 00000000..47f64336 --- /dev/null +++ b/sig/finch-api/models/directory_event.rbs @@ -0,0 +1,61 @@ +module FinchAPI + module Models + type directory_event = + { + data: FinchAPI::Models::DirectoryEvent::Data, + event_type: FinchAPI::Models::DirectoryEvent::event_type + } + + class DirectoryEvent < FinchAPI::Models::BaseWebhookEvent + attr_reader data: FinchAPI::Models::DirectoryEvent::Data? + + def data=: ( + FinchAPI::Models::DirectoryEvent::Data + ) -> FinchAPI::Models::DirectoryEvent::Data + + attr_reader event_type: FinchAPI::Models::DirectoryEvent::event_type? + + def event_type=: ( + FinchAPI::Models::DirectoryEvent::event_type + ) -> FinchAPI::Models::DirectoryEvent::event_type + + def initialize: + ( + data: FinchAPI::Models::DirectoryEvent::Data, + event_type: FinchAPI::Models::DirectoryEvent::event_type + ) -> void + | ( + ?FinchAPI::Models::directory_event | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::directory_event + + type data = { individual_id: String } + + class Data < FinchAPI::BaseModel + attr_reader individual_id: String? + + def individual_id=: (String) -> String + + def initialize: + (individual_id: String) -> void + | ( + ?FinchAPI::Models::DirectoryEvent::data | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::DirectoryEvent::data + end + + type event_type = + :"directory.created" | :"directory.updated" | :"directory.deleted" + + class EventType < FinchAPI::Enum + DIRECTORY_CREATED: :"directory.created" + DIRECTORY_UPDATED: :"directory.updated" + DIRECTORY_DELETED: :"directory.deleted" + + def self.values: -> ::Array[FinchAPI::Models::DirectoryEvent::event_type] + end + end + end +end diff --git a/sig/finch-api/models/disconnect_response.rbs b/sig/finch-api/models/disconnect_response.rbs new file mode 100644 index 00000000..c91409c7 --- /dev/null +++ b/sig/finch-api/models/disconnect_response.rbs @@ -0,0 +1,17 @@ +module FinchAPI + module Models + type disconnect_response = { status: String } + + class DisconnectResponse < FinchAPI::BaseModel + attr_accessor status: String + + def initialize: + (status: String) -> void + | ( + ?FinchAPI::Models::disconnect_response | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::disconnect_response + end + end +end diff --git a/sig/finch-api/models/employment_event.rbs b/sig/finch-api/models/employment_event.rbs new file mode 100644 index 00000000..5417368d --- /dev/null +++ b/sig/finch-api/models/employment_event.rbs @@ -0,0 +1,61 @@ +module FinchAPI + module Models + type employment_event = + { + data: FinchAPI::Models::EmploymentEvent::Data, + event_type: FinchAPI::Models::EmploymentEvent::event_type + } + + class EmploymentEvent < FinchAPI::Models::BaseWebhookEvent + attr_reader data: FinchAPI::Models::EmploymentEvent::Data? + + def data=: ( + FinchAPI::Models::EmploymentEvent::Data + ) -> FinchAPI::Models::EmploymentEvent::Data + + attr_reader event_type: FinchAPI::Models::EmploymentEvent::event_type? + + def event_type=: ( + FinchAPI::Models::EmploymentEvent::event_type + ) -> FinchAPI::Models::EmploymentEvent::event_type + + def initialize: + ( + data: FinchAPI::Models::EmploymentEvent::Data, + event_type: FinchAPI::Models::EmploymentEvent::event_type + ) -> void + | ( + ?FinchAPI::Models::employment_event | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::employment_event + + type data = { individual_id: String } + + class Data < FinchAPI::BaseModel + attr_reader individual_id: String? + + def individual_id=: (String) -> String + + def initialize: + (individual_id: String) -> void + | ( + ?FinchAPI::Models::EmploymentEvent::data | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::EmploymentEvent::data + end + + type event_type = + :"employment.created" | :"employment.updated" | :"employment.deleted" + + class EventType < FinchAPI::Enum + EMPLOYMENT_CREATED: :"employment.created" + EMPLOYMENT_UPDATED: :"employment.updated" + EMPLOYMENT_DELETED: :"employment.deleted" + + def self.values: -> ::Array[FinchAPI::Models::EmploymentEvent::event_type] + end + end + end +end diff --git a/sig/finch-api/models/hris/benefit_contribution.rbs b/sig/finch-api/models/hris/benefit_contribution.rbs new file mode 100644 index 00000000..e1a06a2e --- /dev/null +++ b/sig/finch-api/models/hris/benefit_contribution.rbs @@ -0,0 +1,38 @@ +module FinchAPI + module Models + module HRIS + type benefit_contribution = + { + amount: Integer?, + type: FinchAPI::Models::HRIS::BenefitContribution::type_? + } + + class BenefitContribution < FinchAPI::BaseModel + attr_accessor amount: Integer? + + attr_accessor type: FinchAPI::Models::HRIS::BenefitContribution::type_? + + def initialize: + ( + amount: Integer?, + type: FinchAPI::Models::HRIS::BenefitContribution::type_? + ) -> void + | ( + ?FinchAPI::Models::HRIS::benefit_contribution + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::benefit_contribution + + type type_ = :fixed | :percent + + class Type < FinchAPI::Enum + FIXED: :fixed + PERCENT: :percent + + def self.values: -> ::Array[FinchAPI::Models::HRIS::BenefitContribution::type_] + end + end + end + end +end diff --git a/sig/finch-api/models/hris/benefit_create_params.rbs b/sig/finch-api/models/hris/benefit_create_params.rbs new file mode 100644 index 00000000..eb2e7630 --- /dev/null +++ b/sig/finch-api/models/hris/benefit_create_params.rbs @@ -0,0 +1,40 @@ +module FinchAPI + module Models + module HRIS + type benefit_create_params = + { + description: String, + frequency: FinchAPI::Models::HRIS::benefit_frequency?, + type: FinchAPI::Models::HRIS::benefit_type? + } + & FinchAPI::request_parameters + + class BenefitCreateParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + attr_reader description: String? + + def description=: (String) -> String + + attr_accessor frequency: FinchAPI::Models::HRIS::benefit_frequency? + + attr_accessor type: FinchAPI::Models::HRIS::benefit_type? + + def initialize: + ( + description: String, + frequency: FinchAPI::Models::HRIS::benefit_frequency?, + type: FinchAPI::Models::HRIS::benefit_type?, + request_options: FinchAPI::request_opts + ) -> void + | ( + ?FinchAPI::Models::HRIS::benefit_create_params + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::benefit_create_params + end + end + end +end diff --git a/sig/finch-api/models/hris/benefit_features_and_operations.rbs b/sig/finch-api/models/hris/benefit_features_and_operations.rbs new file mode 100644 index 00000000..0e4cbf01 --- /dev/null +++ b/sig/finch-api/models/hris/benefit_features_and_operations.rbs @@ -0,0 +1,112 @@ +module FinchAPI + module Models + module HRIS + type benefit_features_and_operations = + { + supported_features: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures, + supported_operations: FinchAPI::Models::HRIS::SupportPerBenefitType + } + + class BenefitFeaturesAndOperations < FinchAPI::BaseModel + attr_reader supported_features: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures? + + def supported_features=: ( + FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures + ) -> FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures + + attr_reader supported_operations: FinchAPI::Models::HRIS::SupportPerBenefitType? + + def supported_operations=: ( + FinchAPI::Models::HRIS::SupportPerBenefitType + ) -> FinchAPI::Models::HRIS::SupportPerBenefitType + + def initialize: + ( + supported_features: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures, + supported_operations: FinchAPI::Models::HRIS::SupportPerBenefitType + ) -> void + | ( + ?FinchAPI::Models::HRIS::benefit_features_and_operations + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::benefit_features_and_operations + + type supported_features = + { + annual_maximum: bool?, + catch_up: bool?, + company_contribution: ::Array[FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::company_contribution?]?, + description: String?, + employee_deduction: ::Array[FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::employee_deduction?]?, + frequencies: ::Array[FinchAPI::Models::HRIS::benefit_frequency?], + hsa_contribution_limit: ::Array[FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::hsa_contribution_limit?]? + } + + class SupportedFeatures < FinchAPI::BaseModel + attr_accessor annual_maximum: bool? + + attr_accessor catch_up: bool? + + attr_accessor company_contribution: ::Array[FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::company_contribution?]? + + attr_accessor description: String? + + attr_accessor employee_deduction: ::Array[FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::employee_deduction?]? + + attr_reader frequencies: ::Array[FinchAPI::Models::HRIS::benefit_frequency?]? + + def frequencies=: ( + ::Array[FinchAPI::Models::HRIS::benefit_frequency?] + ) -> ::Array[FinchAPI::Models::HRIS::benefit_frequency?] + + attr_accessor hsa_contribution_limit: ::Array[FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::hsa_contribution_limit?]? + + def initialize: + ( + annual_maximum: bool?, + catch_up: bool?, + company_contribution: ::Array[FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::company_contribution?]?, + description: String?, + employee_deduction: ::Array[FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::employee_deduction?]?, + frequencies: ::Array[FinchAPI::Models::HRIS::benefit_frequency?], + hsa_contribution_limit: ::Array[FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::hsa_contribution_limit?]? + ) -> void + | ( + ?FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::supported_features + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::supported_features + + type company_contribution = :fixed | :percent + + class CompanyContribution < FinchAPI::Enum + FIXED: :fixed + PERCENT: :percent + + def self.values: -> ::Array[FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::company_contribution] + end + + type employee_deduction = :fixed | :percent + + class EmployeeDeduction < FinchAPI::Enum + FIXED: :fixed + PERCENT: :percent + + def self.values: -> ::Array[FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::employee_deduction] + end + + type hsa_contribution_limit = :individual | :family + + class HsaContributionLimit < FinchAPI::Enum + INDIVIDUAL: :individual + FAMILY: :family + + def self.values: -> ::Array[FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::hsa_contribution_limit] + end + end + end + end + end +end diff --git a/sig/finch-api/models/hris/benefit_frequency.rbs b/sig/finch-api/models/hris/benefit_frequency.rbs new file mode 100644 index 00000000..9e9b73df --- /dev/null +++ b/sig/finch-api/models/hris/benefit_frequency.rbs @@ -0,0 +1,15 @@ +module FinchAPI + module Models + module HRIS + type benefit_frequency = :one_time | :every_paycheck | :monthly + + class BenefitFrequency < FinchAPI::Enum + ONE_TIME: :one_time + EVERY_PAYCHECK: :every_paycheck + MONTHLY: :monthly + + def self.values: -> ::Array[FinchAPI::Models::HRIS::benefit_frequency] + end + end + end +end diff --git a/sig/finch-api/models/hris/benefit_list_params.rbs b/sig/finch-api/models/hris/benefit_list_params.rbs new file mode 100644 index 00000000..1f1704f1 --- /dev/null +++ b/sig/finch-api/models/hris/benefit_list_params.rbs @@ -0,0 +1,21 @@ +module FinchAPI + module Models + module HRIS + type benefit_list_params = { } & FinchAPI::request_parameters + + class BenefitListParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + def initialize: + (request_options: FinchAPI::request_opts) -> void + | ( + ?FinchAPI::Models::HRIS::benefit_list_params + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::benefit_list_params + end + end + end +end diff --git a/sig/finch-api/models/hris/benefit_list_supported_benefits_params.rbs b/sig/finch-api/models/hris/benefit_list_supported_benefits_params.rbs new file mode 100644 index 00000000..7db1f506 --- /dev/null +++ b/sig/finch-api/models/hris/benefit_list_supported_benefits_params.rbs @@ -0,0 +1,22 @@ +module FinchAPI + module Models + module HRIS + type benefit_list_supported_benefits_params = + { } & FinchAPI::request_parameters + + class BenefitListSupportedBenefitsParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + def initialize: + (request_options: FinchAPI::request_opts) -> void + | ( + ?FinchAPI::Models::HRIS::benefit_list_supported_benefits_params + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::benefit_list_supported_benefits_params + end + end + end +end diff --git a/sig/finch-api/models/hris/benefit_retrieve_params.rbs b/sig/finch-api/models/hris/benefit_retrieve_params.rbs new file mode 100644 index 00000000..889acf32 --- /dev/null +++ b/sig/finch-api/models/hris/benefit_retrieve_params.rbs @@ -0,0 +1,21 @@ +module FinchAPI + module Models + module HRIS + type benefit_retrieve_params = { } & FinchAPI::request_parameters + + class BenefitRetrieveParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + def initialize: + (request_options: FinchAPI::request_opts) -> void + | ( + ?FinchAPI::Models::HRIS::benefit_retrieve_params + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::benefit_retrieve_params + end + end + end +end diff --git a/sig/finch-api/models/hris/benefit_type.rbs b/sig/finch-api/models/hris/benefit_type.rbs new file mode 100644 index 00000000..4040241c --- /dev/null +++ b/sig/finch-api/models/hris/benefit_type.rbs @@ -0,0 +1,50 @@ +module FinchAPI + module Models + module HRIS + type benefit_type = + :"401k" + | :"401k_roth" + | :"401k_loan" + | :"403b" + | :"403b_roth" + | :"457" + | :"457_roth" + | :s125_medical + | :s125_dental + | :s125_vision + | :hsa_pre + | :hsa_post + | :fsa_medical + | :fsa_dependent_care + | :simple_ira + | :simple + | :commuter + | :custom_post_tax + | :custom_pre_tax + + class BenefitType < FinchAPI::Enum + NUMBER_401K: :"401k" + NUMBER_401K_ROTH: :"401k_roth" + NUMBER_401K_LOAN: :"401k_loan" + NUMBER_403B: :"403b" + NUMBER_403B_ROTH: :"403b_roth" + NUMBER_457: :"457" + NUMBER_457_ROTH: :"457_roth" + S125_MEDICAL: :s125_medical + S125_DENTAL: :s125_dental + S125_VISION: :s125_vision + HSA_PRE: :hsa_pre + HSA_POST: :hsa_post + FSA_MEDICAL: :fsa_medical + FSA_DEPENDENT_CARE: :fsa_dependent_care + SIMPLE_IRA: :simple_ira + SIMPLE: :simple + COMMUTER: :commuter + CUSTOM_POST_TAX: :custom_post_tax + CUSTOM_PRE_TAX: :custom_pre_tax + + def self.values: -> ::Array[FinchAPI::Models::HRIS::benefit_type] + end + end + end +end diff --git a/sig/finch-api/models/hris/benefit_update_params.rbs b/sig/finch-api/models/hris/benefit_update_params.rbs new file mode 100644 index 00000000..5cbc2d80 --- /dev/null +++ b/sig/finch-api/models/hris/benefit_update_params.rbs @@ -0,0 +1,26 @@ +module FinchAPI + module Models + module HRIS + type benefit_update_params = + { description: String } & FinchAPI::request_parameters + + class BenefitUpdateParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + attr_reader description: String? + + def description=: (String) -> String + + def initialize: + (description: String, request_options: FinchAPI::request_opts) -> void + | ( + ?FinchAPI::Models::HRIS::benefit_update_params + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::benefit_update_params + end + end + end +end diff --git a/sig/finch-api/models/hris/benefits/enrolled_individual.rbs b/sig/finch-api/models/hris/benefits/enrolled_individual.rbs new file mode 100644 index 00000000..7c2dcc61 --- /dev/null +++ b/sig/finch-api/models/hris/benefits/enrolled_individual.rbs @@ -0,0 +1,75 @@ +module FinchAPI + module Models + module HRIS + module Benefits + type enrolled_individual = + { + body: FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Body, + code: FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::code, + individual_id: String + } + + class EnrolledIndividual < FinchAPI::BaseModel + attr_reader body: FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Body? + + def body=: ( + FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Body + ) -> FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Body + + attr_reader code: FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::code? + + def code=: ( + FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::code + ) -> FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::code + + attr_reader individual_id: String? + + def individual_id=: (String) -> String + + def initialize: + ( + body: FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Body, + code: FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::code, + individual_id: String + ) -> void + | ( + ?FinchAPI::Models::HRIS::Benefits::enrolled_individual + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::Benefits::enrolled_individual + + type body = { finch_code: String?, message: String?, name: String? } + + class Body < FinchAPI::BaseModel + attr_accessor finch_code: String? + + attr_accessor message: String? + + attr_accessor name: String? + + def initialize: + (finch_code: String?, message: String?, name: String?) -> void + | ( + ?FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::body + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::body + end + + type code = 200 | 201 | 404 | 403 + + class Code < FinchAPI::Enum + OK: 200 + CREATED: 201 + NOT_FOUND: 404 + FORBIDDEN: 403 + + def self.values: -> ::Array[FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::code] + end + end + end + end + end +end diff --git a/sig/finch-api/models/hris/benefits/individual_benefit.rbs b/sig/finch-api/models/hris/benefits/individual_benefit.rbs new file mode 100644 index 00000000..f2a37288 --- /dev/null +++ b/sig/finch-api/models/hris/benefits/individual_benefit.rbs @@ -0,0 +1,91 @@ +module FinchAPI + module Models + module HRIS + + class IndividualBenefit = Benefits::IndividualBenefit + + module Benefits + type individual_benefit = + { + body: FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body, + code: Integer, + individual_id: String + } + + class IndividualBenefit < FinchAPI::BaseModel + attr_reader body: FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body? + + def body=: ( + FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body + ) -> FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body + + attr_reader code: Integer? + + def code=: (Integer) -> Integer + + attr_reader individual_id: String? + + def individual_id=: (String) -> String + + def initialize: + ( + body: FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body, + code: Integer, + individual_id: String + ) -> void + | ( + ?FinchAPI::Models::HRIS::Benefits::individual_benefit + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::Benefits::individual_benefit + + type body = + { + annual_maximum: Integer?, + catch_up: bool?, + company_contribution: FinchAPI::Models::HRIS::BenefitContribution?, + employee_deduction: FinchAPI::Models::HRIS::BenefitContribution?, + hsa_contribution_limit: FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::hsa_contribution_limit? + } + + class Body < FinchAPI::BaseModel + attr_accessor annual_maximum: Integer? + + attr_accessor catch_up: bool? + + attr_accessor company_contribution: FinchAPI::Models::HRIS::BenefitContribution? + + attr_accessor employee_deduction: FinchAPI::Models::HRIS::BenefitContribution? + + attr_accessor hsa_contribution_limit: FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::hsa_contribution_limit? + + def initialize: + ( + annual_maximum: Integer?, + catch_up: bool?, + company_contribution: FinchAPI::Models::HRIS::BenefitContribution?, + employee_deduction: FinchAPI::Models::HRIS::BenefitContribution?, + hsa_contribution_limit: FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::hsa_contribution_limit? + ) -> void + | ( + ?FinchAPI::Models::HRIS::Benefits::IndividualBenefit::body + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::Benefits::IndividualBenefit::body + + type hsa_contribution_limit = :individual | :family + + class HsaContributionLimit < FinchAPI::Enum + INDIVIDUAL: :individual + FAMILY: :family + + def self.values: -> ::Array[FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::hsa_contribution_limit] + end + end + end + end + end + end +end diff --git a/sig/finch-api/models/hris/benefits/individual_enroll_many_params.rbs b/sig/finch-api/models/hris/benefits/individual_enroll_many_params.rbs new file mode 100644 index 00000000..a2e16d68 --- /dev/null +++ b/sig/finch-api/models/hris/benefits/individual_enroll_many_params.rbs @@ -0,0 +1,203 @@ +module FinchAPI + module Models + module HRIS + module Benefits + type individual_enroll_many_params = + { + individuals: ::Array[FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual] + } + & FinchAPI::request_parameters + + class IndividualEnrollManyParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + attr_reader individuals: ::Array[FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual]? + + def individuals=: ( + ::Array[FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual] + ) -> ::Array[FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual] + + def initialize: + ( + individuals: ::Array[FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual], + request_options: FinchAPI::request_opts + ) -> void + | ( + ?FinchAPI::Models::HRIS::Benefits::individual_enroll_many_params + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::Benefits::individual_enroll_many_params + + type individual = + { + configuration: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration, + individual_id: String + } + + class Individual < FinchAPI::BaseModel + attr_reader configuration: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration? + + def configuration=: ( + FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration + ) -> FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration + + attr_reader individual_id: String? + + def individual_id=: (String) -> String + + def initialize: + ( + configuration: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration, + individual_id: String + ) -> void + | ( + ?FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::individual + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::individual + + type configuration = + { + annual_contribution_limit: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::annual_contribution_limit, + annual_maximum: Integer?, + catch_up: bool, + company_contribution: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution, + employee_deduction: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction + } + + class Configuration < FinchAPI::BaseModel + attr_reader annual_contribution_limit: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::annual_contribution_limit? + + def annual_contribution_limit=: ( + FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::annual_contribution_limit + ) -> FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::annual_contribution_limit + + attr_accessor annual_maximum: Integer? + + attr_reader catch_up: bool? + + def catch_up=: (bool) -> bool + + attr_reader company_contribution: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution? + + def company_contribution=: ( + FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution + ) -> FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution + + attr_reader employee_deduction: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction? + + def employee_deduction=: ( + FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction + ) -> FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction + + def initialize: + ( + annual_contribution_limit: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::annual_contribution_limit, + annual_maximum: Integer?, + catch_up: bool, + company_contribution: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution, + employee_deduction: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction + ) -> void + | ( + ?FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::configuration + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::configuration + + type annual_contribution_limit = :individual | :family + + class AnnualContributionLimit < FinchAPI::Enum + INDIVIDUAL: :individual + FAMILY: :family + + def self.values: -> ::Array[FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::annual_contribution_limit] + end + + type company_contribution = + { + amount: Integer, + type: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution::type_ + } + + class CompanyContribution < FinchAPI::BaseModel + attr_reader amount: Integer? + + def amount=: (Integer) -> Integer + + attr_reader type: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution::type_? + + def type=: ( + FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution::type_ + ) -> FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution::type_ + + def initialize: + ( + amount: Integer, + type: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution::type_ + ) -> void + | ( + ?FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::company_contribution + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::company_contribution + + type type_ = :fixed | :percent + + class Type < FinchAPI::Enum + FIXED: :fixed + PERCENT: :percent + + def self.values: -> ::Array[FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution::type_] + end + end + + type employee_deduction = + { + amount: Integer, + type: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction::type_ + } + + class EmployeeDeduction < FinchAPI::BaseModel + attr_reader amount: Integer? + + def amount=: (Integer) -> Integer + + attr_reader type: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction::type_? + + def type=: ( + FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction::type_ + ) -> FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction::type_ + + def initialize: + ( + amount: Integer, + type: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction::type_ + ) -> void + | ( + ?FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::employee_deduction + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::employee_deduction + + type type_ = :fixed | :percent + + class Type < FinchAPI::Enum + FIXED: :fixed + PERCENT: :percent + + def self.values: -> ::Array[FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction::type_] + end + end + end + end + end + end + end + end +end diff --git a/sig/finch-api/models/hris/benefits/individual_enrolled_ids_params.rbs b/sig/finch-api/models/hris/benefits/individual_enrolled_ids_params.rbs new file mode 100644 index 00000000..d75239d2 --- /dev/null +++ b/sig/finch-api/models/hris/benefits/individual_enrolled_ids_params.rbs @@ -0,0 +1,24 @@ +module FinchAPI + module Models + module HRIS + module Benefits + type individual_enrolled_ids_params = + { } & FinchAPI::request_parameters + + class IndividualEnrolledIDsParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + def initialize: + (request_options: FinchAPI::request_opts) -> void + | ( + ?FinchAPI::Models::HRIS::Benefits::individual_enrolled_ids_params + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::Benefits::individual_enrolled_ids_params + end + end + end + end +end diff --git a/sig/finch-api/models/hris/benefits/individual_enrolled_ids_response.rbs b/sig/finch-api/models/hris/benefits/individual_enrolled_ids_response.rbs new file mode 100644 index 00000000..d0a223a4 --- /dev/null +++ b/sig/finch-api/models/hris/benefits/individual_enrolled_ids_response.rbs @@ -0,0 +1,25 @@ +module FinchAPI + module Models + module HRIS + module Benefits + type individual_enrolled_ids_response = + { benefit_id: String, individual_ids: ::Array[String] } + + class IndividualEnrolledIDsResponse < FinchAPI::BaseModel + attr_accessor benefit_id: String + + attr_accessor individual_ids: ::Array[String] + + def initialize: + (benefit_id: String, individual_ids: ::Array[String]) -> void + | ( + ?FinchAPI::Models::HRIS::Benefits::individual_enrolled_ids_response + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::Benefits::individual_enrolled_ids_response + end + end + end + end +end diff --git a/sig/finch-api/models/hris/benefits/individual_retrieve_many_benefits_params.rbs b/sig/finch-api/models/hris/benefits/individual_retrieve_many_benefits_params.rbs new file mode 100644 index 00000000..72be7af0 --- /dev/null +++ b/sig/finch-api/models/hris/benefits/individual_retrieve_many_benefits_params.rbs @@ -0,0 +1,31 @@ +module FinchAPI + module Models + module HRIS + module Benefits + type individual_retrieve_many_benefits_params = + { individual_ids: String } & FinchAPI::request_parameters + + class IndividualRetrieveManyBenefitsParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + attr_reader individual_ids: String? + + def individual_ids=: (String) -> String + + def initialize: + ( + individual_ids: String, + request_options: FinchAPI::request_opts + ) -> void + | ( + ?FinchAPI::Models::HRIS::Benefits::individual_retrieve_many_benefits_params + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::Benefits::individual_retrieve_many_benefits_params + end + end + end + end +end diff --git a/sig/finch-api/models/hris/benefits/individual_unenroll_many_params.rbs b/sig/finch-api/models/hris/benefits/individual_unenroll_many_params.rbs new file mode 100644 index 00000000..b4988cc8 --- /dev/null +++ b/sig/finch-api/models/hris/benefits/individual_unenroll_many_params.rbs @@ -0,0 +1,31 @@ +module FinchAPI + module Models + module HRIS + module Benefits + type individual_unenroll_many_params = + { individual_ids: ::Array[String] } & FinchAPI::request_parameters + + class IndividualUnenrollManyParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + attr_reader individual_ids: ::Array[String]? + + def individual_ids=: (::Array[String]) -> ::Array[String] + + def initialize: + ( + individual_ids: ::Array[String], + request_options: FinchAPI::request_opts + ) -> void + | ( + ?FinchAPI::Models::HRIS::Benefits::individual_unenroll_many_params + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::Benefits::individual_unenroll_many_params + end + end + end + end +end diff --git a/sig/finch-api/models/hris/benefits/unenrolled_individual.rbs b/sig/finch-api/models/hris/benefits/unenrolled_individual.rbs new file mode 100644 index 00000000..d1edb58b --- /dev/null +++ b/sig/finch-api/models/hris/benefits/unenrolled_individual.rbs @@ -0,0 +1,62 @@ +module FinchAPI + module Models + module HRIS + module Benefits + type unenrolled_individual = + { + body: FinchAPI::Models::HRIS::Benefits::UnenrolledIndividual::Body, + code: Integer, + individual_id: String + } + + class UnenrolledIndividual < FinchAPI::BaseModel + attr_reader body: FinchAPI::Models::HRIS::Benefits::UnenrolledIndividual::Body? + + def body=: ( + FinchAPI::Models::HRIS::Benefits::UnenrolledIndividual::Body + ) -> FinchAPI::Models::HRIS::Benefits::UnenrolledIndividual::Body + + attr_reader code: Integer? + + def code=: (Integer) -> Integer + + attr_reader individual_id: String? + + def individual_id=: (String) -> String + + def initialize: + ( + body: FinchAPI::Models::HRIS::Benefits::UnenrolledIndividual::Body, + code: Integer, + individual_id: String + ) -> void + | ( + ?FinchAPI::Models::HRIS::Benefits::unenrolled_individual + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::Benefits::unenrolled_individual + + type body = { finch_code: String?, message: String?, name: String? } + + class Body < FinchAPI::BaseModel + attr_accessor finch_code: String? + + attr_accessor message: String? + + attr_accessor name: String? + + def initialize: + (finch_code: String?, message: String?, name: String?) -> void + | ( + ?FinchAPI::Models::HRIS::Benefits::UnenrolledIndividual::body + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::Benefits::UnenrolledIndividual::body + end + end + end + end + end +end diff --git a/sig/finch-api/models/hris/benefits_support.rbs b/sig/finch-api/models/hris/benefits_support.rbs new file mode 100644 index 00000000..8ee7e3e1 --- /dev/null +++ b/sig/finch-api/models/hris/benefits_support.rbs @@ -0,0 +1,68 @@ +module FinchAPI + module Models + module HRIS + type benefits_support = + { + commuter: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations?, + custom_post_tax: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations?, + custom_pre_tax: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations?, + fsa_dependent_care: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations?, + fsa_medical: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations?, + hsa_post: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations?, + hsa_pre: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations?, + :s125_dental => FinchAPI::Models::HRIS::BenefitFeaturesAndOperations?, + :s125_medical => FinchAPI::Models::HRIS::BenefitFeaturesAndOperations?, + :s125_vision => FinchAPI::Models::HRIS::BenefitFeaturesAndOperations?, + simple: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations?, + simple_ira: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations? + } + + class BenefitsSupport < FinchAPI::BaseModel + attr_accessor commuter: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations? + + attr_accessor custom_post_tax: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations? + + attr_accessor custom_pre_tax: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations? + + attr_accessor fsa_dependent_care: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations? + + attr_accessor fsa_medical: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations? + + attr_accessor hsa_post: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations? + + attr_accessor hsa_pre: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations? + + attr_accessor s125_dental: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations? + + attr_accessor s125_medical: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations? + + attr_accessor s125_vision: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations? + + attr_accessor simple: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations? + + attr_accessor simple_ira: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations? + + def initialize: + ( + commuter: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations?, + custom_post_tax: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations?, + custom_pre_tax: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations?, + fsa_dependent_care: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations?, + fsa_medical: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations?, + hsa_post: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations?, + hsa_pre: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations?, + s125_dental: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations?, + s125_medical: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations?, + s125_vision: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations?, + simple: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations?, + simple_ira: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations? + ) -> void + | ( + ?FinchAPI::Models::HRIS::benefits_support | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::benefits_support + end + end + end +end diff --git a/sig/finch-api/models/hris/benfit_contribution.rbs b/sig/finch-api/models/hris/benfit_contribution.rbs new file mode 100644 index 00000000..7a2dac1c --- /dev/null +++ b/sig/finch-api/models/hris/benfit_contribution.rbs @@ -0,0 +1,8 @@ +module FinchAPI + module Models + module HRIS + + class BenfitContribution = FinchAPI::Models::HRIS::BenefitContribution + end + end +end diff --git a/sig/finch-api/models/hris/company.rbs b/sig/finch-api/models/hris/company.rbs new file mode 100644 index 00000000..e2a470b9 --- /dev/null +++ b/sig/finch-api/models/hris/company.rbs @@ -0,0 +1,195 @@ +module FinchAPI + module Models + module HRIS + type hris_company = + { + id: String, + accounts: ::Array[FinchAPI::Models::HRIS::HRISCompany::Account]?, + departments: ::Array[FinchAPI::Models::HRIS::HRISCompany::Department?]?, + ein: String?, + entity: FinchAPI::Models::HRIS::HRISCompany::Entity?, + legal_name: String?, + locations: ::Array[FinchAPI::Models::Location?]?, + primary_email: String?, + primary_phone_number: String? + } + + class HRISCompany < FinchAPI::BaseModel + attr_accessor id: String + + attr_accessor accounts: ::Array[FinchAPI::Models::HRIS::HRISCompany::Account]? + + attr_accessor departments: ::Array[FinchAPI::Models::HRIS::HRISCompany::Department?]? + + attr_accessor ein: String? + + attr_accessor entity: FinchAPI::Models::HRIS::HRISCompany::Entity? + + attr_accessor legal_name: String? + + attr_accessor locations: ::Array[FinchAPI::Models::Location?]? + + attr_accessor primary_email: String? + + attr_accessor primary_phone_number: String? + + def initialize: + ( + id: String, + accounts: ::Array[FinchAPI::Models::HRIS::HRISCompany::Account]?, + departments: ::Array[FinchAPI::Models::HRIS::HRISCompany::Department?]?, + ein: String?, + entity: FinchAPI::Models::HRIS::HRISCompany::Entity?, + legal_name: String?, + locations: ::Array[FinchAPI::Models::Location?]?, + primary_email: String?, + primary_phone_number: String? + ) -> void + | ( + ?FinchAPI::Models::HRIS::hris_company | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::hris_company + + type account = + { + account_name: String?, + account_number: String?, + account_type: FinchAPI::Models::HRIS::HRISCompany::Account::account_type?, + institution_name: String?, + routing_number: String? + } + + class Account < FinchAPI::BaseModel + attr_accessor account_name: String? + + attr_accessor account_number: String? + + attr_accessor account_type: FinchAPI::Models::HRIS::HRISCompany::Account::account_type? + + attr_accessor institution_name: String? + + attr_accessor routing_number: String? + + def initialize: + ( + account_name: String?, + account_number: String?, + account_type: FinchAPI::Models::HRIS::HRISCompany::Account::account_type?, + institution_name: String?, + routing_number: String? + ) -> void + | ( + ?FinchAPI::Models::HRIS::HRISCompany::account + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::HRISCompany::account + + type account_type = :checking | :savings + + class AccountType < FinchAPI::Enum + CHECKING: :checking + SAVINGS: :savings + + def self.values: -> ::Array[FinchAPI::Models::HRIS::HRISCompany::Account::account_type] + end + end + + type department = + { + name: String?, + parent: FinchAPI::Models::HRIS::HRISCompany::Department::Parent? + } + + class Department < FinchAPI::BaseModel + attr_accessor name: String? + + attr_accessor parent: FinchAPI::Models::HRIS::HRISCompany::Department::Parent? + + def initialize: + ( + name: String?, + parent: FinchAPI::Models::HRIS::HRISCompany::Department::Parent? + ) -> void + | ( + ?FinchAPI::Models::HRIS::HRISCompany::department + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::HRISCompany::department + + type parent = { name: String? } + + class Parent < FinchAPI::BaseModel + attr_accessor name: String? + + def initialize: + (name: String?) -> void + | ( + ?FinchAPI::Models::HRIS::HRISCompany::Department::parent + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::HRISCompany::Department::parent + end + end + + type entity = + { + subtype: FinchAPI::Models::HRIS::HRISCompany::Entity::subtype?, + type: FinchAPI::Models::HRIS::HRISCompany::Entity::type_? + } + + class Entity < FinchAPI::BaseModel + attr_accessor subtype: FinchAPI::Models::HRIS::HRISCompany::Entity::subtype? + + attr_accessor type: FinchAPI::Models::HRIS::HRISCompany::Entity::type_? + + def initialize: + ( + subtype: FinchAPI::Models::HRIS::HRISCompany::Entity::subtype?, + type: FinchAPI::Models::HRIS::HRISCompany::Entity::type_? + ) -> void + | ( + ?FinchAPI::Models::HRIS::HRISCompany::entity + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::HRISCompany::entity + + type subtype = :s_corporation | :c_corporation | :b_corporation + + class Subtype < FinchAPI::Enum + S_CORPORATION: :s_corporation + C_CORPORATION: :c_corporation + B_CORPORATION: :b_corporation + + def self.values: -> ::Array[FinchAPI::Models::HRIS::HRISCompany::Entity::subtype] + end + + type type_ = + :llc + | :lp + | :corporation + | :sole_proprietor + | :non_profit + | :partnership + | :cooperative + + class Type < FinchAPI::Enum + LLC: :llc + LP: :lp + CORPORATION: :corporation + SOLE_PROPRIETOR: :sole_proprietor + NON_PROFIT: :non_profit + PARTNERSHIP: :partnership + COOPERATIVE: :cooperative + + def self.values: -> ::Array[FinchAPI::Models::HRIS::HRISCompany::Entity::type_] + end + end + end + end + end +end diff --git a/sig/finch-api/models/hris/company_benefit.rbs b/sig/finch-api/models/hris/company_benefit.rbs new file mode 100644 index 00000000..f752768e --- /dev/null +++ b/sig/finch-api/models/hris/company_benefit.rbs @@ -0,0 +1,36 @@ +module FinchAPI + module Models + module HRIS + type company_benefit = + { + benefit_id: String, + description: String?, + frequency: FinchAPI::Models::HRIS::benefit_frequency?, + type: FinchAPI::Models::HRIS::benefit_type? + } + + class CompanyBenefit < FinchAPI::BaseModel + attr_accessor benefit_id: String + + attr_accessor description: String? + + attr_accessor frequency: FinchAPI::Models::HRIS::benefit_frequency? + + attr_accessor type: FinchAPI::Models::HRIS::benefit_type? + + def initialize: + ( + benefit_id: String, + description: String?, + frequency: FinchAPI::Models::HRIS::benefit_frequency?, + type: FinchAPI::Models::HRIS::benefit_type? + ) -> void + | ( + ?FinchAPI::Models::HRIS::company_benefit | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::company_benefit + end + end + end +end diff --git a/sig/finch-api/models/hris/company_retrieve_params.rbs b/sig/finch-api/models/hris/company_retrieve_params.rbs new file mode 100644 index 00000000..22edfeaa --- /dev/null +++ b/sig/finch-api/models/hris/company_retrieve_params.rbs @@ -0,0 +1,21 @@ +module FinchAPI + module Models + module HRIS + type company_retrieve_params = { } & FinchAPI::request_parameters + + class CompanyRetrieveParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + def initialize: + (request_options: FinchAPI::request_opts) -> void + | ( + ?FinchAPI::Models::HRIS::company_retrieve_params + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::company_retrieve_params + end + end + end +end diff --git a/sig/finch-api/models/hris/create_company_benefits_response.rbs b/sig/finch-api/models/hris/create_company_benefits_response.rbs new file mode 100644 index 00000000..bf25635a --- /dev/null +++ b/sig/finch-api/models/hris/create_company_benefits_response.rbs @@ -0,0 +1,20 @@ +module FinchAPI + module Models + module HRIS + type create_company_benefits_response = { benefit_id: String } + + class CreateCompanyBenefitsResponse < FinchAPI::BaseModel + attr_accessor benefit_id: String + + def initialize: + (benefit_id: String) -> void + | ( + ?FinchAPI::Models::HRIS::create_company_benefits_response + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::create_company_benefits_response + end + end + end +end diff --git a/sig/finch-api/models/hris/directory_list_individuals_params.rbs b/sig/finch-api/models/hris/directory_list_individuals_params.rbs new file mode 100644 index 00000000..8571ddaf --- /dev/null +++ b/sig/finch-api/models/hris/directory_list_individuals_params.rbs @@ -0,0 +1,34 @@ +module FinchAPI + module Models + module HRIS + type directory_list_individuals_params = + { limit: Integer, offset: Integer } & FinchAPI::request_parameters + + class DirectoryListIndividualsParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + attr_reader limit: Integer? + + def limit=: (Integer) -> Integer + + attr_reader offset: Integer? + + def offset=: (Integer) -> Integer + + def initialize: + ( + limit: Integer, + offset: Integer, + request_options: FinchAPI::request_opts + ) -> void + | ( + ?FinchAPI::Models::HRIS::directory_list_individuals_params + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::directory_list_individuals_params + end + end + end +end diff --git a/sig/finch-api/models/hris/directory_list_params.rbs b/sig/finch-api/models/hris/directory_list_params.rbs new file mode 100644 index 00000000..a24a1024 --- /dev/null +++ b/sig/finch-api/models/hris/directory_list_params.rbs @@ -0,0 +1,34 @@ +module FinchAPI + module Models + module HRIS + type directory_list_params = + { limit: Integer, offset: Integer } & FinchAPI::request_parameters + + class DirectoryListParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + attr_reader limit: Integer? + + def limit=: (Integer) -> Integer + + attr_reader offset: Integer? + + def offset=: (Integer) -> Integer + + def initialize: + ( + limit: Integer, + offset: Integer, + request_options: FinchAPI::request_opts + ) -> void + | ( + ?FinchAPI::Models::HRIS::directory_list_params + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::directory_list_params + end + end + end +end diff --git a/sig/finch-api/models/hris/document_list_params.rbs b/sig/finch-api/models/hris/document_list_params.rbs new file mode 100644 index 00000000..58bd146d --- /dev/null +++ b/sig/finch-api/models/hris/document_list_params.rbs @@ -0,0 +1,61 @@ +module FinchAPI + module Models + module HRIS + type document_list_params = + { + individual_ids: ::Array[String], + limit: Integer, + offset: Integer, + types: ::Array[FinchAPI::Models::HRIS::DocumentListParams::type_] + } + & FinchAPI::request_parameters + + class DocumentListParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + attr_reader individual_ids: ::Array[String]? + + def individual_ids=: (::Array[String]) -> ::Array[String] + + attr_reader limit: Integer? + + def limit=: (Integer) -> Integer + + attr_reader offset: Integer? + + def offset=: (Integer) -> Integer + + attr_reader types: ::Array[FinchAPI::Models::HRIS::DocumentListParams::type_]? + + def types=: ( + ::Array[FinchAPI::Models::HRIS::DocumentListParams::type_] + ) -> ::Array[FinchAPI::Models::HRIS::DocumentListParams::type_] + + def initialize: + ( + individual_ids: ::Array[String], + limit: Integer, + offset: Integer, + types: ::Array[FinchAPI::Models::HRIS::DocumentListParams::type_], + request_options: FinchAPI::request_opts + ) -> void + | ( + ?FinchAPI::Models::HRIS::document_list_params + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::document_list_params + + type type_ = :w4_2020 | :w4_2005 + + class Type < FinchAPI::Enum + W4_2020: :w4_2020 + W4_2005: :w4_2005 + + def self.values: -> ::Array[FinchAPI::Models::HRIS::DocumentListParams::type_] + end + end + end + end +end diff --git a/sig/finch-api/models/hris/document_list_response.rbs b/sig/finch-api/models/hris/document_list_response.rbs new file mode 100644 index 00000000..1a1717c2 --- /dev/null +++ b/sig/finch-api/models/hris/document_list_response.rbs @@ -0,0 +1,29 @@ +module FinchAPI + module Models + module HRIS + type document_list_response = + { + documents: ::Array[FinchAPI::Models::HRIS::DocumentResponse], + paging: FinchAPI::Models::Paging + } + + class DocumentListResponse < FinchAPI::BaseModel + attr_accessor documents: ::Array[FinchAPI::Models::HRIS::DocumentResponse] + + attr_accessor paging: FinchAPI::Models::Paging + + def initialize: + ( + documents: ::Array[FinchAPI::Models::HRIS::DocumentResponse], + paging: FinchAPI::Models::Paging + ) -> void + | ( + ?FinchAPI::Models::HRIS::document_list_response + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::document_list_response + end + end + end +end diff --git a/sig/finch-api/models/hris/document_response.rbs b/sig/finch-api/models/hris/document_response.rbs new file mode 100644 index 00000000..23489f8c --- /dev/null +++ b/sig/finch-api/models/hris/document_response.rbs @@ -0,0 +1,58 @@ +module FinchAPI + module Models + module HRIS + type document_response = + { + id: String, + individual_id: String?, + type: FinchAPI::Models::HRIS::DocumentResponse::type_, + url: String, + year: Float? + } + + class DocumentResponse < FinchAPI::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_accessor individual_id: String? + + attr_reader type: FinchAPI::Models::HRIS::DocumentResponse::type_? + + def type=: ( + FinchAPI::Models::HRIS::DocumentResponse::type_ + ) -> FinchAPI::Models::HRIS::DocumentResponse::type_ + + attr_reader url: String? + + def url=: (String) -> String + + attr_accessor year: Float? + + def initialize: + ( + id: String, + individual_id: String?, + type: FinchAPI::Models::HRIS::DocumentResponse::type_, + url: String, + year: Float? + ) -> void + | ( + ?FinchAPI::Models::HRIS::document_response + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::document_response + + type type_ = :w4_2020 | :w4_2005 + + class Type < FinchAPI::Enum + W4_2020: :w4_2020 + W4_2005: :w4_2005 + + def self.values: -> ::Array[FinchAPI::Models::HRIS::DocumentResponse::type_] + end + end + end + end +end diff --git a/sig/finch-api/models/hris/document_retreive_params.rbs b/sig/finch-api/models/hris/document_retreive_params.rbs new file mode 100644 index 00000000..a1ef05fb --- /dev/null +++ b/sig/finch-api/models/hris/document_retreive_params.rbs @@ -0,0 +1,21 @@ +module FinchAPI + module Models + module HRIS + type document_retreive_params = { } & FinchAPI::request_parameters + + class DocumentRetreiveParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + def initialize: + (request_options: FinchAPI::request_opts) -> void + | ( + ?FinchAPI::Models::HRIS::document_retreive_params + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::document_retreive_params + end + end + end +end diff --git a/sig/finch-api/models/hris/document_retreive_response.rbs b/sig/finch-api/models/hris/document_retreive_response.rbs new file mode 100644 index 00000000..4a429ff9 --- /dev/null +++ b/sig/finch-api/models/hris/document_retreive_response.rbs @@ -0,0 +1,12 @@ +module FinchAPI + module Models + module HRIS + type document_retreive_response = + FinchAPI::Models::HRIS::W42020 | FinchAPI::Models::HRIS::W42005 + + class DocumentRetreiveResponse < FinchAPI::Union + private def self.variants: -> [[:w4_2020, FinchAPI::Models::HRIS::W42020], [:w4_2005, FinchAPI::Models::HRIS::W42005]] + end + end + end +end diff --git a/sig/finch-api/models/hris/employment_data.rbs b/sig/finch-api/models/hris/employment_data.rbs new file mode 100644 index 00000000..d2344da3 --- /dev/null +++ b/sig/finch-api/models/hris/employment_data.rbs @@ -0,0 +1,228 @@ +module FinchAPI + module Models + module HRIS + type employment_data = + { + id: String, + class_code: String?, + custom_fields: ::Array[FinchAPI::Models::HRIS::EmploymentData::CustomField]?, + department: FinchAPI::Models::HRIS::EmploymentData::Department?, + employment: FinchAPI::Models::HRIS::EmploymentData::Employment?, + employment_status: FinchAPI::Models::HRIS::EmploymentData::employment_status?, + end_date: String?, + first_name: String?, + income: FinchAPI::Models::Income?, + income_history: ::Array[FinchAPI::Models::Income?]?, + is_active: bool?, + last_name: String?, + latest_rehire_date: String?, + location: FinchAPI::Models::Location?, + manager: FinchAPI::Models::HRIS::EmploymentData::Manager?, + middle_name: String?, + source_id: String?, + start_date: String?, + title: String?, + work_id: String? + } + + class EmploymentData < FinchAPI::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_accessor class_code: String? + + attr_accessor custom_fields: ::Array[FinchAPI::Models::HRIS::EmploymentData::CustomField]? + + attr_accessor department: FinchAPI::Models::HRIS::EmploymentData::Department? + + attr_accessor employment: FinchAPI::Models::HRIS::EmploymentData::Employment? + + attr_accessor employment_status: FinchAPI::Models::HRIS::EmploymentData::employment_status? + + attr_accessor end_date: String? + + attr_accessor first_name: String? + + attr_accessor income: FinchAPI::Models::Income? + + attr_accessor income_history: ::Array[FinchAPI::Models::Income?]? + + attr_accessor is_active: bool? + + attr_accessor last_name: String? + + attr_accessor latest_rehire_date: String? + + attr_accessor location: FinchAPI::Models::Location? + + attr_accessor manager: FinchAPI::Models::HRIS::EmploymentData::Manager? + + attr_accessor middle_name: String? + + attr_accessor source_id: String? + + attr_accessor start_date: String? + + attr_accessor title: String? + + attr_accessor work_id: String? + + def initialize: + ( + id: String, + class_code: String?, + custom_fields: ::Array[FinchAPI::Models::HRIS::EmploymentData::CustomField]?, + department: FinchAPI::Models::HRIS::EmploymentData::Department?, + employment: FinchAPI::Models::HRIS::EmploymentData::Employment?, + employment_status: FinchAPI::Models::HRIS::EmploymentData::employment_status?, + end_date: String?, + first_name: String?, + income: FinchAPI::Models::Income?, + income_history: ::Array[FinchAPI::Models::Income?]?, + is_active: bool?, + last_name: String?, + latest_rehire_date: String?, + location: FinchAPI::Models::Location?, + manager: FinchAPI::Models::HRIS::EmploymentData::Manager?, + middle_name: String?, + source_id: String?, + start_date: String?, + title: String?, + work_id: String? + ) -> void + | ( + ?FinchAPI::Models::HRIS::employment_data | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::employment_data + + type custom_field = { name: String, value: top } + + class CustomField < FinchAPI::BaseModel + attr_reader name: String? + + def name=: (String) -> String + + attr_reader value: top? + + def value=: (top) -> top + + def initialize: + (name: String, value: top) -> void + | ( + ?FinchAPI::Models::HRIS::EmploymentData::custom_field + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::EmploymentData::custom_field + end + + type department = { name: String? } + + class Department < FinchAPI::BaseModel + attr_accessor name: String? + + def initialize: + (name: String?) -> void + | ( + ?FinchAPI::Models::HRIS::EmploymentData::department + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::EmploymentData::department + end + + type employment = + { + subtype: FinchAPI::Models::HRIS::EmploymentData::Employment::subtype?, + type: FinchAPI::Models::HRIS::EmploymentData::Employment::type_? + } + + class Employment < FinchAPI::BaseModel + attr_accessor subtype: FinchAPI::Models::HRIS::EmploymentData::Employment::subtype? + + attr_accessor type: FinchAPI::Models::HRIS::EmploymentData::Employment::type_? + + def initialize: + ( + subtype: FinchAPI::Models::HRIS::EmploymentData::Employment::subtype?, + type: FinchAPI::Models::HRIS::EmploymentData::Employment::type_? + ) -> void + | ( + ?FinchAPI::Models::HRIS::EmploymentData::employment + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::EmploymentData::employment + + type subtype = + :full_time + | :intern + | :part_time + | :temp + | :seasonal + | :individual_contractor + + class Subtype < FinchAPI::Enum + FULL_TIME: :full_time + INTERN: :intern + PART_TIME: :part_time + TEMP: :temp + SEASONAL: :seasonal + INDIVIDUAL_CONTRACTOR: :individual_contractor + + def self.values: -> ::Array[FinchAPI::Models::HRIS::EmploymentData::Employment::subtype] + end + + type type_ = :employee | :contractor + + class Type < FinchAPI::Enum + EMPLOYEE: :employee + CONTRACTOR: :contractor + + def self.values: -> ::Array[FinchAPI::Models::HRIS::EmploymentData::Employment::type_] + end + end + + type employment_status = + :active + | :deceased + | :leave + | :onboarding + | :prehire + | :retired + | :terminated + + class EmploymentStatus < FinchAPI::Enum + ACTIVE: :active + DECEASED: :deceased + LEAVE: :leave + ONBOARDING: :onboarding + PREHIRE: :prehire + RETIRED: :retired + TERMINATED: :terminated + + def self.values: -> ::Array[FinchAPI::Models::HRIS::EmploymentData::employment_status] + end + + type manager = { id: String } + + class Manager < FinchAPI::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + def initialize: + (id: String) -> void + | ( + ?FinchAPI::Models::HRIS::EmploymentData::manager + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::EmploymentData::manager + end + end + end + end +end diff --git a/sig/finch-api/models/hris/employment_data_response.rbs b/sig/finch-api/models/hris/employment_data_response.rbs new file mode 100644 index 00000000..48609ee5 --- /dev/null +++ b/sig/finch-api/models/hris/employment_data_response.rbs @@ -0,0 +1,41 @@ +module FinchAPI + module Models + module HRIS + type employment_data_response = + { + body: FinchAPI::Models::HRIS::EmploymentData, + code: Integer, + individual_id: String + } + + class EmploymentDataResponse < FinchAPI::BaseModel + attr_reader body: FinchAPI::Models::HRIS::EmploymentData? + + def body=: ( + FinchAPI::Models::HRIS::EmploymentData + ) -> FinchAPI::Models::HRIS::EmploymentData + + attr_reader code: Integer? + + def code=: (Integer) -> Integer + + attr_reader individual_id: String? + + def individual_id=: (String) -> String + + def initialize: + ( + body: FinchAPI::Models::HRIS::EmploymentData, + code: Integer, + individual_id: String + ) -> void + | ( + ?FinchAPI::Models::HRIS::employment_data_response + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::employment_data_response + end + end + end +end diff --git a/sig/finch-api/models/hris/employment_retrieve_many_params.rbs b/sig/finch-api/models/hris/employment_retrieve_many_params.rbs new file mode 100644 index 00000000..092825c1 --- /dev/null +++ b/sig/finch-api/models/hris/employment_retrieve_many_params.rbs @@ -0,0 +1,45 @@ +module FinchAPI + module Models + module HRIS + type employment_retrieve_many_params = + { + requests: ::Array[FinchAPI::Models::HRIS::EmploymentRetrieveManyParams::Request] + } + & FinchAPI::request_parameters + + class EmploymentRetrieveManyParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + attr_accessor requests: ::Array[FinchAPI::Models::HRIS::EmploymentRetrieveManyParams::Request] + + def initialize: + ( + requests: ::Array[FinchAPI::Models::HRIS::EmploymentRetrieveManyParams::Request], + request_options: FinchAPI::request_opts + ) -> void + | ( + ?FinchAPI::Models::HRIS::employment_retrieve_many_params + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::employment_retrieve_many_params + + type request = { individual_id: String } + + class Request < FinchAPI::BaseModel + attr_accessor individual_id: String + + def initialize: + (individual_id: String) -> void + | ( + ?FinchAPI::Models::HRIS::EmploymentRetrieveManyParams::request + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::EmploymentRetrieveManyParams::request + end + end + end + end +end diff --git a/sig/finch-api/models/hris/individual.rbs b/sig/finch-api/models/hris/individual.rbs new file mode 100644 index 00000000..74bec152 --- /dev/null +++ b/sig/finch-api/models/hris/individual.rbs @@ -0,0 +1,176 @@ +module FinchAPI + module Models + module HRIS + type individual = + { + id: String, + dob: String?, + emails: ::Array[FinchAPI::Models::HRIS::Individual::Email]?, + encrypted_ssn: String?, + ethnicity: FinchAPI::Models::HRIS::Individual::ethnicity?, + first_name: String?, + gender: FinchAPI::Models::HRIS::Individual::gender?, + last_name: String?, + middle_name: String?, + phone_numbers: ::Array[FinchAPI::Models::HRIS::Individual::PhoneNumber?]?, + preferred_name: String?, + residence: FinchAPI::Models::Location?, + ssn: String? + } + + class Individual < FinchAPI::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_accessor dob: String? + + attr_accessor emails: ::Array[FinchAPI::Models::HRIS::Individual::Email]? + + attr_accessor encrypted_ssn: String? + + attr_accessor ethnicity: FinchAPI::Models::HRIS::Individual::ethnicity? + + attr_accessor first_name: String? + + attr_accessor gender: FinchAPI::Models::HRIS::Individual::gender? + + attr_accessor last_name: String? + + attr_accessor middle_name: String? + + attr_accessor phone_numbers: ::Array[FinchAPI::Models::HRIS::Individual::PhoneNumber?]? + + attr_accessor preferred_name: String? + + attr_accessor residence: FinchAPI::Models::Location? + + attr_accessor ssn: String? + + def initialize: + ( + id: String, + dob: String?, + emails: ::Array[FinchAPI::Models::HRIS::Individual::Email]?, + encrypted_ssn: String?, + ethnicity: FinchAPI::Models::HRIS::Individual::ethnicity?, + first_name: String?, + gender: FinchAPI::Models::HRIS::Individual::gender?, + last_name: String?, + middle_name: String?, + phone_numbers: ::Array[FinchAPI::Models::HRIS::Individual::PhoneNumber?]?, + preferred_name: String?, + residence: FinchAPI::Models::Location?, + ssn: String? + ) -> void + | ( + ?FinchAPI::Models::HRIS::individual | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::individual + + type email = + { + data: String, + type: FinchAPI::Models::HRIS::Individual::Email::type_? + } + + class Email < FinchAPI::BaseModel + attr_reader data: String? + + def data=: (String) -> String + + attr_accessor type: FinchAPI::Models::HRIS::Individual::Email::type_? + + def initialize: + ( + data: String, + type: FinchAPI::Models::HRIS::Individual::Email::type_? + ) -> void + | ( + ?FinchAPI::Models::HRIS::Individual::email + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::Individual::email + + type type_ = :work | :personal + + class Type < FinchAPI::Enum + WORK: :work + PERSONAL: :personal + + def self.values: -> ::Array[FinchAPI::Models::HRIS::Individual::Email::type_] + end + end + + type ethnicity = + :asian + | :white + | :black_or_african_american + | :native_hawaiian_or_pacific_islander + | :american_indian_or_alaska_native + | :hispanic_or_latino + | :two_or_more_races + | :decline_to_specify + + class Ethnicity < FinchAPI::Enum + ASIAN: :asian + WHITE: :white + BLACK_OR_AFRICAN_AMERICAN: :black_or_african_american + NATIVE_HAWAIIAN_OR_PACIFIC_ISLANDER: :native_hawaiian_or_pacific_islander + AMERICAN_INDIAN_OR_ALASKA_NATIVE: :american_indian_or_alaska_native + HISPANIC_OR_LATINO: :hispanic_or_latino + TWO_OR_MORE_RACES: :two_or_more_races + DECLINE_TO_SPECIFY: :decline_to_specify + + def self.values: -> ::Array[FinchAPI::Models::HRIS::Individual::ethnicity] + end + + type gender = :female | :male | :other | :decline_to_specify + + class Gender < FinchAPI::Enum + FEMALE: :female + MALE: :male + OTHER: :other + DECLINE_TO_SPECIFY: :decline_to_specify + + def self.values: -> ::Array[FinchAPI::Models::HRIS::Individual::gender] + end + + type phone_number = + { + data: String?, + type: FinchAPI::Models::HRIS::Individual::PhoneNumber::type_? + } + + class PhoneNumber < FinchAPI::BaseModel + attr_accessor data: String? + + attr_accessor type: FinchAPI::Models::HRIS::Individual::PhoneNumber::type_? + + def initialize: + ( + data: String?, + type: FinchAPI::Models::HRIS::Individual::PhoneNumber::type_? + ) -> void + | ( + ?FinchAPI::Models::HRIS::Individual::phone_number + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::Individual::phone_number + + type type_ = :work | :personal + + class Type < FinchAPI::Enum + WORK: :work + PERSONAL: :personal + + def self.values: -> ::Array[FinchAPI::Models::HRIS::Individual::PhoneNumber::type_] + end + end + end + end + end +end diff --git a/sig/finch-api/models/hris/individual_in_directory.rbs b/sig/finch-api/models/hris/individual_in_directory.rbs new file mode 100644 index 00000000..20b009fe --- /dev/null +++ b/sig/finch-api/models/hris/individual_in_directory.rbs @@ -0,0 +1,83 @@ +module FinchAPI + module Models + module HRIS + type individual_in_directory = + { + id: String, + department: FinchAPI::Models::HRIS::IndividualInDirectory::Department?, + first_name: String?, + is_active: bool?, + last_name: String?, + manager: FinchAPI::Models::HRIS::IndividualInDirectory::Manager?, + middle_name: String? + } + + class IndividualInDirectory < FinchAPI::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_accessor department: FinchAPI::Models::HRIS::IndividualInDirectory::Department? + + attr_accessor first_name: String? + + attr_accessor is_active: bool? + + attr_accessor last_name: String? + + attr_accessor manager: FinchAPI::Models::HRIS::IndividualInDirectory::Manager? + + attr_accessor middle_name: String? + + def initialize: + ( + id: String, + department: FinchAPI::Models::HRIS::IndividualInDirectory::Department?, + first_name: String?, + is_active: bool?, + last_name: String?, + manager: FinchAPI::Models::HRIS::IndividualInDirectory::Manager?, + middle_name: String? + ) -> void + | ( + ?FinchAPI::Models::HRIS::individual_in_directory + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::individual_in_directory + + type department = { name: String? } + + class Department < FinchAPI::BaseModel + attr_accessor name: String? + + def initialize: + (name: String?) -> void + | ( + ?FinchAPI::Models::HRIS::IndividualInDirectory::department + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::IndividualInDirectory::department + end + + type manager = { id: String } + + class Manager < FinchAPI::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + def initialize: + (id: String) -> void + | ( + ?FinchAPI::Models::HRIS::IndividualInDirectory::manager + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::IndividualInDirectory::manager + end + end + end + end +end diff --git a/sig/finch-api/models/hris/individual_response.rbs b/sig/finch-api/models/hris/individual_response.rbs new file mode 100644 index 00000000..43c26e17 --- /dev/null +++ b/sig/finch-api/models/hris/individual_response.rbs @@ -0,0 +1,41 @@ +module FinchAPI + module Models + module HRIS + type individual_response = + { + body: FinchAPI::Models::HRIS::Individual, + code: Integer, + individual_id: String + } + + class IndividualResponse < FinchAPI::BaseModel + attr_reader body: FinchAPI::Models::HRIS::Individual? + + def body=: ( + FinchAPI::Models::HRIS::Individual + ) -> FinchAPI::Models::HRIS::Individual + + attr_reader code: Integer? + + def code=: (Integer) -> Integer + + attr_reader individual_id: String? + + def individual_id=: (String) -> String + + def initialize: + ( + body: FinchAPI::Models::HRIS::Individual, + code: Integer, + individual_id: String + ) -> void + | ( + ?FinchAPI::Models::HRIS::individual_response + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::individual_response + end + end + end +end diff --git a/sig/finch-api/models/hris/individual_retrieve_many_params.rbs b/sig/finch-api/models/hris/individual_retrieve_many_params.rbs new file mode 100644 index 00000000..dbc9ecba --- /dev/null +++ b/sig/finch-api/models/hris/individual_retrieve_many_params.rbs @@ -0,0 +1,72 @@ +module FinchAPI + module Models + module HRIS + type individual_retrieve_many_params = + { + options: FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Options?, + requests: ::Array[FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Request] + } + & FinchAPI::request_parameters + + class IndividualRetrieveManyParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + attr_accessor options: FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Options? + + attr_reader requests: ::Array[FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Request]? + + def requests=: ( + ::Array[FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Request] + ) -> ::Array[FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Request] + + def initialize: + ( + options: FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Options?, + requests: ::Array[FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Request], + request_options: FinchAPI::request_opts + ) -> void + | ( + ?FinchAPI::Models::HRIS::individual_retrieve_many_params + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::individual_retrieve_many_params + + type options = { include: ::Array[String] } + + class Options < FinchAPI::BaseModel + attr_reader include: ::Array[String]? + + def include=: (::Array[String]) -> ::Array[String] + + def initialize: + (include: ::Array[String]) -> void + | ( + ?FinchAPI::Models::HRIS::IndividualRetrieveManyParams::options + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::IndividualRetrieveManyParams::options + end + + type request = { individual_id: String } + + class Request < FinchAPI::BaseModel + attr_reader individual_id: String? + + def individual_id=: (String) -> String + + def initialize: + (individual_id: String) -> void + | ( + ?FinchAPI::Models::HRIS::IndividualRetrieveManyParams::request + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::IndividualRetrieveManyParams::request + end + end + end + end +end diff --git a/sig/finch-api/models/hris/pay_statement.rbs b/sig/finch-api/models/hris/pay_statement.rbs new file mode 100644 index 00000000..7880d31f --- /dev/null +++ b/sig/finch-api/models/hris/pay_statement.rbs @@ -0,0 +1,445 @@ +module FinchAPI + module Models + module HRIS + type pay_statement = + { + earnings: ::Array[FinchAPI::Models::HRIS::PayStatement::Earning?]?, + employee_deductions: ::Array[FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction?]?, + employer_contributions: ::Array[FinchAPI::Models::HRIS::PayStatement::EmployerContribution?]?, + gross_pay: FinchAPI::Models::Money?, + individual_id: String, + net_pay: FinchAPI::Models::Money?, + payment_method: FinchAPI::Models::HRIS::PayStatement::payment_method?, + taxes: ::Array[FinchAPI::Models::HRIS::PayStatement::Tax?]?, + total_hours: Float?, + type: FinchAPI::Models::HRIS::PayStatement::type_? + } + + class PayStatement < FinchAPI::BaseModel + attr_accessor earnings: ::Array[FinchAPI::Models::HRIS::PayStatement::Earning?]? + + attr_accessor employee_deductions: ::Array[FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction?]? + + attr_accessor employer_contributions: ::Array[FinchAPI::Models::HRIS::PayStatement::EmployerContribution?]? + + attr_accessor gross_pay: FinchAPI::Models::Money? + + attr_reader individual_id: String? + + def individual_id=: (String) -> String + + attr_accessor net_pay: FinchAPI::Models::Money? + + attr_accessor payment_method: FinchAPI::Models::HRIS::PayStatement::payment_method? + + attr_accessor taxes: ::Array[FinchAPI::Models::HRIS::PayStatement::Tax?]? + + attr_accessor total_hours: Float? + + attr_accessor type: FinchAPI::Models::HRIS::PayStatement::type_? + + def initialize: + ( + earnings: ::Array[FinchAPI::Models::HRIS::PayStatement::Earning?]?, + employee_deductions: ::Array[FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction?]?, + employer_contributions: ::Array[FinchAPI::Models::HRIS::PayStatement::EmployerContribution?]?, + gross_pay: FinchAPI::Models::Money?, + individual_id: String, + net_pay: FinchAPI::Models::Money?, + payment_method: FinchAPI::Models::HRIS::PayStatement::payment_method?, + taxes: ::Array[FinchAPI::Models::HRIS::PayStatement::Tax?]?, + total_hours: Float?, + type: FinchAPI::Models::HRIS::PayStatement::type_? + ) -> void + | ( + ?FinchAPI::Models::HRIS::pay_statement | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::pay_statement + + type earning = + { + amount: Integer?, + attributes: FinchAPI::Models::HRIS::PayStatement::Earning::Attributes?, + currency: String?, + hours: Float?, + name: String?, + type: FinchAPI::Models::HRIS::PayStatement::Earning::type_? + } + + class Earning < FinchAPI::BaseModel + attr_accessor amount: Integer? + + attr_accessor attributes: FinchAPI::Models::HRIS::PayStatement::Earning::Attributes? + + attr_accessor currency: String? + + attr_accessor hours: Float? + + attr_accessor name: String? + + attr_accessor type: FinchAPI::Models::HRIS::PayStatement::Earning::type_? + + def initialize: + ( + amount: Integer?, + attributes: FinchAPI::Models::HRIS::PayStatement::Earning::Attributes?, + currency: String?, + hours: Float?, + name: String?, + type: FinchAPI::Models::HRIS::PayStatement::Earning::type_? + ) -> void + | ( + ?FinchAPI::Models::HRIS::PayStatement::earning + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::PayStatement::earning + + type attributes = + { + metadata: FinchAPI::Models::HRIS::PayStatement::Earning::Attributes::Metadata + } + + class Attributes < FinchAPI::BaseModel + attr_reader metadata: FinchAPI::Models::HRIS::PayStatement::Earning::Attributes::Metadata? + + def metadata=: ( + FinchAPI::Models::HRIS::PayStatement::Earning::Attributes::Metadata + ) -> FinchAPI::Models::HRIS::PayStatement::Earning::Attributes::Metadata + + def initialize: + ( + metadata: FinchAPI::Models::HRIS::PayStatement::Earning::Attributes::Metadata + ) -> void + | ( + ?FinchAPI::Models::HRIS::PayStatement::Earning::attributes + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::PayStatement::Earning::attributes + + type metadata = { metadata: ::Hash[Symbol, top] } + + class Metadata < FinchAPI::BaseModel + attr_reader metadata: ::Hash[Symbol, top]? + + def metadata=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + def initialize: + (metadata: ::Hash[Symbol, top]) -> void + | ( + ?FinchAPI::Models::HRIS::PayStatement::Earning::Attributes::metadata + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::PayStatement::Earning::Attributes::metadata + end + end + + type type_ = + :salary + | :wage + | :reimbursement + | :overtime + | :severance + | :double_overtime + | :pto + | :sick + | :bonus + | :commission + | :tips + | :"1099" + | :other + + class Type < FinchAPI::Enum + SALARY: :salary + WAGE: :wage + REIMBURSEMENT: :reimbursement + OVERTIME: :overtime + SEVERANCE: :severance + DOUBLE_OVERTIME: :double_overtime + PTO: :pto + SICK: :sick + BONUS: :bonus + COMMISSION: :commission + TIPS: :tips + NUMBER_1099: :"1099" + OTHER: :other + + def self.values: -> ::Array[FinchAPI::Models::HRIS::PayStatement::Earning::type_] + end + end + + type employee_deduction = + { + amount: Integer?, + attributes: FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes?, + currency: String?, + name: String?, + pre_tax: bool?, + type: FinchAPI::Models::HRIS::benefit_type? + } + + class EmployeeDeduction < FinchAPI::BaseModel + attr_accessor amount: Integer? + + attr_accessor attributes: FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes? + + attr_accessor currency: String? + + attr_accessor name: String? + + attr_accessor pre_tax: bool? + + attr_accessor type: FinchAPI::Models::HRIS::benefit_type? + + def initialize: + ( + amount: Integer?, + attributes: FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes?, + currency: String?, + name: String?, + pre_tax: bool?, + type: FinchAPI::Models::HRIS::benefit_type? + ) -> void + | ( + ?FinchAPI::Models::HRIS::PayStatement::employee_deduction + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::PayStatement::employee_deduction + + type attributes = + { + metadata: FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes::Metadata + } + + class Attributes < FinchAPI::BaseModel + attr_reader metadata: FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes::Metadata? + + def metadata=: ( + FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes::Metadata + ) -> FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes::Metadata + + def initialize: + ( + metadata: FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes::Metadata + ) -> void + | ( + ?FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::attributes + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::attributes + + type metadata = { metadata: ::Hash[Symbol, top] } + + class Metadata < FinchAPI::BaseModel + attr_reader metadata: ::Hash[Symbol, top]? + + def metadata=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + def initialize: + (metadata: ::Hash[Symbol, top]) -> void + | ( + ?FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes::metadata + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes::metadata + end + end + end + + type employer_contribution = + { + amount: Integer?, + attributes: FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes?, + currency: String?, + name: String?, + type: FinchAPI::Models::HRIS::benefit_type? + } + + class EmployerContribution < FinchAPI::BaseModel + attr_accessor amount: Integer? + + attr_accessor attributes: FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes? + + attr_accessor currency: String? + + attr_accessor name: String? + + attr_accessor type: FinchAPI::Models::HRIS::benefit_type? + + def initialize: + ( + amount: Integer?, + attributes: FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes?, + currency: String?, + name: String?, + type: FinchAPI::Models::HRIS::benefit_type? + ) -> void + | ( + ?FinchAPI::Models::HRIS::PayStatement::employer_contribution + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::PayStatement::employer_contribution + + type attributes = + { + metadata: FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes::Metadata + } + + class Attributes < FinchAPI::BaseModel + attr_reader metadata: FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes::Metadata? + + def metadata=: ( + FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes::Metadata + ) -> FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes::Metadata + + def initialize: + ( + metadata: FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes::Metadata + ) -> void + | ( + ?FinchAPI::Models::HRIS::PayStatement::EmployerContribution::attributes + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::PayStatement::EmployerContribution::attributes + + type metadata = { metadata: ::Hash[Symbol, top] } + + class Metadata < FinchAPI::BaseModel + attr_reader metadata: ::Hash[Symbol, top]? + + def metadata=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + def initialize: + (metadata: ::Hash[Symbol, top]) -> void + | ( + ?FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes::metadata + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes::metadata + end + end + end + + type payment_method = :check | :direct_deposit + + class PaymentMethod < FinchAPI::Enum + CHECK: :check + DIRECT_DEPOSIT: :direct_deposit + + def self.values: -> ::Array[FinchAPI::Models::HRIS::PayStatement::payment_method] + end + + type tax = + { + amount: Integer?, + attributes: FinchAPI::Models::HRIS::PayStatement::Tax::Attributes?, + currency: String?, + employer: bool?, + name: String?, + type: FinchAPI::Models::HRIS::PayStatement::Tax::type_? + } + + class Tax < FinchAPI::BaseModel + attr_accessor amount: Integer? + + attr_accessor attributes: FinchAPI::Models::HRIS::PayStatement::Tax::Attributes? + + attr_accessor currency: String? + + attr_accessor employer: bool? + + attr_accessor name: String? + + attr_accessor type: FinchAPI::Models::HRIS::PayStatement::Tax::type_? + + def initialize: + ( + amount: Integer?, + attributes: FinchAPI::Models::HRIS::PayStatement::Tax::Attributes?, + currency: String?, + employer: bool?, + name: String?, + type: FinchAPI::Models::HRIS::PayStatement::Tax::type_? + ) -> void + | ( + ?FinchAPI::Models::HRIS::PayStatement::tax + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::PayStatement::tax + + type attributes = + { + metadata: FinchAPI::Models::HRIS::PayStatement::Tax::Attributes::Metadata + } + + class Attributes < FinchAPI::BaseModel + attr_reader metadata: FinchAPI::Models::HRIS::PayStatement::Tax::Attributes::Metadata? + + def metadata=: ( + FinchAPI::Models::HRIS::PayStatement::Tax::Attributes::Metadata + ) -> FinchAPI::Models::HRIS::PayStatement::Tax::Attributes::Metadata + + def initialize: + ( + metadata: FinchAPI::Models::HRIS::PayStatement::Tax::Attributes::Metadata + ) -> void + | ( + ?FinchAPI::Models::HRIS::PayStatement::Tax::attributes + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::PayStatement::Tax::attributes + + type metadata = { metadata: ::Hash[Symbol, top] } + + class Metadata < FinchAPI::BaseModel + attr_reader metadata: ::Hash[Symbol, top]? + + def metadata=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + def initialize: + (metadata: ::Hash[Symbol, top]) -> void + | ( + ?FinchAPI::Models::HRIS::PayStatement::Tax::Attributes::metadata + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::PayStatement::Tax::Attributes::metadata + end + end + + type type_ = :state | :federal | :local | :fica + + class Type < FinchAPI::Enum + STATE: :state + FEDERAL: :federal + LOCAL: :local + FICA: :fica + + def self.values: -> ::Array[FinchAPI::Models::HRIS::PayStatement::Tax::type_] + end + end + + type type_ = :regular_payroll | :off_cycle_payroll | :one_time_payment + + class Type < FinchAPI::Enum + REGULAR_PAYROLL: :regular_payroll + OFF_CYCLE_PAYROLL: :off_cycle_payroll + ONE_TIME_PAYMENT: :one_time_payment + + def self.values: -> ::Array[FinchAPI::Models::HRIS::PayStatement::type_] + end + end + end + end +end diff --git a/sig/finch-api/models/hris/pay_statement_response.rbs b/sig/finch-api/models/hris/pay_statement_response.rbs new file mode 100644 index 00000000..71bcfaa1 --- /dev/null +++ b/sig/finch-api/models/hris/pay_statement_response.rbs @@ -0,0 +1,41 @@ +module FinchAPI + module Models + module HRIS + type pay_statement_response = + { + body: FinchAPI::Models::HRIS::PayStatementResponseBody, + code: Integer, + payment_id: String + } + + class PayStatementResponse < FinchAPI::BaseModel + attr_reader body: FinchAPI::Models::HRIS::PayStatementResponseBody? + + def body=: ( + FinchAPI::Models::HRIS::PayStatementResponseBody + ) -> FinchAPI::Models::HRIS::PayStatementResponseBody + + attr_reader code: Integer? + + def code=: (Integer) -> Integer + + attr_reader payment_id: String? + + def payment_id=: (String) -> String + + def initialize: + ( + body: FinchAPI::Models::HRIS::PayStatementResponseBody, + code: Integer, + payment_id: String + ) -> void + | ( + ?FinchAPI::Models::HRIS::pay_statement_response + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::pay_statement_response + end + end + end +end diff --git a/sig/finch-api/models/hris/pay_statement_response_body.rbs b/sig/finch-api/models/hris/pay_statement_response_body.rbs new file mode 100644 index 00000000..cb7a710b --- /dev/null +++ b/sig/finch-api/models/hris/pay_statement_response_body.rbs @@ -0,0 +1,35 @@ +module FinchAPI + module Models + module HRIS + type pay_statement_response_body = + { + paging: FinchAPI::Models::Paging, + pay_statements: ::Array[FinchAPI::Models::HRIS::PayStatement] + } + + class PayStatementResponseBody < FinchAPI::BaseModel + attr_reader paging: FinchAPI::Models::Paging? + + def paging=: (FinchAPI::Models::Paging) -> FinchAPI::Models::Paging + + attr_reader pay_statements: ::Array[FinchAPI::Models::HRIS::PayStatement]? + + def pay_statements=: ( + ::Array[FinchAPI::Models::HRIS::PayStatement] + ) -> ::Array[FinchAPI::Models::HRIS::PayStatement] + + def initialize: + ( + paging: FinchAPI::Models::Paging, + pay_statements: ::Array[FinchAPI::Models::HRIS::PayStatement] + ) -> void + | ( + ?FinchAPI::Models::HRIS::pay_statement_response_body + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::pay_statement_response_body + end + end + end +end diff --git a/sig/finch-api/models/hris/pay_statement_retrieve_many_params.rbs b/sig/finch-api/models/hris/pay_statement_retrieve_many_params.rbs new file mode 100644 index 00000000..646aa19d --- /dev/null +++ b/sig/finch-api/models/hris/pay_statement_retrieve_many_params.rbs @@ -0,0 +1,53 @@ +module FinchAPI + module Models + module HRIS + type pay_statement_retrieve_many_params = + { + requests: ::Array[FinchAPI::Models::HRIS::PayStatementRetrieveManyParams::Request] + } + & FinchAPI::request_parameters + + class PayStatementRetrieveManyParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + attr_accessor requests: ::Array[FinchAPI::Models::HRIS::PayStatementRetrieveManyParams::Request] + + def initialize: + ( + requests: ::Array[FinchAPI::Models::HRIS::PayStatementRetrieveManyParams::Request], + request_options: FinchAPI::request_opts + ) -> void + | ( + ?FinchAPI::Models::HRIS::pay_statement_retrieve_many_params + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::pay_statement_retrieve_many_params + + type request = { payment_id: String, limit: Integer, offset: Integer } + + class Request < FinchAPI::BaseModel + attr_accessor payment_id: String + + attr_reader limit: Integer? + + def limit=: (Integer) -> Integer + + attr_reader offset: Integer? + + def offset=: (Integer) -> Integer + + def initialize: + (payment_id: String, limit: Integer, offset: Integer) -> void + | ( + ?FinchAPI::Models::HRIS::PayStatementRetrieveManyParams::request + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::PayStatementRetrieveManyParams::request + end + end + end + end +end diff --git a/sig/finch-api/models/hris/payment.rbs b/sig/finch-api/models/hris/payment.rbs new file mode 100644 index 00000000..30eaa5a5 --- /dev/null +++ b/sig/finch-api/models/hris/payment.rbs @@ -0,0 +1,112 @@ +module FinchAPI + module Models + module HRIS + type payment = + { + id: String, + company_debit: FinchAPI::Models::Money?, + debit_date: String?, + employee_taxes: FinchAPI::Models::Money?, + employer_taxes: FinchAPI::Models::Money?, + gross_pay: FinchAPI::Models::Money?, + individual_ids: ::Array[String]?, + net_pay: FinchAPI::Models::Money?, + pay_date: String?, + pay_frequencies: ::Array[FinchAPI::Models::HRIS::Payment::pay_frequency]?, + pay_group_ids: ::Array[String]?, + pay_period: FinchAPI::Models::HRIS::Payment::PayPeriod? + } + + class Payment < FinchAPI::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_accessor company_debit: FinchAPI::Models::Money? + + attr_accessor debit_date: String? + + attr_accessor employee_taxes: FinchAPI::Models::Money? + + attr_accessor employer_taxes: FinchAPI::Models::Money? + + attr_accessor gross_pay: FinchAPI::Models::Money? + + attr_accessor individual_ids: ::Array[String]? + + attr_accessor net_pay: FinchAPI::Models::Money? + + attr_accessor pay_date: String? + + attr_accessor pay_frequencies: ::Array[FinchAPI::Models::HRIS::Payment::pay_frequency]? + + attr_accessor pay_group_ids: ::Array[String]? + + attr_accessor pay_period: FinchAPI::Models::HRIS::Payment::PayPeriod? + + def initialize: + ( + id: String, + company_debit: FinchAPI::Models::Money?, + debit_date: String?, + employee_taxes: FinchAPI::Models::Money?, + employer_taxes: FinchAPI::Models::Money?, + gross_pay: FinchAPI::Models::Money?, + individual_ids: ::Array[String]?, + net_pay: FinchAPI::Models::Money?, + pay_date: String?, + pay_frequencies: ::Array[FinchAPI::Models::HRIS::Payment::pay_frequency]?, + pay_group_ids: ::Array[String]?, + pay_period: FinchAPI::Models::HRIS::Payment::PayPeriod? + ) -> void + | ( + ?FinchAPI::Models::HRIS::payment | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::payment + + type pay_frequency = + :annually + | :semi_annually + | :quarterly + | :monthly + | :semi_monthly + | :bi_weekly + | :weekly + | :daily + | :other + + class PayFrequency < FinchAPI::Enum + ANNUALLY: :annually + SEMI_ANNUALLY: :semi_annually + QUARTERLY: :quarterly + MONTHLY: :monthly + SEMI_MONTHLY: :semi_monthly + BI_WEEKLY: :bi_weekly + WEEKLY: :weekly + DAILY: :daily + OTHER: :other + + def self.values: -> ::Array[FinchAPI::Models::HRIS::Payment::pay_frequency] + end + + type pay_period = { end_date: String?, start_date: String? } + + class PayPeriod < FinchAPI::BaseModel + attr_accessor end_date: String? + + attr_accessor start_date: String? + + def initialize: + (end_date: String?, start_date: String?) -> void + | ( + ?FinchAPI::Models::HRIS::Payment::pay_period + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::Payment::pay_period + end + end + end + end +end diff --git a/sig/finch-api/models/hris/payment_list_params.rbs b/sig/finch-api/models/hris/payment_list_params.rbs new file mode 100644 index 00000000..c4225a9f --- /dev/null +++ b/sig/finch-api/models/hris/payment_list_params.rbs @@ -0,0 +1,30 @@ +module FinchAPI + module Models + module HRIS + type payment_list_params = + { end_date: Date, start_date: Date } & FinchAPI::request_parameters + + class PaymentListParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + attr_accessor end_date: Date + + attr_accessor start_date: Date + + def initialize: + ( + end_date: Date, + start_date: Date, + request_options: FinchAPI::request_opts + ) -> void + | ( + ?FinchAPI::Models::HRIS::payment_list_params + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::payment_list_params + end + end + end +end diff --git a/sig/finch-api/models/hris/support_per_benefit_type.rbs b/sig/finch-api/models/hris/support_per_benefit_type.rbs new file mode 100644 index 00000000..87dc360e --- /dev/null +++ b/sig/finch-api/models/hris/support_per_benefit_type.rbs @@ -0,0 +1,37 @@ +module FinchAPI + module Models + module HRIS + type support_per_benefit_type = + { + company_benefits: FinchAPI::Models::OperationSupportMatrix, + individual_benefits: FinchAPI::Models::OperationSupportMatrix + } + + class SupportPerBenefitType < FinchAPI::BaseModel + attr_reader company_benefits: FinchAPI::Models::OperationSupportMatrix? + + def company_benefits=: ( + FinchAPI::Models::OperationSupportMatrix + ) -> FinchAPI::Models::OperationSupportMatrix + + attr_reader individual_benefits: FinchAPI::Models::OperationSupportMatrix? + + def individual_benefits=: ( + FinchAPI::Models::OperationSupportMatrix + ) -> FinchAPI::Models::OperationSupportMatrix + + def initialize: + ( + company_benefits: FinchAPI::Models::OperationSupportMatrix, + individual_benefits: FinchAPI::Models::OperationSupportMatrix + ) -> void + | ( + ?FinchAPI::Models::HRIS::support_per_benefit_type + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::support_per_benefit_type + end + end + end +end diff --git a/sig/finch-api/models/hris/supported_benefit.rbs b/sig/finch-api/models/hris/supported_benefit.rbs new file mode 100644 index 00000000..d1e60b98 --- /dev/null +++ b/sig/finch-api/models/hris/supported_benefit.rbs @@ -0,0 +1,84 @@ +module FinchAPI + module Models + module HRIS + type supported_benefit = + { + annual_maximum: bool?, + catch_up: bool?, + company_contribution: ::Array[FinchAPI::Models::HRIS::SupportedBenefit::company_contribution?]?, + description: String?, + employee_deduction: ::Array[FinchAPI::Models::HRIS::SupportedBenefit::employee_deduction?]?, + frequencies: ::Array[FinchAPI::Models::HRIS::benefit_frequency?], + hsa_contribution_limit: ::Array[FinchAPI::Models::HRIS::SupportedBenefit::hsa_contribution_limit?]?, + type: FinchAPI::Models::HRIS::benefit_type? + } + + class SupportedBenefit < FinchAPI::BaseModel + attr_accessor annual_maximum: bool? + + attr_accessor catch_up: bool? + + attr_accessor company_contribution: ::Array[FinchAPI::Models::HRIS::SupportedBenefit::company_contribution?]? + + attr_accessor description: String? + + attr_accessor employee_deduction: ::Array[FinchAPI::Models::HRIS::SupportedBenefit::employee_deduction?]? + + attr_reader frequencies: ::Array[FinchAPI::Models::HRIS::benefit_frequency?]? + + def frequencies=: ( + ::Array[FinchAPI::Models::HRIS::benefit_frequency?] + ) -> ::Array[FinchAPI::Models::HRIS::benefit_frequency?] + + attr_accessor hsa_contribution_limit: ::Array[FinchAPI::Models::HRIS::SupportedBenefit::hsa_contribution_limit?]? + + attr_accessor type: FinchAPI::Models::HRIS::benefit_type? + + def initialize: + ( + annual_maximum: bool?, + catch_up: bool?, + company_contribution: ::Array[FinchAPI::Models::HRIS::SupportedBenefit::company_contribution?]?, + description: String?, + employee_deduction: ::Array[FinchAPI::Models::HRIS::SupportedBenefit::employee_deduction?]?, + frequencies: ::Array[FinchAPI::Models::HRIS::benefit_frequency?], + hsa_contribution_limit: ::Array[FinchAPI::Models::HRIS::SupportedBenefit::hsa_contribution_limit?]?, + type: FinchAPI::Models::HRIS::benefit_type? + ) -> void + | ( + ?FinchAPI::Models::HRIS::supported_benefit + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::supported_benefit + + type company_contribution = :fixed | :percent + + class CompanyContribution < FinchAPI::Enum + FIXED: :fixed + PERCENT: :percent + + def self.values: -> ::Array[FinchAPI::Models::HRIS::SupportedBenefit::company_contribution] + end + + type employee_deduction = :fixed | :percent + + class EmployeeDeduction < FinchAPI::Enum + FIXED: :fixed + PERCENT: :percent + + def self.values: -> ::Array[FinchAPI::Models::HRIS::SupportedBenefit::employee_deduction] + end + + type hsa_contribution_limit = :individual | :family + + class HsaContributionLimit < FinchAPI::Enum + INDIVIDUAL: :individual + FAMILY: :family + + def self.values: -> ::Array[FinchAPI::Models::HRIS::SupportedBenefit::hsa_contribution_limit] + end + end + end + end +end diff --git a/sig/finch-api/models/hris/update_company_benefit_response.rbs b/sig/finch-api/models/hris/update_company_benefit_response.rbs new file mode 100644 index 00000000..8b0fca4f --- /dev/null +++ b/sig/finch-api/models/hris/update_company_benefit_response.rbs @@ -0,0 +1,20 @@ +module FinchAPI + module Models + module HRIS + type update_company_benefit_response = { benefit_id: String } + + class UpdateCompanyBenefitResponse < FinchAPI::BaseModel + attr_accessor benefit_id: String + + def initialize: + (benefit_id: String) -> void + | ( + ?FinchAPI::Models::HRIS::update_company_benefit_response + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::update_company_benefit_response + end + end + end +end diff --git a/sig/finch-api/models/hris/w42005.rbs b/sig/finch-api/models/hris/w42005.rbs new file mode 100644 index 00000000..8390845d --- /dev/null +++ b/sig/finch-api/models/hris/w42005.rbs @@ -0,0 +1,111 @@ +module FinchAPI + module Models + module HRIS + type w42005 = + { + data: FinchAPI::Models::HRIS::W42005::Data, + type: FinchAPI::Models::HRIS::W42005::type_, + year: Float? + } + + class W42005 < FinchAPI::BaseModel + attr_reader data: FinchAPI::Models::HRIS::W42005::Data? + + def data=: ( + FinchAPI::Models::HRIS::W42005::Data + ) -> FinchAPI::Models::HRIS::W42005::Data + + attr_reader type: FinchAPI::Models::HRIS::W42005::type_? + + def type=: ( + FinchAPI::Models::HRIS::W42005::type_ + ) -> FinchAPI::Models::HRIS::W42005::type_ + + attr_accessor year: Float? + + def initialize: + ( + data: FinchAPI::Models::HRIS::W42005::Data, + type: FinchAPI::Models::HRIS::W42005::type_, + year: Float? + ) -> void + | (?FinchAPI::Models::HRIS::w42005 | FinchAPI::BaseModel data) -> void + + def to_hash: -> FinchAPI::Models::HRIS::w42005 + + type data = + { + additional_withholding: Integer?, + exemption: FinchAPI::Models::HRIS::W42005::Data::exemption, + filing_status: FinchAPI::Models::HRIS::W42005::Data::filing_status, + individual_id: String, + total_number_of_allowances: Integer? + } + + class Data < FinchAPI::BaseModel + attr_accessor additional_withholding: Integer? + + attr_reader exemption: FinchAPI::Models::HRIS::W42005::Data::exemption? + + def exemption=: ( + FinchAPI::Models::HRIS::W42005::Data::exemption + ) -> FinchAPI::Models::HRIS::W42005::Data::exemption + + attr_reader filing_status: FinchAPI::Models::HRIS::W42005::Data::filing_status? + + def filing_status=: ( + FinchAPI::Models::HRIS::W42005::Data::filing_status + ) -> FinchAPI::Models::HRIS::W42005::Data::filing_status + + attr_reader individual_id: String? + + def individual_id=: (String) -> String + + attr_accessor total_number_of_allowances: Integer? + + def initialize: + ( + additional_withholding: Integer?, + exemption: FinchAPI::Models::HRIS::W42005::Data::exemption, + filing_status: FinchAPI::Models::HRIS::W42005::Data::filing_status, + individual_id: String, + total_number_of_allowances: Integer? + ) -> void + | ( + ?FinchAPI::Models::HRIS::W42005::data | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::W42005::data + + type exemption = :exempt | :non_exempt + + class Exemption < FinchAPI::Enum + EXEMPT: :exempt + NON_EXEMPT: :non_exempt + + def self.values: -> ::Array[FinchAPI::Models::HRIS::W42005::Data::exemption] + end + + type filing_status = + :married | :married_but_withhold_at_higher_single_rate | :single + + class FilingStatus < FinchAPI::Enum + MARRIED: :married + MARRIED_BUT_WITHHOLD_AT_HIGHER_SINGLE_RATE: :married_but_withhold_at_higher_single_rate + SINGLE: :single + + def self.values: -> ::Array[FinchAPI::Models::HRIS::W42005::Data::filing_status] + end + end + + type type_ = :w4_2005 + + class Type < FinchAPI::Enum + W4_2005: :w4_2005 + + def self.values: -> ::Array[FinchAPI::Models::HRIS::W42005::type_] + end + end + end + end +end diff --git a/sig/finch-api/models/hris/w42020.rbs b/sig/finch-api/models/hris/w42020.rbs new file mode 100644 index 00000000..a7ef901f --- /dev/null +++ b/sig/finch-api/models/hris/w42020.rbs @@ -0,0 +1,108 @@ +module FinchAPI + module Models + module HRIS + type w42020 = + { + data: FinchAPI::Models::HRIS::W42020::Data, + type: FinchAPI::Models::HRIS::W42020::type_, + year: Float? + } + + class W42020 < FinchAPI::BaseModel + attr_reader data: FinchAPI::Models::HRIS::W42020::Data? + + def data=: ( + FinchAPI::Models::HRIS::W42020::Data + ) -> FinchAPI::Models::HRIS::W42020::Data + + attr_reader type: FinchAPI::Models::HRIS::W42020::type_? + + def type=: ( + FinchAPI::Models::HRIS::W42020::type_ + ) -> FinchAPI::Models::HRIS::W42020::type_ + + attr_accessor year: Float? + + def initialize: + ( + data: FinchAPI::Models::HRIS::W42020::Data, + type: FinchAPI::Models::HRIS::W42020::type_, + year: Float? + ) -> void + | (?FinchAPI::Models::HRIS::w42020 | FinchAPI::BaseModel data) -> void + + def to_hash: -> FinchAPI::Models::HRIS::w42020 + + type data = + { + amount_for_other_dependents: Integer?, + :amount_for_qualifying_children_under_17 => Integer?, + deductions: Integer?, + extra_withholding: Integer?, + filing_status: FinchAPI::Models::HRIS::W42020::Data::filing_status?, + individual_id: String, + other_income: Integer?, + total_claim_dependent_and_other_credits: Integer? + } + + class Data < FinchAPI::BaseModel + attr_accessor amount_for_other_dependents: Integer? + + attr_accessor amount_for_qualifying_children_under_17: Integer? + + attr_accessor deductions: Integer? + + attr_accessor extra_withholding: Integer? + + attr_accessor filing_status: FinchAPI::Models::HRIS::W42020::Data::filing_status? + + attr_reader individual_id: String? + + def individual_id=: (String) -> String + + attr_accessor other_income: Integer? + + attr_accessor total_claim_dependent_and_other_credits: Integer? + + def initialize: + ( + amount_for_other_dependents: Integer?, + amount_for_qualifying_children_under_17: Integer?, + deductions: Integer?, + extra_withholding: Integer?, + filing_status: FinchAPI::Models::HRIS::W42020::Data::filing_status?, + individual_id: String, + other_income: Integer?, + total_claim_dependent_and_other_credits: Integer? + ) -> void + | ( + ?FinchAPI::Models::HRIS::W42020::data | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::HRIS::W42020::data + + type filing_status = + :head_of_household + | :married_filing_jointly_or_qualifying_surviving_spouse + | :single_or_married_filing_separately + + class FilingStatus < FinchAPI::Enum + HEAD_OF_HOUSEHOLD: :head_of_household + MARRIED_FILING_JOINTLY_OR_QUALIFYING_SURVIVING_SPOUSE: :married_filing_jointly_or_qualifying_surviving_spouse + SINGLE_OR_MARRIED_FILING_SEPARATELY: :single_or_married_filing_separately + + def self.values: -> ::Array[FinchAPI::Models::HRIS::W42020::Data::filing_status] + end + end + + type type_ = :w4_2020 + + class Type < FinchAPI::Enum + W4_2020: :w4_2020 + + def self.values: -> ::Array[FinchAPI::Models::HRIS::W42020::type_] + end + end + end + end +end diff --git a/sig/finch-api/models/income.rbs b/sig/finch-api/models/income.rbs new file mode 100644 index 00000000..25c623b7 --- /dev/null +++ b/sig/finch-api/models/income.rbs @@ -0,0 +1,57 @@ +module FinchAPI + module Models + type income = + { + amount: Integer?, + currency: String?, + effective_date: String?, + unit: FinchAPI::Models::Income::unit? + } + + class Income < FinchAPI::BaseModel + attr_accessor amount: Integer? + + attr_accessor currency: String? + + attr_accessor effective_date: String? + + attr_accessor unit: FinchAPI::Models::Income::unit? + + def initialize: + ( + amount: Integer?, + currency: String?, + effective_date: String?, + unit: FinchAPI::Models::Income::unit? + ) -> void + | (?FinchAPI::Models::income | FinchAPI::BaseModel data) -> void + + def to_hash: -> FinchAPI::Models::income + + type unit = + :yearly + | :quarterly + | :monthly + | :semi_monthly + | :bi_weekly + | :weekly + | :daily + | :hourly + | :fixed + + class Unit < FinchAPI::Enum + YEARLY: :yearly + QUARTERLY: :quarterly + MONTHLY: :monthly + SEMI_MONTHLY: :semi_monthly + BI_WEEKLY: :bi_weekly + WEEKLY: :weekly + DAILY: :daily + HOURLY: :hourly + FIXED: :fixed + + def self.values: -> ::Array[FinchAPI::Models::Income::unit] + end + end + end +end diff --git a/sig/finch-api/models/individual_event.rbs b/sig/finch-api/models/individual_event.rbs new file mode 100644 index 00000000..3a765997 --- /dev/null +++ b/sig/finch-api/models/individual_event.rbs @@ -0,0 +1,61 @@ +module FinchAPI + module Models + type individual_event = + { + data: FinchAPI::Models::IndividualEvent::Data, + event_type: FinchAPI::Models::IndividualEvent::event_type + } + + class IndividualEvent < FinchAPI::Models::BaseWebhookEvent + attr_reader data: FinchAPI::Models::IndividualEvent::Data? + + def data=: ( + FinchAPI::Models::IndividualEvent::Data + ) -> FinchAPI::Models::IndividualEvent::Data + + attr_reader event_type: FinchAPI::Models::IndividualEvent::event_type? + + def event_type=: ( + FinchAPI::Models::IndividualEvent::event_type + ) -> FinchAPI::Models::IndividualEvent::event_type + + def initialize: + ( + data: FinchAPI::Models::IndividualEvent::Data, + event_type: FinchAPI::Models::IndividualEvent::event_type + ) -> void + | ( + ?FinchAPI::Models::individual_event | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::individual_event + + type data = { individual_id: String } + + class Data < FinchAPI::BaseModel + attr_reader individual_id: String? + + def individual_id=: (String) -> String + + def initialize: + (individual_id: String) -> void + | ( + ?FinchAPI::Models::IndividualEvent::data | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::IndividualEvent::data + end + + type event_type = + :"individual.created" | :"individual.updated" | :"individual.deleted" + + class EventType < FinchAPI::Enum + INDIVIDUAL_CREATED: :"individual.created" + INDIVIDUAL_UPDATED: :"individual.updated" + INDIVIDUAL_DELETED: :"individual.deleted" + + def self.values: -> ::Array[FinchAPI::Models::IndividualEvent::event_type] + end + end + end +end diff --git a/sig/finch-api/models/introspection.rbs b/sig/finch-api/models/introspection.rbs new file mode 100644 index 00000000..2fdbb059 --- /dev/null +++ b/sig/finch-api/models/introspection.rbs @@ -0,0 +1,204 @@ +module FinchAPI + module Models + type introspection = + { + account_id: String, + authentication_methods: ::Array[FinchAPI::Models::Introspection::AuthenticationMethod], + client_id: String, + client_type: FinchAPI::Models::Introspection::client_type, + company_id: String, + connection_id: String, + connection_status: FinchAPI::Models::Introspection::ConnectionStatus, + connection_type: FinchAPI::Models::Introspection::connection_type, + customer_email: String?, + customer_id: String?, + customer_name: String?, + manual: bool, + payroll_provider_id: String, + products: ::Array[String], + provider_id: String, + username: String + } + + class Introspection < FinchAPI::BaseModel + attr_accessor account_id: String + + attr_accessor authentication_methods: ::Array[FinchAPI::Models::Introspection::AuthenticationMethod] + + attr_accessor client_id: String + + attr_accessor client_type: FinchAPI::Models::Introspection::client_type + + attr_accessor company_id: String + + attr_accessor connection_id: String + + attr_accessor connection_status: FinchAPI::Models::Introspection::ConnectionStatus + + attr_accessor connection_type: FinchAPI::Models::Introspection::connection_type + + attr_accessor customer_email: String? + + attr_accessor customer_id: String? + + attr_accessor customer_name: String? + + attr_accessor manual: bool + + attr_accessor payroll_provider_id: String + + attr_accessor products: ::Array[String] + + attr_accessor provider_id: String + + attr_accessor username: String + + def initialize: + ( + account_id: String, + authentication_methods: ::Array[FinchAPI::Models::Introspection::AuthenticationMethod], + client_id: String, + client_type: FinchAPI::Models::Introspection::client_type, + company_id: String, + connection_id: String, + connection_status: FinchAPI::Models::Introspection::ConnectionStatus, + connection_type: FinchAPI::Models::Introspection::connection_type, + customer_email: String?, + customer_id: String?, + customer_name: String?, + manual: bool, + payroll_provider_id: String, + products: ::Array[String], + provider_id: String, + username: String + ) -> void + | (?FinchAPI::Models::introspection | FinchAPI::BaseModel data) -> void + + def to_hash: -> FinchAPI::Models::introspection + + type authentication_method = + { + connection_status: FinchAPI::Models::Introspection::AuthenticationMethod::ConnectionStatus, + products: ::Array[String], + type: FinchAPI::Models::Introspection::AuthenticationMethod::type_ + } + + class AuthenticationMethod < FinchAPI::BaseModel + attr_reader connection_status: FinchAPI::Models::Introspection::AuthenticationMethod::ConnectionStatus? + + def connection_status=: ( + FinchAPI::Models::Introspection::AuthenticationMethod::ConnectionStatus + ) -> FinchAPI::Models::Introspection::AuthenticationMethod::ConnectionStatus + + attr_reader products: ::Array[String]? + + def products=: (::Array[String]) -> ::Array[String] + + attr_reader type: FinchAPI::Models::Introspection::AuthenticationMethod::type_? + + def type=: ( + FinchAPI::Models::Introspection::AuthenticationMethod::type_ + ) -> FinchAPI::Models::Introspection::AuthenticationMethod::type_ + + def initialize: + ( + connection_status: FinchAPI::Models::Introspection::AuthenticationMethod::ConnectionStatus, + products: ::Array[String], + type: FinchAPI::Models::Introspection::AuthenticationMethod::type_ + ) -> void + | ( + ?FinchAPI::Models::Introspection::authentication_method + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Introspection::authentication_method + + type connection_status = + { message: String, status: FinchAPI::Models::connection_status_type } + + class ConnectionStatus < FinchAPI::BaseModel + attr_reader message: String? + + def message=: (String) -> String + + attr_reader status: FinchAPI::Models::connection_status_type? + + def status=: ( + FinchAPI::Models::connection_status_type + ) -> FinchAPI::Models::connection_status_type + + def initialize: + ( + message: String, + status: FinchAPI::Models::connection_status_type + ) -> void + | ( + ?FinchAPI::Models::Introspection::AuthenticationMethod::connection_status + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Introspection::AuthenticationMethod::connection_status + end + + type type_ = + :assisted | :credential | :api_token | :api_credential | :oauth + + class Type < FinchAPI::Enum + ASSISTED: :assisted + CREDENTIAL: :credential + API_TOKEN: :api_token + API_CREDENTIAL: :api_credential + OAUTH: :oauth + + def self.values: -> ::Array[FinchAPI::Models::Introspection::AuthenticationMethod::type_] + end + end + + type client_type = :production | :development | :sandbox + + class ClientType < FinchAPI::Enum + PRODUCTION: :production + DEVELOPMENT: :development + SANDBOX: :sandbox + + def self.values: -> ::Array[FinchAPI::Models::Introspection::client_type] + end + + type connection_status = + { message: String, status: FinchAPI::Models::connection_status_type } + + class ConnectionStatus < FinchAPI::BaseModel + attr_reader message: String? + + def message=: (String) -> String + + attr_reader status: FinchAPI::Models::connection_status_type? + + def status=: ( + FinchAPI::Models::connection_status_type + ) -> FinchAPI::Models::connection_status_type + + def initialize: + ( + message: String, + status: FinchAPI::Models::connection_status_type + ) -> void + | ( + ?FinchAPI::Models::Introspection::connection_status + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Introspection::connection_status + end + + type connection_type = :provider | :finch + + class ConnectionType < FinchAPI::Enum + PROVIDER: :provider + FINCH: :finch + + def self.values: -> ::Array[FinchAPI::Models::Introspection::connection_type] + end + end + end +end diff --git a/sig/finch-api/models/job_completion_event.rbs b/sig/finch-api/models/job_completion_event.rbs new file mode 100644 index 00000000..fd27ee8a --- /dev/null +++ b/sig/finch-api/models/job_completion_event.rbs @@ -0,0 +1,70 @@ +module FinchAPI + module Models + type job_completion_event = + { + data: FinchAPI::Models::JobCompletionEvent::Data, + event_type: FinchAPI::Models::JobCompletionEvent::event_type + } + + class JobCompletionEvent < FinchAPI::Models::BaseWebhookEvent + attr_reader data: FinchAPI::Models::JobCompletionEvent::Data? + + def data=: ( + FinchAPI::Models::JobCompletionEvent::Data + ) -> FinchAPI::Models::JobCompletionEvent::Data + + attr_reader event_type: FinchAPI::Models::JobCompletionEvent::event_type? + + def event_type=: ( + FinchAPI::Models::JobCompletionEvent::event_type + ) -> FinchAPI::Models::JobCompletionEvent::event_type + + def initialize: + ( + data: FinchAPI::Models::JobCompletionEvent::Data, + event_type: FinchAPI::Models::JobCompletionEvent::event_type + ) -> void + | ( + ?FinchAPI::Models::job_completion_event | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::job_completion_event + + type data = { job_id: String, job_url: String } + + class Data < FinchAPI::BaseModel + attr_accessor job_id: String + + attr_accessor job_url: String + + def initialize: + (job_id: String, job_url: String) -> void + | ( + ?FinchAPI::Models::JobCompletionEvent::data + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::JobCompletionEvent::data + end + + type event_type = + :"job.benefit_create.completed" + | :"job.benefit_enroll.completed" + | :"job.benefit_register.completed" + | :"job.benefit_unenroll.completed" + | :"job.benefit_update.completed" + | :"job.data_sync_all.completed" + + class EventType < FinchAPI::Enum + JOB_BENEFIT_CREATE_COMPLETED: :"job.benefit_create.completed" + JOB_BENEFIT_ENROLL_COMPLETED: :"job.benefit_enroll.completed" + JOB_BENEFIT_REGISTER_COMPLETED: :"job.benefit_register.completed" + JOB_BENEFIT_UNENROLL_COMPLETED: :"job.benefit_unenroll.completed" + JOB_BENEFIT_UPDATE_COMPLETED: :"job.benefit_update.completed" + JOB_DATA_SYNC_ALL_COMPLETED: :"job.data_sync_all.completed" + + def self.values: -> ::Array[FinchAPI::Models::JobCompletionEvent::event_type] + end + end + end +end diff --git a/sig/finch-api/models/jobs/automated_async_job.rbs b/sig/finch-api/models/jobs/automated_async_job.rbs new file mode 100644 index 00000000..f43c9400 --- /dev/null +++ b/sig/finch-api/models/jobs/automated_async_job.rbs @@ -0,0 +1,102 @@ +module FinchAPI + module Models + module Jobs + type automated_async_job = + { + completed_at: Time?, + created_at: Time, + job_id: String, + job_url: String, + params: FinchAPI::Models::Jobs::AutomatedAsyncJob::Params?, + scheduled_at: Time?, + started_at: Time?, + status: FinchAPI::Models::Jobs::AutomatedAsyncJob::status, + type: FinchAPI::Models::Jobs::AutomatedAsyncJob::type_ + } + + class AutomatedAsyncJob < FinchAPI::BaseModel + attr_accessor completed_at: Time? + + attr_accessor created_at: Time + + attr_accessor job_id: String + + attr_accessor job_url: String + + attr_accessor params: FinchAPI::Models::Jobs::AutomatedAsyncJob::Params? + + attr_accessor scheduled_at: Time? + + attr_accessor started_at: Time? + + attr_accessor status: FinchAPI::Models::Jobs::AutomatedAsyncJob::status + + attr_accessor type: FinchAPI::Models::Jobs::AutomatedAsyncJob::type_ + + def initialize: + ( + completed_at: Time?, + created_at: Time, + job_id: String, + job_url: String, + params: FinchAPI::Models::Jobs::AutomatedAsyncJob::Params?, + scheduled_at: Time?, + started_at: Time?, + status: FinchAPI::Models::Jobs::AutomatedAsyncJob::status, + type: FinchAPI::Models::Jobs::AutomatedAsyncJob::type_ + ) -> void + | ( + ?FinchAPI::Models::Jobs::automated_async_job + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Jobs::automated_async_job + + type params = { individual_id: String } + + class Params < FinchAPI::BaseModel + attr_reader individual_id: String? + + def individual_id=: (String) -> String + + def initialize: + (individual_id: String) -> void + | ( + ?FinchAPI::Models::Jobs::AutomatedAsyncJob::params + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Jobs::AutomatedAsyncJob::params + end + + type status = + :pending + | :in_progress + | :complete + | :error + | :reauth_error + | :permissions_error + + class Status < FinchAPI::Enum + PENDING: :pending + IN_PROGRESS: :in_progress + COMPLETE: :complete + ERROR: :error + REAUTH_ERROR: :reauth_error + PERMISSIONS_ERROR: :permissions_error + + def self.values: -> ::Array[FinchAPI::Models::Jobs::AutomatedAsyncJob::status] + end + + type type_ = :data_sync_all | :w4_form_employee_sync + + class Type < FinchAPI::Enum + DATA_SYNC_ALL: :data_sync_all + W4_FORM_EMPLOYEE_SYNC: :w4_form_employee_sync + + def self.values: -> ::Array[FinchAPI::Models::Jobs::AutomatedAsyncJob::type_] + end + end + end + end +end diff --git a/sig/finch-api/models/jobs/automated_create_params.rbs b/sig/finch-api/models/jobs/automated_create_params.rbs new file mode 100644 index 00000000..9ffa5248 --- /dev/null +++ b/sig/finch-api/models/jobs/automated_create_params.rbs @@ -0,0 +1,57 @@ +module FinchAPI + module Models + module Jobs + type automated_create_params = + { + type: FinchAPI::Models::Jobs::AutomatedCreateParams::type_, + params: FinchAPI::Models::Jobs::AutomatedCreateParams::Params + } + & FinchAPI::request_parameters + + class AutomatedCreateParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + attr_accessor type: FinchAPI::Models::Jobs::AutomatedCreateParams::type_ + + attr_accessor params: FinchAPI::Models::Jobs::AutomatedCreateParams::Params + + def initialize: + ( + type: FinchAPI::Models::Jobs::AutomatedCreateParams::type_, + params: FinchAPI::Models::Jobs::AutomatedCreateParams::Params, + request_options: FinchAPI::request_opts + ) -> void + | ( + ?FinchAPI::Models::Jobs::automated_create_params + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Jobs::automated_create_params + + type type_ = :w4_form_employee_sync + + class Type < FinchAPI::Enum + W4_FORM_EMPLOYEE_SYNC: :w4_form_employee_sync + + def self.values: -> ::Array[FinchAPI::Models::Jobs::AutomatedCreateParams::type_] + end + + type params = { individual_id: String } + + class Params < FinchAPI::BaseModel + attr_accessor individual_id: String + + def initialize: + (individual_id: String) -> void + | ( + ?FinchAPI::Models::Jobs::AutomatedCreateParams::params + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Jobs::AutomatedCreateParams::params + end + end + end + end +end diff --git a/sig/finch-api/models/jobs/automated_create_response.rbs b/sig/finch-api/models/jobs/automated_create_response.rbs new file mode 100644 index 00000000..6f49847f --- /dev/null +++ b/sig/finch-api/models/jobs/automated_create_response.rbs @@ -0,0 +1,37 @@ +module FinchAPI + module Models + module Jobs + type automated_create_response = + { + allowed_refreshes: Integer, + job_id: String, + job_url: String, + remaining_refreshes: Integer + } + + class AutomatedCreateResponse < FinchAPI::BaseModel + attr_accessor allowed_refreshes: Integer + + attr_accessor job_id: String + + attr_accessor job_url: String + + attr_accessor remaining_refreshes: Integer + + def initialize: + ( + allowed_refreshes: Integer, + job_id: String, + job_url: String, + remaining_refreshes: Integer + ) -> void + | ( + ?FinchAPI::Models::Jobs::automated_create_response + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Jobs::automated_create_response + end + end + end +end diff --git a/sig/finch-api/models/jobs/automated_list_params.rbs b/sig/finch-api/models/jobs/automated_list_params.rbs new file mode 100644 index 00000000..539995b5 --- /dev/null +++ b/sig/finch-api/models/jobs/automated_list_params.rbs @@ -0,0 +1,34 @@ +module FinchAPI + module Models + module Jobs + type automated_list_params = + { limit: Integer, offset: Integer } & FinchAPI::request_parameters + + class AutomatedListParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + attr_reader limit: Integer? + + def limit=: (Integer) -> Integer + + attr_reader offset: Integer? + + def offset=: (Integer) -> Integer + + def initialize: + ( + limit: Integer, + offset: Integer, + request_options: FinchAPI::request_opts + ) -> void + | ( + ?FinchAPI::Models::Jobs::automated_list_params + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Jobs::automated_list_params + end + end + end +end diff --git a/sig/finch-api/models/jobs/automated_retrieve_params.rbs b/sig/finch-api/models/jobs/automated_retrieve_params.rbs new file mode 100644 index 00000000..0f4a887c --- /dev/null +++ b/sig/finch-api/models/jobs/automated_retrieve_params.rbs @@ -0,0 +1,21 @@ +module FinchAPI + module Models + module Jobs + type automated_retrieve_params = { } & FinchAPI::request_parameters + + class AutomatedRetrieveParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + def initialize: + (request_options: FinchAPI::request_opts) -> void + | ( + ?FinchAPI::Models::Jobs::automated_retrieve_params + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Jobs::automated_retrieve_params + end + end + end +end diff --git a/sig/finch-api/models/jobs/manual_async_job.rbs b/sig/finch-api/models/jobs/manual_async_job.rbs new file mode 100644 index 00000000..f34b7368 --- /dev/null +++ b/sig/finch-api/models/jobs/manual_async_job.rbs @@ -0,0 +1,43 @@ +module FinchAPI + module Models + module Jobs + type manual_async_job = + { + body: ::Array[top]?, + job_id: String, + status: FinchAPI::Models::Jobs::ManualAsyncJob::status + } + + class ManualAsyncJob < FinchAPI::BaseModel + attr_accessor body: ::Array[top]? + + attr_accessor job_id: String + + attr_accessor status: FinchAPI::Models::Jobs::ManualAsyncJob::status + + def initialize: + ( + body: ::Array[top]?, + job_id: String, + status: FinchAPI::Models::Jobs::ManualAsyncJob::status + ) -> void + | ( + ?FinchAPI::Models::Jobs::manual_async_job | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Jobs::manual_async_job + + type status = :pending | :in_progress | :error | :complete + + class Status < FinchAPI::Enum + PENDING: :pending + IN_PROGRESS: :in_progress + ERROR: :error + COMPLETE: :complete + + def self.values: -> ::Array[FinchAPI::Models::Jobs::ManualAsyncJob::status] + end + end + end + end +end diff --git a/sig/finch-api/models/jobs/manual_retrieve_params.rbs b/sig/finch-api/models/jobs/manual_retrieve_params.rbs new file mode 100644 index 00000000..83f56492 --- /dev/null +++ b/sig/finch-api/models/jobs/manual_retrieve_params.rbs @@ -0,0 +1,21 @@ +module FinchAPI + module Models + module Jobs + type manual_retrieve_params = { } & FinchAPI::request_parameters + + class ManualRetrieveParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + def initialize: + (request_options: FinchAPI::request_opts) -> void + | ( + ?FinchAPI::Models::Jobs::manual_retrieve_params + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Jobs::manual_retrieve_params + end + end + end +end diff --git a/sig/finch-api/models/location.rbs b/sig/finch-api/models/location.rbs new file mode 100644 index 00000000..861e5e81 --- /dev/null +++ b/sig/finch-api/models/location.rbs @@ -0,0 +1,48 @@ +module FinchAPI + module Models + type location = + { + city: String?, + country: String?, + :line1 => String?, + :line2 => String?, + name: String?, + postal_code: String?, + source_id: String?, + state: String? + } + + class Location < FinchAPI::BaseModel + attr_accessor city: String? + + attr_accessor country: String? + + attr_accessor line1: String? + + attr_accessor line2: String? + + attr_accessor name: String? + + attr_accessor postal_code: String? + + attr_accessor source_id: String? + + attr_accessor state: String? + + def initialize: + ( + city: String?, + country: String?, + line1: String?, + line2: String?, + name: String?, + postal_code: String?, + source_id: String?, + state: String? + ) -> void + | (?FinchAPI::Models::location | FinchAPI::BaseModel data) -> void + + def to_hash: -> FinchAPI::Models::location + end + end +end diff --git a/sig/finch-api/models/money.rbs b/sig/finch-api/models/money.rbs new file mode 100644 index 00000000..93ba9be1 --- /dev/null +++ b/sig/finch-api/models/money.rbs @@ -0,0 +1,19 @@ +module FinchAPI + module Models + type money = { amount: Integer?, currency: String } + + class Money < FinchAPI::BaseModel + attr_accessor amount: Integer? + + attr_reader currency: String? + + def currency=: (String) -> String + + def initialize: + (amount: Integer?, currency: String) -> void + | (?FinchAPI::Models::money | FinchAPI::BaseModel data) -> void + + def to_hash: -> FinchAPI::Models::money + end + end +end diff --git a/sig/finch-api/models/operation_support.rbs b/sig/finch-api/models/operation_support.rbs new file mode 100644 index 00000000..29596ac6 --- /dev/null +++ b/sig/finch-api/models/operation_support.rbs @@ -0,0 +1,18 @@ +module FinchAPI + module Models + type operation_support = + :supported + | :not_supported_by_finch + | :not_supported_by_provider + | :client_access_only + + class OperationSupport < FinchAPI::Enum + SUPPORTED: :supported + NOT_SUPPORTED_BY_FINCH: :not_supported_by_finch + NOT_SUPPORTED_BY_PROVIDER: :not_supported_by_provider + CLIENT_ACCESS_ONLY: :client_access_only + + def self.values: -> ::Array[FinchAPI::Models::operation_support] + end + end +end diff --git a/sig/finch-api/models/operation_support_matrix.rbs b/sig/finch-api/models/operation_support_matrix.rbs new file mode 100644 index 00000000..4de3319e --- /dev/null +++ b/sig/finch-api/models/operation_support_matrix.rbs @@ -0,0 +1,50 @@ +module FinchAPI + module Models + type operation_support_matrix = + { + create: FinchAPI::Models::operation_support, + delete: FinchAPI::Models::operation_support, + read: FinchAPI::Models::operation_support, + update: FinchAPI::Models::operation_support + } + + class OperationSupportMatrix < FinchAPI::BaseModel + attr_reader create: FinchAPI::Models::operation_support? + + def create=: ( + FinchAPI::Models::operation_support + ) -> FinchAPI::Models::operation_support + + attr_reader delete: FinchAPI::Models::operation_support? + + def delete=: ( + FinchAPI::Models::operation_support + ) -> FinchAPI::Models::operation_support + + attr_reader read: FinchAPI::Models::operation_support? + + def read=: ( + FinchAPI::Models::operation_support + ) -> FinchAPI::Models::operation_support + + attr_reader update: FinchAPI::Models::operation_support? + + def update=: ( + FinchAPI::Models::operation_support + ) -> FinchAPI::Models::operation_support + + def initialize: + ( + create: FinchAPI::Models::operation_support, + delete: FinchAPI::Models::operation_support, + read: FinchAPI::Models::operation_support, + update: FinchAPI::Models::operation_support + ) -> void + | ( + ?FinchAPI::Models::operation_support_matrix | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::operation_support_matrix + end + end +end diff --git a/sig/finch-api/models/paging.rbs b/sig/finch-api/models/paging.rbs new file mode 100644 index 00000000..39a39337 --- /dev/null +++ b/sig/finch-api/models/paging.rbs @@ -0,0 +1,21 @@ +module FinchAPI + module Models + type paging = { count: Integer, offset: Integer } + + class Paging < FinchAPI::BaseModel + attr_reader count: Integer? + + def count=: (Integer) -> Integer + + attr_reader offset: Integer? + + def offset=: (Integer) -> Integer + + def initialize: + (count: Integer, offset: Integer) -> void + | (?FinchAPI::Models::paging | FinchAPI::BaseModel data) -> void + + def to_hash: -> FinchAPI::Models::paging + end + end +end diff --git a/sig/finch-api/models/pay_statement_event.rbs b/sig/finch-api/models/pay_statement_event.rbs new file mode 100644 index 00000000..d63c7ee0 --- /dev/null +++ b/sig/finch-api/models/pay_statement_event.rbs @@ -0,0 +1,68 @@ +module FinchAPI + module Models + type pay_statement_event = + { + data: FinchAPI::Models::PayStatementEvent::Data, + event_type: FinchAPI::Models::PayStatementEvent::event_type + } + + class PayStatementEvent < FinchAPI::Models::BaseWebhookEvent + attr_reader data: FinchAPI::Models::PayStatementEvent::Data? + + def data=: ( + FinchAPI::Models::PayStatementEvent::Data + ) -> FinchAPI::Models::PayStatementEvent::Data + + attr_reader event_type: FinchAPI::Models::PayStatementEvent::event_type? + + def event_type=: ( + FinchAPI::Models::PayStatementEvent::event_type + ) -> FinchAPI::Models::PayStatementEvent::event_type + + def initialize: + ( + data: FinchAPI::Models::PayStatementEvent::Data, + event_type: FinchAPI::Models::PayStatementEvent::event_type + ) -> void + | ( + ?FinchAPI::Models::pay_statement_event | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::pay_statement_event + + type data = { individual_id: String, payment_id: String } + + class Data < FinchAPI::BaseModel + attr_reader individual_id: String? + + def individual_id=: (String) -> String + + attr_reader payment_id: String? + + def payment_id=: (String) -> String + + def initialize: + (individual_id: String, payment_id: String) -> void + | ( + ?FinchAPI::Models::PayStatementEvent::data + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::PayStatementEvent::data + end + + type event_type = + :"pay_statement.created" + | :"pay_statement.updated" + | :"pay_statement.deleted" + + class EventType < FinchAPI::Enum + PAY_STATEMENT_CREATED: :"pay_statement.created" + PAY_STATEMENT_UPDATED: :"pay_statement.updated" + PAY_STATEMENT_DELETED: :"pay_statement.deleted" + + def self.values: -> ::Array[FinchAPI::Models::PayStatementEvent::event_type] + end + end + end +end diff --git a/sig/finch-api/models/payment_event.rbs b/sig/finch-api/models/payment_event.rbs new file mode 100644 index 00000000..cd15675a --- /dev/null +++ b/sig/finch-api/models/payment_event.rbs @@ -0,0 +1,59 @@ +module FinchAPI + module Models + type payment_event = + { + data: FinchAPI::Models::PaymentEvent::Data, + event_type: FinchAPI::Models::PaymentEvent::event_type + } + + class PaymentEvent < FinchAPI::Models::BaseWebhookEvent + attr_reader data: FinchAPI::Models::PaymentEvent::Data? + + def data=: ( + FinchAPI::Models::PaymentEvent::Data + ) -> FinchAPI::Models::PaymentEvent::Data + + attr_reader event_type: FinchAPI::Models::PaymentEvent::event_type? + + def event_type=: ( + FinchAPI::Models::PaymentEvent::event_type + ) -> FinchAPI::Models::PaymentEvent::event_type + + def initialize: + ( + data: FinchAPI::Models::PaymentEvent::Data, + event_type: FinchAPI::Models::PaymentEvent::event_type + ) -> void + | (?FinchAPI::Models::payment_event | FinchAPI::BaseModel data) -> void + + def to_hash: -> FinchAPI::Models::payment_event + + type data = { pay_date: String, payment_id: String } + + class Data < FinchAPI::BaseModel + attr_accessor pay_date: String + + attr_accessor payment_id: String + + def initialize: + (pay_date: String, payment_id: String) -> void + | ( + ?FinchAPI::Models::PaymentEvent::data | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::PaymentEvent::data + end + + type event_type = + :"payment.created" | :"payment.updated" | :"payment.deleted" + + class EventType < FinchAPI::Enum + PAYMENT_CREATED: :"payment.created" + PAYMENT_UPDATED: :"payment.updated" + PAYMENT_DELETED: :"payment.deleted" + + def self.values: -> ::Array[FinchAPI::Models::PaymentEvent::event_type] + end + end + end +end diff --git a/sig/finch-api/models/payroll/pay_group_list_params.rbs b/sig/finch-api/models/payroll/pay_group_list_params.rbs new file mode 100644 index 00000000..16422c5c --- /dev/null +++ b/sig/finch-api/models/payroll/pay_group_list_params.rbs @@ -0,0 +1,35 @@ +module FinchAPI + module Models + module Payroll + type pay_group_list_params = + { individual_id: String, pay_frequencies: ::Array[String] } + & FinchAPI::request_parameters + + class PayGroupListParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + attr_reader individual_id: String? + + def individual_id=: (String) -> String + + attr_reader pay_frequencies: ::Array[String]? + + def pay_frequencies=: (::Array[String]) -> ::Array[String] + + def initialize: + ( + individual_id: String, + pay_frequencies: ::Array[String], + request_options: FinchAPI::request_opts + ) -> void + | ( + ?FinchAPI::Models::Payroll::pay_group_list_params + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Payroll::pay_group_list_params + end + end + end +end diff --git a/sig/finch-api/models/payroll/pay_group_list_response.rbs b/sig/finch-api/models/payroll/pay_group_list_response.rbs new file mode 100644 index 00000000..b05254c2 --- /dev/null +++ b/sig/finch-api/models/payroll/pay_group_list_response.rbs @@ -0,0 +1,66 @@ +module FinchAPI + module Models + module Payroll + type pay_group_list_response = + { + id: String, + name: String, + pay_frequencies: ::Array[FinchAPI::Models::Payroll::PayGroupListResponse::pay_frequency] + } + + class PayGroupListResponse < FinchAPI::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_reader name: String? + + def name=: (String) -> String + + attr_reader pay_frequencies: ::Array[FinchAPI::Models::Payroll::PayGroupListResponse::pay_frequency]? + + def pay_frequencies=: ( + ::Array[FinchAPI::Models::Payroll::PayGroupListResponse::pay_frequency] + ) -> ::Array[FinchAPI::Models::Payroll::PayGroupListResponse::pay_frequency] + + def initialize: + ( + id: String, + name: String, + pay_frequencies: ::Array[FinchAPI::Models::Payroll::PayGroupListResponse::pay_frequency] + ) -> void + | ( + ?FinchAPI::Models::Payroll::pay_group_list_response + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Payroll::pay_group_list_response + + type pay_frequency = + :annually + | :semi_annually + | :quarterly + | :monthly + | :semi_monthly + | :bi_weekly + | :weekly + | :daily + | :other + + class PayFrequency < FinchAPI::Enum + ANNUALLY: :annually + SEMI_ANNUALLY: :semi_annually + QUARTERLY: :quarterly + MONTHLY: :monthly + SEMI_MONTHLY: :semi_monthly + BI_WEEKLY: :bi_weekly + WEEKLY: :weekly + DAILY: :daily + OTHER: :other + + def self.values: -> ::Array[FinchAPI::Models::Payroll::PayGroupListResponse::pay_frequency] + end + end + end + end +end diff --git a/sig/finch-api/models/payroll/pay_group_retrieve_params.rbs b/sig/finch-api/models/payroll/pay_group_retrieve_params.rbs new file mode 100644 index 00000000..73f7c953 --- /dev/null +++ b/sig/finch-api/models/payroll/pay_group_retrieve_params.rbs @@ -0,0 +1,21 @@ +module FinchAPI + module Models + module Payroll + type pay_group_retrieve_params = { } & FinchAPI::request_parameters + + class PayGroupRetrieveParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + def initialize: + (request_options: FinchAPI::request_opts) -> void + | ( + ?FinchAPI::Models::Payroll::pay_group_retrieve_params + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Payroll::pay_group_retrieve_params + end + end + end +end diff --git a/sig/finch-api/models/payroll/pay_group_retrieve_response.rbs b/sig/finch-api/models/payroll/pay_group_retrieve_response.rbs new file mode 100644 index 00000000..a044159b --- /dev/null +++ b/sig/finch-api/models/payroll/pay_group_retrieve_response.rbs @@ -0,0 +1,62 @@ +module FinchAPI + module Models + module Payroll + type pay_group_retrieve_response = + { + id: String, + individual_ids: ::Array[String], + name: String, + pay_frequencies: ::Array[FinchAPI::Models::Payroll::PayGroupRetrieveResponse::pay_frequency] + } + + class PayGroupRetrieveResponse < FinchAPI::BaseModel + attr_accessor id: String + + attr_accessor individual_ids: ::Array[String] + + attr_accessor name: String + + attr_accessor pay_frequencies: ::Array[FinchAPI::Models::Payroll::PayGroupRetrieveResponse::pay_frequency] + + def initialize: + ( + id: String, + individual_ids: ::Array[String], + name: String, + pay_frequencies: ::Array[FinchAPI::Models::Payroll::PayGroupRetrieveResponse::pay_frequency] + ) -> void + | ( + ?FinchAPI::Models::Payroll::pay_group_retrieve_response + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Payroll::pay_group_retrieve_response + + type pay_frequency = + :annually + | :semi_annually + | :quarterly + | :monthly + | :semi_monthly + | :bi_weekly + | :weekly + | :daily + | :other + + class PayFrequency < FinchAPI::Enum + ANNUALLY: :annually + SEMI_ANNUALLY: :semi_annually + QUARTERLY: :quarterly + MONTHLY: :monthly + SEMI_MONTHLY: :semi_monthly + BI_WEEKLY: :bi_weekly + WEEKLY: :weekly + DAILY: :daily + OTHER: :other + + def self.values: -> ::Array[FinchAPI::Models::Payroll::PayGroupRetrieveResponse::pay_frequency] + end + end + end + end +end diff --git a/sig/finch-api/models/provider.rbs b/sig/finch-api/models/provider.rbs new file mode 100644 index 00000000..7b923ce5 --- /dev/null +++ b/sig/finch-api/models/provider.rbs @@ -0,0 +1,1455 @@ +module FinchAPI + module Models + type provider = + { + id: String, + authentication_methods: ::Array[FinchAPI::Models::Provider::AuthenticationMethod], + beta: bool, + display_name: String, + icon: String, + logo: String, + manual: bool, + mfa_required: bool, + primary_color: String, + products: ::Array[String] + } + + class Provider < FinchAPI::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_reader authentication_methods: ::Array[FinchAPI::Models::Provider::AuthenticationMethod]? + + def authentication_methods=: ( + ::Array[FinchAPI::Models::Provider::AuthenticationMethod] + ) -> ::Array[FinchAPI::Models::Provider::AuthenticationMethod] + + attr_reader beta: bool? + + def beta=: (bool) -> bool + + attr_reader display_name: String? + + def display_name=: (String) -> String + + attr_reader icon: String? + + def icon=: (String) -> String + + attr_reader logo: String? + + def logo=: (String) -> String + + attr_reader manual: bool? + + def manual=: (bool) -> bool + + attr_reader mfa_required: bool? + + def mfa_required=: (bool) -> bool + + attr_reader primary_color: String? + + def primary_color=: (String) -> String + + attr_reader products: ::Array[String]? + + def products=: (::Array[String]) -> ::Array[String] + + def initialize: + ( + id: String, + authentication_methods: ::Array[FinchAPI::Models::Provider::AuthenticationMethod], + beta: bool, + display_name: String, + icon: String, + logo: String, + manual: bool, + mfa_required: bool, + primary_color: String, + products: ::Array[String] + ) -> void + | (?FinchAPI::Models::provider | FinchAPI::BaseModel data) -> void + + def to_hash: -> FinchAPI::Models::provider + + type authentication_method = + { + benefits_support: FinchAPI::Models::HRIS::BenefitsSupport?, + supported_fields: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields?, + type: FinchAPI::Models::Provider::AuthenticationMethod::type_ + } + + class AuthenticationMethod < FinchAPI::BaseModel + attr_accessor benefits_support: FinchAPI::Models::HRIS::BenefitsSupport? + + attr_accessor supported_fields: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields? + + attr_reader type: FinchAPI::Models::Provider::AuthenticationMethod::type_? + + def type=: ( + FinchAPI::Models::Provider::AuthenticationMethod::type_ + ) -> FinchAPI::Models::Provider::AuthenticationMethod::type_ + + def initialize: + ( + benefits_support: FinchAPI::Models::HRIS::BenefitsSupport?, + supported_fields: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields?, + type: FinchAPI::Models::Provider::AuthenticationMethod::type_ + ) -> void + | ( + ?FinchAPI::Models::Provider::authentication_method + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Provider::authentication_method + + type supported_fields = + { + company: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company, + directory: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory, + employment: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment, + individual: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual, + pay_group: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayGroup, + pay_statement: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement, + payment: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment + } + + class SupportedFields < FinchAPI::BaseModel + attr_reader company: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company? + + def company=: ( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company + ) -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company + + attr_reader directory: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory? + + def directory=: ( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory + ) -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory + + attr_reader employment: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment? + + def employment=: ( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment + ) -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment + + attr_reader individual: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual? + + def individual=: ( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual + ) -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual + + attr_reader pay_group: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayGroup? + + def pay_group=: ( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayGroup + ) -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayGroup + + attr_reader pay_statement: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement? + + def pay_statement=: ( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement + ) -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement + + attr_reader payment: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment? + + def payment=: ( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment + ) -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment + + def initialize: + ( + company: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company, + directory: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory, + employment: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment, + individual: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual, + pay_group: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayGroup, + pay_statement: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement, + payment: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment + ) -> void + | ( + ?FinchAPI::Models::Provider::AuthenticationMethod::supported_fields + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::supported_fields + + type company = + { + id: bool, + accounts: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Accounts, + departments: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments, + ein: bool, + entity: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Entity, + legal_name: bool, + locations: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Locations, + primary_email: bool, + primary_phone_number: bool + } + + class Company < FinchAPI::BaseModel + attr_reader id: bool? + + def id=: (bool) -> bool + + attr_reader accounts: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Accounts? + + def accounts=: ( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Accounts + ) -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Accounts + + attr_reader departments: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments? + + def departments=: ( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments + ) -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments + + attr_reader ein: bool? + + def ein=: (bool) -> bool + + attr_reader entity: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Entity? + + def entity=: ( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Entity + ) -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Entity + + attr_reader legal_name: bool? + + def legal_name=: (bool) -> bool + + attr_reader locations: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Locations? + + def locations=: ( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Locations + ) -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Locations + + attr_reader primary_email: bool? + + def primary_email=: (bool) -> bool + + attr_reader primary_phone_number: bool? + + def primary_phone_number=: (bool) -> bool + + def initialize: + ( + id: bool, + accounts: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Accounts, + departments: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments, + ein: bool, + entity: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Entity, + legal_name: bool, + locations: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Locations, + primary_email: bool, + primary_phone_number: bool + ) -> void + | ( + ?FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::company + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::company + + type accounts = + { + account_name: bool, + account_number: bool, + account_type: bool, + institution_name: bool, + routing_number: bool + } + + class Accounts < FinchAPI::BaseModel + attr_reader account_name: bool? + + def account_name=: (bool) -> bool + + attr_reader account_number: bool? + + def account_number=: (bool) -> bool + + attr_reader account_type: bool? + + def account_type=: (bool) -> bool + + attr_reader institution_name: bool? + + def institution_name=: (bool) -> bool + + attr_reader routing_number: bool? + + def routing_number=: (bool) -> bool + + def initialize: + ( + account_name: bool, + account_number: bool, + account_type: bool, + institution_name: bool, + routing_number: bool + ) -> void + | ( + ?FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::accounts + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::accounts + end + + type departments = + { + name: bool, + parent: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments::Parent + } + + class Departments < FinchAPI::BaseModel + attr_reader name: bool? + + def name=: (bool) -> bool + + attr_reader parent: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments::Parent? + + def parent=: ( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments::Parent + ) -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments::Parent + + def initialize: + ( + name: bool, + parent: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments::Parent + ) -> void + | ( + ?FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::departments + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::departments + + type parent = { name: bool } + + class Parent < FinchAPI::BaseModel + attr_reader name: bool? + + def name=: (bool) -> bool + + def initialize: + (name: bool) -> void + | ( + ?FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments::parent + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments::parent + end + end + + type entity = { subtype: bool, type: bool } + + class Entity < FinchAPI::BaseModel + attr_reader subtype: bool? + + def subtype=: (bool) -> bool + + attr_reader type: bool? + + def type=: (bool) -> bool + + def initialize: + (subtype: bool, type: bool) -> void + | ( + ?FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::entity + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::entity + end + + type locations = + { + city: bool, + country: bool, + :line1 => bool, + :line2 => bool, + postal_code: bool, + state: bool + } + + class Locations < FinchAPI::BaseModel + attr_reader city: bool? + + def city=: (bool) -> bool + + attr_reader country: bool? + + def country=: (bool) -> bool + + attr_reader line1: bool? + + def line1=: (bool) -> bool + + attr_reader line2: bool? + + def line2=: (bool) -> bool + + attr_reader postal_code: bool? + + def postal_code=: (bool) -> bool + + attr_reader state: bool? + + def state=: (bool) -> bool + + def initialize: + ( + city: bool, + country: bool, + line1: bool, + line2: bool, + postal_code: bool, + state: bool + ) -> void + | ( + ?FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::locations + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::locations + end + end + + type directory = + { + individuals: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals, + paging: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Paging + } + + class Directory < FinchAPI::BaseModel + attr_reader individuals: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals? + + def individuals=: ( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals + ) -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals + + attr_reader paging: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Paging? + + def paging=: ( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Paging + ) -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Paging + + def initialize: + ( + individuals: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals, + paging: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Paging + ) -> void + | ( + ?FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::directory + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::directory + + type individuals = + { + id: bool, + department: bool, + first_name: bool, + is_active: bool, + last_name: bool, + manager: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager, + middle_name: bool + } + + class Individuals < FinchAPI::BaseModel + attr_reader id: bool? + + def id=: (bool) -> bool + + attr_reader department: bool? + + def department=: (bool) -> bool + + attr_reader first_name: bool? + + def first_name=: (bool) -> bool + + attr_reader is_active: bool? + + def is_active=: (bool) -> bool + + attr_reader last_name: bool? + + def last_name=: (bool) -> bool + + attr_reader manager: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager? + + def manager=: ( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager + ) -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager + + attr_reader middle_name: bool? + + def middle_name=: (bool) -> bool + + def initialize: + ( + id: bool, + department: bool, + first_name: bool, + is_active: bool, + last_name: bool, + manager: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager, + middle_name: bool + ) -> void + | ( + ?FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::individuals + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::individuals + + type manager = { id: bool } + + class Manager < FinchAPI::BaseModel + attr_reader id: bool? + + def id=: (bool) -> bool + + def initialize: + (id: bool) -> void + | ( + ?FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals::manager + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals::manager + end + end + + type paging = { count: bool, offset: bool } + + class Paging < FinchAPI::BaseModel + attr_reader count: bool? + + def count=: (bool) -> bool + + attr_reader offset: bool? + + def offset=: (bool) -> bool + + def initialize: + (count: bool, offset: bool) -> void + | ( + ?FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::paging + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::paging + end + end + + type employment = + { + id: bool, + class_code: bool, + custom_fields: bool, + department: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Department, + employment: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Employment, + employment_status: bool, + end_date: bool, + first_name: bool, + income: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Income, + income_history: bool, + is_active: bool, + last_name: bool, + location: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Location, + manager: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Manager, + middle_name: bool, + start_date: bool, + title: bool + } + + class Employment < FinchAPI::BaseModel + attr_reader id: bool? + + def id=: (bool) -> bool + + attr_reader class_code: bool? + + def class_code=: (bool) -> bool + + attr_reader custom_fields: bool? + + def custom_fields=: (bool) -> bool + + attr_reader department: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Department? + + def department=: ( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Department + ) -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Department + + attr_reader employment: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Employment? + + def employment=: ( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Employment + ) -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Employment + + attr_reader employment_status: bool? + + def employment_status=: (bool) -> bool + + attr_reader end_date: bool? + + def end_date=: (bool) -> bool + + attr_reader first_name: bool? + + def first_name=: (bool) -> bool + + attr_reader income: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Income? + + def income=: ( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Income + ) -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Income + + attr_reader income_history: bool? + + def income_history=: (bool) -> bool + + attr_reader is_active: bool? + + def is_active=: (bool) -> bool + + attr_reader last_name: bool? + + def last_name=: (bool) -> bool + + attr_reader location: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Location? + + def location=: ( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Location + ) -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Location + + attr_reader manager: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Manager? + + def manager=: ( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Manager + ) -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Manager + + attr_reader middle_name: bool? + + def middle_name=: (bool) -> bool + + attr_reader start_date: bool? + + def start_date=: (bool) -> bool + + attr_reader title: bool? + + def title=: (bool) -> bool + + def initialize: + ( + id: bool, + class_code: bool, + custom_fields: bool, + department: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Department, + employment: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Employment, + employment_status: bool, + end_date: bool, + first_name: bool, + income: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Income, + income_history: bool, + is_active: bool, + last_name: bool, + location: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Location, + manager: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Manager, + middle_name: bool, + start_date: bool, + title: bool + ) -> void + | ( + ?FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::employment + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::employment + + type department = { name: bool } + + class Department < FinchAPI::BaseModel + attr_reader name: bool? + + def name=: (bool) -> bool + + def initialize: + (name: bool) -> void + | ( + ?FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::department + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::department + end + + type employment = { subtype: bool, type: bool } + + class Employment < FinchAPI::BaseModel + attr_reader subtype: bool? + + def subtype=: (bool) -> bool + + attr_reader type: bool? + + def type=: (bool) -> bool + + def initialize: + (subtype: bool, type: bool) -> void + | ( + ?FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::employment + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::employment + end + + type income = { amount: bool, currency: bool, unit: bool } + + class Income < FinchAPI::BaseModel + attr_reader amount: bool? + + def amount=: (bool) -> bool + + attr_reader currency: bool? + + def currency=: (bool) -> bool + + attr_reader unit: bool? + + def unit=: (bool) -> bool + + def initialize: + (amount: bool, currency: bool, unit: bool) -> void + | ( + ?FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::income + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::income + end + + type location = + { + city: bool, + country: bool, + :line1 => bool, + :line2 => bool, + postal_code: bool, + state: bool + } + + class Location < FinchAPI::BaseModel + attr_reader city: bool? + + def city=: (bool) -> bool + + attr_reader country: bool? + + def country=: (bool) -> bool + + attr_reader line1: bool? + + def line1=: (bool) -> bool + + attr_reader line2: bool? + + def line2=: (bool) -> bool + + attr_reader postal_code: bool? + + def postal_code=: (bool) -> bool + + attr_reader state: bool? + + def state=: (bool) -> bool + + def initialize: + ( + city: bool, + country: bool, + line1: bool, + line2: bool, + postal_code: bool, + state: bool + ) -> void + | ( + ?FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::location + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::location + end + + type manager = { id: bool } + + class Manager < FinchAPI::BaseModel + attr_reader id: bool? + + def id=: (bool) -> bool + + def initialize: + (id: bool) -> void + | ( + ?FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::manager + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::manager + end + end + + type individual = + { + id: bool, + dob: bool, + emails: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Emails, + encrypted_ssn: bool, + ethnicity: bool, + first_name: bool, + gender: bool, + last_name: bool, + middle_name: bool, + phone_numbers: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::PhoneNumbers, + preferred_name: bool, + residence: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Residence, + ssn: bool + } + + class Individual < FinchAPI::BaseModel + attr_reader id: bool? + + def id=: (bool) -> bool + + attr_reader dob: bool? + + def dob=: (bool) -> bool + + attr_reader emails: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Emails? + + def emails=: ( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Emails + ) -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Emails + + attr_reader encrypted_ssn: bool? + + def encrypted_ssn=: (bool) -> bool + + attr_reader ethnicity: bool? + + def ethnicity=: (bool) -> bool + + attr_reader first_name: bool? + + def first_name=: (bool) -> bool + + attr_reader gender: bool? + + def gender=: (bool) -> bool + + attr_reader last_name: bool? + + def last_name=: (bool) -> bool + + attr_reader middle_name: bool? + + def middle_name=: (bool) -> bool + + attr_reader phone_numbers: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::PhoneNumbers? + + def phone_numbers=: ( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::PhoneNumbers + ) -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::PhoneNumbers + + attr_reader preferred_name: bool? + + def preferred_name=: (bool) -> bool + + attr_reader residence: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Residence? + + def residence=: ( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Residence + ) -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Residence + + attr_reader ssn: bool? + + def ssn=: (bool) -> bool + + def initialize: + ( + id: bool, + dob: bool, + emails: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Emails, + encrypted_ssn: bool, + ethnicity: bool, + first_name: bool, + gender: bool, + last_name: bool, + middle_name: bool, + phone_numbers: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::PhoneNumbers, + preferred_name: bool, + residence: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Residence, + ssn: bool + ) -> void + | ( + ?FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::individual + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::individual + + type emails = { data: bool, type: bool } + + class Emails < FinchAPI::BaseModel + attr_reader data: bool? + + def data=: (bool) -> bool + + attr_reader type: bool? + + def type=: (bool) -> bool + + def initialize: + (data: bool, type: bool) -> void + | ( + ?FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::emails + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::emails + end + + type phone_numbers = { data: bool, type: bool } + + class PhoneNumbers < FinchAPI::BaseModel + attr_reader data: bool? + + def data=: (bool) -> bool + + attr_reader type: bool? + + def type=: (bool) -> bool + + def initialize: + (data: bool, type: bool) -> void + | ( + ?FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::phone_numbers + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::phone_numbers + end + + type residence = + { + city: bool, + country: bool, + :line1 => bool, + :line2 => bool, + postal_code: bool, + state: bool + } + + class Residence < FinchAPI::BaseModel + attr_reader city: bool? + + def city=: (bool) -> bool + + attr_reader country: bool? + + def country=: (bool) -> bool + + attr_reader line1: bool? + + def line1=: (bool) -> bool + + attr_reader line2: bool? + + def line2=: (bool) -> bool + + attr_reader postal_code: bool? + + def postal_code=: (bool) -> bool + + attr_reader state: bool? + + def state=: (bool) -> bool + + def initialize: + ( + city: bool, + country: bool, + line1: bool, + line2: bool, + postal_code: bool, + state: bool + ) -> void + | ( + ?FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::residence + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::residence + end + end + + type pay_group = + { + id: bool, + individual_ids: bool, + name: bool, + pay_frequencies: bool + } + + class PayGroup < FinchAPI::BaseModel + attr_reader id: bool? + + def id=: (bool) -> bool + + attr_reader individual_ids: bool? + + def individual_ids=: (bool) -> bool + + attr_reader name: bool? + + def name=: (bool) -> bool + + attr_reader pay_frequencies: bool? + + def pay_frequencies=: (bool) -> bool + + def initialize: + ( + id: bool, + individual_ids: bool, + name: bool, + pay_frequencies: bool + ) -> void + | ( + ?FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::pay_group + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::pay_group + end + + type pay_statement = + { + paging: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::Paging, + pay_statements: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements + } + + class PayStatement < FinchAPI::BaseModel + attr_reader paging: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::Paging? + + def paging=: ( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::Paging + ) -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::Paging + + attr_reader pay_statements: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements? + + def pay_statements=: ( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements + ) -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements + + def initialize: + ( + paging: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::Paging, + pay_statements: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements + ) -> void + | ( + ?FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::pay_statement + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::pay_statement + + type paging = { count: bool, offset: bool } + + class Paging < FinchAPI::BaseModel + attr_accessor count: bool + + attr_accessor offset: bool + + def initialize: + (count: bool, offset: bool) -> void + | ( + ?FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::paging + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::paging + end + + type pay_statements = + { + earnings: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings, + employee_deductions: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployeeDeductions, + employer_contributions: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployerContributions, + gross_pay: bool, + individual_id: bool, + net_pay: bool, + payment_method: bool, + taxes: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Taxes, + total_hours: bool, + type: bool + } + + class PayStatements < FinchAPI::BaseModel + attr_reader earnings: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings? + + def earnings=: ( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings + ) -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings + + attr_reader employee_deductions: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployeeDeductions? + + def employee_deductions=: ( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployeeDeductions + ) -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployeeDeductions + + attr_reader employer_contributions: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployerContributions? + + def employer_contributions=: ( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployerContributions + ) -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployerContributions + + attr_reader gross_pay: bool? + + def gross_pay=: (bool) -> bool + + attr_reader individual_id: bool? + + def individual_id=: (bool) -> bool + + attr_reader net_pay: bool? + + def net_pay=: (bool) -> bool + + attr_reader payment_method: bool? + + def payment_method=: (bool) -> bool + + attr_reader taxes: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Taxes? + + def taxes=: ( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Taxes + ) -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Taxes + + attr_reader total_hours: bool? + + def total_hours=: (bool) -> bool + + attr_reader type: bool? + + def type=: (bool) -> bool + + def initialize: + ( + earnings: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings, + employee_deductions: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployeeDeductions, + employer_contributions: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployerContributions, + gross_pay: bool, + individual_id: bool, + net_pay: bool, + payment_method: bool, + taxes: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Taxes, + total_hours: bool, + type: bool + ) -> void + | ( + ?FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::pay_statements + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::pay_statements + + type earnings = + { amount: bool, currency: bool, name: bool, type: bool } + + class Earnings < FinchAPI::BaseModel + attr_reader amount: bool? + + def amount=: (bool) -> bool + + attr_reader currency: bool? + + def currency=: (bool) -> bool + + attr_reader name: bool? + + def name=: (bool) -> bool + + attr_reader type: bool? + + def type=: (bool) -> bool + + def initialize: + (amount: bool, currency: bool, name: bool, type: bool) -> void + | ( + ?FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::earnings + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::earnings + end + + type employee_deductions = + { + amount: bool, + currency: bool, + name: bool, + pre_tax: bool, + type: bool + } + + class EmployeeDeductions < FinchAPI::BaseModel + attr_reader amount: bool? + + def amount=: (bool) -> bool + + attr_reader currency: bool? + + def currency=: (bool) -> bool + + attr_reader name: bool? + + def name=: (bool) -> bool + + attr_reader pre_tax: bool? + + def pre_tax=: (bool) -> bool + + attr_reader type: bool? + + def type=: (bool) -> bool + + def initialize: + ( + amount: bool, + currency: bool, + name: bool, + pre_tax: bool, + type: bool + ) -> void + | ( + ?FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::employee_deductions + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::employee_deductions + end + + type employer_contributions = + { amount: bool, currency: bool, name: bool } + + class EmployerContributions < FinchAPI::BaseModel + attr_reader amount: bool? + + def amount=: (bool) -> bool + + attr_reader currency: bool? + + def currency=: (bool) -> bool + + attr_reader name: bool? + + def name=: (bool) -> bool + + def initialize: + (amount: bool, currency: bool, name: bool) -> void + | ( + ?FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::employer_contributions + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::employer_contributions + end + + type taxes = + { + amount: bool, + currency: bool, + employer: bool, + name: bool, + type: bool + } + + class Taxes < FinchAPI::BaseModel + attr_reader amount: bool? + + def amount=: (bool) -> bool + + attr_reader currency: bool? + + def currency=: (bool) -> bool + + attr_reader employer: bool? + + def employer=: (bool) -> bool + + attr_reader name: bool? + + def name=: (bool) -> bool + + attr_reader type: bool? + + def type=: (bool) -> bool + + def initialize: + ( + amount: bool, + currency: bool, + employer: bool, + name: bool, + type: bool + ) -> void + | ( + ?FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::taxes + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::taxes + end + end + end + + type payment = + { + id: bool, + company_debit: bool, + debit_date: bool, + employee_taxes: bool, + employer_taxes: bool, + gross_pay: bool, + individual_ids: bool, + net_pay: bool, + pay_date: bool, + pay_frequencies: bool, + pay_group_ids: bool, + pay_period: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment::PayPeriod + } + + class Payment < FinchAPI::BaseModel + attr_reader id: bool? + + def id=: (bool) -> bool + + attr_reader company_debit: bool? + + def company_debit=: (bool) -> bool + + attr_reader debit_date: bool? + + def debit_date=: (bool) -> bool + + attr_reader employee_taxes: bool? + + def employee_taxes=: (bool) -> bool + + attr_reader employer_taxes: bool? + + def employer_taxes=: (bool) -> bool + + attr_reader gross_pay: bool? + + def gross_pay=: (bool) -> bool + + attr_reader individual_ids: bool? + + def individual_ids=: (bool) -> bool + + attr_reader net_pay: bool? + + def net_pay=: (bool) -> bool + + attr_reader pay_date: bool? + + def pay_date=: (bool) -> bool + + attr_reader pay_frequencies: bool? + + def pay_frequencies=: (bool) -> bool + + attr_reader pay_group_ids: bool? + + def pay_group_ids=: (bool) -> bool + + attr_reader pay_period: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment::PayPeriod? + + def pay_period=: ( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment::PayPeriod + ) -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment::PayPeriod + + def initialize: + ( + id: bool, + company_debit: bool, + debit_date: bool, + employee_taxes: bool, + employer_taxes: bool, + gross_pay: bool, + individual_ids: bool, + net_pay: bool, + pay_date: bool, + pay_frequencies: bool, + pay_group_ids: bool, + pay_period: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment::PayPeriod + ) -> void + | ( + ?FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::payment + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::payment + + type pay_period = { end_date: bool, start_date: bool } + + class PayPeriod < FinchAPI::BaseModel + attr_reader end_date: bool? + + def end_date=: (bool) -> bool + + attr_reader start_date: bool? + + def start_date=: (bool) -> bool + + def initialize: + (end_date: bool, start_date: bool) -> void + | ( + ?FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment::pay_period + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment::pay_period + end + end + end + + type type_ = + :assisted | :credential | :api_token | :api_credential | :oauth + + class Type < FinchAPI::Enum + ASSISTED: :assisted + CREDENTIAL: :credential + API_TOKEN: :api_token + API_CREDENTIAL: :api_credential + OAUTH: :oauth + + def self.values: -> ::Array[FinchAPI::Models::Provider::AuthenticationMethod::type_] + end + end + end + end +end diff --git a/sig/finch-api/models/provider_list_params.rbs b/sig/finch-api/models/provider_list_params.rbs new file mode 100644 index 00000000..13195874 --- /dev/null +++ b/sig/finch-api/models/provider_list_params.rbs @@ -0,0 +1,18 @@ +module FinchAPI + module Models + type provider_list_params = { } & FinchAPI::request_parameters + + class ProviderListParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + def initialize: + (request_options: FinchAPI::request_opts) -> void + | ( + ?FinchAPI::Models::provider_list_params | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::provider_list_params + end + end +end diff --git a/sig/finch-api/models/request_forwarding_forward_params.rbs b/sig/finch-api/models/request_forwarding_forward_params.rbs new file mode 100644 index 00000000..22f59027 --- /dev/null +++ b/sig/finch-api/models/request_forwarding_forward_params.rbs @@ -0,0 +1,44 @@ +module FinchAPI + module Models + type request_forwarding_forward_params = + { + method_: String, + route: String, + data: String?, + headers: top?, + params: top? + } + & FinchAPI::request_parameters + + class RequestForwardingForwardParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + attr_accessor method_: String + + attr_accessor route: String + + attr_accessor data: String? + + attr_accessor headers: top? + + attr_accessor params: top? + + def initialize: + ( + method_: String, + route: String, + data: String?, + headers: top?, + params: top?, + request_options: FinchAPI::request_opts + ) -> void + | ( + ?FinchAPI::Models::request_forwarding_forward_params + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::request_forwarding_forward_params + end + end +end diff --git a/sig/finch-api/models/request_forwarding_forward_response.rbs b/sig/finch-api/models/request_forwarding_forward_response.rbs new file mode 100644 index 00000000..3e822ec2 --- /dev/null +++ b/sig/finch-api/models/request_forwarding_forward_response.rbs @@ -0,0 +1,71 @@ +module FinchAPI + module Models + type request_forwarding_forward_response = + { + data: String?, + headers: top?, + request: FinchAPI::Models::RequestForwardingForwardResponse::Request, + status_code: Integer + } + + class RequestForwardingForwardResponse < FinchAPI::BaseModel + attr_accessor data: String? + + attr_accessor headers: top? + + attr_accessor request: FinchAPI::Models::RequestForwardingForwardResponse::Request + + attr_accessor status_code: Integer + + def initialize: + ( + data: String?, + headers: top?, + request: FinchAPI::Models::RequestForwardingForwardResponse::Request, + status_code: Integer + ) -> void + | ( + ?FinchAPI::Models::request_forwarding_forward_response + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::request_forwarding_forward_response + + type request = + { + data: String?, + headers: top?, + method_: String, + params: top?, + route: String + } + + class Request < FinchAPI::BaseModel + attr_accessor data: String? + + attr_accessor headers: top? + + attr_accessor method_: String + + attr_accessor params: top? + + attr_accessor route: String + + def initialize: + ( + data: String?, + headers: top?, + method_: String, + params: top?, + route: String + ) -> void + | ( + ?FinchAPI::Models::RequestForwardingForwardResponse::request + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::RequestForwardingForwardResponse::request + end + end + end +end diff --git a/sig/finch-api/models/sandbox/company_update_params.rbs b/sig/finch-api/models/sandbox/company_update_params.rbs new file mode 100644 index 00000000..4e1fbf00 --- /dev/null +++ b/sig/finch-api/models/sandbox/company_update_params.rbs @@ -0,0 +1,197 @@ +module FinchAPI + module Models + module Sandbox + type company_update_params = + { + accounts: ::Array[FinchAPI::Models::Sandbox::CompanyUpdateParams::Account]?, + departments: ::Array[FinchAPI::Models::Sandbox::CompanyUpdateParams::Department?]?, + ein: String?, + entity: FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity?, + legal_name: String?, + locations: ::Array[FinchAPI::Models::Location?]?, + primary_email: String?, + primary_phone_number: String? + } + & FinchAPI::request_parameters + + class CompanyUpdateParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + attr_accessor accounts: ::Array[FinchAPI::Models::Sandbox::CompanyUpdateParams::Account]? + + attr_accessor departments: ::Array[FinchAPI::Models::Sandbox::CompanyUpdateParams::Department?]? + + attr_accessor ein: String? + + attr_accessor entity: FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity? + + attr_accessor legal_name: String? + + attr_accessor locations: ::Array[FinchAPI::Models::Location?]? + + attr_accessor primary_email: String? + + attr_accessor primary_phone_number: String? + + def initialize: + ( + accounts: ::Array[FinchAPI::Models::Sandbox::CompanyUpdateParams::Account]?, + departments: ::Array[FinchAPI::Models::Sandbox::CompanyUpdateParams::Department?]?, + ein: String?, + entity: FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity?, + legal_name: String?, + locations: ::Array[FinchAPI::Models::Location?]?, + primary_email: String?, + primary_phone_number: String?, + request_options: FinchAPI::request_opts + ) -> void + | ( + ?FinchAPI::Models::Sandbox::company_update_params + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::company_update_params + + type account = + { + account_name: String?, + account_number: String?, + account_type: FinchAPI::Models::Sandbox::CompanyUpdateParams::Account::account_type?, + institution_name: String?, + routing_number: String? + } + + class Account < FinchAPI::BaseModel + attr_accessor account_name: String? + + attr_accessor account_number: String? + + attr_accessor account_type: FinchAPI::Models::Sandbox::CompanyUpdateParams::Account::account_type? + + attr_accessor institution_name: String? + + attr_accessor routing_number: String? + + def initialize: + ( + account_name: String?, + account_number: String?, + account_type: FinchAPI::Models::Sandbox::CompanyUpdateParams::Account::account_type?, + institution_name: String?, + routing_number: String? + ) -> void + | ( + ?FinchAPI::Models::Sandbox::CompanyUpdateParams::account + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::CompanyUpdateParams::account + + type account_type = :checking | :savings + + class AccountType < FinchAPI::Enum + CHECKING: :checking + SAVINGS: :savings + + def self.values: -> ::Array[FinchAPI::Models::Sandbox::CompanyUpdateParams::Account::account_type] + end + end + + type department = + { + name: String?, + parent: FinchAPI::Models::Sandbox::CompanyUpdateParams::Department::Parent? + } + + class Department < FinchAPI::BaseModel + attr_accessor name: String? + + attr_accessor parent: FinchAPI::Models::Sandbox::CompanyUpdateParams::Department::Parent? + + def initialize: + ( + name: String?, + parent: FinchAPI::Models::Sandbox::CompanyUpdateParams::Department::Parent? + ) -> void + | ( + ?FinchAPI::Models::Sandbox::CompanyUpdateParams::department + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::CompanyUpdateParams::department + + type parent = { name: String? } + + class Parent < FinchAPI::BaseModel + attr_accessor name: String? + + def initialize: + (name: String?) -> void + | ( + ?FinchAPI::Models::Sandbox::CompanyUpdateParams::Department::parent + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::CompanyUpdateParams::Department::parent + end + end + + type entity = + { + subtype: FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::subtype?, + type: FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::type_? + } + + class Entity < FinchAPI::BaseModel + attr_accessor subtype: FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::subtype? + + attr_accessor type: FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::type_? + + def initialize: + ( + subtype: FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::subtype?, + type: FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::type_? + ) -> void + | ( + ?FinchAPI::Models::Sandbox::CompanyUpdateParams::entity + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::CompanyUpdateParams::entity + + type subtype = :s_corporation | :c_corporation | :b_corporation + + class Subtype < FinchAPI::Enum + S_CORPORATION: :s_corporation + C_CORPORATION: :c_corporation + B_CORPORATION: :b_corporation + + def self.values: -> ::Array[FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::subtype] + end + + type type_ = + :llc + | :lp + | :corporation + | :sole_proprietor + | :non_profit + | :partnership + | :cooperative + + class Type < FinchAPI::Enum + LLC: :llc + LP: :lp + CORPORATION: :corporation + SOLE_PROPRIETOR: :sole_proprietor + NON_PROFIT: :non_profit + PARTNERSHIP: :partnership + COOPERATIVE: :cooperative + + def self.values: -> ::Array[FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::type_] + end + end + end + end + end +end diff --git a/sig/finch-api/models/sandbox/company_update_response.rbs b/sig/finch-api/models/sandbox/company_update_response.rbs new file mode 100644 index 00000000..09108745 --- /dev/null +++ b/sig/finch-api/models/sandbox/company_update_response.rbs @@ -0,0 +1,192 @@ +module FinchAPI + module Models + module Sandbox + type company_update_response = + { + accounts: ::Array[FinchAPI::Models::Sandbox::CompanyUpdateResponse::Account]?, + departments: ::Array[FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department?]?, + ein: String?, + entity: FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity?, + legal_name: String?, + locations: ::Array[FinchAPI::Models::Location?]?, + primary_email: String?, + primary_phone_number: String? + } + + class CompanyUpdateResponse < FinchAPI::BaseModel + attr_accessor accounts: ::Array[FinchAPI::Models::Sandbox::CompanyUpdateResponse::Account]? + + attr_accessor departments: ::Array[FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department?]? + + attr_accessor ein: String? + + attr_accessor entity: FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity? + + attr_accessor legal_name: String? + + attr_accessor locations: ::Array[FinchAPI::Models::Location?]? + + attr_accessor primary_email: String? + + attr_accessor primary_phone_number: String? + + def initialize: + ( + accounts: ::Array[FinchAPI::Models::Sandbox::CompanyUpdateResponse::Account]?, + departments: ::Array[FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department?]?, + ein: String?, + entity: FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity?, + legal_name: String?, + locations: ::Array[FinchAPI::Models::Location?]?, + primary_email: String?, + primary_phone_number: String? + ) -> void + | ( + ?FinchAPI::Models::Sandbox::company_update_response + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::company_update_response + + type account = + { + account_name: String?, + account_number: String?, + account_type: FinchAPI::Models::Sandbox::CompanyUpdateResponse::Account::account_type?, + institution_name: String?, + routing_number: String? + } + + class Account < FinchAPI::BaseModel + attr_accessor account_name: String? + + attr_accessor account_number: String? + + attr_accessor account_type: FinchAPI::Models::Sandbox::CompanyUpdateResponse::Account::account_type? + + attr_accessor institution_name: String? + + attr_accessor routing_number: String? + + def initialize: + ( + account_name: String?, + account_number: String?, + account_type: FinchAPI::Models::Sandbox::CompanyUpdateResponse::Account::account_type?, + institution_name: String?, + routing_number: String? + ) -> void + | ( + ?FinchAPI::Models::Sandbox::CompanyUpdateResponse::account + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::CompanyUpdateResponse::account + + type account_type = :checking | :savings + + class AccountType < FinchAPI::Enum + CHECKING: :checking + SAVINGS: :savings + + def self.values: -> ::Array[FinchAPI::Models::Sandbox::CompanyUpdateResponse::Account::account_type] + end + end + + type department = + { + name: String?, + parent: FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department::Parent? + } + + class Department < FinchAPI::BaseModel + attr_accessor name: String? + + attr_accessor parent: FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department::Parent? + + def initialize: + ( + name: String?, + parent: FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department::Parent? + ) -> void + | ( + ?FinchAPI::Models::Sandbox::CompanyUpdateResponse::department + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::CompanyUpdateResponse::department + + type parent = { name: String? } + + class Parent < FinchAPI::BaseModel + attr_accessor name: String? + + def initialize: + (name: String?) -> void + | ( + ?FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department::parent + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department::parent + end + end + + type entity = + { + subtype: FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::subtype?, + type: FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::type_? + } + + class Entity < FinchAPI::BaseModel + attr_accessor subtype: FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::subtype? + + attr_accessor type: FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::type_? + + def initialize: + ( + subtype: FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::subtype?, + type: FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::type_? + ) -> void + | ( + ?FinchAPI::Models::Sandbox::CompanyUpdateResponse::entity + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::CompanyUpdateResponse::entity + + type subtype = :s_corporation | :c_corporation | :b_corporation + + class Subtype < FinchAPI::Enum + S_CORPORATION: :s_corporation + C_CORPORATION: :c_corporation + B_CORPORATION: :b_corporation + + def self.values: -> ::Array[FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::subtype] + end + + type type_ = + :llc + | :lp + | :corporation + | :sole_proprietor + | :non_profit + | :partnership + | :cooperative + + class Type < FinchAPI::Enum + LLC: :llc + LP: :lp + CORPORATION: :corporation + SOLE_PROPRIETOR: :sole_proprietor + NON_PROFIT: :non_profit + PARTNERSHIP: :partnership + COOPERATIVE: :cooperative + + def self.values: -> ::Array[FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::type_] + end + end + end + end + end +end diff --git a/sig/finch-api/models/sandbox/connection_create_params.rbs b/sig/finch-api/models/sandbox/connection_create_params.rbs new file mode 100644 index 00000000..9e0f18eb --- /dev/null +++ b/sig/finch-api/models/sandbox/connection_create_params.rbs @@ -0,0 +1,61 @@ +module FinchAPI + module Models + module Sandbox + type connection_create_params = + { + provider_id: String, + authentication_type: FinchAPI::Models::Sandbox::ConnectionCreateParams::authentication_type, + employee_size: Integer, + products: ::Array[String] + } + & FinchAPI::request_parameters + + class ConnectionCreateParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + attr_accessor provider_id: String + + attr_reader authentication_type: FinchAPI::Models::Sandbox::ConnectionCreateParams::authentication_type? + + def authentication_type=: ( + FinchAPI::Models::Sandbox::ConnectionCreateParams::authentication_type + ) -> FinchAPI::Models::Sandbox::ConnectionCreateParams::authentication_type + + attr_reader employee_size: Integer? + + def employee_size=: (Integer) -> Integer + + attr_reader products: ::Array[String]? + + def products=: (::Array[String]) -> ::Array[String] + + def initialize: + ( + provider_id: String, + authentication_type: FinchAPI::Models::Sandbox::ConnectionCreateParams::authentication_type, + employee_size: Integer, + products: ::Array[String], + request_options: FinchAPI::request_opts + ) -> void + | ( + ?FinchAPI::Models::Sandbox::connection_create_params + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::connection_create_params + + type authentication_type = :credential | :api_token | :oauth | :assisted + + class AuthenticationType < FinchAPI::Enum + CREDENTIAL: :credential + API_TOKEN: :api_token + OAUTH: :oauth + ASSISTED: :assisted + + def self.values: -> ::Array[FinchAPI::Models::Sandbox::ConnectionCreateParams::authentication_type] + end + end + end + end +end diff --git a/sig/finch-api/models/sandbox/connection_create_response.rbs b/sig/finch-api/models/sandbox/connection_create_response.rbs new file mode 100644 index 00000000..9fb7be9d --- /dev/null +++ b/sig/finch-api/models/sandbox/connection_create_response.rbs @@ -0,0 +1,66 @@ +module FinchAPI + module Models + module Sandbox + type connection_create_response = + { + access_token: String, + account_id: String, + authentication_type: FinchAPI::Models::Sandbox::ConnectionCreateResponse::authentication_type, + company_id: String, + connection_id: String, + products: ::Array[String], + provider_id: String, + token_type: String + } + + class ConnectionCreateResponse < FinchAPI::BaseModel + attr_accessor access_token: String + + attr_accessor account_id: String + + attr_accessor authentication_type: FinchAPI::Models::Sandbox::ConnectionCreateResponse::authentication_type + + attr_accessor company_id: String + + attr_accessor connection_id: String + + attr_accessor products: ::Array[String] + + attr_accessor provider_id: String + + attr_reader token_type: String? + + def token_type=: (String) -> String + + def initialize: + ( + access_token: String, + account_id: String, + authentication_type: FinchAPI::Models::Sandbox::ConnectionCreateResponse::authentication_type, + company_id: String, + connection_id: String, + products: ::Array[String], + provider_id: String, + token_type: String + ) -> void + | ( + ?FinchAPI::Models::Sandbox::connection_create_response + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::connection_create_response + + type authentication_type = :credential | :api_token | :oauth | :assisted + + class AuthenticationType < FinchAPI::Enum + CREDENTIAL: :credential + API_TOKEN: :api_token + OAUTH: :oauth + ASSISTED: :assisted + + def self.values: -> ::Array[FinchAPI::Models::Sandbox::ConnectionCreateResponse::authentication_type] + end + end + end + end +end diff --git a/sig/finch-api/models/sandbox/connections/account_create_params.rbs b/sig/finch-api/models/sandbox/connections/account_create_params.rbs new file mode 100644 index 00000000..a8972f84 --- /dev/null +++ b/sig/finch-api/models/sandbox/connections/account_create_params.rbs @@ -0,0 +1,62 @@ +module FinchAPI + module Models + module Sandbox + module Connections + type account_create_params = + { + company_id: String, + provider_id: String, + authentication_type: FinchAPI::Models::Sandbox::Connections::AccountCreateParams::authentication_type, + products: ::Array[String] + } + & FinchAPI::request_parameters + + class AccountCreateParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + attr_accessor company_id: String + + attr_accessor provider_id: String + + attr_reader authentication_type: FinchAPI::Models::Sandbox::Connections::AccountCreateParams::authentication_type? + + def authentication_type=: ( + FinchAPI::Models::Sandbox::Connections::AccountCreateParams::authentication_type + ) -> FinchAPI::Models::Sandbox::Connections::AccountCreateParams::authentication_type + + attr_reader products: ::Array[String]? + + def products=: (::Array[String]) -> ::Array[String] + + def initialize: + ( + company_id: String, + provider_id: String, + authentication_type: FinchAPI::Models::Sandbox::Connections::AccountCreateParams::authentication_type, + products: ::Array[String], + request_options: FinchAPI::request_opts + ) -> void + | ( + ?FinchAPI::Models::Sandbox::Connections::account_create_params + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::Connections::account_create_params + + type authentication_type = + :credential | :api_token | :oauth | :assisted + + class AuthenticationType < FinchAPI::Enum + CREDENTIAL: :credential + API_TOKEN: :api_token + OAUTH: :oauth + ASSISTED: :assisted + + def self.values: -> ::Array[FinchAPI::Models::Sandbox::Connections::AccountCreateParams::authentication_type] + end + end + end + end + end +end diff --git a/sig/finch-api/models/sandbox/connections/account_create_response.rbs b/sig/finch-api/models/sandbox/connections/account_create_response.rbs new file mode 100644 index 00000000..c0104e87 --- /dev/null +++ b/sig/finch-api/models/sandbox/connections/account_create_response.rbs @@ -0,0 +1,63 @@ +module FinchAPI + module Models + module Sandbox + module Connections + type account_create_response = + { + access_token: String, + account_id: String, + authentication_type: FinchAPI::Models::Sandbox::Connections::AccountCreateResponse::authentication_type, + company_id: String, + connection_id: String, + products: ::Array[String], + provider_id: String + } + + class AccountCreateResponse < FinchAPI::BaseModel + attr_accessor access_token: String + + attr_accessor account_id: String + + attr_accessor authentication_type: FinchAPI::Models::Sandbox::Connections::AccountCreateResponse::authentication_type + + attr_accessor company_id: String + + attr_accessor connection_id: String + + attr_accessor products: ::Array[String] + + attr_accessor provider_id: String + + def initialize: + ( + access_token: String, + account_id: String, + authentication_type: FinchAPI::Models::Sandbox::Connections::AccountCreateResponse::authentication_type, + company_id: String, + connection_id: String, + products: ::Array[String], + provider_id: String + ) -> void + | ( + ?FinchAPI::Models::Sandbox::Connections::account_create_response + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::Connections::account_create_response + + type authentication_type = + :credential | :api_token | :oauth | :assisted + + class AuthenticationType < FinchAPI::Enum + CREDENTIAL: :credential + API_TOKEN: :api_token + OAUTH: :oauth + ASSISTED: :assisted + + def self.values: -> ::Array[FinchAPI::Models::Sandbox::Connections::AccountCreateResponse::authentication_type] + end + end + end + end + end +end diff --git a/sig/finch-api/models/sandbox/connections/account_update_params.rbs b/sig/finch-api/models/sandbox/connections/account_update_params.rbs new file mode 100644 index 00000000..0a957a3d --- /dev/null +++ b/sig/finch-api/models/sandbox/connections/account_update_params.rbs @@ -0,0 +1,34 @@ +module FinchAPI + module Models + module Sandbox + module Connections + type account_update_params = + { connection_status: FinchAPI::Models::connection_status_type } + & FinchAPI::request_parameters + + class AccountUpdateParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + attr_reader connection_status: FinchAPI::Models::connection_status_type? + + def connection_status=: ( + FinchAPI::Models::connection_status_type + ) -> FinchAPI::Models::connection_status_type + + def initialize: + ( + connection_status: FinchAPI::Models::connection_status_type, + request_options: FinchAPI::request_opts + ) -> void + | ( + ?FinchAPI::Models::Sandbox::Connections::account_update_params + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::Connections::account_update_params + end + end + end + end +end diff --git a/sig/finch-api/models/sandbox/connections/account_update_response.rbs b/sig/finch-api/models/sandbox/connections/account_update_response.rbs new file mode 100644 index 00000000..7f5dc7d6 --- /dev/null +++ b/sig/finch-api/models/sandbox/connections/account_update_response.rbs @@ -0,0 +1,61 @@ +module FinchAPI + module Models + module Sandbox + module Connections + type account_update_response = + { + account_id: String, + authentication_type: FinchAPI::Models::Sandbox::Connections::AccountUpdateResponse::authentication_type, + company_id: String, + products: ::Array[String], + provider_id: String, + connection_id: String + } + + class AccountUpdateResponse < FinchAPI::BaseModel + attr_accessor account_id: String + + attr_accessor authentication_type: FinchAPI::Models::Sandbox::Connections::AccountUpdateResponse::authentication_type + + attr_accessor company_id: String + + attr_accessor products: ::Array[String] + + attr_accessor provider_id: String + + attr_reader connection_id: String? + + def connection_id=: (String) -> String + + def initialize: + ( + account_id: String, + authentication_type: FinchAPI::Models::Sandbox::Connections::AccountUpdateResponse::authentication_type, + company_id: String, + products: ::Array[String], + provider_id: String, + connection_id: String + ) -> void + | ( + ?FinchAPI::Models::Sandbox::Connections::account_update_response + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::Connections::account_update_response + + type authentication_type = + :credential | :api_token | :oauth | :assisted + + class AuthenticationType < FinchAPI::Enum + CREDENTIAL: :credential + API_TOKEN: :api_token + OAUTH: :oauth + ASSISTED: :assisted + + def self.values: -> ::Array[FinchAPI::Models::Sandbox::Connections::AccountUpdateResponse::authentication_type] + end + end + end + end + end +end diff --git a/sig/finch-api/models/sandbox/directory_create_params.rbs b/sig/finch-api/models/sandbox/directory_create_params.rbs new file mode 100644 index 00000000..b10a9b2a --- /dev/null +++ b/sig/finch-api/models/sandbox/directory_create_params.rbs @@ -0,0 +1,392 @@ +module FinchAPI + module Models + module Sandbox + type directory_create_params = + { + body: ::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body] + } + & FinchAPI::request_parameters + + class DirectoryCreateParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + attr_reader body: ::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body]? + + def body=: ( + ::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body] + ) -> ::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body] + + def initialize: + ( + body: ::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body], + request_options: FinchAPI::request_opts + ) -> void + | ( + ?FinchAPI::Models::Sandbox::directory_create_params + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::directory_create_params + + type body = + { + class_code: String?, + custom_fields: ::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::CustomField], + department: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Department?, + dob: String?, + emails: ::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Email]?, + employment: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment?, + employment_status: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::employment_status?, + encrypted_ssn: String?, + end_date: String?, + ethnicity: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::ethnicity?, + first_name: String?, + gender: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::gender?, + income: FinchAPI::Models::Income?, + income_history: ::Array[FinchAPI::Models::Income?]?, + is_active: bool?, + last_name: String?, + latest_rehire_date: String?, + location: FinchAPI::Models::Location?, + manager: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Manager?, + middle_name: String?, + phone_numbers: ::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::PhoneNumber?]?, + preferred_name: String?, + residence: FinchAPI::Models::Location?, + source_id: String, + ssn: String?, + start_date: String?, + title: String? + } + + class Body < FinchAPI::BaseModel + attr_accessor class_code: String? + + attr_reader custom_fields: ::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::CustomField]? + + def custom_fields=: ( + ::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::CustomField] + ) -> ::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::CustomField] + + attr_accessor department: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Department? + + attr_accessor dob: String? + + attr_accessor emails: ::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Email]? + + attr_accessor employment: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment? + + attr_accessor employment_status: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::employment_status? + + attr_accessor encrypted_ssn: String? + + attr_accessor end_date: String? + + attr_accessor ethnicity: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::ethnicity? + + attr_accessor first_name: String? + + attr_accessor gender: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::gender? + + attr_accessor income: FinchAPI::Models::Income? + + attr_accessor income_history: ::Array[FinchAPI::Models::Income?]? + + attr_accessor is_active: bool? + + attr_accessor last_name: String? + + attr_accessor latest_rehire_date: String? + + attr_accessor location: FinchAPI::Models::Location? + + attr_accessor manager: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Manager? + + attr_accessor middle_name: String? + + attr_accessor phone_numbers: ::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::PhoneNumber?]? + + attr_accessor preferred_name: String? + + attr_accessor residence: FinchAPI::Models::Location? + + attr_reader source_id: String? + + def source_id=: (String) -> String + + attr_accessor ssn: String? + + attr_accessor start_date: String? + + attr_accessor title: String? + + def initialize: + ( + class_code: String?, + custom_fields: ::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::CustomField], + department: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Department?, + dob: String?, + emails: ::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Email]?, + employment: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment?, + employment_status: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::employment_status?, + encrypted_ssn: String?, + end_date: String?, + ethnicity: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::ethnicity?, + first_name: String?, + gender: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::gender?, + income: FinchAPI::Models::Income?, + income_history: ::Array[FinchAPI::Models::Income?]?, + is_active: bool?, + last_name: String?, + latest_rehire_date: String?, + location: FinchAPI::Models::Location?, + manager: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Manager?, + middle_name: String?, + phone_numbers: ::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::PhoneNumber?]?, + preferred_name: String?, + residence: FinchAPI::Models::Location?, + source_id: String, + ssn: String?, + start_date: String?, + title: String? + ) -> void + | ( + ?FinchAPI::Models::Sandbox::DirectoryCreateParams::body + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::DirectoryCreateParams::body + + type custom_field = { name: String?, value: top } + + class CustomField < FinchAPI::BaseModel + attr_accessor name: String? + + attr_reader value: top? + + def value=: (top) -> top + + def initialize: + (name: String?, value: top) -> void + | ( + ?FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::custom_field + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::custom_field + end + + type department = { name: String? } + + class Department < FinchAPI::BaseModel + attr_accessor name: String? + + def initialize: + (name: String?) -> void + | ( + ?FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::department + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::department + end + + type email = + { + data: String, + type: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Email::type_? + } + + class Email < FinchAPI::BaseModel + attr_reader data: String? + + def data=: (String) -> String + + attr_accessor type: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Email::type_? + + def initialize: + ( + data: String, + type: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Email::type_? + ) -> void + | ( + ?FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::email + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::email + + type type_ = :work | :personal + + class Type < FinchAPI::Enum + WORK: :work + PERSONAL: :personal + + def self.values: -> ::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Email::type_] + end + end + + type employment = + { + subtype: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::subtype?, + type: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::type_? + } + + class Employment < FinchAPI::BaseModel + attr_accessor subtype: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::subtype? + + attr_accessor type: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::type_? + + def initialize: + ( + subtype: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::subtype?, + type: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::type_? + ) -> void + | ( + ?FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::employment + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::employment + + type subtype = + :full_time + | :intern + | :part_time + | :temp + | :seasonal + | :individual_contractor + + class Subtype < FinchAPI::Enum + FULL_TIME: :full_time + INTERN: :intern + PART_TIME: :part_time + TEMP: :temp + SEASONAL: :seasonal + INDIVIDUAL_CONTRACTOR: :individual_contractor + + def self.values: -> ::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::subtype] + end + + type type_ = :employee | :contractor + + class Type < FinchAPI::Enum + EMPLOYEE: :employee + CONTRACTOR: :contractor + + def self.values: -> ::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::type_] + end + end + + type employment_status = + :active + | :deceased + | :leave + | :onboarding + | :prehire + | :retired + | :terminated + + class EmploymentStatus < FinchAPI::Enum + ACTIVE: :active + DECEASED: :deceased + LEAVE: :leave + ONBOARDING: :onboarding + PREHIRE: :prehire + RETIRED: :retired + TERMINATED: :terminated + + def self.values: -> ::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::employment_status] + end + + type ethnicity = + :asian + | :white + | :black_or_african_american + | :native_hawaiian_or_pacific_islander + | :american_indian_or_alaska_native + | :hispanic_or_latino + | :two_or_more_races + | :decline_to_specify + + class Ethnicity < FinchAPI::Enum + ASIAN: :asian + WHITE: :white + BLACK_OR_AFRICAN_AMERICAN: :black_or_african_american + NATIVE_HAWAIIAN_OR_PACIFIC_ISLANDER: :native_hawaiian_or_pacific_islander + AMERICAN_INDIAN_OR_ALASKA_NATIVE: :american_indian_or_alaska_native + HISPANIC_OR_LATINO: :hispanic_or_latino + TWO_OR_MORE_RACES: :two_or_more_races + DECLINE_TO_SPECIFY: :decline_to_specify + + def self.values: -> ::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::ethnicity] + end + + type gender = :female | :male | :other | :decline_to_specify + + class Gender < FinchAPI::Enum + FEMALE: :female + MALE: :male + OTHER: :other + DECLINE_TO_SPECIFY: :decline_to_specify + + def self.values: -> ::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::gender] + end + + type manager = { id: String } + + class Manager < FinchAPI::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + def initialize: + (id: String) -> void + | ( + ?FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::manager + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::manager + end + + type phone_number = + { + data: String, + type: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::PhoneNumber::type_? + } + + class PhoneNumber < FinchAPI::BaseModel + attr_reader data: String? + + def data=: (String) -> String + + attr_accessor type: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::PhoneNumber::type_? + + def initialize: + ( + data: String, + type: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::PhoneNumber::type_? + ) -> void + | ( + ?FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::phone_number + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::phone_number + + type type_ = :work | :personal + + class Type < FinchAPI::Enum + WORK: :work + PERSONAL: :personal + + def self.values: -> ::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::PhoneNumber::type_] + end + end + end + end + end + end +end diff --git a/sig/finch-api/models/sandbox/directory_create_response.rbs b/sig/finch-api/models/sandbox/directory_create_response.rbs new file mode 100644 index 00000000..9c4fd761 --- /dev/null +++ b/sig/finch-api/models/sandbox/directory_create_response.rbs @@ -0,0 +1,9 @@ +module FinchAPI + module Models + module Sandbox + type directory_create_response = ::Array[top] + + DirectoryCreateResponse: directory_create_response + end + end +end diff --git a/sig/finch-api/models/sandbox/employment_update_params.rbs b/sig/finch-api/models/sandbox/employment_update_params.rbs new file mode 100644 index 00000000..0e17c6c9 --- /dev/null +++ b/sig/finch-api/models/sandbox/employment_update_params.rbs @@ -0,0 +1,228 @@ +module FinchAPI + module Models + module Sandbox + type employment_update_params = + { + class_code: String?, + custom_fields: ::Array[FinchAPI::Models::Sandbox::EmploymentUpdateParams::CustomField], + department: FinchAPI::Models::Sandbox::EmploymentUpdateParams::Department?, + employment: FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment?, + employment_status: FinchAPI::Models::Sandbox::EmploymentUpdateParams::employment_status?, + end_date: String?, + first_name: String?, + income: FinchAPI::Models::Income?, + income_history: ::Array[FinchAPI::Models::Income?]?, + is_active: bool?, + last_name: String?, + latest_rehire_date: String?, + location: FinchAPI::Models::Location?, + manager: FinchAPI::Models::Sandbox::EmploymentUpdateParams::Manager?, + middle_name: String?, + source_id: String, + start_date: String?, + title: String? + } + & FinchAPI::request_parameters + + class EmploymentUpdateParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + attr_accessor class_code: String? + + attr_reader custom_fields: ::Array[FinchAPI::Models::Sandbox::EmploymentUpdateParams::CustomField]? + + def custom_fields=: ( + ::Array[FinchAPI::Models::Sandbox::EmploymentUpdateParams::CustomField] + ) -> ::Array[FinchAPI::Models::Sandbox::EmploymentUpdateParams::CustomField] + + attr_accessor department: FinchAPI::Models::Sandbox::EmploymentUpdateParams::Department? + + attr_accessor employment: FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment? + + attr_accessor employment_status: FinchAPI::Models::Sandbox::EmploymentUpdateParams::employment_status? + + attr_accessor end_date: String? + + attr_accessor first_name: String? + + attr_accessor income: FinchAPI::Models::Income? + + attr_accessor income_history: ::Array[FinchAPI::Models::Income?]? + + attr_accessor is_active: bool? + + attr_accessor last_name: String? + + attr_accessor latest_rehire_date: String? + + attr_accessor location: FinchAPI::Models::Location? + + attr_accessor manager: FinchAPI::Models::Sandbox::EmploymentUpdateParams::Manager? + + attr_accessor middle_name: String? + + attr_reader source_id: String? + + def source_id=: (String) -> String + + attr_accessor start_date: String? + + attr_accessor title: String? + + def initialize: + ( + class_code: String?, + custom_fields: ::Array[FinchAPI::Models::Sandbox::EmploymentUpdateParams::CustomField], + department: FinchAPI::Models::Sandbox::EmploymentUpdateParams::Department?, + employment: FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment?, + employment_status: FinchAPI::Models::Sandbox::EmploymentUpdateParams::employment_status?, + end_date: String?, + first_name: String?, + income: FinchAPI::Models::Income?, + income_history: ::Array[FinchAPI::Models::Income?]?, + is_active: bool?, + last_name: String?, + latest_rehire_date: String?, + location: FinchAPI::Models::Location?, + manager: FinchAPI::Models::Sandbox::EmploymentUpdateParams::Manager?, + middle_name: String?, + source_id: String, + start_date: String?, + title: String?, + request_options: FinchAPI::request_opts + ) -> void + | ( + ?FinchAPI::Models::Sandbox::employment_update_params + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::employment_update_params + + type custom_field = { name: String?, value: top } + + class CustomField < FinchAPI::BaseModel + attr_accessor name: String? + + attr_reader value: top? + + def value=: (top) -> top + + def initialize: + (name: String?, value: top) -> void + | ( + ?FinchAPI::Models::Sandbox::EmploymentUpdateParams::custom_field + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::EmploymentUpdateParams::custom_field + end + + type department = { name: String? } + + class Department < FinchAPI::BaseModel + attr_accessor name: String? + + def initialize: + (name: String?) -> void + | ( + ?FinchAPI::Models::Sandbox::EmploymentUpdateParams::department + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::EmploymentUpdateParams::department + end + + type employment = + { + subtype: FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::subtype?, + type: FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::type_? + } + + class Employment < FinchAPI::BaseModel + attr_accessor subtype: FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::subtype? + + attr_accessor type: FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::type_? + + def initialize: + ( + subtype: FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::subtype?, + type: FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::type_? + ) -> void + | ( + ?FinchAPI::Models::Sandbox::EmploymentUpdateParams::employment + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::EmploymentUpdateParams::employment + + type subtype = + :full_time + | :intern + | :part_time + | :temp + | :seasonal + | :individual_contractor + + class Subtype < FinchAPI::Enum + FULL_TIME: :full_time + INTERN: :intern + PART_TIME: :part_time + TEMP: :temp + SEASONAL: :seasonal + INDIVIDUAL_CONTRACTOR: :individual_contractor + + def self.values: -> ::Array[FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::subtype] + end + + type type_ = :employee | :contractor + + class Type < FinchAPI::Enum + EMPLOYEE: :employee + CONTRACTOR: :contractor + + def self.values: -> ::Array[FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::type_] + end + end + + type employment_status = + :active + | :deceased + | :leave + | :onboarding + | :prehire + | :retired + | :terminated + + class EmploymentStatus < FinchAPI::Enum + ACTIVE: :active + DECEASED: :deceased + LEAVE: :leave + ONBOARDING: :onboarding + PREHIRE: :prehire + RETIRED: :retired + TERMINATED: :terminated + + def self.values: -> ::Array[FinchAPI::Models::Sandbox::EmploymentUpdateParams::employment_status] + end + + type manager = { id: String } + + class Manager < FinchAPI::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + def initialize: + (id: String) -> void + | ( + ?FinchAPI::Models::Sandbox::EmploymentUpdateParams::manager + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::EmploymentUpdateParams::manager + end + end + end + end +end diff --git a/sig/finch-api/models/sandbox/employment_update_response.rbs b/sig/finch-api/models/sandbox/employment_update_response.rbs new file mode 100644 index 00000000..a4091f01 --- /dev/null +++ b/sig/finch-api/models/sandbox/employment_update_response.rbs @@ -0,0 +1,229 @@ +module FinchAPI + module Models + module Sandbox + type employment_update_response = + { + id: String, + class_code: String?, + custom_fields: ::Array[FinchAPI::Models::Sandbox::EmploymentUpdateResponse::CustomField], + department: FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Department?, + employment: FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment?, + employment_status: FinchAPI::Models::Sandbox::EmploymentUpdateResponse::employment_status?, + end_date: String?, + first_name: String?, + income: FinchAPI::Models::Income?, + income_history: ::Array[FinchAPI::Models::Income?]?, + is_active: bool?, + last_name: String?, + latest_rehire_date: String?, + location: FinchAPI::Models::Location?, + manager: FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Manager?, + middle_name: String?, + source_id: String, + start_date: String?, + title: String? + } + + class EmploymentUpdateResponse < FinchAPI::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_accessor class_code: String? + + attr_reader custom_fields: ::Array[FinchAPI::Models::Sandbox::EmploymentUpdateResponse::CustomField]? + + def custom_fields=: ( + ::Array[FinchAPI::Models::Sandbox::EmploymentUpdateResponse::CustomField] + ) -> ::Array[FinchAPI::Models::Sandbox::EmploymentUpdateResponse::CustomField] + + attr_accessor department: FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Department? + + attr_accessor employment: FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment? + + attr_accessor employment_status: FinchAPI::Models::Sandbox::EmploymentUpdateResponse::employment_status? + + attr_accessor end_date: String? + + attr_accessor first_name: String? + + attr_accessor income: FinchAPI::Models::Income? + + attr_accessor income_history: ::Array[FinchAPI::Models::Income?]? + + attr_accessor is_active: bool? + + attr_accessor last_name: String? + + attr_accessor latest_rehire_date: String? + + attr_accessor location: FinchAPI::Models::Location? + + attr_accessor manager: FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Manager? + + attr_accessor middle_name: String? + + attr_reader source_id: String? + + def source_id=: (String) -> String + + attr_accessor start_date: String? + + attr_accessor title: String? + + def initialize: + ( + id: String, + class_code: String?, + custom_fields: ::Array[FinchAPI::Models::Sandbox::EmploymentUpdateResponse::CustomField], + department: FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Department?, + employment: FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment?, + employment_status: FinchAPI::Models::Sandbox::EmploymentUpdateResponse::employment_status?, + end_date: String?, + first_name: String?, + income: FinchAPI::Models::Income?, + income_history: ::Array[FinchAPI::Models::Income?]?, + is_active: bool?, + last_name: String?, + latest_rehire_date: String?, + location: FinchAPI::Models::Location?, + manager: FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Manager?, + middle_name: String?, + source_id: String, + start_date: String?, + title: String? + ) -> void + | ( + ?FinchAPI::Models::Sandbox::employment_update_response + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::employment_update_response + + type custom_field = { name: String?, value: top } + + class CustomField < FinchAPI::BaseModel + attr_accessor name: String? + + attr_reader value: top? + + def value=: (top) -> top + + def initialize: + (name: String?, value: top) -> void + | ( + ?FinchAPI::Models::Sandbox::EmploymentUpdateResponse::custom_field + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::EmploymentUpdateResponse::custom_field + end + + type department = { name: String? } + + class Department < FinchAPI::BaseModel + attr_accessor name: String? + + def initialize: + (name: String?) -> void + | ( + ?FinchAPI::Models::Sandbox::EmploymentUpdateResponse::department + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::EmploymentUpdateResponse::department + end + + type employment = + { + subtype: FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::subtype?, + type: FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::type_? + } + + class Employment < FinchAPI::BaseModel + attr_accessor subtype: FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::subtype? + + attr_accessor type: FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::type_? + + def initialize: + ( + subtype: FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::subtype?, + type: FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::type_? + ) -> void + | ( + ?FinchAPI::Models::Sandbox::EmploymentUpdateResponse::employment + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::EmploymentUpdateResponse::employment + + type subtype = + :full_time + | :intern + | :part_time + | :temp + | :seasonal + | :individual_contractor + + class Subtype < FinchAPI::Enum + FULL_TIME: :full_time + INTERN: :intern + PART_TIME: :part_time + TEMP: :temp + SEASONAL: :seasonal + INDIVIDUAL_CONTRACTOR: :individual_contractor + + def self.values: -> ::Array[FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::subtype] + end + + type type_ = :employee | :contractor + + class Type < FinchAPI::Enum + EMPLOYEE: :employee + CONTRACTOR: :contractor + + def self.values: -> ::Array[FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::type_] + end + end + + type employment_status = + :active + | :deceased + | :leave + | :onboarding + | :prehire + | :retired + | :terminated + + class EmploymentStatus < FinchAPI::Enum + ACTIVE: :active + DECEASED: :deceased + LEAVE: :leave + ONBOARDING: :onboarding + PREHIRE: :prehire + RETIRED: :retired + TERMINATED: :terminated + + def self.values: -> ::Array[FinchAPI::Models::Sandbox::EmploymentUpdateResponse::employment_status] + end + + type manager = { id: String } + + class Manager < FinchAPI::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + def initialize: + (id: String) -> void + | ( + ?FinchAPI::Models::Sandbox::EmploymentUpdateResponse::manager + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::EmploymentUpdateResponse::manager + end + end + end + end +end diff --git a/sig/finch-api/models/sandbox/individual_update_params.rbs b/sig/finch-api/models/sandbox/individual_update_params.rbs new file mode 100644 index 00000000..a1806106 --- /dev/null +++ b/sig/finch-api/models/sandbox/individual_update_params.rbs @@ -0,0 +1,178 @@ +module FinchAPI + module Models + module Sandbox + type individual_update_params = + { + dob: String?, + emails: ::Array[FinchAPI::Models::Sandbox::IndividualUpdateParams::Email]?, + encrypted_ssn: String?, + ethnicity: FinchAPI::Models::Sandbox::IndividualUpdateParams::ethnicity?, + first_name: String?, + gender: FinchAPI::Models::Sandbox::IndividualUpdateParams::gender?, + last_name: String?, + middle_name: String?, + phone_numbers: ::Array[FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber?]?, + preferred_name: String?, + residence: FinchAPI::Models::Location?, + ssn: String? + } + & FinchAPI::request_parameters + + class IndividualUpdateParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + attr_accessor dob: String? + + attr_accessor emails: ::Array[FinchAPI::Models::Sandbox::IndividualUpdateParams::Email]? + + attr_accessor encrypted_ssn: String? + + attr_accessor ethnicity: FinchAPI::Models::Sandbox::IndividualUpdateParams::ethnicity? + + attr_accessor first_name: String? + + attr_accessor gender: FinchAPI::Models::Sandbox::IndividualUpdateParams::gender? + + attr_accessor last_name: String? + + attr_accessor middle_name: String? + + attr_accessor phone_numbers: ::Array[FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber?]? + + attr_accessor preferred_name: String? + + attr_accessor residence: FinchAPI::Models::Location? + + attr_accessor ssn: String? + + def initialize: + ( + dob: String?, + emails: ::Array[FinchAPI::Models::Sandbox::IndividualUpdateParams::Email]?, + encrypted_ssn: String?, + ethnicity: FinchAPI::Models::Sandbox::IndividualUpdateParams::ethnicity?, + first_name: String?, + gender: FinchAPI::Models::Sandbox::IndividualUpdateParams::gender?, + last_name: String?, + middle_name: String?, + phone_numbers: ::Array[FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber?]?, + preferred_name: String?, + residence: FinchAPI::Models::Location?, + ssn: String?, + request_options: FinchAPI::request_opts + ) -> void + | ( + ?FinchAPI::Models::Sandbox::individual_update_params + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::individual_update_params + + type email = + { + data: String, + type: FinchAPI::Models::Sandbox::IndividualUpdateParams::Email::type_? + } + + class Email < FinchAPI::BaseModel + attr_reader data: String? + + def data=: (String) -> String + + attr_accessor type: FinchAPI::Models::Sandbox::IndividualUpdateParams::Email::type_? + + def initialize: + ( + data: String, + type: FinchAPI::Models::Sandbox::IndividualUpdateParams::Email::type_? + ) -> void + | ( + ?FinchAPI::Models::Sandbox::IndividualUpdateParams::email + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::IndividualUpdateParams::email + + type type_ = :work | :personal + + class Type < FinchAPI::Enum + WORK: :work + PERSONAL: :personal + + def self.values: -> ::Array[FinchAPI::Models::Sandbox::IndividualUpdateParams::Email::type_] + end + end + + type ethnicity = + :asian + | :white + | :black_or_african_american + | :native_hawaiian_or_pacific_islander + | :american_indian_or_alaska_native + | :hispanic_or_latino + | :two_or_more_races + | :decline_to_specify + + class Ethnicity < FinchAPI::Enum + ASIAN: :asian + WHITE: :white + BLACK_OR_AFRICAN_AMERICAN: :black_or_african_american + NATIVE_HAWAIIAN_OR_PACIFIC_ISLANDER: :native_hawaiian_or_pacific_islander + AMERICAN_INDIAN_OR_ALASKA_NATIVE: :american_indian_or_alaska_native + HISPANIC_OR_LATINO: :hispanic_or_latino + TWO_OR_MORE_RACES: :two_or_more_races + DECLINE_TO_SPECIFY: :decline_to_specify + + def self.values: -> ::Array[FinchAPI::Models::Sandbox::IndividualUpdateParams::ethnicity] + end + + type gender = :female | :male | :other | :decline_to_specify + + class Gender < FinchAPI::Enum + FEMALE: :female + MALE: :male + OTHER: :other + DECLINE_TO_SPECIFY: :decline_to_specify + + def self.values: -> ::Array[FinchAPI::Models::Sandbox::IndividualUpdateParams::gender] + end + + type phone_number = + { + data: String, + type: FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber::type_? + } + + class PhoneNumber < FinchAPI::BaseModel + attr_reader data: String? + + def data=: (String) -> String + + attr_accessor type: FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber::type_? + + def initialize: + ( + data: String, + type: FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber::type_? + ) -> void + | ( + ?FinchAPI::Models::Sandbox::IndividualUpdateParams::phone_number + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::IndividualUpdateParams::phone_number + + type type_ = :work | :personal + + class Type < FinchAPI::Enum + WORK: :work + PERSONAL: :personal + + def self.values: -> ::Array[FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber::type_] + end + end + end + end + end +end diff --git a/sig/finch-api/models/sandbox/individual_update_response.rbs b/sig/finch-api/models/sandbox/individual_update_response.rbs new file mode 100644 index 00000000..bee43ce3 --- /dev/null +++ b/sig/finch-api/models/sandbox/individual_update_response.rbs @@ -0,0 +1,179 @@ +module FinchAPI + module Models + module Sandbox + type individual_update_response = + { + id: String, + dob: String?, + emails: ::Array[FinchAPI::Models::Sandbox::IndividualUpdateResponse::Email]?, + encrypted_ssn: String?, + ethnicity: FinchAPI::Models::Sandbox::IndividualUpdateResponse::ethnicity?, + first_name: String?, + gender: FinchAPI::Models::Sandbox::IndividualUpdateResponse::gender?, + last_name: String?, + middle_name: String?, + phone_numbers: ::Array[FinchAPI::Models::Sandbox::IndividualUpdateResponse::PhoneNumber?]?, + preferred_name: String?, + residence: FinchAPI::Models::Location?, + ssn: String? + } + + class IndividualUpdateResponse < FinchAPI::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_accessor dob: String? + + attr_accessor emails: ::Array[FinchAPI::Models::Sandbox::IndividualUpdateResponse::Email]? + + attr_accessor encrypted_ssn: String? + + attr_accessor ethnicity: FinchAPI::Models::Sandbox::IndividualUpdateResponse::ethnicity? + + attr_accessor first_name: String? + + attr_accessor gender: FinchAPI::Models::Sandbox::IndividualUpdateResponse::gender? + + attr_accessor last_name: String? + + attr_accessor middle_name: String? + + attr_accessor phone_numbers: ::Array[FinchAPI::Models::Sandbox::IndividualUpdateResponse::PhoneNumber?]? + + attr_accessor preferred_name: String? + + attr_accessor residence: FinchAPI::Models::Location? + + attr_accessor ssn: String? + + def initialize: + ( + id: String, + dob: String?, + emails: ::Array[FinchAPI::Models::Sandbox::IndividualUpdateResponse::Email]?, + encrypted_ssn: String?, + ethnicity: FinchAPI::Models::Sandbox::IndividualUpdateResponse::ethnicity?, + first_name: String?, + gender: FinchAPI::Models::Sandbox::IndividualUpdateResponse::gender?, + last_name: String?, + middle_name: String?, + phone_numbers: ::Array[FinchAPI::Models::Sandbox::IndividualUpdateResponse::PhoneNumber?]?, + preferred_name: String?, + residence: FinchAPI::Models::Location?, + ssn: String? + ) -> void + | ( + ?FinchAPI::Models::Sandbox::individual_update_response + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::individual_update_response + + type email = + { + data: String, + type: FinchAPI::Models::Sandbox::IndividualUpdateResponse::Email::type_? + } + + class Email < FinchAPI::BaseModel + attr_reader data: String? + + def data=: (String) -> String + + attr_accessor type: FinchAPI::Models::Sandbox::IndividualUpdateResponse::Email::type_? + + def initialize: + ( + data: String, + type: FinchAPI::Models::Sandbox::IndividualUpdateResponse::Email::type_? + ) -> void + | ( + ?FinchAPI::Models::Sandbox::IndividualUpdateResponse::email + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::IndividualUpdateResponse::email + + type type_ = :work | :personal + + class Type < FinchAPI::Enum + WORK: :work + PERSONAL: :personal + + def self.values: -> ::Array[FinchAPI::Models::Sandbox::IndividualUpdateResponse::Email::type_] + end + end + + type ethnicity = + :asian + | :white + | :black_or_african_american + | :native_hawaiian_or_pacific_islander + | :american_indian_or_alaska_native + | :hispanic_or_latino + | :two_or_more_races + | :decline_to_specify + + class Ethnicity < FinchAPI::Enum + ASIAN: :asian + WHITE: :white + BLACK_OR_AFRICAN_AMERICAN: :black_or_african_american + NATIVE_HAWAIIAN_OR_PACIFIC_ISLANDER: :native_hawaiian_or_pacific_islander + AMERICAN_INDIAN_OR_ALASKA_NATIVE: :american_indian_or_alaska_native + HISPANIC_OR_LATINO: :hispanic_or_latino + TWO_OR_MORE_RACES: :two_or_more_races + DECLINE_TO_SPECIFY: :decline_to_specify + + def self.values: -> ::Array[FinchAPI::Models::Sandbox::IndividualUpdateResponse::ethnicity] + end + + type gender = :female | :male | :other | :decline_to_specify + + class Gender < FinchAPI::Enum + FEMALE: :female + MALE: :male + OTHER: :other + DECLINE_TO_SPECIFY: :decline_to_specify + + def self.values: -> ::Array[FinchAPI::Models::Sandbox::IndividualUpdateResponse::gender] + end + + type phone_number = + { + data: String, + type: FinchAPI::Models::Sandbox::IndividualUpdateResponse::PhoneNumber::type_? + } + + class PhoneNumber < FinchAPI::BaseModel + attr_reader data: String? + + def data=: (String) -> String + + attr_accessor type: FinchAPI::Models::Sandbox::IndividualUpdateResponse::PhoneNumber::type_? + + def initialize: + ( + data: String, + type: FinchAPI::Models::Sandbox::IndividualUpdateResponse::PhoneNumber::type_? + ) -> void + | ( + ?FinchAPI::Models::Sandbox::IndividualUpdateResponse::phone_number + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::IndividualUpdateResponse::phone_number + + type type_ = :work | :personal + + class Type < FinchAPI::Enum + WORK: :work + PERSONAL: :personal + + def self.values: -> ::Array[FinchAPI::Models::Sandbox::IndividualUpdateResponse::PhoneNumber::type_] + end + end + end + end + end +end diff --git a/sig/finch-api/models/sandbox/job_create_params.rbs b/sig/finch-api/models/sandbox/job_create_params.rbs new file mode 100644 index 00000000..d631c377 --- /dev/null +++ b/sig/finch-api/models/sandbox/job_create_params.rbs @@ -0,0 +1,36 @@ +module FinchAPI + module Models + module Sandbox + type job_create_params = + { type: FinchAPI::Models::Sandbox::JobCreateParams::type_ } + & FinchAPI::request_parameters + + class JobCreateParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + attr_accessor type: FinchAPI::Models::Sandbox::JobCreateParams::type_ + + def initialize: + ( + type: FinchAPI::Models::Sandbox::JobCreateParams::type_, + request_options: FinchAPI::request_opts + ) -> void + | ( + ?FinchAPI::Models::Sandbox::job_create_params + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::job_create_params + + type type_ = :data_sync_all + + class Type < FinchAPI::Enum + DATA_SYNC_ALL: :data_sync_all + + def self.values: -> ::Array[FinchAPI::Models::Sandbox::JobCreateParams::type_] + end + end + end + end +end diff --git a/sig/finch-api/models/sandbox/job_create_response.rbs b/sig/finch-api/models/sandbox/job_create_response.rbs new file mode 100644 index 00000000..424a465d --- /dev/null +++ b/sig/finch-api/models/sandbox/job_create_response.rbs @@ -0,0 +1,37 @@ +module FinchAPI + module Models + module Sandbox + type job_create_response = + { + allowed_refreshes: Integer, + job_id: String, + job_url: String, + remaining_refreshes: Integer + } + + class JobCreateResponse < FinchAPI::BaseModel + attr_accessor allowed_refreshes: Integer + + attr_accessor job_id: String + + attr_accessor job_url: String + + attr_accessor remaining_refreshes: Integer + + def initialize: + ( + allowed_refreshes: Integer, + job_id: String, + job_url: String, + remaining_refreshes: Integer + ) -> void + | ( + ?FinchAPI::Models::Sandbox::job_create_response + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::job_create_response + end + end + end +end diff --git a/sig/finch-api/models/sandbox/jobs/configuration_retrieve_params.rbs b/sig/finch-api/models/sandbox/jobs/configuration_retrieve_params.rbs new file mode 100644 index 00000000..f70d8c91 --- /dev/null +++ b/sig/finch-api/models/sandbox/jobs/configuration_retrieve_params.rbs @@ -0,0 +1,23 @@ +module FinchAPI + module Models + module Sandbox + module Jobs + type configuration_retrieve_params = { } & FinchAPI::request_parameters + + class ConfigurationRetrieveParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + def initialize: + (request_options: FinchAPI::request_opts) -> void + | ( + ?FinchAPI::Models::Sandbox::Jobs::configuration_retrieve_params + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::Jobs::configuration_retrieve_params + end + end + end + end +end diff --git a/sig/finch-api/models/sandbox/jobs/configuration_retrieve_response.rbs b/sig/finch-api/models/sandbox/jobs/configuration_retrieve_response.rbs new file mode 100644 index 00000000..e8d47232 --- /dev/null +++ b/sig/finch-api/models/sandbox/jobs/configuration_retrieve_response.rbs @@ -0,0 +1,12 @@ +module FinchAPI + module Models + module Sandbox + module Jobs + type configuration_retrieve_response = + ::Array[FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration] + + ConfigurationRetrieveResponse: configuration_retrieve_response + end + end + end +end diff --git a/sig/finch-api/models/sandbox/jobs/configuration_update_params.rbs b/sig/finch-api/models/sandbox/jobs/configuration_update_params.rbs new file mode 100644 index 00000000..c5390dc7 --- /dev/null +++ b/sig/finch-api/models/sandbox/jobs/configuration_update_params.rbs @@ -0,0 +1,23 @@ +module FinchAPI + module Models + module Sandbox + module Jobs + type configuration_update_params = { } & FinchAPI::request_parameters + + class ConfigurationUpdateParams < FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + def initialize: + (request_options: FinchAPI::request_opts) -> void + | ( + ?FinchAPI::Models::Sandbox::Jobs::configuration_update_params + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::Jobs::configuration_update_params + end + end + end + end +end diff --git a/sig/finch-api/models/sandbox/jobs/sandbox_job_configuration.rbs b/sig/finch-api/models/sandbox/jobs/sandbox_job_configuration.rbs new file mode 100644 index 00000000..21ccda50 --- /dev/null +++ b/sig/finch-api/models/sandbox/jobs/sandbox_job_configuration.rbs @@ -0,0 +1,51 @@ +module FinchAPI + module Models + module Sandbox + module Jobs + type sandbox_job_configuration = + { + completion_status: FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::completion_status, + type: FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::type_ + } + + class SandboxJobConfiguration < FinchAPI::BaseModel + attr_accessor completion_status: FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::completion_status + + attr_accessor type: FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::type_ + + def initialize: + ( + completion_status: FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::completion_status, + type: FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::type_ + ) -> void + | ( + ?FinchAPI::Models::Sandbox::Jobs::sandbox_job_configuration + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::Jobs::sandbox_job_configuration + + type completion_status = + :complete | :reauth_error | :permissions_error | :error + + class CompletionStatus < FinchAPI::Enum + COMPLETE: :complete + REAUTH_ERROR: :reauth_error + PERMISSIONS_ERROR: :permissions_error + ERROR: :error + + def self.values: -> ::Array[FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::completion_status] + end + + type type_ = :data_sync_all + + class Type < FinchAPI::Enum + DATA_SYNC_ALL: :data_sync_all + + def self.values: -> ::Array[FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::type_] + end + end + end + end + end +end diff --git a/sig/finch-api/models/sandbox/payment_create_params.rbs b/sig/finch-api/models/sandbox/payment_create_params.rbs new file mode 100644 index 00000000..f33ec80f --- /dev/null +++ b/sig/finch-api/models/sandbox/payment_create_params.rbs @@ -0,0 +1,487 @@ +module FinchAPI + module Models + module Sandbox + type payment_create_params = + { + end_date: String, + pay_statements: ::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement], + start_date: String + } + & FinchAPI::request_parameters + + class PaymentCreateParams < FinchAPI::BaseModel + extend FinchAPI::RequestParameters::Converter + include FinchAPI::RequestParameters + + attr_reader end_date: String? + + def end_date=: (String) -> String + + attr_reader pay_statements: ::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement]? + + def pay_statements=: ( + ::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement] + ) -> ::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement] + + attr_reader start_date: String? + + def start_date=: (String) -> String + + def initialize: + ( + end_date: String, + pay_statements: ::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement], + start_date: String, + request_options: FinchAPI::request_opts + ) -> void + | ( + ?FinchAPI::Models::Sandbox::payment_create_params + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::payment_create_params + + type pay_statement = + { + earnings: ::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning?]?, + employee_deductions: ::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction?]?, + employer_contributions: ::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution?]?, + gross_pay: FinchAPI::Models::Money?, + individual_id: String, + net_pay: FinchAPI::Models::Money?, + payment_method: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::payment_method?, + taxes: ::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax?]?, + total_hours: Float?, + type: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::type_? + } + + class PayStatement < FinchAPI::BaseModel + attr_accessor earnings: ::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning?]? + + attr_accessor employee_deductions: ::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction?]? + + attr_accessor employer_contributions: ::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution?]? + + attr_accessor gross_pay: FinchAPI::Models::Money? + + attr_reader individual_id: String? + + def individual_id=: (String) -> String + + attr_accessor net_pay: FinchAPI::Models::Money? + + attr_accessor payment_method: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::payment_method? + + attr_accessor taxes: ::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax?]? + + attr_accessor total_hours: Float? + + attr_accessor type: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::type_? + + def initialize: + ( + earnings: ::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning?]?, + employee_deductions: ::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction?]?, + employer_contributions: ::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution?]?, + gross_pay: FinchAPI::Models::Money?, + individual_id: String, + net_pay: FinchAPI::Models::Money?, + payment_method: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::payment_method?, + taxes: ::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax?]?, + total_hours: Float?, + type: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::type_? + ) -> void + | ( + ?FinchAPI::Models::Sandbox::PaymentCreateParams::pay_statement + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::PaymentCreateParams::pay_statement + + type earning = + { + amount: Integer?, + attributes: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes?, + currency: String?, + hours: Float?, + name: String?, + type: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::type_? + } + + class Earning < FinchAPI::BaseModel + attr_accessor amount: Integer? + + attr_accessor attributes: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes? + + attr_accessor currency: String? + + attr_accessor hours: Float? + + attr_accessor name: String? + + attr_accessor type: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::type_? + + def initialize: + ( + amount: Integer?, + attributes: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes?, + currency: String?, + hours: Float?, + name: String?, + type: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::type_? + ) -> void + | ( + ?FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::earning + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::earning + + type attributes = + { + metadata: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes::Metadata + } + + class Attributes < FinchAPI::BaseModel + attr_reader metadata: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes::Metadata? + + def metadata=: ( + FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes::Metadata + ) -> FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes::Metadata + + def initialize: + ( + metadata: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes::Metadata + ) -> void + | ( + ?FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::attributes + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::attributes + + type metadata = { metadata: ::Hash[Symbol, top] } + + class Metadata < FinchAPI::BaseModel + attr_reader metadata: ::Hash[Symbol, top]? + + def metadata=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + def initialize: + (metadata: ::Hash[Symbol, top]) -> void + | ( + ?FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes::metadata + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes::metadata + end + end + + type type_ = + :salary + | :wage + | :reimbursement + | :overtime + | :severance + | :double_overtime + | :pto + | :sick + | :bonus + | :commission + | :tips + | :"1099" + | :other + + class Type < FinchAPI::Enum + SALARY: :salary + WAGE: :wage + REIMBURSEMENT: :reimbursement + OVERTIME: :overtime + SEVERANCE: :severance + DOUBLE_OVERTIME: :double_overtime + PTO: :pto + SICK: :sick + BONUS: :bonus + COMMISSION: :commission + TIPS: :tips + NUMBER_1099: :"1099" + OTHER: :other + + def self.values: -> ::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::type_] + end + end + + type employee_deduction = + { + amount: Integer?, + attributes: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes?, + currency: String?, + name: String?, + pre_tax: bool?, + type: FinchAPI::Models::HRIS::benefit_type? + } + + class EmployeeDeduction < FinchAPI::BaseModel + attr_accessor amount: Integer? + + attr_accessor attributes: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes? + + attr_accessor currency: String? + + attr_accessor name: String? + + attr_accessor pre_tax: bool? + + attr_accessor type: FinchAPI::Models::HRIS::benefit_type? + + def initialize: + ( + amount: Integer?, + attributes: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes?, + currency: String?, + name: String?, + pre_tax: bool?, + type: FinchAPI::Models::HRIS::benefit_type? + ) -> void + | ( + ?FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::employee_deduction + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::employee_deduction + + type attributes = + { + metadata: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes::Metadata + } + + class Attributes < FinchAPI::BaseModel + attr_reader metadata: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes::Metadata? + + def metadata=: ( + FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes::Metadata + ) -> FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes::Metadata + + def initialize: + ( + metadata: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes::Metadata + ) -> void + | ( + ?FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::attributes + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::attributes + + type metadata = { metadata: ::Hash[Symbol, top] } + + class Metadata < FinchAPI::BaseModel + attr_reader metadata: ::Hash[Symbol, top]? + + def metadata=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + def initialize: + (metadata: ::Hash[Symbol, top]) -> void + | ( + ?FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes::metadata + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes::metadata + end + end + end + + type employer_contribution = + { + amount: Integer?, + attributes: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes?, + currency: String?, + name: String?, + type: FinchAPI::Models::HRIS::benefit_type? + } + + class EmployerContribution < FinchAPI::BaseModel + attr_accessor amount: Integer? + + attr_accessor attributes: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes? + + attr_accessor currency: String? + + attr_accessor name: String? + + attr_accessor type: FinchAPI::Models::HRIS::benefit_type? + + def initialize: + ( + amount: Integer?, + attributes: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes?, + currency: String?, + name: String?, + type: FinchAPI::Models::HRIS::benefit_type? + ) -> void + | ( + ?FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::employer_contribution + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::employer_contribution + + type attributes = + { + metadata: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes::Metadata + } + + class Attributes < FinchAPI::BaseModel + attr_reader metadata: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes::Metadata? + + def metadata=: ( + FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes::Metadata + ) -> FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes::Metadata + + def initialize: + ( + metadata: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes::Metadata + ) -> void + | ( + ?FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::attributes + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::attributes + + type metadata = { metadata: ::Hash[Symbol, top] } + + class Metadata < FinchAPI::BaseModel + attr_reader metadata: ::Hash[Symbol, top]? + + def metadata=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + def initialize: + (metadata: ::Hash[Symbol, top]) -> void + | ( + ?FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes::metadata + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes::metadata + end + end + end + + type payment_method = :check | :direct_deposit + + class PaymentMethod < FinchAPI::Enum + CHECK: :check + DIRECT_DEPOSIT: :direct_deposit + + def self.values: -> ::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::payment_method] + end + + type tax = + { + amount: Integer?, + attributes: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes?, + currency: String?, + employer: bool?, + name: String?, + type: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::type_? + } + + class Tax < FinchAPI::BaseModel + attr_accessor amount: Integer? + + attr_accessor attributes: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes? + + attr_accessor currency: String? + + attr_accessor employer: bool? + + attr_accessor name: String? + + attr_accessor type: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::type_? + + def initialize: + ( + amount: Integer?, + attributes: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes?, + currency: String?, + employer: bool?, + name: String?, + type: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::type_? + ) -> void + | ( + ?FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::tax + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::tax + + type attributes = + { + metadata: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes::Metadata + } + + class Attributes < FinchAPI::BaseModel + attr_reader metadata: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes::Metadata? + + def metadata=: ( + FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes::Metadata + ) -> FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes::Metadata + + def initialize: + ( + metadata: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes::Metadata + ) -> void + | ( + ?FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::attributes + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::attributes + + type metadata = { metadata: ::Hash[Symbol, top] } + + class Metadata < FinchAPI::BaseModel + attr_reader metadata: ::Hash[Symbol, top]? + + def metadata=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + def initialize: + (metadata: ::Hash[Symbol, top]) -> void + | ( + ?FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes::metadata + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes::metadata + end + end + + type type_ = :state | :federal | :local | :fica + + class Type < FinchAPI::Enum + STATE: :state + FEDERAL: :federal + LOCAL: :local + FICA: :fica + + def self.values: -> ::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::type_] + end + end + + type type_ = :regular_payroll | :off_cycle_payroll | :one_time_payment + + class Type < FinchAPI::Enum + REGULAR_PAYROLL: :regular_payroll + OFF_CYCLE_PAYROLL: :off_cycle_payroll + ONE_TIME_PAYMENT: :one_time_payment + + def self.values: -> ::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::type_] + end + end + end + end + end +end diff --git a/sig/finch-api/models/sandbox/payment_create_response.rbs b/sig/finch-api/models/sandbox/payment_create_response.rbs new file mode 100644 index 00000000..cf449f8f --- /dev/null +++ b/sig/finch-api/models/sandbox/payment_create_response.rbs @@ -0,0 +1,22 @@ +module FinchAPI + module Models + module Sandbox + type payment_create_response = { pay_date: String, payment_id: String } + + class PaymentCreateResponse < FinchAPI::BaseModel + attr_accessor pay_date: String + + attr_accessor payment_id: String + + def initialize: + (pay_date: String, payment_id: String) -> void + | ( + ?FinchAPI::Models::Sandbox::payment_create_response + | FinchAPI::BaseModel data + ) -> void + + def to_hash: -> FinchAPI::Models::Sandbox::payment_create_response + end + end + end +end diff --git a/sig/finch-api/models/webhook_event.rbs b/sig/finch-api/models/webhook_event.rbs new file mode 100644 index 00000000..aa6a84b3 --- /dev/null +++ b/sig/finch-api/models/webhook_event.rbs @@ -0,0 +1,17 @@ +module FinchAPI + module Models + type webhook_event = + FinchAPI::Models::AccountUpdateEvent + | FinchAPI::Models::JobCompletionEvent + | FinchAPI::Models::CompanyEvent + | FinchAPI::Models::DirectoryEvent + | FinchAPI::Models::EmploymentEvent + | FinchAPI::Models::IndividualEvent + | FinchAPI::Models::PaymentEvent + | FinchAPI::Models::PayStatementEvent + + class WebhookEvent < FinchAPI::Union + private def self.variants: -> [[nil, FinchAPI::Models::AccountUpdateEvent], [nil, FinchAPI::Models::JobCompletionEvent], [nil, FinchAPI::Models::CompanyEvent], [nil, FinchAPI::Models::DirectoryEvent], [nil, FinchAPI::Models::EmploymentEvent], [nil, FinchAPI::Models::IndividualEvent], [nil, FinchAPI::Models::PaymentEvent], [nil, FinchAPI::Models::PayStatementEvent]] + end + end +end diff --git a/sig/finch-api/page.rbs b/sig/finch-api/page.rbs new file mode 100644 index 00000000..fb9b1943 --- /dev/null +++ b/sig/finch-api/page.rbs @@ -0,0 +1,16 @@ +module FinchAPI + class Page[Elem] + include FinchAPI::BasePage[Elem] + + attr_accessor data: ::Array[Elem] + + attr_accessor paging: FinchAPI::Models::Paging + + def initialize: ( + client: FinchAPI::BaseClient, + req: FinchAPI::BaseClient::request_components, + headers: ::Hash[String, String], + unwrapped: ::Hash[Symbol, top] + ) -> void + end +end diff --git a/sig/finch-api/pooled_net_requester.rbs b/sig/finch-api/pooled_net_requester.rbs new file mode 100644 index 00000000..80a36fd0 --- /dev/null +++ b/sig/finch-api/pooled_net_requester.rbs @@ -0,0 +1,28 @@ +module FinchAPI + class PooledNetRequester + type request = + { + method: Symbol, + url: URI::Generic, + headers: ::Hash[String, String], + body: top, + deadline: Float + } + + def self.connect: (URI::Generic url) -> top + + def self.calibrate_socket_timeout: (top conn, Float deadline) -> void + + def self.build_request: ( + FinchAPI::PooledNetRequester::request request + ) -> top + + private def with_pool: (URI::Generic url) { (top arg0) -> void } -> void + + def execute: ( + FinchAPI::PooledNetRequester::request request + ) -> [top, Enumerable[String]] + + def initialize: -> void + end +end diff --git a/sig/finch-api/request_options.rbs b/sig/finch-api/request_options.rbs new file mode 100644 index 00000000..6c85d582 --- /dev/null +++ b/sig/finch-api/request_options.rbs @@ -0,0 +1,40 @@ +module FinchAPI + type request_opts = + FinchAPI::RequestOptions | FinchAPI::request_options | ::Hash[Symbol, top] + + type request_parameters = { request_options: FinchAPI::request_opts } + + module RequestParameters + attr_accessor request_options: FinchAPI::request_opts + + module Converter + def dump_request: (top params) -> [top, ::Hash[Symbol, top]] + end + end + + type request_options = + { + idempotency_key: String?, + extra_query: ::Hash[String, (::Array[String] | String)?]?, + extra_headers: ::Hash[String, String?]?, + extra_body: ::Hash[Symbol, top]?, + max_retries: Integer?, + timeout: Float? + } + + class RequestOptions < FinchAPI::BaseModel + def self.validate!: (self | ::Hash[Symbol, top] opts) -> void + + attr_accessor idempotency_key: String? + + attr_accessor extra_query: ::Hash[String, (::Array[String] | String)?]? + + attr_accessor extra_headers: ::Hash[String, String?]? + + attr_accessor extra_body: ::Hash[Symbol, top]? + + attr_accessor max_retries: Integer? + + attr_accessor timeout: Float? + end +end diff --git a/sig/finch-api/resources/access_tokens.rbs b/sig/finch-api/resources/access_tokens.rbs new file mode 100644 index 00000000..a5f8e6ce --- /dev/null +++ b/sig/finch-api/resources/access_tokens.rbs @@ -0,0 +1,19 @@ +module FinchAPI + module Resources + class AccessTokens + def create: + ( + FinchAPI::Models::AccessTokenCreateParams | ::Hash[Symbol, top] params + ) -> FinchAPI::Models::CreateAccessTokenResponse + | ( + code: String, + client_id: String, + client_secret: String, + redirect_uri: String, + request_options: FinchAPI::request_opts + ) -> FinchAPI::Models::CreateAccessTokenResponse + + def initialize: (client: FinchAPI::Client) -> void + end + end +end diff --git a/sig/finch-api/resources/account.rbs b/sig/finch-api/resources/account.rbs new file mode 100644 index 00000000..4731d4d7 --- /dev/null +++ b/sig/finch-api/resources/account.rbs @@ -0,0 +1,25 @@ +module FinchAPI + module Resources + class Account + def disconnect: + ( + ?FinchAPI::Models::AccountDisconnectParams + | ::Hash[Symbol, top] params + ) -> FinchAPI::Models::DisconnectResponse + | ( + request_options: FinchAPI::request_opts + ) -> FinchAPI::Models::DisconnectResponse + + def introspect: + ( + ?FinchAPI::Models::AccountIntrospectParams + | ::Hash[Symbol, top] params + ) -> FinchAPI::Models::Introspection + | ( + request_options: FinchAPI::request_opts + ) -> FinchAPI::Models::Introspection + + def initialize: (client: FinchAPI::Client) -> void + end + end +end diff --git a/sig/finch-api/resources/connect.rbs b/sig/finch-api/resources/connect.rbs new file mode 100644 index 00000000..d4512c23 --- /dev/null +++ b/sig/finch-api/resources/connect.rbs @@ -0,0 +1,9 @@ +module FinchAPI + module Resources + class Connect + attr_reader sessions: FinchAPI::Resources::Connect::Sessions + + def initialize: (client: FinchAPI::Client) -> void + end + end +end diff --git a/sig/finch-api/resources/connect/sessions.rbs b/sig/finch-api/resources/connect/sessions.rbs new file mode 100644 index 00000000..ba88be0e --- /dev/null +++ b/sig/finch-api/resources/connect/sessions.rbs @@ -0,0 +1,40 @@ +module FinchAPI + module Resources + class Connect + class Sessions + def new: + ( + FinchAPI::Models::Connect::SessionNewParams + | ::Hash[Symbol, top] params + ) -> FinchAPI::Models::Connect::SessionNewResponse + | ( + customer_id: String, + customer_name: String, + products: ::Array[FinchAPI::Models::Connect::SessionNewParams::product], + customer_email: String?, + integration: FinchAPI::Models::Connect::SessionNewParams::Integration?, + manual: bool?, + minutes_to_expire: Float?, + redirect_uri: String?, + sandbox: FinchAPI::Models::Connect::SessionNewParams::sandbox?, + request_options: FinchAPI::request_opts + ) -> FinchAPI::Models::Connect::SessionNewResponse + + def reauthenticate: + ( + FinchAPI::Models::Connect::SessionReauthenticateParams + | ::Hash[Symbol, top] params + ) -> FinchAPI::Models::Connect::SessionReauthenticateResponse + | ( + connection_id: String, + minutes_to_expire: Integer?, + products: ::Array[FinchAPI::Models::Connect::SessionReauthenticateParams::product]?, + redirect_uri: String?, + request_options: FinchAPI::request_opts + ) -> FinchAPI::Models::Connect::SessionReauthenticateResponse + + def initialize: (client: FinchAPI::Client) -> void + end + end + end +end diff --git a/sig/finch-api/resources/hris.rbs b/sig/finch-api/resources/hris.rbs new file mode 100644 index 00000000..2ebb06eb --- /dev/null +++ b/sig/finch-api/resources/hris.rbs @@ -0,0 +1,23 @@ +module FinchAPI + module Resources + class HRIS + attr_reader company: FinchAPI::Resources::HRIS::Company + + attr_reader directory: FinchAPI::Resources::HRIS::Directory + + attr_reader individuals: FinchAPI::Resources::HRIS::Individuals + + attr_reader employments: FinchAPI::Resources::HRIS::Employments + + attr_reader payments: FinchAPI::Resources::HRIS::Payments + + attr_reader pay_statements: FinchAPI::Resources::HRIS::PayStatements + + attr_reader documents: FinchAPI::Resources::HRIS::Documents + + attr_reader benefits: FinchAPI::Resources::HRIS::Benefits + + def initialize: (client: FinchAPI::Client) -> void + end + end +end diff --git a/sig/finch-api/resources/hris/benefits.rbs b/sig/finch-api/resources/hris/benefits.rbs new file mode 100644 index 00000000..8d95c109 --- /dev/null +++ b/sig/finch-api/resources/hris/benefits.rbs @@ -0,0 +1,64 @@ +module FinchAPI + module Resources + class HRIS + class Benefits + attr_reader individuals: FinchAPI::Resources::HRIS::Benefits::Individuals + + def create: + ( + ?FinchAPI::Models::HRIS::BenefitCreateParams + | ::Hash[Symbol, top] params + ) -> FinchAPI::Models::HRIS::CreateCompanyBenefitsResponse + | ( + description: String, + frequency: FinchAPI::Models::HRIS::benefit_frequency?, + type: FinchAPI::Models::HRIS::benefit_type?, + request_options: FinchAPI::request_opts + ) -> FinchAPI::Models::HRIS::CreateCompanyBenefitsResponse + + def retrieve: + ( + String benefit_id, + ?FinchAPI::Models::HRIS::BenefitRetrieveParams + | ::Hash[Symbol, top] params + ) -> FinchAPI::Models::HRIS::CompanyBenefit + | ( + String benefit_id, + request_options: FinchAPI::request_opts + ) -> FinchAPI::Models::HRIS::CompanyBenefit + + def update: + ( + String benefit_id, + ?FinchAPI::Models::HRIS::BenefitUpdateParams + | ::Hash[Symbol, top] params + ) -> FinchAPI::Models::HRIS::UpdateCompanyBenefitResponse + | ( + String benefit_id, + description: String, + request_options: FinchAPI::request_opts + ) -> FinchAPI::Models::HRIS::UpdateCompanyBenefitResponse + + def list: + ( + ?FinchAPI::Models::HRIS::BenefitListParams + | ::Hash[Symbol, top] params + ) -> FinchAPI::SinglePage[FinchAPI::Models::HRIS::CompanyBenefit] + | ( + request_options: FinchAPI::request_opts + ) -> FinchAPI::SinglePage[FinchAPI::Models::HRIS::CompanyBenefit] + + def list_supported_benefits: + ( + ?FinchAPI::Models::HRIS::BenefitListSupportedBenefitsParams + | ::Hash[Symbol, top] params + ) -> FinchAPI::SinglePage[FinchAPI::Models::HRIS::SupportedBenefit] + | ( + request_options: FinchAPI::request_opts + ) -> FinchAPI::SinglePage[FinchAPI::Models::HRIS::SupportedBenefit] + + def initialize: (client: FinchAPI::Client) -> void + end + end + end +end diff --git a/sig/finch-api/resources/hris/benefits/individuals.rbs b/sig/finch-api/resources/hris/benefits/individuals.rbs new file mode 100644 index 00000000..465d2e76 --- /dev/null +++ b/sig/finch-api/resources/hris/benefits/individuals.rbs @@ -0,0 +1,58 @@ +module FinchAPI + module Resources + class HRIS + class Benefits + class Individuals + def enroll_many: + ( + String benefit_id, + ?FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams + | ::Hash[Symbol, top] params + ) -> FinchAPI::SinglePage[FinchAPI::Models::HRIS::Benefits::EnrolledIndividual] + | ( + String benefit_id, + individuals: ::Array[FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual], + request_options: FinchAPI::request_opts + ) -> FinchAPI::SinglePage[FinchAPI::Models::HRIS::Benefits::EnrolledIndividual] + + def enrolled_ids: + ( + String benefit_id, + ?FinchAPI::Models::HRIS::Benefits::IndividualEnrolledIDsParams + | ::Hash[Symbol, top] params + ) -> FinchAPI::Models::HRIS::Benefits::IndividualEnrolledIDsResponse + | ( + String benefit_id, + request_options: FinchAPI::request_opts + ) -> FinchAPI::Models::HRIS::Benefits::IndividualEnrolledIDsResponse + + def retrieve_many_benefits: + ( + String benefit_id, + ?FinchAPI::Models::HRIS::Benefits::IndividualRetrieveManyBenefitsParams + | ::Hash[Symbol, top] params + ) -> FinchAPI::SinglePage[FinchAPI::Models::HRIS::Benefits::IndividualBenefit] + | ( + String benefit_id, + individual_ids: String, + request_options: FinchAPI::request_opts + ) -> FinchAPI::SinglePage[FinchAPI::Models::HRIS::Benefits::IndividualBenefit] + + def unenroll_many: + ( + String benefit_id, + ?FinchAPI::Models::HRIS::Benefits::IndividualUnenrollManyParams + | ::Hash[Symbol, top] params + ) -> FinchAPI::SinglePage[FinchAPI::Models::HRIS::Benefits::UnenrolledIndividual] + | ( + String benefit_id, + individual_ids: ::Array[String], + request_options: FinchAPI::request_opts + ) -> FinchAPI::SinglePage[FinchAPI::Models::HRIS::Benefits::UnenrolledIndividual] + + def initialize: (client: FinchAPI::Client) -> void + end + end + end + end +end diff --git a/sig/finch-api/resources/hris/company.rbs b/sig/finch-api/resources/hris/company.rbs new file mode 100644 index 00000000..2bcf0434 --- /dev/null +++ b/sig/finch-api/resources/hris/company.rbs @@ -0,0 +1,18 @@ +module FinchAPI + module Resources + class HRIS + class Company + def retrieve: + ( + ?FinchAPI::Models::HRIS::CompanyRetrieveParams + | ::Hash[Symbol, top] params + ) -> FinchAPI::Models::HRIS::HRISCompany + | ( + request_options: FinchAPI::request_opts + ) -> FinchAPI::Models::HRIS::HRISCompany + + def initialize: (client: FinchAPI::Client) -> void + end + end + end +end diff --git a/sig/finch-api/resources/hris/directory.rbs b/sig/finch-api/resources/hris/directory.rbs new file mode 100644 index 00000000..acb8b868 --- /dev/null +++ b/sig/finch-api/resources/hris/directory.rbs @@ -0,0 +1,31 @@ +module FinchAPI + module Resources + class HRIS + class Directory + def list: + ( + ?FinchAPI::Models::HRIS::DirectoryListParams + | ::Hash[Symbol, top] params + ) -> FinchAPI::IndividualsPage[FinchAPI::Models::HRIS::IndividualInDirectory] + | ( + limit: Integer, + offset: Integer, + request_options: FinchAPI::request_opts + ) -> FinchAPI::IndividualsPage[FinchAPI::Models::HRIS::IndividualInDirectory] + + def list_individuals: + ( + ?FinchAPI::Models::HRIS::DirectoryListIndividualsParams + | ::Hash[Symbol, top] params + ) -> FinchAPI::IndividualsPage[FinchAPI::Models::HRIS::IndividualInDirectory] + | ( + limit: Integer, + offset: Integer, + request_options: FinchAPI::request_opts + ) -> FinchAPI::IndividualsPage[FinchAPI::Models::HRIS::IndividualInDirectory] + + def initialize: (client: FinchAPI::Client) -> void + end + end + end +end diff --git a/sig/finch-api/resources/hris/documents.rbs b/sig/finch-api/resources/hris/documents.rbs new file mode 100644 index 00000000..330be456 --- /dev/null +++ b/sig/finch-api/resources/hris/documents.rbs @@ -0,0 +1,33 @@ +module FinchAPI + module Resources + class HRIS + class Documents + def list: + ( + ?FinchAPI::Models::HRIS::DocumentListParams + | ::Hash[Symbol, top] params + ) -> FinchAPI::Models::HRIS::DocumentListResponse + | ( + individual_ids: ::Array[String], + limit: Integer, + offset: Integer, + types: ::Array[FinchAPI::Models::HRIS::DocumentListParams::type_], + request_options: FinchAPI::request_opts + ) -> FinchAPI::Models::HRIS::DocumentListResponse + + def retreive: + ( + String document_id, + ?FinchAPI::Models::HRIS::DocumentRetreiveParams + | ::Hash[Symbol, top] params + ) -> FinchAPI::Models::HRIS::document_retreive_response + | ( + String document_id, + request_options: FinchAPI::request_opts + ) -> FinchAPI::Models::HRIS::document_retreive_response + + def initialize: (client: FinchAPI::Client) -> void + end + end + end +end diff --git a/sig/finch-api/resources/hris/employments.rbs b/sig/finch-api/resources/hris/employments.rbs new file mode 100644 index 00000000..81511729 --- /dev/null +++ b/sig/finch-api/resources/hris/employments.rbs @@ -0,0 +1,19 @@ +module FinchAPI + module Resources + class HRIS + class Employments + def retrieve_many: + ( + FinchAPI::Models::HRIS::EmploymentRetrieveManyParams + | ::Hash[Symbol, top] params + ) -> FinchAPI::ResponsesPage[FinchAPI::Models::HRIS::EmploymentDataResponse] + | ( + requests: ::Array[FinchAPI::Models::HRIS::EmploymentRetrieveManyParams::Request], + request_options: FinchAPI::request_opts + ) -> FinchAPI::ResponsesPage[FinchAPI::Models::HRIS::EmploymentDataResponse] + + def initialize: (client: FinchAPI::Client) -> void + end + end + end +end diff --git a/sig/finch-api/resources/hris/individuals.rbs b/sig/finch-api/resources/hris/individuals.rbs new file mode 100644 index 00000000..a7880ccd --- /dev/null +++ b/sig/finch-api/resources/hris/individuals.rbs @@ -0,0 +1,20 @@ +module FinchAPI + module Resources + class HRIS + class Individuals + def retrieve_many: + ( + ?FinchAPI::Models::HRIS::IndividualRetrieveManyParams + | ::Hash[Symbol, top] params + ) -> FinchAPI::ResponsesPage[FinchAPI::Models::HRIS::IndividualResponse] + | ( + options: FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Options?, + requests: ::Array[FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Request], + request_options: FinchAPI::request_opts + ) -> FinchAPI::ResponsesPage[FinchAPI::Models::HRIS::IndividualResponse] + + def initialize: (client: FinchAPI::Client) -> void + end + end + end +end diff --git a/sig/finch-api/resources/hris/pay_statements.rbs b/sig/finch-api/resources/hris/pay_statements.rbs new file mode 100644 index 00000000..310292ca --- /dev/null +++ b/sig/finch-api/resources/hris/pay_statements.rbs @@ -0,0 +1,19 @@ +module FinchAPI + module Resources + class HRIS + class PayStatements + def retrieve_many: + ( + FinchAPI::Models::HRIS::PayStatementRetrieveManyParams + | ::Hash[Symbol, top] params + ) -> FinchAPI::ResponsesPage[FinchAPI::Models::HRIS::PayStatementResponse] + | ( + requests: ::Array[FinchAPI::Models::HRIS::PayStatementRetrieveManyParams::Request], + request_options: FinchAPI::request_opts + ) -> FinchAPI::ResponsesPage[FinchAPI::Models::HRIS::PayStatementResponse] + + def initialize: (client: FinchAPI::Client) -> void + end + end + end +end diff --git a/sig/finch-api/resources/hris/payments.rbs b/sig/finch-api/resources/hris/payments.rbs new file mode 100644 index 00000000..a62fcd29 --- /dev/null +++ b/sig/finch-api/resources/hris/payments.rbs @@ -0,0 +1,20 @@ +module FinchAPI + module Resources + class HRIS + class Payments + def list: + ( + FinchAPI::Models::HRIS::PaymentListParams + | ::Hash[Symbol, top] params + ) -> FinchAPI::SinglePage[FinchAPI::Models::HRIS::Payment] + | ( + end_date: Date, + start_date: Date, + request_options: FinchAPI::request_opts + ) -> FinchAPI::SinglePage[FinchAPI::Models::HRIS::Payment] + + def initialize: (client: FinchAPI::Client) -> void + end + end + end +end diff --git a/sig/finch-api/resources/jobs.rbs b/sig/finch-api/resources/jobs.rbs new file mode 100644 index 00000000..b4125ee6 --- /dev/null +++ b/sig/finch-api/resources/jobs.rbs @@ -0,0 +1,11 @@ +module FinchAPI + module Resources + class Jobs + attr_reader automated: FinchAPI::Resources::Jobs::Automated + + attr_reader manual: FinchAPI::Resources::Jobs::Manual + + def initialize: (client: FinchAPI::Client) -> void + end + end +end diff --git a/sig/finch-api/resources/jobs/automated.rbs b/sig/finch-api/resources/jobs/automated.rbs new file mode 100644 index 00000000..93150c5f --- /dev/null +++ b/sig/finch-api/resources/jobs/automated.rbs @@ -0,0 +1,42 @@ +module FinchAPI + module Resources + class Jobs + class Automated + def create: + ( + FinchAPI::Models::Jobs::AutomatedCreateParams + | ::Hash[Symbol, top] params + ) -> FinchAPI::Models::Jobs::AutomatedCreateResponse + | ( + type: FinchAPI::Models::Jobs::AutomatedCreateParams::type_, + params: FinchAPI::Models::Jobs::AutomatedCreateParams::Params, + request_options: FinchAPI::request_opts + ) -> FinchAPI::Models::Jobs::AutomatedCreateResponse + + def retrieve: + ( + String job_id, + ?FinchAPI::Models::Jobs::AutomatedRetrieveParams + | ::Hash[Symbol, top] params + ) -> FinchAPI::Models::Jobs::AutomatedAsyncJob + | ( + String job_id, + request_options: FinchAPI::request_opts + ) -> FinchAPI::Models::Jobs::AutomatedAsyncJob + + def list: + ( + ?FinchAPI::Models::Jobs::AutomatedListParams + | ::Hash[Symbol, top] params + ) -> FinchAPI::Page[FinchAPI::Models::Jobs::AutomatedAsyncJob] + | ( + limit: Integer, + offset: Integer, + request_options: FinchAPI::request_opts + ) -> FinchAPI::Page[FinchAPI::Models::Jobs::AutomatedAsyncJob] + + def initialize: (client: FinchAPI::Client) -> void + end + end + end +end diff --git a/sig/finch-api/resources/jobs/manual.rbs b/sig/finch-api/resources/jobs/manual.rbs new file mode 100644 index 00000000..503befd6 --- /dev/null +++ b/sig/finch-api/resources/jobs/manual.rbs @@ -0,0 +1,20 @@ +module FinchAPI + module Resources + class Jobs + class Manual + def retrieve: + ( + String job_id, + ?FinchAPI::Models::Jobs::ManualRetrieveParams + | ::Hash[Symbol, top] params + ) -> FinchAPI::Models::Jobs::ManualAsyncJob + | ( + String job_id, + request_options: FinchAPI::request_opts + ) -> FinchAPI::Models::Jobs::ManualAsyncJob + + def initialize: (client: FinchAPI::Client) -> void + end + end + end +end diff --git a/sig/finch-api/resources/payroll.rbs b/sig/finch-api/resources/payroll.rbs new file mode 100644 index 00000000..50e50c2f --- /dev/null +++ b/sig/finch-api/resources/payroll.rbs @@ -0,0 +1,9 @@ +module FinchAPI + module Resources + class Payroll + attr_reader pay_groups: FinchAPI::Resources::Payroll::PayGroups + + def initialize: (client: FinchAPI::Client) -> void + end + end +end diff --git a/sig/finch-api/resources/payroll/pay_groups.rbs b/sig/finch-api/resources/payroll/pay_groups.rbs new file mode 100644 index 00000000..c65a495a --- /dev/null +++ b/sig/finch-api/resources/payroll/pay_groups.rbs @@ -0,0 +1,31 @@ +module FinchAPI + module Resources + class Payroll + class PayGroups + def retrieve: + ( + String pay_group_id, + ?FinchAPI::Models::Payroll::PayGroupRetrieveParams + | ::Hash[Symbol, top] params + ) -> FinchAPI::Models::Payroll::PayGroupRetrieveResponse + | ( + String pay_group_id, + request_options: FinchAPI::request_opts + ) -> FinchAPI::Models::Payroll::PayGroupRetrieveResponse + + def list: + ( + ?FinchAPI::Models::Payroll::PayGroupListParams + | ::Hash[Symbol, top] params + ) -> FinchAPI::SinglePage[FinchAPI::Models::Payroll::PayGroupListResponse] + | ( + individual_id: String, + pay_frequencies: ::Array[String], + request_options: FinchAPI::request_opts + ) -> FinchAPI::SinglePage[FinchAPI::Models::Payroll::PayGroupListResponse] + + def initialize: (client: FinchAPI::Client) -> void + end + end + end +end diff --git a/sig/finch-api/resources/providers.rbs b/sig/finch-api/resources/providers.rbs new file mode 100644 index 00000000..3df737da --- /dev/null +++ b/sig/finch-api/resources/providers.rbs @@ -0,0 +1,15 @@ +module FinchAPI + module Resources + class Providers + def list: + ( + ?FinchAPI::Models::ProviderListParams | ::Hash[Symbol, top] params + ) -> FinchAPI::SinglePage[FinchAPI::Models::Provider] + | ( + request_options: FinchAPI::request_opts + ) -> FinchAPI::SinglePage[FinchAPI::Models::Provider] + + def initialize: (client: FinchAPI::Client) -> void + end + end +end diff --git a/sig/finch-api/resources/request_forwarding.rbs b/sig/finch-api/resources/request_forwarding.rbs new file mode 100644 index 00000000..7b7d4ee4 --- /dev/null +++ b/sig/finch-api/resources/request_forwarding.rbs @@ -0,0 +1,21 @@ +module FinchAPI + module Resources + class RequestForwarding + def forward: + ( + FinchAPI::Models::RequestForwardingForwardParams + | ::Hash[Symbol, top] params + ) -> FinchAPI::Models::RequestForwardingForwardResponse + | ( + method_: String, + route: String, + data: String?, + headers: top?, + params: top?, + request_options: FinchAPI::request_opts + ) -> FinchAPI::Models::RequestForwardingForwardResponse + + def initialize: (client: FinchAPI::Client) -> void + end + end +end diff --git a/sig/finch-api/resources/sandbox.rbs b/sig/finch-api/resources/sandbox.rbs new file mode 100644 index 00000000..c8352736 --- /dev/null +++ b/sig/finch-api/resources/sandbox.rbs @@ -0,0 +1,21 @@ +module FinchAPI + module Resources + class Sandbox + attr_reader connections: FinchAPI::Resources::Sandbox::Connections + + attr_reader company: FinchAPI::Resources::Sandbox::Company + + attr_reader directory: FinchAPI::Resources::Sandbox::Directory + + attr_reader individual: FinchAPI::Resources::Sandbox::Individual + + attr_reader employment: FinchAPI::Resources::Sandbox::Employment + + attr_reader payment: FinchAPI::Resources::Sandbox::Payment + + attr_reader jobs: FinchAPI::Resources::Sandbox::Jobs + + def initialize: (client: FinchAPI::Client) -> void + end + end +end diff --git a/sig/finch-api/resources/sandbox/company.rbs b/sig/finch-api/resources/sandbox/company.rbs new file mode 100644 index 00000000..a9591830 --- /dev/null +++ b/sig/finch-api/resources/sandbox/company.rbs @@ -0,0 +1,26 @@ +module FinchAPI + module Resources + class Sandbox + class Company + def update: + ( + FinchAPI::Models::Sandbox::CompanyUpdateParams + | ::Hash[Symbol, top] params + ) -> FinchAPI::Models::Sandbox::CompanyUpdateResponse + | ( + accounts: ::Array[FinchAPI::Models::Sandbox::CompanyUpdateParams::Account]?, + departments: ::Array[FinchAPI::Models::Sandbox::CompanyUpdateParams::Department?]?, + ein: String?, + entity: FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity?, + legal_name: String?, + locations: ::Array[FinchAPI::Models::Location?]?, + primary_email: String?, + primary_phone_number: String?, + request_options: FinchAPI::request_opts + ) -> FinchAPI::Models::Sandbox::CompanyUpdateResponse + + def initialize: (client: FinchAPI::Client) -> void + end + end + end +end diff --git a/sig/finch-api/resources/sandbox/connections.rbs b/sig/finch-api/resources/sandbox/connections.rbs new file mode 100644 index 00000000..7e750f44 --- /dev/null +++ b/sig/finch-api/resources/sandbox/connections.rbs @@ -0,0 +1,24 @@ +module FinchAPI + module Resources + class Sandbox + class Connections + attr_reader accounts: FinchAPI::Resources::Sandbox::Connections::Accounts + + def create: + ( + FinchAPI::Models::Sandbox::ConnectionCreateParams + | ::Hash[Symbol, top] params + ) -> FinchAPI::Models::Sandbox::ConnectionCreateResponse + | ( + provider_id: String, + authentication_type: FinchAPI::Models::Sandbox::ConnectionCreateParams::authentication_type, + employee_size: Integer, + products: ::Array[String], + request_options: FinchAPI::request_opts + ) -> FinchAPI::Models::Sandbox::ConnectionCreateResponse + + def initialize: (client: FinchAPI::Client) -> void + end + end + end +end diff --git a/sig/finch-api/resources/sandbox/connections/accounts.rbs b/sig/finch-api/resources/sandbox/connections/accounts.rbs new file mode 100644 index 00000000..c200782e --- /dev/null +++ b/sig/finch-api/resources/sandbox/connections/accounts.rbs @@ -0,0 +1,34 @@ +module FinchAPI + module Resources + class Sandbox + class Connections + class Accounts + def create: + ( + FinchAPI::Models::Sandbox::Connections::AccountCreateParams + | ::Hash[Symbol, top] params + ) -> FinchAPI::Models::Sandbox::Connections::AccountCreateResponse + | ( + company_id: String, + provider_id: String, + authentication_type: FinchAPI::Models::Sandbox::Connections::AccountCreateParams::authentication_type, + products: ::Array[String], + request_options: FinchAPI::request_opts + ) -> FinchAPI::Models::Sandbox::Connections::AccountCreateResponse + + def update: + ( + ?FinchAPI::Models::Sandbox::Connections::AccountUpdateParams + | ::Hash[Symbol, top] params + ) -> FinchAPI::Models::Sandbox::Connections::AccountUpdateResponse + | ( + connection_status: FinchAPI::Models::connection_status_type, + request_options: FinchAPI::request_opts + ) -> FinchAPI::Models::Sandbox::Connections::AccountUpdateResponse + + def initialize: (client: FinchAPI::Client) -> void + end + end + end + end +end diff --git a/sig/finch-api/resources/sandbox/directory.rbs b/sig/finch-api/resources/sandbox/directory.rbs new file mode 100644 index 00000000..bc3cd7ca --- /dev/null +++ b/sig/finch-api/resources/sandbox/directory.rbs @@ -0,0 +1,19 @@ +module FinchAPI + module Resources + class Sandbox + class Directory + def create: + ( + ?FinchAPI::Models::Sandbox::DirectoryCreateParams + | ::Hash[Symbol, top] params + ) -> FinchAPI::Models::Sandbox::directory_create_response + | ( + body: ::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body], + request_options: FinchAPI::request_opts + ) -> FinchAPI::Models::Sandbox::directory_create_response + + def initialize: (client: FinchAPI::Client) -> void + end + end + end +end diff --git a/sig/finch-api/resources/sandbox/employment.rbs b/sig/finch-api/resources/sandbox/employment.rbs new file mode 100644 index 00000000..e5c02114 --- /dev/null +++ b/sig/finch-api/resources/sandbox/employment.rbs @@ -0,0 +1,38 @@ +module FinchAPI + module Resources + class Sandbox + class Employment + def update: + ( + String individual_id, + ?FinchAPI::Models::Sandbox::EmploymentUpdateParams + | ::Hash[Symbol, top] params + ) -> FinchAPI::Models::Sandbox::EmploymentUpdateResponse + | ( + String individual_id, + class_code: String?, + custom_fields: ::Array[FinchAPI::Models::Sandbox::EmploymentUpdateParams::CustomField], + department: FinchAPI::Models::Sandbox::EmploymentUpdateParams::Department?, + employment: FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment?, + employment_status: FinchAPI::Models::Sandbox::EmploymentUpdateParams::employment_status?, + end_date: String?, + first_name: String?, + income: FinchAPI::Models::Income?, + income_history: ::Array[FinchAPI::Models::Income?]?, + is_active: bool?, + last_name: String?, + latest_rehire_date: String?, + location: FinchAPI::Models::Location?, + manager: FinchAPI::Models::Sandbox::EmploymentUpdateParams::Manager?, + middle_name: String?, + source_id: String, + start_date: String?, + title: String?, + request_options: FinchAPI::request_opts + ) -> FinchAPI::Models::Sandbox::EmploymentUpdateResponse + + def initialize: (client: FinchAPI::Client) -> void + end + end + end +end diff --git a/sig/finch-api/resources/sandbox/individual.rbs b/sig/finch-api/resources/sandbox/individual.rbs new file mode 100644 index 00000000..c1cfa425 --- /dev/null +++ b/sig/finch-api/resources/sandbox/individual.rbs @@ -0,0 +1,32 @@ +module FinchAPI + module Resources + class Sandbox + class Individual + def update: + ( + String individual_id, + ?FinchAPI::Models::Sandbox::IndividualUpdateParams + | ::Hash[Symbol, top] params + ) -> FinchAPI::Models::Sandbox::IndividualUpdateResponse + | ( + String individual_id, + dob: String?, + emails: ::Array[FinchAPI::Models::Sandbox::IndividualUpdateParams::Email]?, + encrypted_ssn: String?, + ethnicity: FinchAPI::Models::Sandbox::IndividualUpdateParams::ethnicity?, + first_name: String?, + gender: FinchAPI::Models::Sandbox::IndividualUpdateParams::gender?, + last_name: String?, + middle_name: String?, + phone_numbers: ::Array[FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber?]?, + preferred_name: String?, + residence: FinchAPI::Models::Location?, + ssn: String?, + request_options: FinchAPI::request_opts + ) -> FinchAPI::Models::Sandbox::IndividualUpdateResponse + + def initialize: (client: FinchAPI::Client) -> void + end + end + end +end diff --git a/sig/finch-api/resources/sandbox/jobs.rbs b/sig/finch-api/resources/sandbox/jobs.rbs new file mode 100644 index 00000000..6b39676f --- /dev/null +++ b/sig/finch-api/resources/sandbox/jobs.rbs @@ -0,0 +1,21 @@ +module FinchAPI + module Resources + class Sandbox + class Jobs + attr_reader configuration: FinchAPI::Resources::Sandbox::Jobs::Configuration + + def create: + ( + FinchAPI::Models::Sandbox::JobCreateParams + | ::Hash[Symbol, top] params + ) -> FinchAPI::Models::Sandbox::JobCreateResponse + | ( + type: FinchAPI::Models::Sandbox::JobCreateParams::type_, + request_options: FinchAPI::request_opts + ) -> FinchAPI::Models::Sandbox::JobCreateResponse + + def initialize: (client: FinchAPI::Client) -> void + end + end + end +end diff --git a/sig/finch-api/resources/sandbox/jobs/configuration.rbs b/sig/finch-api/resources/sandbox/jobs/configuration.rbs new file mode 100644 index 00000000..c6bcdef1 --- /dev/null +++ b/sig/finch-api/resources/sandbox/jobs/configuration.rbs @@ -0,0 +1,31 @@ +module FinchAPI + module Resources + class Sandbox + class Jobs + class Configuration + def retrieve: + ( + ?FinchAPI::Models::Sandbox::Jobs::ConfigurationRetrieveParams + | ::Hash[Symbol, top] params + ) -> FinchAPI::Models::Sandbox::Jobs::configuration_retrieve_response + | ( + request_options: FinchAPI::request_opts + ) -> FinchAPI::Models::Sandbox::Jobs::configuration_retrieve_response + + def update: + ( + FinchAPI::Models::Sandbox::Jobs::ConfigurationUpdateParams + | ::Hash[Symbol, top] params + ) -> FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration + | ( + completion_status: FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::completion_status, + type: FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::type_, + request_options: FinchAPI::request_opts + ) -> FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration + + def initialize: (client: FinchAPI::Client) -> void + end + end + end + end +end diff --git a/sig/finch-api/resources/sandbox/payment.rbs b/sig/finch-api/resources/sandbox/payment.rbs new file mode 100644 index 00000000..f68c17da --- /dev/null +++ b/sig/finch-api/resources/sandbox/payment.rbs @@ -0,0 +1,21 @@ +module FinchAPI + module Resources + class Sandbox + class Payment + def create: + ( + ?FinchAPI::Models::Sandbox::PaymentCreateParams + | ::Hash[Symbol, top] params + ) -> FinchAPI::Models::Sandbox::PaymentCreateResponse + | ( + end_date: String, + pay_statements: ::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement], + start_date: String, + request_options: FinchAPI::request_opts + ) -> FinchAPI::Models::Sandbox::PaymentCreateResponse + + def initialize: (client: FinchAPI::Client) -> void + end + end + end +end diff --git a/sig/finch-api/resources/webhooks.rbs b/sig/finch-api/resources/webhooks.rbs new file mode 100644 index 00000000..df8137d7 --- /dev/null +++ b/sig/finch-api/resources/webhooks.rbs @@ -0,0 +1,7 @@ +module FinchAPI + module Resources + class Webhooks + def initialize: (client: FinchAPI::Client) -> void + end + end +end diff --git a/sig/finch-api/responses_page.rbs b/sig/finch-api/responses_page.rbs new file mode 100644 index 00000000..dfe5d3e0 --- /dev/null +++ b/sig/finch-api/responses_page.rbs @@ -0,0 +1,14 @@ +module FinchAPI + class ResponsesPage[Elem] + include FinchAPI::BasePage[Elem] + + attr_accessor responses: ::Array[Elem] + + def initialize: ( + client: FinchAPI::BaseClient, + req: FinchAPI::BaseClient::request_components, + headers: ::Hash[String, String], + unwrapped: ::Array[top] + ) -> void + end +end diff --git a/sig/finch-api/single_page.rbs b/sig/finch-api/single_page.rbs new file mode 100644 index 00000000..ed1aed9d --- /dev/null +++ b/sig/finch-api/single_page.rbs @@ -0,0 +1,18 @@ +module FinchAPI + class SinglePage[Elem] < ::Array[Elem] + include FinchAPI::BasePage[Elem] + + def initialize: ( + client: FinchAPI::BaseClient, + req: FinchAPI::BaseClient::request_components, + headers: ::Hash[String, String], + unwrapped: ::Array[top] + ) -> void + + def next_page?: -> bool + + def next_page: -> self + + def auto_paging_each: { (Elem arg0) -> void } -> void + end +end diff --git a/sig/finch-api/util.rbs b/sig/finch-api/util.rbs new file mode 100644 index 00000000..0b823e57 --- /dev/null +++ b/sig/finch-api/util.rbs @@ -0,0 +1,109 @@ +module FinchAPI + module Util + def self?.monotonic_secs: -> Float + + def self?.arch: -> String + + def self?.os: -> String + + def self?.primitive?: (top input) -> (bool | top) + + def self?.coerce_boolean: (top input) -> (bool | top) + + def self?.coerce_boolean!: (top input) -> bool? + + def self?.coerce_integer: (top input) -> (Integer | top) + + def self?.coerce_float: (top input) -> (Float | top) + + def self?.coerce_hash: (top input) -> (::Hash[top, top] | top) + + OMIT: top + + def self?.deep_merge_lr: (top lhs, top rhs, concat: bool) -> top + + def self?.deep_merge: ( + *::Array[top] values, + sentinel: top?, + concat: bool + ) -> top + + def self?.dig: ( + ::Hash[Symbol, top] | ::Array[top] | top data, + (Symbol | Integer | ::Array[(Symbol | Integer)])? pick, + ?top? sentinel + ) { + -> top? + } -> top? + + def self?.uri_origin: (URI::Generic uri) -> String + + def self?.interpolate_path: (String | ::Array[String] path) -> String + + def self?.decode_query: (String? query) -> ::Hash[String, ::Array[String]] + + def self?.encode_query: ( + ::Hash[String, (::Array[String] | String)?]? query + ) -> String? + + type parsed_uri = + { + scheme: String?, + host: String?, + port: Integer?, + path: String?, + query: ::Hash[String, ::Array[String]] + } + + def self?.parse_uri: ( + URI::Generic | String url + ) -> FinchAPI::Util::parsed_uri + + def self?.unparse_uri: (FinchAPI::Util::parsed_uri parsed) -> URI::Generic + + def self?.join_parsed_uri: ( + FinchAPI::Util::parsed_uri lhs, + FinchAPI::Util::parsed_uri rhs + ) -> URI::Generic + + def self?.normalized_headers: ( + *::Hash[String, (String + | Integer + | ::Array[(String | Integer)?])?] headers + ) -> ::Hash[String, String] + + def self?.encode_multipart_formdata: ( + StringIO io, + boundary: String, + key: Symbol | String, + val: top + ) -> void + + def self?.encode_content: (::Hash[String, String] headers, top body) -> top + + def self?.decode_content: ( + ::Hash[String, String] headers, + stream: Enumerable[String], + suppress_error: bool + ) -> top + + def self?.fused_enum: (Enumerable[top] enum) { -> void } -> Enumerable[top] + + def self?.close_fused!: (Enumerable[top]? enum) -> void + + def self?.chain_fused: ( + Enumerable[top]? enum + ) { + (Enumerator::Yielder arg0) -> void + } -> void + + type sse_message = + { event: String?, data: String?, id: String?, retry: Integer? } + + def self?.enum_lines: (Enumerable[String] enum) -> Enumerable[String] + + def self?.parse_sse: ( + Enumerable[String] lines + ) -> FinchAPI::Util::sse_message + end +end diff --git a/sig/finch-api/version.rbs b/sig/finch-api/version.rbs new file mode 100644 index 00000000..80866030 --- /dev/null +++ b/sig/finch-api/version.rbs @@ -0,0 +1,3 @@ +module FinchAPI + VERSION: "0.0.1-alpha.0" +end diff --git a/test/finch-api/base_model_test.rb b/test/finch-api/base_model_test.rb new file mode 100644 index 00000000..f1002ea7 --- /dev/null +++ b/test/finch-api/base_model_test.rb @@ -0,0 +1,341 @@ +# frozen_string_literal: true + +require_relative "test_helper" + +class FinchAPI::Test::BaseModelTest < Minitest::Test + class E1 < FinchAPI::Enum + A = :a + B = :b + end + + A1 = FinchAPI::ArrayOf[-> { Integer }] + A2 = FinchAPI::ArrayOf[enum: -> { E1 }] + + def test_basic + assert(E1.is_a?(FinchAPI::Converter)) + assert(A1.is_a?(FinchAPI::Converter)) + end + + def test_basic_coerce + assert_pattern do + FinchAPI::Converter.coerce(A1, [1.0, 2.0, 3.0]) => [1, 2, 3] + end + + assert_pattern do + FinchAPI::Converter.coerce(A2, %w[a b c]) => [:a, :b, :c] + end + end + + def test_basic_dump + assert_pattern do + FinchAPI::Converter.dump(A1, [1.0, 2.0, 3.0]) => [1, 2, 3] + end + + assert_pattern do + FinchAPI::Converter.dump(A2, %w[a b c]) => %w[a b c] + end + end + + def test_primitive_try_strict_coerce + d_now = Date.today + t_now = Time.now + + cases = { + [NilClass, :a] => [true, nil, 0], + [NilClass, nil] => [true, nil, 1], + [Integer, 1.0] => [true, 1, 1], + [Float, 1] => [true, 1.0, 1], + [Date, d_now] => [true, d_now, 1], + [Time, t_now] => [true, t_now, 1] + } + + cases.each do |test, expect| + type, input = test + assert_pattern do + FinchAPI::Converter.try_strict_coerce(type, input) => ^expect + end + end + end + + def test_basic_enum_try_strict_coerce + cases = { + :a => [true, :a, 1], + "a" => [true, :a, 1], + :c => [false, true, 0], + 1 => [false, false, 0] + } + + cases.each do |input, expect| + assert_pattern do + FinchAPI::Converter.try_strict_coerce(E1, input) => ^expect + end + end + end + + def test_basic_array_try_strict_coerce + cases = { + [] => [true, [], 0], + nil => [false, false, 0], + [1, 2, 3] => [true, [1, 2, 3], 3], + [1.0, 2.0, 3.0] => [true, [1, 2, 3], 3], + [1, nil, 3] => [true, [1, nil, 3], 2], + [1, nil, nil] => [true, [1, nil, nil], 1], + [1, "two", 3] => [false, true, 2] + } + + cases.each do |input, expect| + assert_pattern do + FinchAPI::Converter.try_strict_coerce(A1, input) => ^expect + end + end + end + + def test_nested_array_try_strict_coerce + cases = { + %w[a b] => [true, [:a, :b], 2], + %w[a b c] => [false, true, 2] + } + + cases.each do |input, expect| + assert_pattern do + FinchAPI::Converter.try_strict_coerce(A2, input) => ^expect + end + end + end + + class M1 < FinchAPI::BaseModel + required :a, Time + optional :b, E1, api_name: :renamed + required :c, A1 + + request_only do + required :w, Integer + optional :x, String + end + + response_only do + required :y, Integer + optional :z, String + end + end + + class M2 < M1 + required :c, M1 + end + + def test_model_accessors + now = Time.now.round(0) + model = M2.new(a: now.to_s, b: "b", renamed: "a", c: [1.0, 2.0, 3.0], w: 1, y: 1) + + cases = [ + [model.a, now], + [model.b, :a], + [model.c, [1, 2, 3]], + [model.w, 1], + [model.y, 1] + ] + + cases.each do |input, expect| + assert_pattern do + input => ^expect + end + end + end + + def test_model_conversion_accessor + model = M2.new(c: {}) + assert_pattern do + model.c => M1 + end + end + + def test_model_equality + now = Time.now + model1 = M2.new(a: now, b: "b", renamed: "a", c: M1.new, w: 1, y: 1) + model2 = M2.new(a: now, b: "b", renamed: "a", c: M1.new, w: 1, y: 1) + + assert_pattern do + model2 => ^model1 + end + end + + def test_basic_model_coerce + cases = { + {} => M2.new, + {a: nil, b: :a, c: [1.0, 2.0, 3.0], w: 1} => M2.new(a: nil, b: :a, c: [1.0, 2.0, 3.0], w: 1) + } + + cases.each do |input, expect| + assert_pattern do + FinchAPI::Converter.coerce(M2, input) => ^expect + end + end + end + + def test_basic_model_dump + cases = { + nil => nil, + {} => {}, + {w: 1, x: "x", y: 1, z: "z"} => {w: 1, x: "x"}, + [1, 2, 3] => [1, 2, 3] + } + + cases.each do |input, expect| + assert_pattern do + FinchAPI::Converter.dump(M2, input) => ^expect + end + end + end + + def test_basic_model_try_strict_coerce + raw = {a: Time.now, c: [2], y: 1} + addn = {x: "x", n: "n"} + expect_exact = M1.new(raw) + expect_addn = M1.new(**raw, **addn) + + cases = { + {} => [false, true, 0], + raw => [true, expect_exact, 3], + {**raw, **addn} => [true, expect_addn, 4] + } + + cases.each do |input, expect| + assert_pattern do + FinchAPI::Converter.try_strict_coerce(M1, input) => ^expect + end + end + end + + def test_nested_model_dump + now = Time.now + models = [M1, M2] + inputs = [ + M1.new(a: now, b: "a", c: [1.0, 2.0, 3.0], y: 1), + {a: now, b: "a", c: [1.0, 2.0, 3.0], y: 1}, + {"a" => now, b: "", "b" => "a", "c" => [], :c => [1.0, 2.0, 3.0], "y" => 1} + ] + + models.product(inputs).each do |model, input| + assert_pattern do + FinchAPI::Converter.dump(model, input) => {a: now, renamed: "a", c: [1, 2, 3]} + end + end + end + + A3 = FinchAPI::ArrayOf[A1] + + class M3 < M1 + optional :b, E1, api_name: :renamed_again + end + + class U1 < FinchAPI::Union + discriminator :type + variant :a, M1 + variant :b, M3 + end + + class U2 < FinchAPI::Union + variant A1 + variant A3 + end + + def test_basic_union + assert(U1.is_a?(FinchAPI::Converter)) + + assert_pattern do + M1.new => U1 + M3.new => U1 + end + end + + def test_basic_discriminated_union_coerce + common = {a: Time.now, c: [], w: 1} + cases = { + nil => nil, + {type: "a", **common} => M1.new(type: "a", **common), + {type: :b, **common} => M3.new(type: :b, **common), + {type: :c, xyz: 1} => {type: :c, xyz: 1} + } + + cases.each do |input, expect| + assert_pattern do + FinchAPI::Converter.coerce(U1, input) => ^expect + end + end + end + + def test_basic_discriminated_union_dump + now = Time.now + cases = { + nil => nil, + M1.new(a: now, b: :a, c: [1.0, 2.0, 3.0], y: 1) => {a: now, renamed: :a, c: [1, 2, 3]}, + M3.new(b: "a", y: 1) => {renamed_again: "a"}, + {type: :a, b: "a", y: 1} => {type: :a, renamed: "a"}, + {type: "b", b: "a", y: 1} => {type: "b", renamed_again: "a"}, + {type: :c, xyz: 1} => {type: :c, xyz: 1} + } + + cases.each do |input, expect| + assert_pattern do + FinchAPI::Converter.dump(U1, input) => ^expect + end + end + end + + def test_basic_undifferentiated_union_try_strict_coerce + cases = { + [] => [true, [], 0], + [[]] => [true, [[]], 0], + # [nil] => [false, true, 0], + [1, 2, 3] => [true, [1, 2, 3], 3], + [[1, 2, 3], [4, 5, 6]] => [true, [[1, 2, 3], [4, 5, 6]], 6] + } + + cases.each do |input, expect| + assert_pattern do + FinchAPI::Converter.try_strict_coerce(U2, input) => ^expect + end + end + end + + class C1 < FinchAPI::BaseModel + required :a, const: :a + required :b, const: :b, nil?: true + optional :c, const: :c + end + + def test_basic_const + assert_pattern do + C1.dump(C1.new) => {a: :a} + C1.new => {a: :a} + C1.new(a: "a") => {a: :a} + C1.new(b: 2) => {b: 2} + C1.new.a => :a + C1.new.b => nil + C1.new.c => nil + end + end + + class E2 < FinchAPI::Enum + A = :a + B = :b + end + + class U3 < FinchAPI::Union + discriminator :type + variant :a, M1 + variant :b, M3 + end + + def test_basic_eql + assert_equal(FinchAPI::Unknown, FinchAPI::Unknown) + refute_equal(FinchAPI::Unknown, FinchAPI::BooleanModel) + assert_equal(FinchAPI::BooleanModel, FinchAPI::BooleanModel) + + assert_equal(E1, E2) + assert_equal(E1, E2) + + refute_equal(U1, U2) + assert_equal(U1, U3) + end +end diff --git a/test/finch-api/client_test.rb b/test/finch-api/client_test.rb new file mode 100644 index 00000000..4f8f5268 --- /dev/null +++ b/test/finch-api/client_test.rb @@ -0,0 +1,294 @@ +# frozen_string_literal: true + +require_relative "test_helper" + +class FinchAPITest < Minitest::Test + def setup + Thread.current.thread_variable_set(:mock_sleep, []) + end + + def teardown + Thread.current.thread_variable_set(:mock_sleep, nil) + end + + class MockResponse + # @return [Integer] + attr_reader :code + + # @param code [Integer] + # @param headers [Hash{String=>String}] + # + def initialize(code, headers) + @code = code + @headers = {"content-type" => "application/json", **headers} + end + + # @param header [String] + # + # @return [String, nil] + # + def [](header) + @headers[header] + end + + # @param header [String] + # + # @return [Boolean] + # + def key?(header) + @headers.key?(header) + end + end + + class MockRequester + # @return [Integer] + attr_reader :response_code + + # @return [Hash{String=>String}] + attr_reader :response_headers + + # @return [Object] + attr_reader :response_data + + # @return [ArrayObject}>] + attr_accessor :attempts + + # @param response_code [Integer] + # @param response_headers [Hash{String=>String}] + # @param response_data [Object] + # + def initialize(response_code, response_headers, response_data) + @response_code = response_code + @response_headers = response_headers + @response_data = JSON.fast_generate(response_data) + @attempts = [] + end + + # @param req [Hash{Symbol=>Object}] + # + def execute(req) + # Deep copy the request because it is mutated on each retry. + attempts.push(Marshal.load(Marshal.dump(req))) + [MockResponse.new(response_code, response_headers), response_data.grapheme_clusters] + end + end + + def test_client_default_request_default_retry_attempts + finch = FinchAPI::Client.new(base_url: "http://localhost:4010", access_token: "My Access Token") + requester = MockRequester.new(500, {}, {}) + finch.requester = requester + + assert_raises(FinchAPI::InternalServerError) do + finch.hris.directory.list + end + + assert_equal(3, requester.attempts.length) + end + + def test_client_given_request_default_retry_attempts + finch = FinchAPI::Client.new( + base_url: "http://localhost:4010", + access_token: "My Access Token", + max_retries: 3 + ) + requester = MockRequester.new(500, {}, {}) + finch.requester = requester + + assert_raises(FinchAPI::InternalServerError) do + finch.hris.directory.list + end + + assert_equal(4, requester.attempts.length) + end + + def test_client_default_request_given_retry_attempts + finch = FinchAPI::Client.new(base_url: "http://localhost:4010", access_token: "My Access Token") + requester = MockRequester.new(500, {}, {}) + finch.requester = requester + + assert_raises(FinchAPI::InternalServerError) do + finch.hris.directory.list(request_options: {max_retries: 3}) + end + + assert_equal(4, requester.attempts.length) + end + + def test_client_given_request_given_retry_attempts + finch = FinchAPI::Client.new( + base_url: "http://localhost:4010", + access_token: "My Access Token", + max_retries: 3 + ) + requester = MockRequester.new(500, {}, {}) + finch.requester = requester + + assert_raises(FinchAPI::InternalServerError) do + finch.hris.directory.list(request_options: {max_retries: 4}) + end + + assert_equal(5, requester.attempts.length) + end + + def test_client_retry_after_seconds + finch = FinchAPI::Client.new( + base_url: "http://localhost:4010", + access_token: "My Access Token", + max_retries: 1 + ) + requester = MockRequester.new(500, {"retry-after" => "1.3"}, {}) + finch.requester = requester + + assert_raises(FinchAPI::InternalServerError) do + finch.hris.directory.list + end + + assert_equal(2, requester.attempts.length) + assert_equal(1.3, Thread.current.thread_variable_get(:mock_sleep).last) + end + + def test_client_retry_after_date + finch = FinchAPI::Client.new( + base_url: "http://localhost:4010", + access_token: "My Access Token", + max_retries: 1 + ) + requester = MockRequester.new(500, {"retry-after" => (Time.now + 10).httpdate}, {}) + finch.requester = requester + + assert_raises(FinchAPI::InternalServerError) do + Thread.current.thread_variable_set(:time_now, Time.now) + finch.hris.directory.list + Thread.current.thread_variable_set(:time_now, nil) + end + + assert_equal(2, requester.attempts.length) + assert_in_delta(10, Thread.current.thread_variable_get(:mock_sleep).last, 1.0) + end + + def test_client_retry_after_ms + finch = FinchAPI::Client.new( + base_url: "http://localhost:4010", + access_token: "My Access Token", + max_retries: 1 + ) + requester = MockRequester.new(500, {"retry-after-ms" => "1300"}, {}) + finch.requester = requester + + assert_raises(FinchAPI::InternalServerError) do + finch.hris.directory.list + end + + assert_equal(2, requester.attempts.length) + assert_equal(1.3, Thread.current.thread_variable_get(:mock_sleep).last) + end + + def test_retry_count_header + finch = FinchAPI::Client.new(base_url: "http://localhost:4010", access_token: "My Access Token") + requester = MockRequester.new(500, {}, {}) + finch.requester = requester + + assert_raises(FinchAPI::InternalServerError) do + finch.hris.directory.list + end + + retry_count_headers = requester.attempts.map { _1[:headers]["x-stainless-retry-count"] } + assert_equal(%w[0 1 2], retry_count_headers) + end + + def test_omit_retry_count_header + finch = FinchAPI::Client.new(base_url: "http://localhost:4010", access_token: "My Access Token") + requester = MockRequester.new(500, {}, {}) + finch.requester = requester + + assert_raises(FinchAPI::InternalServerError) do + finch.hris.directory.list(request_options: {extra_headers: {"x-stainless-retry-count" => nil}}) + end + + retry_count_headers = requester.attempts.map { _1[:headers]["x-stainless-retry-count"] } + assert_equal([nil, nil, nil], retry_count_headers) + end + + def test_overwrite_retry_count_header + finch = FinchAPI::Client.new(base_url: "http://localhost:4010", access_token: "My Access Token") + requester = MockRequester.new(500, {}, {}) + finch.requester = requester + + assert_raises(FinchAPI::InternalServerError) do + finch.hris.directory.list(request_options: {extra_headers: {"x-stainless-retry-count" => "42"}}) + end + + retry_count_headers = requester.attempts.map { _1[:headers]["x-stainless-retry-count"] } + assert_equal(%w[42 42 42], retry_count_headers) + end + + def test_client_redirect_307 + finch = FinchAPI::Client.new(base_url: "http://localhost:4010", access_token: "My Access Token") + requester = MockRequester.new(307, {"location" => "/redirected"}, {}) + finch.requester = requester + + assert_raises(FinchAPI::APIConnectionError) do + finch.hris.directory.list(request_options: {extra_headers: {}}) + end + + assert_equal("/redirected", requester.attempts.last[:url].path) + assert_equal(requester.attempts.first[:method], requester.attempts.last[:method]) + assert_equal(requester.attempts.first[:body], requester.attempts.last[:body]) + assert_equal( + requester.attempts.first[:headers]["content-type"], + requester.attempts.last[:headers]["content-type"] + ) + end + + def test_client_redirect_303 + finch = FinchAPI::Client.new(base_url: "http://localhost:4010", access_token: "My Access Token") + requester = MockRequester.new(303, {"location" => "/redirected"}, {}) + finch.requester = requester + + assert_raises(FinchAPI::APIConnectionError) do + finch.hris.directory.list(request_options: {extra_headers: {}}) + end + + assert_equal("/redirected", requester.attempts.last[:url].path) + assert_equal(:get, requester.attempts.last[:method]) + assert_nil(requester.attempts.last[:body]) + assert_nil(requester.attempts.last[:headers]["Content-Type"]) + end + + def test_client_redirect_auth_keep_same_origin + finch = FinchAPI::Client.new(base_url: "http://localhost:4010", access_token: "My Access Token") + requester = MockRequester.new(307, {"location" => "/redirected"}, {}) + finch.requester = requester + + assert_raises(FinchAPI::APIConnectionError) do + finch.hris.directory.list(request_options: {extra_headers: {"Authorization" => "Bearer xyz"}}) + end + + assert_equal( + requester.attempts.first[:headers]["authorization"], + requester.attempts.last[:headers]["authorization"] + ) + end + + def test_client_redirect_auth_strip_cross_origin + finch = FinchAPI::Client.new(base_url: "http://localhost:4010", access_token: "My Access Token") + requester = MockRequester.new(307, {"location" => "https://example.com/redirected"}, {}) + finch.requester = requester + + assert_raises(FinchAPI::APIConnectionError) do + finch.hris.directory.list(request_options: {extra_headers: {"Authorization" => "Bearer xyz"}}) + end + + assert_nil(requester.attempts.last[:headers]["Authorization"]) + end + + def test_default_headers + finch = FinchAPI::Client.new(base_url: "http://localhost:4010", access_token: "My Access Token") + requester = MockRequester.new(200, {}, {}) + finch.requester = requester + finch.hris.directory.list + headers = requester.attempts.first[:headers] + + refute_empty(headers["accept"]) + refute_empty(headers["content-type"]) + end +end diff --git a/test/finch-api/resource_namespaces.rb b/test/finch-api/resource_namespaces.rb new file mode 100644 index 00000000..79ba2bd4 --- /dev/null +++ b/test/finch-api/resource_namespaces.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module FinchAPI + module Test + module Resources + module Benefits + end + + module Connect + end + + module Connections + end + + module HRIS + module Benefits + end + end + + module Jobs + end + + module Payroll + end + + module Sandbox + module Connections + end + + module Jobs + end + end + end + end +end diff --git a/test/finch-api/resources/access_tokens_test.rb b/test/finch-api/resources/access_tokens_test.rb new file mode 100644 index 00000000..6c6f2043 --- /dev/null +++ b/test/finch-api/resources/access_tokens_test.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class FinchAPI::Test::Resources::AccessTokensTest < FinchAPI::Test::ResourceTest + def test_create_required_params + response = @finch.access_tokens.create(code: "") + + assert_pattern do + response => FinchAPI::Models::CreateAccessTokenResponse + end + + assert_pattern do + response => { + access_token: String, + account_id: String, + client_type: FinchAPI::Models::CreateAccessTokenResponse::ClientType, + company_id: String, + connection_id: String, + connection_type: FinchAPI::Models::CreateAccessTokenResponse::ConnectionType, + products: ^(FinchAPI::ArrayOf[String]), + provider_id: String, + customer_id: String | nil, + token_type: String | nil + } + end + end +end diff --git a/test/finch-api/resources/account_test.rb b/test/finch-api/resources/account_test.rb new file mode 100644 index 00000000..9ce7dd22 --- /dev/null +++ b/test/finch-api/resources/account_test.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class FinchAPI::Test::Resources::AccountTest < FinchAPI::Test::ResourceTest + def test_disconnect + response = @finch.account.disconnect + + assert_pattern do + response => FinchAPI::Models::DisconnectResponse + end + + assert_pattern do + response => { + status: String + } + end + end + + def test_introspect + response = @finch.account.introspect + + assert_pattern do + response => FinchAPI::Models::Introspection + end + + assert_pattern do + response => { + account_id: String, + authentication_methods: ^(FinchAPI::ArrayOf[FinchAPI::Models::Introspection::AuthenticationMethod]), + client_id: String, + client_type: FinchAPI::Models::Introspection::ClientType, + company_id: String, + connection_id: String, + connection_status: FinchAPI::Models::Introspection::ConnectionStatus, + connection_type: FinchAPI::Models::Introspection::ConnectionType, + customer_email: String | nil, + customer_id: String | nil, + customer_name: String | nil, + manual: FinchAPI::BooleanModel, + payroll_provider_id: String, + products: ^(FinchAPI::ArrayOf[String]), + provider_id: String, + username: String + } + end + end +end diff --git a/test/finch-api/resources/connect/sessions_test.rb b/test/finch-api/resources/connect/sessions_test.rb new file mode 100644 index 00000000..5d413ec8 --- /dev/null +++ b/test/finch-api/resources/connect/sessions_test.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class FinchAPI::Test::Resources::Connect::SessionsTest < FinchAPI::Test::ResourceTest + def test_new_required_params + response = @finch.connect.sessions.new(customer_id: "x", customer_name: "x", products: [:company]) + + assert_pattern do + response => FinchAPI::Models::Connect::SessionNewResponse + end + + assert_pattern do + response => { + connect_url: String, + session_id: String + } + end + end + + def test_reauthenticate_required_params + response = @finch.connect.sessions.reauthenticate(connection_id: "connection_id") + + assert_pattern do + response => FinchAPI::Models::Connect::SessionReauthenticateResponse + end + + assert_pattern do + response => { + connect_url: String, + session_id: String + } + end + end +end diff --git a/test/finch-api/resources/connect_test.rb b/test/finch-api/resources/connect_test.rb new file mode 100644 index 00000000..a8e0bef4 --- /dev/null +++ b/test/finch-api/resources/connect_test.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class FinchAPI::Test::Resources::ConnectTest < FinchAPI::Test::ResourceTest +end diff --git a/test/finch-api/resources/hris/benefits/individuals_test.rb b/test/finch-api/resources/hris/benefits/individuals_test.rb new file mode 100644 index 00000000..c38a05af --- /dev/null +++ b/test/finch-api/resources/hris/benefits/individuals_test.rb @@ -0,0 +1,83 @@ +# frozen_string_literal: true + +require_relative "../../../test_helper" + +class FinchAPI::Test::Resources::HRIS::Benefits::IndividualsTest < FinchAPI::Test::ResourceTest + def test_enroll_many + response = @finch.hris.benefits.individuals.enroll_many("benefit_id") + + assert_pattern do + response => FinchAPI::SinglePage + end + + row = response.to_enum.first + assert_pattern do + row => FinchAPI::Models::HRIS::Benefits::EnrolledIndividual + end + + assert_pattern do + row => { + body: FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Body | nil, + code: FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Code | nil, + individual_id: String | nil + } + end + end + + def test_enrolled_ids + response = @finch.hris.benefits.individuals.enrolled_ids("benefit_id") + + assert_pattern do + response => FinchAPI::Models::HRIS::Benefits::IndividualEnrolledIDsResponse + end + + assert_pattern do + response => { + benefit_id: String, + individual_ids: ^(FinchAPI::ArrayOf[String]) + } + end + end + + def test_retrieve_many_benefits + response = @finch.hris.benefits.individuals.retrieve_many_benefits("benefit_id") + + assert_pattern do + response => FinchAPI::SinglePage + end + + row = response.to_enum.first + assert_pattern do + row => FinchAPI::Models::HRIS::Benefits::IndividualBenefit + end + + assert_pattern do + row => { + body: FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body | nil, + code: Integer | nil, + individual_id: String | nil + } + end + end + + def test_unenroll_many + response = @finch.hris.benefits.individuals.unenroll_many("benefit_id") + + assert_pattern do + response => FinchAPI::SinglePage + end + + row = response.to_enum.first + assert_pattern do + row => FinchAPI::Models::HRIS::Benefits::UnenrolledIndividual + end + + assert_pattern do + row => { + body: FinchAPI::Models::HRIS::Benefits::UnenrolledIndividual::Body | nil, + code: Integer | nil, + individual_id: String | nil + } + end + end +end diff --git a/test/finch-api/resources/hris/benefits_test.rb b/test/finch-api/resources/hris/benefits_test.rb new file mode 100644 index 00000000..ab07d369 --- /dev/null +++ b/test/finch-api/resources/hris/benefits_test.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class FinchAPI::Test::Resources::HRIS::BenefitsTest < FinchAPI::Test::ResourceTest + def test_create + response = @finch.hris.benefits.create + + assert_pattern do + response => FinchAPI::Models::HRIS::CreateCompanyBenefitsResponse + end + + assert_pattern do + response => { + benefit_id: String + } + end + end + + def test_retrieve + response = @finch.hris.benefits.retrieve("benefit_id") + + assert_pattern do + response => FinchAPI::Models::HRIS::CompanyBenefit + end + + assert_pattern do + response => { + benefit_id: String, + description: String | nil, + frequency: FinchAPI::Models::HRIS::BenefitFrequency | nil, + type: FinchAPI::Models::HRIS::BenefitType | nil + } + end + end + + def test_update + response = @finch.hris.benefits.update("benefit_id") + + assert_pattern do + response => FinchAPI::Models::HRIS::UpdateCompanyBenefitResponse + end + + assert_pattern do + response => { + benefit_id: String + } + end + end + + def test_list + response = @finch.hris.benefits.list + + assert_pattern do + response => FinchAPI::SinglePage + end + + row = response.to_enum.first + assert_pattern do + row => FinchAPI::Models::HRIS::CompanyBenefit + end + + assert_pattern do + row => { + benefit_id: String, + description: String | nil, + frequency: FinchAPI::Models::HRIS::BenefitFrequency | nil, + type: FinchAPI::Models::HRIS::BenefitType | nil + } + end + end + + def test_list_supported_benefits + response = @finch.hris.benefits.list_supported_benefits + + assert_pattern do + response => FinchAPI::SinglePage + end + + row = response.to_enum.first + assert_pattern do + row => FinchAPI::Models::HRIS::SupportedBenefit + end + + assert_pattern do + row => { + annual_maximum: FinchAPI::BooleanModel | nil, + catch_up: FinchAPI::BooleanModel | nil, + company_contribution: ^(FinchAPI::ArrayOf[enum: FinchAPI::Models::HRIS::SupportedBenefit::CompanyContribution, nil?: true]) | nil, + description: String | nil, + employee_deduction: ^(FinchAPI::ArrayOf[enum: FinchAPI::Models::HRIS::SupportedBenefit::EmployeeDeduction, nil?: true]) | nil, + frequencies: ^(FinchAPI::ArrayOf[enum: FinchAPI::Models::HRIS::BenefitFrequency, nil?: true]) | nil, + hsa_contribution_limit: ^(FinchAPI::ArrayOf[enum: FinchAPI::Models::HRIS::SupportedBenefit::HsaContributionLimit, nil?: true]) | nil, + type: FinchAPI::Models::HRIS::BenefitType | nil + } + end + end +end diff --git a/test/finch-api/resources/hris/company_test.rb b/test/finch-api/resources/hris/company_test.rb new file mode 100644 index 00000000..f6a7cf5b --- /dev/null +++ b/test/finch-api/resources/hris/company_test.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class FinchAPI::Test::Resources::HRIS::CompanyTest < FinchAPI::Test::ResourceTest + def test_retrieve + response = @finch.hris.company.retrieve + + assert_pattern do + response => FinchAPI::Models::HRIS::HRISCompany + end + + assert_pattern do + response => { + id: String, + accounts: ^(FinchAPI::ArrayOf[FinchAPI::Models::HRIS::HRISCompany::Account]) | nil, + departments: ^(FinchAPI::ArrayOf[FinchAPI::Models::HRIS::HRISCompany::Department, nil?: true]) | nil, + ein: String | nil, + entity: FinchAPI::Models::HRIS::HRISCompany::Entity | nil, + legal_name: String | nil, + locations: ^(FinchAPI::ArrayOf[FinchAPI::Models::Location, nil?: true]) | nil, + primary_email: String | nil, + primary_phone_number: String | nil + } + end + end +end diff --git a/test/finch-api/resources/hris/directory_test.rb b/test/finch-api/resources/hris/directory_test.rb new file mode 100644 index 00000000..1e40cbe6 --- /dev/null +++ b/test/finch-api/resources/hris/directory_test.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class FinchAPI::Test::Resources::HRIS::DirectoryTest < FinchAPI::Test::ResourceTest + def test_list + response = @finch.hris.directory.list + + assert_pattern do + response => FinchAPI::IndividualsPage + end + + row = response.to_enum.first + assert_pattern do + row => FinchAPI::Models::HRIS::IndividualInDirectory + end + + assert_pattern do + row => { + id: String | nil, + department: FinchAPI::Models::HRIS::IndividualInDirectory::Department | nil, + first_name: String | nil, + is_active: FinchAPI::BooleanModel | nil, + last_name: String | nil, + manager: FinchAPI::Models::HRIS::IndividualInDirectory::Manager | nil, + middle_name: String | nil + } + end + end + + def test_list_individuals + response = @finch.hris.directory.list_individuals + + assert_pattern do + response => FinchAPI::IndividualsPage + end + + row = response.to_enum.first + assert_pattern do + row => FinchAPI::Models::HRIS::IndividualInDirectory + end + + assert_pattern do + row => { + id: String | nil, + department: FinchAPI::Models::HRIS::IndividualInDirectory::Department | nil, + first_name: String | nil, + is_active: FinchAPI::BooleanModel | nil, + last_name: String | nil, + manager: FinchAPI::Models::HRIS::IndividualInDirectory::Manager | nil, + middle_name: String | nil + } + end + end +end diff --git a/test/finch-api/resources/hris/documents_test.rb b/test/finch-api/resources/hris/documents_test.rb new file mode 100644 index 00000000..c76aade7 --- /dev/null +++ b/test/finch-api/resources/hris/documents_test.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class FinchAPI::Test::Resources::HRIS::DocumentsTest < FinchAPI::Test::ResourceTest + def test_list + response = @finch.hris.documents.list + + assert_pattern do + response => FinchAPI::Models::HRIS::DocumentListResponse + end + + assert_pattern do + response => { + documents: ^(FinchAPI::ArrayOf[FinchAPI::Models::HRIS::DocumentResponse]), + paging: FinchAPI::Models::Paging + } + end + end + + def test_retreive + response = @finch.hris.documents.retreive("document_id") + + assert_pattern do + response => FinchAPI::Models::HRIS::DocumentRetreiveResponse + end + end +end diff --git a/test/finch-api/resources/hris/employments_test.rb b/test/finch-api/resources/hris/employments_test.rb new file mode 100644 index 00000000..a1355ca5 --- /dev/null +++ b/test/finch-api/resources/hris/employments_test.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class FinchAPI::Test::Resources::HRIS::EmploymentsTest < FinchAPI::Test::ResourceTest + def test_retrieve_many_required_params + response = @finch.hris.employments.retrieve_many(requests: [{individual_id: "individual_id"}]) + + assert_pattern do + response => FinchAPI::ResponsesPage + end + + row = response.to_enum.first + assert_pattern do + row => FinchAPI::Models::HRIS::EmploymentDataResponse + end + + assert_pattern do + row => { + body: FinchAPI::Models::HRIS::EmploymentData | nil, + code: Integer | nil, + individual_id: String | nil + } + end + end +end diff --git a/test/finch-api/resources/hris/individuals_test.rb b/test/finch-api/resources/hris/individuals_test.rb new file mode 100644 index 00000000..3a382ade --- /dev/null +++ b/test/finch-api/resources/hris/individuals_test.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class FinchAPI::Test::Resources::HRIS::IndividualsTest < FinchAPI::Test::ResourceTest + def test_retrieve_many + response = @finch.hris.individuals.retrieve_many + + assert_pattern do + response => FinchAPI::ResponsesPage + end + + row = response.to_enum.first + assert_pattern do + row => FinchAPI::Models::HRIS::IndividualResponse + end + + assert_pattern do + row => { + body: FinchAPI::Models::HRIS::Individual | nil, + code: Integer | nil, + individual_id: String | nil + } + end + end +end diff --git a/test/finch-api/resources/hris/pay_statements_test.rb b/test/finch-api/resources/hris/pay_statements_test.rb new file mode 100644 index 00000000..11920211 --- /dev/null +++ b/test/finch-api/resources/hris/pay_statements_test.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class FinchAPI::Test::Resources::HRIS::PayStatementsTest < FinchAPI::Test::ResourceTest + def test_retrieve_many_required_params + response = @finch.hris.pay_statements.retrieve_many(requests: [{payment_id: "string"}]) + + assert_pattern do + response => FinchAPI::ResponsesPage + end + + row = response.to_enum.first + assert_pattern do + row => FinchAPI::Models::HRIS::PayStatementResponse + end + + assert_pattern do + row => { + body: FinchAPI::Models::HRIS::PayStatementResponseBody | nil, + code: Integer | nil, + payment_id: String | nil + } + end + end +end diff --git a/test/finch-api/resources/hris/payments_test.rb b/test/finch-api/resources/hris/payments_test.rb new file mode 100644 index 00000000..9462cc3b --- /dev/null +++ b/test/finch-api/resources/hris/payments_test.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class FinchAPI::Test::Resources::HRIS::PaymentsTest < FinchAPI::Test::ResourceTest + def test_list_required_params + response = @finch.hris.payments.list(end_date: "2021-01-01", start_date: "2021-01-01") + + assert_pattern do + response => FinchAPI::SinglePage + end + + row = response.to_enum.first + assert_pattern do + row => FinchAPI::Models::HRIS::Payment + end + + assert_pattern do + row => { + id: String | nil, + company_debit: FinchAPI::Models::Money | nil, + debit_date: String | nil, + employee_taxes: FinchAPI::Models::Money | nil, + employer_taxes: FinchAPI::Models::Money | nil, + gross_pay: FinchAPI::Models::Money | nil, + individual_ids: ^(FinchAPI::ArrayOf[String]) | nil, + net_pay: FinchAPI::Models::Money | nil, + pay_date: String | nil, + pay_frequencies: ^(FinchAPI::ArrayOf[enum: FinchAPI::Models::HRIS::Payment::PayFrequency]) | nil, + pay_group_ids: ^(FinchAPI::ArrayOf[String]) | nil, + pay_period: FinchAPI::Models::HRIS::Payment::PayPeriod | nil + } + end + end +end diff --git a/test/finch-api/resources/hris_test.rb b/test/finch-api/resources/hris_test.rb new file mode 100644 index 00000000..d1df4d33 --- /dev/null +++ b/test/finch-api/resources/hris_test.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class FinchAPI::Test::Resources::HRISTest < FinchAPI::Test::ResourceTest +end diff --git a/test/finch-api/resources/jobs/automated_test.rb b/test/finch-api/resources/jobs/automated_test.rb new file mode 100644 index 00000000..d5a1f007 --- /dev/null +++ b/test/finch-api/resources/jobs/automated_test.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class FinchAPI::Test::Resources::Jobs::AutomatedTest < FinchAPI::Test::ResourceTest + def test_create_required_params + response = @finch.jobs.automated.create( + params: {individual_id: "individual_id"}, + type: :w4_form_employee_sync + ) + + assert_pattern do + response => FinchAPI::Models::Jobs::AutomatedCreateResponse + end + + assert_pattern do + response => { + allowed_refreshes: Integer, + job_id: String, + job_url: String, + remaining_refreshes: Integer + } + end + end + + def test_retrieve + response = @finch.jobs.automated.retrieve("job_id") + + assert_pattern do + response => FinchAPI::Models::Jobs::AutomatedAsyncJob + end + + assert_pattern do + response => { + completed_at: Time | nil, + created_at: Time, + job_id: String, + job_url: String, + params: FinchAPI::Models::Jobs::AutomatedAsyncJob::Params | nil, + scheduled_at: Time | nil, + started_at: Time | nil, + status: FinchAPI::Models::Jobs::AutomatedAsyncJob::Status, + type: FinchAPI::Models::Jobs::AutomatedAsyncJob::Type + } + end + end + + def test_list + response = @finch.jobs.automated.list + + assert_pattern do + response => FinchAPI::Page + end + + row = response.to_enum.first + assert_pattern do + row => FinchAPI::Models::Jobs::AutomatedAsyncJob + end + + assert_pattern do + row => { + completed_at: Time | nil, + created_at: Time, + job_id: String, + job_url: String, + params: FinchAPI::Models::Jobs::AutomatedAsyncJob::Params | nil, + scheduled_at: Time | nil, + started_at: Time | nil, + status: FinchAPI::Models::Jobs::AutomatedAsyncJob::Status, + type: FinchAPI::Models::Jobs::AutomatedAsyncJob::Type + } + end + end +end diff --git a/test/finch-api/resources/jobs/manual_test.rb b/test/finch-api/resources/jobs/manual_test.rb new file mode 100644 index 00000000..2811c1b9 --- /dev/null +++ b/test/finch-api/resources/jobs/manual_test.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class FinchAPI::Test::Resources::Jobs::ManualTest < FinchAPI::Test::ResourceTest + def test_retrieve + response = @finch.jobs.manual.retrieve("job_id") + + assert_pattern do + response => FinchAPI::Models::Jobs::ManualAsyncJob + end + + assert_pattern do + response => { + body: ^(FinchAPI::ArrayOf[FinchAPI::Unknown]) | nil, + job_id: String, + status: FinchAPI::Models::Jobs::ManualAsyncJob::Status + } + end + end +end diff --git a/test/finch-api/resources/jobs_test.rb b/test/finch-api/resources/jobs_test.rb new file mode 100644 index 00000000..0b7f1093 --- /dev/null +++ b/test/finch-api/resources/jobs_test.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class FinchAPI::Test::Resources::JobsTest < FinchAPI::Test::ResourceTest +end diff --git a/test/finch-api/resources/payroll/pay_groups_test.rb b/test/finch-api/resources/payroll/pay_groups_test.rb new file mode 100644 index 00000000..e1493647 --- /dev/null +++ b/test/finch-api/resources/payroll/pay_groups_test.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class FinchAPI::Test::Resources::Payroll::PayGroupsTest < FinchAPI::Test::ResourceTest + def test_retrieve + response = @finch.payroll.pay_groups.retrieve("pay_group_id") + + assert_pattern do + response => FinchAPI::Models::Payroll::PayGroupRetrieveResponse + end + + assert_pattern do + response => { + id: String, + individual_ids: ^(FinchAPI::ArrayOf[String]), + name: String, + pay_frequencies: ^(FinchAPI::ArrayOf[enum: FinchAPI::Models::Payroll::PayGroupRetrieveResponse::PayFrequency]) + } + end + end + + def test_list + response = @finch.payroll.pay_groups.list + + assert_pattern do + response => FinchAPI::SinglePage + end + + row = response.to_enum.first + assert_pattern do + row => FinchAPI::Models::Payroll::PayGroupListResponse + end + + assert_pattern do + row => { + id: String | nil, + name: String | nil, + pay_frequencies: ^(FinchAPI::ArrayOf[enum: FinchAPI::Models::Payroll::PayGroupListResponse::PayFrequency]) | nil + } + end + end +end diff --git a/test/finch-api/resources/payroll_test.rb b/test/finch-api/resources/payroll_test.rb new file mode 100644 index 00000000..094ff7e6 --- /dev/null +++ b/test/finch-api/resources/payroll_test.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class FinchAPI::Test::Resources::PayrollTest < FinchAPI::Test::ResourceTest +end diff --git a/test/finch-api/resources/providers_test.rb b/test/finch-api/resources/providers_test.rb new file mode 100644 index 00000000..e754d341 --- /dev/null +++ b/test/finch-api/resources/providers_test.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class FinchAPI::Test::Resources::ProvidersTest < FinchAPI::Test::ResourceTest + def test_list + response = @finch.providers.list + + assert_pattern do + response => FinchAPI::SinglePage + end + + row = response.to_enum.first + assert_pattern do + row => FinchAPI::Models::Provider + end + + assert_pattern do + row => { + id: String | nil, + authentication_methods: ^(FinchAPI::ArrayOf[FinchAPI::Models::Provider::AuthenticationMethod]) | nil, + beta: FinchAPI::BooleanModel | nil, + display_name: String | nil, + icon: String | nil, + logo: String | nil, + manual: FinchAPI::BooleanModel | nil, + mfa_required: FinchAPI::BooleanModel | nil, + primary_color: String | nil, + products: ^(FinchAPI::ArrayOf[String]) | nil + } + end + end +end diff --git a/test/finch-api/resources/request_forwarding_test.rb b/test/finch-api/resources/request_forwarding_test.rb new file mode 100644 index 00000000..5fc1e2e9 --- /dev/null +++ b/test/finch-api/resources/request_forwarding_test.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class FinchAPI::Test::Resources::RequestForwardingTest < FinchAPI::Test::ResourceTest + def test_forward_required_params + response = @finch.request_forwarding.forward(method_: "POST", route: "/people/search") + + assert_pattern do + response => FinchAPI::Models::RequestForwardingForwardResponse + end + + assert_pattern do + response => { + data: String | nil, + headers: FinchAPI::Unknown | nil, + request: FinchAPI::Models::RequestForwardingForwardResponse::Request, + status_code: Integer + } + end + end +end diff --git a/test/finch-api/resources/sandbox/company_test.rb b/test/finch-api/resources/sandbox/company_test.rb new file mode 100644 index 00000000..3727b65f --- /dev/null +++ b/test/finch-api/resources/sandbox/company_test.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class FinchAPI::Test::Resources::Sandbox::CompanyTest < FinchAPI::Test::ResourceTest + def test_update_required_params + response = @finch.sandbox.company.update( + accounts: [{}], + departments: [{}], + ein: "ein", + entity: {}, + legal_name: "legal_name", + locations: [{}], + primary_email: "primary_email", + primary_phone_number: "primary_phone_number" + ) + + assert_pattern do + response => FinchAPI::Models::Sandbox::CompanyUpdateResponse + end + + assert_pattern do + response => { + accounts: ^(FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::CompanyUpdateResponse::Account]) | nil, + departments: ^(FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department, nil?: true]) | nil, + ein: String | nil, + entity: FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity | nil, + legal_name: String | nil, + locations: ^(FinchAPI::ArrayOf[FinchAPI::Models::Location, nil?: true]) | nil, + primary_email: String | nil, + primary_phone_number: String | nil + } + end + end +end diff --git a/test/finch-api/resources/sandbox/connections/accounts_test.rb b/test/finch-api/resources/sandbox/connections/accounts_test.rb new file mode 100644 index 00000000..16ed49d7 --- /dev/null +++ b/test/finch-api/resources/sandbox/connections/accounts_test.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +require_relative "../../../test_helper" + +class FinchAPI::Test::Resources::Sandbox::Connections::AccountsTest < FinchAPI::Test::ResourceTest + def test_create_required_params + response = @finch.sandbox.connections.accounts.create( + company_id: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + provider_id: "provider_id" + ) + + assert_pattern do + response => FinchAPI::Models::Sandbox::Connections::AccountCreateResponse + end + + assert_pattern do + response => { + access_token: String, + account_id: String, + authentication_type: FinchAPI::Models::Sandbox::Connections::AccountCreateResponse::AuthenticationType, + company_id: String, + connection_id: String, + products: ^(FinchAPI::ArrayOf[String]), + provider_id: String + } + end + end + + def test_update + response = @finch.sandbox.connections.accounts.update + + assert_pattern do + response => FinchAPI::Models::Sandbox::Connections::AccountUpdateResponse + end + + assert_pattern do + response => { + account_id: String, + authentication_type: FinchAPI::Models::Sandbox::Connections::AccountUpdateResponse::AuthenticationType, + company_id: String, + products: ^(FinchAPI::ArrayOf[String]), + provider_id: String, + connection_id: String | nil + } + end + end +end diff --git a/test/finch-api/resources/sandbox/connections_test.rb b/test/finch-api/resources/sandbox/connections_test.rb new file mode 100644 index 00000000..ecfb074d --- /dev/null +++ b/test/finch-api/resources/sandbox/connections_test.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class FinchAPI::Test::Resources::Sandbox::ConnectionsTest < FinchAPI::Test::ResourceTest + def test_create_required_params + response = @finch.sandbox.connections.create(provider_id: "provider_id") + + assert_pattern do + response => FinchAPI::Models::Sandbox::ConnectionCreateResponse + end + + assert_pattern do + response => { + access_token: String, + account_id: String, + authentication_type: FinchAPI::Models::Sandbox::ConnectionCreateResponse::AuthenticationType, + company_id: String, + connection_id: String, + products: ^(FinchAPI::ArrayOf[String]), + provider_id: String, + token_type: String | nil + } + end + end +end diff --git a/test/finch-api/resources/sandbox/directory_test.rb b/test/finch-api/resources/sandbox/directory_test.rb new file mode 100644 index 00000000..864b5f29 --- /dev/null +++ b/test/finch-api/resources/sandbox/directory_test.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class FinchAPI::Test::Resources::Sandbox::DirectoryTest < FinchAPI::Test::ResourceTest + def test_create + response = @finch.sandbox.directory.create + + assert_pattern do + response => ^(FinchAPI::ArrayOf[FinchAPI::Unknown]) + end + end +end diff --git a/test/finch-api/resources/sandbox/employment_test.rb b/test/finch-api/resources/sandbox/employment_test.rb new file mode 100644 index 00000000..26caf144 --- /dev/null +++ b/test/finch-api/resources/sandbox/employment_test.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class FinchAPI::Test::Resources::Sandbox::EmploymentTest < FinchAPI::Test::ResourceTest + def test_update + response = @finch.sandbox.employment.update("individual_id") + + assert_pattern do + response => FinchAPI::Models::Sandbox::EmploymentUpdateResponse + end + + assert_pattern do + response => { + id: String | nil, + class_code: String | nil, + custom_fields: ^(FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::EmploymentUpdateResponse::CustomField]) | nil, + department: FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Department | nil, + employment: FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment | nil, + employment_status: FinchAPI::Models::Sandbox::EmploymentUpdateResponse::EmploymentStatus | nil, + end_date: String | nil, + first_name: String | nil, + income: FinchAPI::Models::Income | nil, + income_history: ^(FinchAPI::ArrayOf[FinchAPI::Models::Income, nil?: true]) | nil, + is_active: FinchAPI::BooleanModel | nil, + last_name: String | nil, + latest_rehire_date: String | nil, + location: FinchAPI::Models::Location | nil, + manager: FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Manager | nil, + middle_name: String | nil, + source_id: String | nil, + start_date: String | nil, + title: String | nil + } + end + end +end diff --git a/test/finch-api/resources/sandbox/individual_test.rb b/test/finch-api/resources/sandbox/individual_test.rb new file mode 100644 index 00000000..c909005a --- /dev/null +++ b/test/finch-api/resources/sandbox/individual_test.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class FinchAPI::Test::Resources::Sandbox::IndividualTest < FinchAPI::Test::ResourceTest + def test_update + response = @finch.sandbox.individual.update("individual_id") + + assert_pattern do + response => FinchAPI::Models::Sandbox::IndividualUpdateResponse + end + + assert_pattern do + response => { + id: String | nil, + dob: String | nil, + emails: ^(FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::IndividualUpdateResponse::Email]) | nil, + encrypted_ssn: String | nil, + ethnicity: FinchAPI::Models::Sandbox::IndividualUpdateResponse::Ethnicity | nil, + first_name: String | nil, + gender: FinchAPI::Models::Sandbox::IndividualUpdateResponse::Gender | nil, + last_name: String | nil, + middle_name: String | nil, + phone_numbers: ^(FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::IndividualUpdateResponse::PhoneNumber, nil?: true]) | nil, + preferred_name: String | nil, + residence: FinchAPI::Models::Location | nil, + ssn: String | nil + } + end + end +end diff --git a/test/finch-api/resources/sandbox/jobs/configuration_test.rb b/test/finch-api/resources/sandbox/jobs/configuration_test.rb new file mode 100644 index 00000000..e4b2399e --- /dev/null +++ b/test/finch-api/resources/sandbox/jobs/configuration_test.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +require_relative "../../../test_helper" + +class FinchAPI::Test::Resources::Sandbox::Jobs::ConfigurationTest < FinchAPI::Test::ResourceTest + def test_retrieve + response = @finch.sandbox.jobs.configuration.retrieve + + assert_pattern do + response => ^(FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration]) + end + end + + def test_update_required_params + response = @finch.sandbox.jobs.configuration.update(completion_status: :complete, type: :data_sync_all) + + assert_pattern do + response => FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration + end + + assert_pattern do + response => { + completion_status: FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::CompletionStatus, + type: FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::Type + } + end + end +end diff --git a/test/finch-api/resources/sandbox/jobs_test.rb b/test/finch-api/resources/sandbox/jobs_test.rb new file mode 100644 index 00000000..ad9d419d --- /dev/null +++ b/test/finch-api/resources/sandbox/jobs_test.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class FinchAPI::Test::Resources::Sandbox::JobsTest < FinchAPI::Test::ResourceTest + def test_create_required_params + response = @finch.sandbox.jobs.create(type: :data_sync_all) + + assert_pattern do + response => FinchAPI::Models::Sandbox::JobCreateResponse + end + + assert_pattern do + response => { + allowed_refreshes: Integer, + job_id: String, + job_url: String, + remaining_refreshes: Integer + } + end + end +end diff --git a/test/finch-api/resources/sandbox/payment_test.rb b/test/finch-api/resources/sandbox/payment_test.rb new file mode 100644 index 00000000..4b929dc3 --- /dev/null +++ b/test/finch-api/resources/sandbox/payment_test.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class FinchAPI::Test::Resources::Sandbox::PaymentTest < FinchAPI::Test::ResourceTest + def test_create + response = @finch.sandbox.payment.create + + assert_pattern do + response => FinchAPI::Models::Sandbox::PaymentCreateResponse + end + + assert_pattern do + response => { + pay_date: String, + payment_id: String + } + end + end +end diff --git a/test/finch-api/resources/sandbox_test.rb b/test/finch-api/resources/sandbox_test.rb new file mode 100644 index 00000000..17c439be --- /dev/null +++ b/test/finch-api/resources/sandbox_test.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class FinchAPI::Test::Resources::SandboxTest < FinchAPI::Test::ResourceTest +end diff --git a/test/finch-api/resources/shared_test.rb b/test/finch-api/resources/shared_test.rb new file mode 100644 index 00000000..84b47391 --- /dev/null +++ b/test/finch-api/resources/shared_test.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class FinchAPI::Test::Resources::SharedTest < FinchAPI::Test::ResourceTest +end diff --git a/test/finch-api/resources/webhooks_test.rb b/test/finch-api/resources/webhooks_test.rb new file mode 100644 index 00000000..d8f74b4c --- /dev/null +++ b/test/finch-api/resources/webhooks_test.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class FinchAPI::Test::Resources::WebhooksTest < FinchAPI::Test::ResourceTest +end diff --git a/test/finch-api/test_helper.rb b/test/finch-api/test_helper.rb new file mode 100644 index 00000000..005cb3e2 --- /dev/null +++ b/test/finch-api/test_helper.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# Requiring this file from each test file ensures we always do the following, even +# when running a single-file test: +# - Load the whole gem (as one would in production) +# - Define shared testing namespace so that we don't need to indent test files as much +# - Setting up testing dependencies + +require "digest" +require "singleton" + +require "async" +require "minitest/autorun" +require "minitest/focus" +require "minitest/hooks/test" +require "minitest/proveit" +require "minitest/rg" + +require_relative "../../lib/finch-api" +require_relative "resource_namespaces" + +module Kernel + alias_method :_sleep, :sleep + + def sleep(secs) + case Thread.current.thread_variable_get(:mock_sleep) + in Array => counter + counter << secs + secs + else + _sleep(secs) + end + end +end + +class Time + class << self + alias_method :_now, :now + end + + def self.now = Thread.current.thread_variable_get(:time_now) || _now +end + +class FinchAPI::Test::SingletonClient < FinchAPI::Client + include Singleton + + def initialize + super(base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"), access_token: "My Access Token") + end +end + +class Minitest::Test + include Minitest::Hooks + + make_my_diffs_pretty! + parallelize_me! + prove_it! +end + +class FinchAPI::Test::ResourceTest < Minitest::Test + def async? + return @async unless @async.nil? + @async = Digest::SHA256.hexdigest(self.class.name).to_i(16).odd? + end + + def before_all + super + @finch = FinchAPI::Test::SingletonClient.instance + end + + def around_all = async? ? Sync { super } : super + + def around = async? ? Async { super }.wait : super +end diff --git a/test/finch-api/util_test.rb b/test/finch-api/util_test.rb new file mode 100644 index 00000000..24d9972d --- /dev/null +++ b/test/finch-api/util_test.rb @@ -0,0 +1,467 @@ +# frozen_string_literal: true + +require_relative "test_helper" + +class FinchAPI::Test::UtilDataHandlingTest < Minitest::Test + def test_left_map + assert_pattern do + FinchAPI::Util.deep_merge({a: 1}, nil) => nil + end + end + + def test_right_map + assert_pattern do + FinchAPI::Util.deep_merge(nil, {a: 1}) => {a: 1} + end + end + + def test_disjoint_maps + assert_pattern do + FinchAPI::Util.deep_merge({b: 2}, {a: 1}) => {a: 1, b: 2} + end + end + + def test_overlapping_maps + assert_pattern do + FinchAPI::Util.deep_merge({b: 2, c: 3}, {a: 1, c: 4}) => {a: 1, b: 2, c: 4} + end + end + + def test_nested + assert_pattern do + FinchAPI::Util.deep_merge({b: {b2: 1}}, {b: {b2: 2}}) => {b: {b2: 2}} + end + end + + def test_nested_left_map + assert_pattern do + FinchAPI::Util.deep_merge({b: {b2: 1}}, {b: 6}) => {b: 6} + end + end + + def test_omission + merged = FinchAPI::Util.deep_merge( + {b: {b2: 1, b3: {c: 4, d: 5}}}, + {b: {b2: 1, b3: {c: FinchAPI::Util::OMIT, d: 5}}} + ) + + assert_pattern do + merged => {b: {b2: 1, b3: {d: 5}}} + end + end + + def test_concat + merged = FinchAPI::Util.deep_merge( + {a: {b: [1, 2]}}, + {a: {b: [3, 4]}}, + concat: true + ) + + assert_pattern do + merged => {a: {b: [1, 2, 3, 4]}} + end + end + + def test_concat_false + merged = FinchAPI::Util.deep_merge( + {a: {b: [1, 2]}}, + {a: {b: [3, 4]}}, + concat: false + ) + + assert_pattern do + merged => {a: {b: [3, 4]}} + end + end + + def test_dig + assert_pattern do + FinchAPI::Util.dig(1, nil) => 1 + FinchAPI::Util.dig({a: 1}, :b) => nil + FinchAPI::Util.dig({a: 1}, :a) => 1 + FinchAPI::Util.dig({a: {b: 1}}, [:a, :b]) => 1 + + FinchAPI::Util.dig([], 1) => nil + FinchAPI::Util.dig([nil, [nil, 1]], [1, 1]) => 1 + FinchAPI::Util.dig({a: [nil, 1]}, [:a, 1]) => 1 + FinchAPI::Util.dig([], 1.0) => nil + + FinchAPI::Util.dig(Object, 1) => nil + FinchAPI::Util.dig([], 1.0, 2) => 2 + FinchAPI::Util.dig([], 1.0) { 2 } => 2 + end + end +end + +class FinchAPI::Test::UtilUriHandlingTest < Minitest::Test + def test_parsing + %w[ + http://example.com + https://example.com/ + https://example.com:443/example?e1=e1&e2=e2&e= + ].each do |url| + parsed = FinchAPI::Util.parse_uri(url) + unparsed = FinchAPI::Util.unparse_uri(parsed).to_s + + assert_equal(url, unparsed) + assert_equal(parsed, FinchAPI::Util.parse_uri(unparsed)) + end + end + + def test_joining + cases = [ + [ + "h://a.b/c?d=e", + "h://nope/ignored", + FinchAPI::Util.parse_uri("h://a.b/c?d=e") + ], + [ + "h://a.b/c?d=e", + "h://nope", + { + host: "a.b", + path: "/c", + query: {"d" => ["e"]} + } + ] + ] + + cases.each do |expect, lhs, rhs| + assert_equal( + URI.parse(expect), + FinchAPI::Util.join_parsed_uri( + FinchAPI::Util.parse_uri(lhs), + rhs + ) + ) + end + end + + def test_joining_queries + base_url = "h://a.b/c?d=e" + cases = { + "c2" => "h://a.b/c/c2", + "/c2?f=g" => "h://a.b/c2?f=g", + "/c?f=g" => "h://a.b/c?d=e&f=g" + } + + cases.each do |path, expected| + assert_equal( + URI.parse(expected), + FinchAPI::Util.join_parsed_uri( + FinchAPI::Util.parse_uri(base_url), + {path: path} + ) + ) + end + end +end + +class FinchAPI::Test::UtilFormDataEncodingTest < Minitest::Test + class FakeCGI < CGI + def initialize(headers, io) + @ctype = headers["content-type"] + @io = io + super() + end + + def stdinput = @io + + def env_table + { + "REQUEST_METHOD" => "POST", + "CONTENT_TYPE" => @ctype, + "CONTENT_LENGTH" => stdinput.string.length + } + end + end + + def test_file_encode + headers = {"content-type" => "multipart/form-data"} + cases = { + StringIO.new("abc") => "abc" + } + cases.each do |body, val| + encoded = FinchAPI::Util.encode_content(headers, body) + cgi = FakeCGI.new(*encoded) + assert_pattern do + cgi[""] => ^val + end + end + end + + def test_hash_encode + headers = {"content-type" => "multipart/form-data"} + cases = { + {a: 2, b: 3} => {"a" => "2", "b" => "3"}, + {a: 2, b: nil} => {"a" => "2", "b" => "null"}, + {a: 2, b: [1, 2, 3]} => {"a" => "2", "b" => "1"}, + {file: StringIO.new("a")} => {"file" => "a"} + } + cases.each do |body, testcase| + encoded = FinchAPI::Util.encode_content(headers, body) + cgi = FakeCGI.new(*encoded) + testcase.each do |key, val| + assert_equal(val, cgi[key]) + end + end + end +end + +class FinchAPI::Test::UtilFusedEnumTest < Minitest::Test + def test_closing + arr = [1, 2, 3] + once = 0 + fused = FinchAPI::Util.fused_enum(arr.to_enum) do + once = once.succ + end + + enumerated_1 = fused.to_a + assert_equal(arr, enumerated_1) + assert_equal(1, once) + + enumerated_2 = fused.to_a + assert_equal([], enumerated_2) + assert_equal(1, once) + end + + def test_rewind_chain + once = 0 + fused = FinchAPI::Util.fused_enum([1, 2, 3].to_enum) do + once = once.succ + end + .lazy + .map(&:succ) + .filter(&:odd?) + first = fused.next + + assert_equal(3, first) + assert_equal(0, once) + assert_raises(StopIteration) { fused.rewind.next } + assert_equal(1, once) + end + + def test_external_iteration + it = [1, 2, 3].to_enum + first = it.next + fused = FinchAPI::Util.fused_enum(it) + + assert_equal(1, first) + assert_equal([2, 3], fused.to_a) + end + + def test_close_fused + once = 0 + fused = FinchAPI::Util.fused_enum([1, 2, 3].to_enum) do + once = once.succ + end + + FinchAPI::Util.close_fused!(fused) + + assert_equal(1, once) + assert_equal([], fused.to_a) + assert_equal(1, once) + end + + def test_closed_fused_extern_iteration + taken = 0 + enum = [1, 2, 3].to_enum.lazy.map do + taken = taken.succ + _1 + end + fused = FinchAPI::Util.fused_enum(enum) + first = fused.next + + assert_equal(1, first) + FinchAPI::Util.close_fused!(fused) + assert_equal(1, taken) + end + + def test_closed_fused_taken_count + taken = 0 + enum = [1, 2, 3].to_enum.lazy.map do + taken = taken.succ + _1 + end + .map(&:succ) + .filter(&:odd?) + fused = FinchAPI::Util.fused_enum(enum) + + assert_equal(0, taken) + FinchAPI::Util.close_fused!(fused) + assert_equal(0, taken) + end + + def test_closed_fused_extern_iter_taken_count + taken = 0 + enum = [1, 2, 3].to_enum.lazy.map do + taken = taken.succ + _1 + end + .map(&:succ) + .filter(&:itself) + first = enum.next + assert_equal(2, first) + assert_equal(1, taken) + + fused = FinchAPI::Util.fused_enum(enum) + FinchAPI::Util.close_fused!(fused) + assert_equal(1, taken) + end + + def test_close_fused_sse_chain + taken = 0 + enum = [1, 2, 3].to_enum.lazy.map do + taken = taken.succ + _1 + end + .map(&:succ) + .filter(&:odd?) + .map(&:to_s) + + fused_1 = FinchAPI::Util.fused_enum(enum) + fused_2 = FinchAPI::Util.enum_lines(fused_1) + fused_3 = FinchAPI::Util.parse_sse(fused_2) + + assert_equal(0, taken) + FinchAPI::Util.close_fused!(fused_3) + assert_equal(0, taken) + end +end + +class FinchAPI::Test::UtilSseTest < Minitest::Test + def test_enum_lines + cases = { + %w[] => %w[], + %W[\n\n] => %W[\n \n], + %W[\n \n] => %W[\n \n], + %w[a] => %w[a], + %W[a\nb] => %W[a\n b], + %W[a\nb\n] => %W[a\n b\n], + %W[\na b\n] => %W[\n ab\n], + %W[\na b\n\n] => %W[\n ab\n \n], + %W[\na b] => %W[\n ab] + } + cases.each do |enum, expected| + lines = FinchAPI::Util.enum_lines(enum) + assert_equal(expected, lines.to_a) + end + end + + def test_parse_sse + cases = { + "empty input" => { + [] => [] + }, + "single data event" => { + [ + "data: hello world\n", + "\n" + ] => [ + {data: "hello world\n"} + ] + }, + "multiple data lines" => { + [ + "data: line 1\n", + "data: line 2\n", + "\n" + ] => [ + {data: "line 1\nline 2\n"} + ] + }, + "complete event" => { + [ + "event: update\n", + "id: 123\n", + "data: hello world\n", + "retry: 5000\n", + "\n" + ] => [ + { + event: "update", + id: "123", + data: "hello world\n", + retry: 5000 + } + ] + }, + "multiple events" => { + [ + "event: update\n", + "data: first\n", + "\n", + "event: message\n", + "data: second\n", + "\n" + ] => [ + {event: "update", data: "first\n"}, + {event: "message", data: "second\n"} + ] + }, + "comments" => { + [ + ": this is a comment\n", + "data: actual data\n", + "\n" + ] => [ + {data: "actual data\n"} + ] + }, + "invalid retry" => { + [ + "retry: not a number\n", + "data: hello\n", + "\n" + ] => [ + {data: "hello\n"} + ] + }, + "invalid id with null" => { + [ + "id: bad\0id\n", + "data: hello\n", + "\n" + ] => [ + {data: "hello\n"} + ] + }, + "leading space in value" => { + [ + "data: hello world\n", + "data: leading space\n", + "\n" + ] => [ + {data: "hello world\n leading space\n"} + ] + }, + "no final newline" => { + [ + "data: hello\n", + "id: 1" + ] => [ + {data: "hello\n", id: "1"} + ] + }, + "multiple empty lines" => { + [ + "data: first\n", + "\n", + "\n", + "data: second\n", + "\n" + ] => [ + {data: "first\n"}, + {data: "second\n"} + ] + } + } + + cases.each do |name, test_cases| + test_cases.each do |input, expected| + actual = FinchAPI::Util.parse_sse(input).map(&:compact) + assert_equal(expected, actual, name) + end + end + end +end From 2f8af600f995b28fd2d6e72694e4447eb22145a9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 5 Mar 2025 15:59:35 +0000 Subject: [PATCH 2/2] release: 0.1.0-alpha.1 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 9 +++++++++ Gemfile.lock | 2 +- lib/finch-api/version.rb | 2 +- rbi/lib/finch-api/version.rbi | 2 +- 5 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 CHANGELOG.md diff --git a/.release-please-manifest.json b/.release-please-manifest.json index c4762802..ba6c3483 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.0.1-alpha.0" + ".": "0.1.0-alpha.1" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..a59f455e --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,9 @@ +# Changelog + +## 0.1.0-alpha.1 (2025-03-05) + +Full Changelog: [v0.0.1-alpha.0...v0.1.0-alpha.1](https://github.com/Finch-API/finch-api-ruby/compare/v0.0.1-alpha.0...v0.1.0-alpha.1) + +### Features + +* **api:** manual updates ([#1](https://github.com/Finch-API/finch-api-ruby/issues/1)) ([4273cd2](https://github.com/Finch-API/finch-api-ruby/commit/4273cd2fd27dfb2c0d3c4f73ec0169ff1dfbd501)) diff --git a/Gemfile.lock b/Gemfile.lock index 9370f270..7dcdc3da 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - finch-api (0.0.1.pre.alpha.0) + finch-api (0.1.0.pre.alpha.1) connection_pool GEM diff --git a/lib/finch-api/version.rb b/lib/finch-api/version.rb index 4ac9a633..e85ced32 100644 --- a/lib/finch-api/version.rb +++ b/lib/finch-api/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module FinchAPI - VERSION = "0.0.1-alpha.0" + VERSION = "0.1.0-alpha.1" end diff --git a/rbi/lib/finch-api/version.rbi b/rbi/lib/finch-api/version.rbi index a9a8c777..772681c6 100644 --- a/rbi/lib/finch-api/version.rbi +++ b/rbi/lib/finch-api/version.rbi @@ -1,5 +1,5 @@ # typed: strong module FinchAPI - VERSION = "0.0.1-alpha.0" + VERSION = "0.1.0-alpha.1" end