diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 32e3f314..6992080f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,4 +42,3 @@ jobs: - name: Run tests run: ./scripts/test - diff --git a/.gitignore b/.gitignore index 1ef280e1..8b1228a8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,10 @@ -.prism.log +*.gem .idea/ +.prism.log .ruby-lsp/ .yardoc/ -doc/ -sorbet/ Brewfile.lock.json bin/tapioca -*.gem +doc/ +sorbet/* +!/sorbet/config diff --git a/.release-please-manifest.json b/.release-please-manifest.json index ba6c3483..f14b480a 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.1" + ".": "0.1.0-alpha.2" } \ No newline at end of file diff --git a/.rubocop.yml b/.rubocop.yml index 2663e1d2..b5329c39 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -10,6 +10,10 @@ AllCops: SuggestExtensions: false TargetRubyVersion: 3.1.0 +# Whether MFA is required or not should be left to the token configuration. +Gemspec/RequireMFA: + Enabled: false + # Don't require this extra line break, it can be excessive. Layout/EmptyLineAfterGuardClause: Enabled: false @@ -58,6 +62,20 @@ Layout/MultilineMethodParameterLineBreaks: Layout/SpaceInsideHashLiteralBraces: EnforcedStyle: no_space +# This option occasionally mangles identifier names +Lint/DeprecatedConstants: + Exclude: + - "**/*.rbi" + +# Fairly useful in tests for pattern assertions. +Lint/EmptyInPattern: + Exclude: + - "test/**/*" + +Lint/MissingCopEnableDirective: + Exclude: + - "examples/**/*.rb" + Lint/MissingSuper: Exclude: - "**/*.rbi" @@ -66,9 +84,21 @@ Lint/MissingSuper: Lint/UnusedMethodArgument: AutoCorrect: false +# This option is prone to causing accidental bugs. +Lint/UselessAssignment: + AutoCorrect: false + Exclude: + - "examples/**/*.rb" + Metrics/AbcSize: Enabled: false +Metrics/BlockLength: + AllowedPatterns: + - assert_pattern + Exclude: + - "**/*.rbi" + Metrics/ClassLength: Enabled: false @@ -78,6 +108,10 @@ Metrics/CyclomaticComplexity: Metrics/MethodLength: Enabled: false +Metrics/ModuleLength: + Exclude: + - "**/*.rbi" + Metrics/ParameterLists: Enabled: false @@ -88,10 +122,18 @@ Naming/BlockForwarding: Exclude: - "**/*.rbi" +Naming/ClassAndModuleCamelCase: + Exclude: + - "**/*.rbi" + Naming/MethodParameterName: Exclude: - "**/*.rbi" +Naming/PredicateName: + Exclude: + - "**/*.rbi" + Naming/VariableNumber: Enabled: false @@ -115,11 +157,6 @@ 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: @@ -210,3 +247,8 @@ Style/StringLiterals: # Prefer explicit symbols for clarity; you can search for `:the_symbol`. Style/SymbolArray: EnforcedStyle: brackets + +# This option makes examples harder to read for ruby novices. +Style/SymbolProc: + Exclude: + - "examples/**/*.rb" diff --git a/.solargraph.yml b/.solargraph.yml new file mode 100644 index 00000000..21a04d80 --- /dev/null +++ b/.solargraph.yml @@ -0,0 +1,10 @@ +--- +max_files: 0 +include: + - '*.gemspec' + - 'Rakefile' + - 'examples/**/*.rb' + - 'lib/**/*.rb' + - 'test/finch-api/test_helper.rb' +exclude: + - 'rbi/**/*' diff --git a/.stats.yml b/.stats.yml index 06d70961..fc279b3c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 41 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-7a816d4a5f0039230590a6662f3513d5756344ca662761ecbc49016593f65836.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-69819ddc6d03624ee8d880317fca03afab50a0a843218f1d9f14616e8a003dad.yml diff --git a/.yardopts b/.yardopts index 29c933bc..c7c3301d 100644 --- a/.yardopts +++ b/.yardopts @@ -1 +1,3 @@ --markup markdown +--exclude /rbi +--exclude /sig diff --git a/CHANGELOG.md b/CHANGELOG.md index a59f455e..33f0ec9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,90 @@ # Changelog +## 0.1.0-alpha.2 (2025-03-25) + +Full Changelog: [v0.1.0-alpha.1...v0.1.0-alpha.2](https://github.com/Finch-API/finch-api-ruby/compare/v0.1.0-alpha.1...v0.1.0-alpha.2) + +### ⚠ BREAKING CHANGES + +* use tagged enums in sorbet type definitions ([#57](https://github.com/Finch-API/finch-api-ruby/issues/57)) +* support `for item in stream` style iteration on `Stream`s ([#55](https://github.com/Finch-API/finch-api-ruby/issues/55)) +* **model:** base model should recursively store coerced base models ([#44](https://github.com/Finch-API/finch-api-ruby/issues/44)) + +### Features + +* add jsonl support ([#10](https://github.com/Finch-API/finch-api-ruby/issues/10)) ([74f6a63](https://github.com/Finch-API/finch-api-ruby/commit/74f6a630c57dfbc065fe3dccc20d2a0912241e58)) +* add SKIP_BREW env var to ./scripts/bootstrap ([#14](https://github.com/Finch-API/finch-api-ruby/issues/14)) ([6d5ad33](https://github.com/Finch-API/finch-api-ruby/commit/6d5ad336c49d7492c9a1382cd0eb6e4938a9630d)) +* **api:** api update ([#69](https://github.com/Finch-API/finch-api-ruby/issues/69)) ([1374a6e](https://github.com/Finch-API/finch-api-ruby/commit/1374a6ea4304b03f6ba6a7874ad920baf86d2f6c)) +* consistently accept `AnyHash` types in parameter positions in sorbet ([#62](https://github.com/Finch-API/finch-api-ruby/issues/62)) ([8a5cbf7](https://github.com/Finch-API/finch-api-ruby/commit/8a5cbf70086cb9b903b8b54594995332fdf12a29)) +* prevent tapioca from introspecting the gem internals ([#61](https://github.com/Finch-API/finch-api-ruby/issues/61)) ([a7e45cc](https://github.com/Finch-API/finch-api-ruby/commit/a7e45cc2a440752eba32881faeb37b3192634ce7)) +* support `for item in stream` style iteration on `Stream`s ([#55](https://github.com/Finch-API/finch-api-ruby/issues/55)) ([c59a90c](https://github.com/Finch-API/finch-api-ruby/commit/c59a90c57b184e478192f899a6c2f0b10395f548)) +* support client level methods ([#18](https://github.com/Finch-API/finch-api-ruby/issues/18)) ([92bf05c](https://github.com/Finch-API/finch-api-ruby/commit/92bf05cf13896ff88e36de59a7c780835686f75f)) +* support jsonl uploads ([#32](https://github.com/Finch-API/finch-api-ruby/issues/32)) ([fd8bb80](https://github.com/Finch-API/finch-api-ruby/commit/fd8bb80dd8174a3da2e715313e5348b6ad61e75f)) +* support streaming uploads ([#25](https://github.com/Finch-API/finch-api-ruby/issues/25)) ([5adeadb](https://github.com/Finch-API/finch-api-ruby/commit/5adeadbe7a0cbeb213d9a37cebe6b8c04288c98a)) +* use tagged enums in sorbet type definitions ([#57](https://github.com/Finch-API/finch-api-ruby/issues/57)) ([6956ce9](https://github.com/Finch-API/finch-api-ruby/commit/6956ce97a9b6d7298bc8264914cd0c121d5a3400)) + + +### Bug Fixes + +* bad documentation url for gemdocs.org ([#43](https://github.com/Finch-API/finch-api-ruby/issues/43)) ([10c313f](https://github.com/Finch-API/finch-api-ruby/commit/10c313ffd786e8640c6dfb1665664157ea9a32a9)) +* enums should only coerce matching symbols into strings ([#26](https://github.com/Finch-API/finch-api-ruby/issues/26)) ([d0260a3](https://github.com/Finch-API/finch-api-ruby/commit/d0260a33499410c0e267b01b8583d2d072b7ae61)) +* label optional keyword arguments in *.rbs type definitions ([#53](https://github.com/Finch-API/finch-api-ruby/issues/53)) ([66ba596](https://github.com/Finch-API/finch-api-ruby/commit/66ba5968ed917bc848cb3cb79223cb3f0eb5489a)) +* **model:** base model should recursively store coerced base models ([#44](https://github.com/Finch-API/finch-api-ruby/issues/44)) ([5b67ef6](https://github.com/Finch-API/finch-api-ruby/commit/5b67ef6d68c5d9729c5e1b44dd2b00a05a987342)) +* pages should be able to accept non-converter models ([#65](https://github.com/Finch-API/finch-api-ruby/issues/65)) ([1927323](https://github.com/Finch-API/finch-api-ruby/commit/1927323200a74179fde0a73a976eeea2096b1969)) +* rectify a mistake where wrong lines were chosen during rebase ([#19](https://github.com/Finch-API/finch-api-ruby/issues/19)) ([7ff758e](https://github.com/Finch-API/finch-api-ruby/commit/7ff758e5ccd442f8fe4843f70025f7c302e6d1ba)) +* resolve tapioca derived sorbet errors ([#56](https://github.com/Finch-API/finch-api-ruby/issues/56)) ([0b1c07a](https://github.com/Finch-API/finch-api-ruby/commit/0b1c07a2abd333fc000f785066987fe951f7bf59)) +* sorbet class aliases are not type aliases ([#52](https://github.com/Finch-API/finch-api-ruby/issues/52)) ([f2abbe9](https://github.com/Finch-API/finch-api-ruby/commit/f2abbe9fb129d81f6b345f522af1ff36a0044786)) +* yard example tag formatting ([#59](https://github.com/Finch-API/finch-api-ruby/issues/59)) ([de42306](https://github.com/Finch-API/finch-api-ruby/commit/de42306ed5186b7031889b725609b28b8b04b35c)) + + +### Chores + +* `BaseModel` fields that are `BaseModel` typed should also accept `Hash` ([#58](https://github.com/Finch-API/finch-api-ruby/issues/58)) ([a519092](https://github.com/Finch-API/finch-api-ruby/commit/a519092120ad92d1ad8bb1fa1cdc18902b3842c4)) +* add `[@yieldparam](https://github.com/yieldparam)` to yard doc ([#48](https://github.com/Finch-API/finch-api-ruby/issues/48)) ([07be571](https://github.com/Finch-API/finch-api-ruby/commit/07be5719c8710e6b876ae13593daf13d744800ee)) +* add `sorbet` section to README ([#15](https://github.com/Finch-API/finch-api-ruby/issues/15)) ([353250b](https://github.com/Finch-API/finch-api-ruby/commit/353250b0ba9474617d2c844eb01d9753405b87ca)) +* add example directory ([#51](https://github.com/Finch-API/finch-api-ruby/issues/51)) ([f7dbdf7](https://github.com/Finch-API/finch-api-ruby/commit/f7dbdf7c341bd6622b5caa66abc010218ff7669b)) +* add more examples to README.md ([#16](https://github.com/Finch-API/finch-api-ruby/issues/16)) ([00b0b73](https://github.com/Finch-API/finch-api-ruby/commit/00b0b73708af0e39e23f03028bb4d32250c07cf4)) +* add most doc strings to rbi type definitions ([#33](https://github.com/Finch-API/finch-api-ruby/issues/33)) ([e366baa](https://github.com/Finch-API/finch-api-ruby/commit/e366baa122865a1734c9e17bba6a0531c115c1a3)) +* add type annotations for enum and union member listing methods ([#60](https://github.com/Finch-API/finch-api-ruby/issues/60)) ([414af1a](https://github.com/Finch-API/finch-api-ruby/commit/414af1a8c761ded84a26cd5ad1d85838fe372cdf)) +* bump lockfile ([#7](https://github.com/Finch-API/finch-api-ruby/issues/7)) ([a644446](https://github.com/Finch-API/finch-api-ruby/commit/a64444614bbee1dd6cb93d1f5ba3440eb15e192c)) +* disable dangerous rubocop auto correct rule ([#67](https://github.com/Finch-API/finch-api-ruby/issues/67)) ([1d98cb0](https://github.com/Finch-API/finch-api-ruby/commit/1d98cb0aabcaa378bc08b87e54ae9bdb476d077e)) +* disable overloads in `*.rbs` definitions for readable LSP errors ([#54](https://github.com/Finch-API/finch-api-ruby/issues/54)) ([2d71742](https://github.com/Finch-API/finch-api-ruby/commit/2d717426f7371291b3d6cde32f63d179a3ba5da0)) +* disable unnecessary linter rules for sorbet manifests ([#47](https://github.com/Finch-API/finch-api-ruby/issues/47)) ([50e9efe](https://github.com/Finch-API/finch-api-ruby/commit/50e9efea70eb91f9cb8fb1e39205ca16009fefcc)) +* do not label modules as abstract ([#42](https://github.com/Finch-API/finch-api-ruby/issues/42)) ([f99868b](https://github.com/Finch-API/finch-api-ruby/commit/f99868b7b10d354a735276e8f2d5dba226daf35c)) +* document Client's concurrency capability ([#46](https://github.com/Finch-API/finch-api-ruby/issues/46)) ([24aba19](https://github.com/Finch-API/finch-api-ruby/commit/24aba192cb119c823905ee9296f65870ce697aa5)) +* document union variants in yard doc ([#37](https://github.com/Finch-API/finch-api-ruby/issues/37)) ([623ce81](https://github.com/Finch-API/finch-api-ruby/commit/623ce8130371bb406cd138fb07757932a2522464)) +* ensure doc strings for rbi method arguments ([#34](https://github.com/Finch-API/finch-api-ruby/issues/34)) ([a592cdf](https://github.com/Finch-API/finch-api-ruby/commit/a592cdf6fea4bab81c60e25ea1149a38b3e2ad75)) +* error fields are now mutable in keeping with rest of SDK ([#36](https://github.com/Finch-API/finch-api-ruby/issues/36)) ([99d4319](https://github.com/Finch-API/finch-api-ruby/commit/99d43196e06882dfc973a70a2e5294cd5d2c28dc)) +* fused enum should use faster internal iteration by default ([#22](https://github.com/Finch-API/finch-api-ruby/issues/22)) ([c4ee170](https://github.com/Finch-API/finch-api-ruby/commit/c4ee1708018b48967978e1a94c882e15bc920aa5)) +* generate better supported rbi signatures ([#12](https://github.com/Finch-API/finch-api-ruby/issues/12)) ([e093ce4](https://github.com/Finch-API/finch-api-ruby/commit/e093ce41d1d87e0848f49cde7e5eac8e8d11bbe5)) +* ignore some spurious linter warnings and formatting changes ([#45](https://github.com/Finch-API/finch-api-ruby/issues/45)) ([2dce5e9](https://github.com/Finch-API/finch-api-ruby/commit/2dce5e92fca8b7a9f70ddee082390d0fbb470d21)) +* improve documentation ([#24](https://github.com/Finch-API/finch-api-ruby/issues/24)) ([1896856](https://github.com/Finch-API/finch-api-ruby/commit/1896856a88362566dd81a1afed4e97096b62c7d6)) +* improve rbi typedef for page classes ([#29](https://github.com/Finch-API/finch-api-ruby/issues/29)) ([ac6b999](https://github.com/Finch-API/finch-api-ruby/commit/ac6b9994ed71d42702133590144fe5a22c273111)) +* **internal:** add sorbet config for SDK local development ([#50](https://github.com/Finch-API/finch-api-ruby/issues/50)) ([bb63811](https://github.com/Finch-API/finch-api-ruby/commit/bb6381194d39b2794921cea5c885be5157bd1163)) +* **internal:** codegen related update ([#17](https://github.com/Finch-API/finch-api-ruby/issues/17)) ([b0d79ac](https://github.com/Finch-API/finch-api-ruby/commit/b0d79ac02e99852b1ab14892a0f14fa275105819)) +* **internal:** codegen related update ([#20](https://github.com/Finch-API/finch-api-ruby/issues/20)) ([d715c02](https://github.com/Finch-API/finch-api-ruby/commit/d715c0202babd8cdd2911f8cd390611865c0955f)) +* **internal:** remove extra empty newlines ([#30](https://github.com/Finch-API/finch-api-ruby/issues/30)) ([d8c970e](https://github.com/Finch-API/finch-api-ruby/commit/d8c970e6728b8a61c13e518850776d75cbdcece8)) +* **internal:** version bump ([#4](https://github.com/Finch-API/finch-api-ruby/issues/4)) ([1e24a6c](https://github.com/Finch-API/finch-api-ruby/commit/1e24a6c308f2bda2dfc8d253bad8c0e7c007d149)) +* mark non-inheritable SDK internal classes as final ([#39](https://github.com/Finch-API/finch-api-ruby/issues/39)) ([69bb3a3](https://github.com/Finch-API/finch-api-ruby/commit/69bb3a3c0831b8940709dd3b14115fefbcc7508e)) +* modify sorbet initializers to better support auto-completion ([#13](https://github.com/Finch-API/finch-api-ruby/issues/13)) ([3271474](https://github.com/Finch-API/finch-api-ruby/commit/327147477a34f2f0bd0e0e6b813a2646493ca2df)) +* more readable output when tests fail ([#68](https://github.com/Finch-API/finch-api-ruby/issues/68)) ([7af6e91](https://github.com/Finch-API/finch-api-ruby/commit/7af6e913d4c8acbac489d14d33ed3df443e9fd7e)) +* move examples into tests ([#9](https://github.com/Finch-API/finch-api-ruby/issues/9)) ([4ba4a39](https://github.com/Finch-API/finch-api-ruby/commit/4ba4a39da10518ea5f4ec13f35d2ffcdac9931dc)) +* pagination ([#21](https://github.com/Finch-API/finch-api-ruby/issues/21)) ([e95562f](https://github.com/Finch-API/finch-api-ruby/commit/e95562f4be1b85f0c5de44037eb0c64ac0c66dde)) +* recursively accept `AnyHash` for `BaseModel`s in arrays and hashes ([#63](https://github.com/Finch-API/finch-api-ruby/issues/63)) ([727a5b5](https://github.com/Finch-API/finch-api-ruby/commit/727a5b5a14aa309e4db8a21fac8689f8924863df)) +* reduce verbosity in type declarations ([#66](https://github.com/Finch-API/finch-api-ruby/issues/66)) ([47de683](https://github.com/Finch-API/finch-api-ruby/commit/47de6833d2762936d4dd2be7f21466c1a7f2d6b1)) +* refactor BasePage to have initializer ([#28](https://github.com/Finch-API/finch-api-ruby/issues/28)) ([0b49043](https://github.com/Finch-API/finch-api-ruby/commit/0b49043f7bcd2fa9cc522ca65945634add1338a8)) +* remove stale thread local checks ([#27](https://github.com/Finch-API/finch-api-ruby/issues/27)) ([3fbfa6c](https://github.com/Finch-API/finch-api-ruby/commit/3fbfa6cf8802942f58d331a1193b9ed537f5669d)) +* rename misleading variable ([#8](https://github.com/Finch-API/finch-api-ruby/issues/8)) ([0b3397f](https://github.com/Finch-API/finch-api-ruby/commit/0b3397f11d90ca29a56b7fa7f162d96edf07be06)) +* sdk client internal refactoring ([#41](https://github.com/Finch-API/finch-api-ruby/issues/41)) ([a0e8fe9](https://github.com/Finch-API/finch-api-ruby/commit/a0e8fe940fbeab06cfd62c3faea8b32b93500234)) +* sdk internal updates ([#31](https://github.com/Finch-API/finch-api-ruby/issues/31)) ([74a9ff6](https://github.com/Finch-API/finch-api-ruby/commit/74a9ff6839ce6c108514d1197987e5a6223a571e)) +* slightly more consistent type definition layout ([#38](https://github.com/Finch-API/finch-api-ruby/issues/38)) ([cf75aa6](https://github.com/Finch-API/finch-api-ruby/commit/cf75aa6659727bf0f0c429df3e2cdb51ccb49541)) +* support different EOLs in streaming ([#11](https://github.com/Finch-API/finch-api-ruby/issues/11)) ([4eb4cc3](https://github.com/Finch-API/finch-api-ruby/commit/4eb4cc36954eeb5fb39beee0d335d573cddd11b6)) +* switch to prettier looking sorbet annotations ([#64](https://github.com/Finch-API/finch-api-ruby/issues/64)) ([797cdf7](https://github.com/Finch-API/finch-api-ruby/commit/797cdf7ff1377392296b80b8681447b47de0c3a9)) +* touch up sdk usage examples ([#35](https://github.com/Finch-API/finch-api-ruby/issues/35)) ([f17f349](https://github.com/Finch-API/finch-api-ruby/commit/f17f349ca92249203baa08738ed0f6100c280f6c)) +* update custom timeout header name ([#6](https://github.com/Finch-API/finch-api-ruby/issues/6)) ([e19278e](https://github.com/Finch-API/finch-api-ruby/commit/e19278e42797781e1ed237688abe62a2b9e85b4c)) +* use generics instead of overloading for sorbet type definitions ([#40](https://github.com/Finch-API/finch-api-ruby/issues/40)) ([e8e32c7](https://github.com/Finch-API/finch-api-ruby/commit/e8e32c72394607c86788de884fa2ed8335e4d8bf)) +* use multi-line formatting style for really long lines ([#49](https://github.com/Finch-API/finch-api-ruby/issues/49)) ([96c2c73](https://github.com/Finch-API/finch-api-ruby/commit/96c2c73fa1e7994dffdbeabafee3c8dc93c0a46d)) + ## 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) diff --git a/Gemfile.lock b/Gemfile.lock index 7dcdc3da..0febc9da 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - finch-api (0.1.0.pre.alpha.1) + finch-api (0.1.0.pre.alpha.2) connection_pool GEM @@ -93,7 +93,7 @@ GEM rbs (3.8.1) logger regexp_parser (2.10.0) - rubocop (1.72.2) + rubocop (1.73.2) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) @@ -108,13 +108,13 @@ GEM 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) + sorbet (0.5.11888) + sorbet-static (= 0.5.11888) + sorbet-runtime (0.5.11888) + sorbet-static (0.5.11888-x86_64-linux) + sorbet-static-and-runtime (0.5.11888) + sorbet (= 0.5.11888) + sorbet-runtime (= 0.5.11888) spoom (1.5.4) erubi (>= 1.10.0) prism (>= 0.28.0) @@ -157,7 +157,7 @@ GEM tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (2.6.0) - uri (1.0.2) + uri (1.0.3) webrick (1.9.1) yard (0.9.37) yard-sorbet (0.9.0) diff --git a/README.md b/README.md index 5b36337d..0033c802 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,18 @@ # Finch Ruby API library -The Finch Ruby library provides convenient access to the Finch REST API from any Ruby 3.0.0+ -application. +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). +Documentation for released of this gem can be found [on RubyDoc](https://gemdocs.org/gems/finch-api). 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`: +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" @@ -26,8 +24,7 @@ To fetch an initial copy of the gem: bundle install ``` -To update the version used by your application when updates are pushed to -GitHub: +To update the version used by your application when updates are pushed to GitHub: ```sh bundle update finch-api @@ -46,11 +43,28 @@ page = finch.hris.directory.list puts(page.id) ``` +### Pagination + +List methods in the Finch API are paginated. + +This library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually: + +```ruby +page = finch.hris.directory.list + +# Fetch single item from page. +directory = page.individuals[0] +puts(directory.id) + +# Automatically fetches more pages as needed. +page.auto_paging_each do |directory| + puts(directory.id) +end +``` + ### 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: +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 @@ -78,10 +92,9 @@ Error codes are as followed: ### 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. +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: @@ -98,8 +111,8 @@ 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. + +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: @@ -113,12 +126,42 @@ finch = FinchAPI::Client.new( finch.hris.directory.list(request_options: {timeout: 5}) ``` +## Sorbet Support + +**This library emits an intentional warning under the [`tapioca` toolchain](https://github.com/Shopify/tapioca)**. This is normal, and does not impact functionality. + +This library is written with [Sorbet type definitions](https://sorbet.org/docs/rbi). However, there is no runtime dependency on the `sorbet-runtime`. + +What this means is that while you can use Sorbet to type check your code statically, and benefit from the [Sorbet Language Server](https://sorbet.org/docs/lsp) in your editor, there is no runtime type checking and execution overhead from Sorbet itself. + +Due to limitations with the Sorbet type system, where a method otherwise can take an instance of `FinchAPI::BaseModel` class, you will need to use the `**` splat operator to pass the arguments: + +Please follow Sorbet's [setup guides](https://sorbet.org/docs/adopting) for best experience. + +```ruby +model = DirectoryListParams.new + +finch.hris.directory.list(**model) +``` + +## Advanced + +### Concurrency & Connection Pooling + +The `FinchAPI::Client` instances are thread-safe, and should be re-used across multiple threads. By default, each `Client` have their own HTTP connection pool, with a maximum number of connections equal to thread count. + +When the maximum number of connections has been checked out from the connection pool, the `Client` will wait for an in use connection to become available. The queue time for this mechanism is accounted for by the per-request timeout. + +Unless otherwise specified, other classes in the SDK do not have locks protecting their underlying data structure. + +Currently, `FinchAPI::Client` instances are only fork-safe if there are no in-flight HTTP requests. + ## 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. +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. + +This package considers improvements to the (non-runtime) `*.rbi` and `*.rbs` type definitions to be non-breaking changes. ## Requirements -Ruby 3.0 or higher. +Ruby 3.0.0 or higher. diff --git a/Rakefile b/Rakefile index 062fd055..d1a3eb10 100644 --- a/Rakefile +++ b/Rakefile @@ -1,20 +1,25 @@ # frozen_string_literal: true +require "securerandom" +require "shellwords" + 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]) +task(default: [:test]) + +multitask(:test) do + rb = + FileList[ENV.fetch("TEST", "./test/**/*_test.rb")] + .map { "require_relative(#{_1.dump});" } + .join -Minitest::TestTask.create do |t| - t.libs = %w[.] - t.test_globs = ENV.fetch("TEST", "./test/**/*_test.rb") + ruby(*%w[-w -e], rb, verbose: false) { fail unless _1 } end RuboCop::RakeTask.new(:rubocop) do |t| @@ -35,24 +40,25 @@ multitask(:syntax_tree) do inplace = /darwin|bsd/ =~ RUBY_PLATFORM ? %w[-i''] : %w[-i] uuid = SecureRandom.uuid - # `syntax_tree` has trouble with `rbs`'s class aliases + # `syntax_tree` has trouble with `rbs`'s class & module aliases sed = xargs + %w[sed -E] + inplace + %w[-e] - # annotate class aliases with a unique comment - pre = sed + ["s/class ([^ ]+) = (.+$)/# #{uuid}\\n\\1: \\2/", "--"] + # annotate unprocessable aliases with a unique comment + pre = sed + ["s/(class|module) ([^ ]+) = (.+$)/# \\1 #{uuid}\\n\\2: \\3/", "--"] fmt = xargs + %w[stree write --plugin=rbs --] - # remove the unique comment and transform class aliases to type aliases + # remove the unique comment and unprocessable aliases to type aliases subst = <<~SED - s/# #{uuid}// + s/# (class|module) #{uuid}/\\1/ t l1 b + : l1 - n - s/([^ :]+): (.+$)/class \\1 = \\2/ + N + s/\\n *([^:]+): (.+)$/ \\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` + # for each line: + # 1. try transform the unique comment into `class | module`, if successful, branch to label `l1`. + # 2. at label `l1`, join previously annotated line with `class | module` information. pst = sed + [subst, "--"] # transform class aliases to type aliases, which syntax tree has no trouble with @@ -70,7 +76,7 @@ multitask(:steep) do end multitask(:sorbet) do - sh(*%w[srb typecheck -- .], chdir: "./rbi") + sh(*%w[srb typecheck]) end file("sorbet/tapioca") do diff --git a/examples/.keep b/examples/.keep new file mode 100644 index 00000000..d8c73e93 --- /dev/null +++ b/examples/.keep @@ -0,0 +1,4 @@ +File generated from our OpenAPI spec by Stainless. + +This directory can be used to store example files demonstrating usage of this SDK. +It is ignored by Stainless code generation and its content (other than this keep file) won't be touched. \ No newline at end of file diff --git a/finch-api.gemspec b/finch-api.gemspec index 6ab22ac2..e3cc699a 100644 --- a/finch-api.gemspec +++ b/finch-api.gemspec @@ -12,8 +12,8 @@ Gem::Specification.new do |s| 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.homepage = "https://gemdocs.org/gems/finch-api" 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" + s.metadata["rubygems_mfa_required"] = false.to_s end diff --git a/lib/finch-api.rb b/lib/finch-api.rb index 1b0521be..aca387c2 100644 --- a/lib/finch-api.rb +++ b/lib/finch-api.rb @@ -1,5 +1,20 @@ # frozen_string_literal: true +# We already ship the preferred sorbet manifests in the package itself. +# `tapioca` currently does not offer us a way to opt out of unnecessary compilation. +if Object.const_defined?(:Tapioca) && caller_locations.any? { _1.path.end_with?("tapioca/cli.rb") } + Warning.warn( + <<~WARN + \n + ⚠️ skipped loading of "finch-api" gem under `tapioca`. + + This message is normal and expected if you are running a `tapioca` command, and does not impact `.rbi` generation. + \n + WARN + ) + return +end + # Standard libraries. require "cgi" require "date" @@ -7,6 +22,7 @@ require "etc" require "json" require "net/http" +require "pathname" require "rbconfig" require "securerandom" require "set" @@ -104,6 +120,7 @@ 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_list_response" 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" diff --git a/lib/finch-api/base_client.rb b/lib/finch-api/base_client.rb index 4f024e48..a601f5db 100644 --- a/lib/finch-api/base_client.rb +++ b/lib/finch-api/base_client.rb @@ -1,32 +1,31 @@ # frozen_string_literal: true module FinchAPI - # @private + # @api 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 - } + 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 + # @api private # # @param req [Hash{Symbol=>Object}] # # @raise [ArgumentError] - # def validate!(req) keys = [:method, :path, :query, :headers, :body, :unwrap, :page, :stream, :model, :options] case req @@ -41,13 +40,12 @@ def validate!(req) end end - # @private + # @api 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] @@ -65,7 +63,7 @@ def should_retry?(status, headers:) end end - # @private + # @api private # # @param request [Hash{Symbol=>Object}] . # @@ -86,7 +84,6 @@ def should_retry?(status, headers:) # @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 = @@ -128,14 +125,27 @@ def follow_redirect(request, status:, response_headers:) request end + + # @api private + # + # @param status [Integer, FinchAPI::APIConnectionError] + # @param stream [Enumerable, nil] + def reap_connection!(status, stream:) + case status + in (..199) | (300..499) + stream&.each { next } + in FinchAPI::APIConnectionError | (500..) + FinchAPI::Util.close_fused!(stream) + else + end + end end - # @private - # + # @api private # @return [FinchAPI::PooledNetRequester] attr_accessor :requester - # @private + # @api private # # @param base_url [String] # @param timeout [Float] @@ -144,7 +154,6 @@ def follow_redirect(request, status:, response_headers:) # @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, @@ -171,19 +180,17 @@ def initialize( @max_retry_delay = max_retry_delay end - # @private + # @api private # # @return [Hash{String=>String}] - # private def auth_headers = {} - # @private + # @api private # # @return [String] - # private def generate_idempotency_key = "stainless-ruby-retry-#{SecureRandom.uuid}" - # @private + # @api private # # @param req [Hash{Symbol=>Object}] . # @@ -213,14 +220,13 @@ def initialize( # # @option opts [Hash{String=>String, nil}, nil] :extra_headers # - # @option opts [Hash{Symbol=>Object}, nil] :extra_body + # @option opts [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) @@ -246,8 +252,8 @@ def initialize( 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 + unless headers.key?("x-stainless-timeout") || timeout.zero? + headers["x-stainless-timeout"] = timeout.to_s end headers.reject! { |_, v| v.to_s.empty? } @@ -271,13 +277,12 @@ def initialize( } end - # @private + # @api 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 } @@ -298,7 +303,7 @@ def initialize( (@initial_retry_delay * scale * jitter).clamp(0, @max_retry_delay) end - # @private + # @api private # # @param request [Hash{Symbol=>Object}] . # @@ -322,7 +327,6 @@ def initialize( # # @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} @@ -332,28 +336,23 @@ def initialize( end begin - response, stream = @requester.execute(input) - status = Integer(response.code) + status, response, stream = @requester.execute(input) 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." + self.class.reap_connection!(status, stream: stream) - stream.each { next } + message = "Failed to complete the request within #{self.class::MAX_REDIRECTS} redirects." raise FinchAPI::APIConnectionError.new(url: url, message: message) in 300..399 - request = self.class.follow_redirect(request, status: status, response_headers: response) + self.class.reap_connection!(status, stream: stream) - stream.each { next } + request = self.class.follow_redirect(request, status: status, response_headers: response) send_request( request, redirect_count: redirect_count + 1, @@ -363,12 +362,10 @@ def initialize( 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 } + decoded = Kernel.then do + FinchAPI::Util.decode_content(response, stream: stream, suppress_error: true) + ensure + self.class.reap_connection!(status, stream: stream) end raise FinchAPI::APIStatusError.for( @@ -379,13 +376,9 @@ def initialize( response: response ) in (400..) | FinchAPI::APIConnectionError - delay = retry_delay(response, retry_count: retry_count) + self.class.reap_connection!(status, stream: stream) - if srv_fault - FinchAPI::Util.close_fused!(stream) - else - stream&.each { next } - end + delay = retry_delay(response, retry_count: retry_count) sleep(delay) send_request( @@ -424,7 +417,6 @@ def initialize( # # @raise [FinchAPI::APIError] # @return [Object] - # def request(req) self.class.validate!(req) model = req.fetch(:model) { FinchAPI::Unknown } @@ -445,9 +437,9 @@ def request(req) 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) + st.new(model: model, url: url, status: status, response: response, stream: decoded) in { page: Class => page } - page.new(client: self, req: req, headers: response, unwrapped: decoded) + page.new(client: self, req: req, headers: response, page_data: decoded) else unwrapped = FinchAPI::Util.dig(decoded, req[:unwrap]) FinchAPI::Converter.coerce(model, unwrapped) @@ -455,10 +447,11 @@ def request(req) end # @return [String] - # def inspect + # rubocop:disable Layout/LineLength 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}>" + # rubocop:enable Layout/LineLength end end end diff --git a/lib/finch-api/base_model.rb b/lib/finch-api/base_model.rb index b31a922a..925e7ee1 100644 --- a/lib/finch-api/base_model.rb +++ b/lib/finch-api/base_model.rb @@ -1,41 +1,35 @@ # frozen_string_literal: true module FinchAPI - # @private - # - # @abstract - # + # @api private module Converter # rubocop:disable Lint/UnusedMethodArgument - # @private + # @api private # # @param value [Object] # # @return [Object] - # def coerce(value) = value - # @private + # @api private # # @param value [Object] # # @return [Object] - # def dump(value) = value - # @private + # @api 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 + # @api private # # @param spec [Hash{Symbol=>Object}, Proc, FinchAPI::Converter, Class] . # @@ -48,23 +42,22 @@ class << self # @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 + in FinchAPI::Converter | Module | Symbol -> { spec } in true | false -> { FinchAPI::BooleanModel } - in NilClass | true | false | Symbol | Integer | Float + in NilClass | Integer | Float -> { spec.class } end end - # @private + # @api private # # Based on `target`, transform `value` into `target`, to the extent possible: # @@ -77,12 +70,18 @@ def type_info(spec) # @param value [Object] # # @return [Object] - # def coerce(target, value) case target in FinchAPI::Converter target.coerce(value) - in Class + in Symbol + case value + in Symbol | String if (val = value.to_sym) == target + val + else + value + end + in Module case target in -> { _1 <= NilClass } nil @@ -104,13 +103,12 @@ def coerce(target, value) end end - # @private + # @api private # # @param target [FinchAPI::Converter, Class] # @param value [Object] # # @return [Object] - # def dump(target, value) case target in FinchAPI::Converter @@ -120,7 +118,7 @@ def dump(target, value) end end - # @private + # @api private # # The underlying algorithm for computing maximal compatibility is subject to # future improvements. @@ -135,12 +133,18 @@ def dump(target, value) # @param value [Object] # # @return [Object] - # def try_strict_coerce(target, value) case target in FinchAPI::Converter target.try_strict_coerce(value) - in Class + in Symbol + case value + in Symbol | String if (val = value.to_sym) == target + [true, val, 1] + else + [false, false, 0] + end + in Module case [target, value] in [-> { _1 <= NilClass }, _] [true, nil, value.nil? ? 1 : 0] @@ -155,7 +159,7 @@ def try_strict_coerce(target, value) in [-> { _1 <= Date || _1 <= Time }, String] Kernel.then do [true, target.parse(value), 1] - rescue ArgumentError, Date::Error + rescue ArgumentError [false, false, 0] end in [_, ^target] @@ -168,7 +172,7 @@ def try_strict_coerce(target, value) end end - # @private + # @api private # # @abstract # @@ -178,53 +182,48 @@ class Unknown # 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] + class << self + # @!parse + # # @api private + # # + # # @param value [Object] + # # + # # @return [Object] + # def coerce(value) = super + + # @!parse + # # @api private + # # + # # @param value [Object] + # # + # # @return [Object] + # def dump(value) = super + + # @api private + # + # @param value [Object] + # + # @return [Array(true, Object, nil), Array(false, Boolean, Integer)] + def try_strict_coerce(value) + # prevent unknown variant from being chosen during the first coercion pass + [false, true, 0] + end end # rubocop:enable Lint/UnusedMethodArgument end - # @private + # @api private # # @abstract # @@ -232,57 +231,50 @@ def self.try_strict_coerce(value) 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] + class << self + # @!parse + # # @api private + # # + # # @param value [Boolean, Object] + # # + # # @return [Boolean, Object] + # def coerce(value) = super + + # @!parse + # # @api private + # # + # # @param value [Boolean, Object] + # # + # # @return [Boolean, Object] + # def dump(value) = super + + # @api private + # + # @param value [Object] + # + # @return [Array(true, Object, nil), Array(false, Boolean, Integer)] + def try_strict_coerce(value) + case value + in true | false + [true, value, 1] + else + [false, false, 0] + end end end end - # @private - # - # @abstract + # @api private # # A value from among a specified list of options. OpenAPI enum values map to Ruby # values in the SDK as follows: @@ -294,65 +286,88 @@ def self.try_strict_coerce(value) # # We can therefore convert string values to Symbols, but can't convert other # values safely. - class Enum - extend FinchAPI::Converter + # + # @example + # # `connection_status_type` is a `FinchAPI::Models::ConnectionStatusType` + # case connection_status_type + # when FinchAPI::Models::ConnectionStatusType::PENDING + # # ... + # when FinchAPI::Models::ConnectionStatusType::PROCESSING + # # ... + # when FinchAPI::Models::ConnectionStatusType::CONNECTED + # # ... + # else + # puts(connection_status_type) + # end + # + # @example + # case connection_status_type + # in :pending + # # ... + # in :processing + # # ... + # in :connected + # # ... + # else + # puts(connection_status_type) + # end + module Enum + include FinchAPI::Converter # All of the valid Symbol values for this enum. # # @return [Array] - # - def self.values = (@values ||= constants.map { const_get(_1) }) + def values = (@values ||= constants.map { const_get(_1) }) - # @private + # @api private # # Guard against thread safety issues by instantiating `@values`. - # - private_class_method def self.finalize! = values - - private_class_method :new + private def finalize! = values # @param other [Object] # # @return [Boolean] - # - def self.===(other) = values.include?(other) + def ===(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 + def ==(other) + other.is_a?(Module) && other.singleton_class.ancestors.include?(FinchAPI::Enum) && other.values.to_set == values.to_set end - # @private + # @api private # # @param value [String, Symbol, Object] # # @return [Symbol, Object] - # - def self.coerce(value) = (value.is_a?(String) ? value.to_sym : value) + def coerce(value) + case value + in Symbol | String if values.include?(val = value.to_sym) + val + else + value + end + end # @!parse - # # @private + # # @api private # # # # @param value [Symbol, Object] # # # # @return [Symbol, Object] - # # - # def self.dump(value) = super + # def dump(value) = super - # @private + # @api private # # @param value [Object] # # @return [Array(true, Object, nil), Array(false, Boolean, Integer)] - # - def self.try_strict_coerce(value) + def try_strict_coerce(value) return [true, value, 1] if values.include?(value) case value - in String if values.include?(val = value.to_sym) + in Symbol | String if values.include?(val = value.to_sym) [true, val, 1] else case [value, values.first] @@ -365,45 +380,63 @@ def self.try_strict_coerce(value) end end - # @private + # @api private # - # @abstract + # @example + # # `document_retreive_response` is a `FinchAPI::Models::HRIS::DocumentRetreiveResponse` + # case document_retreive_response + # when FinchAPI::Models::HRIS::W42020 + # puts(document_retreive_response.data) + # when FinchAPI::Models::HRIS::W42005 + # puts(document_retreive_response.type) + # else + # puts(document_retreive_response) + # end # - class Union - extend FinchAPI::Converter + # @example + # case document_retreive_response + # in {type: :w4_2020, data: data, year: year} + # puts(data) + # in {type: :w4_2005, data: data, year: year} + # puts(year) + # else + # puts(document_retreive_response) + # end + module Union + include FinchAPI::Converter - # @private + # @api private # # All of the specified variant info for this union. # # @return [Array] + private def known_variants = (@known_variants ||= []) + + # @api private # - private_class_method def self.known_variants = (@known_variants ||= []) + # @return [Array] + protected def derefed_variants + @known_variants.map { |key, variant_fn| [key, variant_fn.call] } + end - 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 + # All of the specified variants for this union. + # + # @return [Array] + def variants + derefed_variants.map(&:last) end - # @private + # @api private # # @param property [Symbol] - # - private_class_method def self.discriminator(property) + private def discriminator(property) case property in Symbol @discriminator = property end end - # @private + # @api private # # @param key [Symbol, Hash{Symbol=>Object}, Proc, FinchAPI::Converter, Class] # @@ -416,26 +449,24 @@ class << self # @option spec [Proc] :union # # @option spec [Boolean] :"nil?" - # - private_class_method def self.variant(key, spec = nil) + private def variant(key, spec = nil) variant_info = case key in Symbol [key, FinchAPI::Converter.type_info(spec)] - in Proc | FinchAPI::Converter | Class | Hash + in Proc | FinchAPI::Converter | Module | Hash [nil, FinchAPI::Converter.type_info(key)] end known_variants << variant_info end - # @private + # @api private # # @param value [Object] # # @return [FinchAPI::Converter, Class, nil] - # - private_class_method def self.resolve_variant(value) + private def resolve_variant(value) case [@discriminator, value] in [_, FinchAPI::BaseModel] value.class @@ -458,13 +489,10 @@ class << self # rubocop:disable Style/HashEachMethods # rubocop:disable Style/CaseEquality - private_class_method :new - # @param other [Object] # # @return [Boolean] - # - def self.===(other) + def ===(other) known_variants.any? do |_, variant_fn| variant_fn.call === other end @@ -473,18 +501,16 @@ def self.===(other) # @param other [Object] # # @return [Boolean] - # - def self.==(other) - other.is_a?(Class) && other <= FinchAPI::Union && other.variants == variants + def ==(other) + other.is_a?(Module) && other.singleton_class.ancestors.include?(FinchAPI::Union) && other.derefed_variants == derefed_variants end - # @private + # @api private # # @param value [Object] # # @return [Object] - # - def self.coerce(value) + def coerce(value) if (variant = resolve_variant(value)) return FinchAPI::Converter.coerce(variant, value) end @@ -508,13 +534,12 @@ def self.coerce(value) variant.nil? ? value : FinchAPI::Converter.coerce(variant, value) end - # @private + # @api private # # @param value [Object] # # @return [Object] - # - def self.dump(value) + def dump(value) if (variant = resolve_variant(value)) return FinchAPI::Converter.dump(variant, value) end @@ -528,13 +553,12 @@ def self.dump(value) value end - # @private + # @api private # # @param value [Object] # # @return [Array(true, Object, nil), Array(false, Boolean, Integer)] - # - def self.try_strict_coerce(value) + def 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)) @@ -565,7 +589,7 @@ def self.try_strict_coerce(value) # rubocop:enable Style/HashEachMethods end - # @private + # @api private # # @abstract # @@ -573,14 +597,22 @@ def self.try_strict_coerce(value) class ArrayOf include FinchAPI::Converter - private_class_method :new - - def self.[](...) = new(...) + # @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.[](type_info, spec = {}) = new(type_info, spec) # @param other [Object] # # @return [Boolean] - # def ===(other) type = item_type case other @@ -596,15 +628,13 @@ def ===(other) # @param other [Object] # # @return [Boolean] - # def ==(other) = other.is_a?(FinchAPI::ArrayOf) && other.item_type == item_type - # @private + # @api private # # @param value [Enumerable, Object] # # @return [Array, Object] - # def coerce(value) type = item_type case value @@ -615,12 +645,11 @@ def coerce(value) end end - # @private + # @api private # # @param value [Enumerable, Object] # # @return [Array, Object] - # def dump(value) type = item_type case value @@ -631,12 +660,11 @@ def dump(value) end end - # @private + # @api private # # @param value [Object] # # @return [Array(true, Object, nil), Array(false, Boolean, Integer)] - # def try_strict_coerce(value) case value in Array @@ -670,13 +698,12 @@ def try_strict_coerce(value) end end - # @private + # @api private # # @return [FinchAPI::Converter, Class] - # protected def item_type = @item_type_fn.call - # @private + # @api private # # @param type_info [Hash{Symbol=>Object}, Proc, FinchAPI::Converter, Class] # @@ -689,13 +716,12 @@ def try_strict_coerce(value) # @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 + # @api private # # @abstract # @@ -703,14 +729,22 @@ def initialize(type_info, spec = {}) class HashOf include FinchAPI::Converter - private_class_method :new - - def self.[](...) = new(...) + # @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.[](type_info, spec = {}) = new(type_info, spec) # @param other [Object] # # @return [Boolean] - # def ===(other) type = item_type case other @@ -731,15 +765,13 @@ def ===(other) # @param other [Object] # # @return [Boolean] - # def ==(other) = other.is_a?(FinchAPI::HashOf) && other.item_type == item_type - # @private + # @api private # # @param value [Hash{Object=>Object}, Object] # # @return [Hash{Symbol=>Object}, Object] - # def coerce(value) type = item_type case value @@ -753,12 +785,11 @@ def coerce(value) end end - # @private + # @api private # # @param value [Hash{Object=>Object}, Object] # # @return [Hash{Symbol=>Object}, Object] - # def dump(value) type = item_type case value @@ -771,12 +802,11 @@ def dump(value) end end - # @private + # @api private # # @param value [Object] # # @return [Array(true, Object, nil), Array(false, Boolean, Integer)] - # def try_strict_coerce(value) case value in Hash @@ -810,13 +840,12 @@ def try_strict_coerce(value) end end - # @private + # @api private # # @return [FinchAPI::Converter, Class] - # protected def item_type = @item_type_fn.call - # @private + # @api private # # @param type_info [Hash{Symbol=>Object}, Proc, FinchAPI::Converter, Class] # @@ -829,175 +858,177 @@ def try_strict_coerce(value) # @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 # + # @example + # # `operation_support_matrix` is a `FinchAPI::Models::OperationSupportMatrix` + # operation_support_matrix => { + # create: create, + # delete: delete, + # read: read + # } 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 + # @api private + # + # Assumes superclass fields are totally defined before fields are accessed / + # defined on subclasses. # # @return [Hash{Symbol=>Hash{Symbol=>Object}}] + def known_fields + @known_fields ||= (self < FinchAPI::BaseModel ? superclass.known_fields.dup : {}) + end + + # @api private + # + # @return [Hash{Symbol=>Symbol}] + def reverse_map + @reverse_map ||= (self < FinchAPI::BaseModel ? superclass.reverse_map.dup : {}) + end + + # @api 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 ||= {}) + # @api private + # + # @return [Hash{Symbol=>Proc}] + def 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 + # @api 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 def add_field(name_sym, required:, type_info:, spec:) + type_fn, info = + case type_info + in Proc | Module | 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) + fallback = info[:const] + defaults[name_sym] = fallback if required && !info[:nil?] && info.key?(:const) - key = info.fetch(:api_name, name_sym) - setter = "#{name_sym}=" + key = info[:api_name]&.tap { reverse_map[_1] = name_sym } || name_sym + setter = "#{name_sym}=" - if known_fields.key?(name_sym) - [name_sym, setter].each { undef_method(_1) } - end + 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} + 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(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}]." - ) + 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 - 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 + # @api 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 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 + # @api 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 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 + # @api private + # + # `request_only` attributes not excluded from `.#coerce` when receiving responses + # even if well behaved servers should not send them + # + # @param blk [Proc] + private def 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 + # @api private + # + # `response_only` attributes are omitted from `.#dump` when making requests + # + # @param blk [Proc] + private def response_only(&blk) + @mode = :coerce + blk.call + ensure + @mode = nil + end end # @param other [Object] # # @return [Boolean] - # def ==(other) case other in FinchAPI::BaseModel @@ -1007,108 +1038,107 @@ def ==(other) 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 + class << self + # @api private + # + # @param value [FinchAPI::BaseModel, Hash{Object=>Object}, Object] + # + # @return [FinchAPI::BaseModel, Object] + def coerce(value) + case FinchAPI::Util.coerce_hash(value) + in Hash => coerced + new(coerced) + else + value + end 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 + # @api private + # + # @param value [FinchAPI::BaseModel, Object] + # + # @return [Hash{Object=>Object}, Object] + def 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 + values = coerced.filter_map do |key, val| + name = key.to_sym + case (field = known_fields[name]) + in nil + [name, val] else - target = type_fn.call - [api_name, FinchAPI::Converter.dump(target, val)] + 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 - end.to_h + end.to_h - defaults.each do |key, val| - next if values.key?(key) + defaults.each do |key, val| + next if values.key?(key) - values[key] = val + values[key] = val + end + + values end - values - end + # @api private + # + # @param value [Object] + # + # @return [Array(true, Object, nil), Array(false, Boolean, Integer)] + def try_strict_coerce(value) + case value + in Hash | FinchAPI::BaseModel + value = value.to_h + else + return [false, false, 0] + 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) - 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] + 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 - tally += score - acc[api_name] = item - in [false, false, _] - great_success &&= item.nil? + in [false, false] + nil end - in [true, false] - great_success = false - in [false, false] - nil end - end - keys.each do |key| - acc[key] = value.fetch(key) - end + keys.each do |key| + acc[key] = value.fetch(key) + end - great_success ? [true, new(acc), tally] : [false, true, tally] + great_success ? [true, new(acc), tally] : [false, true, tally] + end end # Returns the raw value associated with the given key, if found. Otherwise, nil is @@ -1121,7 +1151,6 @@ def self.try_strict_coerce(value) # @param key [Symbol] # # @return [Object, nil] - # def [](key) unless key.instance_of?(Symbol) raise ArgumentError.new("Expected symbol key for lookup, got #{key.inspect}") @@ -1140,7 +1169,6 @@ def [](key) # should not be mutated. # # @return [Hash{Symbol=>Object}] - # def to_h = @data alias_method :to_hash, :to_h @@ -1148,7 +1176,6 @@ def to_h = @data # @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) @@ -1163,22 +1190,33 @@ def deconstruct_keys(keys) # 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) + @data = coerced.to_h do |key, value| + name = key.to_sym + mapped = self.class.reverse_map.fetch(name, name) + type = self.class.fields[mapped]&.fetch(:type) + stored = + case [type, value] + in [Module, Hash] if type <= FinchAPI::BaseModel + type.new(value) + in [FinchAPI::ArrayOf, Array] | [FinchAPI::HashOf, Hash] + type.coerce(value) + else + value + end + [name, stored] + end 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}" diff --git a/lib/finch-api/base_page.rb b/lib/finch-api/base_page.rb index 428f6416..4ceaf25e 100644 --- a/lib/finch-api/base_page.rb +++ b/lib/finch-api/base_page.rb @@ -1,40 +1,59 @@ # frozen_string_literal: true module FinchAPI - # @private + # @example + # if page.has_next? + # page = page.next_page + # end # - # @abstract + # @example + # page.auto_paging_each do |access_token| + # puts(access_token) + # end # + # @example + # access_tokens = + # page + # .to_enum + # .lazy + # .select { _1.object_id.even? } + # .map(&:itself) + # .take(2) + # .to_a + # + # access_tokens => Array module BasePage + # rubocop:disable Lint/UnusedMethodArgument + # @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 + # @api private + # + # @param client [FinchAPI::BaseClient] + # @param req [Hash{Symbol=>Object}] + # @param headers [Hash{String=>String}, Net::HTTPHeader] + # @param page_data [Object] + def initialize(client:, req:, headers:, page_data:) + @client = client + @req = req + super() + end + + # rubocop:enable Lint/UnusedMethodArgument end end diff --git a/lib/finch-api/client.rb b/lib/finch-api/client.rb index 5ed0209d..78220550 100644 --- a/lib/finch-api/client.rb +++ b/lib/finch-api/client.rb @@ -54,28 +54,25 @@ class Client < FinchAPI::BaseClient # @return [FinchAPI::Resources::Connect] attr_reader :connect - # @private + # @api private # # @return [Hash{String=>String}] - # private def auth_headers {**bearer_auth, **basic_auth} end - # @private + # @api private # # @return [Hash{String=>String}] - # private def bearer_auth return {} if @access_token.nil? {"authorization" => "Bearer #{@access_token}"} end - # @private + # @api private # # @return [Hash{String=>String}] - # private def basic_auth return {} if @client_id.nil? || @client_secret.nil? @@ -100,7 +97,6 @@ class Client < FinchAPI::BaseClient # @param initial_retry_delay [Float] # # @param max_retry_delay [Float] - # def initialize( base_url: nil, access_token: nil, diff --git a/lib/finch-api/errors.rb b/lib/finch-api/errors.rb index fd627339..48e69e6f 100644 --- a/lib/finch-api/errors.rb +++ b/lib/finch-api/errors.rb @@ -4,7 +4,7 @@ module FinchAPI class Error < StandardError # @!parse # # @return [StandardError, nil] - # attr_reader :cause + # attr_accessor :cause end class ConversionError < FinchAPI::Error @@ -12,15 +12,15 @@ class ConversionError < FinchAPI::Error class APIError < FinchAPI::Error # @return [URI::Generic] - attr_reader :url + attr_accessor :url # @return [Integer, nil] - attr_reader :status + attr_accessor :status # @return [Object, nil] - attr_reader :body + attr_accessor :body - # @private + # @api private # # @param url [URI::Generic] # @param status [Integer, nil] @@ -28,7 +28,6 @@ class APIError < FinchAPI::Error # @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 @@ -42,13 +41,13 @@ def initialize(url:, status: nil, body: nil, request: nil, response: nil, messag class APIConnectionError < FinchAPI::APIError # @!parse # # @return [nil] - # attr_reader :status + # attr_accessor :status # @!parse # # @return [nil] - # attr_reader :body + # attr_accessor :body - # @private + # @api private # # @param url [URI::Generic] # @param status [nil] @@ -56,7 +55,6 @@ class APIConnectionError < FinchAPI::APIError # @param request [nil] # @param response [nil] # @param message [String, nil] - # def initialize( url:, status: nil, @@ -70,7 +68,7 @@ def initialize( end class APITimeoutError < FinchAPI::APIConnectionError - # @private + # @api private # # @param url [URI::Generic] # @param status [nil] @@ -78,7 +76,6 @@ class APITimeoutError < FinchAPI::APIConnectionError # @param request [nil] # @param response [nil] # @param message [String, nil] - # def initialize( url:, status: nil, @@ -92,7 +89,7 @@ def initialize( end class APIStatusError < FinchAPI::APIError - # @private + # @api private # # @param url [URI::Generic] # @param status [Integer] @@ -102,7 +99,6 @@ class APIStatusError < FinchAPI::APIError # @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} @@ -130,9 +126,9 @@ def self.for(url:, status:, body:, request:, response:, message: nil) # @!parse # # @return [Integer] - # attr_reader :status + # attr_accessor :status - # @private + # @api private # # @param url [URI::Generic] # @param status [Integer] @@ -140,7 +136,6 @@ def self.for(url:, status:, body:, request:, response:, message: 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( diff --git a/lib/finch-api/extern.rb b/lib/finch-api/extern.rb index 8ab900bc..ec4b0ef7 100644 --- a/lib/finch-api/extern.rb +++ b/lib/finch-api/extern.rb @@ -1,10 +1,7 @@ # frozen_string_literal: true module FinchAPI - # @private - # - # @abstract - # + # @api private module Extern end end diff --git a/lib/finch-api/individuals_page.rb b/lib/finch-api/individuals_page.rb index 9f549ce6..f14c9aeb 100644 --- a/lib/finch-api/individuals_page.rb +++ b/lib/finch-api/individuals_page.rb @@ -2,84 +2,79 @@ module FinchAPI # @example - # ```ruby - # if individuals_page.has_next? - # page = individuals_page.next_page - # end - # ``` + # if individuals_page.has_next? + # individuals_page = individuals_page.next_page + # end # # @example - # ```ruby - # individuals_page.auto_paging_each do |item| - # # item ... - # end - # ``` + # individuals_page.auto_paging_each do |directory| + # puts(directory) + # end # # @example - # ```ruby - # items = individuals_page.to_enum.take(2) + # directories = + # individuals_page + # .to_enum + # .lazy + # .select { _1.object_id.even? } + # .map(&:itself) + # .take(2) + # .to_a # - # items => Array - # ``` + # directories => Array class IndividualsPage include FinchAPI::BasePage - # @return [Array] + # @return [Array, nil] attr_accessor :individuals # @return [FinchAPI::Models::Paging] attr_accessor :paging - # rubocop:disable Lint/UnusedMethodArgument - # @private + # @api 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 + # @param page_data [Hash{Symbol=>Object}] + def initialize(client:, req:, headers:, page_data:) + super model = req.fetch(:model) - case unwrapped + case page_data in {individuals: Array | nil => individuals} - @individuals = individuals&.map { model.coerce(_1) } + @individuals = individuals&.map { FinchAPI::Converter.coerce(model, _1) } else end - case unwrapped + case page_data 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 + paging&.offset.to_i + individuals.to_a.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") + message = "No more pages available. Please check #next_page? before calling ##{__method__}" + raise RuntimeError.new(message) end - req = FinchAPI::Util.deep_merge(@req, {query: {offset: paging&.offset.to_i + individuals.size}}) + req = FinchAPI::Util.deep_merge(@req, {query: {offset: paging&.offset.to_i + individuals.to_a.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") + raise ArgumentError.new("A block must be given to ##{__method__}") end page = self loop do @@ -90,7 +85,6 @@ def auto_paging_each(&blk) end # @return [String] - # def inspect "#<#{self.class}:0x#{object_id.to_s(16)} individuals=#{individuals.inspect} paging=#{paging.inspect}>" end diff --git a/lib/finch-api/models/account_update_event.rb b/lib/finch-api/models/account_update_event.rb index 4d3ad167..a9f16bb9 100644 --- a/lib/finch-api/models/account_update_event.rb +++ b/lib/finch-api/models/account_update_event.rb @@ -1918,26 +1918,10 @@ class PayPeriod < FinchAPI::BaseModel 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 + module Type + extend FinchAPI::Enum + ASSISTED = :assisted CREDENTIAL = :credential API_TOKEN = :api_token @@ -1948,29 +1932,20 @@ class Type < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end end end - # @abstract - # - # @example - # ```ruby - # case event_type - # in :"account.updated" - # # ... - # end - # ``` - class EventType < FinchAPI::Enum + module EventType + extend FinchAPI::Enum + ACCOUNT_UPDATED = :"account.updated" finalize! # @!parse # # @return [Array] - # # # def self.values; end end end diff --git a/lib/finch-api/models/company_event.rb b/lib/finch-api/models/company_event.rb index 2aa752c4..c8f57e27 100644 --- a/lib/finch-api/models/company_event.rb +++ b/lib/finch-api/models/company_event.rb @@ -25,23 +25,15 @@ class CompanyEvent < FinchAPI::Models::BaseWebhookEvent # def initialize: (Hash | FinchAPI::BaseModel) -> void - # @abstract - # - # @example - # ```ruby - # case event_type - # in :"company.updated" - # # ... - # end - # ``` - class EventType < FinchAPI::Enum + module EventType + extend FinchAPI::Enum + COMPANY_UPDATED = :"company.updated" finalize! # @!parse # # @return [Array] - # # # def self.values; 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 index 3e3be8d4..8761f443 100644 --- a/lib/finch-api/models/connect/session_new_params.rb +++ b/lib/finch-api/models/connect/session_new_params.rb @@ -85,28 +85,10 @@ class SessionNewParams < FinchAPI::BaseModel # 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 + module Product + extend FinchAPI::Enum + COMPANY = :company DIRECTORY = :directory INDIVIDUAL = :individual @@ -120,7 +102,6 @@ class Product < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end @@ -145,22 +126,9 @@ class Integration < FinchAPI::BaseModel # 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 + module AuthMethod + extend FinchAPI::Enum + ASSISTED = :assisted CREDENTIAL = :credential OAUTH = :oauth @@ -170,23 +138,13 @@ class AuthMethod < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end end - # @abstract - # - # @example - # ```ruby - # case sandbox - # in :finch - # # ... - # in :provider - # # ... - # end - # ``` - class Sandbox < FinchAPI::Enum + module Sandbox + extend FinchAPI::Enum + FINCH = :finch PROVIDER = :provider @@ -194,7 +152,6 @@ class Sandbox < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; 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 index 2c9d4a30..51d90696 100644 --- a/lib/finch-api/models/connect/session_reauthenticate_params.rb +++ b/lib/finch-api/models/connect/session_reauthenticate_params.rb @@ -46,28 +46,10 @@ class SessionReauthenticateParams < FinchAPI::BaseModel # 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 + module Product + extend FinchAPI::Enum + COMPANY = :company DIRECTORY = :directory INDIVIDUAL = :individual @@ -81,7 +63,6 @@ class Product < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end end diff --git a/lib/finch-api/models/connection_status_type.rb b/lib/finch-api/models/connection_status_type.rb index 37bb73e7..60299526 100644 --- a/lib/finch-api/models/connection_status_type.rb +++ b/lib/finch-api/models/connection_status_type.rb @@ -2,26 +2,9 @@ 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 + module ConnectionStatusType + extend FinchAPI::Enum + PENDING = :pending PROCESSING = :processing CONNECTED = :connected @@ -33,7 +16,6 @@ class ConnectionStatusType < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; 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 index 859c9d0a..b651790b 100644 --- a/lib/finch-api/models/create_access_token_response.rb +++ b/lib/finch-api/models/create_access_token_response.rb @@ -103,22 +103,10 @@ class CreateAccessTokenResponse < FinchAPI::BaseModel # 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 + module ClientType + extend FinchAPI::Enum + PRODUCTION = :production DEVELOPMENT = :development SANDBOX = :sandbox @@ -127,27 +115,16 @@ class ClientType < FinchAPI::Enum # @!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 + module ConnectionType + extend FinchAPI::Enum + PROVIDER = :provider FINCH = :finch @@ -155,7 +132,6 @@ class ConnectionType < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end end diff --git a/lib/finch-api/models/directory_event.rb b/lib/finch-api/models/directory_event.rb index 553c0d74..5bb8ff07 100644 --- a/lib/finch-api/models/directory_event.rb +++ b/lib/finch-api/models/directory_event.rb @@ -48,20 +48,9 @@ class Data < FinchAPI::BaseModel # 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 + module EventType + extend FinchAPI::Enum + DIRECTORY_CREATED = :"directory.created" DIRECTORY_UPDATED = :"directory.updated" DIRECTORY_DELETED = :"directory.deleted" @@ -70,7 +59,6 @@ class EventType < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end end diff --git a/lib/finch-api/models/employment_event.rb b/lib/finch-api/models/employment_event.rb index c7d603b1..86f18c5f 100644 --- a/lib/finch-api/models/employment_event.rb +++ b/lib/finch-api/models/employment_event.rb @@ -48,20 +48,9 @@ class Data < FinchAPI::BaseModel # 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 + module EventType + extend FinchAPI::Enum + EMPLOYMENT_CREATED = :"employment.created" EMPLOYMENT_UPDATED = :"employment.updated" EMPLOYMENT_DELETED = :"employment.deleted" @@ -70,7 +59,6 @@ class EventType < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end end diff --git a/lib/finch-api/models/hris/benefit_contribution.rb b/lib/finch-api/models/hris/benefit_contribution.rb index e3092be8..4c57ebe4 100644 --- a/lib/finch-api/models/hris/benefit_contribution.rb +++ b/lib/finch-api/models/hris/benefit_contribution.rb @@ -24,20 +24,10 @@ class BenefitContribution < FinchAPI::BaseModel # def initialize: (Hash | FinchAPI::BaseModel) -> void - # @abstract - # # Contribution type. - # - # @example - # ```ruby - # case type - # in :fixed - # # ... - # in :percent - # # ... - # end - # ``` - class Type < FinchAPI::Enum + module Type + extend FinchAPI::Enum + FIXED = :fixed PERCENT = :percent @@ -45,7 +35,6 @@ class Type < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; 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 index 94e3d83d..9d7f186d 100644 --- a/lib/finch-api/models/hris/benefit_features_and_operations.rb +++ b/lib/finch-api/models/hris/benefit_features_and_operations.rb @@ -124,18 +124,9 @@ class SupportedFeatures < FinchAPI::BaseModel # def initialize: (Hash | FinchAPI::BaseModel) -> void - # @abstract - # - # @example - # ```ruby - # case company_contribution - # in :fixed - # # ... - # in :percent - # # ... - # end - # ``` - class CompanyContribution < FinchAPI::Enum + module CompanyContribution + extend FinchAPI::Enum + FIXED = :fixed PERCENT = :percent @@ -143,22 +134,12 @@ class CompanyContribution < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end - # @abstract - # - # @example - # ```ruby - # case employee_deduction - # in :fixed - # # ... - # in :percent - # # ... - # end - # ``` - class EmployeeDeduction < FinchAPI::Enum + module EmployeeDeduction + extend FinchAPI::Enum + FIXED = :fixed PERCENT = :percent @@ -166,22 +147,12 @@ class EmployeeDeduction < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end - # @abstract - # - # @example - # ```ruby - # case hsa_contribution_limit - # in :individual - # # ... - # in :family - # # ... - # end - # ``` - class HsaContributionLimit < FinchAPI::Enum + module HsaContributionLimit + extend FinchAPI::Enum + INDIVIDUAL = :individual FAMILY = :family @@ -189,7 +160,6 @@ class HsaContributionLimit < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end end diff --git a/lib/finch-api/models/hris/benefit_frequency.rb b/lib/finch-api/models/hris/benefit_frequency.rb index 4cc1d21b..d882c80c 100644 --- a/lib/finch-api/models/hris/benefit_frequency.rb +++ b/lib/finch-api/models/hris/benefit_frequency.rb @@ -3,20 +3,9 @@ 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 + module BenefitFrequency + extend FinchAPI::Enum + ONE_TIME = :one_time EVERY_PAYCHECK = :every_paycheck MONTHLY = :monthly @@ -25,7 +14,6 @@ class BenefitFrequency < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end end diff --git a/lib/finch-api/models/hris/benefit_type.rb b/lib/finch-api/models/hris/benefit_type.rb index ca5830ef..b78cb3fa 100644 --- a/lib/finch-api/models/hris/benefit_type.rb +++ b/lib/finch-api/models/hris/benefit_type.rb @@ -3,28 +3,10 @@ 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 + module BenefitType + extend FinchAPI::Enum + NUMBER_401K = :"401k" NUMBER_401K_ROTH = :"401k_roth" NUMBER_401K_LOAN = :"401k_loan" @@ -49,7 +31,6 @@ class BenefitType < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; 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 index e9f69a87..b55a4731 100644 --- a/lib/finch-api/models/hris/benefits/enrolled_individual.rb +++ b/lib/finch-api/models/hris/benefits/enrolled_individual.rb @@ -71,24 +71,10 @@ class Body < FinchAPI::BaseModel # 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 + module Code + extend FinchAPI::Enum + OK = 200 CREATED = 201 NOT_FOUND = 404 @@ -98,7 +84,6 @@ class Code < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; 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 index 399c4c50..e6203e58 100644 --- a/lib/finch-api/models/hris/benefits/individual_benefit.rb +++ b/lib/finch-api/models/hris/benefits/individual_benefit.rb @@ -93,20 +93,10 @@ class Body < FinchAPI::BaseModel # 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 + module HsaContributionLimit + extend FinchAPI::Enum + INDIVIDUAL = :individual FAMILY = :family @@ -114,7 +104,6 @@ class HsaContributionLimit < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; 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 index 2c910c6f..5e068387 100644 --- a/lib/finch-api/models/hris/benefits/individual_enroll_many_params.rb +++ b/lib/finch-api/models/hris/benefits/individual_enroll_many_params.rb @@ -126,21 +126,11 @@ class Configuration < FinchAPI::BaseModel # 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 + module AnnualContributionLimit + extend FinchAPI::Enum + INDIVIDUAL = :individual FAMILY = :family @@ -148,7 +138,6 @@ class AnnualContributionLimit < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end @@ -182,18 +171,9 @@ class CompanyContribution < FinchAPI::BaseModel # def initialize: (Hash | FinchAPI::BaseModel) -> void - # @abstract - # - # @example - # ```ruby - # case type - # in :fixed - # # ... - # in :percent - # # ... - # end - # ``` - class Type < FinchAPI::Enum + module Type + extend FinchAPI::Enum + FIXED = :fixed PERCENT = :percent @@ -201,7 +181,6 @@ class Type < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end end @@ -236,18 +215,9 @@ class EmployeeDeduction < FinchAPI::BaseModel # def initialize: (Hash | FinchAPI::BaseModel) -> void - # @abstract - # - # @example - # ```ruby - # case type - # in :fixed - # # ... - # in :percent - # # ... - # end - # ``` - class Type < FinchAPI::Enum + module Type + extend FinchAPI::Enum + FIXED = :fixed PERCENT = :percent @@ -255,7 +225,6 @@ class Type < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end end diff --git a/lib/finch-api/models/hris/company.rb b/lib/finch-api/models/hris/company.rb index 9eb638c2..94788671 100644 --- a/lib/finch-api/models/hris/company.rb +++ b/lib/finch-api/models/hris/company.rb @@ -130,20 +130,10 @@ class Account < FinchAPI::BaseModel # 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 + module AccountType + extend FinchAPI::Enum + CHECKING = :checking SAVINGS = :savings @@ -151,7 +141,6 @@ class AccountType < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end end @@ -218,22 +207,10 @@ class Entity < FinchAPI::BaseModel # 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 + module Subtype + extend FinchAPI::Enum + S_CORPORATION = :s_corporation C_CORPORATION = :c_corporation B_CORPORATION = :b_corporation @@ -242,32 +219,13 @@ class Subtype < FinchAPI::Enum # @!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 + module Type + extend FinchAPI::Enum + LLC = :llc LP = :lp CORPORATION = :corporation @@ -280,7 +238,6 @@ class Type < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; 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 index 31186fbd..2e077b06 100644 --- a/lib/finch-api/models/hris/document_list_params.rb +++ b/lib/finch-api/models/hris/document_list_params.rb @@ -61,18 +61,9 @@ class DocumentListParams < FinchAPI::BaseModel # def initialize: (Hash | FinchAPI::BaseModel) -> void - # @abstract - # - # @example - # ```ruby - # case type - # in :w4_2020 - # # ... - # in :w4_2005 - # # ... - # end - # ``` - class Type < FinchAPI::Enum + module Type + extend FinchAPI::Enum + W4_2020 = :w4_2020 W4_2005 = :w4_2005 @@ -80,7 +71,6 @@ class Type < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end end diff --git a/lib/finch-api/models/hris/document_response.rb b/lib/finch-api/models/hris/document_response.rb index 78f9739b..bfafdc49 100644 --- a/lib/finch-api/models/hris/document_response.rb +++ b/lib/finch-api/models/hris/document_response.rb @@ -59,20 +59,10 @@ class DocumentResponse < FinchAPI::BaseModel # 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 + module Type + extend FinchAPI::Enum + W4_2020 = :w4_2020 W4_2005 = :w4_2005 @@ -80,7 +70,6 @@ class Type < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; 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 index dc47ccf2..39e25456 100644 --- a/lib/finch-api/models/hris/document_retreive_response.rb +++ b/lib/finch-api/models/hris/document_retreive_response.rb @@ -3,31 +3,11 @@ 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 + module DocumentRetreiveResponse + extend 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. @@ -35,6 +15,10 @@ class DocumentRetreiveResponse < FinchAPI::Union # 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 } + + # @!parse + # # @return [Array(FinchAPI::Models::HRIS::W42020, FinchAPI::Models::HRIS::W42005)] + # def self.variants; end end end end diff --git a/lib/finch-api/models/hris/employment_data.rb b/lib/finch-api/models/hris/employment_data.rb index a1bfd120..b02e66f2 100644 --- a/lib/finch-api/models/hris/employment_data.rb +++ b/lib/finch-api/models/hris/employment_data.rb @@ -251,29 +251,11 @@ class Employment < FinchAPI::BaseModel # 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 + module Subtype + extend FinchAPI::Enum + FULL_TIME = :full_time INTERN = :intern PART_TIME = :part_time @@ -285,24 +267,13 @@ class Subtype < FinchAPI::Enum # @!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 + module Type + extend FinchAPI::Enum + EMPLOYEE = :employee CONTRACTOR = :contractor @@ -310,34 +281,15 @@ class Type < FinchAPI::Enum # @!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 + module EmploymentStatus + extend FinchAPI::Enum + ACTIVE = :active DECEASED = :deceased LEAVE = :leave @@ -350,7 +302,6 @@ class EmploymentStatus < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end diff --git a/lib/finch-api/models/hris/individual.rb b/lib/finch-api/models/hris/individual.rb index 1e7f9ec5..726ac4bd 100644 --- a/lib/finch-api/models/hris/individual.rb +++ b/lib/finch-api/models/hris/individual.rb @@ -148,18 +148,9 @@ class Email < FinchAPI::BaseModel # def initialize: (Hash | FinchAPI::BaseModel) -> void - # @abstract - # - # @example - # ```ruby - # case type - # in :work - # # ... - # in :personal - # # ... - # end - # ``` - class Type < FinchAPI::Enum + module Type + extend FinchAPI::Enum + WORK = :work PERSONAL = :personal @@ -167,33 +158,14 @@ class Type < FinchAPI::Enum # @!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 + module Ethnicity + extend FinchAPI::Enum + ASIAN = :asian WHITE = :white BLACK_OR_AFRICAN_AMERICAN = :black_or_african_american @@ -207,28 +179,13 @@ class Ethnicity < FinchAPI::Enum # @!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 + module Gender + extend FinchAPI::Enum + FEMALE = :female MALE = :male OTHER = :other @@ -238,7 +195,6 @@ class Gender < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end @@ -261,18 +217,9 @@ class PhoneNumber < FinchAPI::BaseModel # def initialize: (Hash | FinchAPI::BaseModel) -> void - # @abstract - # - # @example - # ```ruby - # case type - # in :work - # # ... - # in :personal - # # ... - # end - # ``` - class Type < FinchAPI::Enum + module Type + extend FinchAPI::Enum + WORK = :work PERSONAL = :personal @@ -280,7 +227,6 @@ class Type < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end end diff --git a/lib/finch-api/models/hris/pay_statement.rb b/lib/finch-api/models/hris/pay_statement.rb index 2bc89ee0..95f66e65 100644 --- a/lib/finch-api/models/hris/pay_statement.rb +++ b/lib/finch-api/models/hris/pay_statement.rb @@ -191,28 +191,10 @@ class Metadata < FinchAPI::BaseModel 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 + module Type + extend FinchAPI::Enum + SALARY = :salary WAGE = :wage REIMBURSEMENT = :reimbursement @@ -231,7 +213,6 @@ class Type < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end end @@ -410,20 +391,10 @@ class Metadata < FinchAPI::BaseModel end end - # @abstract - # # The payment method. - # - # @example - # ```ruby - # case payment_method - # in :check - # # ... - # in :direct_deposit - # # ... - # end - # ``` - class PaymentMethod < FinchAPI::Enum + module PaymentMethod + extend FinchAPI::Enum + CHECK = :check DIRECT_DEPOSIT = :direct_deposit @@ -431,7 +402,6 @@ class PaymentMethod < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end @@ -522,24 +492,10 @@ class Metadata < FinchAPI::BaseModel end end - # @abstract - # # The type of taxes. - # - # @example - # ```ruby - # case type - # in :state - # # ... - # in :federal - # # ... - # in :local - # # ... - # in :fica - # # ... - # end - # ``` - class Type < FinchAPI::Enum + module Type + extend FinchAPI::Enum + STATE = :state FEDERAL = :federal LOCAL = :local @@ -549,27 +505,14 @@ class Type < FinchAPI::Enum # @!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 + module Type + extend FinchAPI::Enum + REGULAR_PAYROLL = :regular_payroll OFF_CYCLE_PAYROLL = :off_cycle_payroll ONE_TIME_PAYMENT = :one_time_payment @@ -578,7 +521,6 @@ class Type < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end end diff --git a/lib/finch-api/models/hris/payment.rb b/lib/finch-api/models/hris/payment.rb index 3e834e23..c79bc869 100644 --- a/lib/finch-api/models/hris/payment.rb +++ b/lib/finch-api/models/hris/payment.rb @@ -109,26 +109,9 @@ class Payment < FinchAPI::BaseModel # 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 + module PayFrequency + extend FinchAPI::Enum + ANNUALLY = :annually SEMI_ANNUALLY = :semi_annually QUARTERLY = :quarterly @@ -143,7 +126,6 @@ class PayFrequency < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end diff --git a/lib/finch-api/models/hris/supported_benefit.rb b/lib/finch-api/models/hris/supported_benefit.rb index c20638c9..d8dfe58a 100644 --- a/lib/finch-api/models/hris/supported_benefit.rb +++ b/lib/finch-api/models/hris/supported_benefit.rb @@ -92,18 +92,9 @@ class SupportedBenefit < FinchAPI::BaseModel # def initialize: (Hash | FinchAPI::BaseModel) -> void - # @abstract - # - # @example - # ```ruby - # case company_contribution - # in :fixed - # # ... - # in :percent - # # ... - # end - # ``` - class CompanyContribution < FinchAPI::Enum + module CompanyContribution + extend FinchAPI::Enum + FIXED = :fixed PERCENT = :percent @@ -111,22 +102,12 @@ class CompanyContribution < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end - # @abstract - # - # @example - # ```ruby - # case employee_deduction - # in :fixed - # # ... - # in :percent - # # ... - # end - # ``` - class EmployeeDeduction < FinchAPI::Enum + module EmployeeDeduction + extend FinchAPI::Enum + FIXED = :fixed PERCENT = :percent @@ -134,22 +115,12 @@ class EmployeeDeduction < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end - # @abstract - # - # @example - # ```ruby - # case hsa_contribution_limit - # in :individual - # # ... - # in :family - # # ... - # end - # ``` - class HsaContributionLimit < FinchAPI::Enum + module HsaContributionLimit + extend FinchAPI::Enum + INDIVIDUAL = :individual FAMILY = :family @@ -157,7 +128,6 @@ class HsaContributionLimit < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end end diff --git a/lib/finch-api/models/hris/w42005.rb b/lib/finch-api/models/hris/w42005.rb index 616ba232..8f0ac8b1 100644 --- a/lib/finch-api/models/hris/w42005.rb +++ b/lib/finch-api/models/hris/w42005.rb @@ -59,15 +59,11 @@ class Data < FinchAPI::BaseModel # # @return [Symbol, FinchAPI::Models::HRIS::W42005::Data::Exemption] # attr_writer :exemption - # @!attribute [r] filing_status + # @!attribute 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 + optional :filing_status, enum: -> { FinchAPI::Models::HRIS::W42005::Data::FilingStatus }, nil?: true # @!attribute [r] individual_id # The unique identifier for the individual associated with this 2005 W4 form. @@ -90,7 +86,7 @@ class Data < FinchAPI::BaseModel # # # # @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 filing_status [Symbol, FinchAPI::Models::HRIS::W42005::Data::FilingStatus, nil] # # @param individual_id [String] # # @param total_number_of_allowances [Integer, nil] # # @@ -107,20 +103,10 @@ class Data < FinchAPI::BaseModel # 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 + module Exemption + extend FinchAPI::Enum + EXEMPT = :exempt NON_EXEMPT = :non_exempt @@ -128,26 +114,13 @@ class Exemption < FinchAPI::Enum # @!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 + module FilingStatus + extend FinchAPI::Enum + MARRIED = :married MARRIED_BUT_WITHHOLD_AT_HIGHER_SINGLE_RATE = :married_but_withhold_at_higher_single_rate SINGLE = :single @@ -156,30 +129,20 @@ class FilingStatus < FinchAPI::Enum # @!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 + module Type + extend FinchAPI::Enum + W4_2005 = :w4_2005 finalize! # @!parse # # @return [Array] - # # # def self.values; end end end diff --git a/lib/finch-api/models/hris/w42020.rb b/lib/finch-api/models/hris/w42020.rb index 053888d5..41751295 100644 --- a/lib/finch-api/models/hris/w42020.rb +++ b/lib/finch-api/models/hris/w42020.rb @@ -124,54 +124,33 @@ class Data < FinchAPI::BaseModel # 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 + module FilingStatus + extend FinchAPI::Enum + HEAD_OF_HOUSEHOLD = :head_of_household - MARRIED_FILING_JOINTLY_OR_QUALIFYING_SURVIVING_SPOUSE = :married_filing_jointly_or_qualifying_surviving_spouse + 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 + module Type + extend FinchAPI::Enum + W4_2020 = :w4_2020 finalize! # @!parse # # @return [Array] - # # # def self.values; end end end diff --git a/lib/finch-api/models/income.rb b/lib/finch-api/models/income.rb index 06851161..647fc525 100644 --- a/lib/finch-api/models/income.rb +++ b/lib/finch-api/models/income.rb @@ -42,29 +42,11 @@ class Income < FinchAPI::BaseModel # 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 + module Unit + extend FinchAPI::Enum + YEARLY = :yearly QUARTERLY = :quarterly MONTHLY = :monthly @@ -79,7 +61,6 @@ class Unit < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end end diff --git a/lib/finch-api/models/individual_event.rb b/lib/finch-api/models/individual_event.rb index 818affba..b164e814 100644 --- a/lib/finch-api/models/individual_event.rb +++ b/lib/finch-api/models/individual_event.rb @@ -48,20 +48,9 @@ class Data < FinchAPI::BaseModel # 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 + module EventType + extend FinchAPI::Enum + INDIVIDUAL_CREATED = :"individual.created" INDIVIDUAL_UPDATED = :"individual.updated" INDIVIDUAL_DELETED = :"individual.deleted" @@ -70,7 +59,6 @@ class EventType < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end end diff --git a/lib/finch-api/models/introspection.rb b/lib/finch-api/models/introspection.rb index 9d7db423..3029b2b5 100644 --- a/lib/finch-api/models/introspection.rb +++ b/lib/finch-api/models/introspection.rb @@ -219,26 +219,10 @@ class ConnectionStatus < FinchAPI::BaseModel # 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 + module Type + extend FinchAPI::Enum + ASSISTED = :assisted CREDENTIAL = :credential API_TOKEN = :api_token @@ -249,27 +233,14 @@ class Type < FinchAPI::Enum # @!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 + module ClientType + extend FinchAPI::Enum + PRODUCTION = :production DEVELOPMENT = :development SANDBOX = :sandbox @@ -278,7 +249,6 @@ class ClientType < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end @@ -310,23 +280,13 @@ class ConnectionStatus < FinchAPI::BaseModel # 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 + module ConnectionType + extend FinchAPI::Enum + PROVIDER = :provider FINCH = :finch @@ -334,7 +294,6 @@ class ConnectionType < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end end diff --git a/lib/finch-api/models/job_completion_event.rb b/lib/finch-api/models/job_completion_event.rb index 895cd676..56ded516 100644 --- a/lib/finch-api/models/job_completion_event.rb +++ b/lib/finch-api/models/job_completion_event.rb @@ -51,26 +51,9 @@ class Data < FinchAPI::BaseModel # 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 + module EventType + extend 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" @@ -82,7 +65,6 @@ class EventType < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; 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 index 3addbe79..3392d908 100644 --- a/lib/finch-api/models/jobs/automated_async_job.rb +++ b/lib/finch-api/models/jobs/automated_async_job.rb @@ -97,26 +97,9 @@ class Params < FinchAPI::BaseModel # 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 + module Status + extend FinchAPI::Enum + PENDING = :pending IN_PROGRESS = :in_progress COMPLETE = :complete @@ -128,24 +111,13 @@ class Status < FinchAPI::Enum # @!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 + module Type + extend FinchAPI::Enum + DATA_SYNC_ALL = :data_sync_all W4_FORM_EMPLOYEE_SYNC = :w4_form_employee_sync @@ -153,7 +125,6 @@ class Type < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; 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 index b4fdf4a1..a0993cab 100644 --- a/lib/finch-api/models/jobs/automated_create_params.rb +++ b/lib/finch-api/models/jobs/automated_create_params.rb @@ -28,25 +28,16 @@ class AutomatedCreateParams < FinchAPI::BaseModel # 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 + module Type + extend FinchAPI::Enum + W4_FORM_EMPLOYEE_SYNC = :w4_form_employee_sync finalize! # @!parse # # @return [Array] - # # # def self.values; end end diff --git a/lib/finch-api/models/jobs/automated_list_response.rb b/lib/finch-api/models/jobs/automated_list_response.rb new file mode 100644 index 00000000..bdbd0998 --- /dev/null +++ b/lib/finch-api/models/jobs/automated_list_response.rb @@ -0,0 +1,100 @@ +# frozen_string_literal: true + +module FinchAPI + module Models + module Jobs + class AutomatedListResponse < FinchAPI::BaseModel + # @!attribute data + # + # @return [Array] + required :data, -> { FinchAPI::ArrayOf[FinchAPI::Models::Jobs::AutomatedAsyncJob] } + + # @!attribute meta + # + # @return [FinchAPI::Models::Jobs::AutomatedListResponse::Meta] + required :meta, -> { FinchAPI::Models::Jobs::AutomatedListResponse::Meta } + + # @!parse + # # @param data [Array] + # # @param meta [FinchAPI::Models::Jobs::AutomatedListResponse::Meta] + # # + # def initialize(data:, meta:, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Meta < FinchAPI::BaseModel + # @!attribute [r] quotas + # Information about remaining quotas for this connection. Only applicable for + # customers opted in to use Finch's Data Sync Refresh endpoint + # (`POST /jobs/automated`). Please contact a Finch representative for more + # details. + # + # @return [FinchAPI::Models::Jobs::AutomatedListResponse::Meta::Quotas, nil] + optional :quotas, -> { FinchAPI::Models::Jobs::AutomatedListResponse::Meta::Quotas } + + # @!parse + # # @return [FinchAPI::Models::Jobs::AutomatedListResponse::Meta::Quotas] + # attr_writer :quotas + + # @!parse + # # @param quotas [FinchAPI::Models::Jobs::AutomatedListResponse::Meta::Quotas] + # # + # def initialize(quotas: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class Quotas < FinchAPI::BaseModel + # @!attribute [r] data_sync_all + # + # @return [FinchAPI::Models::Jobs::AutomatedListResponse::Meta::Quotas::DataSyncAll, nil] + optional :data_sync_all, -> { FinchAPI::Models::Jobs::AutomatedListResponse::Meta::Quotas::DataSyncAll } + + # @!parse + # # @return [FinchAPI::Models::Jobs::AutomatedListResponse::Meta::Quotas::DataSyncAll] + # attr_writer :data_sync_all + + # @!parse + # # Information about remaining quotas for this connection. Only applicable for + # # customers opted in to use Finch's Data Sync Refresh endpoint + # # (`POST /jobs/automated`). Please contact a Finch representative for more + # # details. + # # + # # @param data_sync_all [FinchAPI::Models::Jobs::AutomatedListResponse::Meta::Quotas::DataSyncAll] + # # + # def initialize(data_sync_all: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + + class DataSyncAll < FinchAPI::BaseModel + # @!attribute [r] allowed_refreshes + # + # @return [Integer, nil] + optional :allowed_refreshes, Integer + + # @!parse + # # @return [Integer] + # attr_writer :allowed_refreshes + + # @!attribute [r] remaining_refreshes + # + # @return [Integer, nil] + optional :remaining_refreshes, Integer + + # @!parse + # # @return [Integer] + # attr_writer :remaining_refreshes + + # @!parse + # # @param allowed_refreshes [Integer] + # # @param remaining_refreshes [Integer] + # # + # def initialize(allowed_refreshes: nil, remaining_refreshes: nil, **) = super + + # def initialize: (Hash | FinchAPI::BaseModel) -> void + end + end + end + 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 index f16a6248..68508894 100644 --- a/lib/finch-api/models/jobs/manual_async_job.rb +++ b/lib/finch-api/models/jobs/manual_async_job.rb @@ -29,22 +29,9 @@ class ManualAsyncJob < FinchAPI::BaseModel # 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 + module Status + extend FinchAPI::Enum + PENDING = :pending IN_PROGRESS = :in_progress ERROR = :error @@ -54,7 +41,6 @@ class Status < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end end diff --git a/lib/finch-api/models/operation_support.rb b/lib/finch-api/models/operation_support.rb index b886afc8..68cd639d 100644 --- a/lib/finch-api/models/operation_support.rb +++ b/lib/finch-api/models/operation_support.rb @@ -2,8 +2,6 @@ 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 @@ -11,21 +9,9 @@ module Models # 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 + module OperationSupport + extend FinchAPI::Enum + SUPPORTED = :supported NOT_SUPPORTED_BY_FINCH = :not_supported_by_finch NOT_SUPPORTED_BY_PROVIDER = :not_supported_by_provider @@ -35,7 +21,6 @@ class OperationSupport < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end end diff --git a/lib/finch-api/models/pay_statement_event.rb b/lib/finch-api/models/pay_statement_event.rb index a336948a..5bb1870d 100644 --- a/lib/finch-api/models/pay_statement_event.rb +++ b/lib/finch-api/models/pay_statement_event.rb @@ -59,20 +59,9 @@ class Data < FinchAPI::BaseModel # 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 + module EventType + extend FinchAPI::Enum + PAY_STATEMENT_CREATED = :"pay_statement.created" PAY_STATEMENT_UPDATED = :"pay_statement.updated" PAY_STATEMENT_DELETED = :"pay_statement.deleted" @@ -81,7 +70,6 @@ class EventType < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end end diff --git a/lib/finch-api/models/payment_event.rb b/lib/finch-api/models/payment_event.rb index 8a976da6..77738eec 100644 --- a/lib/finch-api/models/payment_event.rb +++ b/lib/finch-api/models/payment_event.rb @@ -51,20 +51,9 @@ class Data < FinchAPI::BaseModel # 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 + module EventType + extend FinchAPI::Enum + PAYMENT_CREATED = :"payment.created" PAYMENT_UPDATED = :"payment.updated" PAYMENT_DELETED = :"payment.deleted" @@ -73,7 +62,6 @@ class EventType < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; 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 index 524a6aae..7ae9e6f4 100644 --- a/lib/finch-api/models/payroll/pay_group_list_response.rb +++ b/lib/finch-api/models/payroll/pay_group_list_response.rb @@ -44,26 +44,9 @@ class PayGroupListResponse < FinchAPI::BaseModel # 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 + module PayFrequency + extend FinchAPI::Enum + ANNUALLY = :annually SEMI_ANNUALLY = :semi_annually QUARTERLY = :quarterly @@ -78,7 +61,6 @@ class PayFrequency < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; 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 index 7220ce13..f621e67c 100644 --- a/lib/finch-api/models/payroll/pay_group_retrieve_response.rb +++ b/lib/finch-api/models/payroll/pay_group_retrieve_response.rb @@ -38,26 +38,9 @@ class PayGroupRetrieveResponse < FinchAPI::BaseModel # 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 + module PayFrequency + extend FinchAPI::Enum + ANNUALLY = :annually SEMI_ANNUALLY = :semi_annually QUARTERLY = :quarterly @@ -72,7 +55,6 @@ class PayFrequency < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end end diff --git a/lib/finch-api/models/provider.rb b/lib/finch-api/models/provider.rb index b246e22d..19c63704 100644 --- a/lib/finch-api/models/provider.rb +++ b/lib/finch-api/models/provider.rb @@ -2000,26 +2000,10 @@ class PayPeriod < FinchAPI::BaseModel 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 + module Type + extend FinchAPI::Enum + ASSISTED = :assisted CREDENTIAL = :credential API_TOKEN = :api_token @@ -2030,7 +2014,6 @@ class Type < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; 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 index 3307ee2f..fcffc5f7 100644 --- a/lib/finch-api/models/sandbox/company_update_params.rb +++ b/lib/finch-api/models/sandbox/company_update_params.rb @@ -132,20 +132,10 @@ class Account < FinchAPI::BaseModel # 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 + module AccountType + extend FinchAPI::Enum + CHECKING = :checking SAVINGS = :savings @@ -153,7 +143,6 @@ class AccountType < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end end @@ -222,22 +211,10 @@ class Entity < FinchAPI::BaseModel # 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 + module Subtype + extend FinchAPI::Enum + S_CORPORATION = :s_corporation C_CORPORATION = :c_corporation B_CORPORATION = :b_corporation @@ -246,32 +223,13 @@ class Subtype < FinchAPI::Enum # @!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 + module Type + extend FinchAPI::Enum + LLC = :llc LP = :lp CORPORATION = :corporation @@ -284,7 +242,6 @@ class Type < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; 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 index e5799b21..0766ddd7 100644 --- a/lib/finch-api/models/sandbox/company_update_response.rb +++ b/lib/finch-api/models/sandbox/company_update_response.rb @@ -114,20 +114,10 @@ class Account < FinchAPI::BaseModel # 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 + module AccountType + extend FinchAPI::Enum + CHECKING = :checking SAVINGS = :savings @@ -135,7 +125,6 @@ class AccountType < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end end @@ -204,22 +193,10 @@ class Entity < FinchAPI::BaseModel # 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 + module Subtype + extend FinchAPI::Enum + S_CORPORATION = :s_corporation C_CORPORATION = :c_corporation B_CORPORATION = :b_corporation @@ -228,32 +205,13 @@ class Subtype < FinchAPI::Enum # @!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 + module Type + extend FinchAPI::Enum + LLC = :llc LP = :lp CORPORATION = :corporation @@ -266,7 +224,6 @@ class Type < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; 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 index 3ab58352..c0396eef 100644 --- a/lib/finch-api/models/sandbox/connection_create_params.rb +++ b/lib/finch-api/models/sandbox/connection_create_params.rb @@ -56,22 +56,9 @@ class ConnectionCreateParams < FinchAPI::BaseModel # 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 + module AuthenticationType + extend FinchAPI::Enum + CREDENTIAL = :credential API_TOKEN = :api_token OAUTH = :oauth @@ -81,7 +68,6 @@ class AuthenticationType < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; 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 index 97ec669f..149370cb 100644 --- a/lib/finch-api/models/sandbox/connection_create_response.rb +++ b/lib/finch-api/models/sandbox/connection_create_response.rb @@ -79,22 +79,9 @@ class ConnectionCreateResponse < FinchAPI::BaseModel # 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 + module AuthenticationType + extend FinchAPI::Enum + CREDENTIAL = :credential API_TOKEN = :api_token OAUTH = :oauth @@ -104,7 +91,6 @@ class AuthenticationType < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; 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 index 4ab7c58b..b241178d 100644 --- a/lib/finch-api/models/sandbox/connections/account_create_params.rb +++ b/lib/finch-api/models/sandbox/connections/account_create_params.rb @@ -52,22 +52,9 @@ class AccountCreateParams < FinchAPI::BaseModel # 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 + module AuthenticationType + extend FinchAPI::Enum + CREDENTIAL = :credential API_TOKEN = :api_token OAUTH = :oauth @@ -77,7 +64,6 @@ class AuthenticationType < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; 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 index 5914f541..5b4c6c23 100644 --- a/lib/finch-api/models/sandbox/connections/account_create_response.rb +++ b/lib/finch-api/models/sandbox/connections/account_create_response.rb @@ -58,22 +58,9 @@ class AccountCreateResponse < FinchAPI::BaseModel # 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 + module AuthenticationType + extend FinchAPI::Enum + CREDENTIAL = :credential API_TOKEN = :api_token OAUTH = :oauth @@ -83,7 +70,6 @@ class AuthenticationType < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; 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 index 148377e3..204ee5fe 100644 --- a/lib/finch-api/models/sandbox/connections/account_update_response.rb +++ b/lib/finch-api/models/sandbox/connections/account_update_response.rb @@ -56,22 +56,9 @@ class AccountUpdateResponse < FinchAPI::BaseModel # 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 + module AuthenticationType + extend FinchAPI::Enum + CREDENTIAL = :credential API_TOKEN = :api_token OAUTH = :oauth @@ -81,7 +68,6 @@ class AuthenticationType < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; 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 index b9e88d1d..35b607f4 100644 --- a/lib/finch-api/models/sandbox/directory_create_params.rb +++ b/lib/finch-api/models/sandbox/directory_create_params.rb @@ -342,18 +342,9 @@ class Email < FinchAPI::BaseModel # def initialize: (Hash | FinchAPI::BaseModel) -> void - # @abstract - # - # @example - # ```ruby - # case type - # in :work - # # ... - # in :personal - # # ... - # end - # ``` - class Type < FinchAPI::Enum + module Type + extend FinchAPI::Enum + WORK = :work PERSONAL = :personal @@ -361,7 +352,6 @@ class Type < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end end @@ -394,29 +384,11 @@ class Employment < FinchAPI::BaseModel # 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 + module Subtype + extend FinchAPI::Enum + FULL_TIME = :full_time INTERN = :intern PART_TIME = :part_time @@ -428,24 +400,13 @@ class Subtype < FinchAPI::Enum # @!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 + module Type + extend FinchAPI::Enum + EMPLOYEE = :employee CONTRACTOR = :contractor @@ -453,33 +414,14 @@ class Type < FinchAPI::Enum # @!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 + module EmploymentStatus + extend FinchAPI::Enum + ACTIVE = :active DECEASED = :deceased LEAVE = :leave @@ -492,32 +434,13 @@ class EmploymentStatus < FinchAPI::Enum # @!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 + module Ethnicity + extend FinchAPI::Enum + ASIAN = :asian WHITE = :white BLACK_OR_AFRICAN_AMERICAN = :black_or_african_american @@ -531,28 +454,13 @@ class Ethnicity < FinchAPI::Enum # @!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 + module Gender + extend FinchAPI::Enum + FEMALE = :female MALE = :male OTHER = :other @@ -562,7 +470,6 @@ class Gender < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end @@ -612,18 +519,9 @@ class PhoneNumber < FinchAPI::BaseModel # def initialize: (Hash | FinchAPI::BaseModel) -> void - # @abstract - # - # @example - # ```ruby - # case type - # in :work - # # ... - # in :personal - # # ... - # end - # ``` - class Type < FinchAPI::Enum + module Type + extend FinchAPI::Enum + WORK = :work PERSONAL = :personal @@ -631,7 +529,6 @@ class Type < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; 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 index b1c95cff..c9c07878 100644 --- a/lib/finch-api/models/sandbox/employment_update_params.rb +++ b/lib/finch-api/models/sandbox/employment_update_params.rb @@ -244,29 +244,11 @@ class Employment < FinchAPI::BaseModel # 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 + module Subtype + extend FinchAPI::Enum + FULL_TIME = :full_time INTERN = :intern PART_TIME = :part_time @@ -278,24 +260,13 @@ class Subtype < FinchAPI::Enum # @!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 + module Type + extend FinchAPI::Enum + EMPLOYEE = :employee CONTRACTOR = :contractor @@ -303,33 +274,14 @@ class Type < FinchAPI::Enum # @!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 + module EmploymentStatus + extend FinchAPI::Enum + ACTIVE = :active DECEASED = :deceased LEAVE = :leave @@ -342,7 +294,6 @@ class EmploymentStatus < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end diff --git a/lib/finch-api/models/sandbox/employment_update_response.rb b/lib/finch-api/models/sandbox/employment_update_response.rb index dcd77e86..03ec24b6 100644 --- a/lib/finch-api/models/sandbox/employment_update_response.rb +++ b/lib/finch-api/models/sandbox/employment_update_response.rb @@ -250,29 +250,11 @@ class Employment < FinchAPI::BaseModel # 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 + module Subtype + extend FinchAPI::Enum + FULL_TIME = :full_time INTERN = :intern PART_TIME = :part_time @@ -284,24 +266,13 @@ class Subtype < FinchAPI::Enum # @!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 + module Type + extend FinchAPI::Enum + EMPLOYEE = :employee CONTRACTOR = :contractor @@ -309,33 +280,14 @@ class Type < FinchAPI::Enum # @!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 + module EmploymentStatus + extend FinchAPI::Enum + ACTIVE = :active DECEASED = :deceased LEAVE = :leave @@ -348,7 +300,6 @@ class EmploymentStatus < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end diff --git a/lib/finch-api/models/sandbox/individual_update_params.rb b/lib/finch-api/models/sandbox/individual_update_params.rb index 9ebf2475..509d8c4d 100644 --- a/lib/finch-api/models/sandbox/individual_update_params.rb +++ b/lib/finch-api/models/sandbox/individual_update_params.rb @@ -144,18 +144,9 @@ class Email < FinchAPI::BaseModel # def initialize: (Hash | FinchAPI::BaseModel) -> void - # @abstract - # - # @example - # ```ruby - # case type - # in :work - # # ... - # in :personal - # # ... - # end - # ``` - class Type < FinchAPI::Enum + module Type + extend FinchAPI::Enum + WORK = :work PERSONAL = :personal @@ -163,33 +154,14 @@ class Type < FinchAPI::Enum # @!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 + module Ethnicity + extend FinchAPI::Enum + ASIAN = :asian WHITE = :white BLACK_OR_AFRICAN_AMERICAN = :black_or_african_american @@ -203,28 +175,13 @@ class Ethnicity < FinchAPI::Enum # @!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 + module Gender + extend FinchAPI::Enum + FEMALE = :female MALE = :male OTHER = :other @@ -234,7 +191,6 @@ class Gender < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end @@ -263,18 +219,9 @@ class PhoneNumber < FinchAPI::BaseModel # def initialize: (Hash | FinchAPI::BaseModel) -> void - # @abstract - # - # @example - # ```ruby - # case type - # in :work - # # ... - # in :personal - # # ... - # end - # ``` - class Type < FinchAPI::Enum + module Type + extend FinchAPI::Enum + WORK = :work PERSONAL = :personal @@ -282,7 +229,6 @@ class Type < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; 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 index 10b86276..6e5e1984 100644 --- a/lib/finch-api/models/sandbox/individual_update_response.rb +++ b/lib/finch-api/models/sandbox/individual_update_response.rb @@ -152,18 +152,9 @@ class Email < FinchAPI::BaseModel # def initialize: (Hash | FinchAPI::BaseModel) -> void - # @abstract - # - # @example - # ```ruby - # case type - # in :work - # # ... - # in :personal - # # ... - # end - # ``` - class Type < FinchAPI::Enum + module Type + extend FinchAPI::Enum + WORK = :work PERSONAL = :personal @@ -171,33 +162,14 @@ class Type < FinchAPI::Enum # @!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 + module Ethnicity + extend FinchAPI::Enum + ASIAN = :asian WHITE = :white BLACK_OR_AFRICAN_AMERICAN = :black_or_african_american @@ -211,28 +183,13 @@ class Ethnicity < FinchAPI::Enum # @!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 + module Gender + extend FinchAPI::Enum + FEMALE = :female MALE = :male OTHER = :other @@ -242,7 +199,6 @@ class Gender < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end @@ -271,18 +227,9 @@ class PhoneNumber < FinchAPI::BaseModel # def initialize: (Hash | FinchAPI::BaseModel) -> void - # @abstract - # - # @example - # ```ruby - # case type - # in :work - # # ... - # in :personal - # # ... - # end - # ``` - class Type < FinchAPI::Enum + module Type + extend FinchAPI::Enum + WORK = :work PERSONAL = :personal @@ -290,7 +237,6 @@ class Type < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; 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 index 1d6b7205..de341449 100644 --- a/lib/finch-api/models/sandbox/job_create_params.rb +++ b/lib/finch-api/models/sandbox/job_create_params.rb @@ -22,25 +22,16 @@ class JobCreateParams < FinchAPI::BaseModel # 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 + module Type + extend FinchAPI::Enum + DATA_SYNC_ALL = :data_sync_all finalize! # @!parse # # @return [Array] - # # # def self.values; 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 index bb2a4b46..185c59dd 100644 --- a/lib/finch-api/models/sandbox/jobs/configuration_retrieve_response.rb +++ b/lib/finch-api/models/sandbox/jobs/configuration_retrieve_response.rb @@ -4,7 +4,8 @@ module FinchAPI module Models module Sandbox module Jobs - ConfigurationRetrieveResponse = FinchAPI::ArrayOf[-> { FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration }] + ConfigurationRetrieveResponse = + FinchAPI::ArrayOf[-> { FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration }] 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 index 74375558..5e799f4f 100644 --- a/lib/finch-api/models/sandbox/jobs/sandbox_job_configuration.rb +++ b/lib/finch-api/models/sandbox/jobs/sandbox_job_configuration.rb @@ -24,22 +24,9 @@ class SandboxJobConfiguration < FinchAPI::BaseModel # 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 + module CompletionStatus + extend FinchAPI::Enum + COMPLETE = :complete REAUTH_ERROR = :reauth_error PERMISSIONS_ERROR = :permissions_error @@ -49,27 +36,18 @@ class CompletionStatus < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end - # @abstract - # - # @example - # ```ruby - # case type - # in :data_sync_all - # # ... - # end - # ``` - class Type < FinchAPI::Enum + module Type + extend FinchAPI::Enum + DATA_SYNC_ALL = :data_sync_all finalize! # @!parse # # @return [Array] - # # # def self.values; 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 index df02a216..35306e20 100644 --- a/lib/finch-api/models/sandbox/payment_create_params.rb +++ b/lib/finch-api/models/sandbox/payment_create_params.rb @@ -243,28 +243,10 @@ class Metadata < FinchAPI::BaseModel 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 + module Type + extend FinchAPI::Enum + SALARY = :salary WAGE = :wage REIMBURSEMENT = :reimbursement @@ -283,7 +265,6 @@ class Type < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end end @@ -463,20 +444,10 @@ class Metadata < FinchAPI::BaseModel end end - # @abstract - # # The payment method. - # - # @example - # ```ruby - # case payment_method - # in :check - # # ... - # in :direct_deposit - # # ... - # end - # ``` - class PaymentMethod < FinchAPI::Enum + module PaymentMethod + extend FinchAPI::Enum + CHECK = :check DIRECT_DEPOSIT = :direct_deposit @@ -484,7 +455,6 @@ class PaymentMethod < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end @@ -580,24 +550,10 @@ class Metadata < FinchAPI::BaseModel end end - # @abstract - # # The type of taxes. - # - # @example - # ```ruby - # case type - # in :state - # # ... - # in :federal - # # ... - # in :local - # # ... - # in :fica - # # ... - # end - # ``` - class Type < FinchAPI::Enum + module Type + extend FinchAPI::Enum + STATE = :state FEDERAL = :federal LOCAL = :local @@ -607,27 +563,14 @@ class Type < FinchAPI::Enum # @!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 + module Type + extend FinchAPI::Enum + REGULAR_PAYROLL = :regular_payroll OFF_CYCLE_PAYROLL = :off_cycle_payroll ONE_TIME_PAYMENT = :one_time_payment @@ -636,7 +579,6 @@ class Type < FinchAPI::Enum # @!parse # # @return [Array] - # # # def self.values; end end end diff --git a/lib/finch-api/models/webhook_event.rb b/lib/finch-api/models/webhook_event.rb index 3b4914ad..02b0b402 100644 --- a/lib/finch-api/models/webhook_event.rb +++ b/lib/finch-api/models/webhook_event.rb @@ -2,37 +2,16 @@ 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 + module WebhookEvent + extend FinchAPI::Union + discriminator :event_type - variant -> { FinchAPI::Models::AccountUpdateEvent } + variant :"account.updated", -> { FinchAPI::Models::AccountUpdateEvent } - variant -> { FinchAPI::Models::JobCompletionEvent } + variant :"company.updated", -> { FinchAPI::Models::CompanyEvent } - variant -> { FinchAPI::Models::CompanyEvent } + variant -> { FinchAPI::Models::JobCompletionEvent } variant -> { FinchAPI::Models::DirectoryEvent } @@ -43,6 +22,10 @@ class WebhookEvent < FinchAPI::Union variant -> { FinchAPI::Models::PaymentEvent } variant -> { FinchAPI::Models::PayStatementEvent } + + # @!parse + # # @return [Array(FinchAPI::Models::AccountUpdateEvent, FinchAPI::Models::CompanyEvent, FinchAPI::Models::JobCompletionEvent, FinchAPI::Models::DirectoryEvent, FinchAPI::Models::EmploymentEvent, FinchAPI::Models::IndividualEvent, FinchAPI::Models::PaymentEvent, FinchAPI::Models::PayStatementEvent)] + # def self.variants; end end end end diff --git a/lib/finch-api/page.rb b/lib/finch-api/page.rb index 167eedd3..117cd89d 100644 --- a/lib/finch-api/page.rb +++ b/lib/finch-api/page.rb @@ -2,84 +2,79 @@ module FinchAPI # @example - # ```ruby - # if page.has_next? - # page = page.next_page - # end - # ``` + # if page.has_next? + # page = page.next_page + # end # # @example - # ```ruby - # page.auto_paging_each do |item| - # # item ... - # end - # ``` + # page.auto_paging_each do |item| + # puts(item) + # end # # @example - # ```ruby - # items = page.to_enum.take(2) + # items = + # page + # .to_enum + # .lazy + # .select { _1.object_id.even? } + # .map(&:itself) + # .take(2) + # .to_a # - # items => Array - # ``` + # items => Array class Page include FinchAPI::BasePage - # @return [Array] + # @return [Array, nil] attr_accessor :data # @return [FinchAPI::Models::Paging] attr_accessor :paging - # rubocop:disable Lint/UnusedMethodArgument - # @private + # @api 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 + # @param page_data [Hash{Symbol=>Object}] + def initialize(client:, req:, headers:, page_data:) + super model = req.fetch(:model) - case unwrapped + case page_data in {data: Array | nil => data} - @data = data&.map { model.coerce(_1) } + @data = data&.map { FinchAPI::Converter.coerce(model, _1) } else end - case unwrapped + case page_data 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 + paging&.offset.to_i + data.to_a.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") + message = "No more pages available. Please check #next_page? before calling ##{__method__}" + raise RuntimeError.new(message) end - req = FinchAPI::Util.deep_merge(@req, {query: {offset: paging&.offset.to_i + data.size}}) + req = FinchAPI::Util.deep_merge(@req, {query: {offset: paging&.offset.to_i + data.to_a.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") + raise ArgumentError.new("A block must be given to ##{__method__}") end page = self loop do @@ -90,7 +85,6 @@ def auto_paging_each(&blk) end # @return [String] - # def inspect "#<#{self.class}:0x#{object_id.to_s(16)} data=#{data.inspect} paging=#{paging.inspect}>" end diff --git a/lib/finch-api/pooled_net_requester.rb b/lib/finch-api/pooled_net_requester.rb index 0087f71d..b0f9134e 100644 --- a/lib/finch-api/pooled_net_requester.rb +++ b/lib/finch-api/pooled_net_requester.rb @@ -1,16 +1,18 @@ # frozen_string_literal: true module FinchAPI - # @private - # + # @api private class PooledNetRequester + # from the golang stdlib + # https://github.com/golang/go/blob/c8eced8580028328fde7c03cbfcb720ce15b2358/src/net/http/transport.go#L49 + KEEP_ALIVE_TIMEOUT = 30 + class << self - # @private + # @api private # # @param url [URI::Generic] # # @return [Net::HTTP] - # def connect(url) port = case [url.port, url.scheme] @@ -28,17 +30,16 @@ def connect(url) end end - # @private + # @api 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 + # @api private # # @param request [Hash{Symbol=>Object}] . # @@ -48,9 +49,11 @@ def calibrate_socket_timeout(conn, deadline) # # @option request [Hash{String=>String}] :headers # - # @return [Net::HTTPGenericRequest] + # @param blk [Proc] # - def build_request(request) + # @yieldparam [String] + # @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, @@ -63,54 +66,44 @@ def build_request(request) case body in nil + nil in String - req.body = body + req["content-length"] ||= body.bytesize.to_s unless req["transfer-encoding"] + req.body_stream = FinchAPI::Util::ReadIOAdapter.new(body, &) in StringIO - req.body = body.string - in IO - body.rewind - req.body_stream = body + req["content-length"] ||= body.size.to_s unless req["transfer-encoding"] + req.body_stream = FinchAPI::Util::ReadIOAdapter.new(body, &) + in IO | Enumerator + req["transfer-encoding"] ||= "chunked" unless req["content-length"] + req.body_stream = FinchAPI::Util::ReadIOAdapter.new(body, &) end req end end - # @private + # @api private # # @param url [URI::Generic] + # @param deadline [Float] # @param blk [Proc] # - private def with_pool(url, &blk) + # @raise [Timeout::Error] + # @yieldparam [Net::HTTP] + private def with_pool(url, deadline:, &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 - + timeout = deadline - FinchAPI::Util.monotonic_secs pool = @mutex.synchronize do - @pools[origin] ||= ConnectionPool.new(size: Etc.nprocessors) do + @pools[origin] ||= ConnectionPool.new(size: @size) do self.class.connect(url) end end - pool.with do |conn| - th[key] = true - blk.call(conn) - ensure - th[key] = nil - end + pool.with(timeout: timeout, &blk) end - # @private + # @api private # # @param request [Hash{Symbol=>Object}] . # @@ -124,24 +117,29 @@ def build_request(request) # # @option request [Float] :deadline # - # @return [Array(Net::HTTPResponse, Enumerable)] - # + # @return [Array(Integer, 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| + with_pool(url, deadline: deadline) do |conn| next if finished + req = self.class.build_request(request) do + self.class.calibrate_socket_timeout(conn, deadline) + end + self.class.calibrate_socket_timeout(conn, deadline) - conn.start unless conn.started? + unless conn.started? + conn.keep_alive_timeout = self.class::KEEP_ALIVE_TIMEOUT + conn.start + end self.class.calibrate_socket_timeout(conn, deadline) conn.request(req) do |rsp| - y << [conn, rsp] + y << [conn, req, rsp] break if finished rsp.read_body do |bytes| @@ -153,22 +151,29 @@ def execute(request) eof = true end end + rescue Timeout::Error + raise FinchAPI::APITimeoutError end - conn, response = enum.next - body = FinchAPI::Util.fused_enum(enum) do + conn, _, response = enum.next + body = FinchAPI::Util.fused_enum(enum, external: true) do finished = true tap do enum.next rescue StopIteration + nil end conn.finish if !eof && conn&.started? end - [response, (response.body = body)] + [Integer(response.code), response, (response.body = body)] end - def initialize + # @api private + # + # @param size [Integer] + def initialize(size: Etc.nprocessors) @mutex = Mutex.new + @size = size @pools = {} end end diff --git a/lib/finch-api/request_options.rb b/lib/finch-api/request_options.rb index 2bb2b387..a6f9db8a 100644 --- a/lib/finch-api/request_options.rb +++ b/lib/finch-api/request_options.rb @@ -1,10 +1,7 @@ # frozen_string_literal: true module FinchAPI - # @private - # - # @abstract - # + # @api private module RequestParameters # @!parse # # Options to specify HTTP behaviour for this request. @@ -12,7 +9,6 @@ module RequestParameters # attr_accessor :request_options # @param mod [Module] - # def self.included(mod) return unless mod <= FinchAPI::BaseModel @@ -20,15 +16,13 @@ def self.included(mod) mod.optional(:request_options, FinchAPI::RequestOptions) end - # @private - # + # @api private module Converter - # @private + # @api private # # @param params [Object] # # @return [Array(Object, Hash{Symbol=>Object})] - # def dump_request(params) case (dumped = dump(params)) in Hash @@ -46,12 +40,11 @@ def dump_request(params) # 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 + # @api private # # @param opts [FinchAPI::RequestOptions, Hash{Symbol=>Object}] # # @raise [ArgumentError] - # def self.validate!(opts) case opts in FinchAPI::RequestOptions | Hash @@ -90,7 +83,7 @@ def self.validate!(opts) # 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] + # @return [Object, nil] optional :extra_body, FinchAPI::HashOf[FinchAPI::Unknown] # @!attribute max_retries diff --git a/lib/finch-api/resources/access_tokens.rb b/lib/finch-api/resources/access_tokens.rb index d760f881..4a840cc6 100644 --- a/lib/finch-api/resources/access_tokens.rb +++ b/lib/finch-api/resources/access_tokens.rb @@ -18,7 +18,6 @@ class AccessTokens # @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( @@ -31,7 +30,6 @@ def create(params) end # @param client [FinchAPI::Client] - # def initialize(client:) @client = client end diff --git a/lib/finch-api/resources/account.rb b/lib/finch-api/resources/account.rb index 8f7e3f6a..3d1fcd12 100644 --- a/lib/finch-api/resources/account.rb +++ b/lib/finch-api/resources/account.rb @@ -10,7 +10,6 @@ class Account # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options # # @return [FinchAPI::Models::DisconnectResponse] - # def disconnect(params = {}) @client.request( method: :post, @@ -27,7 +26,6 @@ def disconnect(params = {}) # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options # # @return [FinchAPI::Models::Introspection] - # def introspect(params = {}) @client.request( method: :get, @@ -38,7 +36,6 @@ def introspect(params = {}) end # @param client [FinchAPI::Client] - # def initialize(client:) @client = client end diff --git a/lib/finch-api/resources/connect.rb b/lib/finch-api/resources/connect.rb index 538d30a8..ba71f94c 100644 --- a/lib/finch-api/resources/connect.rb +++ b/lib/finch-api/resources/connect.rb @@ -7,7 +7,6 @@ class Connect attr_reader :sessions # @param client [FinchAPI::Client] - # def initialize(client:) @client = client @sessions = FinchAPI::Resources::Connect::Sessions.new(client: client) diff --git a/lib/finch-api/resources/connect/sessions.rb b/lib/finch-api/resources/connect/sessions.rb index f490b350..40b84600 100644 --- a/lib/finch-api/resources/connect/sessions.rb +++ b/lib/finch-api/resources/connect/sessions.rb @@ -30,7 +30,6 @@ class Sessions # @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( @@ -58,7 +57,6 @@ def new(params) # @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( @@ -71,7 +69,6 @@ def reauthenticate(params) end # @param client [FinchAPI::Client] - # def initialize(client:) @client = client end diff --git a/lib/finch-api/resources/hris.rb b/lib/finch-api/resources/hris.rb index 635afd0a..34b46404 100644 --- a/lib/finch-api/resources/hris.rb +++ b/lib/finch-api/resources/hris.rb @@ -28,7 +28,6 @@ class HRIS attr_reader :benefits # @param client [FinchAPI::Client] - # def initialize(client:) @client = client @company = FinchAPI::Resources::HRIS::Company.new(client: client) diff --git a/lib/finch-api/resources/hris/benefits.rb b/lib/finch-api/resources/hris/benefits.rb index 6db28fd4..c7561451 100644 --- a/lib/finch-api/resources/hris/benefits.rb +++ b/lib/finch-api/resources/hris/benefits.rb @@ -23,7 +23,6 @@ class Benefits # @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( @@ -44,7 +43,6 @@ def create(params = {}) # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options # # @return [FinchAPI::Models::HRIS::CompanyBenefit] - # def retrieve(benefit_id, params = {}) @client.request( method: :get, @@ -65,7 +63,6 @@ def retrieve(benefit_id, params = {}) # @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( @@ -84,7 +81,6 @@ def update(benefit_id, params = {}) # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options # # @return [FinchAPI::SinglePage] - # def list(params = {}) @client.request( method: :get, @@ -102,7 +98,6 @@ def list(params = {}) # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options # # @return [FinchAPI::SinglePage] - # def list_supported_benefits(params = {}) @client.request( method: :get, @@ -114,7 +109,6 @@ def list_supported_benefits(params = {}) end # @param client [FinchAPI::Client] - # def initialize(client:) @client = client @individuals = FinchAPI::Resources::HRIS::Benefits::Individuals.new(client: client) diff --git a/lib/finch-api/resources/hris/benefits/individuals.rb b/lib/finch-api/resources/hris/benefits/individuals.rb index 81988f39..fd91aaee 100644 --- a/lib/finch-api/resources/hris/benefits/individuals.rb +++ b/lib/finch-api/resources/hris/benefits/individuals.rb @@ -19,7 +19,6 @@ class Individuals # @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( @@ -41,7 +40,6 @@ def enroll_many(benefit_id, params = {}) # @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, @@ -63,9 +61,9 @@ def enrolled_ids(benefit_id, params = {}) # @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) + parsed, options = + FinchAPI::Models::HRIS::Benefits::IndividualRetrieveManyBenefitsParams.dump_request(params) @client.request( method: :get, path: ["employer/benefits/%0s/individuals", benefit_id], @@ -87,7 +85,6 @@ def retrieve_many_benefits(benefit_id, params = {}) # @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( @@ -101,7 +98,6 @@ def unenroll_many(benefit_id, params = {}) end # @param client [FinchAPI::Client] - # def initialize(client:) @client = client end diff --git a/lib/finch-api/resources/hris/company.rb b/lib/finch-api/resources/hris/company.rb index c9901cfa..05f07846 100644 --- a/lib/finch-api/resources/hris/company.rb +++ b/lib/finch-api/resources/hris/company.rb @@ -11,7 +11,6 @@ class Company # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options # # @return [FinchAPI::Models::HRIS::HRISCompany] - # def retrieve(params = {}) @client.request( method: :get, @@ -22,7 +21,6 @@ def retrieve(params = {}) end # @param client [FinchAPI::Client] - # def initialize(client:) @client = client end diff --git a/lib/finch-api/resources/hris/directory.rb b/lib/finch-api/resources/hris/directory.rb index 88b8fa41..051952f8 100644 --- a/lib/finch-api/resources/hris/directory.rb +++ b/lib/finch-api/resources/hris/directory.rb @@ -15,7 +15,6 @@ class Directory # @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( @@ -31,31 +30,9 @@ def list(params = {}) # @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 + alias_method :list_individuals, :list # @param client [FinchAPI::Client] - # def initialize(client:) @client = client end diff --git a/lib/finch-api/resources/hris/documents.rb b/lib/finch-api/resources/hris/documents.rb index 5a7aa50b..996c99db 100644 --- a/lib/finch-api/resources/hris/documents.rb +++ b/lib/finch-api/resources/hris/documents.rb @@ -4,8 +4,8 @@ module FinchAPI module Resources class HRIS class Documents - # **Beta:** This endpoint is in beta and may change. - # Retrieve a list of company-wide 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}] . # @@ -22,7 +22,6 @@ class Documents # @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( @@ -34,8 +33,8 @@ def list(params = {}) ) end - # **Beta:** This endpoint is in beta and may change. - # Retrieve details of a specific document by its ID. + # **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. # @@ -44,7 +43,6 @@ def list(params = {}) # @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, @@ -55,7 +53,6 @@ def retreive(document_id, params = {}) end # @param client [FinchAPI::Client] - # def initialize(client:) @client = client end diff --git a/lib/finch-api/resources/hris/employments.rb b/lib/finch-api/resources/hris/employments.rb index de3c9938..524377f0 100644 --- a/lib/finch-api/resources/hris/employments.rb +++ b/lib/finch-api/resources/hris/employments.rb @@ -13,7 +13,6 @@ class Employments # @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( @@ -27,7 +26,6 @@ def retrieve_many(params) end # @param client [FinchAPI::Client] - # def initialize(client:) @client = client end diff --git a/lib/finch-api/resources/hris/individuals.rb b/lib/finch-api/resources/hris/individuals.rb index 336d2549..fc4bb17f 100644 --- a/lib/finch-api/resources/hris/individuals.rb +++ b/lib/finch-api/resources/hris/individuals.rb @@ -15,7 +15,6 @@ class Individuals # @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( @@ -29,7 +28,6 @@ def retrieve_many(params = {}) end # @param client [FinchAPI::Client] - # def initialize(client:) @client = client end diff --git a/lib/finch-api/resources/hris/pay_statements.rb b/lib/finch-api/resources/hris/pay_statements.rb index 963734af..309e6d3d 100644 --- a/lib/finch-api/resources/hris/pay_statements.rb +++ b/lib/finch-api/resources/hris/pay_statements.rb @@ -16,7 +16,6 @@ class PayStatements # @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( @@ -30,7 +29,6 @@ def retrieve_many(params) end # @param client [FinchAPI::Client] - # def initialize(client:) @client = client end diff --git a/lib/finch-api/resources/hris/payments.rb b/lib/finch-api/resources/hris/payments.rb index 6bb93ed0..e54785ca 100644 --- a/lib/finch-api/resources/hris/payments.rb +++ b/lib/finch-api/resources/hris/payments.rb @@ -17,7 +17,6 @@ class Payments # @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( @@ -31,7 +30,6 @@ def list(params) end # @param client [FinchAPI::Client] - # def initialize(client:) @client = client end diff --git a/lib/finch-api/resources/jobs.rb b/lib/finch-api/resources/jobs.rb index ba33b43b..06d80494 100644 --- a/lib/finch-api/resources/jobs.rb +++ b/lib/finch-api/resources/jobs.rb @@ -10,7 +10,6 @@ class Jobs attr_reader :manual # @param client [FinchAPI::Client] - # def initialize(client:) @client = client @automated = FinchAPI::Resources::Jobs::Automated.new(client: client) diff --git a/lib/finch-api/resources/jobs/automated.rb b/lib/finch-api/resources/jobs/automated.rb index d91cbd90..66d2b505 100644 --- a/lib/finch-api/resources/jobs/automated.rb +++ b/lib/finch-api/resources/jobs/automated.rb @@ -28,7 +28,6 @@ class Automated # @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( @@ -49,7 +48,6 @@ def create(params) # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options # # @return [FinchAPI::Models::Jobs::AutomatedAsyncJob] - # def retrieve(job_id, params = {}) @client.request( method: :get, @@ -71,22 +69,19 @@ def retrieve(job_id, params = {}) # # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options # - # @return [FinchAPI::Page] - # + # @return [FinchAPI::Models::Jobs::AutomatedListResponse] 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, + model: FinchAPI::Models::Jobs::AutomatedListResponse, options: options ) end # @param client [FinchAPI::Client] - # def initialize(client:) @client = client end diff --git a/lib/finch-api/resources/jobs/manual.rb b/lib/finch-api/resources/jobs/manual.rb index bb9d7ac5..a6cdc88e 100644 --- a/lib/finch-api/resources/jobs/manual.rb +++ b/lib/finch-api/resources/jobs/manual.rb @@ -14,7 +14,6 @@ class Manual # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options # # @return [FinchAPI::Models::Jobs::ManualAsyncJob] - # def retrieve(job_id, params = {}) @client.request( method: :get, @@ -25,7 +24,6 @@ def retrieve(job_id, params = {}) end # @param client [FinchAPI::Client] - # def initialize(client:) @client = client end diff --git a/lib/finch-api/resources/payroll.rb b/lib/finch-api/resources/payroll.rb index 57884396..ae4d0c07 100644 --- a/lib/finch-api/resources/payroll.rb +++ b/lib/finch-api/resources/payroll.rb @@ -7,7 +7,6 @@ class Payroll attr_reader :pay_groups # @param client [FinchAPI::Client] - # def initialize(client:) @client = client @pay_groups = FinchAPI::Resources::Payroll::PayGroups.new(client: client) diff --git a/lib/finch-api/resources/payroll/pay_groups.rb b/lib/finch-api/resources/payroll/pay_groups.rb index 4b792392..2c07d48e 100644 --- a/lib/finch-api/resources/payroll/pay_groups.rb +++ b/lib/finch-api/resources/payroll/pay_groups.rb @@ -13,7 +13,6 @@ class PayGroups # @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, @@ -34,7 +33,6 @@ def retrieve(pay_group_id, params = {}) # @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( @@ -48,7 +46,6 @@ def list(params = {}) end # @param client [FinchAPI::Client] - # def initialize(client:) @client = client end diff --git a/lib/finch-api/resources/providers.rb b/lib/finch-api/resources/providers.rb index ce6daa52..3edff480 100644 --- a/lib/finch-api/resources/providers.rb +++ b/lib/finch-api/resources/providers.rb @@ -10,7 +10,6 @@ class Providers # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options # # @return [FinchAPI::SinglePage] - # def list(params = {}) @client.request( method: :get, @@ -22,7 +21,6 @@ def list(params = {}) end # @param client [FinchAPI::Client] - # def initialize(client:) @client = client end diff --git a/lib/finch-api/resources/request_forwarding.rb b/lib/finch-api/resources/request_forwarding.rb index c41cd81a..cc0b573d 100644 --- a/lib/finch-api/resources/request_forwarding.rb +++ b/lib/finch-api/resources/request_forwarding.rb @@ -30,7 +30,6 @@ class RequestForwarding # @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( @@ -43,7 +42,6 @@ def forward(params) end # @param client [FinchAPI::Client] - # def initialize(client:) @client = client end diff --git a/lib/finch-api/resources/sandbox.rb b/lib/finch-api/resources/sandbox.rb index ebde5169..6e34091f 100644 --- a/lib/finch-api/resources/sandbox.rb +++ b/lib/finch-api/resources/sandbox.rb @@ -25,7 +25,6 @@ class Sandbox attr_reader :jobs # @param client [FinchAPI::Client] - # def initialize(client:) @client = client @connections = FinchAPI::Resources::Sandbox::Connections.new(client: client) diff --git a/lib/finch-api/resources/sandbox/company.rb b/lib/finch-api/resources/sandbox/company.rb index 140a7b50..70c8df86 100644 --- a/lib/finch-api/resources/sandbox/company.rb +++ b/lib/finch-api/resources/sandbox/company.rb @@ -27,7 +27,6 @@ class Company # @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( @@ -40,7 +39,6 @@ def update(params) end # @param client [FinchAPI::Client] - # def initialize(client:) @client = client end diff --git a/lib/finch-api/resources/sandbox/connections.rb b/lib/finch-api/resources/sandbox/connections.rb index 80f00bc1..f1c1c117 100644 --- a/lib/finch-api/resources/sandbox/connections.rb +++ b/lib/finch-api/resources/sandbox/connections.rb @@ -24,7 +24,6 @@ class Connections # @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( @@ -37,7 +36,6 @@ def create(params) end # @param client [FinchAPI::Client] - # def initialize(client:) @client = client @accounts = FinchAPI::Resources::Sandbox::Connections::Accounts.new(client: client) diff --git a/lib/finch-api/resources/sandbox/connections/accounts.rb b/lib/finch-api/resources/sandbox/connections/accounts.rb index f3e7997a..e1589b6b 100644 --- a/lib/finch-api/resources/sandbox/connections/accounts.rb +++ b/lib/finch-api/resources/sandbox/connections/accounts.rb @@ -21,7 +21,6 @@ class Accounts # @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( @@ -43,7 +42,6 @@ def create(params) # @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( @@ -56,7 +54,6 @@ def update(params = {}) end # @param client [FinchAPI::Client] - # def initialize(client:) @client = client end diff --git a/lib/finch-api/resources/sandbox/directory.rb b/lib/finch-api/resources/sandbox/directory.rb index 26fd4156..04e5e44d 100644 --- a/lib/finch-api/resources/sandbox/directory.rb +++ b/lib/finch-api/resources/sandbox/directory.rb @@ -14,7 +14,6 @@ class Directory # @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( @@ -27,7 +26,6 @@ def create(params = {}) end # @param client [FinchAPI::Client] - # def initialize(client:) @client = client end diff --git a/lib/finch-api/resources/sandbox/employment.rb b/lib/finch-api/resources/sandbox/employment.rb index 3fc0520a..56efcbe0 100644 --- a/lib/finch-api/resources/sandbox/employment.rb +++ b/lib/finch-api/resources/sandbox/employment.rb @@ -53,7 +53,6 @@ class Employment # @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( @@ -66,7 +65,6 @@ def update(individual_id, params = {}) end # @param client [FinchAPI::Client] - # def initialize(client:) @client = client end diff --git a/lib/finch-api/resources/sandbox/individual.rb b/lib/finch-api/resources/sandbox/individual.rb index 19065cfd..541489d7 100644 --- a/lib/finch-api/resources/sandbox/individual.rb +++ b/lib/finch-api/resources/sandbox/individual.rb @@ -42,7 +42,6 @@ class Individual # @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( @@ -55,7 +54,6 @@ def update(individual_id, params = {}) end # @param client [FinchAPI::Client] - # def initialize(client:) @client = client end diff --git a/lib/finch-api/resources/sandbox/jobs.rb b/lib/finch-api/resources/sandbox/jobs.rb index 08859b39..f98aaf4e 100644 --- a/lib/finch-api/resources/sandbox/jobs.rb +++ b/lib/finch-api/resources/sandbox/jobs.rb @@ -16,7 +16,6 @@ class Jobs # @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( @@ -29,7 +28,6 @@ def create(params) end # @param client [FinchAPI::Client] - # def initialize(client:) @client = client @configuration = FinchAPI::Resources::Sandbox::Jobs::Configuration.new(client: client) diff --git a/lib/finch-api/resources/sandbox/jobs/configuration.rb b/lib/finch-api/resources/sandbox/jobs/configuration.rb index cc8cb27f..c0464b09 100644 --- a/lib/finch-api/resources/sandbox/jobs/configuration.rb +++ b/lib/finch-api/resources/sandbox/jobs/configuration.rb @@ -12,7 +12,6 @@ class Configuration # @option params [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] :request_options # # @return [Array] - # def retrieve(params = {}) @client.request( method: :get, @@ -33,7 +32,6 @@ def retrieve(params = {}) # @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( @@ -46,7 +44,6 @@ def update(params) end # @param client [FinchAPI::Client] - # def initialize(client:) @client = client end diff --git a/lib/finch-api/resources/sandbox/payment.rb b/lib/finch-api/resources/sandbox/payment.rb index da0669ea..753ae9ac 100644 --- a/lib/finch-api/resources/sandbox/payment.rb +++ b/lib/finch-api/resources/sandbox/payment.rb @@ -17,7 +17,6 @@ class Payment # @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( @@ -30,7 +29,6 @@ def create(params = {}) end # @param client [FinchAPI::Client] - # def initialize(client:) @client = client end diff --git a/lib/finch-api/resources/webhooks.rb b/lib/finch-api/resources/webhooks.rb index 6a8781e0..c82af6c9 100644 --- a/lib/finch-api/resources/webhooks.rb +++ b/lib/finch-api/resources/webhooks.rb @@ -4,7 +4,6 @@ module FinchAPI module Resources class Webhooks # @param client [FinchAPI::Client] - # def initialize(client:) @client = client end diff --git a/lib/finch-api/responses_page.rb b/lib/finch-api/responses_page.rb index c041c8b0..ecff105d 100644 --- a/lib/finch-api/responses_page.rb +++ b/lib/finch-api/responses_page.rb @@ -2,70 +2,64 @@ module FinchAPI # @example - # ```ruby - # if responses_page.has_next? - # page = responses_page.next_page - # end - # ``` + # if responses_page.has_next? + # responses_page = responses_page.next_page + # end # # @example - # ```ruby - # responses_page.auto_paging_each do |item| - # # item ... - # end - # ``` + # responses_page.auto_paging_each do |individual| + # puts(individual) + # end # # @example - # ```ruby - # items = responses_page.to_enum.take(2) + # individuals = + # responses_page + # .to_enum + # .lazy + # .select { _1.object_id.even? } + # .map(&:itself) + # .take(2) + # .to_a # - # items => Array - # ``` + # individuals => Array class ResponsesPage include FinchAPI::BasePage - # @return [Array] + # @return [Array, nil] attr_accessor :responses - # rubocop:disable Lint/UnusedMethodArgument - # @private + # @api 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 + # @param page_data [Array] + def initialize(client:, req:, headers:, page_data:) + super model = req.fetch(:model) - case unwrapped + case page_data in {responses: Array | nil => responses} - @responses = responses&.map { model.coerce(_1) } + @responses = responses&.map { FinchAPI::Converter.coerce(model, _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 + RuntimeError.new("No more pages available.") end # @param blk [Proc] - # def auto_paging_each(&blk) unless block_given? - raise ArgumentError.new("A block must be given to #auto_paging_each") + raise ArgumentError.new("A block must be given to ##{__method__}") end page = self loop do @@ -76,7 +70,6 @@ def auto_paging_each(&blk) end # @return [String] - # def inspect "#<#{self.class}:0x#{object_id.to_s(16)} responses=#{responses.inspect}>" end diff --git a/lib/finch-api/single_page.rb b/lib/finch-api/single_page.rb index 3cf33206..ea744fec 100644 --- a/lib/finch-api/single_page.rb +++ b/lib/finch-api/single_page.rb @@ -2,68 +2,61 @@ module FinchAPI # @example - # ```ruby - # if single_page.has_next? - # page = single_page.next_page - # end - # ``` + # if single_page.has_next? + # single_page = single_page.next_page + # end # # @example - # ```ruby - # single_page.auto_paging_each do |item| - # # item ... - # end - # ``` + # single_page.auto_paging_each do |payment| + # puts(payment) + # end # # @example - # ```ruby - # items = single_page.to_enum.take(2) + # payments = + # single_page + # .to_enum + # .lazy + # .select { _1.object_id.even? } + # .map(&:itself) + # .take(2) + # .to_a # - # items => Array - # ``` + # payments => Array class SinglePage < ::Array include FinchAPI::BasePage - # rubocop:disable Lint/UnusedMethodArgument - # @private + # @api 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 + # @param page_data [Array] + def initialize(client:, req:, headers:, page_data:) + super model = req.fetch(:model) - case unwrapped + case page_data in Array - super(unwrapped&.map { model.coerce(_1) }) + replace(page_data.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 + RuntimeError.new("No more pages available.") end # @param blk [Proc] - # def auto_paging_each(&blk) unless block_given? - raise ArgumentError.new("A block must be given to #auto_paging_each") + raise ArgumentError.new("A block must be given to ##{__method__}") end page = self loop do @@ -74,7 +67,6 @@ def auto_paging_each(&blk) end # @return [String] - # def inspect "#<#{self.class}:0x#{object_id.to_s(16)}>" end diff --git a/lib/finch-api/util.rb b/lib/finch-api/util.rb index 4cf22db3..ae602709 100644 --- a/lib/finch-api/util.rb +++ b/lib/finch-api/util.rb @@ -3,20 +3,17 @@ module FinchAPI # rubocop:disable Metrics/ModuleLength - # @private - # + # @api private module Util - # @private + # @api private # # @return [Float] - # def self.monotonic_secs = Process.clock_gettime(Process::CLOCK_MONOTONIC) class << self - # @private + # @api private # # @return [String] - # def arch case (arch = RbConfig::CONFIG["arch"])&.downcase in nil @@ -32,10 +29,9 @@ def arch end end - # @private + # @api private # # @return [String] - # def os case (host = RbConfig::CONFIG["host_os"])&.downcase in nil @@ -57,12 +53,11 @@ def os end class << self - # @private + # @api private # # @param input [Object] # - # @return [Boolean, Object] - # + # @return [Boolean] def primitive?(input) case input in true | false | Integer | Float | Symbol | String @@ -72,12 +67,11 @@ def primitive?(input) end end - # @private + # @api private # # @param input [Object] # # @return [Boolean, Object] - # def coerce_boolean(input) case input.is_a?(String) ? input.downcase : input in Numeric @@ -91,13 +85,12 @@ def coerce_boolean(input) end end - # @private + # @api private # # @param input [Object] # # @raise [ArgumentError] # @return [Boolean, nil] - # def coerce_boolean!(input) case coerce_boolean(input) in true | false | nil => coerced @@ -107,12 +100,11 @@ def coerce_boolean!(input) end end - # @private + # @api private # # @param input [Object] # # @return [Integer, Object] - # def coerce_integer(input) case input in true @@ -124,12 +116,11 @@ def coerce_integer(input) end end - # @private + # @api private # # @param input [Object] # # @return [Float, Object] - # def coerce_float(input) case input in true @@ -141,12 +132,11 @@ def coerce_float(input) end end - # @private + # @api private # # @param input [Object] # # @return [Hash{Object=>Object}, Object] - # def coerce_hash(input) case input in NilClass | Array | Set | Enumerator @@ -165,14 +155,13 @@ def coerce_hash(input) OMIT = Object.new.freeze class << self - # @private + # @api 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, _] @@ -191,7 +180,7 @@ class << self end end - # @private + # @api private # # Recursively merge one hash with another. If the values at a given key are not # both hashes, just take the new value. @@ -203,7 +192,6 @@ class << self # @param concat [Boolean] whether to merge sequences by concatenation. # # @return [Object] - # def deep_merge(*values, sentinel: nil, concat: false) case values in [value, *values] @@ -215,7 +203,7 @@ def deep_merge(*values, sentinel: nil, concat: false) end end - # @private + # @api private # # @param data [Hash{Symbol=>Object}, Array, Object] # @param pick [Symbol, Integer, Array, nil] @@ -223,7 +211,6 @@ def deep_merge(*values, sentinel: nil, concat: false) # @param blk [Proc, nil] # # @return [Object, nil] - # def dig(data, pick, sentinel = nil, &blk) case [data, pick, blk] in [_, nil, nil] @@ -248,22 +235,20 @@ def dig(data, pick, sentinel = nil, &blk) end class << self - # @private + # @api private # # @param uri [URI::Generic] # # @return [String] - # def uri_origin(uri) "#{uri.scheme}://#{uri.host}#{uri.port == uri.default_port ? '' : ":#{uri.port}"}" end - # @private + # @api private # # @param path [String, Array] # # @return [String] - # def interpolate_path(path) case path in String @@ -278,40 +263,37 @@ def interpolate_path(path) end class << self - # @private + # @api private # # @param query [String, nil] # # @return [Hash{String=>Array}] - # def decode_query(query) CGI.parse(query.to_s) end - # @private + # @api 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 + # @api 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 + # @api private # # @param parsed [Hash{Symbol=>String, Integer, nil}] . # @@ -326,12 +308,11 @@ def parse_uri(url) # @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 + # @api private # # @param lhs [Hash{Symbol=>String, Integer, nil}] . # @@ -358,7 +339,6 @@ def unparse_uri(parsed) # @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}/" @@ -380,112 +360,199 @@ def join_parsed_uri(lhs, rhs) end class << self - # @private + # @api 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 + value = + case val + in Array + val.map { _1.to_s.strip }.join(", ") + else + val&.to_s&.strip + end + [key.downcase, value] + end + end + end + + # @api private + # + # An adapter that satisfies the IO interface required by `::IO.copy_stream` + class ReadIOAdapter + # @api private + # + # @param max_len [Integer, nil] + # + # @return [String] + private def read_enum(max_len) + case max_len + in nil + @stream.to_a.join + in Integer + @buf << @stream.next while @buf.length < max_len + @buf.slice!(..max_len) + end + rescue StopIteration + @stream = nil + @buf.slice!(0..) + end + + # @api private + # + # @param max_len [Integer, nil] + # @param out_string [String, nil] + # + # @return [String, nil] + def read(max_len = nil, out_string = nil) + case @stream + in nil + nil + in IO | StringIO + @stream.read(max_len, out_string) + in Enumerator + read = read_enum(max_len) + case out_string + in String + out_string.replace(read) + in nil + read end - [key.downcase, val] end + .tap(&@blk) + end + + # @api private + # + # @param stream [String, IO, StringIO, Enumerable] + # @param blk [Proc] + # + # @yieldparam [String] + def initialize(stream, &blk) + @stream = stream.is_a?(String) ? StringIO.new(stream) : stream + @buf = String.new.b + @blk = blk end end class << self - # @private + # @param blk [Proc] # - # @param io [StringIO] + # @yieldparam [Enumerator::Yielder] + # @return [Enumerable] + def string_io(&blk) + Enumerator.new do |y| + y.define_singleton_method(:write) do + self << _1.clone + _1.bytesize + end + + blk.call(y) + end + end + end + + class << self + # rubocop:disable Naming/MethodParameterName + + # @api private + # + # @param y [Enumerator::Yielder] # @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" + private def encode_multipart_formdata(y, boundary:, key:, val:) + y << "--#{boundary}\r\n" + y << "Content-Disposition: form-data" unless key.nil? name = ERB::Util.url_encode(key.to_s) - io << "; name=\"#{name}\"" + y << "; name=\"#{name}\"" end if val.is_a?(IO) filename = ERB::Util.url_encode(File.basename(val.to_path)) - io << "; filename=\"#{filename}\"" + y << "; filename=\"#{filename}\"" end - io << "\r\n" + y << "\r\n" case val - in IO | StringIO - io << "Content-Type: application/octet-stream\r\n\r\n" - IO.copy_stream(val, io) + in IO + y << "Content-Type: application/octet-stream\r\n\r\n" + IO.copy_stream(val, y) + in StringIO + y << "Content-Type: application/octet-stream\r\n\r\n" + y << val.string in String - io << "Content-Type: application/octet-stream\r\n\r\n" - io << val.to_s + y << "Content-Type: application/octet-stream\r\n\r\n" + y << val.to_s in true | false | Integer | Float | Symbol - io << "Content-Type: text/plain\r\n\r\n" - io << val.to_s + y << "Content-Type: text/plain\r\n\r\n" + y << val.to_s else - io << "Content-Type: application/json\r\n\r\n" - io << JSON.fast_generate(val) + y << "Content-Type: application/json\r\n\r\n" + y << JSON.fast_generate(val) end - io << "\r\n" + y << "\r\n" end - # @private + # rubocop:enable Naming/MethodParameterName + + # @api private + # + # @param body [Object] + # + # @return [Array(String, Enumerable)] + private def encode_multipart_streaming(body) + boundary = SecureRandom.urlsafe_base64(60) + + strio = string_io do |y| + 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(y, boundary: boundary, key: key, val: v) + end + else + encode_multipart_formdata(y, boundary: boundary, key: key, val: val) + end + end + else + encode_multipart_formdata(y, boundary: boundary, key: nil, val: body) + end + y << "--#{boundary}--\r\n" + end + + [boundary, strio] + end + + # @api 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] + in [%r{^application/(?:vnd\.api\+)?json}, Hash | Array] [headers, JSON.fast_generate(body)] + in [%r{^application/(?:x-)?jsonl}, Enumerable] + [headers, body.lazy.map { JSON.fast_generate(_1) }] 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" - } + boundary, strio = encode_multipart_streaming(body) + headers = {**headers, "content-type" => "#{content_type}; boundary=#{boundary}"} [headers, strio] in [_, StringIO] [headers, body.string] - in [_, IO] - headers = {**headers, "transfer-encoding" => "chunked"} - [headers, body] else [headers, body] end end - # @private + # @api private # # @param headers [Hash{String=>String}, Net::HTTPHeader] # @param stream [Enumerable] @@ -493,13 +560,9 @@ def encode_content(headers, body) # # @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} + in %r{^application/(?:vnd\.api\+)?json} json = stream.to_a.join begin JSON.parse(json, symbolize_names: true) @@ -507,6 +570,14 @@ def decode_content(headers, stream:, suppress_error: false) raise e unless suppress_error json end + in %r{^application/(?:x-)?jsonl} + lines = decode_lines(stream) + chain_fused(lines) do |y| + lines.each { y << JSON.parse(_1, symbolize_names: true) } + end + in %r{^text/event-stream} + lines = decode_lines(stream) + decode_sse(lines) in %r{^text/} stream.to_a.join else @@ -517,22 +588,26 @@ def decode_content(headers, stream:, suppress_error: false) end class << self - # @private + # @api private # # https://doc.rust-lang.org/std/iter/trait.FusedIterator.html # # @param enum [Enumerable] + # @param external [Boolean] # @param close [Proc] # # @return [Enumerable] - # - def fused_enum(enum, &close) + def fused_enum(enum, external: false, &close) fused = false iter = Enumerator.new do |y| next if fused fused = true - loop { y << enum.next } + if external + loop { y << enum.next } + else + enum.each(&y) + end ensure close&.call close = nil @@ -545,10 +620,9 @@ def fused_enum(enum, &close) iter end - # @private + # @api private # # @param enum [Enumerable, nil] - # def close_fused!(enum) return unless enum.is_a?(Enumerator) @@ -557,11 +631,13 @@ def close_fused!(enum) # rubocop:enable Lint/UnreachableLoop end - # @private + # @api private # # @param enum [Enumerable, nil] # @param blk [Proc] # + # @yieldparam [Enumerator::Yielder] + # @return [Enumerable] def chain_fused(enum, &blk) iter = Enumerator.new { blk.call(_1) } fused_enum(iter) { close_fused!(enum) } @@ -569,40 +645,55 @@ def chain_fused(enum, &blk) end class << self - # @private + # @api private # # @param enum [Enumerable] # # @return [Enumerable] - # - def enum_lines(enum) + def decode_lines(enum) + re = /(\r\n|\r|\n)/ + buffer = String.new.b + cr_seen = nil + chain_fused(enum) do |y| - buffer = String.new enum.each do |row| + offset = buffer.bytesize buffer << row - while (idx = buffer.index("\n")) - y << buffer.slice!(..idx) + while (match = re.match(buffer, cr_seen&.to_i || offset)) + case [match.captures.first, cr_seen] + in ["\r", nil] + cr_seen = match.end(1) + next + in ["\r" | "\r\n", Integer] + y << buffer.slice!(..(cr_seen.pred)) + else + y << buffer.slice!(..(match.end(1).pred)) + end + offset = 0 + cr_seen = nil end end + + y << buffer.slice!(..(cr_seen.pred)) unless cr_seen.nil? y << buffer unless buffer.empty? end end - # @private + # @api 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) + def decode_sse(lines) + # rubocop:disable Metrics/BlockLength chain_fused(lines) do |y| blank = {event: nil, data: nil, id: nil, retry: nil} current = {} lines.each do |line| - case line.strip + case line.sub(/\R$/, "") in "" next if current.empty? y << {**blank, **current} @@ -610,12 +701,12 @@ def parse_sse(lines) in /^:/ next in /^([^:]+):\s?(.*)$/ - _, field, value = Regexp.last_match.to_a + field, value = Regexp.last_match.captures case field in "event" current.merge!(event: value) in "data" - (current[:data] ||= String.new) << value << "\n" + (current[:data] ||= String.new.b) << (value << "\n") in "id" unless value.include?("\0") current.merge!(id: value) in "retry" if /^\d+$/ =~ value @@ -625,6 +716,7 @@ def parse_sse(lines) else end end + # rubocop:enable Metrics/BlockLength y << {**blank, **current} unless current.empty? end diff --git a/lib/finch-api/version.rb b/lib/finch-api/version.rb index e85ced32..45af2d06 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.1.0-alpha.1" + VERSION = "0.1.0-alpha.2" end diff --git a/manifest.yaml b/manifest.yaml index e2306edd..fa9c3e5e 100644 --- a/manifest.yaml +++ b/manifest.yaml @@ -5,6 +5,7 @@ dependencies: - etc - json - net/http + - pathname - rbconfig - securerandom - set diff --git a/rbi/lib/finch-api/base_client.rbi b/rbi/lib/finch-api/base_client.rbi index f72fad18..5ee8e3ce 100644 --- a/rbi/lib/finch-api/base_client.rbi +++ b/rbi/lib/finch-api/base_client.rbi @@ -1,77 +1,93 @@ # typed: strong module FinchAPI + # @api private 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 - + 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, FinchAPI::Util::AnyHash)) + } + 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 + + # from whatwg fetch spec 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 - + class << self + # @api private + sig { params(req: FinchAPI::BaseClient::RequestComponentsShape).void } + def validate!(req) + end + + # @api private + sig do + params(status: Integer, headers: T.any(T::Hash[String, String], Net::HTTPHeader)).returns(T::Boolean) + end + def should_retry?(status, headers:) + end + + # @api private + 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 follow_redirect(request, status:, response_headers:) + end + + # @api private + sig do + params( + status: T.any(Integer, FinchAPI::APIConnectionError), + stream: T.nilable(T::Enumerable[String]) + ).void + end + def reap_connection!(status, stream:) + end + end + + # @api private sig { returns(T.anything) } - def requester - end - - sig { params(_: T.anything).returns(T.anything) } - def requester=(_) - end + attr_accessor :requester + # @api private sig do params( base_url: String, @@ -83,9 +99,9 @@ module FinchAPI T.nilable(T.any(String, Integer, T::Array[T.nilable(T.any(String, Integer))]))], idempotency_header: T.nilable(String) ) - .void + .returns(T.attached_class) end - def initialize( + def self.new( base_url:, timeout: 0.0, max_retries: 0, @@ -96,26 +112,31 @@ module FinchAPI ) end + # @api private sig { overridable.returns(T::Hash[String, String]) } private def auth_headers end + # @api private sig { returns(String) } private def generate_idempotency_key end + # @api private sig do overridable - .params(req: FinchAPI::BaseClient::RequestComponentsShape, opts: T::Hash[Symbol, T.anything]) + .params(req: FinchAPI::BaseClient::RequestComponentsShape, opts: FinchAPI::Util::AnyHash) .returns(FinchAPI::BaseClient::RequestInputShape) end private def build_request(req, opts) end + # @api private sig { params(headers: T::Hash[String, String], retry_count: Integer).returns(Float) } private def retry_delay(headers, retry_count:) end + # @api private sig do params( request: FinchAPI::BaseClient::RequestInputShape, @@ -128,6 +149,8 @@ module FinchAPI private def send_request(request, redirect_count:, retry_count:, send_retry_header:) end + # Execute the request specified by `req`. This is the method that all resource + # methods call into. sig do params( method: Symbol, @@ -148,7 +171,7 @@ module FinchAPI 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])) + options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) ) .returns(T.anything) end diff --git a/rbi/lib/finch-api/base_model.rbi b/rbi/lib/finch-api/base_model.rbi index 35b4ce59..d5219284 100644 --- a/rbi/lib/finch-api/base_model.rbi +++ b/rbi/lib/finch-api/base_model.rbi @@ -1,19 +1,21 @@ # typed: strong module FinchAPI + # @api private module Converter - abstract! - Input = T.type_alias { T.any(FinchAPI::Converter, T::Class[T.anything]) } + # @api private sig { overridable.params(value: T.anything).returns(T.anything) } def coerce(value) end + # @api private sig { overridable.params(value: T.anything).returns(T.anything) } def dump(value) end + # @api private sig do overridable .params(value: T.anything) @@ -22,213 +24,298 @@ module FinchAPI 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 + class << self + # @api private + 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) + .returns(T.proc.returns(T.anything).void) + end + def self.type_info(spec) + end + + # @api 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 + sig { params(target: FinchAPI::Converter::Input, value: T.anything).returns(T.anything) } + def self.coerce(target, value) + end + + # @api private + sig { params(target: FinchAPI::Converter::Input, value: T.anything).returns(T.anything) } + def self.dump(target, value) + end + + # @api 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 + sig { params(target: FinchAPI::Converter::Input, value: T.anything).returns(T.anything) } + def self.try_strict_coerce(target, value) + end end end + # @api private + # + # When we don't know what to expect for the value. class Unknown - abstract! - extend FinchAPI::Converter - sig { params(other: T.anything).returns(T::Boolean) } + abstract! + final! + + sig(:final) { params(other: T.anything).returns(T::Boolean) } def self.===(other) end - sig { params(other: T.anything).returns(T::Boolean) } + sig(:final) { 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 + class << self + # @api private + sig(:final) { override.params(value: T.anything).returns(T.anything) } + def coerce(value) + end - sig { override.params(value: T.anything).returns(T.anything) } - def self.dump(value) - end + # @api private + sig(:final) { override.params(value: T.anything).returns(T.anything) } + 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 self.try_strict_coerce(value) + # @api private + sig(:final) 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 end end + # @api private + # + # Ruby has no Boolean class; this is something for models to refer to. class BooleanModel - abstract! - extend FinchAPI::Converter - sig { params(other: T.anything).returns(T::Boolean) } + abstract! + final! + + sig(:final) { params(other: T.anything).returns(T::Boolean) } def self.===(other) end - sig { params(other: T.anything).returns(T::Boolean) } + sig(:final) { 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) + class << self + # @api private + sig(:final) do + override.params(value: T.any(T::Boolean, T.anything)).returns(T.any(T::Boolean, T.anything)) + end + def coerce(value) + end + + # @api private + sig(:final) do + override.params(value: T.any(T::Boolean, T.anything)).returns(T.any(T::Boolean, T.anything)) + end + def dump(value) + end + + # @api private + sig(:final) 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 end end - class Enum - abstract! - - extend FinchAPI::Converter + # @api private + # + # 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. + module Enum + include FinchAPI::Converter + # All of the valid Symbol values for this enum. sig { overridable.returns(T::Array[T.any(NilClass, T::Boolean, Integer, Float, Symbol)]) } - def self.values + def values end + # @api private + # + # Guard against thread safety issues by instantiating `@values`. sig { void } - private_class_method def self.finalize! + private def finalize! end sig { params(other: T.anything).returns(T::Boolean) } - def self.===(other) + def ===(other) end sig { params(other: T.anything).returns(T::Boolean) } - def self.==(other) + def ==(other) end + # @api private sig { override.params(value: T.any(String, Symbol, T.anything)).returns(T.any(Symbol, T.anything)) } - def self.coerce(value) + def coerce(value) end + # @api private sig { override.params(value: T.any(Symbol, T.anything)).returns(T.any(Symbol, T.anything)) } - def self.dump(value) + def dump(value) end + # @api private 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) + def try_strict_coerce(value) end end - class Union - abstract! + # @api private + module Union + include FinchAPI::Converter - extend FinchAPI::Converter + # @api private + # + # All of the specified variant info for this union. + sig { returns(T::Array[[T.nilable(Symbol), T.proc.returns(FinchAPI::Converter::Input)]]) } + private def known_variants + end - sig { returns(T::Array[[T.nilable(Symbol), Proc]]) } - private_class_method def self.known_variants + # @api private + sig { returns(T::Array[[T.nilable(Symbol), T.anything]]) } + protected def derefed_variants end - sig { overridable.returns(T::Array[[T.nilable(Symbol), T.anything]]) } - private_class_method def self.variants + # All of the specified variants for this union. + sig { overridable.returns(T::Array[T.anything]) } + def variants end + # @api private sig { params(property: Symbol).void } - private_class_method def self.discriminator(property) + private def discriminator(property) end + # @api private 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 - ) + key: T.any(Symbol, FinchAPI::Util::AnyHash, T.proc.returns(T.anything), T.anything), + spec: T.any(FinchAPI::Util::AnyHash, T.proc.returns(T.anything), T.anything) ) .void end - private_class_method def self.variant(key, spec = nil) + private def variant(key, spec = nil) end - sig { params(value: T.anything).returns(T.nilable(FinchAPI::Converter::Input)) } - private_class_method def self.resolve_variant(value) + # @api private + sig { params(value: T.anything).returns(T.nilable(T.anything)) } + private def resolve_variant(value) end sig { params(other: T.anything).returns(T::Boolean) } - def self.===(other) + def ===(other) end sig { params(other: T.anything).returns(T::Boolean) } - def self.==(other) + def ==(other) end + # @api private sig { override.params(value: T.anything).returns(T.anything) } - def self.coerce(value) + def coerce(value) end + # @api private sig { override.params(value: T.anything).returns(T.anything) } - def self.dump(value) + def dump(value) end + # @api private 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) + def try_strict_coerce(value) end end + # @api private + # + # Array of items of a given type. class ArrayOf + include FinchAPI::Converter + abstract! + final! - include FinchAPI::Converter + sig(:final) do + params( + type_info: T.any( + FinchAPI::Util::AnyHash, + T.proc.returns(FinchAPI::Converter::Input), + FinchAPI::Converter::Input + ), + spec: FinchAPI::Util::AnyHash + ) + .returns(T.attached_class) + end + def self.[](type_info, spec = {}) + end - sig { params(other: T.anything).returns(T::Boolean) } + sig(:final) { params(other: T.anything).returns(T::Boolean) } def ===(other) end - sig { params(other: T.anything).returns(T::Boolean) } + sig(:final) { params(other: T.anything).returns(T::Boolean) } def ==(other) end - sig do + # @api private + sig(:final) do override .params(value: T.any(T::Enumerable[T.anything], T.anything)) .returns(T.any(T::Array[T.anything], T.anything)) @@ -236,7 +323,8 @@ module FinchAPI def coerce(value) end - sig do + # @api private + sig(:final) do override .params(value: T.any(T::Enumerable[T.anything], T.anything)) .returns(T.any(T::Array[T.anything], T.anything)) @@ -244,7 +332,8 @@ module FinchAPI def dump(value) end - sig do + # @api private + sig(:final) do override .params(value: T.anything) .returns(T.any([T::Boolean, T.anything, NilClass], [T::Boolean, T::Boolean, Integer])) @@ -252,18 +341,20 @@ module FinchAPI def try_strict_coerce(value) end - sig { returns(FinchAPI::Converter::Input) } + # @api private + sig(:final) { returns(T.anything) } protected def item_type end - sig do + # @api private + sig(:final) do params( type_info: T.any( - T::Hash[Symbol, T.anything], + FinchAPI::Util::AnyHash, T.proc.returns(FinchAPI::Converter::Input), FinchAPI::Converter::Input ), - spec: T::Hash[Symbol, T.anything] + spec: FinchAPI::Util::AnyHash ) .void end @@ -271,36 +362,57 @@ module FinchAPI end end + # @api private + # + # Hash of items of a given type. class HashOf + include FinchAPI::Converter + abstract! + final! - include FinchAPI::Converter + sig(:final) do + params( + type_info: T.any( + FinchAPI::Util::AnyHash, + T.proc.returns(FinchAPI::Converter::Input), + FinchAPI::Converter::Input + ), + spec: FinchAPI::Util::AnyHash + ) + .returns(T.attached_class) + end + def self.[](type_info, spec = {}) + end - sig { params(other: T.anything).returns(T::Boolean) } + sig(:final) { params(other: T.anything).returns(T::Boolean) } def ===(other) end - sig { params(other: T.anything).returns(T::Boolean) } + sig(:final) { params(other: T.anything).returns(T::Boolean) } def ==(other) end - sig do + # @api private + sig(:final) do override .params(value: T.any(T::Hash[T.anything, T.anything], T.anything)) - .returns(T.any(T::Hash[Symbol, T.anything], T.anything)) + .returns(T.any(FinchAPI::Util::AnyHash, T.anything)) end def coerce(value) end - sig do + # @api private + sig(:final) do override .params(value: T.any(T::Hash[T.anything, T.anything], T.anything)) - .returns(T.any(T::Hash[Symbol, T.anything], T.anything)) + .returns(T.any(FinchAPI::Util::AnyHash, T.anything)) end def dump(value) end - sig do + # @api private + sig(:final) do override .params(value: T.anything) .returns(T.any([T::Boolean, T.anything, NilClass], [T::Boolean, T::Boolean, Integer])) @@ -308,18 +420,20 @@ module FinchAPI def try_strict_coerce(value) end - sig { returns(FinchAPI::Converter::Input) } + # @api private + sig(:final) { returns(T.anything) } protected def item_type end - sig do + # @api private + sig(:final) do params( type_info: T.any( - T::Hash[Symbol, T.anything], + FinchAPI::Util::AnyHash, T.proc.returns(FinchAPI::Converter::Input), FinchAPI::Converter::Input ), - spec: T::Hash[Symbol, T.anything] + spec: FinchAPI::Util::AnyHash ) .void end @@ -328,141 +442,194 @@ module FinchAPI 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 + abstract! - sig { params(blk: T.proc.void).void } - private_class_method def self.request_only(&blk) - end + KnownFieldShape = T.type_alias { {mode: T.nilable(Symbol), required: T::Boolean} } - sig { params(blk: T.proc.void).void } - private_class_method def self.response_only(&blk) + class << self + # @api private + # + # Assumes superclass fields are totally defined before fields are accessed / + # defined on subclasses. + sig do + returns( + T::Hash[Symbol, + T.all( + FinchAPI::BaseModel::KnownFieldShape, + {type_fn: T.proc.returns(FinchAPI::Converter::Input)} + )] + ) + end + def known_fields + end + + # @api private + sig { returns(T::Hash[Symbol, Symbol]) } + def reverse_map + end + + # @api private + sig do + returns( + T::Hash[Symbol, + T.all(FinchAPI::BaseModel::KnownFieldShape, {type: FinchAPI::Converter::Input})] + ) + end + def fields + end + + # @api private + sig { returns(T::Hash[Symbol, T.proc.returns(T::Class[T.anything])]) } + def defaults + end + + # @api private + 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: FinchAPI::Util::AnyHash + ) + .void + end + private def add_field(name_sym, required:, type_info:, spec:) + end + + # @api private + sig do + params( + name_sym: Symbol, + type_info: T.any( + FinchAPI::Util::AnyHash, + T.proc.returns(FinchAPI::Converter::Input), + FinchAPI::Converter::Input + ), + spec: FinchAPI::Util::AnyHash + ) + .void + end + def required(name_sym, type_info, spec = {}) + end + + # @api private + sig do + params( + name_sym: Symbol, + type_info: T.any( + FinchAPI::Util::AnyHash, + T.proc.returns(FinchAPI::Converter::Input), + FinchAPI::Converter::Input + ), + spec: FinchAPI::Util::AnyHash + ) + .void + end + def optional(name_sym, type_info, spec = {}) + end + + # @api private + # + # `request_only` attributes not excluded from `.#coerce` when receiving responses + # even if well behaved servers should not send them + sig { params(blk: T.proc.void).void } + private def request_only(&blk) + end + + # @api private + # + # `response_only` attributes are omitted from `.#dump` when making requests + sig { params(blk: T.proc.void).void } + private def response_only(&blk) + end 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 - + class << self + # @api private + 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 coerce(value) + end + + # @api private + 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 dump(value) + end + + # @api private + 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 + 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. sig { params(key: Symbol).returns(T.nilable(T.anything)) } def [](key) end - sig { overridable.returns(T::Hash[Symbol, T.anything]) } + # 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. + sig { overridable.returns(FinchAPI::Util::AnyHash) } def to_h end - alias_method :to_hash, :to_h + # 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. + sig { overridable.returns(FinchAPI::Util::AnyHash) } + def to_hash + end - sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.anything]) } + sig { params(keys: T.nilable(T::Array[Symbol])).returns(FinchAPI::Util::AnyHash) } def deconstruct_keys(keys) end - sig { params(data: T.any(T::Hash[Symbol, T.anything], T.self_type)).void } - def initialize(data = {}) + # Create a new instance of a model. + sig { params(data: T.any(T::Hash[Symbol, T.anything], T.self_type)).returns(T.attached_class) } + def self.new(data = {}) end sig { returns(String) } diff --git a/rbi/lib/finch-api/base_page.rbi b/rbi/lib/finch-api/base_page.rbi index ef4c814e..0b481300 100644 --- a/rbi/lib/finch-api/base_page.rbi +++ b/rbi/lib/finch-api/base_page.rbi @@ -2,8 +2,6 @@ module FinchAPI module BasePage - abstract! - Elem = type_member(:out) sig { overridable.returns(T::Boolean) } @@ -22,18 +20,17 @@ module FinchAPI def to_enum end - alias_method :enum_for, :to_enum - + # @api private sig do params( client: FinchAPI::BaseClient, req: FinchAPI::BaseClient::RequestComponentsShape, headers: T.any(T::Hash[String, String], Net::HTTPHeader), - unwrapped: T.anything + page_data: T.anything ) .void end - def initialize(client:, req:, headers:, unwrapped:) + def initialize(client:, req:, headers:, page_data:) end end end diff --git a/rbi/lib/finch-api/client.rbi b/rbi/lib/finch-api/client.rbi index c8e4dd05..6af43f2c 100644 --- a/rbi/lib/finch-api/client.rbi +++ b/rbi/lib/finch-api/client.rbi @@ -11,69 +11,60 @@ module FinchAPI DEFAULT_MAX_RETRY_DELAY = T.let(8.0, Float) sig { returns(T.nilable(String)) } - def access_token - end + attr_reader :access_token sig { returns(T.nilable(String)) } - def client_id - end + attr_reader :client_id sig { returns(T.nilable(String)) } - def client_secret - end + attr_reader :client_secret sig { returns(FinchAPI::Resources::AccessTokens) } - def access_tokens - end + attr_reader :access_tokens sig { returns(FinchAPI::Resources::HRIS) } - def hris - end + attr_reader :hris sig { returns(FinchAPI::Resources::Providers) } - def providers - end + attr_reader :providers sig { returns(FinchAPI::Resources::Account) } - def account - end + attr_reader :account sig { returns(FinchAPI::Resources::Webhooks) } - def webhooks - end + attr_reader :webhooks sig { returns(FinchAPI::Resources::RequestForwarding) } - def request_forwarding - end + attr_reader :request_forwarding sig { returns(FinchAPI::Resources::Jobs) } - def jobs - end + attr_reader :jobs sig { returns(FinchAPI::Resources::Sandbox) } - def sandbox - end + attr_reader :sandbox sig { returns(FinchAPI::Resources::Payroll) } - def payroll - end + attr_reader :payroll sig { returns(FinchAPI::Resources::Connect) } - def connect - end + attr_reader :connect + # @api private sig { override.returns(T::Hash[String, String]) } private def auth_headers end + # @api private sig { returns(T::Hash[String, String]) } private def bearer_auth end + # @api private sig { returns(T::Hash[String, String]) } private def basic_auth end + # Creates and returns a new client for interacting with the API. sig do params( base_url: T.nilable(String), @@ -85,13 +76,17 @@ module FinchAPI initial_retry_delay: Float, max_retry_delay: Float ) - .void + .returns(T.attached_class) end - def initialize( + def self.new( + # Override the default base URL for the API, e.g., `"https://api.example.com/v2/"` base_url: nil, access_token: nil, + # Defaults to `ENV["FINCH_CLIENT_ID"]` client_id: ENV["FINCH_CLIENT_ID"], + # Defaults to `ENV["FINCH_CLIENT_SECRET"]` client_secret: ENV["FINCH_CLIENT_SECRET"], + # Max number of retries to attempt after a failed retryable request. max_retries: DEFAULT_MAX_RETRIES, timeout: DEFAULT_TIMEOUT_IN_SECONDS, initial_retry_delay: DEFAULT_INITIAL_RETRY_DELAY, diff --git a/rbi/lib/finch-api/errors.rbi b/rbi/lib/finch-api/errors.rbi index da720877..7ffea6da 100644 --- a/rbi/lib/finch-api/errors.rbi +++ b/rbi/lib/finch-api/errors.rbi @@ -3,8 +3,7 @@ module FinchAPI class Error < StandardError sig { returns(T.nilable(StandardError)) } - def cause - end + attr_accessor :cause end class ConversionError < FinchAPI::Error @@ -12,17 +11,15 @@ module FinchAPI class APIError < FinchAPI::Error sig { returns(URI::Generic) } - def url - end + attr_accessor :url sig { returns(T.nilable(Integer)) } - def status - end + attr_accessor :status sig { returns(T.nilable(T.anything)) } - def body - end + attr_accessor :body + # @api private sig do params( url: URI::Generic, @@ -32,21 +29,20 @@ module FinchAPI response: NilClass, message: T.nilable(String) ) - .void + .returns(T.attached_class) end - def initialize(url:, status: nil, body: nil, request: nil, response: nil, message: nil) + def self.new(url:, status: nil, body: nil, request: nil, response: nil, message: nil) end end class APIConnectionError < FinchAPI::APIError sig { void } - def status - end + attr_accessor :status sig { void } - def body - end + attr_accessor :body + # @api private sig do params( url: URI::Generic, @@ -56,13 +52,14 @@ module FinchAPI response: NilClass, message: T.nilable(String) ) - .void + .returns(T.attached_class) end - def initialize(url:, status: nil, body: nil, request: nil, response: nil, message: "Connection error.") + def self.new(url:, status: nil, body: nil, request: nil, response: nil, message: "Connection error.") end end class APITimeoutError < FinchAPI::APIConnectionError + # @api private sig do params( url: URI::Generic, @@ -72,13 +69,14 @@ module FinchAPI response: NilClass, message: T.nilable(String) ) - .void + .returns(T.attached_class) end - def initialize(url:, status: nil, body: nil, request: nil, response: nil, message: "Request timed out.") + def self.new(url:, status: nil, body: nil, request: nil, response: nil, message: "Request timed out.") end end class APIStatusError < FinchAPI::APIError + # @api private sig do params( url: URI::Generic, @@ -94,9 +92,9 @@ module FinchAPI end sig { returns(Integer) } - def status - end + attr_accessor :status + # @api private sig do params( url: URI::Generic, @@ -106,9 +104,9 @@ module FinchAPI response: NilClass, message: T.nilable(String) ) - .void + .returns(T.attached_class) end - def initialize(url:, status:, body:, request:, response:, message: nil) + def self.new(url:, status:, body:, request:, response:, message: nil) end end diff --git a/rbi/lib/finch-api/extern.rbi b/rbi/lib/finch-api/extern.rbi index 2affab87..f57af343 100644 --- a/rbi/lib/finch-api/extern.rbi +++ b/rbi/lib/finch-api/extern.rbi @@ -1,7 +1,7 @@ # typed: strong module FinchAPI + # @api private module Extern - abstract! end end diff --git a/rbi/lib/finch-api/individuals_page.rbi b/rbi/lib/finch-api/individuals_page.rbi index 3209623f..dc735152 100644 --- a/rbi/lib/finch-api/individuals_page.rbi +++ b/rbi/lib/finch-api/individuals_page.rbi @@ -6,32 +6,14 @@ module FinchAPI 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(T.nilable(T::Array[Elem])) } + attr_accessor :individuals sig { returns(FinchAPI::Models::Paging) } - def paging - end + attr_accessor :paging - 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:) + sig { returns(String) } + def inspect 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 index 690fa5a9..2b02d4b9 100644 --- a/rbi/lib/finch-api/models/access_token_create_params.rbi +++ b/rbi/lib/finch-api/models/access_token_create_params.rbi @@ -7,36 +7,25 @@ module FinchAPI include FinchAPI::RequestParameters sig { returns(String) } - def code - end - - sig { params(_: String).returns(String) } - def code=(_) - end + attr_accessor :code sig { returns(T.nilable(String)) } - def client_id - end + attr_reader :client_id - sig { params(_: String).returns(String) } - def client_id=(_) - end + sig { params(client_id: String).void } + attr_writer :client_id sig { returns(T.nilable(String)) } - def client_secret - end + attr_reader :client_secret - sig { params(_: String).returns(String) } - def client_secret=(_) - end + sig { params(client_secret: String).void } + attr_writer :client_secret sig { returns(T.nilable(String)) } - def redirect_uri - end + attr_reader :redirect_uri - sig { params(_: String).returns(String) } - def redirect_uri=(_) - end + sig { params(redirect_uri: String).void } + attr_writer :redirect_uri sig do params( @@ -44,11 +33,11 @@ module FinchAPI client_id: String, client_secret: String, redirect_uri: String, - request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) ) - .void + .returns(T.attached_class) end - def initialize(code:, client_id: nil, client_secret: nil, redirect_uri: nil, request_options: {}) + def self.new(code:, client_id: nil, client_secret: nil, redirect_uri: nil, request_options: {}) end sig do diff --git a/rbi/lib/finch-api/models/account_disconnect_params.rbi b/rbi/lib/finch-api/models/account_disconnect_params.rbi index 1eb51817..9a204527 100644 --- a/rbi/lib/finch-api/models/account_disconnect_params.rbi +++ b/rbi/lib/finch-api/models/account_disconnect_params.rbi @@ -6,8 +6,15 @@ module FinchAPI 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: {}) + sig do + params( + request_options: T.any( + FinchAPI::RequestOptions, + FinchAPI::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) end sig { override.returns({request_options: FinchAPI::RequestOptions}) } diff --git a/rbi/lib/finch-api/models/account_introspect_params.rbi b/rbi/lib/finch-api/models/account_introspect_params.rbi index b3aa30db..183bc5bb 100644 --- a/rbi/lib/finch-api/models/account_introspect_params.rbi +++ b/rbi/lib/finch-api/models/account_introspect_params.rbi @@ -6,8 +6,15 @@ module FinchAPI 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: {}) + sig do + params( + request_options: T.any( + FinchAPI::RequestOptions, + FinchAPI::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) end sig { override.returns({request_options: FinchAPI::RequestOptions}) } diff --git a/rbi/lib/finch-api/models/account_update_event.rbi b/rbi/lib/finch-api/models/account_update_event.rbi index 812c9003..ef218692 100644 --- a/rbi/lib/finch-api/models/account_update_event.rbi +++ b/rbi/lib/finch-api/models/account_update_event.rbi @@ -4,108 +4,128 @@ module FinchAPI module Models class AccountUpdateEvent < FinchAPI::Models::BaseWebhookEvent sig { returns(T.nilable(FinchAPI::Models::AccountUpdateEvent::Data)) } - def data - end + attr_reader :data - sig { params(_: FinchAPI::Models::AccountUpdateEvent::Data).returns(FinchAPI::Models::AccountUpdateEvent::Data) } - def data=(_) - end + sig { params(data: T.any(FinchAPI::Models::AccountUpdateEvent::Data, FinchAPI::Util::AnyHash)).void } + attr_writer :data - sig { returns(T.nilable(Symbol)) } - def event_type - end + sig { returns(T.nilable(FinchAPI::Models::AccountUpdateEvent::EventType::TaggedSymbol)) } + attr_reader :event_type - sig { params(_: Symbol).returns(Symbol) } - def event_type=(_) - end + sig { params(event_type: FinchAPI::Models::AccountUpdateEvent::EventType::OrSymbol).void } + attr_writer :event_type - sig { params(data: FinchAPI::Models::AccountUpdateEvent::Data, event_type: Symbol).void } - def initialize(data: nil, event_type: nil) + sig do + params( + data: T.any(FinchAPI::Models::AccountUpdateEvent::Data, FinchAPI::Util::AnyHash), + event_type: FinchAPI::Models::AccountUpdateEvent::EventType::OrSymbol + ) + .returns(T.attached_class) + end + def self.new(data: nil, event_type: nil) end - sig { override.returns({data: FinchAPI::Models::AccountUpdateEvent::Data, event_type: Symbol}) } + sig do + override + .returns( + { + data: FinchAPI::Models::AccountUpdateEvent::Data, + event_type: FinchAPI::Models::AccountUpdateEvent::EventType::TaggedSymbol + } + ) + end def to_hash end class Data < FinchAPI::BaseModel sig { returns(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod) } - def authentication_method - end + attr_reader :authentication_method sig do - params(_: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod) - .returns(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod) - end - def authentication_method=(_) - end - - sig { returns(Symbol) } - def status + params( + authentication_method: T.any(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod, FinchAPI::Util::AnyHash) + ) + .void end + attr_writer :authentication_method - sig { params(_: Symbol).returns(Symbol) } - def status=(_) - end + sig { returns(FinchAPI::Models::ConnectionStatusType::TaggedSymbol) } + attr_accessor :status sig do params( - authentication_method: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod, - status: Symbol + authentication_method: T.any(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod, FinchAPI::Util::AnyHash), + status: FinchAPI::Models::ConnectionStatusType::OrSymbol ) - .void + .returns(T.attached_class) end - def initialize(authentication_method:, status:) + def self.new(authentication_method:, status:) end sig do override .returns( - {authentication_method: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod, status: Symbol} + { + authentication_method: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod, + status: FinchAPI::Models::ConnectionStatusType::TaggedSymbol + } ) end def to_hash end class AuthenticationMethod < FinchAPI::BaseModel + # Each benefit type and their supported features. If the benefit type is not + # supported, the property will be null sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitsSupport)) } - def benefits_support - end + attr_reader :benefits_support sig do - params(_: T.nilable(FinchAPI::Models::HRIS::BenefitsSupport)) - .returns(T.nilable(FinchAPI::Models::HRIS::BenefitsSupport)) - end - def benefits_support=(_) + params( + benefits_support: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitsSupport, FinchAPI::Util::AnyHash)) + ) + .void end + attr_writer :benefits_support + # The supported data fields returned by our HR and payroll endpoints sig { returns(T.nilable(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields)) } - def supported_fields - end + attr_reader :supported_fields sig do - params(_: T.nilable(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields)) - .returns(T.nilable(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields)) - end - def supported_fields=(_) + params( + supported_fields: T.nilable( + T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields, + FinchAPI::Util::AnyHash + ) + ) + ) + .void end + attr_writer :supported_fields - sig { returns(T.nilable(Symbol)) } - def type - end + # The type of authentication method. + sig { returns(T.nilable(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::Type::TaggedSymbol)) } + attr_reader :type - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + sig { params(type: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::Type::OrSymbol).void } + attr_writer :type sig do params( - benefits_support: T.nilable(FinchAPI::Models::HRIS::BenefitsSupport), - supported_fields: T.nilable(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields), - type: Symbol + benefits_support: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitsSupport, FinchAPI::Util::AnyHash)), + supported_fields: T.nilable( + T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields, + FinchAPI::Util::AnyHash + ) + ), + type: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::Type::OrSymbol ) - .void + .returns(T.attached_class) end - def initialize(benefits_support: nil, supported_fields: nil, type: nil) + def self.new(benefits_support: nil, supported_fields: nil, type: nil) end sig do @@ -114,7 +134,7 @@ module FinchAPI { benefits_support: T.nilable(FinchAPI::Models::HRIS::BenefitsSupport), supported_fields: T.nilable(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields), - type: Symbol + type: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::Type::TaggedSymbol } ) end @@ -127,119 +147,162 @@ module FinchAPI T.nilable(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company) ) end - def company - end + attr_reader :company sig do - params(_: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company) - .returns(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company) - end - def company=(_) + params( + company: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company, + FinchAPI::Util::AnyHash + ) + ) + .void end + attr_writer :company sig do returns( T.nilable(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory) ) end - def directory - end + attr_reader :directory sig do - params(_: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory) - .returns(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory) - end - def directory=(_) + params( + directory: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory, + FinchAPI::Util::AnyHash + ) + ) + .void end + attr_writer :directory sig do returns( T.nilable(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment) ) end - def employment - end + attr_reader :employment sig do - params(_: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment) - .returns(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment) - end - def employment=(_) + params( + employment: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment, + FinchAPI::Util::AnyHash + ) + ) + .void end + attr_writer :employment sig do returns( T.nilable(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual) ) end - def individual - end + attr_reader :individual sig do - params(_: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual) - .returns(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual) - end - def individual=(_) + params( + individual: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual, + FinchAPI::Util::AnyHash + ) + ) + .void end + attr_writer :individual sig do returns( T.nilable(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayGroup) ) end - def pay_group - end + attr_reader :pay_group sig do - params(_: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayGroup) - .returns(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayGroup) - end - def pay_group=(_) + params( + pay_group: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayGroup, + FinchAPI::Util::AnyHash + ) + ) + .void end + attr_writer :pay_group sig do returns( T.nilable(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement) ) end - def pay_statement - end + attr_reader :pay_statement sig do - params(_: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement) - .returns(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement) - end - def pay_statement=(_) + params( + pay_statement: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement, + FinchAPI::Util::AnyHash + ) + ) + .void end + attr_writer :pay_statement sig do returns( T.nilable(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment) ) end - def payment - end + attr_reader :payment sig do - params(_: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment) - .returns(FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment) - end - def payment=(_) + params( + payment: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment, + FinchAPI::Util::AnyHash + ) + ) + .void end + attr_writer :payment + # The supported data fields returned by our HR and payroll endpoints 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 + company: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company, + FinchAPI::Util::AnyHash + ), + directory: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory, + FinchAPI::Util::AnyHash + ), + employment: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment, + FinchAPI::Util::AnyHash + ), + individual: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual, + FinchAPI::Util::AnyHash + ), + pay_group: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayGroup, + FinchAPI::Util::AnyHash + ), + pay_statement: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement, + FinchAPI::Util::AnyHash + ), + payment: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment, + FinchAPI::Util::AnyHash + ) ) - .void + .returns(T.attached_class) end - def initialize( + def self.new( company: nil, directory: nil, employment: nil, @@ -269,12 +332,10 @@ module FinchAPI class Company < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def id - end + attr_reader :id - sig { params(_: T::Boolean).returns(T::Boolean) } - def id=(_) - end + sig { params(id: T::Boolean).void } + attr_writer :id sig do returns( @@ -283,19 +344,18 @@ module FinchAPI ) ) end - def accounts - end + attr_reader :accounts sig do params( - _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Accounts - ) - .returns( - FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Accounts + accounts: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Accounts, + FinchAPI::Util::AnyHash ) + ) + .void end - def accounts=(_) - end + attr_writer :accounts sig do returns( @@ -304,27 +364,24 @@ module FinchAPI ) ) end - def departments - end + attr_reader :departments sig do params( - _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments - ) - .returns( - FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments + departments: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments, + FinchAPI::Util::AnyHash ) + ) + .void end - def departments=(_) - end + attr_writer :departments sig { returns(T.nilable(T::Boolean)) } - def ein - end + attr_reader :ein - sig { params(_: T::Boolean).returns(T::Boolean) } - def ein=(_) - end + sig { params(ein: T::Boolean).void } + attr_writer :ein sig do returns( @@ -333,27 +390,24 @@ module FinchAPI ) ) end - def entity - end + attr_reader :entity sig do params( - _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Entity - ) - .returns( - FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Entity + entity: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Entity, + FinchAPI::Util::AnyHash ) + ) + .void end - def entity=(_) - end + attr_writer :entity sig { returns(T.nilable(T::Boolean)) } - def legal_name - end + attr_reader :legal_name - sig { params(_: T::Boolean).returns(T::Boolean) } - def legal_name=(_) - end + sig { params(legal_name: T::Boolean).void } + attr_writer :legal_name sig do returns( @@ -362,51 +416,58 @@ module FinchAPI ) ) end - def locations - end + attr_reader :locations sig do params( - _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Locations - ) - .returns( - FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Locations + locations: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Locations, + FinchAPI::Util::AnyHash ) + ) + .void end - def locations=(_) - end + attr_writer :locations sig { returns(T.nilable(T::Boolean)) } - def primary_email - end + attr_reader :primary_email - sig { params(_: T::Boolean).returns(T::Boolean) } - def primary_email=(_) - end + sig { params(primary_email: T::Boolean).void } + attr_writer :primary_email sig { returns(T.nilable(T::Boolean)) } - def primary_phone_number - end + attr_reader :primary_phone_number - sig { params(_: T::Boolean).returns(T::Boolean) } - def primary_phone_number=(_) - end + sig { params(primary_phone_number: T::Boolean).void } + attr_writer :primary_phone_number sig do params( id: T::Boolean, - accounts: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Accounts, - departments: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments, + accounts: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Accounts, + FinchAPI::Util::AnyHash + ), + departments: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments, + FinchAPI::Util::AnyHash + ), ein: T::Boolean, - entity: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Entity, + entity: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Entity, + FinchAPI::Util::AnyHash + ), legal_name: T::Boolean, - locations: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Locations, + locations: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Locations, + FinchAPI::Util::AnyHash + ), primary_email: T::Boolean, primary_phone_number: T::Boolean ) - .void + .returns(T.attached_class) end - def initialize( + def self.new( id: nil, accounts: nil, departments: nil, @@ -440,44 +501,34 @@ module FinchAPI class Accounts < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def account_name - end + attr_reader :account_name - sig { params(_: T::Boolean).returns(T::Boolean) } - def account_name=(_) - end + sig { params(account_name: T::Boolean).void } + attr_writer :account_name sig { returns(T.nilable(T::Boolean)) } - def account_number - end + attr_reader :account_number - sig { params(_: T::Boolean).returns(T::Boolean) } - def account_number=(_) - end + sig { params(account_number: T::Boolean).void } + attr_writer :account_number sig { returns(T.nilable(T::Boolean)) } - def account_type - end + attr_reader :account_type - sig { params(_: T::Boolean).returns(T::Boolean) } - def account_type=(_) - end + sig { params(account_type: T::Boolean).void } + attr_writer :account_type sig { returns(T.nilable(T::Boolean)) } - def institution_name - end + attr_reader :institution_name - sig { params(_: T::Boolean).returns(T::Boolean) } - def institution_name=(_) - end + sig { params(institution_name: T::Boolean).void } + attr_writer :institution_name sig { returns(T.nilable(T::Boolean)) } - def routing_number - end + attr_reader :routing_number - sig { params(_: T::Boolean).returns(T::Boolean) } - def routing_number=(_) - end + sig { params(routing_number: T::Boolean).void } + attr_writer :routing_number sig do params( @@ -487,15 +538,9 @@ module FinchAPI institution_name: T::Boolean, routing_number: T::Boolean ) - .void + .returns(T.attached_class) end - def initialize( - account_name: nil, - account_number: nil, - account_type: nil, - institution_name: nil, - routing_number: nil - ) + def self.new(account_name: nil, account_number: nil, account_type: nil, institution_name: nil, routing_number: nil) end sig do @@ -516,12 +561,10 @@ module FinchAPI class Departments < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def name - end + attr_reader :name - sig { params(_: T::Boolean).returns(T::Boolean) } - def name=(_) - end + sig { params(name: T::Boolean).void } + attr_writer :name sig do returns( @@ -530,28 +573,30 @@ module FinchAPI ) ) end - def parent - end + attr_reader :parent sig do params( - _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments::Parent - ) - .returns( - FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments::Parent + parent: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments::Parent, + FinchAPI::Util::AnyHash ) + ) + .void end - def parent=(_) - end + attr_writer :parent sig do params( name: T::Boolean, - parent: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments::Parent + parent: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments::Parent, + FinchAPI::Util::AnyHash + ) ) - .void + .returns(T.attached_class) end - def initialize(name: nil, parent: nil) + def self.new(name: nil, parent: nil) end sig do @@ -568,15 +613,13 @@ module FinchAPI class Parent < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def name - end - - sig { params(_: T::Boolean).returns(T::Boolean) } - def name=(_) - end + attr_reader :name sig { params(name: T::Boolean).void } - def initialize(name: nil) + attr_writer :name + + sig { params(name: T::Boolean).returns(T.attached_class) } + def self.new(name: nil) end sig { override.returns({name: T::Boolean}) } @@ -587,23 +630,19 @@ module FinchAPI class Entity < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def subtype - end + attr_reader :subtype - sig { params(_: T::Boolean).returns(T::Boolean) } - def subtype=(_) - end + sig { params(subtype: T::Boolean).void } + attr_writer :subtype sig { returns(T.nilable(T::Boolean)) } - def type - end + attr_reader :type - sig { params(_: T::Boolean).returns(T::Boolean) } - def type=(_) - end + sig { params(type: T::Boolean).void } + attr_writer :type - sig { params(subtype: T::Boolean, type: T::Boolean).void } - def initialize(subtype: nil, type: nil) + sig { params(subtype: T::Boolean, type: T::Boolean).returns(T.attached_class) } + def self.new(subtype: nil, type: nil) end sig { override.returns({subtype: T::Boolean, type: T::Boolean}) } @@ -613,52 +652,40 @@ module FinchAPI class Locations < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def city - end + attr_reader :city - sig { params(_: T::Boolean).returns(T::Boolean) } - def city=(_) - end + sig { params(city: T::Boolean).void } + attr_writer :city sig { returns(T.nilable(T::Boolean)) } - def country - end + attr_reader :country - sig { params(_: T::Boolean).returns(T::Boolean) } - def country=(_) - end + sig { params(country: T::Boolean).void } + attr_writer :country sig { returns(T.nilable(T::Boolean)) } - def line1 - end + attr_reader :line1 - sig { params(_: T::Boolean).returns(T::Boolean) } - def line1=(_) - end + sig { params(line1: T::Boolean).void } + attr_writer :line1 sig { returns(T.nilable(T::Boolean)) } - def line2 - end + attr_reader :line2 - sig { params(_: T::Boolean).returns(T::Boolean) } - def line2=(_) - end + sig { params(line2: T::Boolean).void } + attr_writer :line2 sig { returns(T.nilable(T::Boolean)) } - def postal_code - end + attr_reader :postal_code - sig { params(_: T::Boolean).returns(T::Boolean) } - def postal_code=(_) - end + sig { params(postal_code: T::Boolean).void } + attr_writer :postal_code sig { returns(T.nilable(T::Boolean)) } - def state - end + attr_reader :state - sig { params(_: T::Boolean).returns(T::Boolean) } - def state=(_) - end + sig { params(state: T::Boolean).void } + attr_writer :state sig do params( @@ -669,9 +696,9 @@ module FinchAPI postal_code: T::Boolean, state: T::Boolean ) - .void + .returns(T.attached_class) end - def initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil) + def self.new(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil) end sig do @@ -700,19 +727,18 @@ module FinchAPI ) ) end - def individuals - end + attr_reader :individuals sig do params( - _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals - ) - .returns( - FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals + individuals: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals, + FinchAPI::Util::AnyHash ) + ) + .void end - def individuals=(_) - end + attr_writer :individuals sig do returns( @@ -721,28 +747,33 @@ module FinchAPI ) ) end - def paging - end + attr_reader :paging sig do params( - _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Paging - ) - .returns( - FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Paging + paging: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Paging, + FinchAPI::Util::AnyHash ) + ) + .void end - def paging=(_) - end + attr_writer :paging sig do params( - individuals: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals, - paging: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Paging + individuals: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals, + FinchAPI::Util::AnyHash + ), + paging: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Paging, + FinchAPI::Util::AnyHash + ) ) - .void + .returns(T.attached_class) end - def initialize(individuals: nil, paging: nil) + def self.new(individuals: nil, paging: nil) end sig do @@ -759,44 +790,34 @@ module FinchAPI class Individuals < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def id - end + attr_reader :id - sig { params(_: T::Boolean).returns(T::Boolean) } - def id=(_) - end + sig { params(id: T::Boolean).void } + attr_writer :id sig { returns(T.nilable(T::Boolean)) } - def department - end + attr_reader :department - sig { params(_: T::Boolean).returns(T::Boolean) } - def department=(_) - end + sig { params(department: T::Boolean).void } + attr_writer :department sig { returns(T.nilable(T::Boolean)) } - def first_name - end + attr_reader :first_name - sig { params(_: T::Boolean).returns(T::Boolean) } - def first_name=(_) - end + sig { params(first_name: T::Boolean).void } + attr_writer :first_name sig { returns(T.nilable(T::Boolean)) } - def is_active - end + attr_reader :is_active - sig { params(_: T::Boolean).returns(T::Boolean) } - def is_active=(_) - end + sig { params(is_active: T::Boolean).void } + attr_writer :is_active sig { returns(T.nilable(T::Boolean)) } - def last_name - end + attr_reader :last_name - sig { params(_: T::Boolean).returns(T::Boolean) } - def last_name=(_) - end + sig { params(last_name: T::Boolean).void } + attr_writer :last_name sig do returns( @@ -805,27 +826,24 @@ module FinchAPI ) ) end - def manager - end + attr_reader :manager sig do params( - _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager - ) - .returns( - FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager + manager: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager, + FinchAPI::Util::AnyHash ) + ) + .void end - def manager=(_) - end + attr_writer :manager sig { returns(T.nilable(T::Boolean)) } - def middle_name - end + attr_reader :middle_name - sig { params(_: T::Boolean).returns(T::Boolean) } - def middle_name=(_) - end + sig { params(middle_name: T::Boolean).void } + attr_writer :middle_name sig do params( @@ -834,20 +852,15 @@ module FinchAPI first_name: T::Boolean, is_active: T::Boolean, last_name: T::Boolean, - manager: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager, + manager: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager, + FinchAPI::Util::AnyHash + ), middle_name: T::Boolean ) - .void + .returns(T.attached_class) end - def initialize( - id: nil, - department: nil, - first_name: nil, - is_active: nil, - last_name: nil, - manager: nil, - middle_name: nil - ) + def self.new(id: nil, department: nil, first_name: nil, is_active: nil, last_name: nil, manager: nil, middle_name: nil) end sig do @@ -869,15 +882,13 @@ module FinchAPI class Manager < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def id - end - - sig { params(_: T::Boolean).returns(T::Boolean) } - def id=(_) - end + attr_reader :id sig { params(id: T::Boolean).void } - def initialize(id: nil) + attr_writer :id + + sig { params(id: T::Boolean).returns(T.attached_class) } + def self.new(id: nil) end sig { override.returns({id: T::Boolean}) } @@ -888,23 +899,19 @@ module FinchAPI class Paging < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def count - end + attr_reader :count - sig { params(_: T::Boolean).returns(T::Boolean) } - def count=(_) - end + sig { params(count: T::Boolean).void } + attr_writer :count sig { returns(T.nilable(T::Boolean)) } - def offset - end + attr_reader :offset - sig { params(_: T::Boolean).returns(T::Boolean) } - def offset=(_) - end + sig { params(offset: T::Boolean).void } + attr_writer :offset - sig { params(count: T::Boolean, offset: T::Boolean).void } - def initialize(count: nil, offset: nil) + sig { params(count: T::Boolean, offset: T::Boolean).returns(T.attached_class) } + def self.new(count: nil, offset: nil) end sig { override.returns({count: T::Boolean, offset: T::Boolean}) } @@ -915,28 +922,22 @@ module FinchAPI class Employment < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def id - end + attr_reader :id - sig { params(_: T::Boolean).returns(T::Boolean) } - def id=(_) - end + sig { params(id: T::Boolean).void } + attr_writer :id sig { returns(T.nilable(T::Boolean)) } - def class_code - end + attr_reader :class_code - sig { params(_: T::Boolean).returns(T::Boolean) } - def class_code=(_) - end + sig { params(class_code: T::Boolean).void } + attr_writer :class_code sig { returns(T.nilable(T::Boolean)) } - def custom_fields - end + attr_reader :custom_fields - sig { params(_: T::Boolean).returns(T::Boolean) } - def custom_fields=(_) - end + sig { params(custom_fields: T::Boolean).void } + attr_writer :custom_fields sig do returns( @@ -945,19 +946,18 @@ module FinchAPI ) ) end - def department - end + attr_reader :department sig do params( - _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Department - ) - .returns( - FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Department + department: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Department, + FinchAPI::Util::AnyHash ) + ) + .void end - def department=(_) - end + attr_writer :department sig do returns( @@ -966,43 +966,36 @@ module FinchAPI ) ) end - def employment - end + attr_reader :employment sig do params( - _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Employment - ) - .returns( - FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Employment + employment: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Employment, + FinchAPI::Util::AnyHash ) + ) + .void end - def employment=(_) - end + attr_writer :employment sig { returns(T.nilable(T::Boolean)) } - def employment_status - end + attr_reader :employment_status - sig { params(_: T::Boolean).returns(T::Boolean) } - def employment_status=(_) - end + sig { params(employment_status: T::Boolean).void } + attr_writer :employment_status sig { returns(T.nilable(T::Boolean)) } - def end_date - end + attr_reader :end_date - sig { params(_: T::Boolean).returns(T::Boolean) } - def end_date=(_) - end + sig { params(end_date: T::Boolean).void } + attr_writer :end_date sig { returns(T.nilable(T::Boolean)) } - def first_name - end + attr_reader :first_name - sig { params(_: T::Boolean).returns(T::Boolean) } - def first_name=(_) - end + sig { params(first_name: T::Boolean).void } + attr_writer :first_name sig do returns( @@ -1011,43 +1004,36 @@ module FinchAPI ) ) end - def income - end + attr_reader :income sig do params( - _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Income - ) - .returns( - FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Income + income: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Income, + FinchAPI::Util::AnyHash ) + ) + .void end - def income=(_) - end + attr_writer :income sig { returns(T.nilable(T::Boolean)) } - def income_history - end + attr_reader :income_history - sig { params(_: T::Boolean).returns(T::Boolean) } - def income_history=(_) - end + sig { params(income_history: T::Boolean).void } + attr_writer :income_history sig { returns(T.nilable(T::Boolean)) } - def is_active - end + attr_reader :is_active - sig { params(_: T::Boolean).returns(T::Boolean) } - def is_active=(_) - end + sig { params(is_active: T::Boolean).void } + attr_writer :is_active sig { returns(T.nilable(T::Boolean)) } - def last_name - end + attr_reader :last_name - sig { params(_: T::Boolean).returns(T::Boolean) } - def last_name=(_) - end + sig { params(last_name: T::Boolean).void } + attr_writer :last_name sig do returns( @@ -1056,19 +1042,18 @@ module FinchAPI ) ) end - def location - end + attr_reader :location sig do params( - _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Location - ) - .returns( - FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Location + location: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Location, + FinchAPI::Util::AnyHash ) + ) + .void end - def location=(_) - end + attr_writer :location sig do returns( @@ -1077,67 +1062,75 @@ module FinchAPI ) ) end - def manager - end + attr_reader :manager sig do params( - _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Manager - ) - .returns( - FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Manager + manager: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Manager, + FinchAPI::Util::AnyHash ) + ) + .void end - def manager=(_) - end + attr_writer :manager sig { returns(T.nilable(T::Boolean)) } - def middle_name - end + attr_reader :middle_name - sig { params(_: T::Boolean).returns(T::Boolean) } - def middle_name=(_) - end + sig { params(middle_name: T::Boolean).void } + attr_writer :middle_name sig { returns(T.nilable(T::Boolean)) } - def start_date - end + attr_reader :start_date - sig { params(_: T::Boolean).returns(T::Boolean) } - def start_date=(_) - end + sig { params(start_date: T::Boolean).void } + attr_writer :start_date sig { returns(T.nilable(T::Boolean)) } - def title - end + attr_reader :title - sig { params(_: T::Boolean).returns(T::Boolean) } - def title=(_) - end + sig { params(title: T::Boolean).void } + attr_writer :title 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, + department: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Department, + FinchAPI::Util::AnyHash + ), + employment: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Employment, + FinchAPI::Util::AnyHash + ), employment_status: T::Boolean, end_date: T::Boolean, first_name: T::Boolean, - income: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Income, + income: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Income, + FinchAPI::Util::AnyHash + ), 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, + location: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Location, + FinchAPI::Util::AnyHash + ), + manager: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::Manager, + FinchAPI::Util::AnyHash + ), middle_name: T::Boolean, start_date: T::Boolean, title: T::Boolean ) - .void + .returns(T.attached_class) end - def initialize( + def self.new( id: nil, class_code: nil, custom_fields: nil, @@ -1187,15 +1180,13 @@ module FinchAPI class Department < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def name - end - - sig { params(_: T::Boolean).returns(T::Boolean) } - def name=(_) - end + attr_reader :name sig { params(name: T::Boolean).void } - def initialize(name: nil) + attr_writer :name + + sig { params(name: T::Boolean).returns(T.attached_class) } + def self.new(name: nil) end sig { override.returns({name: T::Boolean}) } @@ -1205,23 +1196,19 @@ module FinchAPI class Employment < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def subtype - end + attr_reader :subtype - sig { params(_: T::Boolean).returns(T::Boolean) } - def subtype=(_) - end + sig { params(subtype: T::Boolean).void } + attr_writer :subtype sig { returns(T.nilable(T::Boolean)) } - def type - end + attr_reader :type - sig { params(_: T::Boolean).returns(T::Boolean) } - def type=(_) - end + sig { params(type: T::Boolean).void } + attr_writer :type - sig { params(subtype: T::Boolean, type: T::Boolean).void } - def initialize(subtype: nil, type: nil) + sig { params(subtype: T::Boolean, type: T::Boolean).returns(T.attached_class) } + def self.new(subtype: nil, type: nil) end sig { override.returns({subtype: T::Boolean, type: T::Boolean}) } @@ -1231,31 +1218,27 @@ module FinchAPI class Income < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def amount - end + attr_reader :amount - sig { params(_: T::Boolean).returns(T::Boolean) } - def amount=(_) - end + sig { params(amount: T::Boolean).void } + attr_writer :amount sig { returns(T.nilable(T::Boolean)) } - def currency - end + attr_reader :currency - sig { params(_: T::Boolean).returns(T::Boolean) } - def currency=(_) - end + sig { params(currency: T::Boolean).void } + attr_writer :currency sig { returns(T.nilable(T::Boolean)) } - def unit - end + attr_reader :unit - sig { params(_: T::Boolean).returns(T::Boolean) } - def unit=(_) - end + sig { params(unit: T::Boolean).void } + attr_writer :unit - sig { params(amount: T::Boolean, currency: T::Boolean, unit: T::Boolean).void } - def initialize(amount: nil, currency: nil, unit: nil) + sig do + params(amount: T::Boolean, currency: T::Boolean, unit: T::Boolean).returns(T.attached_class) + end + def self.new(amount: nil, currency: nil, unit: nil) end sig { override.returns({amount: T::Boolean, currency: T::Boolean, unit: T::Boolean}) } @@ -1265,52 +1248,40 @@ module FinchAPI class Location < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def city - end + attr_reader :city - sig { params(_: T::Boolean).returns(T::Boolean) } - def city=(_) - end + sig { params(city: T::Boolean).void } + attr_writer :city sig { returns(T.nilable(T::Boolean)) } - def country - end + attr_reader :country - sig { params(_: T::Boolean).returns(T::Boolean) } - def country=(_) - end + sig { params(country: T::Boolean).void } + attr_writer :country sig { returns(T.nilable(T::Boolean)) } - def line1 - end + attr_reader :line1 - sig { params(_: T::Boolean).returns(T::Boolean) } - def line1=(_) - end + sig { params(line1: T::Boolean).void } + attr_writer :line1 sig { returns(T.nilable(T::Boolean)) } - def line2 - end + attr_reader :line2 - sig { params(_: T::Boolean).returns(T::Boolean) } - def line2=(_) - end + sig { params(line2: T::Boolean).void } + attr_writer :line2 sig { returns(T.nilable(T::Boolean)) } - def postal_code - end + attr_reader :postal_code - sig { params(_: T::Boolean).returns(T::Boolean) } - def postal_code=(_) - end + sig { params(postal_code: T::Boolean).void } + attr_writer :postal_code sig { returns(T.nilable(T::Boolean)) } - def state - end + attr_reader :state - sig { params(_: T::Boolean).returns(T::Boolean) } - def state=(_) - end + sig { params(state: T::Boolean).void } + attr_writer :state sig do params( @@ -1321,9 +1292,9 @@ module FinchAPI postal_code: T::Boolean, state: T::Boolean ) - .void + .returns(T.attached_class) end - def initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil) + def self.new(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil) end sig do @@ -1345,15 +1316,13 @@ module FinchAPI class Manager < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def id - end - - sig { params(_: T::Boolean).returns(T::Boolean) } - def id=(_) - end + attr_reader :id sig { params(id: T::Boolean).void } - def initialize(id: nil) + attr_writer :id + + sig { params(id: T::Boolean).returns(T.attached_class) } + def self.new(id: nil) end sig { override.returns({id: T::Boolean}) } @@ -1364,20 +1333,16 @@ module FinchAPI class Individual < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def id - end + attr_reader :id - sig { params(_: T::Boolean).returns(T::Boolean) } - def id=(_) - end + sig { params(id: T::Boolean).void } + attr_writer :id sig { returns(T.nilable(T::Boolean)) } - def dob - end + attr_reader :dob - sig { params(_: T::Boolean).returns(T::Boolean) } - def dob=(_) - end + sig { params(dob: T::Boolean).void } + attr_writer :dob sig do returns( @@ -1386,67 +1351,54 @@ module FinchAPI ) ) end - def emails - end + attr_reader :emails sig do params( - _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::Emails - ) - .returns( - FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::Emails + emails: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::Emails, + FinchAPI::Util::AnyHash ) + ) + .void end - def emails=(_) - end + attr_writer :emails sig { returns(T.nilable(T::Boolean)) } - def encrypted_ssn - end + attr_reader :encrypted_ssn - sig { params(_: T::Boolean).returns(T::Boolean) } - def encrypted_ssn=(_) - end + sig { params(encrypted_ssn: T::Boolean).void } + attr_writer :encrypted_ssn sig { returns(T.nilable(T::Boolean)) } - def ethnicity - end + attr_reader :ethnicity - sig { params(_: T::Boolean).returns(T::Boolean) } - def ethnicity=(_) - end + sig { params(ethnicity: T::Boolean).void } + attr_writer :ethnicity sig { returns(T.nilable(T::Boolean)) } - def first_name - end + attr_reader :first_name - sig { params(_: T::Boolean).returns(T::Boolean) } - def first_name=(_) - end + sig { params(first_name: T::Boolean).void } + attr_writer :first_name sig { returns(T.nilable(T::Boolean)) } - def gender - end + attr_reader :gender - sig { params(_: T::Boolean).returns(T::Boolean) } - def gender=(_) - end + sig { params(gender: T::Boolean).void } + attr_writer :gender sig { returns(T.nilable(T::Boolean)) } - def last_name - end + attr_reader :last_name - sig { params(_: T::Boolean).returns(T::Boolean) } - def last_name=(_) - end + sig { params(last_name: T::Boolean).void } + attr_writer :last_name sig { returns(T.nilable(T::Boolean)) } - def middle_name - end + attr_reader :middle_name - sig { params(_: T::Boolean).returns(T::Boolean) } - def middle_name=(_) - end + sig { params(middle_name: T::Boolean).void } + attr_writer :middle_name sig do returns( @@ -1455,27 +1407,24 @@ module FinchAPI ) ) end - def phone_numbers - end + attr_reader :phone_numbers sig do params( - _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::PhoneNumbers - ) - .returns( - FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::PhoneNumbers + phone_numbers: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::PhoneNumbers, + FinchAPI::Util::AnyHash ) + ) + .void end - def phone_numbers=(_) - end + attr_writer :phone_numbers sig { returns(T.nilable(T::Boolean)) } - def preferred_name - end + attr_reader :preferred_name - sig { params(_: T::Boolean).returns(T::Boolean) } - def preferred_name=(_) - end + sig { params(preferred_name: T::Boolean).void } + attr_writer :preferred_name sig do returns( @@ -1484,47 +1433,53 @@ module FinchAPI ) ) end - def residence - end + attr_reader :residence sig do params( - _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::Residence - ) - .returns( - FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::Residence + residence: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::Residence, + FinchAPI::Util::AnyHash ) + ) + .void end - def residence=(_) - end + attr_writer :residence sig { returns(T.nilable(T::Boolean)) } - def ssn - end + attr_reader :ssn - sig { params(_: T::Boolean).returns(T::Boolean) } - def ssn=(_) - end + sig { params(ssn: T::Boolean).void } + attr_writer :ssn sig do params( id: T::Boolean, dob: T::Boolean, - emails: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::Emails, + emails: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::Emails, + FinchAPI::Util::AnyHash + ), 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, + phone_numbers: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::PhoneNumbers, + FinchAPI::Util::AnyHash + ), preferred_name: T::Boolean, - residence: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::Residence, + residence: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::Residence, + FinchAPI::Util::AnyHash + ), ssn: T::Boolean ) - .void + .returns(T.attached_class) end - def initialize( + def self.new( id: nil, dob: nil, emails: nil, @@ -1566,23 +1521,19 @@ module FinchAPI class Emails < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def data - end + attr_reader :data - sig { params(_: T::Boolean).returns(T::Boolean) } - def data=(_) - end + sig { params(data: T::Boolean).void } + attr_writer :data sig { returns(T.nilable(T::Boolean)) } - def type - end + attr_reader :type - sig { params(_: T::Boolean).returns(T::Boolean) } - def type=(_) - end + sig { params(type: T::Boolean).void } + attr_writer :type - sig { params(data: T::Boolean, type: T::Boolean).void } - def initialize(data: nil, type: nil) + sig { params(data: T::Boolean, type: T::Boolean).returns(T.attached_class) } + def self.new(data: nil, type: nil) end sig { override.returns({data: T::Boolean, type: T::Boolean}) } @@ -1592,23 +1543,19 @@ module FinchAPI class PhoneNumbers < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def data - end + attr_reader :data - sig { params(_: T::Boolean).returns(T::Boolean) } - def data=(_) - end + sig { params(data: T::Boolean).void } + attr_writer :data sig { returns(T.nilable(T::Boolean)) } - def type - end + attr_reader :type - sig { params(_: T::Boolean).returns(T::Boolean) } - def type=(_) - end + sig { params(type: T::Boolean).void } + attr_writer :type - sig { params(data: T::Boolean, type: T::Boolean).void } - def initialize(data: nil, type: nil) + sig { params(data: T::Boolean, type: T::Boolean).returns(T.attached_class) } + def self.new(data: nil, type: nil) end sig { override.returns({data: T::Boolean, type: T::Boolean}) } @@ -1618,52 +1565,40 @@ module FinchAPI class Residence < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def city - end + attr_reader :city - sig { params(_: T::Boolean).returns(T::Boolean) } - def city=(_) - end + sig { params(city: T::Boolean).void } + attr_writer :city sig { returns(T.nilable(T::Boolean)) } - def country - end + attr_reader :country - sig { params(_: T::Boolean).returns(T::Boolean) } - def country=(_) - end + sig { params(country: T::Boolean).void } + attr_writer :country sig { returns(T.nilable(T::Boolean)) } - def line1 - end + attr_reader :line1 - sig { params(_: T::Boolean).returns(T::Boolean) } - def line1=(_) - end + sig { params(line1: T::Boolean).void } + attr_writer :line1 sig { returns(T.nilable(T::Boolean)) } - def line2 - end + attr_reader :line2 - sig { params(_: T::Boolean).returns(T::Boolean) } - def line2=(_) - end + sig { params(line2: T::Boolean).void } + attr_writer :line2 sig { returns(T.nilable(T::Boolean)) } - def postal_code - end + attr_reader :postal_code - sig { params(_: T::Boolean).returns(T::Boolean) } - def postal_code=(_) - end + sig { params(postal_code: T::Boolean).void } + attr_writer :postal_code sig { returns(T.nilable(T::Boolean)) } - def state - end + attr_reader :state - sig { params(_: T::Boolean).returns(T::Boolean) } - def state=(_) - end + sig { params(state: T::Boolean).void } + attr_writer :state sig do params( @@ -1674,9 +1609,9 @@ module FinchAPI postal_code: T::Boolean, state: T::Boolean ) - .void + .returns(T.attached_class) end - def initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil) + def self.new(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil) end sig do @@ -1699,36 +1634,28 @@ module FinchAPI class PayGroup < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def id - end + attr_reader :id - sig { params(_: T::Boolean).returns(T::Boolean) } - def id=(_) - end + sig { params(id: T::Boolean).void } + attr_writer :id sig { returns(T.nilable(T::Boolean)) } - def individual_ids - end + attr_reader :individual_ids - sig { params(_: T::Boolean).returns(T::Boolean) } - def individual_ids=(_) - end + sig { params(individual_ids: T::Boolean).void } + attr_writer :individual_ids sig { returns(T.nilable(T::Boolean)) } - def name - end + attr_reader :name - sig { params(_: T::Boolean).returns(T::Boolean) } - def name=(_) - end + sig { params(name: T::Boolean).void } + attr_writer :name sig { returns(T.nilable(T::Boolean)) } - def pay_frequencies - end + attr_reader :pay_frequencies - sig { params(_: T::Boolean).returns(T::Boolean) } - def pay_frequencies=(_) - end + sig { params(pay_frequencies: T::Boolean).void } + attr_writer :pay_frequencies sig do params( @@ -1736,9 +1663,10 @@ module FinchAPI individual_ids: T::Boolean, name: T::Boolean, pay_frequencies: T::Boolean - ).void + ) + .returns(T.attached_class) end - def initialize(id: nil, individual_ids: nil, name: nil, pay_frequencies: nil) + def self.new(id: nil, individual_ids: nil, name: nil, pay_frequencies: nil) end sig do @@ -1762,19 +1690,18 @@ module FinchAPI ) ) end - def paging - end + attr_reader :paging sig do params( - _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::Paging - ) - .returns( - FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::Paging + paging: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::Paging, + FinchAPI::Util::AnyHash ) + ) + .void end - def paging=(_) - end + attr_writer :paging sig do returns( @@ -1783,28 +1710,33 @@ module FinchAPI ) ) end - def pay_statements - end + attr_reader :pay_statements sig do params( - _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements - ) - .returns( - FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements + pay_statements: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements, + FinchAPI::Util::AnyHash ) + ) + .void end - def pay_statements=(_) - end + attr_writer :pay_statements sig do params( - paging: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::Paging, - pay_statements: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements + paging: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::Paging, + FinchAPI::Util::AnyHash + ), + pay_statements: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements, + FinchAPI::Util::AnyHash + ) ) - .void + .returns(T.attached_class) end - def initialize(paging: nil, pay_statements: nil) + def self.new(paging: nil, pay_statements: nil) end sig do @@ -1821,23 +1753,13 @@ module FinchAPI class Paging < FinchAPI::BaseModel sig { returns(T::Boolean) } - def count - end - - sig { params(_: T::Boolean).returns(T::Boolean) } - def count=(_) - end + attr_accessor :count sig { returns(T::Boolean) } - def offset - end - - sig { params(_: T::Boolean).returns(T::Boolean) } - def offset=(_) - end + attr_accessor :offset - sig { params(count: T::Boolean, offset: T::Boolean).void } - def initialize(count:, offset:) + sig { params(count: T::Boolean, offset: T::Boolean).returns(T.attached_class) } + def self.new(count:, offset:) end sig { override.returns({count: T::Boolean, offset: T::Boolean}) } @@ -1853,19 +1775,18 @@ module FinchAPI ) ) end - def earnings - end + attr_reader :earnings sig do params( - _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings - ) - .returns( - FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings + earnings: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings, + FinchAPI::Util::AnyHash ) + ) + .void end - def earnings=(_) - end + attr_writer :earnings sig do returns( @@ -1874,19 +1795,18 @@ module FinchAPI ) ) end - def employee_deductions - end + attr_reader :employee_deductions sig do params( - _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployeeDeductions - ) - .returns( - FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployeeDeductions + employee_deductions: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployeeDeductions, + FinchAPI::Util::AnyHash ) + ) + .void end - def employee_deductions=(_) - end + attr_writer :employee_deductions sig do returns( @@ -1895,51 +1815,42 @@ module FinchAPI ) ) end - def employer_contributions - end + attr_reader :employer_contributions sig do params( - _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployerContributions - ) - .returns( - FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployerContributions + employer_contributions: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployerContributions, + FinchAPI::Util::AnyHash ) + ) + .void end - def employer_contributions=(_) - end + attr_writer :employer_contributions sig { returns(T.nilable(T::Boolean)) } - def gross_pay - end + attr_reader :gross_pay - sig { params(_: T::Boolean).returns(T::Boolean) } - def gross_pay=(_) - end + sig { params(gross_pay: T::Boolean).void } + attr_writer :gross_pay sig { returns(T.nilable(T::Boolean)) } - def individual_id - end + attr_reader :individual_id - sig { params(_: T::Boolean).returns(T::Boolean) } - def individual_id=(_) - end + sig { params(individual_id: T::Boolean).void } + attr_writer :individual_id sig { returns(T.nilable(T::Boolean)) } - def net_pay - end + attr_reader :net_pay - sig { params(_: T::Boolean).returns(T::Boolean) } - def net_pay=(_) - end + sig { params(net_pay: T::Boolean).void } + attr_writer :net_pay sig { returns(T.nilable(T::Boolean)) } - def payment_method - end + attr_reader :payment_method - sig { params(_: T::Boolean).returns(T::Boolean) } - def payment_method=(_) - end + sig { params(payment_method: T::Boolean).void } + attr_writer :payment_method sig do returns( @@ -1948,52 +1859,59 @@ module FinchAPI ) ) end - def taxes - end + attr_reader :taxes sig do params( - _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Taxes - ) - .returns( - FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Taxes + taxes: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Taxes, + FinchAPI::Util::AnyHash ) + ) + .void end - def taxes=(_) - end + attr_writer :taxes sig { returns(T.nilable(T::Boolean)) } - def total_hours - end + attr_reader :total_hours - sig { params(_: T::Boolean).returns(T::Boolean) } - def total_hours=(_) - end + sig { params(total_hours: T::Boolean).void } + attr_writer :total_hours sig { returns(T.nilable(T::Boolean)) } - def type - end + attr_reader :type - sig { params(_: T::Boolean).returns(T::Boolean) } - def type=(_) - end + sig { params(type: T::Boolean).void } + attr_writer :type 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, + earnings: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings, + FinchAPI::Util::AnyHash + ), + employee_deductions: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployeeDeductions, + FinchAPI::Util::AnyHash + ), + employer_contributions: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployerContributions, + FinchAPI::Util::AnyHash + ), 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, + taxes: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Taxes, + FinchAPI::Util::AnyHash + ), total_hours: T::Boolean, type: T::Boolean ) - .void + .returns(T.attached_class) end - def initialize( + def self.new( earnings: nil, employee_deductions: nil, employer_contributions: nil, @@ -2029,41 +1947,34 @@ module FinchAPI class Earnings < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def amount - end + attr_reader :amount - sig { params(_: T::Boolean).returns(T::Boolean) } - def amount=(_) - end + sig { params(amount: T::Boolean).void } + attr_writer :amount sig { returns(T.nilable(T::Boolean)) } - def currency - end + attr_reader :currency - sig { params(_: T::Boolean).returns(T::Boolean) } - def currency=(_) - end + sig { params(currency: T::Boolean).void } + attr_writer :currency sig { returns(T.nilable(T::Boolean)) } - def name - end + attr_reader :name - sig { params(_: T::Boolean).returns(T::Boolean) } - def name=(_) - end + sig { params(name: T::Boolean).void } + attr_writer :name sig { returns(T.nilable(T::Boolean)) } - def type - end + attr_reader :type - sig { params(_: T::Boolean).returns(T::Boolean) } - def type=(_) - end + sig { params(type: T::Boolean).void } + attr_writer :type sig do - params(amount: T::Boolean, currency: T::Boolean, name: T::Boolean, type: T::Boolean).void + params(amount: T::Boolean, currency: T::Boolean, name: T::Boolean, type: T::Boolean) + .returns(T.attached_class) end - def initialize(amount: nil, currency: nil, name: nil, type: nil) + def self.new(amount: nil, currency: nil, name: nil, type: nil) end sig do @@ -2082,44 +1993,34 @@ module FinchAPI class EmployeeDeductions < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def amount - end + attr_reader :amount - sig { params(_: T::Boolean).returns(T::Boolean) } - def amount=(_) - end + sig { params(amount: T::Boolean).void } + attr_writer :amount sig { returns(T.nilable(T::Boolean)) } - def currency - end + attr_reader :currency - sig { params(_: T::Boolean).returns(T::Boolean) } - def currency=(_) - end + sig { params(currency: T::Boolean).void } + attr_writer :currency sig { returns(T.nilable(T::Boolean)) } - def name - end + attr_reader :name - sig { params(_: T::Boolean).returns(T::Boolean) } - def name=(_) - end + sig { params(name: T::Boolean).void } + attr_writer :name sig { returns(T.nilable(T::Boolean)) } - def pre_tax - end + attr_reader :pre_tax - sig { params(_: T::Boolean).returns(T::Boolean) } - def pre_tax=(_) - end + sig { params(pre_tax: T::Boolean).void } + attr_writer :pre_tax sig { returns(T.nilable(T::Boolean)) } - def type - end + attr_reader :type - sig { params(_: T::Boolean).returns(T::Boolean) } - def type=(_) - end + sig { params(type: T::Boolean).void } + attr_writer :type sig do params( @@ -2129,9 +2030,9 @@ module FinchAPI pre_tax: T::Boolean, type: T::Boolean ) - .void + .returns(T.attached_class) end - def initialize(amount: nil, currency: nil, name: nil, pre_tax: nil, type: nil) + def self.new(amount: nil, currency: nil, name: nil, pre_tax: nil, type: nil) end sig do @@ -2152,31 +2053,31 @@ module FinchAPI class EmployerContributions < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def amount - end + attr_reader :amount - sig { params(_: T::Boolean).returns(T::Boolean) } - def amount=(_) - end + sig { params(amount: T::Boolean).void } + attr_writer :amount sig { returns(T.nilable(T::Boolean)) } - def currency - end + attr_reader :currency - sig { params(_: T::Boolean).returns(T::Boolean) } - def currency=(_) - end + sig { params(currency: T::Boolean).void } + attr_writer :currency sig { returns(T.nilable(T::Boolean)) } - def name - end + attr_reader :name - sig { params(_: T::Boolean).returns(T::Boolean) } - def name=(_) - end + sig { params(name: T::Boolean).void } + attr_writer :name - sig { params(amount: T::Boolean, currency: T::Boolean, name: T::Boolean).void } - def initialize(amount: nil, currency: nil, name: nil) + sig do + params( + amount: T::Boolean, + currency: T::Boolean, + name: T::Boolean + ).returns(T.attached_class) + end + def self.new(amount: nil, currency: nil, name: nil) end sig { override.returns({amount: T::Boolean, currency: T::Boolean, name: T::Boolean}) } @@ -2186,44 +2087,34 @@ module FinchAPI class Taxes < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def amount - end + attr_reader :amount - sig { params(_: T::Boolean).returns(T::Boolean) } - def amount=(_) - end + sig { params(amount: T::Boolean).void } + attr_writer :amount sig { returns(T.nilable(T::Boolean)) } - def currency - end + attr_reader :currency - sig { params(_: T::Boolean).returns(T::Boolean) } - def currency=(_) - end + sig { params(currency: T::Boolean).void } + attr_writer :currency sig { returns(T.nilable(T::Boolean)) } - def employer - end + attr_reader :employer - sig { params(_: T::Boolean).returns(T::Boolean) } - def employer=(_) - end + sig { params(employer: T::Boolean).void } + attr_writer :employer sig { returns(T.nilable(T::Boolean)) } - def name - end + attr_reader :name - sig { params(_: T::Boolean).returns(T::Boolean) } - def name=(_) - end + sig { params(name: T::Boolean).void } + attr_writer :name sig { returns(T.nilable(T::Boolean)) } - def type - end + attr_reader :type - sig { params(_: T::Boolean).returns(T::Boolean) } - def type=(_) - end + sig { params(type: T::Boolean).void } + attr_writer :type sig do params( @@ -2233,9 +2124,9 @@ module FinchAPI name: T::Boolean, type: T::Boolean ) - .void + .returns(T.attached_class) end - def initialize(amount: nil, currency: nil, employer: nil, name: nil, type: nil) + def self.new(amount: nil, currency: nil, employer: nil, name: nil, type: nil) end sig do @@ -2258,92 +2149,70 @@ module FinchAPI class Payment < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def id - end + attr_reader :id - sig { params(_: T::Boolean).returns(T::Boolean) } - def id=(_) - end + sig { params(id: T::Boolean).void } + attr_writer :id sig { returns(T.nilable(T::Boolean)) } - def company_debit - end + attr_reader :company_debit - sig { params(_: T::Boolean).returns(T::Boolean) } - def company_debit=(_) - end + sig { params(company_debit: T::Boolean).void } + attr_writer :company_debit sig { returns(T.nilable(T::Boolean)) } - def debit_date - end + attr_reader :debit_date - sig { params(_: T::Boolean).returns(T::Boolean) } - def debit_date=(_) - end + sig { params(debit_date: T::Boolean).void } + attr_writer :debit_date sig { returns(T.nilable(T::Boolean)) } - def employee_taxes - end + attr_reader :employee_taxes - sig { params(_: T::Boolean).returns(T::Boolean) } - def employee_taxes=(_) - end + sig { params(employee_taxes: T::Boolean).void } + attr_writer :employee_taxes sig { returns(T.nilable(T::Boolean)) } - def employer_taxes - end + attr_reader :employer_taxes - sig { params(_: T::Boolean).returns(T::Boolean) } - def employer_taxes=(_) - end + sig { params(employer_taxes: T::Boolean).void } + attr_writer :employer_taxes sig { returns(T.nilable(T::Boolean)) } - def gross_pay - end + attr_reader :gross_pay - sig { params(_: T::Boolean).returns(T::Boolean) } - def gross_pay=(_) - end + sig { params(gross_pay: T::Boolean).void } + attr_writer :gross_pay sig { returns(T.nilable(T::Boolean)) } - def individual_ids - end + attr_reader :individual_ids - sig { params(_: T::Boolean).returns(T::Boolean) } - def individual_ids=(_) - end + sig { params(individual_ids: T::Boolean).void } + attr_writer :individual_ids sig { returns(T.nilable(T::Boolean)) } - def net_pay - end + attr_reader :net_pay - sig { params(_: T::Boolean).returns(T::Boolean) } - def net_pay=(_) - end + sig { params(net_pay: T::Boolean).void } + attr_writer :net_pay sig { returns(T.nilable(T::Boolean)) } - def pay_date - end + attr_reader :pay_date - sig { params(_: T::Boolean).returns(T::Boolean) } - def pay_date=(_) - end + sig { params(pay_date: T::Boolean).void } + attr_writer :pay_date sig { returns(T.nilable(T::Boolean)) } - def pay_frequencies - end + attr_reader :pay_frequencies - sig { params(_: T::Boolean).returns(T::Boolean) } - def pay_frequencies=(_) - end + sig { params(pay_frequencies: T::Boolean).void } + attr_writer :pay_frequencies sig { returns(T.nilable(T::Boolean)) } - def pay_group_ids - end + attr_reader :pay_group_ids - sig { params(_: T::Boolean).returns(T::Boolean) } - def pay_group_ids=(_) - end + sig { params(pay_group_ids: T::Boolean).void } + attr_writer :pay_group_ids sig do returns( @@ -2352,19 +2221,18 @@ module FinchAPI ) ) end - def pay_period - end + attr_reader :pay_period sig do params( - _: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment::PayPeriod - ) - .returns( - FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment::PayPeriod + pay_period: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment::PayPeriod, + FinchAPI::Util::AnyHash ) + ) + .void end - def pay_period=(_) - end + attr_writer :pay_period sig do params( @@ -2379,11 +2247,14 @@ module FinchAPI pay_date: T::Boolean, pay_frequencies: T::Boolean, pay_group_ids: T::Boolean, - pay_period: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment::PayPeriod + pay_period: T.any( + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment::PayPeriod, + FinchAPI::Util::AnyHash + ) ) - .void + .returns(T.attached_class) end - def initialize( + def self.new( id: nil, company_debit: nil, debit_date: nil, @@ -2423,23 +2294,19 @@ module FinchAPI class PayPeriod < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def end_date - end + attr_reader :end_date - sig { params(_: T::Boolean).returns(T::Boolean) } - def end_date=(_) - end + sig { params(end_date: T::Boolean).void } + attr_writer :end_date sig { returns(T.nilable(T::Boolean)) } - def start_date - end + attr_reader :start_date - sig { params(_: T::Boolean).returns(T::Boolean) } - def start_date=(_) - end + sig { params(start_date: T::Boolean).void } + attr_writer :start_date - sig { params(end_date: T::Boolean, start_date: T::Boolean).void } - def initialize(end_date: nil, start_date: nil) + sig { params(end_date: T::Boolean, start_date: T::Boolean).returns(T.attached_class) } + def self.new(end_date: nil, start_date: nil) end sig { override.returns({end_date: T::Boolean, start_date: T::Boolean}) } @@ -2449,28 +2316,49 @@ module FinchAPI end end - class Type < FinchAPI::Enum - abstract! - - ASSISTED = :assisted - CREDENTIAL = :credential - API_TOKEN = :api_token - API_CREDENTIAL = :api_credential - OAUTH = :oauth + # The type of authentication method. + module Type + extend FinchAPI::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::Type::TaggedSymbol) } + + ASSISTED = + T.let(:assisted, FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::Type::TaggedSymbol) + CREDENTIAL = + T.let(:credential, FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::Type::TaggedSymbol) + API_TOKEN = + T.let(:api_token, FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::Type::TaggedSymbol) + API_CREDENTIAL = + T.let( + :api_credential, + FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::Type::TaggedSymbol + ) + OAUTH = + T.let(:oauth, FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::Type::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig do + override + .returns(T::Array[FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::Type::TaggedSymbol]) + end def self.values end end end end - class EventType < FinchAPI::Enum - abstract! + module EventType + extend FinchAPI::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::AccountUpdateEvent::EventType) } + OrSymbol = T.type_alias { T.any(Symbol, FinchAPI::Models::AccountUpdateEvent::EventType::TaggedSymbol) } - ACCOUNT_UPDATED = :"account.updated" + ACCOUNT_UPDATED = + T.let(:"account.updated", FinchAPI::Models::AccountUpdateEvent::EventType::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig { override.returns(T::Array[FinchAPI::Models::AccountUpdateEvent::EventType::TaggedSymbol]) } def self.values end end diff --git a/rbi/lib/finch-api/models/base_webhook_event.rbi b/rbi/lib/finch-api/models/base_webhook_event.rbi index dbf35f17..0516e4ce 100644 --- a/rbi/lib/finch-api/models/base_webhook_event.rbi +++ b/rbi/lib/finch-api/models/base_webhook_event.rbi @@ -3,32 +3,26 @@ module FinchAPI module Models class BaseWebhookEvent < FinchAPI::BaseModel + # [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. sig { returns(String) } - def account_id - end - - sig { params(_: String).returns(String) } - def account_id=(_) - end + attr_accessor :account_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. sig { returns(String) } - def company_id - end - - sig { params(_: String).returns(String) } - def company_id=(_) - end + attr_accessor :company_id + # Unique Finch ID of the connection associated with the webhook event. sig { returns(T.nilable(String)) } - def connection_id - end + attr_reader :connection_id - sig { params(_: String).returns(String) } - def connection_id=(_) - end + sig { params(connection_id: String).void } + attr_writer :connection_id - sig { params(account_id: String, company_id: String, connection_id: String).void } - def initialize(account_id:, company_id:, connection_id: nil) + sig { params(account_id: String, company_id: String, connection_id: String).returns(T.attached_class) } + def self.new(account_id:, company_id:, connection_id: nil) end sig { override.returns({account_id: String, company_id: String, connection_id: String}) } diff --git a/rbi/lib/finch-api/models/company_event.rbi b/rbi/lib/finch-api/models/company_event.rbi index 2c38858d..5dc180c6 100644 --- a/rbi/lib/finch-api/models/company_event.rbi +++ b/rbi/lib/finch-api/models/company_event.rbi @@ -4,37 +4,45 @@ module FinchAPI module Models class CompanyEvent < FinchAPI::Models::BaseWebhookEvent sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } - def data - end + attr_accessor :data - 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(FinchAPI::Models::CompanyEvent::EventType::TaggedSymbol)) } + attr_reader :event_type - sig { returns(T.nilable(Symbol)) } - def event_type - end + sig { params(event_type: FinchAPI::Models::CompanyEvent::EventType::OrSymbol).void } + attr_writer :event_type - sig { params(_: Symbol).returns(Symbol) } - def event_type=(_) + sig do + params( + data: T.nilable(T::Hash[Symbol, T.anything]), + event_type: FinchAPI::Models::CompanyEvent::EventType::OrSymbol + ) + .returns(T.attached_class) end - - sig { params(data: T.nilable(T::Hash[Symbol, T.anything]), event_type: Symbol).void } - def initialize(data: nil, event_type: nil) + def self.new(data: nil, event_type: nil) end - sig { override.returns({data: T.nilable(T::Hash[Symbol, T.anything]), event_type: Symbol}) } + sig do + override + .returns( + { + data: T.nilable(T::Hash[Symbol, T.anything]), + event_type: FinchAPI::Models::CompanyEvent::EventType::TaggedSymbol + } + ) + end def to_hash end - class EventType < FinchAPI::Enum - abstract! + module EventType + extend FinchAPI::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::CompanyEvent::EventType) } + OrSymbol = T.type_alias { T.any(Symbol, FinchAPI::Models::CompanyEvent::EventType::TaggedSymbol) } - COMPANY_UPDATED = :"company.updated" + COMPANY_UPDATED = T.let(:"company.updated", FinchAPI::Models::CompanyEvent::EventType::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig { override.returns(T::Array[FinchAPI::Models::CompanyEvent::EventType::TaggedSymbol]) } def self.values 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 index 5ea91e8d..d87b295f 100644 --- a/rbi/lib/finch-api/models/connect/session_new_params.rbi +++ b/rbi/lib/finch-api/models/connect/session_new_params.rbi @@ -8,96 +8,58 @@ module FinchAPI include FinchAPI::RequestParameters sig { returns(String) } - def customer_id - end - - sig { params(_: String).returns(String) } - def customer_id=(_) - end + attr_accessor :customer_id sig { returns(String) } - def customer_name - end + attr_accessor :customer_name - 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::Array[FinchAPI::Models::Connect::SessionNewParams::Product::OrSymbol]) } + attr_accessor :products sig { returns(T.nilable(String)) } - def customer_email - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def customer_email=(_) - end + attr_accessor :customer_email sig { returns(T.nilable(FinchAPI::Models::Connect::SessionNewParams::Integration)) } - def integration - end + attr_reader :integration sig do - params(_: T.nilable(FinchAPI::Models::Connect::SessionNewParams::Integration)) - .returns(T.nilable(FinchAPI::Models::Connect::SessionNewParams::Integration)) - end - def integration=(_) + params( + integration: T.nilable(T.any(FinchAPI::Models::Connect::SessionNewParams::Integration, FinchAPI::Util::AnyHash)) + ) + .void end + attr_writer :integration sig { returns(T.nilable(T::Boolean)) } - def manual - end - - sig { params(_: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } - def manual=(_) - end + attr_accessor :manual + # The number of minutes until the session expires (defaults to 43,200, which is 30 + # days) sig { returns(T.nilable(Float)) } - def minutes_to_expire - end - - sig { params(_: T.nilable(Float)).returns(T.nilable(Float)) } - def minutes_to_expire=(_) - end + attr_accessor :minutes_to_expire sig { returns(T.nilable(String)) } - def redirect_uri - end + attr_accessor :redirect_uri - 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 { returns(T.nilable(FinchAPI::Models::Connect::SessionNewParams::Sandbox::OrSymbol)) } + attr_accessor :sandbox sig do params( customer_id: String, customer_name: String, - products: T::Array[Symbol], + products: T::Array[FinchAPI::Models::Connect::SessionNewParams::Product::OrSymbol], customer_email: T.nilable(String), - integration: T.nilable(FinchAPI::Models::Connect::SessionNewParams::Integration), + integration: T.nilable(T.any(FinchAPI::Models::Connect::SessionNewParams::Integration, FinchAPI::Util::AnyHash)), 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]) + sandbox: T.nilable(FinchAPI::Models::Connect::SessionNewParams::Sandbox::OrSymbol), + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) ) - .void + .returns(T.attached_class) end - def initialize( + def self.new( customer_id:, customer_name:, products:, @@ -117,13 +79,13 @@ module FinchAPI { customer_id: String, customer_name: String, - products: T::Array[Symbol], + products: T::Array[FinchAPI::Models::Connect::SessionNewParams::Product::OrSymbol], 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), + sandbox: T.nilable(FinchAPI::Models::Connect::SessionNewParams::Sandbox::OrSymbol), request_options: FinchAPI::RequestOptions } ) @@ -131,69 +93,93 @@ module FinchAPI def to_hash end - class Product < FinchAPI::Enum - abstract! + # The Finch products that can be requested during the Connect flow. + module Product + extend FinchAPI::Enum - COMPANY = :company - DIRECTORY = :directory - INDIVIDUAL = :individual - EMPLOYMENT = :employment - PAYMENT = :payment - PAY_STATEMENT = :pay_statement - BENEFITS = :benefits - SSN = :ssn + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::Connect::SessionNewParams::Product) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Connect::SessionNewParams::Product::TaggedSymbol) } - sig { override.returns(T::Array[Symbol]) } + COMPANY = T.let(:company, FinchAPI::Models::Connect::SessionNewParams::Product::TaggedSymbol) + DIRECTORY = T.let(:directory, FinchAPI::Models::Connect::SessionNewParams::Product::TaggedSymbol) + INDIVIDUAL = T.let(:individual, FinchAPI::Models::Connect::SessionNewParams::Product::TaggedSymbol) + EMPLOYMENT = T.let(:employment, FinchAPI::Models::Connect::SessionNewParams::Product::TaggedSymbol) + PAYMENT = T.let(:payment, FinchAPI::Models::Connect::SessionNewParams::Product::TaggedSymbol) + PAY_STATEMENT = T.let(:pay_statement, FinchAPI::Models::Connect::SessionNewParams::Product::TaggedSymbol) + BENEFITS = T.let(:benefits, FinchAPI::Models::Connect::SessionNewParams::Product::TaggedSymbol) + SSN = T.let(:ssn, FinchAPI::Models::Connect::SessionNewParams::Product::TaggedSymbol) + + sig { override.returns(T::Array[FinchAPI::Models::Connect::SessionNewParams::Product::TaggedSymbol]) } 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(FinchAPI::Models::Connect::SessionNewParams::Integration::AuthMethod::OrSymbol)) } + attr_accessor :auth_method sig { returns(T.nilable(String)) } - def provider - end + attr_accessor :provider - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def provider=(_) + sig do + params( + auth_method: T.nilable(FinchAPI::Models::Connect::SessionNewParams::Integration::AuthMethod::OrSymbol), + provider: T.nilable(String) + ) + .returns(T.attached_class) end - - sig { params(auth_method: T.nilable(Symbol), provider: T.nilable(String)).void } - def initialize(auth_method: nil, provider: nil) + def self.new(auth_method: nil, provider: nil) end - sig { override.returns({auth_method: T.nilable(Symbol), provider: T.nilable(String)}) } + sig do + override + .returns( + { + auth_method: T.nilable(FinchAPI::Models::Connect::SessionNewParams::Integration::AuthMethod::OrSymbol), + provider: T.nilable(String) + } + ) + end 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]) } + module AuthMethod + extend FinchAPI::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::Connect::SessionNewParams::Integration::AuthMethod) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Connect::SessionNewParams::Integration::AuthMethod::TaggedSymbol) } + + ASSISTED = + T.let(:assisted, FinchAPI::Models::Connect::SessionNewParams::Integration::AuthMethod::TaggedSymbol) + CREDENTIAL = + T.let(:credential, FinchAPI::Models::Connect::SessionNewParams::Integration::AuthMethod::TaggedSymbol) + OAUTH = T.let(:oauth, FinchAPI::Models::Connect::SessionNewParams::Integration::AuthMethod::TaggedSymbol) + API_TOKEN = + T.let(:api_token, FinchAPI::Models::Connect::SessionNewParams::Integration::AuthMethod::TaggedSymbol) + + sig do + override + .returns(T::Array[FinchAPI::Models::Connect::SessionNewParams::Integration::AuthMethod::TaggedSymbol]) + end def self.values end end end - class Sandbox < FinchAPI::Enum - abstract! + module Sandbox + extend FinchAPI::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::Connect::SessionNewParams::Sandbox) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Connect::SessionNewParams::Sandbox::TaggedSymbol) } - FINCH = T.let(:finch, T.nilable(Symbol)) - PROVIDER = T.let(:provider, T.nilable(Symbol)) + FINCH = T.let(:finch, FinchAPI::Models::Connect::SessionNewParams::Sandbox::TaggedSymbol) + PROVIDER = T.let(:provider, FinchAPI::Models::Connect::SessionNewParams::Sandbox::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig { override.returns(T::Array[FinchAPI::Models::Connect::SessionNewParams::Sandbox::TaggedSymbol]) } def self.values 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 index 9dbeb488..99b78779 100644 --- a/rbi/lib/finch-api/models/connect/session_new_response.rbi +++ b/rbi/lib/finch-api/models/connect/session_new_response.rbi @@ -4,24 +4,16 @@ module FinchAPI module Models module Connect class SessionNewResponse < FinchAPI::BaseModel + # The Connect URL to redirect the user to for authentication sig { returns(String) } - def connect_url - end - - sig { params(_: String).returns(String) } - def connect_url=(_) - end + attr_accessor :connect_url + # The unique identifier for the created connect session sig { returns(String) } - def session_id - end - - sig { params(_: String).returns(String) } - def session_id=(_) - end + attr_accessor :session_id - sig { params(connect_url: String, session_id: String).void } - def initialize(connect_url:, session_id:) + sig { params(connect_url: String, session_id: String).returns(T.attached_class) } + def self.new(connect_url:, session_id:) end sig { override.returns({connect_url: String, session_id: String}) } diff --git a/rbi/lib/finch-api/models/connect/session_reauthenticate_params.rbi b/rbi/lib/finch-api/models/connect/session_reauthenticate_params.rbi index 582cb438..f1306ba9 100644 --- a/rbi/lib/finch-api/models/connect/session_reauthenticate_params.rbi +++ b/rbi/lib/finch-api/models/connect/session_reauthenticate_params.rbi @@ -7,55 +7,34 @@ module FinchAPI extend FinchAPI::RequestParameters::Converter include FinchAPI::RequestParameters + # The ID of the existing connection to reauthenticate sig { returns(String) } - def connection_id - end - - sig { params(_: String).returns(String) } - def connection_id=(_) - end + attr_accessor :connection_id + # The number of minutes until the session expires (defaults to 43,200, which is 30 + # days) sig { returns(T.nilable(Integer)) } - def minutes_to_expire - end + attr_accessor :minutes_to_expire - 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 + # The products to request access to (optional for reauthentication) + sig { returns(T.nilable(T::Array[FinchAPI::Models::Connect::SessionReauthenticateParams::Product::OrSymbol])) } + attr_accessor :products + # The URI to redirect to after the Connect flow is completed sig { returns(T.nilable(String)) } - def redirect_uri - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def redirect_uri=(_) - end + attr_accessor :redirect_uri sig do params( connection_id: String, minutes_to_expire: T.nilable(Integer), - products: T.nilable(T::Array[Symbol]), + products: T.nilable(T::Array[FinchAPI::Models::Connect::SessionReauthenticateParams::Product::OrSymbol]), redirect_uri: T.nilable(String), - request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) ) - .void + .returns(T.attached_class) end - def initialize( - connection_id:, - minutes_to_expire: nil, - products: nil, - redirect_uri: nil, - request_options: {} - ) + def self.new(connection_id:, minutes_to_expire: nil, products: nil, redirect_uri: nil, request_options: {}) end sig do @@ -64,7 +43,7 @@ module FinchAPI { connection_id: String, minutes_to_expire: T.nilable(Integer), - products: T.nilable(T::Array[Symbol]), + products: T.nilable(T::Array[FinchAPI::Models::Connect::SessionReauthenticateParams::Product::OrSymbol]), redirect_uri: T.nilable(String), request_options: FinchAPI::RequestOptions } @@ -73,19 +52,30 @@ module FinchAPI def to_hash end - class Product < FinchAPI::Enum - abstract! + # The Finch products that can be requested during the Connect flow. + module Product + extend FinchAPI::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::Connect::SessionReauthenticateParams::Product) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Connect::SessionReauthenticateParams::Product::TaggedSymbol) } - COMPANY = :company - DIRECTORY = :directory - INDIVIDUAL = :individual - EMPLOYMENT = :employment - PAYMENT = :payment - PAY_STATEMENT = :pay_statement - BENEFITS = :benefits - SSN = :ssn + COMPANY = T.let(:company, FinchAPI::Models::Connect::SessionReauthenticateParams::Product::TaggedSymbol) + DIRECTORY = + T.let(:directory, FinchAPI::Models::Connect::SessionReauthenticateParams::Product::TaggedSymbol) + INDIVIDUAL = + T.let(:individual, FinchAPI::Models::Connect::SessionReauthenticateParams::Product::TaggedSymbol) + EMPLOYMENT = + T.let(:employment, FinchAPI::Models::Connect::SessionReauthenticateParams::Product::TaggedSymbol) + PAYMENT = T.let(:payment, FinchAPI::Models::Connect::SessionReauthenticateParams::Product::TaggedSymbol) + PAY_STATEMENT = + T.let(:pay_statement, FinchAPI::Models::Connect::SessionReauthenticateParams::Product::TaggedSymbol) + BENEFITS = + T.let(:benefits, FinchAPI::Models::Connect::SessionReauthenticateParams::Product::TaggedSymbol) + SSN = T.let(:ssn, FinchAPI::Models::Connect::SessionReauthenticateParams::Product::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig { override.returns(T::Array[FinchAPI::Models::Connect::SessionReauthenticateParams::Product::TaggedSymbol]) } def self.values 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 index e7344c65..fa8b1c7d 100644 --- a/rbi/lib/finch-api/models/connect/session_reauthenticate_response.rbi +++ b/rbi/lib/finch-api/models/connect/session_reauthenticate_response.rbi @@ -4,24 +4,16 @@ module FinchAPI module Models module Connect class SessionReauthenticateResponse < FinchAPI::BaseModel + # The Connect URL to redirect the user to for reauthentication sig { returns(String) } - def connect_url - end - - sig { params(_: String).returns(String) } - def connect_url=(_) - end + attr_accessor :connect_url + # The unique identifier for the created connect session sig { returns(String) } - def session_id - end - - sig { params(_: String).returns(String) } - def session_id=(_) - end + attr_accessor :session_id - sig { params(connect_url: String, session_id: String).void } - def initialize(connect_url:, session_id:) + sig { params(connect_url: String, session_id: String).returns(T.attached_class) } + def self.new(connect_url:, session_id:) end sig { override.returns({connect_url: String, session_id: String}) } diff --git a/rbi/lib/finch-api/models/connection_status_type.rbi b/rbi/lib/finch-api/models/connection_status_type.rbi index fb495a37..672cd482 100644 --- a/rbi/lib/finch-api/models/connection_status_type.rbi +++ b/rbi/lib/finch-api/models/connection_status_type.rbi @@ -2,17 +2,21 @@ module FinchAPI module Models - class ConnectionStatusType < FinchAPI::Enum - abstract! + module ConnectionStatusType + extend FinchAPI::Enum - PENDING = :pending - PROCESSING = :processing - CONNECTED = :connected - ERROR_NO_ACCOUNT_SETUP = :error_no_account_setup - ERROR_PERMISSIONS = :error_permissions - REAUTH = :reauth + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::ConnectionStatusType) } + OrSymbol = T.type_alias { T.any(Symbol, FinchAPI::Models::ConnectionStatusType::TaggedSymbol) } - sig { override.returns(T::Array[Symbol]) } + PENDING = T.let(:pending, FinchAPI::Models::ConnectionStatusType::TaggedSymbol) + PROCESSING = T.let(:processing, FinchAPI::Models::ConnectionStatusType::TaggedSymbol) + CONNECTED = T.let(:connected, FinchAPI::Models::ConnectionStatusType::TaggedSymbol) + ERROR_NO_ACCOUNT_SETUP = + T.let(:error_no_account_setup, FinchAPI::Models::ConnectionStatusType::TaggedSymbol) + ERROR_PERMISSIONS = T.let(:error_permissions, FinchAPI::Models::ConnectionStatusType::TaggedSymbol) + REAUTH = T.let(:reauth, FinchAPI::Models::ConnectionStatusType::TaggedSymbol) + + sig { override.returns(T::Array[FinchAPI::Models::ConnectionStatusType::TaggedSymbol]) } def self.values 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 index 341c7933..bfcc9759 100644 --- a/rbi/lib/finch-api/models/create_access_token_response.rbi +++ b/rbi/lib/finch-api/models/create_access_token_response.rbi @@ -3,102 +3,71 @@ module FinchAPI module Models class CreateAccessTokenResponse < FinchAPI::BaseModel + # The access token for the connection. sig { returns(String) } - def access_token - end - - sig { params(_: String).returns(String) } - def access_token=(_) - end + attr_accessor :access_token + # [DEPRECATED] Use `connection_id` to identify the connection instead of this + # account ID. sig { returns(String) } - def account_id - end - - sig { params(_: String).returns(String) } - def account_id=(_) - end - - sig { returns(Symbol) } - def client_type - end + attr_accessor :account_id - sig { params(_: Symbol).returns(Symbol) } - def client_type=(_) - end + # The type of application associated with a token. + sig { returns(FinchAPI::Models::CreateAccessTokenResponse::ClientType::TaggedSymbol) } + attr_accessor :client_type + # [DEPRECATED] Use `connection_id` to identify the connection instead of this + # company ID. sig { returns(String) } - def company_id - end - - sig { params(_: String).returns(String) } - def company_id=(_) - end + attr_accessor :company_id + # The Finch UUID of the connection associated with the `access_token`. sig { returns(String) } - def connection_id - end - - sig { params(_: String).returns(String) } - def connection_id=(_) - end + attr_accessor :connection_id - sig { returns(Symbol) } - def connection_type - end - - sig { params(_: Symbol).returns(Symbol) } - def connection_type=(_) - end + # The type of the connection associated with the token. + # + # - `provider` - connection to an external provider + # - `finch` - finch-generated data. + sig { returns(FinchAPI::Models::CreateAccessTokenResponse::ConnectionType::TaggedSymbol) } + attr_accessor :connection_type + # An array of the authorized products associated with the `access_token`. sig { returns(T::Array[String]) } - def products - end - - sig { params(_: T::Array[String]).returns(T::Array[String]) } - def products=(_) - end + attr_accessor :products + # The ID of the provider associated with the `access_token`. sig { returns(String) } - def provider_id - end - - sig { params(_: String).returns(String) } - def provider_id=(_) - end + attr_accessor :provider_id + # The ID of your customer you provided to Finch when a connect session was created + # for this connection. sig { returns(T.nilable(String)) } - def customer_id - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def customer_id=(_) - end + attr_accessor :customer_id + # The RFC 8693 token type (Finch uses `bearer` tokens) sig { returns(T.nilable(String)) } - def token_type - end + attr_reader :token_type - sig { params(_: String).returns(String) } - def token_type=(_) - end + sig { params(token_type: String).void } + attr_writer :token_type sig do params( access_token: String, account_id: String, - client_type: Symbol, + client_type: FinchAPI::Models::CreateAccessTokenResponse::ClientType::OrSymbol, company_id: String, connection_id: String, - connection_type: Symbol, + connection_type: FinchAPI::Models::CreateAccessTokenResponse::ConnectionType::OrSymbol, products: T::Array[String], provider_id: String, customer_id: T.nilable(String), token_type: String ) - .void + .returns(T.attached_class) end - def initialize( + def self.new( access_token:, account_id:, client_type:, @@ -118,10 +87,10 @@ module FinchAPI { access_token: String, account_id: String, - client_type: Symbol, + client_type: FinchAPI::Models::CreateAccessTokenResponse::ClientType::TaggedSymbol, company_id: String, connection_id: String, - connection_type: Symbol, + connection_type: FinchAPI::Models::CreateAccessTokenResponse::ConnectionType::TaggedSymbol, products: T::Array[String], provider_id: String, customer_id: T.nilable(String), @@ -132,25 +101,39 @@ module FinchAPI def to_hash end - class ClientType < FinchAPI::Enum - abstract! + # The type of application associated with a token. + module ClientType + extend FinchAPI::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::CreateAccessTokenResponse::ClientType) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::CreateAccessTokenResponse::ClientType::TaggedSymbol) } - PRODUCTION = :production - DEVELOPMENT = :development - SANDBOX = :sandbox + PRODUCTION = T.let(:production, FinchAPI::Models::CreateAccessTokenResponse::ClientType::TaggedSymbol) + DEVELOPMENT = T.let(:development, FinchAPI::Models::CreateAccessTokenResponse::ClientType::TaggedSymbol) + SANDBOX = T.let(:sandbox, FinchAPI::Models::CreateAccessTokenResponse::ClientType::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig { override.returns(T::Array[FinchAPI::Models::CreateAccessTokenResponse::ClientType::TaggedSymbol]) } def self.values end end - class ConnectionType < FinchAPI::Enum - abstract! + # The type of the connection associated with the token. + # + # - `provider` - connection to an external provider + # - `finch` - finch-generated data. + module ConnectionType + extend FinchAPI::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::CreateAccessTokenResponse::ConnectionType) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::CreateAccessTokenResponse::ConnectionType::TaggedSymbol) } - PROVIDER = :provider - FINCH = :finch + PROVIDER = T.let(:provider, FinchAPI::Models::CreateAccessTokenResponse::ConnectionType::TaggedSymbol) + FINCH = T.let(:finch, FinchAPI::Models::CreateAccessTokenResponse::ConnectionType::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig { override.returns(T::Array[FinchAPI::Models::CreateAccessTokenResponse::ConnectionType::TaggedSymbol]) } def self.values end end diff --git a/rbi/lib/finch-api/models/directory_event.rbi b/rbi/lib/finch-api/models/directory_event.rbi index bb7e3bfb..6854755f 100644 --- a/rbi/lib/finch-api/models/directory_event.rbi +++ b/rbi/lib/finch-api/models/directory_event.rbi @@ -4,40 +4,49 @@ module FinchAPI module Models class DirectoryEvent < FinchAPI::Models::BaseWebhookEvent sig { returns(T.nilable(FinchAPI::Models::DirectoryEvent::Data)) } - def data - end + attr_reader :data - sig { params(_: FinchAPI::Models::DirectoryEvent::Data).returns(FinchAPI::Models::DirectoryEvent::Data) } - def data=(_) - end + sig { params(data: T.any(FinchAPI::Models::DirectoryEvent::Data, FinchAPI::Util::AnyHash)).void } + attr_writer :data - sig { returns(T.nilable(Symbol)) } - def event_type - end + sig { returns(T.nilable(FinchAPI::Models::DirectoryEvent::EventType::TaggedSymbol)) } + attr_reader :event_type - sig { params(_: Symbol).returns(Symbol) } - def event_type=(_) - end + sig { params(event_type: FinchAPI::Models::DirectoryEvent::EventType::OrSymbol).void } + attr_writer :event_type - sig { params(data: FinchAPI::Models::DirectoryEvent::Data, event_type: Symbol).void } - def initialize(data: nil, event_type: nil) + sig do + params( + data: T.any(FinchAPI::Models::DirectoryEvent::Data, FinchAPI::Util::AnyHash), + event_type: FinchAPI::Models::DirectoryEvent::EventType::OrSymbol + ) + .returns(T.attached_class) + end + def self.new(data: nil, event_type: nil) end - sig { override.returns({data: FinchAPI::Models::DirectoryEvent::Data, event_type: Symbol}) } + sig do + override + .returns( + { + data: FinchAPI::Models::DirectoryEvent::Data, + event_type: FinchAPI::Models::DirectoryEvent::EventType::TaggedSymbol + } + ) + end def to_hash end class Data < FinchAPI::BaseModel + # The ID of the individual related to the event. sig { returns(T.nilable(String)) } - def individual_id - end - - sig { params(_: String).returns(String) } - def individual_id=(_) - end + attr_reader :individual_id sig { params(individual_id: String).void } - def initialize(individual_id: nil) + attr_writer :individual_id + + sig { params(individual_id: String).returns(T.attached_class) } + def self.new(individual_id: nil) end sig { override.returns({individual_id: String}) } @@ -45,14 +54,20 @@ module FinchAPI end end - class EventType < FinchAPI::Enum - abstract! + module EventType + extend FinchAPI::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::DirectoryEvent::EventType) } + OrSymbol = T.type_alias { T.any(Symbol, FinchAPI::Models::DirectoryEvent::EventType::TaggedSymbol) } - DIRECTORY_CREATED = :"directory.created" - DIRECTORY_UPDATED = :"directory.updated" - DIRECTORY_DELETED = :"directory.deleted" + DIRECTORY_CREATED = + T.let(:"directory.created", FinchAPI::Models::DirectoryEvent::EventType::TaggedSymbol) + DIRECTORY_UPDATED = + T.let(:"directory.updated", FinchAPI::Models::DirectoryEvent::EventType::TaggedSymbol) + DIRECTORY_DELETED = + T.let(:"directory.deleted", FinchAPI::Models::DirectoryEvent::EventType::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig { override.returns(T::Array[FinchAPI::Models::DirectoryEvent::EventType::TaggedSymbol]) } def self.values end end diff --git a/rbi/lib/finch-api/models/disconnect_response.rbi b/rbi/lib/finch-api/models/disconnect_response.rbi index 16d35b15..1b96cae8 100644 --- a/rbi/lib/finch-api/models/disconnect_response.rbi +++ b/rbi/lib/finch-api/models/disconnect_response.rbi @@ -3,16 +3,12 @@ module FinchAPI module Models class DisconnectResponse < FinchAPI::BaseModel + # If the request is successful, Finch will return “success” (HTTP 200 status). sig { returns(String) } - def status - end - - sig { params(_: String).returns(String) } - def status=(_) - end + attr_accessor :status - sig { params(status: String).void } - def initialize(status:) + sig { params(status: String).returns(T.attached_class) } + def self.new(status:) end sig { override.returns({status: String}) } diff --git a/rbi/lib/finch-api/models/employment_event.rbi b/rbi/lib/finch-api/models/employment_event.rbi index 96cc16e3..3a6e3e7d 100644 --- a/rbi/lib/finch-api/models/employment_event.rbi +++ b/rbi/lib/finch-api/models/employment_event.rbi @@ -4,40 +4,49 @@ module FinchAPI module Models class EmploymentEvent < FinchAPI::Models::BaseWebhookEvent sig { returns(T.nilable(FinchAPI::Models::EmploymentEvent::Data)) } - def data - end + attr_reader :data - sig { params(_: FinchAPI::Models::EmploymentEvent::Data).returns(FinchAPI::Models::EmploymentEvent::Data) } - def data=(_) - end + sig { params(data: T.any(FinchAPI::Models::EmploymentEvent::Data, FinchAPI::Util::AnyHash)).void } + attr_writer :data - sig { returns(T.nilable(Symbol)) } - def event_type - end + sig { returns(T.nilable(FinchAPI::Models::EmploymentEvent::EventType::TaggedSymbol)) } + attr_reader :event_type - sig { params(_: Symbol).returns(Symbol) } - def event_type=(_) - end + sig { params(event_type: FinchAPI::Models::EmploymentEvent::EventType::OrSymbol).void } + attr_writer :event_type - sig { params(data: FinchAPI::Models::EmploymentEvent::Data, event_type: Symbol).void } - def initialize(data: nil, event_type: nil) + sig do + params( + data: T.any(FinchAPI::Models::EmploymentEvent::Data, FinchAPI::Util::AnyHash), + event_type: FinchAPI::Models::EmploymentEvent::EventType::OrSymbol + ) + .returns(T.attached_class) + end + def self.new(data: nil, event_type: nil) end - sig { override.returns({data: FinchAPI::Models::EmploymentEvent::Data, event_type: Symbol}) } + sig do + override + .returns( + { + data: FinchAPI::Models::EmploymentEvent::Data, + event_type: FinchAPI::Models::EmploymentEvent::EventType::TaggedSymbol + } + ) + end def to_hash end class Data < FinchAPI::BaseModel + # The ID of the individual related to the event. sig { returns(T.nilable(String)) } - def individual_id - end - - sig { params(_: String).returns(String) } - def individual_id=(_) - end + attr_reader :individual_id sig { params(individual_id: String).void } - def initialize(individual_id: nil) + attr_writer :individual_id + + sig { params(individual_id: String).returns(T.attached_class) } + def self.new(individual_id: nil) end sig { override.returns({individual_id: String}) } @@ -45,14 +54,20 @@ module FinchAPI end end - class EventType < FinchAPI::Enum - abstract! + module EventType + extend FinchAPI::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::EmploymentEvent::EventType) } + OrSymbol = T.type_alias { T.any(Symbol, FinchAPI::Models::EmploymentEvent::EventType::TaggedSymbol) } - EMPLOYMENT_CREATED = :"employment.created" - EMPLOYMENT_UPDATED = :"employment.updated" - EMPLOYMENT_DELETED = :"employment.deleted" + EMPLOYMENT_CREATED = + T.let(:"employment.created", FinchAPI::Models::EmploymentEvent::EventType::TaggedSymbol) + EMPLOYMENT_UPDATED = + T.let(:"employment.updated", FinchAPI::Models::EmploymentEvent::EventType::TaggedSymbol) + EMPLOYMENT_DELETED = + T.let(:"employment.deleted", FinchAPI::Models::EmploymentEvent::EventType::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig { override.returns(T::Array[FinchAPI::Models::EmploymentEvent::EventType::TaggedSymbol]) } def self.values end end diff --git a/rbi/lib/finch-api/models/hris/benefit_contribution.rbi b/rbi/lib/finch-api/models/hris/benefit_contribution.rbi index 6ec99ded..e946879e 100644 --- a/rbi/lib/finch-api/models/hris/benefit_contribution.rbi +++ b/rbi/lib/finch-api/models/hris/benefit_contribution.rbi @@ -4,37 +4,45 @@ module FinchAPI module Models module HRIS class BenefitContribution < FinchAPI::BaseModel + # Contribution amount in cents (if `fixed`) or basis points (if `percent`). sig { returns(T.nilable(Integer)) } - def amount + attr_accessor :amount + + # Contribution type. + sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitContribution::Type::TaggedSymbol)) } + attr_accessor :type + + sig do + params( + amount: T.nilable(Integer), + type: T.nilable(FinchAPI::Models::HRIS::BenefitContribution::Type::OrSymbol) + ) + .returns(T.attached_class) end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def amount=(_) - end - - sig { returns(T.nilable(Symbol)) } - def type + def self.new(amount: nil, type: nil) end - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def type=(_) + sig do + override + .returns( + {amount: T.nilable(Integer), type: T.nilable(FinchAPI::Models::HRIS::BenefitContribution::Type::TaggedSymbol)} + ) 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! + # Contribution type. + module Type + extend FinchAPI::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::BenefitContribution::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::HRIS::BenefitContribution::Type::TaggedSymbol) } - FIXED = T.let(:fixed, T.nilable(Symbol)) - PERCENT = T.let(:percent, T.nilable(Symbol)) + FIXED = T.let(:fixed, FinchAPI::Models::HRIS::BenefitContribution::Type::TaggedSymbol) + PERCENT = T.let(:percent, FinchAPI::Models::HRIS::BenefitContribution::Type::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig { override.returns(T::Array[FinchAPI::Models::HRIS::BenefitContribution::Type::TaggedSymbol]) } def self.values 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 index 23bcb010..4a8c86a7 100644 --- a/rbi/lib/finch-api/models/hris/benefit_create_params.rbi +++ b/rbi/lib/finch-api/models/hris/benefit_create_params.rbi @@ -7,40 +7,32 @@ module FinchAPI extend FinchAPI::RequestParameters::Converter include FinchAPI::RequestParameters + # 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). sig { returns(T.nilable(String)) } - def description - end - - sig { params(_: String).returns(String) } - def description=(_) - end - - sig { returns(T.nilable(Symbol)) } - def frequency - end + attr_reader :description - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def frequency=(_) - end + sig { params(description: String).void } + attr_writer :description - sig { returns(T.nilable(Symbol)) } - def type - end + sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitFrequency::OrSymbol)) } + attr_accessor :frequency - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def type=(_) - end + # Type of benefit. + sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitType::OrSymbol)) } + attr_accessor :type sig do params( description: String, - frequency: T.nilable(Symbol), - type: T.nilable(Symbol), - request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + frequency: T.nilable(FinchAPI::Models::HRIS::BenefitFrequency::OrSymbol), + type: T.nilable(FinchAPI::Models::HRIS::BenefitType::OrSymbol), + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) ) - .void + .returns(T.attached_class) end - def initialize(description: nil, frequency: nil, type: nil, request_options: {}) + def self.new(description: nil, frequency: nil, type: nil, request_options: {}) end sig do @@ -48,8 +40,8 @@ module FinchAPI .returns( { description: String, - frequency: T.nilable(Symbol), - type: T.nilable(Symbol), + frequency: T.nilable(FinchAPI::Models::HRIS::BenefitFrequency::OrSymbol), + type: T.nilable(FinchAPI::Models::HRIS::BenefitType::OrSymbol), request_options: FinchAPI::RequestOptions } ) 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 index 6d5c8163..45f38f6b 100644 --- a/rbi/lib/finch-api/models/hris/benefit_features_and_operations.rbi +++ b/rbi/lib/finch-api/models/hris/benefit_features_and_operations.rbi @@ -5,35 +5,35 @@ module FinchAPI module HRIS class BenefitFeaturesAndOperations < FinchAPI::BaseModel sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures)) } - def supported_features - end + attr_reader :supported_features sig do - params(_: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures) - .returns(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures) - end - def supported_features=(_) + params( + supported_features: T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures, FinchAPI::Util::AnyHash) + ) + .void end + attr_writer :supported_features sig { returns(T.nilable(FinchAPI::Models::HRIS::SupportPerBenefitType)) } - def supported_operations - end + attr_reader :supported_operations sig do - params(_: FinchAPI::Models::HRIS::SupportPerBenefitType) - .returns(FinchAPI::Models::HRIS::SupportPerBenefitType) - end - def supported_operations=(_) + params( + supported_operations: T.any(FinchAPI::Models::HRIS::SupportPerBenefitType, FinchAPI::Util::AnyHash) + ) + .void end + attr_writer :supported_operations sig do params( - supported_features: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures, - supported_operations: FinchAPI::Models::HRIS::SupportPerBenefitType + supported_features: T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures, FinchAPI::Util::AnyHash), + supported_operations: T.any(FinchAPI::Models::HRIS::SupportPerBenefitType, FinchAPI::Util::AnyHash) ) - .void + .returns(T.attached_class) end - def initialize(supported_features: nil, supported_operations: nil) + def self.new(supported_features: nil, supported_operations: nil) end sig do @@ -49,81 +49,101 @@ module FinchAPI end class SupportedFeatures < FinchAPI::BaseModel + # Whether the provider supports an annual maximum for this benefit. 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 + attr_accessor :annual_maximum + # Whether the provider supports catch up for this benefit. This field will only be + # true for retirement benefits. 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 + attr_accessor :catch_up + # Supported contribution types. An empty array indicates contributions are not + # supported. sig do - params(_: T.nilable(T::Array[T.nilable(Symbol)])).returns(T.nilable(T::Array[T.nilable(Symbol)])) - end - def company_contribution=(_) + returns( + T.nilable( + T::Array[ + T.nilable( + FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::CompanyContribution::TaggedSymbol + ) + ] + ) + ) end + attr_accessor :company_contribution 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 + attr_accessor :description + # Supported deduction types. An empty array indicates deductions are not + # supported. sig do - params(_: T.nilable(T::Array[T.nilable(Symbol)])).returns(T.nilable(T::Array[T.nilable(Symbol)])) - end - def employee_deduction=(_) + returns( + T.nilable( + T::Array[ + T.nilable( + FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::EmployeeDeduction::TaggedSymbol + ) + ] + ) + ) end + attr_accessor :employee_deduction - sig { returns(T.nilable(T::Array[T.nilable(Symbol)])) } - def frequencies - end + # The list of frequencies supported by the provider for this benefit + sig { returns(T.nilable(T::Array[T.nilable(FinchAPI::Models::HRIS::BenefitFrequency::TaggedSymbol)])) } + attr_reader :frequencies - 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 { params(frequencies: T::Array[T.nilable(FinchAPI::Models::HRIS::BenefitFrequency::OrSymbol)]).void } + attr_writer :frequencies + # 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. sig do - params(_: T.nilable(T::Array[T.nilable(Symbol)])).returns(T.nilable(T::Array[T.nilable(Symbol)])) - end - def hsa_contribution_limit=(_) + returns( + T.nilable( + T::Array[ + T.nilable( + FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::HsaContributionLimit::TaggedSymbol + ) + ] + ) + ) end + attr_accessor :hsa_contribution_limit sig do params( annual_maximum: T.nilable(T::Boolean), catch_up: T.nilable(T::Boolean), - company_contribution: T.nilable(T::Array[T.nilable(Symbol)]), + company_contribution: T.nilable( + T::Array[ + T.nilable( + FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::CompanyContribution::OrSymbol + ) + ] + ), 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)]) + employee_deduction: T.nilable( + T::Array[ + T.nilable( + FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::EmployeeDeduction::OrSymbol + ) + ] + ), + frequencies: T::Array[T.nilable(FinchAPI::Models::HRIS::BenefitFrequency::OrSymbol)], + hsa_contribution_limit: T.nilable( + T::Array[ + T.nilable( + FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::HsaContributionLimit::OrSymbol + ) + ] + ) ) - .void + .returns(T.attached_class) end - def initialize( + def self.new( annual_maximum: nil, catch_up: nil, company_contribution: nil, @@ -140,46 +160,139 @@ module FinchAPI { annual_maximum: T.nilable(T::Boolean), catch_up: T.nilable(T::Boolean), - company_contribution: T.nilable(T::Array[T.nilable(Symbol)]), + company_contribution: T.nilable( + T::Array[ + T.nilable( + FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::CompanyContribution::TaggedSymbol + ) + ] + ), 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)]) + employee_deduction: T.nilable( + T::Array[ + T.nilable( + FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::EmployeeDeduction::TaggedSymbol + ) + ] + ), + frequencies: T::Array[T.nilable(FinchAPI::Models::HRIS::BenefitFrequency::TaggedSymbol)], + hsa_contribution_limit: T.nilable( + T::Array[ + T.nilable( + FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::HsaContributionLimit::TaggedSymbol + ) + ] + ) } ) end def to_hash end - class CompanyContribution < FinchAPI::Enum - abstract! + module CompanyContribution + extend FinchAPI::Enum - FIXED = T.let(:fixed, T.nilable(Symbol)) - PERCENT = T.let(:percent, T.nilable(Symbol)) + TaggedSymbol = + T.type_alias do + T.all(Symbol, FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::CompanyContribution) + end + OrSymbol = + T.type_alias do + T.any( + Symbol, + FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::CompanyContribution::TaggedSymbol + ) + end - sig { override.returns(T::Array[Symbol]) } + FIXED = + T.let( + :fixed, + FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::CompanyContribution::TaggedSymbol + ) + PERCENT = + T.let( + :percent, + FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::CompanyContribution::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::CompanyContribution::TaggedSymbol] + ) + end def self.values end end - class EmployeeDeduction < FinchAPI::Enum - abstract! + module EmployeeDeduction + extend FinchAPI::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::EmployeeDeduction) } + OrSymbol = + T.type_alias do + T.any( + Symbol, + FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::EmployeeDeduction::TaggedSymbol + ) + end - FIXED = T.let(:fixed, T.nilable(Symbol)) - PERCENT = T.let(:percent, T.nilable(Symbol)) + FIXED = + T.let( + :fixed, + FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::EmployeeDeduction::TaggedSymbol + ) + PERCENT = + T.let( + :percent, + FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::EmployeeDeduction::TaggedSymbol + ) - sig { override.returns(T::Array[Symbol]) } + sig do + override + .returns( + T::Array[FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::EmployeeDeduction::TaggedSymbol] + ) + end def self.values end end - class HsaContributionLimit < FinchAPI::Enum - abstract! + module HsaContributionLimit + extend FinchAPI::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::HsaContributionLimit) + end + OrSymbol = + T.type_alias do + T.any( + Symbol, + FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::HsaContributionLimit::TaggedSymbol + ) + end - INDIVIDUAL = T.let(:individual, T.nilable(Symbol)) - FAMILY = T.let(:family, T.nilable(Symbol)) + INDIVIDUAL = + T.let( + :individual, + FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::HsaContributionLimit::TaggedSymbol + ) + FAMILY = + T.let( + :family, + FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::HsaContributionLimit::TaggedSymbol + ) - sig { override.returns(T::Array[Symbol]) } + sig do + override + .returns( + T::Array[ + FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::HsaContributionLimit::TaggedSymbol + ] + ) + end def self.values end end diff --git a/rbi/lib/finch-api/models/hris/benefit_frequency.rbi b/rbi/lib/finch-api/models/hris/benefit_frequency.rbi index ccd5d033..cfec91c8 100644 --- a/rbi/lib/finch-api/models/hris/benefit_frequency.rbi +++ b/rbi/lib/finch-api/models/hris/benefit_frequency.rbi @@ -3,14 +3,17 @@ module FinchAPI module Models module HRIS - class BenefitFrequency < FinchAPI::Enum - abstract! + module BenefitFrequency + extend FinchAPI::Enum - 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)) + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::BenefitFrequency) } + OrSymbol = T.type_alias { T.any(Symbol, FinchAPI::Models::HRIS::BenefitFrequency::TaggedSymbol) } - sig { override.returns(T::Array[Symbol]) } + ONE_TIME = T.let(:one_time, FinchAPI::Models::HRIS::BenefitFrequency::TaggedSymbol) + EVERY_PAYCHECK = T.let(:every_paycheck, FinchAPI::Models::HRIS::BenefitFrequency::TaggedSymbol) + MONTHLY = T.let(:monthly, FinchAPI::Models::HRIS::BenefitFrequency::TaggedSymbol) + + sig { override.returns(T::Array[FinchAPI::Models::HRIS::BenefitFrequency::TaggedSymbol]) } def self.values 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 index 90e4e917..f0175d26 100644 --- a/rbi/lib/finch-api/models/hris/benefit_list_params.rbi +++ b/rbi/lib/finch-api/models/hris/benefit_list_params.rbi @@ -7,8 +7,15 @@ module FinchAPI 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: {}) + sig do + params( + request_options: T.any( + FinchAPI::RequestOptions, + FinchAPI::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) end sig { override.returns({request_options: FinchAPI::RequestOptions}) } 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 index a37943fb..c9b14062 100644 --- 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 @@ -7,8 +7,15 @@ module FinchAPI 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: {}) + sig do + params( + request_options: T.any( + FinchAPI::RequestOptions, + FinchAPI::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) end sig { override.returns({request_options: FinchAPI::RequestOptions}) } diff --git a/rbi/lib/finch-api/models/hris/benefit_retrieve_params.rbi b/rbi/lib/finch-api/models/hris/benefit_retrieve_params.rbi index 7219ab5d..38b0371d 100644 --- a/rbi/lib/finch-api/models/hris/benefit_retrieve_params.rbi +++ b/rbi/lib/finch-api/models/hris/benefit_retrieve_params.rbi @@ -7,8 +7,15 @@ module FinchAPI 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: {}) + sig do + params( + request_options: T.any( + FinchAPI::RequestOptions, + FinchAPI::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) end sig { override.returns({request_options: FinchAPI::RequestOptions}) } diff --git a/rbi/lib/finch-api/models/hris/benefit_type.rbi b/rbi/lib/finch-api/models/hris/benefit_type.rbi index 98b48853..cd0e2c26 100644 --- a/rbi/lib/finch-api/models/hris/benefit_type.rbi +++ b/rbi/lib/finch-api/models/hris/benefit_type.rbi @@ -3,30 +3,34 @@ module FinchAPI module Models module HRIS - class BenefitType < FinchAPI::Enum - abstract! + # Type of benefit. + module BenefitType + extend FinchAPI::Enum - 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)) + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::BenefitType) } + OrSymbol = T.type_alias { T.any(Symbol, FinchAPI::Models::HRIS::BenefitType::TaggedSymbol) } - sig { override.returns(T::Array[Symbol]) } + NUMBER_401K = T.let(:"401k", FinchAPI::Models::HRIS::BenefitType::TaggedSymbol) + NUMBER_401K_ROTH = T.let(:"401k_roth", FinchAPI::Models::HRIS::BenefitType::TaggedSymbol) + NUMBER_401K_LOAN = T.let(:"401k_loan", FinchAPI::Models::HRIS::BenefitType::TaggedSymbol) + NUMBER_403B = T.let(:"403b", FinchAPI::Models::HRIS::BenefitType::TaggedSymbol) + NUMBER_403B_ROTH = T.let(:"403b_roth", FinchAPI::Models::HRIS::BenefitType::TaggedSymbol) + NUMBER_457 = T.let(:"457", FinchAPI::Models::HRIS::BenefitType::TaggedSymbol) + NUMBER_457_ROTH = T.let(:"457_roth", FinchAPI::Models::HRIS::BenefitType::TaggedSymbol) + S125_MEDICAL = T.let(:s125_medical, FinchAPI::Models::HRIS::BenefitType::TaggedSymbol) + S125_DENTAL = T.let(:s125_dental, FinchAPI::Models::HRIS::BenefitType::TaggedSymbol) + S125_VISION = T.let(:s125_vision, FinchAPI::Models::HRIS::BenefitType::TaggedSymbol) + HSA_PRE = T.let(:hsa_pre, FinchAPI::Models::HRIS::BenefitType::TaggedSymbol) + HSA_POST = T.let(:hsa_post, FinchAPI::Models::HRIS::BenefitType::TaggedSymbol) + FSA_MEDICAL = T.let(:fsa_medical, FinchAPI::Models::HRIS::BenefitType::TaggedSymbol) + FSA_DEPENDENT_CARE = T.let(:fsa_dependent_care, FinchAPI::Models::HRIS::BenefitType::TaggedSymbol) + SIMPLE_IRA = T.let(:simple_ira, FinchAPI::Models::HRIS::BenefitType::TaggedSymbol) + SIMPLE = T.let(:simple, FinchAPI::Models::HRIS::BenefitType::TaggedSymbol) + COMMUTER = T.let(:commuter, FinchAPI::Models::HRIS::BenefitType::TaggedSymbol) + CUSTOM_POST_TAX = T.let(:custom_post_tax, FinchAPI::Models::HRIS::BenefitType::TaggedSymbol) + CUSTOM_PRE_TAX = T.let(:custom_pre_tax, FinchAPI::Models::HRIS::BenefitType::TaggedSymbol) + + sig { override.returns(T::Array[FinchAPI::Models::HRIS::BenefitType::TaggedSymbol]) } def self.values 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 index 58f79cb6..3b5343a9 100644 --- a/rbi/lib/finch-api/models/hris/benefit_update_params.rbi +++ b/rbi/lib/finch-api/models/hris/benefit_update_params.rbi @@ -7,25 +7,21 @@ module FinchAPI extend FinchAPI::RequestParameters::Converter include FinchAPI::RequestParameters + # Updated name or description. sig { returns(T.nilable(String)) } - def description - end + attr_reader :description - sig { params(_: String).returns(String) } - def description=(_) - end + sig { params(description: String).void } + attr_writer :description sig do params( description: String, - request_options: T.any( - FinchAPI::RequestOptions, - T::Hash[Symbol, T.anything] - ) + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) ) - .void + .returns(T.attached_class) end - def initialize(description: nil, request_options: {}) + def self.new(description: nil, request_options: {}) end sig { override.returns({description: String, request_options: FinchAPI::RequestOptions}) } diff --git a/rbi/lib/finch-api/models/hris/benefits/enrolled_individual.rbi b/rbi/lib/finch-api/models/hris/benefits/enrolled_individual.rbi index d814a30e..965d62f4 100644 --- a/rbi/lib/finch-api/models/hris/benefits/enrolled_individual.rbi +++ b/rbi/lib/finch-api/models/hris/benefits/enrolled_individual.rbi @@ -6,81 +6,69 @@ module FinchAPI module Benefits class EnrolledIndividual < FinchAPI::BaseModel sig { returns(T.nilable(FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Body)) } - def body - end + attr_reader :body sig do - params(_: FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Body) - .returns(FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Body) - end - def body=(_) + params(body: T.any(FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Body, FinchAPI::Util::AnyHash)) + .void end + attr_writer :body - sig { returns(T.nilable(Integer)) } - def code - end + # HTTP status code. Either 201 or 200 + sig { returns(T.nilable(FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Code::TaggedInteger)) } + attr_reader :code - sig { params(_: Integer).returns(Integer) } - def code=(_) - end + sig { params(code: FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Code::OrInteger).void } + attr_writer :code sig { returns(T.nilable(String)) } - def individual_id - end + attr_reader :individual_id - sig { params(_: String).returns(String) } - def individual_id=(_) - end + sig { params(individual_id: String).void } + attr_writer :individual_id sig do params( - body: FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Body, - code: Integer, + body: T.any(FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Body, FinchAPI::Util::AnyHash), + code: FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Code::OrInteger, individual_id: String ) - .void + .returns(T.attached_class) end - def initialize(body: nil, code: nil, individual_id: nil) + def self.new(body: nil, code: nil, individual_id: nil) end sig do override .returns( - {body: FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Body, code: Integer, individual_id: String} + { + body: FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Body, + code: FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Code::TaggedInteger, + individual_id: String + } ) end def to_hash end class Body < FinchAPI::BaseModel + # A descriptive identifier for the response sig { returns(T.nilable(String)) } - def finch_code - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def finch_code=(_) - end + attr_accessor :finch_code + # Short description in English that provides more information about the response. sig { returns(T.nilable(String)) } - def message - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def message=(_) - end + attr_accessor :message + # Identifier indicating whether the benefit was newly enrolled or updated. sig { returns(T.nilable(String)) } - def name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def name=(_) - end + attr_accessor :name sig do - params(finch_code: T.nilable(String), message: T.nilable(String), name: T.nilable(String)).void + params(finch_code: T.nilable(String), message: T.nilable(String), name: T.nilable(String)) + .returns(T.attached_class) end - def initialize(finch_code: nil, message: nil, name: nil) + def self.new(finch_code: nil, message: nil, name: nil) end sig do @@ -96,15 +84,21 @@ module FinchAPI end end - class Code < FinchAPI::Enum - abstract! + # HTTP status code. Either 201 or 200 + module Code + extend FinchAPI::Enum + + TaggedInteger = + T.type_alias { T.all(Integer, FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Code) } + OrInteger = + T.type_alias { T.any(Integer, FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Code::TaggedInteger) } - OK = 200 - CREATED = 201 - NOT_FOUND = 404 - FORBIDDEN = 403 + OK = T.let(200, FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Code::TaggedInteger) + CREATED = T.let(201, FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Code::TaggedInteger) + NOT_FOUND = T.let(404, FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Code::TaggedInteger) + FORBIDDEN = T.let(403, FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Code::TaggedInteger) - sig { override.returns(T::Array[Integer]) } + sig { override.returns(T::Array[FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Code::TaggedInteger]) } def self.values 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 index 8121a4a0..c481e71e 100644 --- a/rbi/lib/finch-api/models/hris/benefits/individual_benefit.rbi +++ b/rbi/lib/finch-api/models/hris/benefits/individual_benefit.rbi @@ -3,46 +3,38 @@ 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 + attr_reader :body sig do - params(_: FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body) - .returns(FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body) - end - def body=(_) + params(body: T.any(FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body, FinchAPI::Util::AnyHash)) + .void end + attr_writer :body sig { returns(T.nilable(Integer)) } - def code - end + attr_reader :code - sig { params(_: Integer).returns(Integer) } - def code=(_) - end + sig { params(code: Integer).void } + attr_writer :code sig { returns(T.nilable(String)) } - def individual_id - end + attr_reader :individual_id - sig { params(_: String).returns(String) } - def individual_id=(_) - end + sig { params(individual_id: String).void } + attr_writer :individual_id sig do params( - body: FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body, + body: T.any(FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body, FinchAPI::Util::AnyHash), code: Integer, individual_id: String ) - .void + .returns(T.attached_class) end - def initialize(body: nil, code: nil, individual_id: nil) + def self.new(body: nil, code: nil, individual_id: nil) end sig do @@ -55,63 +47,56 @@ module FinchAPI end class Body < FinchAPI::BaseModel + # If the benefit supports annual maximum, the amount in cents for this individual. sig { returns(T.nilable(Integer)) } - def annual_maximum - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def annual_maximum=(_) - end + attr_accessor :annual_maximum + # If the benefit supports catch up (401k, 403b, etc.), whether catch up is enabled + # for this individual. 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 + attr_accessor :catch_up sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitContribution)) } - def company_contribution - end + attr_reader :company_contribution sig do - params(_: T.nilable(FinchAPI::Models::HRIS::BenefitContribution)) - .returns(T.nilable(FinchAPI::Models::HRIS::BenefitContribution)) - end - def company_contribution=(_) + params( + company_contribution: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitContribution, FinchAPI::Util::AnyHash)) + ) + .void end + attr_writer :company_contribution sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitContribution)) } - def employee_deduction - end + attr_reader :employee_deduction 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 + params( + employee_deduction: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitContribution, FinchAPI::Util::AnyHash)) + ) + .void end + attr_writer :employee_deduction - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def hsa_contribution_limit=(_) + # Type for HSA contribution limit if the benefit is a HSA. + sig do + returns( + T.nilable(FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::HsaContributionLimit::TaggedSymbol) + ) end + attr_accessor :hsa_contribution_limit 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) + company_contribution: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitContribution, FinchAPI::Util::AnyHash)), + employee_deduction: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitContribution, FinchAPI::Util::AnyHash)), + hsa_contribution_limit: T.nilable(FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::HsaContributionLimit::OrSymbol) ) - .void + .returns(T.attached_class) end - def initialize( + def self.new( annual_maximum: nil, catch_up: nil, company_contribution: nil, @@ -128,26 +113,52 @@ module FinchAPI 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) + hsa_contribution_limit: T.nilable(FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::HsaContributionLimit::TaggedSymbol) } ) end def to_hash end - class HsaContributionLimit < FinchAPI::Enum - abstract! - - INDIVIDUAL = T.let(:individual, T.nilable(Symbol)) - FAMILY = T.let(:family, T.nilable(Symbol)) + # Type for HSA contribution limit if the benefit is a HSA. + module HsaContributionLimit + extend FinchAPI::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::HsaContributionLimit) } + OrSymbol = + T.type_alias do + T.any( + Symbol, + FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::HsaContributionLimit::TaggedSymbol + ) + end + + INDIVIDUAL = + T.let( + :individual, + FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::HsaContributionLimit::TaggedSymbol + ) + FAMILY = + T.let( + :family, + FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::HsaContributionLimit::TaggedSymbol + ) - sig { override.returns(T::Array[Symbol]) } + sig do + override + .returns( + T::Array[FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::HsaContributionLimit::TaggedSymbol] + ) + end def self.values end end end end end + + IndividualBenefit = Benefits::IndividualBenefit 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 index a5eedd15..7a911dca 100644 --- 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 @@ -8,25 +8,26 @@ module FinchAPI extend FinchAPI::RequestParameters::Converter include FinchAPI::RequestParameters + # Array of the individual_id to enroll and a configuration object. sig { returns(T.nilable(T::Array[FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual])) } - def individuals - end + attr_reader :individuals sig do - params(_: T::Array[FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual]) - .returns(T::Array[FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual]) - end - def individuals=(_) + params( + individuals: T::Array[T.any(FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual, FinchAPI::Util::AnyHash)] + ) + .void end + attr_writer :individuals sig do params( - individuals: T::Array[FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual], - request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + individuals: T::Array[T.any(FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual, FinchAPI::Util::AnyHash)], + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) ) - .void + .returns(T.attached_class) end - def initialize(individuals: nil, request_options: {}) + def self.new(individuals: nil, request_options: {}) end sig do @@ -47,32 +48,37 @@ module FinchAPI T.nilable(FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration) ) end - def configuration - end + attr_reader :configuration sig do - params(_: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration) - .returns(FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration) - end - def configuration=(_) + params( + configuration: T.any( + FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration, + FinchAPI::Util::AnyHash + ) + ) + .void end + attr_writer :configuration + # Finch id (uuidv4) for the individual to enroll sig { returns(T.nilable(String)) } - def individual_id - end + attr_reader :individual_id - sig { params(_: String).returns(String) } - def individual_id=(_) - end + sig { params(individual_id: String).void } + attr_writer :individual_id sig do params( - configuration: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration, + configuration: T.any( + FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration, + FinchAPI::Util::AnyHash + ), individual_id: String ) - .void + .returns(T.attached_class) end - def initialize(configuration: nil, individual_id: nil) + def self.new(configuration: nil, individual_id: nil) end sig do @@ -88,29 +94,35 @@ module FinchAPI end class Configuration < FinchAPI::BaseModel - sig { returns(T.nilable(Symbol)) } - def annual_contribution_limit + # For HSA benefits only - whether the contribution limit is for an individual or + # family + sig do + returns( + T.nilable( + FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::AnnualContributionLimit::OrSymbol + ) + ) end + attr_reader :annual_contribution_limit - sig { params(_: Symbol).returns(Symbol) } - def annual_contribution_limit=(_) + sig do + params( + annual_contribution_limit: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::AnnualContributionLimit::OrSymbol + ) + .void end + attr_writer :annual_contribution_limit + # Maximum annual amount in cents sig { returns(T.nilable(Integer)) } - def annual_maximum - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def annual_maximum=(_) - end + attr_accessor :annual_maximum + # For retirement benefits only - whether catch up contributions are enabled sig { returns(T.nilable(T::Boolean)) } - def catch_up - end + attr_reader :catch_up - sig { params(_: T::Boolean).returns(T::Boolean) } - def catch_up=(_) - end + sig { params(catch_up: T::Boolean).void } + attr_writer :catch_up sig do returns( @@ -119,19 +131,18 @@ module FinchAPI ) ) end - def company_contribution - end + attr_reader :company_contribution sig do params( - _: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution - ) - .returns( - FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution + company_contribution: T.any( + FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution, + FinchAPI::Util::AnyHash ) + ) + .void end - def company_contribution=(_) - end + attr_writer :company_contribution sig do returns( @@ -140,31 +151,36 @@ module FinchAPI ) ) end - def employee_deduction - end + attr_reader :employee_deduction sig do params( - _: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction - ) - .returns( - FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction + employee_deduction: T.any( + FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction, + FinchAPI::Util::AnyHash ) + ) + .void end - def employee_deduction=(_) - end + attr_writer :employee_deduction sig do params( - annual_contribution_limit: Symbol, + annual_contribution_limit: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::AnnualContributionLimit::OrSymbol, 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 + company_contribution: T.any( + FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution, + FinchAPI::Util::AnyHash + ), + employee_deduction: T.any( + FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction, + FinchAPI::Util::AnyHash + ) ) - .void + .returns(T.attached_class) end - def initialize( + def self.new( annual_contribution_limit: nil, annual_maximum: nil, catch_up: nil, @@ -177,7 +193,7 @@ module FinchAPI override .returns( { - annual_contribution_limit: Symbol, + annual_contribution_limit: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::AnnualContributionLimit::OrSymbol, annual_maximum: T.nilable(Integer), catch_up: T::Boolean, company_contribution: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution, @@ -188,86 +204,215 @@ module FinchAPI def to_hash end - class AnnualContributionLimit < FinchAPI::Enum - abstract! + # For HSA benefits only - whether the contribution limit is for an individual or + # family + module AnnualContributionLimit + extend FinchAPI::Enum - INDIVIDUAL = :individual - FAMILY = :family + TaggedSymbol = + T.type_alias do + T.all(Symbol, FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::AnnualContributionLimit) + end + OrSymbol = + T.type_alias do + T.any( + Symbol, + FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::AnnualContributionLimit::TaggedSymbol + ) + end + + INDIVIDUAL = + T.let( + :individual, + FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::AnnualContributionLimit::TaggedSymbol + ) + FAMILY = + T.let( + :family, + FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::AnnualContributionLimit::TaggedSymbol + ) - sig { override.returns(T::Array[Symbol]) } + sig do + override + .returns( + T::Array[ + FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::AnnualContributionLimit::TaggedSymbol + ] + ) + end def self.values end end class CompanyContribution < FinchAPI::BaseModel + # Amount in cents for fixed type or basis points (1/100th of a percent) for + # percent type sig { returns(T.nilable(Integer)) } - def amount - end + attr_reader :amount - sig { params(_: Integer).returns(Integer) } - def amount=(_) - end + sig { params(amount: Integer).void } + attr_writer :amount - sig { returns(T.nilable(Symbol)) } - def type + sig do + returns( + T.nilable( + FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution::Type::OrSymbol + ) + ) end + attr_reader :type - sig { params(_: Symbol).returns(Symbol) } - def type=(_) + sig do + params( + type: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution::Type::OrSymbol + ) + .void end + attr_writer :type - sig { params(amount: Integer, type: Symbol).void } - def initialize(amount: nil, type: nil) + sig do + params( + amount: Integer, + type: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution::Type::OrSymbol + ) + .returns(T.attached_class) + end + def self.new(amount: nil, type: nil) end - sig { override.returns({amount: Integer, type: Symbol}) } + sig do + override + .returns( + { + amount: Integer, + type: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution::Type::OrSymbol + } + ) + end def to_hash end - class Type < FinchAPI::Enum - abstract! - - FIXED = :fixed - PERCENT = :percent - - sig { override.returns(T::Array[Symbol]) } + module Type + extend FinchAPI::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution::Type) + end + OrSymbol = + T.type_alias do + T.any( + Symbol, + FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution::Type::TaggedSymbol + ) + end + + FIXED = + T.let( + :fixed, + FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution::Type::TaggedSymbol + ) + PERCENT = + T.let( + :percent, + FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution::Type::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[ + FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution::Type::TaggedSymbol + ] + ) + end def self.values end end end class EmployeeDeduction < FinchAPI::BaseModel + # Amount in cents for fixed type or basis points (1/100th of a percent) for + # percent type sig { returns(T.nilable(Integer)) } - def amount - end + attr_reader :amount - sig { params(_: Integer).returns(Integer) } - def amount=(_) - end + sig { params(amount: Integer).void } + attr_writer :amount - sig { returns(T.nilable(Symbol)) } - def type + sig do + returns( + T.nilable( + FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction::Type::OrSymbol + ) + ) end + attr_reader :type - sig { params(_: Symbol).returns(Symbol) } - def type=(_) + sig do + params( + type: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction::Type::OrSymbol + ) + .void end + attr_writer :type - sig { params(amount: Integer, type: Symbol).void } - def initialize(amount: nil, type: nil) + sig do + params( + amount: Integer, + type: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction::Type::OrSymbol + ) + .returns(T.attached_class) + end + def self.new(amount: nil, type: nil) end - sig { override.returns({amount: Integer, type: Symbol}) } + sig do + override + .returns( + { + amount: Integer, + type: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction::Type::OrSymbol + } + ) + end def to_hash end - class Type < FinchAPI::Enum - abstract! - - FIXED = :fixed - PERCENT = :percent - - sig { override.returns(T::Array[Symbol]) } + module Type + extend FinchAPI::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction::Type) + end + OrSymbol = + T.type_alias do + T.any( + Symbol, + FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction::Type::TaggedSymbol + ) + end + + FIXED = + T.let( + :fixed, + FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction::Type::TaggedSymbol + ) + PERCENT = + T.let( + :percent, + FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction::Type::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[ + FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction::Type::TaggedSymbol + ] + ) + end def self.values 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 index 9bc56fac..0a8f9470 100644 --- 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 @@ -8,8 +8,15 @@ module FinchAPI 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: {}) + sig do + params( + request_options: T.any( + FinchAPI::RequestOptions, + FinchAPI::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) end sig { override.returns({request_options: FinchAPI::RequestOptions}) } 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 index 403bd593..ef979642 100644 --- 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 @@ -6,23 +6,13 @@ module FinchAPI module Benefits class IndividualEnrolledIDsResponse < FinchAPI::BaseModel sig { returns(String) } - def benefit_id - end - - sig { params(_: String).returns(String) } - def benefit_id=(_) - end + attr_accessor :benefit_id sig { returns(T::Array[String]) } - def individual_ids - end - - sig { params(_: T::Array[String]).returns(T::Array[String]) } - def individual_ids=(_) - end + attr_accessor :individual_ids - sig { params(benefit_id: String, individual_ids: T::Array[String]).void } - def initialize(benefit_id:, individual_ids:) + sig { params(benefit_id: String, individual_ids: T::Array[String]).returns(T.attached_class) } + def self.new(benefit_id:, individual_ids:) end sig { override.returns({benefit_id: String, individual_ids: T::Array[String]}) } 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 index 8f9e56fa..650ad7c8 100644 --- 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 @@ -8,22 +8,25 @@ module FinchAPI extend FinchAPI::RequestParameters::Converter include FinchAPI::RequestParameters + # comma-delimited list of stable Finch uuids for each individual. If empty, + # defaults to all individuals sig { returns(T.nilable(String)) } - def individual_ids - end + attr_reader :individual_ids - sig { params(_: String).returns(String) } - def individual_ids=(_) - end + sig { params(individual_ids: String).void } + attr_writer :individual_ids sig do params( individual_ids: String, - request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + request_options: T.any( + FinchAPI::RequestOptions, + FinchAPI::Util::AnyHash + ) ) - .void + .returns(T.attached_class) end - def initialize(individual_ids: nil, request_options: {}) + def self.new(individual_ids: nil, request_options: {}) end sig { override.returns({individual_ids: String, request_options: FinchAPI::RequestOptions}) } 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 index 54f6a304..9a5bc734 100644 --- 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 @@ -8,22 +8,21 @@ module FinchAPI extend FinchAPI::RequestParameters::Converter include FinchAPI::RequestParameters + # Array of individual_ids to unenroll. sig { returns(T.nilable(T::Array[String])) } - def individual_ids - end + attr_reader :individual_ids - sig { params(_: T::Array[String]).returns(T::Array[String]) } - def individual_ids=(_) - end + sig { params(individual_ids: T::Array[String]).void } + attr_writer :individual_ids sig do params( individual_ids: T::Array[String], - request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) ) - .void + .returns(T.attached_class) end - def initialize(individual_ids: nil, request_options: {}) + def self.new(individual_ids: nil, request_options: {}) end sig do diff --git a/rbi/lib/finch-api/models/hris/benefits/unenrolled_individual.rbi b/rbi/lib/finch-api/models/hris/benefits/unenrolled_individual.rbi index dd3d1062..5a8206ce 100644 --- a/rbi/lib/finch-api/models/hris/benefits/unenrolled_individual.rbi +++ b/rbi/lib/finch-api/models/hris/benefits/unenrolled_individual.rbi @@ -6,41 +6,36 @@ module FinchAPI module Benefits class UnenrolledIndividual < FinchAPI::BaseModel sig { returns(T.nilable(FinchAPI::Models::HRIS::Benefits::UnenrolledIndividual::Body)) } - def body - end + attr_reader :body sig do - params(_: FinchAPI::Models::HRIS::Benefits::UnenrolledIndividual::Body) - .returns(FinchAPI::Models::HRIS::Benefits::UnenrolledIndividual::Body) - end - def body=(_) + params(body: T.any(FinchAPI::Models::HRIS::Benefits::UnenrolledIndividual::Body, FinchAPI::Util::AnyHash)) + .void end + attr_writer :body + # HTTP status code sig { returns(T.nilable(Integer)) } - def code - end + attr_reader :code - sig { params(_: Integer).returns(Integer) } - def code=(_) - end + sig { params(code: Integer).void } + attr_writer :code sig { returns(T.nilable(String)) } - def individual_id - end + attr_reader :individual_id - sig { params(_: String).returns(String) } - def individual_id=(_) - end + sig { params(individual_id: String).void } + attr_writer :individual_id sig do params( - body: FinchAPI::Models::HRIS::Benefits::UnenrolledIndividual::Body, + body: T.any(FinchAPI::Models::HRIS::Benefits::UnenrolledIndividual::Body, FinchAPI::Util::AnyHash), code: Integer, individual_id: String ) - .void + .returns(T.attached_class) end - def initialize(body: nil, code: nil, individual_id: nil) + def self.new(body: nil, code: nil, individual_id: nil) end sig do @@ -53,34 +48,23 @@ module FinchAPI end class Body < FinchAPI::BaseModel + # A descriptive identifier for the response. sig { returns(T.nilable(String)) } - def finch_code - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def finch_code=(_) - end + attr_accessor :finch_code + # Short description in English that provides more information about the response. sig { returns(T.nilable(String)) } - def message - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def message=(_) - end + attr_accessor :message + # Identifier indicating whether the benefit was newly enrolled or updated. sig { returns(T.nilable(String)) } - def name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def name=(_) - end + attr_accessor :name sig do - params(finch_code: T.nilable(String), message: T.nilable(String), name: T.nilable(String)).void + params(finch_code: T.nilable(String), message: T.nilable(String), name: T.nilable(String)) + .returns(T.attached_class) end - def initialize(finch_code: nil, message: nil, name: nil) + def self.new(finch_code: nil, message: nil, name: nil) end sig do diff --git a/rbi/lib/finch-api/models/hris/benefits_support.rbi b/rbi/lib/finch-api/models/hris/benefits_support.rbi index 4bd2a008..0394d2d9 100644 --- a/rbi/lib/finch-api/models/hris/benefits_support.rbi +++ b/rbi/lib/finch-api/models/hris/benefits_support.rbi @@ -5,155 +5,157 @@ module FinchAPI module HRIS class BenefitsSupport < FinchAPI::BaseModel sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) } - def commuter - end + attr_reader :commuter sig do - params(_: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) - .returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) - end - def commuter=(_) + params( + commuter: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Util::AnyHash)) + ) + .void end + attr_writer :commuter sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) } - def custom_post_tax - end + attr_reader :custom_post_tax sig do - params(_: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) - .returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) - end - def custom_post_tax=(_) + params( + custom_post_tax: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Util::AnyHash)) + ) + .void end + attr_writer :custom_post_tax sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) } - def custom_pre_tax - end + attr_reader :custom_pre_tax sig do - params(_: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) - .returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) - end - def custom_pre_tax=(_) + params( + custom_pre_tax: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Util::AnyHash)) + ) + .void end + attr_writer :custom_pre_tax sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) } - def fsa_dependent_care - end + attr_reader :fsa_dependent_care sig do - params(_: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) - .returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) - end - def fsa_dependent_care=(_) + params( + fsa_dependent_care: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Util::AnyHash)) + ) + .void end + attr_writer :fsa_dependent_care sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) } - def fsa_medical - end + attr_reader :fsa_medical sig do - params(_: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) - .returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) - end - def fsa_medical=(_) + params( + fsa_medical: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Util::AnyHash)) + ) + .void end + attr_writer :fsa_medical sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) } - def hsa_post - end + attr_reader :hsa_post sig do - params(_: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) - .returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) - end - def hsa_post=(_) + params( + hsa_post: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Util::AnyHash)) + ) + .void end + attr_writer :hsa_post sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) } - def hsa_pre - end + attr_reader :hsa_pre sig do - params(_: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) - .returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) - end - def hsa_pre=(_) + params( + hsa_pre: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Util::AnyHash)) + ) + .void end + attr_writer :hsa_pre sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) } - def s125_dental - end + attr_reader :s125_dental sig do - params(_: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) - .returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) - end - def s125_dental=(_) + params( + s125_dental: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Util::AnyHash)) + ) + .void end + attr_writer :s125_dental sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) } - def s125_medical - end + attr_reader :s125_medical sig do - params(_: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) - .returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) - end - def s125_medical=(_) + params( + s125_medical: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Util::AnyHash)) + ) + .void end + attr_writer :s125_medical sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) } - def s125_vision - end + attr_reader :s125_vision sig do - params(_: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) - .returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) - end - def s125_vision=(_) + params( + s125_vision: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Util::AnyHash)) + ) + .void end + attr_writer :s125_vision sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) } - def simple - end + attr_reader :simple sig do - params(_: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) - .returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) - end - def simple=(_) + params( + simple: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Util::AnyHash)) + ) + .void end + attr_writer :simple sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) } - def simple_ira - end + attr_reader :simple_ira sig do - params(_: T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) - .returns(T.nilable(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations)) - end - def simple_ira=(_) + params( + simple_ira: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Util::AnyHash)) + ) + .void end + attr_writer :simple_ira + # Each benefit type and their supported features. If the benefit type is not + # supported, the property will be null 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) + commuter: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Util::AnyHash)), + custom_post_tax: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Util::AnyHash)), + custom_pre_tax: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Util::AnyHash)), + fsa_dependent_care: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Util::AnyHash)), + fsa_medical: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Util::AnyHash)), + hsa_post: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Util::AnyHash)), + hsa_pre: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Util::AnyHash)), + s125_dental: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Util::AnyHash)), + s125_medical: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Util::AnyHash)), + s125_vision: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Util::AnyHash)), + simple: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Util::AnyHash)), + simple_ira: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitFeaturesAndOperations, FinchAPI::Util::AnyHash)) ) - .void + .returns(T.attached_class) end - def initialize( + def self.new( commuter: nil, custom_post_tax: nil, custom_pre_tax: nil, diff --git a/rbi/lib/finch-api/models/hris/benfit_contribution.rbi b/rbi/lib/finch-api/models/hris/benfit_contribution.rbi index 19833876..29f3346f 100644 --- a/rbi/lib/finch-api/models/hris/benfit_contribution.rbi +++ b/rbi/lib/finch-api/models/hris/benfit_contribution.rbi @@ -3,7 +3,7 @@ module FinchAPI module Models module HRIS - BenfitContribution = T.type_alias { FinchAPI::Models::HRIS::BenefitContribution } + BenfitContribution = 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 index a07708a8..1309816e 100644 --- a/rbi/lib/finch-api/models/hris/company.rbi +++ b/rbi/lib/finch-api/models/hris/company.rbi @@ -4,105 +4,61 @@ module FinchAPI module Models module HRIS class HRISCompany < FinchAPI::BaseModel + # A stable Finch `id` (UUID v4) for the company. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id + # An array of bank account objects associated with the payroll/HRIS system. 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 + attr_accessor :accounts + # The array of company departments. 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 + attr_accessor :departments + # The employer identification number. sig { returns(T.nilable(String)) } - def ein - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def ein=(_) - end + attr_accessor :ein + # The entity type object. sig { returns(T.nilable(FinchAPI::Models::HRIS::HRISCompany::Entity)) } - def entity - end + attr_reader :entity - sig do - params(_: T.nilable(FinchAPI::Models::HRIS::HRISCompany::Entity)) - .returns(T.nilable(FinchAPI::Models::HRIS::HRISCompany::Entity)) - end - def entity=(_) - end + sig { params(entity: T.nilable(T.any(FinchAPI::Models::HRIS::HRISCompany::Entity, FinchAPI::Util::AnyHash))).void } + attr_writer :entity + # The legal name of the company. sig { returns(T.nilable(String)) } - def legal_name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def legal_name=(_) - end + attr_accessor :legal_name 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 + attr_accessor :locations + # The email of the main administrator on the account. sig { returns(T.nilable(String)) } - def primary_email - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def primary_email=(_) - end + attr_accessor :primary_email + # The phone number of the main administrator on the account. Format: `XXXXXXXXXX` sig { returns(T.nilable(String)) } - def primary_phone_number - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def primary_phone_number=(_) - end + attr_accessor :primary_phone_number 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)]), + accounts: T.nilable(T::Array[T.any(FinchAPI::Models::HRIS::HRISCompany::Account, FinchAPI::Util::AnyHash)]), + departments: T.nilable( + T::Array[T.nilable(T.any(FinchAPI::Models::HRIS::HRISCompany::Department, FinchAPI::Util::AnyHash))] + ), ein: T.nilable(String), - entity: T.nilable(FinchAPI::Models::HRIS::HRISCompany::Entity), + entity: T.nilable(T.any(FinchAPI::Models::HRIS::HRISCompany::Entity, FinchAPI::Util::AnyHash)), legal_name: T.nilable(String), - locations: T.nilable(T::Array[T.nilable(FinchAPI::Models::Location)]), + locations: T.nilable(T::Array[T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Util::AnyHash))]), primary_email: T.nilable(String), primary_phone_number: T.nilable(String) ) - .void + .returns(T.attached_class) end - def initialize( + def self.new( id:, accounts:, departments:, @@ -135,63 +91,38 @@ module FinchAPI end class Account < FinchAPI::BaseModel + # The name of the bank associated in the payroll/HRIS system. sig { returns(T.nilable(String)) } - def account_name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def account_name=(_) - end + attr_accessor :account_name + # 10-12 digit number to specify the bank account sig { returns(T.nilable(String)) } - def account_number - end + attr_accessor :account_number - 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 + # The type of bank account. + sig { returns(T.nilable(FinchAPI::Models::HRIS::HRISCompany::Account::AccountType::TaggedSymbol)) } + attr_accessor :account_type + # Name of the banking institution. sig { returns(T.nilable(String)) } - def institution_name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def institution_name=(_) - end + attr_accessor :institution_name + # A nine-digit code that's based on the U.S. Bank location where your account was + # opened. sig { returns(T.nilable(String)) } - def routing_number - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def routing_number=(_) - end + attr_accessor :routing_number sig do params( account_name: T.nilable(String), account_number: T.nilable(String), - account_type: T.nilable(Symbol), + account_type: T.nilable(FinchAPI::Models::HRIS::HRISCompany::Account::AccountType::OrSymbol), institution_name: T.nilable(String), routing_number: T.nilable(String) ) - .void + .returns(T.attached_class) end - def initialize( - account_name: nil, - account_number: nil, - account_type: nil, - institution_name: nil, - routing_number: nil - ) + def self.new(account_name: nil, account_number: nil, account_type: nil, institution_name: nil, routing_number: nil) end sig do @@ -200,7 +131,7 @@ module FinchAPI { account_name: T.nilable(String), account_number: T.nilable(String), - account_type: T.nilable(Symbol), + account_type: T.nilable(FinchAPI::Models::HRIS::HRISCompany::Account::AccountType::TaggedSymbol), institution_name: T.nilable(String), routing_number: T.nilable(String) } @@ -209,46 +140,48 @@ module FinchAPI def to_hash end - class AccountType < FinchAPI::Enum - abstract! + # The type of bank account. + module AccountType + extend FinchAPI::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::HRISCompany::Account::AccountType) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::HRIS::HRISCompany::Account::AccountType::TaggedSymbol) } - CHECKING = T.let(:checking, T.nilable(Symbol)) - SAVINGS = T.let(:savings, T.nilable(Symbol)) + CHECKING = T.let(:checking, FinchAPI::Models::HRIS::HRISCompany::Account::AccountType::TaggedSymbol) + SAVINGS = T.let(:savings, FinchAPI::Models::HRIS::HRISCompany::Account::AccountType::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig { override.returns(T::Array[FinchAPI::Models::HRIS::HRISCompany::Account::AccountType::TaggedSymbol]) } def self.values end end end class Department < FinchAPI::BaseModel + # The department name. sig { returns(T.nilable(String)) } - def name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def name=(_) - end + attr_accessor :name + # The parent department, if present. sig { returns(T.nilable(FinchAPI::Models::HRIS::HRISCompany::Department::Parent)) } - def parent - end + attr_reader :parent sig do - params(_: T.nilable(FinchAPI::Models::HRIS::HRISCompany::Department::Parent)) - .returns(T.nilable(FinchAPI::Models::HRIS::HRISCompany::Department::Parent)) - end - def parent=(_) + params( + parent: T.nilable(T.any(FinchAPI::Models::HRIS::HRISCompany::Department::Parent, FinchAPI::Util::AnyHash)) + ) + .void end + attr_writer :parent sig do params( name: T.nilable(String), - parent: T.nilable(FinchAPI::Models::HRIS::HRISCompany::Department::Parent) + parent: T.nilable(T.any(FinchAPI::Models::HRIS::HRISCompany::Department::Parent, FinchAPI::Util::AnyHash)) ) - .void + .returns(T.attached_class) end - def initialize(name: nil, parent: nil) + def self.new(name: nil, parent: nil) end sig do @@ -261,16 +194,13 @@ module FinchAPI end class Parent < FinchAPI::BaseModel + # The parent department's name. sig { returns(T.nilable(String)) } - def name - end + attr_accessor :name - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def name=(_) - end - - sig { params(name: T.nilable(String)).void } - def initialize(name: nil) + # The parent department, if present. + sig { params(name: T.nilable(String)).returns(T.attached_class) } + def self.new(name: nil) end sig { override.returns({name: T.nilable(String)}) } @@ -280,54 +210,72 @@ module FinchAPI end class Entity < FinchAPI::BaseModel - sig { returns(T.nilable(Symbol)) } - def subtype - end + # The tax payer subtype of the company. + sig { returns(T.nilable(FinchAPI::Models::HRIS::HRISCompany::Entity::Subtype::TaggedSymbol)) } + attr_accessor :subtype - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def subtype=(_) - end + # The tax payer type of the company. + sig { returns(T.nilable(FinchAPI::Models::HRIS::HRISCompany::Entity::Type::TaggedSymbol)) } + attr_accessor :type - sig { returns(T.nilable(Symbol)) } - def type + # The entity type object. + sig do + params( + subtype: T.nilable(FinchAPI::Models::HRIS::HRISCompany::Entity::Subtype::OrSymbol), + type: T.nilable(FinchAPI::Models::HRIS::HRISCompany::Entity::Type::OrSymbol) + ) + .returns(T.attached_class) end - - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def type=(_) + def self.new(subtype: nil, type: nil) end - sig { params(subtype: T.nilable(Symbol), type: T.nilable(Symbol)).void } - def initialize(subtype: nil, type: nil) + sig do + override + .returns( + { + subtype: T.nilable(FinchAPI::Models::HRIS::HRISCompany::Entity::Subtype::TaggedSymbol), + type: T.nilable(FinchAPI::Models::HRIS::HRISCompany::Entity::Type::TaggedSymbol) + } + ) end - - sig { override.returns({subtype: T.nilable(Symbol), type: T.nilable(Symbol)}) } def to_hash end - class Subtype < FinchAPI::Enum - abstract! + # The tax payer subtype of the company. + module Subtype + extend FinchAPI::Enum - 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)) + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::HRISCompany::Entity::Subtype) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::HRIS::HRISCompany::Entity::Subtype::TaggedSymbol) } - sig { override.returns(T::Array[Symbol]) } + S_CORPORATION = T.let(:s_corporation, FinchAPI::Models::HRIS::HRISCompany::Entity::Subtype::TaggedSymbol) + C_CORPORATION = T.let(:c_corporation, FinchAPI::Models::HRIS::HRISCompany::Entity::Subtype::TaggedSymbol) + B_CORPORATION = T.let(:b_corporation, FinchAPI::Models::HRIS::HRISCompany::Entity::Subtype::TaggedSymbol) + + sig { override.returns(T::Array[FinchAPI::Models::HRIS::HRISCompany::Entity::Subtype::TaggedSymbol]) } def self.values end end - class Type < FinchAPI::Enum - abstract! + # The tax payer type of the company. + module Type + extend FinchAPI::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::HRISCompany::Entity::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::HRIS::HRISCompany::Entity::Type::TaggedSymbol) } - 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)) + LLC = T.let(:llc, FinchAPI::Models::HRIS::HRISCompany::Entity::Type::TaggedSymbol) + LP = T.let(:lp, FinchAPI::Models::HRIS::HRISCompany::Entity::Type::TaggedSymbol) + CORPORATION = T.let(:corporation, FinchAPI::Models::HRIS::HRISCompany::Entity::Type::TaggedSymbol) + SOLE_PROPRIETOR = + T.let(:sole_proprietor, FinchAPI::Models::HRIS::HRISCompany::Entity::Type::TaggedSymbol) + NON_PROFIT = T.let(:non_profit, FinchAPI::Models::HRIS::HRISCompany::Entity::Type::TaggedSymbol) + PARTNERSHIP = T.let(:partnership, FinchAPI::Models::HRIS::HRISCompany::Entity::Type::TaggedSymbol) + COOPERATIVE = T.let(:cooperative, FinchAPI::Models::HRIS::HRISCompany::Entity::Type::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig { override.returns(T::Array[FinchAPI::Models::HRIS::HRISCompany::Entity::Type::TaggedSymbol]) } def self.values end end diff --git a/rbi/lib/finch-api/models/hris/company_benefit.rbi b/rbi/lib/finch-api/models/hris/company_benefit.rbi index f677e92b..265758ee 100644 --- a/rbi/lib/finch-api/models/hris/company_benefit.rbi +++ b/rbi/lib/finch-api/models/hris/company_benefit.rbi @@ -5,47 +5,28 @@ module FinchAPI module HRIS class CompanyBenefit < FinchAPI::BaseModel sig { returns(String) } - def benefit_id - end - - sig { params(_: String).returns(String) } - def benefit_id=(_) - end + attr_accessor :benefit_id sig { returns(T.nilable(String)) } - def description - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def description=(_) - end + attr_accessor :description - sig { returns(T.nilable(Symbol)) } - def frequency - end - - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def frequency=(_) - end + sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitFrequency::TaggedSymbol)) } + attr_accessor :frequency - sig { returns(T.nilable(Symbol)) } - def type - end - - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def type=(_) - end + # Type of benefit. + sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitType::TaggedSymbol)) } + attr_accessor :type sig do params( benefit_id: String, description: T.nilable(String), - frequency: T.nilable(Symbol), - type: T.nilable(Symbol) + frequency: T.nilable(FinchAPI::Models::HRIS::BenefitFrequency::OrSymbol), + type: T.nilable(FinchAPI::Models::HRIS::BenefitType::OrSymbol) ) - .void + .returns(T.attached_class) end - def initialize(benefit_id:, description:, frequency:, type:) + def self.new(benefit_id:, description:, frequency:, type:) end sig do @@ -54,8 +35,8 @@ module FinchAPI { benefit_id: String, description: T.nilable(String), - frequency: T.nilable(Symbol), - type: T.nilable(Symbol) + frequency: T.nilable(FinchAPI::Models::HRIS::BenefitFrequency::TaggedSymbol), + type: T.nilable(FinchAPI::Models::HRIS::BenefitType::TaggedSymbol) } ) 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 index ebbd2c49..ad51c2bc 100644 --- a/rbi/lib/finch-api/models/hris/company_retrieve_params.rbi +++ b/rbi/lib/finch-api/models/hris/company_retrieve_params.rbi @@ -7,8 +7,15 @@ module FinchAPI 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: {}) + sig do + params( + request_options: T.any( + FinchAPI::RequestOptions, + FinchAPI::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) end sig { override.returns({request_options: FinchAPI::RequestOptions}) } 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 index c397c8b7..5ff70dca 100644 --- a/rbi/lib/finch-api/models/hris/create_company_benefits_response.rbi +++ b/rbi/lib/finch-api/models/hris/create_company_benefits_response.rbi @@ -5,15 +5,10 @@ module FinchAPI module HRIS class CreateCompanyBenefitsResponse < FinchAPI::BaseModel sig { returns(String) } - def benefit_id - end - - sig { params(_: String).returns(String) } - def benefit_id=(_) - end + attr_accessor :benefit_id - sig { params(benefit_id: String).void } - def initialize(benefit_id:) + sig { params(benefit_id: String).returns(T.attached_class) } + def self.new(benefit_id:) end sig { override.returns({benefit_id: String}) } 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 index 1af6722d..b616e087 100644 --- a/rbi/lib/finch-api/models/hris/directory_list_individuals_params.rbi +++ b/rbi/lib/finch-api/models/hris/directory_list_individuals_params.rbi @@ -7,31 +7,29 @@ module FinchAPI extend FinchAPI::RequestParameters::Converter include FinchAPI::RequestParameters + # Number of employees to return (defaults to all) sig { returns(T.nilable(Integer)) } - def limit - end + attr_reader :limit - sig { params(_: Integer).returns(Integer) } - def limit=(_) - end + sig { params(limit: Integer).void } + attr_writer :limit + # Index to start from (defaults to 0) sig { returns(T.nilable(Integer)) } - def offset - end + attr_reader :offset - sig { params(_: Integer).returns(Integer) } - def offset=(_) - end + sig { params(offset: Integer).void } + attr_writer :offset sig do params( limit: Integer, offset: Integer, - request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) ) - .void + .returns(T.attached_class) end - def initialize(limit: nil, offset: nil, request_options: {}) + def self.new(limit: nil, offset: nil, request_options: {}) end sig { override.returns({limit: Integer, offset: Integer, request_options: FinchAPI::RequestOptions}) } diff --git a/rbi/lib/finch-api/models/hris/directory_list_params.rbi b/rbi/lib/finch-api/models/hris/directory_list_params.rbi index f8dc2476..df9594b7 100644 --- a/rbi/lib/finch-api/models/hris/directory_list_params.rbi +++ b/rbi/lib/finch-api/models/hris/directory_list_params.rbi @@ -7,31 +7,29 @@ module FinchAPI extend FinchAPI::RequestParameters::Converter include FinchAPI::RequestParameters + # Number of employees to return (defaults to all) sig { returns(T.nilable(Integer)) } - def limit - end + attr_reader :limit - sig { params(_: Integer).returns(Integer) } - def limit=(_) - end + sig { params(limit: Integer).void } + attr_writer :limit + # Index to start from (defaults to 0) sig { returns(T.nilable(Integer)) } - def offset - end + attr_reader :offset - sig { params(_: Integer).returns(Integer) } - def offset=(_) - end + sig { params(offset: Integer).void } + attr_writer :offset sig do params( limit: Integer, offset: Integer, - request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) ) - .void + .returns(T.attached_class) end - def initialize(limit: nil, offset: nil, request_options: {}) + def self.new(limit: nil, offset: nil, request_options: {}) end sig { override.returns({limit: Integer, offset: Integer, request_options: FinchAPI::RequestOptions}) } diff --git a/rbi/lib/finch-api/models/hris/document_list_params.rbi b/rbi/lib/finch-api/models/hris/document_list_params.rbi index 9f8761d3..1a0660bc 100644 --- a/rbi/lib/finch-api/models/hris/document_list_params.rbi +++ b/rbi/lib/finch-api/models/hris/document_list_params.rbi @@ -7,49 +7,47 @@ module FinchAPI extend FinchAPI::RequestParameters::Converter include FinchAPI::RequestParameters + # Comma-delimited list of stable Finch uuids for each individual. If empty, + # defaults to all individuals sig { returns(T.nilable(T::Array[String])) } - def individual_ids - end + attr_reader :individual_ids - sig { params(_: T::Array[String]).returns(T::Array[String]) } - def individual_ids=(_) - end + sig { params(individual_ids: T::Array[String]).void } + attr_writer :individual_ids + # Number of documents to return (defaults to all) sig { returns(T.nilable(Integer)) } - def limit - end + attr_reader :limit - sig { params(_: Integer).returns(Integer) } - def limit=(_) - end + sig { params(limit: Integer).void } + attr_writer :limit + # Index to start from (defaults to 0) sig { returns(T.nilable(Integer)) } - def offset - end + attr_reader :offset - sig { params(_: Integer).returns(Integer) } - def offset=(_) - end + sig { params(offset: Integer).void } + attr_writer :offset - sig { returns(T.nilable(T::Array[Symbol])) } - def types - end + # Comma-delimited list of document types to filter on. If empty, defaults to all + # types + sig { returns(T.nilable(T::Array[FinchAPI::Models::HRIS::DocumentListParams::Type::OrSymbol])) } + attr_reader :types - sig { params(_: T::Array[Symbol]).returns(T::Array[Symbol]) } - def types=(_) - end + sig { params(types: T::Array[FinchAPI::Models::HRIS::DocumentListParams::Type::OrSymbol]).void } + attr_writer :types 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]) + types: T::Array[FinchAPI::Models::HRIS::DocumentListParams::Type::OrSymbol], + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) ) - .void + .returns(T.attached_class) end - def initialize(individual_ids: nil, limit: nil, offset: nil, types: nil, request_options: {}) + def self.new(individual_ids: nil, limit: nil, offset: nil, types: nil, request_options: {}) end sig do @@ -59,7 +57,7 @@ module FinchAPI individual_ids: T::Array[String], limit: Integer, offset: Integer, - types: T::Array[Symbol], + types: T::Array[FinchAPI::Models::HRIS::DocumentListParams::Type::OrSymbol], request_options: FinchAPI::RequestOptions } ) @@ -67,13 +65,16 @@ module FinchAPI def to_hash end - class Type < FinchAPI::Enum - abstract! + module Type + extend FinchAPI::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::DocumentListParams::Type) } + OrSymbol = T.type_alias { T.any(Symbol, FinchAPI::Models::HRIS::DocumentListParams::Type::TaggedSymbol) } - W4_2020 = :w4_2020 - W4_2005 = :w4_2005 + W4_2020 = T.let(:w4_2020, FinchAPI::Models::HRIS::DocumentListParams::Type::TaggedSymbol) + W4_2005 = T.let(:w4_2005, FinchAPI::Models::HRIS::DocumentListParams::Type::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig { override.returns(T::Array[FinchAPI::Models::HRIS::DocumentListParams::Type::TaggedSymbol]) } def self.values 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 index 29a4abae..4c912a9d 100644 --- a/rbi/lib/finch-api/models/hris/document_list_response.rbi +++ b/rbi/lib/finch-api/models/hris/document_list_response.rbi @@ -5,29 +5,22 @@ module FinchAPI 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 + attr_accessor :documents sig { returns(FinchAPI::Models::Paging) } - def paging - end + attr_reader :paging - sig { params(_: FinchAPI::Models::Paging).returns(FinchAPI::Models::Paging) } - def paging=(_) - end + sig { params(paging: T.any(FinchAPI::Models::Paging, FinchAPI::Util::AnyHash)).void } + attr_writer :paging sig do - params(documents: T::Array[FinchAPI::Models::HRIS::DocumentResponse], paging: FinchAPI::Models::Paging) - .void + params( + documents: T::Array[T.any(FinchAPI::Models::HRIS::DocumentResponse, FinchAPI::Util::AnyHash)], + paging: T.any(FinchAPI::Models::Paging, FinchAPI::Util::AnyHash) + ) + .returns(T.attached_class) end - def initialize(documents:, paging:) + def self.new(documents:, paging:) end sig do diff --git a/rbi/lib/finch-api/models/hris/document_response.rbi b/rbi/lib/finch-api/models/hris/document_response.rbi index bd3fbbf5..431a3dba 100644 --- a/rbi/lib/finch-api/models/hris/document_response.rbi +++ b/rbi/lib/finch-api/models/hris/document_response.rbi @@ -4,79 +4,76 @@ module FinchAPI module Models module HRIS class DocumentResponse < FinchAPI::BaseModel + # A stable Finch id for the document. sig { returns(T.nilable(String)) } - def id - end + attr_reader :id - sig { params(_: String).returns(String) } - def id=(_) - end + sig { params(id: String).void } + attr_writer :id + # The ID of the individual associated with the document. This will be null for + # employer-level documents. sig { returns(T.nilable(String)) } - def individual_id - end + attr_accessor :individual_id - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def individual_id=(_) - end + # The type of document. + sig { returns(T.nilable(FinchAPI::Models::HRIS::DocumentResponse::Type::TaggedSymbol)) } + attr_reader :type - sig { returns(T.nilable(Symbol)) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + sig { params(type: FinchAPI::Models::HRIS::DocumentResponse::Type::OrSymbol).void } + attr_writer :type + # A URL to access the document. Format: + # `https://api.tryfinch.com/employer/documents/:document_id`. sig { returns(T.nilable(String)) } - def url - end + attr_reader :url - sig { params(_: String).returns(String) } - def url=(_) - end + sig { params(url: String).void } + attr_writer :url + # The year the document applies to, if available. sig { returns(T.nilable(Float)) } - def year - end - - sig { params(_: T.nilable(Float)).returns(T.nilable(Float)) } - def year=(_) - end + attr_accessor :year sig do params( id: String, individual_id: T.nilable(String), - type: Symbol, + type: FinchAPI::Models::HRIS::DocumentResponse::Type::OrSymbol, url: String, year: T.nilable(Float) ) - .void + .returns(T.attached_class) end - def initialize(id: nil, individual_id: nil, type: nil, url: nil, year: nil) + def self.new(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) - }) + .returns( + { + id: String, + individual_id: T.nilable(String), + type: FinchAPI::Models::HRIS::DocumentResponse::Type::TaggedSymbol, + url: String, + year: T.nilable(Float) + } + ) end def to_hash end - class Type < FinchAPI::Enum - abstract! + # The type of document. + module Type + extend FinchAPI::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::DocumentResponse::Type) } + OrSymbol = T.type_alias { T.any(Symbol, FinchAPI::Models::HRIS::DocumentResponse::Type::TaggedSymbol) } - W4_2020 = :w4_2020 - W4_2005 = :w4_2005 + W4_2020 = T.let(:w4_2020, FinchAPI::Models::HRIS::DocumentResponse::Type::TaggedSymbol) + W4_2005 = T.let(:w4_2005, FinchAPI::Models::HRIS::DocumentResponse::Type::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig { override.returns(T::Array[FinchAPI::Models::HRIS::DocumentResponse::Type::TaggedSymbol]) } def self.values 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 index ec5025f8..50c4082e 100644 --- a/rbi/lib/finch-api/models/hris/document_retreive_params.rbi +++ b/rbi/lib/finch-api/models/hris/document_retreive_params.rbi @@ -7,8 +7,15 @@ module FinchAPI 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: {}) + sig do + params( + request_options: T.any( + FinchAPI::RequestOptions, + FinchAPI::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) end sig { override.returns({request_options: FinchAPI::RequestOptions}) } diff --git a/rbi/lib/finch-api/models/hris/document_retreive_response.rbi b/rbi/lib/finch-api/models/hris/document_retreive_response.rbi index 526e6ccb..478d82fc 100644 --- a/rbi/lib/finch-api/models/hris/document_retreive_response.rbi +++ b/rbi/lib/finch-api/models/hris/document_retreive_response.rbi @@ -3,11 +3,13 @@ module FinchAPI module Models module HRIS - class DocumentRetreiveResponse < FinchAPI::Union - abstract! + # A 2020 version of the W-4 tax form containing information on an individual's + # filing status, dependents, and withholding details. + module DocumentRetreiveResponse + extend FinchAPI::Union - sig { override.returns([[Symbol, FinchAPI::Models::HRIS::W42020], [Symbol, FinchAPI::Models::HRIS::W42005]]) } - private_class_method def self.variants + sig { override.returns([FinchAPI::Models::HRIS::W42020, FinchAPI::Models::HRIS::W42005]) } + def self.variants 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 index 1c8c47d4..22e9c824 100644 --- a/rbi/lib/finch-api/models/hris/employment_data.rbi +++ b/rbi/lib/finch-api/models/hris/employment_data.rbi @@ -4,207 +4,145 @@ module FinchAPI module Models module HRIS class EmploymentData < FinchAPI::BaseModel + # string A stable Finch `id` (UUID v4) for an individual in the company. sig { returns(T.nilable(String)) } - def id - end + attr_reader :id - sig { params(_: String).returns(String) } - def id=(_) - end + sig { params(id: String).void } + attr_writer :id + # Worker's compensation classification code for this employee sig { returns(T.nilable(String)) } - def class_code - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def class_code=(_) - end + attr_accessor :class_code + # Custom fields for the individual. These are fields which are defined by the + # employer in the system. 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 + attr_accessor :custom_fields + # The department object. sig { returns(T.nilable(FinchAPI::Models::HRIS::EmploymentData::Department)) } - def department - end + attr_reader :department sig do - params(_: T.nilable(FinchAPI::Models::HRIS::EmploymentData::Department)) - .returns(T.nilable(FinchAPI::Models::HRIS::EmploymentData::Department)) - end - def department=(_) + params( + department: T.nilable(T.any(FinchAPI::Models::HRIS::EmploymentData::Department, FinchAPI::Util::AnyHash)) + ) + .void end + attr_writer :department + # The employment object. sig { returns(T.nilable(FinchAPI::Models::HRIS::EmploymentData::Employment)) } - def employment - end + attr_reader :employment 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 + params( + employment: T.nilable(T.any(FinchAPI::Models::HRIS::EmploymentData::Employment, FinchAPI::Util::AnyHash)) + ) + .void end + attr_writer :employment - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def employment_status=(_) - end + # The detailed employment status of the individual. Available options: `active`, + # `deceased`, `leave`, `onboarding`, `prehire`, `retired`, `terminated`. + sig { returns(T.nilable(FinchAPI::Models::HRIS::EmploymentData::EmploymentStatus::TaggedSymbol)) } + attr_accessor :employment_status sig { returns(T.nilable(String)) } - def end_date - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def end_date=(_) - end + attr_accessor :end_date + # The legal first name of the individual. sig { returns(T.nilable(String)) } - def first_name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def first_name=(_) - end + attr_accessor :first_name + # 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. sig { returns(T.nilable(FinchAPI::Models::Income)) } - def income - end + attr_reader :income - sig { params(_: T.nilable(FinchAPI::Models::Income)).returns(T.nilable(FinchAPI::Models::Income)) } - def income=(_) - end + sig { params(income: T.nilable(T.any(FinchAPI::Models::Income, FinchAPI::Util::AnyHash))).void } + attr_writer :income + # The array of income history. 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 + attr_accessor :income_history + # `true` if the individual an an active employee or contractor at the company. 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 + attr_accessor :is_active + # The legal last name of the individual. sig { returns(T.nilable(String)) } - def last_name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def last_name=(_) - end + attr_accessor :last_name sig { returns(T.nilable(String)) } - def latest_rehire_date - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def latest_rehire_date=(_) - end + attr_accessor :latest_rehire_date sig { returns(T.nilable(FinchAPI::Models::Location)) } - def location - end + attr_reader :location - sig { params(_: T.nilable(FinchAPI::Models::Location)).returns(T.nilable(FinchAPI::Models::Location)) } - def location=(_) - end + sig { params(location: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Util::AnyHash))).void } + attr_writer :location + # The manager object representing the manager of the individual within the org. sig { returns(T.nilable(FinchAPI::Models::HRIS::EmploymentData::Manager)) } - def manager - end + attr_reader :manager sig do - params(_: T.nilable(FinchAPI::Models::HRIS::EmploymentData::Manager)) - .returns(T.nilable(FinchAPI::Models::HRIS::EmploymentData::Manager)) - end - def manager=(_) + params( + manager: T.nilable(T.any(FinchAPI::Models::HRIS::EmploymentData::Manager, FinchAPI::Util::AnyHash)) + ) + .void end + attr_writer :manager + # The legal middle name of the individual. sig { returns(T.nilable(String)) } - def middle_name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def middle_name=(_) - end + attr_accessor :middle_name + # The source system's unique employment identifier for this individual sig { returns(T.nilable(String)) } - def source_id - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def source_id=(_) - end + attr_accessor :source_id sig { returns(T.nilable(String)) } - def start_date - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def start_date=(_) - end + attr_accessor :start_date + # The current title of the individual. sig { returns(T.nilable(String)) } - def title - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def title=(_) - end + attr_accessor :title + # This field is deprecated in favour of `source_id` sig { returns(T.nilable(String)) } - def work_id - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def work_id=(_) - end + attr_accessor :work_id 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), + custom_fields: T.nilable(T::Array[T.any(FinchAPI::Models::HRIS::EmploymentData::CustomField, FinchAPI::Util::AnyHash)]), + department: T.nilable(T.any(FinchAPI::Models::HRIS::EmploymentData::Department, FinchAPI::Util::AnyHash)), + employment: T.nilable(T.any(FinchAPI::Models::HRIS::EmploymentData::Employment, FinchAPI::Util::AnyHash)), + employment_status: T.nilable(FinchAPI::Models::HRIS::EmploymentData::EmploymentStatus::OrSymbol), 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)]), + income: T.nilable(T.any(FinchAPI::Models::Income, FinchAPI::Util::AnyHash)), + income_history: T.nilable(T::Array[T.nilable(T.any(FinchAPI::Models::Income, FinchAPI::Util::AnyHash))]), 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), + location: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Util::AnyHash)), + manager: T.nilable(T.any(FinchAPI::Models::HRIS::EmploymentData::Manager, FinchAPI::Util::AnyHash)), 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 + .returns(T.attached_class) end - def initialize( + def self.new( id: nil, class_code: nil, custom_fields: nil, @@ -237,7 +175,7 @@ module FinchAPI 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), + employment_status: T.nilable(FinchAPI::Models::HRIS::EmploymentData::EmploymentStatus::TaggedSymbol), end_date: T.nilable(String), first_name: T.nilable(String), income: T.nilable(FinchAPI::Models::Income), @@ -260,23 +198,19 @@ module FinchAPI class CustomField < FinchAPI::BaseModel sig { returns(T.nilable(String)) } - def name - end + attr_reader :name - sig { params(_: String).returns(String) } - def name=(_) - end + sig { params(name: String).void } + attr_writer :name sig { returns(T.nilable(T.anything)) } - def value - end + attr_reader :value - sig { params(_: T.anything).returns(T.anything) } - def value=(_) - end + sig { params(value: T.anything).void } + attr_writer :value - sig { params(name: String, value: T.anything).void } - def initialize(name: nil, value: nil) + sig { params(name: String, value: T.anything).returns(T.attached_class) } + def self.new(name: nil, value: nil) end sig { override.returns({name: String, value: T.anything}) } @@ -285,16 +219,13 @@ module FinchAPI end class Department < FinchAPI::BaseModel + # The name of the department associated with the individual. sig { returns(T.nilable(String)) } - def name - end + attr_accessor :name - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def name=(_) - end - - sig { params(name: T.nilable(String)).void } - def initialize(name: nil) + # The department object. + sig { params(name: T.nilable(String)).returns(T.attached_class) } + def self.new(name: nil) end sig { override.returns({name: T.nilable(String)}) } @@ -303,84 +234,111 @@ module FinchAPI 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 + # The secondary employment type of the individual. Options: `full_time`, + # `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`. + sig { returns(T.nilable(FinchAPI::Models::HRIS::EmploymentData::Employment::Subtype::TaggedSymbol)) } + attr_accessor :subtype + + # The main employment type of the individual. + sig { returns(T.nilable(FinchAPI::Models::HRIS::EmploymentData::Employment::Type::TaggedSymbol)) } + attr_accessor :type + + # The employment object. + sig do + params( + subtype: T.nilable(FinchAPI::Models::HRIS::EmploymentData::Employment::Subtype::OrSymbol), + type: T.nilable(FinchAPI::Models::HRIS::EmploymentData::Employment::Type::OrSymbol) + ) + .returns(T.attached_class) end - - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def type=(_) + def self.new(subtype: nil, type: nil) end - sig { params(subtype: T.nilable(Symbol), type: T.nilable(Symbol)).void } - def initialize(subtype: nil, type: nil) + sig do + override + .returns( + { + subtype: T.nilable(FinchAPI::Models::HRIS::EmploymentData::Employment::Subtype::TaggedSymbol), + type: T.nilable(FinchAPI::Models::HRIS::EmploymentData::Employment::Type::TaggedSymbol) + } + ) 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]) } + # The secondary employment type of the individual. Options: `full_time`, + # `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`. + module Subtype + extend FinchAPI::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::EmploymentData::Employment::Subtype) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::HRIS::EmploymentData::Employment::Subtype::TaggedSymbol) } + + FULL_TIME = T.let(:full_time, FinchAPI::Models::HRIS::EmploymentData::Employment::Subtype::TaggedSymbol) + INTERN = T.let(:intern, FinchAPI::Models::HRIS::EmploymentData::Employment::Subtype::TaggedSymbol) + PART_TIME = T.let(:part_time, FinchAPI::Models::HRIS::EmploymentData::Employment::Subtype::TaggedSymbol) + TEMP = T.let(:temp, FinchAPI::Models::HRIS::EmploymentData::Employment::Subtype::TaggedSymbol) + SEASONAL = T.let(:seasonal, FinchAPI::Models::HRIS::EmploymentData::Employment::Subtype::TaggedSymbol) + INDIVIDUAL_CONTRACTOR = + T.let(:individual_contractor, FinchAPI::Models::HRIS::EmploymentData::Employment::Subtype::TaggedSymbol) + + sig { override.returns(T::Array[FinchAPI::Models::HRIS::EmploymentData::Employment::Subtype::TaggedSymbol]) } def self.values end end - class Type < FinchAPI::Enum - abstract! + # The main employment type of the individual. + module Type + extend FinchAPI::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::EmploymentData::Employment::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::HRIS::EmploymentData::Employment::Type::TaggedSymbol) } - EMPLOYEE = T.let(:employee, T.nilable(Symbol)) - CONTRACTOR = T.let(:contractor, T.nilable(Symbol)) + EMPLOYEE = T.let(:employee, FinchAPI::Models::HRIS::EmploymentData::Employment::Type::TaggedSymbol) + CONTRACTOR = T.let(:contractor, FinchAPI::Models::HRIS::EmploymentData::Employment::Type::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig { override.returns(T::Array[FinchAPI::Models::HRIS::EmploymentData::Employment::Type::TaggedSymbol]) } def self.values end end end - class EmploymentStatus < FinchAPI::Enum - abstract! + # The detailed employment status of the individual. Available options: `active`, + # `deceased`, `leave`, `onboarding`, `prehire`, `retired`, `terminated`. + module EmploymentStatus + extend FinchAPI::Enum - 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)) + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::EmploymentData::EmploymentStatus) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::HRIS::EmploymentData::EmploymentStatus::TaggedSymbol) } - sig { override.returns(T::Array[Symbol]) } + ACTIVE = T.let(:active, FinchAPI::Models::HRIS::EmploymentData::EmploymentStatus::TaggedSymbol) + DECEASED = T.let(:deceased, FinchAPI::Models::HRIS::EmploymentData::EmploymentStatus::TaggedSymbol) + LEAVE = T.let(:leave, FinchAPI::Models::HRIS::EmploymentData::EmploymentStatus::TaggedSymbol) + ONBOARDING = T.let(:onboarding, FinchAPI::Models::HRIS::EmploymentData::EmploymentStatus::TaggedSymbol) + PREHIRE = T.let(:prehire, FinchAPI::Models::HRIS::EmploymentData::EmploymentStatus::TaggedSymbol) + RETIRED = T.let(:retired, FinchAPI::Models::HRIS::EmploymentData::EmploymentStatus::TaggedSymbol) + TERMINATED = T.let(:terminated, FinchAPI::Models::HRIS::EmploymentData::EmploymentStatus::TaggedSymbol) + + sig { override.returns(T::Array[FinchAPI::Models::HRIS::EmploymentData::EmploymentStatus::TaggedSymbol]) } def self.values end end class Manager < FinchAPI::BaseModel + # A stable Finch `id` (UUID v4) for an individual in the company. sig { returns(T.nilable(String)) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_reader :id sig { params(id: String).void } - def initialize(id: nil) + attr_writer :id + + # The manager object representing the manager of the individual within the org. + sig { params(id: String).returns(T.attached_class) } + def self.new(id: nil) end sig { override.returns({id: String}) } diff --git a/rbi/lib/finch-api/models/hris/employment_data_response.rbi b/rbi/lib/finch-api/models/hris/employment_data_response.rbi index 90a1c460..c4f4ed80 100644 --- a/rbi/lib/finch-api/models/hris/employment_data_response.rbi +++ b/rbi/lib/finch-api/models/hris/employment_data_response.rbi @@ -5,31 +5,32 @@ module FinchAPI module HRIS class EmploymentDataResponse < FinchAPI::BaseModel sig { returns(T.nilable(FinchAPI::Models::HRIS::EmploymentData)) } - def body - end + attr_reader :body - sig { params(_: FinchAPI::Models::HRIS::EmploymentData).returns(FinchAPI::Models::HRIS::EmploymentData) } - def body=(_) - end + sig { params(body: T.any(FinchAPI::Models::HRIS::EmploymentData, FinchAPI::Util::AnyHash)).void } + attr_writer :body sig { returns(T.nilable(Integer)) } - def code - end + attr_reader :code - sig { params(_: Integer).returns(Integer) } - def code=(_) - end + sig { params(code: Integer).void } + attr_writer :code sig { returns(T.nilable(String)) } - def individual_id - end + attr_reader :individual_id - sig { params(_: String).returns(String) } - def individual_id=(_) - end + sig { params(individual_id: String).void } + attr_writer :individual_id - sig { params(body: FinchAPI::Models::HRIS::EmploymentData, code: Integer, individual_id: String).void } - def initialize(body: nil, code: nil, individual_id: nil) + sig do + params( + body: T.any(FinchAPI::Models::HRIS::EmploymentData, FinchAPI::Util::AnyHash), + code: Integer, + individual_id: String + ) + .returns(T.attached_class) + end + def self.new(body: nil, code: nil, individual_id: nil) end sig { override.returns({body: FinchAPI::Models::HRIS::EmploymentData, code: Integer, individual_id: String}) } 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 index c5609a7c..5328d35e 100644 --- a/rbi/lib/finch-api/models/hris/employment_retrieve_many_params.rbi +++ b/rbi/lib/finch-api/models/hris/employment_retrieve_many_params.rbi @@ -7,25 +7,18 @@ module FinchAPI extend FinchAPI::RequestParameters::Converter include FinchAPI::RequestParameters + # The array of batch requests. 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 + attr_accessor :requests sig do params( - requests: T::Array[FinchAPI::Models::HRIS::EmploymentRetrieveManyParams::Request], - request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + requests: T::Array[T.any(FinchAPI::Models::HRIS::EmploymentRetrieveManyParams::Request, FinchAPI::Util::AnyHash)], + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) ) - .void + .returns(T.attached_class) end - def initialize(requests:, request_options: {}) + def self.new(requests:, request_options: {}) end sig do @@ -41,16 +34,14 @@ module FinchAPI end class Request < FinchAPI::BaseModel + # 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. sig { returns(String) } - def individual_id - end - - sig { params(_: String).returns(String) } - def individual_id=(_) - end + attr_accessor :individual_id - sig { params(individual_id: String).void } - def initialize(individual_id:) + sig { params(individual_id: String).returns(T.attached_class) } + def self.new(individual_id:) end sig { override.returns({individual_id: String}) } diff --git a/rbi/lib/finch-api/models/hris/individual.rbi b/rbi/lib/finch-api/models/hris/individual.rbi index a0c7e992..1a80d0df 100644 --- a/rbi/lib/finch-api/models/hris/individual.rbi +++ b/rbi/lib/finch-api/models/hris/individual.rbi @@ -4,135 +4,86 @@ module FinchAPI module Models module HRIS class Individual < FinchAPI::BaseModel + # A stable Finch `id` (UUID v4) for an individual in the company. sig { returns(T.nilable(String)) } - def id - end + attr_reader :id - sig { params(_: String).returns(String) } - def id=(_) - end + sig { params(id: String).void } + attr_writer :id sig { returns(T.nilable(String)) } - def dob - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def dob=(_) - end + attr_accessor :dob 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 + attr_accessor :emails + # 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. 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 + attr_accessor :encrypted_ssn - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def ethnicity=(_) - end + # The EEOC-defined ethnicity of the individual. + sig { returns(T.nilable(FinchAPI::Models::HRIS::Individual::Ethnicity::TaggedSymbol)) } + attr_accessor :ethnicity + # The legal first name of the individual. 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 + attr_accessor :first_name - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def gender=(_) - end + # The gender of the individual. + sig { returns(T.nilable(FinchAPI::Models::HRIS::Individual::Gender::TaggedSymbol)) } + attr_accessor :gender + # The legal last name of the individual. sig { returns(T.nilable(String)) } - def last_name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def last_name=(_) - end + attr_accessor :last_name + # The legal middle name of the individual. sig { returns(T.nilable(String)) } - def middle_name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def middle_name=(_) - end + attr_accessor :middle_name 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 + attr_accessor :phone_numbers + # The preferred name of the individual. sig { returns(T.nilable(String)) } - def preferred_name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def preferred_name=(_) - end + attr_accessor :preferred_name sig { returns(T.nilable(FinchAPI::Models::Location)) } - def residence - end + attr_reader :residence - sig { params(_: T.nilable(FinchAPI::Models::Location)).returns(T.nilable(FinchAPI::Models::Location)) } - def residence=(_) - end + sig { params(residence: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Util::AnyHash))).void } + attr_writer :residence + # 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). sig { returns(T.nilable(String)) } - def ssn - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def ssn=(_) - end + attr_accessor :ssn sig do params( id: String, dob: T.nilable(String), - emails: T.nilable(T::Array[FinchAPI::Models::HRIS::Individual::Email]), + emails: T.nilable(T::Array[T.any(FinchAPI::Models::HRIS::Individual::Email, FinchAPI::Util::AnyHash)]), encrypted_ssn: T.nilable(String), - ethnicity: T.nilable(Symbol), + ethnicity: T.nilable(FinchAPI::Models::HRIS::Individual::Ethnicity::OrSymbol), first_name: T.nilable(String), - gender: T.nilable(Symbol), + gender: T.nilable(FinchAPI::Models::HRIS::Individual::Gender::OrSymbol), last_name: T.nilable(String), middle_name: T.nilable(String), - phone_numbers: T.nilable(T::Array[T.nilable(FinchAPI::Models::HRIS::Individual::PhoneNumber)]), + phone_numbers: T.nilable( + T::Array[T.nilable(T.any(FinchAPI::Models::HRIS::Individual::PhoneNumber, FinchAPI::Util::AnyHash))] + ), preferred_name: T.nilable(String), - residence: T.nilable(FinchAPI::Models::Location), + residence: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Util::AnyHash)), ssn: T.nilable(String) ) - .void + .returns(T.attached_class) end - def initialize( + def self.new( id: nil, dob: nil, emails: nil, @@ -157,9 +108,9 @@ module FinchAPI dob: T.nilable(String), emails: T.nilable(T::Array[FinchAPI::Models::HRIS::Individual::Email]), encrypted_ssn: T.nilable(String), - ethnicity: T.nilable(Symbol), + ethnicity: T.nilable(FinchAPI::Models::HRIS::Individual::Ethnicity::TaggedSymbol), first_name: T.nilable(String), - gender: T.nilable(Symbol), + gender: T.nilable(FinchAPI::Models::HRIS::Individual::Gender::TaggedSymbol), last_name: T.nilable(String), middle_name: T.nilable(String), phone_numbers: T.nilable(T::Array[T.nilable(FinchAPI::Models::HRIS::Individual::PhoneNumber)]), @@ -174,103 +125,127 @@ module FinchAPI class Email < FinchAPI::BaseModel sig { returns(T.nilable(String)) } - def data - end + attr_reader :data - sig { params(_: String).returns(String) } - def data=(_) - end + sig { params(data: String).void } + attr_writer :data - sig { returns(T.nilable(Symbol)) } - def type - end + sig { returns(T.nilable(FinchAPI::Models::HRIS::Individual::Email::Type::TaggedSymbol)) } + attr_accessor :type - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def type=(_) + sig do + params(data: String, type: T.nilable(FinchAPI::Models::HRIS::Individual::Email::Type::OrSymbol)) + .returns(T.attached_class) end - - sig { params(data: String, type: T.nilable(Symbol)).void } - def initialize(data: nil, type: nil) + def self.new(data: nil, type: nil) end - sig { override.returns({data: String, type: T.nilable(Symbol)}) } + sig do + override + .returns({data: String, type: T.nilable(FinchAPI::Models::HRIS::Individual::Email::Type::TaggedSymbol)}) + end def to_hash end - class Type < FinchAPI::Enum - abstract! + module Type + extend FinchAPI::Enum - WORK = T.let(:work, T.nilable(Symbol)) - PERSONAL = T.let(:personal, T.nilable(Symbol)) + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::Individual::Email::Type) } + OrSymbol = T.type_alias { T.any(Symbol, FinchAPI::Models::HRIS::Individual::Email::Type::TaggedSymbol) } - sig { override.returns(T::Array[Symbol]) } + WORK = T.let(:work, FinchAPI::Models::HRIS::Individual::Email::Type::TaggedSymbol) + PERSONAL = T.let(:personal, FinchAPI::Models::HRIS::Individual::Email::Type::TaggedSymbol) + + sig { override.returns(T::Array[FinchAPI::Models::HRIS::Individual::Email::Type::TaggedSymbol]) } 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]) } + # The EEOC-defined ethnicity of the individual. + module Ethnicity + extend FinchAPI::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::Individual::Ethnicity) } + OrSymbol = T.type_alias { T.any(Symbol, FinchAPI::Models::HRIS::Individual::Ethnicity::TaggedSymbol) } + + ASIAN = T.let(:asian, FinchAPI::Models::HRIS::Individual::Ethnicity::TaggedSymbol) + WHITE = T.let(:white, FinchAPI::Models::HRIS::Individual::Ethnicity::TaggedSymbol) + BLACK_OR_AFRICAN_AMERICAN = + T.let(:black_or_african_american, FinchAPI::Models::HRIS::Individual::Ethnicity::TaggedSymbol) + NATIVE_HAWAIIAN_OR_PACIFIC_ISLANDER = + T.let(:native_hawaiian_or_pacific_islander, FinchAPI::Models::HRIS::Individual::Ethnicity::TaggedSymbol) + AMERICAN_INDIAN_OR_ALASKA_NATIVE = + T.let(:american_indian_or_alaska_native, FinchAPI::Models::HRIS::Individual::Ethnicity::TaggedSymbol) + HISPANIC_OR_LATINO = + T.let(:hispanic_or_latino, FinchAPI::Models::HRIS::Individual::Ethnicity::TaggedSymbol) + TWO_OR_MORE_RACES = + T.let(:two_or_more_races, FinchAPI::Models::HRIS::Individual::Ethnicity::TaggedSymbol) + DECLINE_TO_SPECIFY = + T.let(:decline_to_specify, FinchAPI::Models::HRIS::Individual::Ethnicity::TaggedSymbol) + + sig { override.returns(T::Array[FinchAPI::Models::HRIS::Individual::Ethnicity::TaggedSymbol]) } def self.values end end - class Gender < FinchAPI::Enum - abstract! + # The gender of the individual. + module Gender + extend FinchAPI::Enum - 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)) + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::Individual::Gender) } + OrSymbol = T.type_alias { T.any(Symbol, FinchAPI::Models::HRIS::Individual::Gender::TaggedSymbol) } - sig { override.returns(T::Array[Symbol]) } + FEMALE = T.let(:female, FinchAPI::Models::HRIS::Individual::Gender::TaggedSymbol) + MALE = T.let(:male, FinchAPI::Models::HRIS::Individual::Gender::TaggedSymbol) + OTHER = T.let(:other, FinchAPI::Models::HRIS::Individual::Gender::TaggedSymbol) + DECLINE_TO_SPECIFY = T.let(:decline_to_specify, FinchAPI::Models::HRIS::Individual::Gender::TaggedSymbol) + + sig { override.returns(T::Array[FinchAPI::Models::HRIS::Individual::Gender::TaggedSymbol]) } def self.values end end class PhoneNumber < FinchAPI::BaseModel sig { returns(T.nilable(String)) } - def data - end + attr_accessor :data - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def data=(_) - end + sig { returns(T.nilable(FinchAPI::Models::HRIS::Individual::PhoneNumber::Type::TaggedSymbol)) } + attr_accessor :type - sig { returns(T.nilable(Symbol)) } - def type + sig do + params( + data: T.nilable(String), + type: T.nilable(FinchAPI::Models::HRIS::Individual::PhoneNumber::Type::OrSymbol) + ) + .returns(T.attached_class) end - - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def type=(_) + def self.new(data: nil, type: nil) end - sig { params(data: T.nilable(String), type: T.nilable(Symbol)).void } - def initialize(data: nil, type: nil) + sig do + override + .returns( + { + data: T.nilable(String), + type: T.nilable(FinchAPI::Models::HRIS::Individual::PhoneNumber::Type::TaggedSymbol) + } + ) end - - sig { override.returns({data: T.nilable(String), type: T.nilable(Symbol)}) } def to_hash end - class Type < FinchAPI::Enum - abstract! + module Type + extend FinchAPI::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::Individual::PhoneNumber::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::HRIS::Individual::PhoneNumber::Type::TaggedSymbol) } - WORK = T.let(:work, T.nilable(Symbol)) - PERSONAL = T.let(:personal, T.nilable(Symbol)) + WORK = T.let(:work, FinchAPI::Models::HRIS::Individual::PhoneNumber::Type::TaggedSymbol) + PERSONAL = T.let(:personal, FinchAPI::Models::HRIS::Individual::PhoneNumber::Type::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig { override.returns(T::Array[FinchAPI::Models::HRIS::Individual::PhoneNumber::Type::TaggedSymbol]) } def self.values 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 index 1ca71c73..96c1af08 100644 --- a/rbi/lib/finch-api/models/hris/individual_in_directory.rbi +++ b/rbi/lib/finch-api/models/hris/individual_in_directory.rbi @@ -4,89 +4,66 @@ module FinchAPI module Models module HRIS class IndividualInDirectory < FinchAPI::BaseModel + # A stable Finch id (UUID v4) for an individual in the company. sig { returns(T.nilable(String)) } - def id - end + attr_reader :id - sig { params(_: String).returns(String) } - def id=(_) - end + sig { params(id: String).void } + attr_writer :id + # The department object. sig { returns(T.nilable(FinchAPI::Models::HRIS::IndividualInDirectory::Department)) } - def department - end + attr_reader :department sig do - params(_: T.nilable(FinchAPI::Models::HRIS::IndividualInDirectory::Department)) - .returns(T.nilable(FinchAPI::Models::HRIS::IndividualInDirectory::Department)) - end - def department=(_) + params( + department: T.nilable(T.any(FinchAPI::Models::HRIS::IndividualInDirectory::Department, FinchAPI::Util::AnyHash)) + ) + .void end + attr_writer :department + # The legal first name of the individual. sig { returns(T.nilable(String)) } - def first_name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def first_name=(_) - end + attr_accessor :first_name + # `true` if the individual is an active employee or contractor at the company. 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 + attr_accessor :is_active + # The legal last name of the individual. sig { returns(T.nilable(String)) } - def last_name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def last_name=(_) - end + attr_accessor :last_name + # The manager object. sig { returns(T.nilable(FinchAPI::Models::HRIS::IndividualInDirectory::Manager)) } - def manager - end + attr_reader :manager sig do - params(_: T.nilable(FinchAPI::Models::HRIS::IndividualInDirectory::Manager)) - .returns(T.nilable(FinchAPI::Models::HRIS::IndividualInDirectory::Manager)) - end - def manager=(_) + params( + manager: T.nilable(T.any(FinchAPI::Models::HRIS::IndividualInDirectory::Manager, FinchAPI::Util::AnyHash)) + ) + .void end + attr_writer :manager + # The legal middle name of the individual. sig { returns(T.nilable(String)) } - def middle_name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def middle_name=(_) - end + attr_accessor :middle_name sig do params( id: String, - department: T.nilable(FinchAPI::Models::HRIS::IndividualInDirectory::Department), + department: T.nilable(T.any(FinchAPI::Models::HRIS::IndividualInDirectory::Department, FinchAPI::Util::AnyHash)), first_name: T.nilable(String), is_active: T.nilable(T::Boolean), last_name: T.nilable(String), - manager: T.nilable(FinchAPI::Models::HRIS::IndividualInDirectory::Manager), + manager: T.nilable(T.any(FinchAPI::Models::HRIS::IndividualInDirectory::Manager, FinchAPI::Util::AnyHash)), middle_name: T.nilable(String) ) - .void + .returns(T.attached_class) end - def initialize( - id: nil, - department: nil, - first_name: nil, - is_active: nil, - last_name: nil, - manager: nil, - middle_name: nil - ) + def self.new(id: nil, department: nil, first_name: nil, is_active: nil, last_name: nil, manager: nil, middle_name: nil) end sig do @@ -107,16 +84,13 @@ module FinchAPI end class Department < FinchAPI::BaseModel + # The name of the department. sig { returns(T.nilable(String)) } - def name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def name=(_) - end + attr_accessor :name - sig { params(name: T.nilable(String)).void } - def initialize(name: nil) + # The department object. + sig { params(name: T.nilable(String)).returns(T.attached_class) } + def self.new(name: nil) end sig { override.returns({name: T.nilable(String)}) } @@ -125,16 +99,16 @@ module FinchAPI end class Manager < FinchAPI::BaseModel + # A stable Finch `id` (UUID v4) for an individual in the company. sig { returns(T.nilable(String)) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_reader :id sig { params(id: String).void } - def initialize(id: nil) + attr_writer :id + + # The manager object. + sig { params(id: String).returns(T.attached_class) } + def self.new(id: nil) end sig { override.returns({id: String}) } diff --git a/rbi/lib/finch-api/models/hris/individual_response.rbi b/rbi/lib/finch-api/models/hris/individual_response.rbi index 3f4d6195..19ed5262 100644 --- a/rbi/lib/finch-api/models/hris/individual_response.rbi +++ b/rbi/lib/finch-api/models/hris/individual_response.rbi @@ -5,31 +5,32 @@ module FinchAPI module HRIS class IndividualResponse < FinchAPI::BaseModel sig { returns(T.nilable(FinchAPI::Models::HRIS::Individual)) } - def body - end + attr_reader :body - sig { params(_: FinchAPI::Models::HRIS::Individual).returns(FinchAPI::Models::HRIS::Individual) } - def body=(_) - end + sig { params(body: T.any(FinchAPI::Models::HRIS::Individual, FinchAPI::Util::AnyHash)).void } + attr_writer :body sig { returns(T.nilable(Integer)) } - def code - end + attr_reader :code - sig { params(_: Integer).returns(Integer) } - def code=(_) - end + sig { params(code: Integer).void } + attr_writer :code sig { returns(T.nilable(String)) } - def individual_id - end + attr_reader :individual_id - sig { params(_: String).returns(String) } - def individual_id=(_) - end + sig { params(individual_id: String).void } + attr_writer :individual_id - sig { params(body: FinchAPI::Models::HRIS::Individual, code: Integer, individual_id: String).void } - def initialize(body: nil, code: nil, individual_id: nil) + sig do + params( + body: T.any(FinchAPI::Models::HRIS::Individual, FinchAPI::Util::AnyHash), + code: Integer, + individual_id: String + ) + .returns(T.attached_class) + end + def self.new(body: nil, code: nil, individual_id: nil) end sig { override.returns({body: FinchAPI::Models::HRIS::Individual, code: Integer, individual_id: String}) } 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 index b0d55cf0..c1a70c1d 100644 --- a/rbi/lib/finch-api/models/hris/individual_retrieve_many_params.rbi +++ b/rbi/lib/finch-api/models/hris/individual_retrieve_many_params.rbi @@ -8,36 +8,36 @@ module FinchAPI include FinchAPI::RequestParameters sig { returns(T.nilable(FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Options)) } - def options - end + attr_reader :options sig do - params(_: T.nilable(FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Options)) - .returns(T.nilable(FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Options)) - end - def options=(_) + params( + options: T.nilable(T.any(FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Options, FinchAPI::Util::AnyHash)) + ) + .void end + attr_writer :options sig { returns(T.nilable(T::Array[FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Request])) } - def requests - end + attr_reader :requests sig do - params(_: T::Array[FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Request]) - .returns(T::Array[FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Request]) - end - def requests=(_) + params( + requests: T::Array[T.any(FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Request, FinchAPI::Util::AnyHash)] + ) + .void end + attr_writer :requests 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]) + options: T.nilable(T.any(FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Options, FinchAPI::Util::AnyHash)), + requests: T::Array[T.any(FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Request, FinchAPI::Util::AnyHash)], + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) ) - .void + .returns(T.attached_class) end - def initialize(options: nil, requests: nil, request_options: {}) + def self.new(options: nil, requests: nil, request_options: {}) end sig do @@ -55,15 +55,13 @@ module FinchAPI 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 + attr_reader :include sig { params(include: T::Array[String]).void } - def initialize(include: nil) + attr_writer :include + + sig { params(include: T::Array[String]).returns(T.attached_class) } + def self.new(include: nil) end sig { override.returns({include: T::Array[String]}) } @@ -73,15 +71,13 @@ module FinchAPI class Request < FinchAPI::BaseModel sig { returns(T.nilable(String)) } - def individual_id - end - - sig { params(_: String).returns(String) } - def individual_id=(_) - end + attr_reader :individual_id sig { params(individual_id: String).void } - def initialize(individual_id: nil) + attr_writer :individual_id + + sig { params(individual_id: String).returns(T.attached_class) } + def self.new(individual_id: nil) end sig { override.returns({individual_id: String}) } diff --git a/rbi/lib/finch-api/models/hris/pay_statement.rbi b/rbi/lib/finch-api/models/hris/pay_statement.rbi index 8f17bf18..8c107cfa 100644 --- a/rbi/lib/finch-api/models/hris/pay_statement.rbi +++ b/rbi/lib/finch-api/models/hris/pay_statement.rbi @@ -4,114 +4,74 @@ module FinchAPI module Models module HRIS class PayStatement < FinchAPI::BaseModel + # The array of earnings objects associated with this pay statement 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 + attr_accessor :earnings + # The array of deductions objects associated with this pay statement. 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 + attr_accessor :employee_deductions 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 + attr_accessor :employer_contributions sig { returns(T.nilable(FinchAPI::Models::Money)) } - def gross_pay - end + attr_reader :gross_pay - sig { params(_: T.nilable(FinchAPI::Models::Money)).returns(T.nilable(FinchAPI::Models::Money)) } - def gross_pay=(_) - end + sig { params(gross_pay: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Util::AnyHash))).void } + attr_writer :gross_pay + # A stable Finch `id` (UUID v4) for an individual in the company sig { returns(T.nilable(String)) } - def individual_id - end + attr_reader :individual_id - sig { params(_: String).returns(String) } - def individual_id=(_) - end + sig { params(individual_id: String).void } + attr_writer :individual_id sig { returns(T.nilable(FinchAPI::Models::Money)) } - def net_pay - end + attr_reader :net_pay - sig { params(_: T.nilable(FinchAPI::Models::Money)).returns(T.nilable(FinchAPI::Models::Money)) } - def net_pay=(_) - end + sig { params(net_pay: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Util::AnyHash))).void } + attr_writer :net_pay - sig { returns(T.nilable(Symbol)) } - def payment_method - end - - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def payment_method=(_) - end + # The payment method. + sig { returns(T.nilable(FinchAPI::Models::HRIS::PayStatement::PaymentMethod::TaggedSymbol)) } + attr_accessor :payment_method + # The array of taxes objects associated with this pay statement. 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 + attr_accessor :taxes + # The number of hours worked for this pay period sig { returns(T.nilable(Float)) } - def total_hours - end - - sig { params(_: T.nilable(Float)).returns(T.nilable(Float)) } - def total_hours=(_) - end + attr_accessor :total_hours - sig { returns(T.nilable(Symbol)) } - def type - end - - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def type=(_) - end + # The type of the payment associated with the pay statement. + sig { returns(T.nilable(FinchAPI::Models::HRIS::PayStatement::Type::TaggedSymbol)) } + attr_accessor :type 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), + earnings: T.nilable( + T::Array[T.nilable(T.any(FinchAPI::Models::HRIS::PayStatement::Earning, FinchAPI::Util::AnyHash))] + ), + employee_deductions: T.nilable( + T::Array[T.nilable(T.any(FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction, FinchAPI::Util::AnyHash))] + ), + employer_contributions: T.nilable( + T::Array[T.nilable(T.any(FinchAPI::Models::HRIS::PayStatement::EmployerContribution, FinchAPI::Util::AnyHash))] + ), + gross_pay: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Util::AnyHash)), 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)]), + net_pay: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Util::AnyHash)), + payment_method: T.nilable(FinchAPI::Models::HRIS::PayStatement::PaymentMethod::OrSymbol), + taxes: T.nilable(T::Array[T.nilable(T.any(FinchAPI::Models::HRIS::PayStatement::Tax, FinchAPI::Util::AnyHash))]), total_hours: T.nilable(Float), - type: T.nilable(Symbol) + type: T.nilable(FinchAPI::Models::HRIS::PayStatement::Type::OrSymbol) ) - .void + .returns(T.attached_class) end - def initialize( + def self.new( earnings: nil, employee_deductions: nil, employer_contributions: nil, @@ -135,10 +95,10 @@ module FinchAPI gross_pay: T.nilable(FinchAPI::Models::Money), individual_id: String, net_pay: T.nilable(FinchAPI::Models::Money), - payment_method: T.nilable(Symbol), + payment_method: T.nilable(FinchAPI::Models::HRIS::PayStatement::PaymentMethod::TaggedSymbol), taxes: T.nilable(T::Array[T.nilable(FinchAPI::Models::HRIS::PayStatement::Tax)]), total_hours: T.nilable(Float), - type: T.nilable(Symbol) + type: T.nilable(FinchAPI::Models::HRIS::PayStatement::Type::TaggedSymbol) } ) end @@ -146,69 +106,50 @@ module FinchAPI end class Earning < FinchAPI::BaseModel + # The earnings amount in cents. sig { returns(T.nilable(Integer)) } - def amount - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def amount=(_) - end + attr_accessor :amount sig { returns(T.nilable(FinchAPI::Models::HRIS::PayStatement::Earning::Attributes)) } - def attributes - end + attr_reader :attributes sig do - params(_: T.nilable(FinchAPI::Models::HRIS::PayStatement::Earning::Attributes)) - .returns(T.nilable(FinchAPI::Models::HRIS::PayStatement::Earning::Attributes)) - end - def attributes=(_) + params( + attributes: T.nilable(T.any(FinchAPI::Models::HRIS::PayStatement::Earning::Attributes, FinchAPI::Util::AnyHash)) + ) + .void end + attr_writer :attributes + # The earnings currency code. sig { returns(T.nilable(String)) } - def currency - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def currency=(_) - end + attr_accessor :currency + # 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). sig { returns(T.nilable(Float)) } - def hours - end - - sig { params(_: T.nilable(Float)).returns(T.nilable(Float)) } - def hours=(_) - end + attr_accessor :hours + # The exact name of the deduction from the pay statement. sig { returns(T.nilable(String)) } - def name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def name=(_) - end + attr_accessor :name - sig { returns(T.nilable(Symbol)) } - def type - end - - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def type=(_) - end + # The type of earning. + sig { returns(T.nilable(FinchAPI::Models::HRIS::PayStatement::Earning::Type::TaggedSymbol)) } + attr_accessor :type sig do params( amount: T.nilable(Integer), - attributes: T.nilable(FinchAPI::Models::HRIS::PayStatement::Earning::Attributes), + attributes: T.nilable(T.any(FinchAPI::Models::HRIS::PayStatement::Earning::Attributes, FinchAPI::Util::AnyHash)), currency: T.nilable(String), hours: T.nilable(Float), name: T.nilable(String), - type: T.nilable(Symbol) + type: T.nilable(FinchAPI::Models::HRIS::PayStatement::Earning::Type::OrSymbol) ) - .void + .returns(T.attached_class) end - def initialize(amount: nil, attributes: nil, currency: nil, hours: nil, name: nil, type: nil) + def self.new(amount: nil, attributes: nil, currency: nil, hours: nil, name: nil, type: nil) end sig do @@ -220,7 +161,7 @@ module FinchAPI currency: T.nilable(String), hours: T.nilable(Float), name: T.nilable(String), - type: T.nilable(Symbol) + type: T.nilable(FinchAPI::Models::HRIS::PayStatement::Earning::Type::TaggedSymbol) } ) end @@ -229,18 +170,23 @@ module FinchAPI class Attributes < FinchAPI::BaseModel sig { returns(T.nilable(FinchAPI::Models::HRIS::PayStatement::Earning::Attributes::Metadata)) } - def metadata - end + attr_reader :metadata sig do - params(_: FinchAPI::Models::HRIS::PayStatement::Earning::Attributes::Metadata) - .returns(FinchAPI::Models::HRIS::PayStatement::Earning::Attributes::Metadata) - end - def metadata=(_) + params( + metadata: T.any(FinchAPI::Models::HRIS::PayStatement::Earning::Attributes::Metadata, FinchAPI::Util::AnyHash) + ) + .void end + attr_writer :metadata - sig { params(metadata: FinchAPI::Models::HRIS::PayStatement::Earning::Attributes::Metadata).void } - def initialize(metadata: nil) + sig do + params( + metadata: T.any(FinchAPI::Models::HRIS::PayStatement::Earning::Attributes::Metadata, FinchAPI::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(metadata: nil) end sig { override.returns({metadata: FinchAPI::Models::HRIS::PayStatement::Earning::Attributes::Metadata}) } @@ -248,16 +194,17 @@ module FinchAPI end class Metadata < FinchAPI::BaseModel + # 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.). 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 + attr_reader :metadata sig { params(metadata: T::Hash[Symbol, T.anything]).void } - def initialize(metadata: nil) + attr_writer :metadata + + sig { params(metadata: T::Hash[Symbol, T.anything]).returns(T.attached_class) } + def self.new(metadata: nil) end sig { override.returns({metadata: T::Hash[Symbol, T.anything]}) } @@ -266,93 +213,83 @@ module FinchAPI 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]) } + # The type of earning. + module Type + extend FinchAPI::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::PayStatement::Earning::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::HRIS::PayStatement::Earning::Type::TaggedSymbol) } + + SALARY = T.let(:salary, FinchAPI::Models::HRIS::PayStatement::Earning::Type::TaggedSymbol) + WAGE = T.let(:wage, FinchAPI::Models::HRIS::PayStatement::Earning::Type::TaggedSymbol) + REIMBURSEMENT = T.let(:reimbursement, FinchAPI::Models::HRIS::PayStatement::Earning::Type::TaggedSymbol) + OVERTIME = T.let(:overtime, FinchAPI::Models::HRIS::PayStatement::Earning::Type::TaggedSymbol) + SEVERANCE = T.let(:severance, FinchAPI::Models::HRIS::PayStatement::Earning::Type::TaggedSymbol) + DOUBLE_OVERTIME = + T.let(:double_overtime, FinchAPI::Models::HRIS::PayStatement::Earning::Type::TaggedSymbol) + PTO = T.let(:pto, FinchAPI::Models::HRIS::PayStatement::Earning::Type::TaggedSymbol) + SICK = T.let(:sick, FinchAPI::Models::HRIS::PayStatement::Earning::Type::TaggedSymbol) + BONUS = T.let(:bonus, FinchAPI::Models::HRIS::PayStatement::Earning::Type::TaggedSymbol) + COMMISSION = T.let(:commission, FinchAPI::Models::HRIS::PayStatement::Earning::Type::TaggedSymbol) + TIPS = T.let(:tips, FinchAPI::Models::HRIS::PayStatement::Earning::Type::TaggedSymbol) + NUMBER_1099 = T.let(:"1099", FinchAPI::Models::HRIS::PayStatement::Earning::Type::TaggedSymbol) + OTHER = T.let(:other, FinchAPI::Models::HRIS::PayStatement::Earning::Type::TaggedSymbol) + + sig { override.returns(T::Array[FinchAPI::Models::HRIS::PayStatement::Earning::Type::TaggedSymbol]) } def self.values end end end class EmployeeDeduction < FinchAPI::BaseModel + # The deduction amount in cents. sig { returns(T.nilable(Integer)) } - def amount - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def amount=(_) - end + attr_accessor :amount sig { returns(T.nilable(FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes)) } - def attributes - end + attr_reader :attributes sig do - params(_: T.nilable(FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes)) - .returns(T.nilable(FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes)) - end - def attributes=(_) + params( + attributes: T.nilable( + T.any(FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes, FinchAPI::Util::AnyHash) + ) + ) + .void end + attr_writer :attributes + # The deduction currency. sig { returns(T.nilable(String)) } - def currency - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def currency=(_) - end + attr_accessor :currency + # The deduction name from the pay statement. sig { returns(T.nilable(String)) } - def name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def name=(_) - end + attr_accessor :name + # Boolean indicating if the deduction is pre-tax. 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 + attr_accessor :pre_tax - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def type=(_) - end + # Type of benefit. + sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitType::TaggedSymbol)) } + attr_accessor :type sig do params( amount: T.nilable(Integer), - attributes: T.nilable(FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes), + attributes: T.nilable( + T.any(FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes, FinchAPI::Util::AnyHash) + ), currency: T.nilable(String), name: T.nilable(String), pre_tax: T.nilable(T::Boolean), - type: T.nilable(Symbol) + type: T.nilable(FinchAPI::Models::HRIS::BenefitType::OrSymbol) ) - .void + .returns(T.attached_class) end - def initialize(amount: nil, attributes: nil, currency: nil, name: nil, pre_tax: nil, type: nil) + def self.new(amount: nil, attributes: nil, currency: nil, name: nil, pre_tax: nil, type: nil) end sig do @@ -364,7 +301,7 @@ module FinchAPI currency: T.nilable(String), name: T.nilable(String), pre_tax: T.nilable(T::Boolean), - type: T.nilable(Symbol) + type: T.nilable(FinchAPI::Models::HRIS::BenefitType::TaggedSymbol) } ) end @@ -373,18 +310,29 @@ module FinchAPI class Attributes < FinchAPI::BaseModel sig { returns(T.nilable(FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes::Metadata)) } - def metadata - end + attr_reader :metadata sig do - params(_: FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes::Metadata) - .returns(FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes::Metadata) - end - def metadata=(_) + params( + metadata: T.any( + FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes::Metadata, + FinchAPI::Util::AnyHash + ) + ) + .void end + attr_writer :metadata - sig { params(metadata: FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes::Metadata).void } - def initialize(metadata: nil) + sig do + params( + metadata: T.any( + FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes::Metadata, + FinchAPI::Util::AnyHash + ) + ) + .returns(T.attached_class) + end + def self.new(metadata: nil) end sig do @@ -394,16 +342,17 @@ module FinchAPI end class Metadata < FinchAPI::BaseModel + # 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.). 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 + attr_reader :metadata sig { params(metadata: T::Hash[Symbol, T.anything]).void } - def initialize(metadata: nil) + attr_writer :metadata + + sig { params(metadata: T::Hash[Symbol, T.anything]).returns(T.attached_class) } + def self.new(metadata: nil) end sig { override.returns({metadata: T::Hash[Symbol, T.anything]}) } @@ -414,60 +363,48 @@ module FinchAPI end class EmployerContribution < FinchAPI::BaseModel + # The contribution amount in cents. sig { returns(T.nilable(Integer)) } - def amount - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def amount=(_) - end + attr_accessor :amount sig { returns(T.nilable(FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes)) } - def attributes - end + attr_reader :attributes sig do - params(_: T.nilable(FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes)) - .returns(T.nilable(FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes)) - end - def attributes=(_) + params( + attributes: T.nilable( + T.any(FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes, FinchAPI::Util::AnyHash) + ) + ) + .void end + attr_writer :attributes + # The contribution currency. sig { returns(T.nilable(String)) } - def currency - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def currency=(_) - end + attr_accessor :currency + # The contribution name from the pay statement. sig { returns(T.nilable(String)) } - def name - end + attr_accessor :name - 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 + # Type of benefit. + sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitType::TaggedSymbol)) } + attr_accessor :type sig do params( amount: T.nilable(Integer), - attributes: T.nilable(FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes), + attributes: T.nilable( + T.any(FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes, FinchAPI::Util::AnyHash) + ), currency: T.nilable(String), name: T.nilable(String), - type: T.nilable(Symbol) + type: T.nilable(FinchAPI::Models::HRIS::BenefitType::OrSymbol) ) - .void + .returns(T.attached_class) end - def initialize(amount: nil, attributes: nil, currency: nil, name: nil, type: nil) + def self.new(amount: nil, attributes: nil, currency: nil, name: nil, type: nil) end sig do @@ -478,7 +415,7 @@ module FinchAPI attributes: T.nilable(FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes), currency: T.nilable(String), name: T.nilable(String), - type: T.nilable(Symbol) + type: T.nilable(FinchAPI::Models::HRIS::BenefitType::TaggedSymbol) } ) end @@ -487,18 +424,29 @@ module FinchAPI class Attributes < FinchAPI::BaseModel sig { returns(T.nilable(FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes::Metadata)) } - def metadata - end + attr_reader :metadata sig do - params(_: FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes::Metadata) - .returns(FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes::Metadata) - end - def metadata=(_) + params( + metadata: T.any( + FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes::Metadata, + FinchAPI::Util::AnyHash + ) + ) + .void end + attr_writer :metadata - sig { params(metadata: FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes::Metadata).void } - def initialize(metadata: nil) + sig do + params( + metadata: T.any( + FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes::Metadata, + FinchAPI::Util::AnyHash + ) + ) + .returns(T.attached_class) + end + def self.new(metadata: nil) end sig do @@ -509,16 +457,17 @@ module FinchAPI end class Metadata < FinchAPI::BaseModel + # 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.). 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 + attr_reader :metadata sig { params(metadata: T::Hash[Symbol, T.anything]).void } - def initialize(metadata: nil) + attr_writer :metadata + + sig { params(metadata: T::Hash[Symbol, T.anything]).returns(T.attached_class) } + def self.new(metadata: nil) end sig { override.returns({metadata: T::Hash[Symbol, T.anything]}) } @@ -528,81 +477,67 @@ module FinchAPI end end - class PaymentMethod < FinchAPI::Enum - abstract! + # The payment method. + module PaymentMethod + extend FinchAPI::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::PayStatement::PaymentMethod) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::HRIS::PayStatement::PaymentMethod::TaggedSymbol) } - CHECK = T.let(:check, T.nilable(Symbol)) - DIRECT_DEPOSIT = T.let(:direct_deposit, T.nilable(Symbol)) + CHECK = T.let(:check, FinchAPI::Models::HRIS::PayStatement::PaymentMethod::TaggedSymbol) + DIRECT_DEPOSIT = + T.let(:direct_deposit, FinchAPI::Models::HRIS::PayStatement::PaymentMethod::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig { override.returns(T::Array[FinchAPI::Models::HRIS::PayStatement::PaymentMethod::TaggedSymbol]) } def self.values end end class Tax < FinchAPI::BaseModel + # The tax amount in cents. sig { returns(T.nilable(Integer)) } - def amount - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def amount=(_) - end + attr_accessor :amount sig { returns(T.nilable(FinchAPI::Models::HRIS::PayStatement::Tax::Attributes)) } - def attributes - end + attr_reader :attributes sig do - params(_: T.nilable(FinchAPI::Models::HRIS::PayStatement::Tax::Attributes)) - .returns(T.nilable(FinchAPI::Models::HRIS::PayStatement::Tax::Attributes)) - end - def attributes=(_) + params( + attributes: T.nilable(T.any(FinchAPI::Models::HRIS::PayStatement::Tax::Attributes, FinchAPI::Util::AnyHash)) + ) + .void end + attr_writer :attributes + # The currency code. sig { returns(T.nilable(String)) } - def currency - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def currency=(_) - end + attr_accessor :currency + # `true` if the amount is paid by the employers. sig { returns(T.nilable(T::Boolean)) } - def employer - end - - sig { params(_: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } - def employer=(_) - end + attr_accessor :employer + # The exact name of tax from the pay statement. 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 + attr_accessor :name - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def type=(_) - end + # The type of taxes. + sig { returns(T.nilable(FinchAPI::Models::HRIS::PayStatement::Tax::Type::TaggedSymbol)) } + attr_accessor :type sig do params( amount: T.nilable(Integer), - attributes: T.nilable(FinchAPI::Models::HRIS::PayStatement::Tax::Attributes), + attributes: T.nilable(T.any(FinchAPI::Models::HRIS::PayStatement::Tax::Attributes, FinchAPI::Util::AnyHash)), currency: T.nilable(String), employer: T.nilable(T::Boolean), name: T.nilable(String), - type: T.nilable(Symbol) + type: T.nilable(FinchAPI::Models::HRIS::PayStatement::Tax::Type::OrSymbol) ) - .void + .returns(T.attached_class) end - def initialize(amount: nil, attributes: nil, currency: nil, employer: nil, name: nil, type: nil) + def self.new(amount: nil, attributes: nil, currency: nil, employer: nil, name: nil, type: nil) end sig do @@ -614,7 +549,7 @@ module FinchAPI currency: T.nilable(String), employer: T.nilable(T::Boolean), name: T.nilable(String), - type: T.nilable(Symbol) + type: T.nilable(FinchAPI::Models::HRIS::PayStatement::Tax::Type::TaggedSymbol) } ) end @@ -623,18 +558,23 @@ module FinchAPI class Attributes < FinchAPI::BaseModel sig { returns(T.nilable(FinchAPI::Models::HRIS::PayStatement::Tax::Attributes::Metadata)) } - def metadata - end + attr_reader :metadata sig do - params(_: FinchAPI::Models::HRIS::PayStatement::Tax::Attributes::Metadata) - .returns(FinchAPI::Models::HRIS::PayStatement::Tax::Attributes::Metadata) - end - def metadata=(_) + params( + metadata: T.any(FinchAPI::Models::HRIS::PayStatement::Tax::Attributes::Metadata, FinchAPI::Util::AnyHash) + ) + .void end + attr_writer :metadata - sig { params(metadata: FinchAPI::Models::HRIS::PayStatement::Tax::Attributes::Metadata).void } - def initialize(metadata: nil) + sig do + params( + metadata: T.any(FinchAPI::Models::HRIS::PayStatement::Tax::Attributes::Metadata, FinchAPI::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(metadata: nil) end sig { override.returns({metadata: FinchAPI::Models::HRIS::PayStatement::Tax::Attributes::Metadata}) } @@ -642,16 +582,17 @@ module FinchAPI end class Metadata < FinchAPI::BaseModel + # 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.). 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 + attr_reader :metadata sig { params(metadata: T::Hash[Symbol, T.anything]).void } - def initialize(metadata: nil) + attr_writer :metadata + + sig { params(metadata: T::Hash[Symbol, T.anything]).returns(T.attached_class) } + def self.new(metadata: nil) end sig { override.returns({metadata: T::Hash[Symbol, T.anything]}) } @@ -660,28 +601,36 @@ module FinchAPI end end - class Type < FinchAPI::Enum - abstract! + # The type of taxes. + module Type + extend FinchAPI::Enum - 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)) + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::PayStatement::Tax::Type) } + OrSymbol = T.type_alias { T.any(Symbol, FinchAPI::Models::HRIS::PayStatement::Tax::Type::TaggedSymbol) } - sig { override.returns(T::Array[Symbol]) } + STATE = T.let(:state, FinchAPI::Models::HRIS::PayStatement::Tax::Type::TaggedSymbol) + FEDERAL = T.let(:federal, FinchAPI::Models::HRIS::PayStatement::Tax::Type::TaggedSymbol) + LOCAL = T.let(:local, FinchAPI::Models::HRIS::PayStatement::Tax::Type::TaggedSymbol) + FICA = T.let(:fica, FinchAPI::Models::HRIS::PayStatement::Tax::Type::TaggedSymbol) + + sig { override.returns(T::Array[FinchAPI::Models::HRIS::PayStatement::Tax::Type::TaggedSymbol]) } def self.values end end end - class Type < FinchAPI::Enum - abstract! + # The type of the payment associated with the pay statement. + module Type + extend FinchAPI::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::PayStatement::Type) } + OrSymbol = T.type_alias { T.any(Symbol, FinchAPI::Models::HRIS::PayStatement::Type::TaggedSymbol) } - 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)) + REGULAR_PAYROLL = T.let(:regular_payroll, FinchAPI::Models::HRIS::PayStatement::Type::TaggedSymbol) + OFF_CYCLE_PAYROLL = T.let(:off_cycle_payroll, FinchAPI::Models::HRIS::PayStatement::Type::TaggedSymbol) + ONE_TIME_PAYMENT = T.let(:one_time_payment, FinchAPI::Models::HRIS::PayStatement::Type::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig { override.returns(T::Array[FinchAPI::Models::HRIS::PayStatement::Type::TaggedSymbol]) } def self.values 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 index 53e22ac0..0a080722 100644 --- a/rbi/lib/finch-api/models/hris/pay_statement_response.rbi +++ b/rbi/lib/finch-api/models/hris/pay_statement_response.rbi @@ -5,34 +5,32 @@ module FinchAPI module HRIS class PayStatementResponse < FinchAPI::BaseModel sig { returns(T.nilable(FinchAPI::Models::HRIS::PayStatementResponseBody)) } - def body - end + attr_reader :body - sig do - params(_: FinchAPI::Models::HRIS::PayStatementResponseBody) - .returns(FinchAPI::Models::HRIS::PayStatementResponseBody) - end - def body=(_) - end + sig { params(body: T.any(FinchAPI::Models::HRIS::PayStatementResponseBody, FinchAPI::Util::AnyHash)).void } + attr_writer :body sig { returns(T.nilable(Integer)) } - def code - end + attr_reader :code - sig { params(_: Integer).returns(Integer) } - def code=(_) - end + sig { params(code: Integer).void } + attr_writer :code sig { returns(T.nilable(String)) } - def payment_id - end + attr_reader :payment_id - sig { params(_: String).returns(String) } - def payment_id=(_) - end + sig { params(payment_id: String).void } + attr_writer :payment_id - sig { params(body: FinchAPI::Models::HRIS::PayStatementResponseBody, code: Integer, payment_id: String).void } - def initialize(body: nil, code: nil, payment_id: nil) + sig do + params( + body: T.any(FinchAPI::Models::HRIS::PayStatementResponseBody, FinchAPI::Util::AnyHash), + code: Integer, + payment_id: String + ) + .returns(T.attached_class) + end + def self.new(body: nil, code: nil, payment_id: nil) end sig do 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 index 7a7a8f37..906ab10f 100644 --- a/rbi/lib/finch-api/models/hris/pay_statement_response_body.rbi +++ b/rbi/lib/finch-api/models/hris/pay_statement_response_body.rbi @@ -5,29 +5,26 @@ module FinchAPI module HRIS class PayStatementResponseBody < FinchAPI::BaseModel sig { returns(T.nilable(FinchAPI::Models::Paging)) } - def paging - end + attr_reader :paging - sig { params(_: FinchAPI::Models::Paging).returns(FinchAPI::Models::Paging) } - def paging=(_) - end + sig { params(paging: T.any(FinchAPI::Models::Paging, FinchAPI::Util::AnyHash)).void } + attr_writer :paging + # The array of pay statements for the current payment. sig { returns(T.nilable(T::Array[FinchAPI::Models::HRIS::PayStatement])) } - def pay_statements - end + attr_reader :pay_statements - sig do - params(_: T::Array[FinchAPI::Models::HRIS::PayStatement]) - .returns(T::Array[FinchAPI::Models::HRIS::PayStatement]) - end - def pay_statements=(_) - end + sig { params(pay_statements: T::Array[T.any(FinchAPI::Models::HRIS::PayStatement, FinchAPI::Util::AnyHash)]).void } + attr_writer :pay_statements sig do - params(paging: FinchAPI::Models::Paging, pay_statements: T::Array[FinchAPI::Models::HRIS::PayStatement]) - .void + params( + paging: T.any(FinchAPI::Models::Paging, FinchAPI::Util::AnyHash), + pay_statements: T::Array[T.any(FinchAPI::Models::HRIS::PayStatement, FinchAPI::Util::AnyHash)] + ) + .returns(T.attached_class) end - def initialize(paging: nil, pay_statements: nil) + def self.new(paging: nil, pay_statements: nil) end sig do 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 index fae3af84..165efc26 100644 --- 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 @@ -7,25 +7,18 @@ module FinchAPI extend FinchAPI::RequestParameters::Converter include FinchAPI::RequestParameters + # The array of batch requests. 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 + attr_accessor :requests sig do params( - requests: T::Array[FinchAPI::Models::HRIS::PayStatementRetrieveManyParams::Request], - request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + requests: T::Array[T.any(FinchAPI::Models::HRIS::PayStatementRetrieveManyParams::Request, FinchAPI::Util::AnyHash)], + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) ) - .void + .returns(T.attached_class) end - def initialize(requests:, request_options: {}) + def self.new(requests:, request_options: {}) end sig do @@ -41,32 +34,26 @@ module FinchAPI end class Request < FinchAPI::BaseModel + # A stable Finch `id` (UUID v4) for a payment. sig { returns(String) } - def payment_id - end - - sig { params(_: String).returns(String) } - def payment_id=(_) - end + attr_accessor :payment_id + # Number of pay statements to return (defaults to all). sig { returns(T.nilable(Integer)) } - def limit - end + attr_reader :limit - sig { params(_: Integer).returns(Integer) } - def limit=(_) - end + sig { params(limit: Integer).void } + attr_writer :limit + # Index to start from. sig { returns(T.nilable(Integer)) } - def offset - end + attr_reader :offset - sig { params(_: Integer).returns(Integer) } - def offset=(_) - end + sig { params(offset: Integer).void } + attr_writer :offset - sig { params(payment_id: String, limit: Integer, offset: Integer).void } - def initialize(payment_id:, limit: nil, offset: nil) + sig { params(payment_id: String, limit: Integer, offset: Integer).returns(T.attached_class) } + def self.new(payment_id:, limit: nil, offset: nil) end sig { override.returns({payment_id: String, limit: Integer, offset: Integer}) } diff --git a/rbi/lib/finch-api/models/hris/payment.rbi b/rbi/lib/finch-api/models/hris/payment.rbi index 600beb6f..eba3e803 100644 --- a/rbi/lib/finch-api/models/hris/payment.rbi +++ b/rbi/lib/finch-api/models/hris/payment.rbi @@ -4,123 +4,89 @@ module FinchAPI module Models module HRIS class Payment < FinchAPI::BaseModel + # The unique id for the payment. sig { returns(T.nilable(String)) } - def id - end + attr_reader :id - sig { params(_: String).returns(String) } - def id=(_) - end + sig { params(id: String).void } + attr_writer :id sig { returns(T.nilable(FinchAPI::Models::Money)) } - def company_debit - end + attr_reader :company_debit - sig { params(_: T.nilable(FinchAPI::Models::Money)).returns(T.nilable(FinchAPI::Models::Money)) } - def company_debit=(_) - end + sig { params(company_debit: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Util::AnyHash))).void } + attr_writer :company_debit sig { returns(T.nilable(String)) } - def debit_date - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def debit_date=(_) - end + attr_accessor :debit_date sig { returns(T.nilable(FinchAPI::Models::Money)) } - def employee_taxes - end + attr_reader :employee_taxes - sig { params(_: T.nilable(FinchAPI::Models::Money)).returns(T.nilable(FinchAPI::Models::Money)) } - def employee_taxes=(_) - end + sig { params(employee_taxes: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Util::AnyHash))).void } + attr_writer :employee_taxes sig { returns(T.nilable(FinchAPI::Models::Money)) } - def employer_taxes - end + attr_reader :employer_taxes - sig { params(_: T.nilable(FinchAPI::Models::Money)).returns(T.nilable(FinchAPI::Models::Money)) } - def employer_taxes=(_) - end + sig { params(employer_taxes: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Util::AnyHash))).void } + attr_writer :employer_taxes sig { returns(T.nilable(FinchAPI::Models::Money)) } - def gross_pay - end + attr_reader :gross_pay - sig { params(_: T.nilable(FinchAPI::Models::Money)).returns(T.nilable(FinchAPI::Models::Money)) } - def gross_pay=(_) - end + sig { params(gross_pay: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Util::AnyHash))).void } + attr_writer :gross_pay + # Array of every individual on this payment. 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 + attr_accessor :individual_ids sig { returns(T.nilable(FinchAPI::Models::Money)) } - def net_pay - end + attr_reader :net_pay - sig { params(_: T.nilable(FinchAPI::Models::Money)).returns(T.nilable(FinchAPI::Models::Money)) } - def net_pay=(_) - end + sig { params(net_pay: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Util::AnyHash))).void } + attr_writer :net_pay sig { returns(T.nilable(String)) } - def pay_date - end + attr_accessor :pay_date - 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 + # List of pay frequencies associated with this payment. + sig { returns(T.nilable(T::Array[FinchAPI::Models::HRIS::Payment::PayFrequency::TaggedSymbol])) } + attr_accessor :pay_frequencies + # Array of the Finch id (uuidv4) of every pay group associated with this payment. 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 + attr_accessor :pay_group_ids + # The pay period object. sig { returns(T.nilable(FinchAPI::Models::HRIS::Payment::PayPeriod)) } - def pay_period - end + attr_reader :pay_period sig do - params(_: T.nilable(FinchAPI::Models::HRIS::Payment::PayPeriod)) - .returns(T.nilable(FinchAPI::Models::HRIS::Payment::PayPeriod)) - end - def pay_period=(_) + params(pay_period: T.nilable(T.any(FinchAPI::Models::HRIS::Payment::PayPeriod, FinchAPI::Util::AnyHash))) + .void end + attr_writer :pay_period sig do params( id: String, - company_debit: T.nilable(FinchAPI::Models::Money), + company_debit: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Util::AnyHash)), 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), + employee_taxes: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Util::AnyHash)), + employer_taxes: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Util::AnyHash)), + gross_pay: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Util::AnyHash)), individual_ids: T.nilable(T::Array[String]), - net_pay: T.nilable(FinchAPI::Models::Money), + net_pay: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Util::AnyHash)), pay_date: T.nilable(String), - pay_frequencies: T.nilable(T::Array[Symbol]), + pay_frequencies: T.nilable(T::Array[FinchAPI::Models::HRIS::Payment::PayFrequency::OrSymbol]), pay_group_ids: T.nilable(T::Array[String]), - pay_period: T.nilable(FinchAPI::Models::HRIS::Payment::PayPeriod) + pay_period: T.nilable(T.any(FinchAPI::Models::HRIS::Payment::PayPeriod, FinchAPI::Util::AnyHash)) ) - .void + .returns(T.attached_class) end - def initialize( + def self.new( id: nil, company_debit: nil, debit_date: nil, @@ -149,7 +115,7 @@ module FinchAPI 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_frequencies: T.nilable(T::Array[FinchAPI::Models::HRIS::Payment::PayFrequency::TaggedSymbol]), pay_group_ids: T.nilable(T::Array[String]), pay_period: T.nilable(FinchAPI::Models::HRIS::Payment::PayPeriod) } @@ -158,43 +124,37 @@ module FinchAPI def to_hash end - class PayFrequency < FinchAPI::Enum - abstract! + module PayFrequency + extend FinchAPI::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::Payment::PayFrequency) } + OrSymbol = T.type_alias { T.any(Symbol, FinchAPI::Models::HRIS::Payment::PayFrequency::TaggedSymbol) } - ANNUALLY = :annually - SEMI_ANNUALLY = :semi_annually - QUARTERLY = :quarterly - MONTHLY = :monthly - SEMI_MONTHLY = :semi_monthly - BI_WEEKLY = :bi_weekly - WEEKLY = :weekly - DAILY = :daily - OTHER = :other + ANNUALLY = T.let(:annually, FinchAPI::Models::HRIS::Payment::PayFrequency::TaggedSymbol) + SEMI_ANNUALLY = T.let(:semi_annually, FinchAPI::Models::HRIS::Payment::PayFrequency::TaggedSymbol) + QUARTERLY = T.let(:quarterly, FinchAPI::Models::HRIS::Payment::PayFrequency::TaggedSymbol) + MONTHLY = T.let(:monthly, FinchAPI::Models::HRIS::Payment::PayFrequency::TaggedSymbol) + SEMI_MONTHLY = T.let(:semi_monthly, FinchAPI::Models::HRIS::Payment::PayFrequency::TaggedSymbol) + BI_WEEKLY = T.let(:bi_weekly, FinchAPI::Models::HRIS::Payment::PayFrequency::TaggedSymbol) + WEEKLY = T.let(:weekly, FinchAPI::Models::HRIS::Payment::PayFrequency::TaggedSymbol) + DAILY = T.let(:daily, FinchAPI::Models::HRIS::Payment::PayFrequency::TaggedSymbol) + OTHER = T.let(:other, FinchAPI::Models::HRIS::Payment::PayFrequency::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig { override.returns(T::Array[FinchAPI::Models::HRIS::Payment::PayFrequency::TaggedSymbol]) } 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 + attr_accessor :end_date sig { returns(T.nilable(String)) } - def start_date - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def start_date=(_) - end + attr_accessor :start_date - sig { params(end_date: T.nilable(String), start_date: T.nilable(String)).void } - def initialize(end_date: nil, start_date: nil) + # The pay period object. + sig { params(end_date: T.nilable(String), start_date: T.nilable(String)).returns(T.attached_class) } + def self.new(end_date: nil, start_date: nil) end sig { override.returns({end_date: T.nilable(String), start_date: T.nilable(String)}) } diff --git a/rbi/lib/finch-api/models/hris/payment_list_params.rbi b/rbi/lib/finch-api/models/hris/payment_list_params.rbi index 8c986cc1..0287f985 100644 --- a/rbi/lib/finch-api/models/hris/payment_list_params.rbi +++ b/rbi/lib/finch-api/models/hris/payment_list_params.rbi @@ -7,31 +7,25 @@ module FinchAPI extend FinchAPI::RequestParameters::Converter include FinchAPI::RequestParameters + # The end date to retrieve payments by a company (inclusive) in `YYYY-MM-DD` + # format. sig { returns(Date) } - def end_date - end - - sig { params(_: Date).returns(Date) } - def end_date=(_) - end + attr_accessor :end_date + # The start date to retrieve payments by a company (inclusive) in `YYYY-MM-DD` + # format. sig { returns(Date) } - def start_date - end - - sig { params(_: Date).returns(Date) } - def start_date=(_) - end + attr_accessor :start_date sig do params( end_date: Date, start_date: Date, - request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) ) - .void + .returns(T.attached_class) end - def initialize(end_date:, start_date:, request_options: {}) + def self.new(end_date:, start_date:, request_options: {}) end sig do 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 index b685b6eb..0d8cea7c 100644 --- a/rbi/lib/finch-api/models/hris/support_per_benefit_type.rbi +++ b/rbi/lib/finch-api/models/hris/support_per_benefit_type.rbi @@ -5,29 +5,25 @@ module FinchAPI module HRIS class SupportPerBenefitType < FinchAPI::BaseModel sig { returns(T.nilable(FinchAPI::Models::OperationSupportMatrix)) } - def company_benefits - end + attr_reader :company_benefits - sig { params(_: FinchAPI::Models::OperationSupportMatrix).returns(FinchAPI::Models::OperationSupportMatrix) } - def company_benefits=(_) - end + sig { params(company_benefits: T.any(FinchAPI::Models::OperationSupportMatrix, FinchAPI::Util::AnyHash)).void } + attr_writer :company_benefits sig { returns(T.nilable(FinchAPI::Models::OperationSupportMatrix)) } - def individual_benefits - end + attr_reader :individual_benefits - sig { params(_: FinchAPI::Models::OperationSupportMatrix).returns(FinchAPI::Models::OperationSupportMatrix) } - def individual_benefits=(_) - end + sig { params(individual_benefits: T.any(FinchAPI::Models::OperationSupportMatrix, FinchAPI::Util::AnyHash)).void } + attr_writer :individual_benefits sig do params( - company_benefits: FinchAPI::Models::OperationSupportMatrix, - individual_benefits: FinchAPI::Models::OperationSupportMatrix + company_benefits: T.any(FinchAPI::Models::OperationSupportMatrix, FinchAPI::Util::AnyHash), + individual_benefits: T.any(FinchAPI::Models::OperationSupportMatrix, FinchAPI::Util::AnyHash) ) - .void + .returns(T.attached_class) end - def initialize(company_benefits: nil, individual_benefits: nil) + def self.new(company_benefits: nil, individual_benefits: nil) end sig do diff --git a/rbi/lib/finch-api/models/hris/supported_benefit.rbi b/rbi/lib/finch-api/models/hris/supported_benefit.rbi index ea88e4f7..7afe8e13 100644 --- a/rbi/lib/finch-api/models/hris/supported_benefit.rbi +++ b/rbi/lib/finch-api/models/hris/supported_benefit.rbi @@ -4,90 +4,74 @@ module FinchAPI module Models module HRIS class SupportedBenefit < FinchAPI::BaseModel + # Whether the provider supports an annual maximum for this benefit. 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 + attr_accessor :annual_maximum + # Whether the provider supports catch up for this benefit. This field will only be + # true for retirement benefits. 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 + attr_accessor :catch_up + # Supported contribution types. An empty array indicates contributions are not + # supported. sig do - params(_: T.nilable(T::Array[T.nilable(Symbol)])).returns(T.nilable(T::Array[T.nilable(Symbol)])) - end - def company_contribution=(_) + returns( + T.nilable( + T::Array[T.nilable(FinchAPI::Models::HRIS::SupportedBenefit::CompanyContribution::TaggedSymbol)] + ) + ) end + attr_accessor :company_contribution 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 + attr_accessor :description + # Supported deduction types. An empty array indicates deductions are not + # supported. 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 + returns( + T.nilable(T::Array[T.nilable(FinchAPI::Models::HRIS::SupportedBenefit::EmployeeDeduction::TaggedSymbol)]) + ) end + attr_accessor :employee_deduction - sig { params(_: T::Array[T.nilable(Symbol)]).returns(T::Array[T.nilable(Symbol)]) } - def frequencies=(_) - end + # The list of frequencies supported by the provider for this benefit + sig { returns(T.nilable(T::Array[T.nilable(FinchAPI::Models::HRIS::BenefitFrequency::TaggedSymbol)])) } + attr_reader :frequencies - sig { returns(T.nilable(T::Array[T.nilable(Symbol)])) } - def hsa_contribution_limit - end + sig { params(frequencies: T::Array[T.nilable(FinchAPI::Models::HRIS::BenefitFrequency::OrSymbol)]).void } + attr_writer :frequencies + # 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. 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 + returns( + T.nilable( + T::Array[T.nilable(FinchAPI::Models::HRIS::SupportedBenefit::HsaContributionLimit::TaggedSymbol)] + ) + ) end + attr_accessor :hsa_contribution_limit - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def type=(_) - end + # Type of benefit. + sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitType::TaggedSymbol)) } + attr_accessor :type sig do params( annual_maximum: T.nilable(T::Boolean), catch_up: T.nilable(T::Boolean), - company_contribution: T.nilable(T::Array[T.nilable(Symbol)]), + company_contribution: T.nilable(T::Array[T.nilable(FinchAPI::Models::HRIS::SupportedBenefit::CompanyContribution::OrSymbol)]), 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) + employee_deduction: T.nilable(T::Array[T.nilable(FinchAPI::Models::HRIS::SupportedBenefit::EmployeeDeduction::OrSymbol)]), + frequencies: T::Array[T.nilable(FinchAPI::Models::HRIS::BenefitFrequency::OrSymbol)], + hsa_contribution_limit: T.nilable(T::Array[T.nilable(FinchAPI::Models::HRIS::SupportedBenefit::HsaContributionLimit::OrSymbol)]), + type: T.nilable(FinchAPI::Models::HRIS::BenefitType::OrSymbol) ) - .void + .returns(T.attached_class) end - def initialize( + def self.new( annual_maximum: nil, catch_up: nil, company_contribution: nil, @@ -105,47 +89,67 @@ module FinchAPI { annual_maximum: T.nilable(T::Boolean), catch_up: T.nilable(T::Boolean), - company_contribution: T.nilable(T::Array[T.nilable(Symbol)]), + company_contribution: T.nilable( + T::Array[T.nilable(FinchAPI::Models::HRIS::SupportedBenefit::CompanyContribution::TaggedSymbol)] + ), 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) + employee_deduction: T.nilable(T::Array[T.nilable(FinchAPI::Models::HRIS::SupportedBenefit::EmployeeDeduction::TaggedSymbol)]), + frequencies: T::Array[T.nilable(FinchAPI::Models::HRIS::BenefitFrequency::TaggedSymbol)], + hsa_contribution_limit: T.nilable( + T::Array[T.nilable(FinchAPI::Models::HRIS::SupportedBenefit::HsaContributionLimit::TaggedSymbol)] + ), + type: T.nilable(FinchAPI::Models::HRIS::BenefitType::TaggedSymbol) } ) end def to_hash end - class CompanyContribution < FinchAPI::Enum - abstract! + module CompanyContribution + extend FinchAPI::Enum - FIXED = T.let(:fixed, T.nilable(Symbol)) - PERCENT = T.let(:percent, T.nilable(Symbol)) + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::SupportedBenefit::CompanyContribution) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::HRIS::SupportedBenefit::CompanyContribution::TaggedSymbol) } - sig { override.returns(T::Array[Symbol]) } + FIXED = T.let(:fixed, FinchAPI::Models::HRIS::SupportedBenefit::CompanyContribution::TaggedSymbol) + PERCENT = T.let(:percent, FinchAPI::Models::HRIS::SupportedBenefit::CompanyContribution::TaggedSymbol) + + sig { override.returns(T::Array[FinchAPI::Models::HRIS::SupportedBenefit::CompanyContribution::TaggedSymbol]) } def self.values end end - class EmployeeDeduction < FinchAPI::Enum - abstract! + module EmployeeDeduction + extend FinchAPI::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::SupportedBenefit::EmployeeDeduction) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::HRIS::SupportedBenefit::EmployeeDeduction::TaggedSymbol) } - FIXED = T.let(:fixed, T.nilable(Symbol)) - PERCENT = T.let(:percent, T.nilable(Symbol)) + FIXED = T.let(:fixed, FinchAPI::Models::HRIS::SupportedBenefit::EmployeeDeduction::TaggedSymbol) + PERCENT = T.let(:percent, FinchAPI::Models::HRIS::SupportedBenefit::EmployeeDeduction::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig { override.returns(T::Array[FinchAPI::Models::HRIS::SupportedBenefit::EmployeeDeduction::TaggedSymbol]) } def self.values end end - class HsaContributionLimit < FinchAPI::Enum - abstract! + module HsaContributionLimit + extend FinchAPI::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::SupportedBenefit::HsaContributionLimit) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::HRIS::SupportedBenefit::HsaContributionLimit::TaggedSymbol) } - INDIVIDUAL = T.let(:individual, T.nilable(Symbol)) - FAMILY = T.let(:family, T.nilable(Symbol)) + INDIVIDUAL = + T.let(:individual, FinchAPI::Models::HRIS::SupportedBenefit::HsaContributionLimit::TaggedSymbol) + FAMILY = T.let(:family, FinchAPI::Models::HRIS::SupportedBenefit::HsaContributionLimit::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig { override.returns(T::Array[FinchAPI::Models::HRIS::SupportedBenefit::HsaContributionLimit::TaggedSymbol]) } def self.values 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 index dc95d139..822dbf5c 100644 --- a/rbi/lib/finch-api/models/hris/update_company_benefit_response.rbi +++ b/rbi/lib/finch-api/models/hris/update_company_benefit_response.rbi @@ -5,15 +5,10 @@ module FinchAPI module HRIS class UpdateCompanyBenefitResponse < FinchAPI::BaseModel sig { returns(String) } - def benefit_id - end - - sig { params(_: String).returns(String) } - def benefit_id=(_) - end + attr_accessor :benefit_id - sig { params(benefit_id: String).void } - def initialize(benefit_id:) + sig { params(benefit_id: String).returns(T.attached_class) } + def self.new(benefit_id:) end sig { override.returns({benefit_id: String}) } diff --git a/rbi/lib/finch-api/models/hris/w42005.rbi b/rbi/lib/finch-api/models/hris/w42005.rbi index f05a7c9b..78380257 100644 --- a/rbi/lib/finch-api/models/hris/w42005.rbi +++ b/rbi/lib/finch-api/models/hris/w42005.rbi @@ -4,90 +4,89 @@ module FinchAPI module Models module HRIS class W42005 < FinchAPI::BaseModel + # Detailed information specific to the 2005 W4 form. sig { returns(T.nilable(FinchAPI::Models::HRIS::W42005::Data)) } - def data - end + attr_reader :data - sig { params(_: FinchAPI::Models::HRIS::W42005::Data).returns(FinchAPI::Models::HRIS::W42005::Data) } - def data=(_) - end + sig { params(data: T.any(FinchAPI::Models::HRIS::W42005::Data, FinchAPI::Util::AnyHash)).void } + attr_writer :data - sig { returns(T.nilable(Symbol)) } - def type - end + # Specifies the form type, indicating that this document is a 2005 W4 form. + sig { returns(T.nilable(FinchAPI::Models::HRIS::W42005::Type::TaggedSymbol)) } + attr_reader :type - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + sig { params(type: FinchAPI::Models::HRIS::W42005::Type::OrSymbol).void } + attr_writer :type + # The tax year this W4 document applies to. sig { returns(T.nilable(Float)) } - def year + attr_accessor :year + + # A 2005 version of the W-4 tax form containing information on an individual's + # filing status, dependents, and withholding details. + sig do + params( + data: T.any(FinchAPI::Models::HRIS::W42005::Data, FinchAPI::Util::AnyHash), + type: FinchAPI::Models::HRIS::W42005::Type::OrSymbol, + year: T.nilable(Float) + ) + .returns(T.attached_class) end - - sig { params(_: T.nilable(Float)).returns(T.nilable(Float)) } - def year=(_) + def self.new(data: nil, type: nil, year: nil) end - sig { params(data: FinchAPI::Models::HRIS::W42005::Data, type: Symbol, year: T.nilable(Float)).void } - def initialize(data: nil, type: nil, year: nil) + sig do + override + .returns( + { + data: FinchAPI::Models::HRIS::W42005::Data, + type: FinchAPI::Models::HRIS::W42005::Type::TaggedSymbol, + year: T.nilable(Float) + } + ) end - - sig { override.returns({data: FinchAPI::Models::HRIS::W42005::Data, type: Symbol, year: T.nilable(Float)}) } def to_hash end class Data < FinchAPI::BaseModel + # Additional withholding amount (in cents). sig { returns(T.nilable(Integer)) } - def additional_withholding - end + attr_accessor :additional_withholding - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def additional_withholding=(_) - end + # Indicates exemption status from federal tax withholding. + sig { returns(T.nilable(FinchAPI::Models::HRIS::W42005::Data::Exemption::TaggedSymbol)) } + attr_reader :exemption - sig { returns(T.nilable(Symbol)) } - def exemption - end + sig { params(exemption: FinchAPI::Models::HRIS::W42005::Data::Exemption::OrSymbol).void } + attr_writer :exemption - 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 + # The individual's filing status for tax purposes. + sig { returns(T.nilable(FinchAPI::Models::HRIS::W42005::Data::FilingStatus::TaggedSymbol)) } + attr_accessor :filing_status + # The unique identifier for the individual associated with this 2005 W4 form. sig { returns(T.nilable(String)) } - def individual_id - end + attr_reader :individual_id - sig { params(_: String).returns(String) } - def individual_id=(_) - end + sig { params(individual_id: String).void } + attr_writer :individual_id + # Total number of allowances claimed (in cents). 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 + attr_accessor :total_number_of_allowances + # Detailed information specific to the 2005 W4 form. sig do params( additional_withholding: T.nilable(Integer), - exemption: Symbol, - filing_status: Symbol, + exemption: FinchAPI::Models::HRIS::W42005::Data::Exemption::OrSymbol, + filing_status: T.nilable(FinchAPI::Models::HRIS::W42005::Data::FilingStatus::OrSymbol), individual_id: String, total_number_of_allowances: T.nilable(Integer) ) - .void + .returns(T.attached_class) end - def initialize( + def self.new( additional_withholding: nil, exemption: nil, filing_status: nil, @@ -101,8 +100,8 @@ module FinchAPI .returns( { additional_withholding: T.nilable(Integer), - exemption: Symbol, - filing_status: Symbol, + exemption: FinchAPI::Models::HRIS::W42005::Data::Exemption::TaggedSymbol, + filing_status: T.nilable(FinchAPI::Models::HRIS::W42005::Data::FilingStatus::TaggedSymbol), individual_id: String, total_number_of_allowances: T.nilable(Integer) } @@ -111,36 +110,53 @@ module FinchAPI def to_hash end - class Exemption < FinchAPI::Enum - abstract! + # Indicates exemption status from federal tax withholding. + module Exemption + extend FinchAPI::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::W42005::Data::Exemption) } + OrSymbol = T.type_alias { T.any(Symbol, FinchAPI::Models::HRIS::W42005::Data::Exemption::TaggedSymbol) } - EXEMPT = :exempt - NON_EXEMPT = :non_exempt + EXEMPT = T.let(:exempt, FinchAPI::Models::HRIS::W42005::Data::Exemption::TaggedSymbol) + NON_EXEMPT = T.let(:non_exempt, FinchAPI::Models::HRIS::W42005::Data::Exemption::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig { override.returns(T::Array[FinchAPI::Models::HRIS::W42005::Data::Exemption::TaggedSymbol]) } def self.values end end - class FilingStatus < FinchAPI::Enum - abstract! + # The individual's filing status for tax purposes. + module FilingStatus + extend FinchAPI::Enum - MARRIED = :married - MARRIED_BUT_WITHHOLD_AT_HIGHER_SINGLE_RATE = :married_but_withhold_at_higher_single_rate - SINGLE = :single + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::W42005::Data::FilingStatus) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::HRIS::W42005::Data::FilingStatus::TaggedSymbol) } - sig { override.returns(T::Array[Symbol]) } + MARRIED = T.let(:married, FinchAPI::Models::HRIS::W42005::Data::FilingStatus::TaggedSymbol) + MARRIED_BUT_WITHHOLD_AT_HIGHER_SINGLE_RATE = + T.let( + :married_but_withhold_at_higher_single_rate, + FinchAPI::Models::HRIS::W42005::Data::FilingStatus::TaggedSymbol + ) + SINGLE = T.let(:single, FinchAPI::Models::HRIS::W42005::Data::FilingStatus::TaggedSymbol) + + sig { override.returns(T::Array[FinchAPI::Models::HRIS::W42005::Data::FilingStatus::TaggedSymbol]) } def self.values end end end - class Type < FinchAPI::Enum - abstract! + # Specifies the form type, indicating that this document is a 2005 W4 form. + module Type + extend FinchAPI::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::W42005::Type) } + OrSymbol = T.type_alias { T.any(Symbol, FinchAPI::Models::HRIS::W42005::Type::TaggedSymbol) } - W4_2005 = :w4_2005 + W4_2005 = T.let(:w4_2005, FinchAPI::Models::HRIS::W42005::Type::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig { override.returns(T::Array[FinchAPI::Models::HRIS::W42005::Type::TaggedSymbol]) } def self.values end end diff --git a/rbi/lib/finch-api/models/hris/w42020.rbi b/rbi/lib/finch-api/models/hris/w42020.rbi index 43d18748..f8852091 100644 --- a/rbi/lib/finch-api/models/hris/w42020.rbi +++ b/rbi/lib/finch-api/models/hris/w42020.rbi @@ -4,117 +4,102 @@ module FinchAPI module Models module HRIS class W42020 < FinchAPI::BaseModel + # Detailed information specific to the 2020 W4 form. sig { returns(T.nilable(FinchAPI::Models::HRIS::W42020::Data)) } - def data - end + attr_reader :data - sig { params(_: FinchAPI::Models::HRIS::W42020::Data).returns(FinchAPI::Models::HRIS::W42020::Data) } - def data=(_) - end + sig { params(data: T.any(FinchAPI::Models::HRIS::W42020::Data, FinchAPI::Util::AnyHash)).void } + attr_writer :data - sig { returns(T.nilable(Symbol)) } - def type - end + # Specifies the form type, indicating that this document is a 2020 W4 form. + sig { returns(T.nilable(FinchAPI::Models::HRIS::W42020::Type::TaggedSymbol)) } + attr_reader :type - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + sig { params(type: FinchAPI::Models::HRIS::W42020::Type::OrSymbol).void } + attr_writer :type + # The tax year this W4 document applies to. sig { returns(T.nilable(Float)) } - def year + attr_accessor :year + + # A 2020 version of the W-4 tax form containing information on an individual's + # filing status, dependents, and withholding details. + sig do + params( + data: T.any(FinchAPI::Models::HRIS::W42020::Data, FinchAPI::Util::AnyHash), + type: FinchAPI::Models::HRIS::W42020::Type::OrSymbol, + year: T.nilable(Float) + ) + .returns(T.attached_class) end - - sig { params(_: T.nilable(Float)).returns(T.nilable(Float)) } - def year=(_) + def self.new(data: nil, type: nil, year: nil) end - sig { params(data: FinchAPI::Models::HRIS::W42020::Data, type: Symbol, year: T.nilable(Float)).void } - def initialize(data: nil, type: nil, year: nil) + sig do + override + .returns( + { + data: FinchAPI::Models::HRIS::W42020::Data, + type: FinchAPI::Models::HRIS::W42020::Type::TaggedSymbol, + year: T.nilable(Float) + } + ) end - - sig { override.returns({data: FinchAPI::Models::HRIS::W42020::Data, type: Symbol, year: T.nilable(Float)}) } def to_hash end class Data < FinchAPI::BaseModel + # Amount claimed for dependents other than qualifying children under 17 (in + # cents). 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 + attr_accessor :amount_for_other_dependents + # Amount claimed for dependents under 17 years old (in cents). 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 + attr_accessor :amount_for_qualifying_children_under_17 + # Deductible expenses (in cents). sig { returns(T.nilable(Integer)) } - def deductions - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def deductions=(_) - end + attr_accessor :deductions + # Additional withholding amount (in cents). sig { returns(T.nilable(Integer)) } - def extra_withholding - end + attr_accessor :extra_withholding - 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 + # The individual's filing status for tax purposes. + sig { returns(T.nilable(FinchAPI::Models::HRIS::W42020::Data::FilingStatus::TaggedSymbol)) } + attr_accessor :filing_status + # The unique identifier for the individual associated with this document. sig { returns(T.nilable(String)) } - def individual_id - end + attr_reader :individual_id - sig { params(_: String).returns(String) } - def individual_id=(_) - end + sig { params(individual_id: String).void } + attr_writer :individual_id + # Additional income from sources outside of primary employment (in cents). sig { returns(T.nilable(Integer)) } - def other_income - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def other_income=(_) - end + attr_accessor :other_income + # Total amount claimed for dependents and other credits (in cents). 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 + attr_accessor :total_claim_dependent_and_other_credits + # Detailed information specific to the 2020 W4 form. 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), + filing_status: T.nilable(FinchAPI::Models::HRIS::W42020::Data::FilingStatus::OrSymbol), individual_id: String, other_income: T.nilable(Integer), total_claim_dependent_and_other_credits: T.nilable(Integer) ) - .void + .returns(T.attached_class) end - def initialize( + def self.new( amount_for_other_dependents: nil, amount_for_qualifying_children_under_17: nil, deductions: nil, @@ -134,7 +119,7 @@ module FinchAPI amount_for_qualifying_children_under_17: T.nilable(Integer), deductions: T.nilable(Integer), extra_withholding: T.nilable(Integer), - filing_status: T.nilable(Symbol), + filing_status: T.nilable(FinchAPI::Models::HRIS::W42020::Data::FilingStatus::TaggedSymbol), individual_id: String, other_income: T.nilable(Integer), total_claim_dependent_and_other_credits: T.nilable(Integer) @@ -144,30 +129,43 @@ module FinchAPI def to_hash end - class FilingStatus < FinchAPI::Enum - abstract! + # The individual's filing status for tax purposes. + module FilingStatus + extend FinchAPI::Enum - 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) - ) + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::W42020::Data::FilingStatus) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::HRIS::W42020::Data::FilingStatus::TaggedSymbol) } - sig { override.returns(T::Array[Symbol]) } + HEAD_OF_HOUSEHOLD = + T.let(:head_of_household, FinchAPI::Models::HRIS::W42020::Data::FilingStatus::TaggedSymbol) + MARRIED_FILING_JOINTLY_OR_QUALIFYING_SURVIVING_SPOUSE = + T.let( + :married_filing_jointly_or_qualifying_surviving_spouse, + FinchAPI::Models::HRIS::W42020::Data::FilingStatus::TaggedSymbol + ) + SINGLE_OR_MARRIED_FILING_SEPARATELY = + T.let( + :single_or_married_filing_separately, + FinchAPI::Models::HRIS::W42020::Data::FilingStatus::TaggedSymbol + ) + + sig { override.returns(T::Array[FinchAPI::Models::HRIS::W42020::Data::FilingStatus::TaggedSymbol]) } def self.values end end end - class Type < FinchAPI::Enum - abstract! + # Specifies the form type, indicating that this document is a 2020 W4 form. + module Type + extend FinchAPI::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::HRIS::W42020::Type) } + OrSymbol = T.type_alias { T.any(Symbol, FinchAPI::Models::HRIS::W42020::Type::TaggedSymbol) } - W4_2020 = :w4_2020 + W4_2020 = T.let(:w4_2020, FinchAPI::Models::HRIS::W42020::Type::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig { override.returns(T::Array[FinchAPI::Models::HRIS::W42020::Type::TaggedSymbol]) } def self.values end end diff --git a/rbi/lib/finch-api/models/income.rbi b/rbi/lib/finch-api/models/income.rbi index 5c93bb0e..667a7e62 100644 --- a/rbi/lib/finch-api/models/income.rbi +++ b/rbi/lib/finch-api/models/income.rbi @@ -3,48 +3,36 @@ module FinchAPI module Models class Income < FinchAPI::BaseModel + # The income amount in cents. sig { returns(T.nilable(Integer)) } - def amount - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def amount=(_) - end + attr_accessor :amount + # The currency code. sig { returns(T.nilable(String)) } - def currency - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def currency=(_) - end + attr_accessor :currency + # The date the income amount went into effect. sig { returns(T.nilable(String)) } - def effective_date - end + attr_accessor :effective_date - 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 + # The income unit of payment. Options: `yearly`, `quarterly`, `monthly`, + # `semi_monthly`, `bi_weekly`, `weekly`, `daily`, `hourly`, and `fixed`. + sig { returns(T.nilable(FinchAPI::Models::Income::Unit::OrSymbol)) } + attr_accessor :unit + # 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. sig do params( amount: T.nilable(Integer), currency: T.nilable(String), effective_date: T.nilable(String), - unit: T.nilable(Symbol) + unit: T.nilable(FinchAPI::Models::Income::Unit::OrSymbol) ) - .void + .returns(T.attached_class) end - def initialize(amount: nil, currency: nil, effective_date: nil, unit: nil) + def self.new(amount: nil, currency: nil, effective_date: nil, unit: nil) end sig do @@ -54,27 +42,32 @@ module FinchAPI amount: T.nilable(Integer), currency: T.nilable(String), effective_date: T.nilable(String), - unit: T.nilable(Symbol) + unit: T.nilable(FinchAPI::Models::Income::Unit::OrSymbol) } ) end def to_hash end - class Unit < FinchAPI::Enum - abstract! + # The income unit of payment. Options: `yearly`, `quarterly`, `monthly`, + # `semi_monthly`, `bi_weekly`, `weekly`, `daily`, `hourly`, and `fixed`. + module Unit + extend FinchAPI::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::Income::Unit) } + OrSymbol = T.type_alias { T.any(Symbol, FinchAPI::Models::Income::Unit::TaggedSymbol) } - 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)) + YEARLY = T.let(:yearly, FinchAPI::Models::Income::Unit::TaggedSymbol) + QUARTERLY = T.let(:quarterly, FinchAPI::Models::Income::Unit::TaggedSymbol) + MONTHLY = T.let(:monthly, FinchAPI::Models::Income::Unit::TaggedSymbol) + SEMI_MONTHLY = T.let(:semi_monthly, FinchAPI::Models::Income::Unit::TaggedSymbol) + BI_WEEKLY = T.let(:bi_weekly, FinchAPI::Models::Income::Unit::TaggedSymbol) + WEEKLY = T.let(:weekly, FinchAPI::Models::Income::Unit::TaggedSymbol) + DAILY = T.let(:daily, FinchAPI::Models::Income::Unit::TaggedSymbol) + HOURLY = T.let(:hourly, FinchAPI::Models::Income::Unit::TaggedSymbol) + FIXED = T.let(:fixed, FinchAPI::Models::Income::Unit::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig { override.returns(T::Array[FinchAPI::Models::Income::Unit::TaggedSymbol]) } def self.values end end diff --git a/rbi/lib/finch-api/models/individual_event.rbi b/rbi/lib/finch-api/models/individual_event.rbi index c4eeb27b..2a8dc066 100644 --- a/rbi/lib/finch-api/models/individual_event.rbi +++ b/rbi/lib/finch-api/models/individual_event.rbi @@ -4,40 +4,49 @@ module FinchAPI module Models class IndividualEvent < FinchAPI::Models::BaseWebhookEvent sig { returns(T.nilable(FinchAPI::Models::IndividualEvent::Data)) } - def data - end + attr_reader :data - sig { params(_: FinchAPI::Models::IndividualEvent::Data).returns(FinchAPI::Models::IndividualEvent::Data) } - def data=(_) - end + sig { params(data: T.any(FinchAPI::Models::IndividualEvent::Data, FinchAPI::Util::AnyHash)).void } + attr_writer :data - sig { returns(T.nilable(Symbol)) } - def event_type - end + sig { returns(T.nilable(FinchAPI::Models::IndividualEvent::EventType::TaggedSymbol)) } + attr_reader :event_type - sig { params(_: Symbol).returns(Symbol) } - def event_type=(_) - end + sig { params(event_type: FinchAPI::Models::IndividualEvent::EventType::OrSymbol).void } + attr_writer :event_type - sig { params(data: FinchAPI::Models::IndividualEvent::Data, event_type: Symbol).void } - def initialize(data: nil, event_type: nil) + sig do + params( + data: T.any(FinchAPI::Models::IndividualEvent::Data, FinchAPI::Util::AnyHash), + event_type: FinchAPI::Models::IndividualEvent::EventType::OrSymbol + ) + .returns(T.attached_class) + end + def self.new(data: nil, event_type: nil) end - sig { override.returns({data: FinchAPI::Models::IndividualEvent::Data, event_type: Symbol}) } + sig do + override + .returns( + { + data: FinchAPI::Models::IndividualEvent::Data, + event_type: FinchAPI::Models::IndividualEvent::EventType::TaggedSymbol + } + ) + end def to_hash end class Data < FinchAPI::BaseModel + # The ID of the individual related to the event. sig { returns(T.nilable(String)) } - def individual_id - end - - sig { params(_: String).returns(String) } - def individual_id=(_) - end + attr_reader :individual_id sig { params(individual_id: String).void } - def initialize(individual_id: nil) + attr_writer :individual_id + + sig { params(individual_id: String).returns(T.attached_class) } + def self.new(individual_id: nil) end sig { override.returns({individual_id: String}) } @@ -45,14 +54,20 @@ module FinchAPI end end - class EventType < FinchAPI::Enum - abstract! + module EventType + extend FinchAPI::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::IndividualEvent::EventType) } + OrSymbol = T.type_alias { T.any(Symbol, FinchAPI::Models::IndividualEvent::EventType::TaggedSymbol) } - INDIVIDUAL_CREATED = :"individual.created" - INDIVIDUAL_UPDATED = :"individual.updated" - INDIVIDUAL_DELETED = :"individual.deleted" + INDIVIDUAL_CREATED = + T.let(:"individual.created", FinchAPI::Models::IndividualEvent::EventType::TaggedSymbol) + INDIVIDUAL_UPDATED = + T.let(:"individual.updated", FinchAPI::Models::IndividualEvent::EventType::TaggedSymbol) + INDIVIDUAL_DELETED = + T.let(:"individual.deleted", FinchAPI::Models::IndividualEvent::EventType::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig { override.returns(T::Array[FinchAPI::Models::IndividualEvent::EventType::TaggedSymbol]) } def self.values end end diff --git a/rbi/lib/finch-api/models/introspection.rbi b/rbi/lib/finch-api/models/introspection.rbi index a8ca675f..dd5311c6 100644 --- a/rbi/lib/finch-api/models/introspection.rbi +++ b/rbi/lib/finch-api/models/introspection.rbi @@ -3,150 +3,97 @@ module FinchAPI module Models class Introspection < FinchAPI::BaseModel + # [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection + # instead of this account ID. sig { returns(String) } - def account_id - end - - sig { params(_: String).returns(String) } - def account_id=(_) - end + attr_accessor :account_id 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 + attr_accessor :authentication_methods + # The client ID of the application associated with the `access_token`. sig { returns(String) } - def client_id - end - - sig { params(_: String).returns(String) } - def client_id=(_) - end + attr_accessor :client_id - sig { returns(Symbol) } - def client_type - end - - sig { params(_: Symbol).returns(Symbol) } - def client_type=(_) - end + # The type of application associated with a token. + sig { returns(FinchAPI::Models::Introspection::ClientType::TaggedSymbol) } + attr_accessor :client_type + # [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection + # instead of this company ID. sig { returns(String) } - def company_id - end - - sig { params(_: String).returns(String) } - def company_id=(_) - end + attr_accessor :company_id + # The Finch UUID of the connection associated with the `access_token`. sig { returns(String) } - def connection_id - end - - sig { params(_: String).returns(String) } - def connection_id=(_) - end + attr_accessor :connection_id sig { returns(FinchAPI::Models::Introspection::ConnectionStatus) } - def connection_status - end + attr_reader :connection_status sig do - params(_: FinchAPI::Models::Introspection::ConnectionStatus) - .returns(FinchAPI::Models::Introspection::ConnectionStatus) - end - def connection_status=(_) - end - - sig { returns(Symbol) } - def connection_type + params( + connection_status: T.any(FinchAPI::Models::Introspection::ConnectionStatus, FinchAPI::Util::AnyHash) + ) + .void end + attr_writer :connection_status - sig { params(_: Symbol).returns(Symbol) } - def connection_type=(_) - end + # The type of the connection associated with the token. + # + # - `provider` - connection to an external provider + # - `finch` - finch-generated data. + sig { returns(FinchAPI::Models::Introspection::ConnectionType::TaggedSymbol) } + attr_accessor :connection_type + # The email of your customer you provided to Finch when a connect session was + # created for this connection. sig { returns(T.nilable(String)) } - def customer_email - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def customer_email=(_) - end + attr_accessor :customer_email + # The ID of your customer you provided to Finch when a connect session was created + # for this connection. sig { returns(T.nilable(String)) } - def customer_id - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def customer_id=(_) - end + attr_accessor :customer_id + # The name of your customer you provided to Finch when a connect session was + # created for this connection. sig { returns(T.nilable(String)) } - def customer_name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def customer_name=(_) - end + attr_accessor :customer_name + # Whether the connection associated with the `access_token` uses the Assisted + # Connect Flow. (`true` if using Assisted Connect, `false` if connection is + # automated) sig { returns(T::Boolean) } - def manual - end - - sig { params(_: T::Boolean).returns(T::Boolean) } - def manual=(_) - end + attr_accessor :manual + # [DEPRECATED] Use `provider_id` to identify the provider instead of this payroll + # provider ID. sig { returns(String) } - def payroll_provider_id - end - - sig { params(_: String).returns(String) } - def payroll_provider_id=(_) - end + attr_accessor :payroll_provider_id + # An array of the authorized products associated with the `access_token`. sig { returns(T::Array[String]) } - def products - end - - sig { params(_: T::Array[String]).returns(T::Array[String]) } - def products=(_) - end + attr_accessor :products + # The ID of the provider associated with the `access_token`. sig { returns(String) } - def provider_id - end - - sig { params(_: String).returns(String) } - def provider_id=(_) - end + attr_accessor :provider_id + # The account username used for login associated with the `access_token`. sig { returns(String) } - def username - end - - sig { params(_: String).returns(String) } - def username=(_) - end + attr_accessor :username sig do params( account_id: String, - authentication_methods: T::Array[FinchAPI::Models::Introspection::AuthenticationMethod], + authentication_methods: T::Array[T.any(FinchAPI::Models::Introspection::AuthenticationMethod, FinchAPI::Util::AnyHash)], client_id: String, - client_type: Symbol, + client_type: FinchAPI::Models::Introspection::ClientType::OrSymbol, company_id: String, connection_id: String, - connection_status: FinchAPI::Models::Introspection::ConnectionStatus, - connection_type: Symbol, + connection_status: T.any(FinchAPI::Models::Introspection::ConnectionStatus, FinchAPI::Util::AnyHash), + connection_type: FinchAPI::Models::Introspection::ConnectionType::OrSymbol, customer_email: T.nilable(String), customer_id: T.nilable(String), customer_name: T.nilable(String), @@ -156,9 +103,9 @@ module FinchAPI provider_id: String, username: String ) - .void + .returns(T.attached_class) end - def initialize( + def self.new( account_id:, authentication_methods:, client_id:, @@ -185,11 +132,11 @@ module FinchAPI account_id: String, authentication_methods: T::Array[FinchAPI::Models::Introspection::AuthenticationMethod], client_id: String, - client_type: Symbol, + client_type: FinchAPI::Models::Introspection::ClientType::TaggedSymbol, company_id: String, connection_id: String, connection_status: FinchAPI::Models::Introspection::ConnectionStatus, - connection_type: Symbol, + connection_type: FinchAPI::Models::Introspection::ConnectionType::TaggedSymbol, customer_email: T.nilable(String), customer_id: T.nilable(String), customer_name: T.nilable(String), @@ -206,41 +153,39 @@ module FinchAPI class AuthenticationMethod < FinchAPI::BaseModel sig { returns(T.nilable(FinchAPI::Models::Introspection::AuthenticationMethod::ConnectionStatus)) } - def connection_status - end + attr_reader :connection_status sig do - params(_: FinchAPI::Models::Introspection::AuthenticationMethod::ConnectionStatus) - .returns(FinchAPI::Models::Introspection::AuthenticationMethod::ConnectionStatus) - end - def connection_status=(_) + params( + connection_status: T.any(FinchAPI::Models::Introspection::AuthenticationMethod::ConnectionStatus, FinchAPI::Util::AnyHash) + ) + .void end + attr_writer :connection_status + # An array of the authorized products associated with the `access_token`. sig { returns(T.nilable(T::Array[String])) } - def products - end + attr_reader :products - sig { params(_: T::Array[String]).returns(T::Array[String]) } - def products=(_) - end + sig { params(products: T::Array[String]).void } + attr_writer :products - sig { returns(T.nilable(Symbol)) } - def type - end + # The type of authentication method. + sig { returns(T.nilable(FinchAPI::Models::Introspection::AuthenticationMethod::Type::TaggedSymbol)) } + attr_reader :type - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + sig { params(type: FinchAPI::Models::Introspection::AuthenticationMethod::Type::OrSymbol).void } + attr_writer :type sig do params( - connection_status: FinchAPI::Models::Introspection::AuthenticationMethod::ConnectionStatus, + connection_status: T.any(FinchAPI::Models::Introspection::AuthenticationMethod::ConnectionStatus, FinchAPI::Util::AnyHash), products: T::Array[String], - type: Symbol + type: FinchAPI::Models::Introspection::AuthenticationMethod::Type::OrSymbol ) - .void + .returns(T.attached_class) end - def initialize(connection_status: nil, products: nil, type: nil) + def self.new(connection_status: nil, products: nil, type: nil) end sig do @@ -249,7 +194,7 @@ module FinchAPI { connection_status: FinchAPI::Models::Introspection::AuthenticationMethod::ConnectionStatus, products: T::Array[String], - type: Symbol + type: FinchAPI::Models::Introspection::AuthenticationMethod::Type::TaggedSymbol } ) end @@ -258,90 +203,105 @@ module FinchAPI class ConnectionStatus < FinchAPI::BaseModel sig { returns(T.nilable(String)) } - def message - end + attr_reader :message - sig { params(_: String).returns(String) } - def message=(_) - end + sig { params(message: String).void } + attr_writer :message - sig { returns(T.nilable(Symbol)) } - def status - end + sig { returns(T.nilable(FinchAPI::Models::ConnectionStatusType::TaggedSymbol)) } + attr_reader :status - sig { params(_: Symbol).returns(Symbol) } - def status=(_) - end + sig { params(status: FinchAPI::Models::ConnectionStatusType::OrSymbol).void } + attr_writer :status - sig { params(message: String, status: Symbol).void } - def initialize(message: nil, status: nil) + sig do + params(message: String, status: FinchAPI::Models::ConnectionStatusType::OrSymbol).returns(T.attached_class) + end + def self.new(message: nil, status: nil) end - sig { override.returns({message: String, status: Symbol}) } + sig { override.returns({message: String, status: FinchAPI::Models::ConnectionStatusType::TaggedSymbol}) } def to_hash end end - class Type < FinchAPI::Enum - abstract! + # The type of authentication method. + module Type + extend FinchAPI::Enum - ASSISTED = :assisted - CREDENTIAL = :credential - API_TOKEN = :api_token - API_CREDENTIAL = :api_credential - OAUTH = :oauth + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::Introspection::AuthenticationMethod::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Introspection::AuthenticationMethod::Type::TaggedSymbol) } - sig { override.returns(T::Array[Symbol]) } + ASSISTED = T.let(:assisted, FinchAPI::Models::Introspection::AuthenticationMethod::Type::TaggedSymbol) + CREDENTIAL = + T.let(:credential, FinchAPI::Models::Introspection::AuthenticationMethod::Type::TaggedSymbol) + API_TOKEN = T.let(:api_token, FinchAPI::Models::Introspection::AuthenticationMethod::Type::TaggedSymbol) + API_CREDENTIAL = + T.let(:api_credential, FinchAPI::Models::Introspection::AuthenticationMethod::Type::TaggedSymbol) + OAUTH = T.let(:oauth, FinchAPI::Models::Introspection::AuthenticationMethod::Type::TaggedSymbol) + + sig { override.returns(T::Array[FinchAPI::Models::Introspection::AuthenticationMethod::Type::TaggedSymbol]) } def self.values end end end - class ClientType < FinchAPI::Enum - abstract! + # The type of application associated with a token. + module ClientType + extend FinchAPI::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::Introspection::ClientType) } + OrSymbol = T.type_alias { T.any(Symbol, FinchAPI::Models::Introspection::ClientType::TaggedSymbol) } - PRODUCTION = :production - DEVELOPMENT = :development - SANDBOX = :sandbox + PRODUCTION = T.let(:production, FinchAPI::Models::Introspection::ClientType::TaggedSymbol) + DEVELOPMENT = T.let(:development, FinchAPI::Models::Introspection::ClientType::TaggedSymbol) + SANDBOX = T.let(:sandbox, FinchAPI::Models::Introspection::ClientType::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig { override.returns(T::Array[FinchAPI::Models::Introspection::ClientType::TaggedSymbol]) } def self.values end end class ConnectionStatus < FinchAPI::BaseModel sig { returns(T.nilable(String)) } - def message - end + attr_reader :message - sig { params(_: String).returns(String) } - def message=(_) - end + sig { params(message: String).void } + attr_writer :message - sig { returns(T.nilable(Symbol)) } - def status - end + sig { returns(T.nilable(FinchAPI::Models::ConnectionStatusType::TaggedSymbol)) } + attr_reader :status - sig { params(_: Symbol).returns(Symbol) } - def status=(_) - end + sig { params(status: FinchAPI::Models::ConnectionStatusType::OrSymbol).void } + attr_writer :status - sig { params(message: String, status: Symbol).void } - def initialize(message: nil, status: nil) + sig do + params(message: String, status: FinchAPI::Models::ConnectionStatusType::OrSymbol).returns(T.attached_class) + end + def self.new(message: nil, status: nil) end - sig { override.returns({message: String, status: Symbol}) } + sig { override.returns({message: String, status: FinchAPI::Models::ConnectionStatusType::TaggedSymbol}) } def to_hash end end - class ConnectionType < FinchAPI::Enum - abstract! + # The type of the connection associated with the token. + # + # - `provider` - connection to an external provider + # - `finch` - finch-generated data. + module ConnectionType + extend FinchAPI::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::Introspection::ConnectionType) } + OrSymbol = T.type_alias { T.any(Symbol, FinchAPI::Models::Introspection::ConnectionType::TaggedSymbol) } - PROVIDER = :provider - FINCH = :finch + PROVIDER = T.let(:provider, FinchAPI::Models::Introspection::ConnectionType::TaggedSymbol) + FINCH = T.let(:finch, FinchAPI::Models::Introspection::ConnectionType::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig { override.returns(T::Array[FinchAPI::Models::Introspection::ConnectionType::TaggedSymbol]) } def self.values end end diff --git a/rbi/lib/finch-api/models/job_completion_event.rbi b/rbi/lib/finch-api/models/job_completion_event.rbi index 66bf53f7..dff4174b 100644 --- a/rbi/lib/finch-api/models/job_completion_event.rbi +++ b/rbi/lib/finch-api/models/job_completion_event.rbi @@ -4,48 +4,50 @@ module FinchAPI module Models class JobCompletionEvent < FinchAPI::Models::BaseWebhookEvent sig { returns(T.nilable(FinchAPI::Models::JobCompletionEvent::Data)) } - def data - end + attr_reader :data - sig { params(_: FinchAPI::Models::JobCompletionEvent::Data).returns(FinchAPI::Models::JobCompletionEvent::Data) } - def data=(_) - end + sig { params(data: T.any(FinchAPI::Models::JobCompletionEvent::Data, FinchAPI::Util::AnyHash)).void } + attr_writer :data - sig { returns(T.nilable(Symbol)) } - def event_type - end + sig { returns(T.nilable(FinchAPI::Models::JobCompletionEvent::EventType::TaggedSymbol)) } + attr_reader :event_type - sig { params(_: Symbol).returns(Symbol) } - def event_type=(_) - end + sig { params(event_type: FinchAPI::Models::JobCompletionEvent::EventType::OrSymbol).void } + attr_writer :event_type - sig { params(data: FinchAPI::Models::JobCompletionEvent::Data, event_type: Symbol).void } - def initialize(data: nil, event_type: nil) + sig do + params( + data: T.any(FinchAPI::Models::JobCompletionEvent::Data, FinchAPI::Util::AnyHash), + event_type: FinchAPI::Models::JobCompletionEvent::EventType::OrSymbol + ) + .returns(T.attached_class) + end + def self.new(data: nil, event_type: nil) end - sig { override.returns({data: FinchAPI::Models::JobCompletionEvent::Data, event_type: Symbol}) } + sig do + override + .returns( + { + data: FinchAPI::Models::JobCompletionEvent::Data, + event_type: FinchAPI::Models::JobCompletionEvent::EventType::TaggedSymbol + } + ) + end def to_hash end class Data < FinchAPI::BaseModel + # The id of the job which has completed. sig { returns(String) } - def job_id - end - - sig { params(_: String).returns(String) } - def job_id=(_) - end + attr_accessor :job_id + # The url to query the result of the job. sig { returns(String) } - def job_url - end + attr_accessor :job_url - sig { params(_: String).returns(String) } - def job_url=(_) - end - - sig { params(job_id: String, job_url: String).void } - def initialize(job_id:, job_url:) + sig { params(job_id: String, job_url: String).returns(T.attached_class) } + def self.new(job_id:, job_url:) end sig { override.returns({job_id: String, job_url: String}) } @@ -53,17 +55,26 @@ module FinchAPI end end - class EventType < FinchAPI::Enum - abstract! + module EventType + extend FinchAPI::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::JobCompletionEvent::EventType) } + OrSymbol = T.type_alias { T.any(Symbol, FinchAPI::Models::JobCompletionEvent::EventType::TaggedSymbol) } - 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" + JOB_BENEFIT_CREATE_COMPLETED = + T.let(:"job.benefit_create.completed", FinchAPI::Models::JobCompletionEvent::EventType::TaggedSymbol) + JOB_BENEFIT_ENROLL_COMPLETED = + T.let(:"job.benefit_enroll.completed", FinchAPI::Models::JobCompletionEvent::EventType::TaggedSymbol) + JOB_BENEFIT_REGISTER_COMPLETED = + T.let(:"job.benefit_register.completed", FinchAPI::Models::JobCompletionEvent::EventType::TaggedSymbol) + JOB_BENEFIT_UNENROLL_COMPLETED = + T.let(:"job.benefit_unenroll.completed", FinchAPI::Models::JobCompletionEvent::EventType::TaggedSymbol) + JOB_BENEFIT_UPDATE_COMPLETED = + T.let(:"job.benefit_update.completed", FinchAPI::Models::JobCompletionEvent::EventType::TaggedSymbol) + JOB_DATA_SYNC_ALL_COMPLETED = + T.let(:"job.data_sync_all.completed", FinchAPI::Models::JobCompletionEvent::EventType::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig { override.returns(T::Array[FinchAPI::Models::JobCompletionEvent::EventType::TaggedSymbol]) } def self.values 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 index ed1d0b60..f07be912 100644 --- a/rbi/lib/finch-api/models/jobs/automated_async_job.rbi +++ b/rbi/lib/finch-api/models/jobs/automated_async_job.rbi @@ -4,80 +4,52 @@ module FinchAPI module Models module Jobs class AutomatedAsyncJob < FinchAPI::BaseModel + # The datetime the job completed. sig { returns(T.nilable(Time)) } - def completed_at - end - - sig { params(_: T.nilable(Time)).returns(T.nilable(Time)) } - def completed_at=(_) - end + attr_accessor :completed_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. sig { returns(Time) } - def created_at - end - - sig { params(_: Time).returns(Time) } - def created_at=(_) - end + attr_accessor :created_at + # The id of the job that has been created. sig { returns(String) } - def job_id - end - - sig { params(_: String).returns(String) } - def job_id=(_) - end + attr_accessor :job_id + # The url that can be used to retrieve the job status sig { returns(String) } - def job_url - end - - sig { params(_: String).returns(String) } - def job_url=(_) - end + attr_accessor :job_url + # The input parameters for the job. sig { returns(T.nilable(FinchAPI::Models::Jobs::AutomatedAsyncJob::Params)) } - def params - end + attr_reader :params sig do - params(_: T.nilable(FinchAPI::Models::Jobs::AutomatedAsyncJob::Params)) - .returns(T.nilable(FinchAPI::Models::Jobs::AutomatedAsyncJob::Params)) - end - def params=(_) + params( + params: T.nilable(T.any(FinchAPI::Models::Jobs::AutomatedAsyncJob::Params, FinchAPI::Util::AnyHash)) + ) + .void end + attr_writer :params + # 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. sig { returns(T.nilable(Time)) } - def scheduled_at - end - - sig { params(_: T.nilable(Time)).returns(T.nilable(Time)) } - def scheduled_at=(_) - end + attr_accessor :scheduled_at + # The datetime a job entered into the job queue. 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 + attr_accessor :started_at - sig { returns(Symbol) } - def type - end + sig { returns(FinchAPI::Models::Jobs::AutomatedAsyncJob::Status::TaggedSymbol) } + attr_accessor :status - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + # The type of automated job + sig { returns(FinchAPI::Models::Jobs::AutomatedAsyncJob::Type::TaggedSymbol) } + attr_accessor :type sig do params( @@ -85,25 +57,15 @@ module FinchAPI created_at: Time, job_id: String, job_url: String, - params: T.nilable(FinchAPI::Models::Jobs::AutomatedAsyncJob::Params), + params: T.nilable(T.any(FinchAPI::Models::Jobs::AutomatedAsyncJob::Params, FinchAPI::Util::AnyHash)), scheduled_at: T.nilable(Time), started_at: T.nilable(Time), - status: Symbol, - type: Symbol + status: FinchAPI::Models::Jobs::AutomatedAsyncJob::Status::OrSymbol, + type: FinchAPI::Models::Jobs::AutomatedAsyncJob::Type::OrSymbol ) - .void + .returns(T.attached_class) end - def initialize( - completed_at:, - created_at:, - job_id:, - job_url:, - params:, - scheduled_at:, - started_at:, - status:, - type: - ) + def self.new(completed_at:, created_at:, job_id:, job_url:, params:, scheduled_at:, started_at:, status:, type:) end sig do @@ -117,8 +79,8 @@ module FinchAPI params: T.nilable(FinchAPI::Models::Jobs::AutomatedAsyncJob::Params), scheduled_at: T.nilable(Time), started_at: T.nilable(Time), - status: Symbol, - type: Symbol + status: FinchAPI::Models::Jobs::AutomatedAsyncJob::Status::TaggedSymbol, + type: FinchAPI::Models::Jobs::AutomatedAsyncJob::Type::TaggedSymbol } ) end @@ -126,16 +88,16 @@ module FinchAPI end class Params < FinchAPI::BaseModel + # The ID of the individual that the job was completed for. sig { returns(T.nilable(String)) } - def individual_id - end - - sig { params(_: String).returns(String) } - def individual_id=(_) - end + attr_reader :individual_id sig { params(individual_id: String).void } - def initialize(individual_id: nil) + attr_writer :individual_id + + # The input parameters for the job. + sig { params(individual_id: String).returns(T.attached_class) } + def self.new(individual_id: nil) end sig { override.returns({individual_id: String}) } @@ -143,28 +105,38 @@ module FinchAPI end end - class Status < FinchAPI::Enum - abstract! + module Status + extend FinchAPI::Enum - PENDING = :pending - IN_PROGRESS = :in_progress - COMPLETE = :complete - ERROR = :error - REAUTH_ERROR = :reauth_error - PERMISSIONS_ERROR = :permissions_error + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::Jobs::AutomatedAsyncJob::Status) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Jobs::AutomatedAsyncJob::Status::TaggedSymbol) } - sig { override.returns(T::Array[Symbol]) } + PENDING = T.let(:pending, FinchAPI::Models::Jobs::AutomatedAsyncJob::Status::TaggedSymbol) + IN_PROGRESS = T.let(:in_progress, FinchAPI::Models::Jobs::AutomatedAsyncJob::Status::TaggedSymbol) + COMPLETE = T.let(:complete, FinchAPI::Models::Jobs::AutomatedAsyncJob::Status::TaggedSymbol) + ERROR = T.let(:error, FinchAPI::Models::Jobs::AutomatedAsyncJob::Status::TaggedSymbol) + REAUTH_ERROR = T.let(:reauth_error, FinchAPI::Models::Jobs::AutomatedAsyncJob::Status::TaggedSymbol) + PERMISSIONS_ERROR = + T.let(:permissions_error, FinchAPI::Models::Jobs::AutomatedAsyncJob::Status::TaggedSymbol) + + sig { override.returns(T::Array[FinchAPI::Models::Jobs::AutomatedAsyncJob::Status::TaggedSymbol]) } def self.values end end - class Type < FinchAPI::Enum - abstract! + # The type of automated job + module Type + extend FinchAPI::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::Jobs::AutomatedAsyncJob::Type) } + OrSymbol = T.type_alias { T.any(Symbol, FinchAPI::Models::Jobs::AutomatedAsyncJob::Type::TaggedSymbol) } - DATA_SYNC_ALL = :data_sync_all - W4_FORM_EMPLOYEE_SYNC = :w4_form_employee_sync + DATA_SYNC_ALL = T.let(:data_sync_all, FinchAPI::Models::Jobs::AutomatedAsyncJob::Type::TaggedSymbol) + W4_FORM_EMPLOYEE_SYNC = + T.let(:w4_form_employee_sync, FinchAPI::Models::Jobs::AutomatedAsyncJob::Type::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig { override.returns(T::Array[FinchAPI::Models::Jobs::AutomatedAsyncJob::Type::TaggedSymbol]) } def self.values 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 index 05af55bd..eb10d8e7 100644 --- a/rbi/lib/finch-api/models/jobs/automated_create_params.rbi +++ b/rbi/lib/finch-api/models/jobs/automated_create_params.rbi @@ -7,41 +7,32 @@ module FinchAPI extend FinchAPI::RequestParameters::Converter include FinchAPI::RequestParameters - sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + # The type of job to start. + sig { returns(FinchAPI::Models::Jobs::AutomatedCreateParams::Type::OrSymbol) } + attr_accessor :type sig { returns(FinchAPI::Models::Jobs::AutomatedCreateParams::Params) } - def params - end + attr_reader :params - sig do - params(_: FinchAPI::Models::Jobs::AutomatedCreateParams::Params) - .returns(FinchAPI::Models::Jobs::AutomatedCreateParams::Params) - end - def params=(_) - end + sig { params(params: T.any(FinchAPI::Models::Jobs::AutomatedCreateParams::Params, FinchAPI::Util::AnyHash)).void } + attr_writer :params sig do params( - type: Symbol, - params: FinchAPI::Models::Jobs::AutomatedCreateParams::Params, - request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + type: FinchAPI::Models::Jobs::AutomatedCreateParams::Type::OrSymbol, + params: T.any(FinchAPI::Models::Jobs::AutomatedCreateParams::Params, FinchAPI::Util::AnyHash), + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) ) - .void + .returns(T.attached_class) end - def initialize(type:, params:, request_options: {}) + def self.new(type:, params:, request_options: {}) end sig do override .returns( { - type: Symbol, + type: FinchAPI::Models::Jobs::AutomatedCreateParams::Type::OrSymbol, params: FinchAPI::Models::Jobs::AutomatedCreateParams::Params, request_options: FinchAPI::RequestOptions } @@ -50,27 +41,29 @@ module FinchAPI def to_hash end - class Type < FinchAPI::Enum - abstract! + # The type of job to start. + module Type + extend FinchAPI::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::Jobs::AutomatedCreateParams::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Jobs::AutomatedCreateParams::Type::TaggedSymbol) } - W4_FORM_EMPLOYEE_SYNC = :w4_form_employee_sync + W4_FORM_EMPLOYEE_SYNC = + T.let(:w4_form_employee_sync, FinchAPI::Models::Jobs::AutomatedCreateParams::Type::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig { override.returns(T::Array[FinchAPI::Models::Jobs::AutomatedCreateParams::Type::TaggedSymbol]) } def self.values end end class Params < FinchAPI::BaseModel + # The unique ID of the individual for W-4 data sync. sig { returns(String) } - def individual_id - end - - sig { params(_: String).returns(String) } - def individual_id=(_) - end + attr_accessor :individual_id - sig { params(individual_id: String).void } - def initialize(individual_id:) + sig { params(individual_id: String).returns(T.attached_class) } + def self.new(individual_id:) end sig { override.returns({individual_id: String}) } diff --git a/rbi/lib/finch-api/models/jobs/automated_create_response.rbi b/rbi/lib/finch-api/models/jobs/automated_create_response.rbi index 43308533..b431553e 100644 --- a/rbi/lib/finch-api/models/jobs/automated_create_response.rbi +++ b/rbi/lib/finch-api/models/jobs/automated_create_response.rbi @@ -4,47 +4,27 @@ module FinchAPI module Models module Jobs class AutomatedCreateResponse < FinchAPI::BaseModel + # The number of allowed refreshes per hour (per hour, fixed window) sig { returns(Integer) } - def allowed_refreshes - end - - sig { params(_: Integer).returns(Integer) } - def allowed_refreshes=(_) - end + attr_accessor :allowed_refreshes + # The id of the job that has been created. sig { returns(String) } - def job_id - end - - sig { params(_: String).returns(String) } - def job_id=(_) - end + attr_accessor :job_id + # The url that can be used to retrieve the job status sig { returns(String) } - def job_url - end - - sig { params(_: String).returns(String) } - def job_url=(_) - end + attr_accessor :job_url + # The number of remaining refreshes available (per hour, fixed window) sig { returns(Integer) } - def remaining_refreshes - end - - sig { params(_: Integer).returns(Integer) } - def remaining_refreshes=(_) - end + attr_accessor :remaining_refreshes sig do - params( - allowed_refreshes: Integer, - job_id: String, - job_url: String, - remaining_refreshes: Integer - ).void + params(allowed_refreshes: Integer, job_id: String, job_url: String, remaining_refreshes: Integer) + .returns(T.attached_class) end - def initialize(allowed_refreshes:, job_id:, job_url:, remaining_refreshes:) + def self.new(allowed_refreshes:, job_id:, job_url:, remaining_refreshes:) end sig do diff --git a/rbi/lib/finch-api/models/jobs/automated_list_params.rbi b/rbi/lib/finch-api/models/jobs/automated_list_params.rbi index 7343edb5..644ff55f 100644 --- a/rbi/lib/finch-api/models/jobs/automated_list_params.rbi +++ b/rbi/lib/finch-api/models/jobs/automated_list_params.rbi @@ -7,31 +7,29 @@ module FinchAPI extend FinchAPI::RequestParameters::Converter include FinchAPI::RequestParameters + # Number of items to return sig { returns(T.nilable(Integer)) } - def limit - end + attr_reader :limit - sig { params(_: Integer).returns(Integer) } - def limit=(_) - end + sig { params(limit: Integer).void } + attr_writer :limit + # Index to start from (defaults to 0) sig { returns(T.nilable(Integer)) } - def offset - end + attr_reader :offset - sig { params(_: Integer).returns(Integer) } - def offset=(_) - end + sig { params(offset: Integer).void } + attr_writer :offset sig do params( limit: Integer, offset: Integer, - request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) ) - .void + .returns(T.attached_class) end - def initialize(limit: nil, offset: nil, request_options: {}) + def self.new(limit: nil, offset: nil, request_options: {}) end sig { override.returns({limit: Integer, offset: Integer, request_options: FinchAPI::RequestOptions}) } diff --git a/rbi/lib/finch-api/models/jobs/automated_list_response.rbi b/rbi/lib/finch-api/models/jobs/automated_list_response.rbi new file mode 100644 index 00000000..eb420941 --- /dev/null +++ b/rbi/lib/finch-api/models/jobs/automated_list_response.rbi @@ -0,0 +1,126 @@ +# typed: strong + +module FinchAPI + module Models + module Jobs + class AutomatedListResponse < FinchAPI::BaseModel + sig { returns(T::Array[FinchAPI::Models::Jobs::AutomatedAsyncJob]) } + attr_accessor :data + + sig { returns(FinchAPI::Models::Jobs::AutomatedListResponse::Meta) } + attr_reader :meta + + sig { params(meta: T.any(FinchAPI::Models::Jobs::AutomatedListResponse::Meta, FinchAPI::Util::AnyHash)).void } + attr_writer :meta + + sig do + params( + data: T::Array[T.any(FinchAPI::Models::Jobs::AutomatedAsyncJob, FinchAPI::Util::AnyHash)], + meta: T.any(FinchAPI::Models::Jobs::AutomatedListResponse::Meta, FinchAPI::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(data:, meta:) + end + + sig do + override + .returns( + { + data: T::Array[FinchAPI::Models::Jobs::AutomatedAsyncJob], + meta: FinchAPI::Models::Jobs::AutomatedListResponse::Meta + } + ) + end + def to_hash + end + + class Meta < FinchAPI::BaseModel + # Information about remaining quotas for this connection. Only applicable for + # customers opted in to use Finch's Data Sync Refresh endpoint + # (`POST /jobs/automated`). Please contact a Finch representative for more + # details. + sig { returns(T.nilable(FinchAPI::Models::Jobs::AutomatedListResponse::Meta::Quotas)) } + attr_reader :quotas + + sig do + params( + quotas: T.any(FinchAPI::Models::Jobs::AutomatedListResponse::Meta::Quotas, FinchAPI::Util::AnyHash) + ) + .void + end + attr_writer :quotas + + sig do + params( + quotas: T.any(FinchAPI::Models::Jobs::AutomatedListResponse::Meta::Quotas, FinchAPI::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(quotas: nil) + end + + sig { override.returns({quotas: FinchAPI::Models::Jobs::AutomatedListResponse::Meta::Quotas}) } + def to_hash + end + + class Quotas < FinchAPI::BaseModel + sig { returns(T.nilable(FinchAPI::Models::Jobs::AutomatedListResponse::Meta::Quotas::DataSyncAll)) } + attr_reader :data_sync_all + + sig do + params( + data_sync_all: T.any(FinchAPI::Models::Jobs::AutomatedListResponse::Meta::Quotas::DataSyncAll, FinchAPI::Util::AnyHash) + ) + .void + end + attr_writer :data_sync_all + + # Information about remaining quotas for this connection. Only applicable for + # customers opted in to use Finch's Data Sync Refresh endpoint + # (`POST /jobs/automated`). Please contact a Finch representative for more + # details. + sig do + params( + data_sync_all: T.any(FinchAPI::Models::Jobs::AutomatedListResponse::Meta::Quotas::DataSyncAll, FinchAPI::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(data_sync_all: nil) + end + + sig do + override.returns({data_sync_all: FinchAPI::Models::Jobs::AutomatedListResponse::Meta::Quotas::DataSyncAll}) + end + def to_hash + end + + class DataSyncAll < FinchAPI::BaseModel + sig { returns(T.nilable(Integer)) } + attr_reader :allowed_refreshes + + sig { params(allowed_refreshes: Integer).void } + attr_writer :allowed_refreshes + + sig { returns(T.nilable(Integer)) } + attr_reader :remaining_refreshes + + sig { params(remaining_refreshes: Integer).void } + attr_writer :remaining_refreshes + + sig do + params(allowed_refreshes: Integer, remaining_refreshes: Integer).returns(T.attached_class) + end + def self.new(allowed_refreshes: nil, remaining_refreshes: nil) + end + + sig { override.returns({allowed_refreshes: Integer, remaining_refreshes: Integer}) } + def to_hash + end + end + end + 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 index df84a332..f4e49c4c 100644 --- a/rbi/lib/finch-api/models/jobs/automated_retrieve_params.rbi +++ b/rbi/lib/finch-api/models/jobs/automated_retrieve_params.rbi @@ -7,8 +7,15 @@ module FinchAPI 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: {}) + sig do + params( + request_options: T.any( + FinchAPI::RequestOptions, + FinchAPI::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) end sig { override.returns({request_options: FinchAPI::RequestOptions}) } diff --git a/rbi/lib/finch-api/models/jobs/manual_async_job.rbi b/rbi/lib/finch-api/models/jobs/manual_async_job.rbi index cbf87fd5..67d1d5ee 100644 --- a/rbi/lib/finch-api/models/jobs/manual_async_job.rbi +++ b/rbi/lib/finch-api/models/jobs/manual_async_job.rbi @@ -4,47 +4,52 @@ module FinchAPI module Models module Jobs class ManualAsyncJob < FinchAPI::BaseModel + # Specific information about the job, such as individual statuses for batch jobs. 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 + attr_accessor :body sig { returns(String) } - def job_id - end + attr_accessor :job_id - sig { params(_: String).returns(String) } - def job_id=(_) - end + sig { returns(FinchAPI::Models::Jobs::ManualAsyncJob::Status::TaggedSymbol) } + attr_accessor :status - sig { returns(Symbol) } - def status + sig do + params( + body: T.nilable(T::Array[T.anything]), + job_id: String, + status: FinchAPI::Models::Jobs::ManualAsyncJob::Status::OrSymbol + ) + .returns(T.attached_class) end - - sig { params(_: Symbol).returns(Symbol) } - def status=(_) + def self.new(body:, job_id:, status:) end - sig { params(body: T.nilable(T::Array[T.anything]), job_id: String, status: Symbol).void } - def initialize(body:, job_id:, status:) + sig do + override + .returns( + { + body: T.nilable(T::Array[T.anything]), + job_id: String, + status: FinchAPI::Models::Jobs::ManualAsyncJob::Status::TaggedSymbol + } + ) 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! + module Status + extend FinchAPI::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::Jobs::ManualAsyncJob::Status) } + OrSymbol = T.type_alias { T.any(Symbol, FinchAPI::Models::Jobs::ManualAsyncJob::Status::TaggedSymbol) } - PENDING = :pending - IN_PROGRESS = :in_progress - ERROR = :error - COMPLETE = :complete + PENDING = T.let(:pending, FinchAPI::Models::Jobs::ManualAsyncJob::Status::TaggedSymbol) + IN_PROGRESS = T.let(:in_progress, FinchAPI::Models::Jobs::ManualAsyncJob::Status::TaggedSymbol) + ERROR = T.let(:error, FinchAPI::Models::Jobs::ManualAsyncJob::Status::TaggedSymbol) + COMPLETE = T.let(:complete, FinchAPI::Models::Jobs::ManualAsyncJob::Status::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig { override.returns(T::Array[FinchAPI::Models::Jobs::ManualAsyncJob::Status::TaggedSymbol]) } def self.values 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 index 480e3614..f23caf2a 100644 --- a/rbi/lib/finch-api/models/jobs/manual_retrieve_params.rbi +++ b/rbi/lib/finch-api/models/jobs/manual_retrieve_params.rbi @@ -7,8 +7,15 @@ module FinchAPI 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: {}) + sig do + params( + request_options: T.any( + FinchAPI::RequestOptions, + FinchAPI::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) end sig { override.returns({request_options: FinchAPI::RequestOptions}) } diff --git a/rbi/lib/finch-api/models/location.rbi b/rbi/lib/finch-api/models/location.rbi index a79e7d3b..0c7df5cc 100644 --- a/rbi/lib/finch-api/models/location.rbi +++ b/rbi/lib/finch-api/models/location.rbi @@ -3,69 +3,35 @@ module FinchAPI module Models class Location < FinchAPI::BaseModel + # City, district, suburb, town, or village. sig { returns(T.nilable(String)) } - def city - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def city=(_) - end + attr_accessor :city + # The 2-letter ISO 3166 country code. sig { returns(T.nilable(String)) } - def country - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def country=(_) - end + attr_accessor :country + # Street address or PO box. sig { returns(T.nilable(String)) } - def line1 - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def line1=(_) - end + attr_accessor :line1 + # Apartment, suite, unit, or building. sig { returns(T.nilable(String)) } - def line2 - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def line2=(_) - end + attr_accessor :line2 sig { returns(T.nilable(String)) } - def name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def name=(_) - end + attr_accessor :name + # The postal code or zip code. sig { returns(T.nilable(String)) } - def postal_code - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def postal_code=(_) - end + attr_accessor :postal_code sig { returns(T.nilable(String)) } - def source_id - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def source_id=(_) - end + attr_accessor :source_id + # The state code. sig { returns(T.nilable(String)) } - def state - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def state=(_) - end + attr_accessor :state sig do params( @@ -78,18 +44,9 @@ module FinchAPI source_id: T.nilable(String), state: T.nilable(String) ) - .void + .returns(T.attached_class) end - def initialize( - city: nil, - country: nil, - line1: nil, - line2: nil, - name: nil, - postal_code: nil, - source_id: nil, - state: nil - ) + def self.new(city: nil, country: nil, line1: nil, line2: nil, name: nil, postal_code: nil, source_id: nil, state: nil) end sig do diff --git a/rbi/lib/finch-api/models/money.rbi b/rbi/lib/finch-api/models/money.rbi index 64e1b602..c95b3321 100644 --- a/rbi/lib/finch-api/models/money.rbi +++ b/rbi/lib/finch-api/models/money.rbi @@ -3,24 +3,18 @@ module FinchAPI module Models class Money < FinchAPI::BaseModel + # Amount for money object (in cents) sig { returns(T.nilable(Integer)) } - def amount - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def amount=(_) - end + attr_accessor :amount sig { returns(T.nilable(String)) } - def currency - end + attr_reader :currency - sig { params(_: String).returns(String) } - def currency=(_) - end + sig { params(currency: String).void } + attr_writer :currency - sig { params(amount: T.nilable(Integer), currency: String).void } - def initialize(amount: nil, currency: nil) + sig { params(amount: T.nilable(Integer), currency: String).returns(T.attached_class) } + def self.new(amount: nil, currency: nil) end sig { override.returns({amount: T.nilable(Integer), currency: String}) } diff --git a/rbi/lib/finch-api/models/operation_support.rbi b/rbi/lib/finch-api/models/operation_support.rbi index 04720507..6cb9ccc4 100644 --- a/rbi/lib/finch-api/models/operation_support.rbi +++ b/rbi/lib/finch-api/models/operation_support.rbi @@ -2,15 +2,26 @@ module FinchAPI module Models - class OperationSupport < FinchAPI::Enum - 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 + module OperationSupport + extend 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 + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::OperationSupport) } + OrSymbol = T.type_alias { T.any(Symbol, FinchAPI::Models::OperationSupport::TaggedSymbol) } - sig { override.returns(T::Array[Symbol]) } + SUPPORTED = T.let(:supported, FinchAPI::Models::OperationSupport::TaggedSymbol) + NOT_SUPPORTED_BY_FINCH = T.let(:not_supported_by_finch, FinchAPI::Models::OperationSupport::TaggedSymbol) + NOT_SUPPORTED_BY_PROVIDER = + T.let(:not_supported_by_provider, FinchAPI::Models::OperationSupport::TaggedSymbol) + CLIENT_ACCESS_ONLY = T.let(:client_access_only, FinchAPI::Models::OperationSupport::TaggedSymbol) + + sig { override.returns(T::Array[FinchAPI::Models::OperationSupport::TaggedSymbol]) } def self.values end end diff --git a/rbi/lib/finch-api/models/operation_support_matrix.rbi b/rbi/lib/finch-api/models/operation_support_matrix.rbi index 4b88a1bb..193dff70 100644 --- a/rbi/lib/finch-api/models/operation_support_matrix.rbi +++ b/rbi/lib/finch-api/models/operation_support_matrix.rbi @@ -3,43 +3,81 @@ module FinchAPI module Models class OperationSupportMatrix < FinchAPI::BaseModel - sig { returns(T.nilable(Symbol)) } - def create - end + # - `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 + sig { returns(T.nilable(FinchAPI::Models::OperationSupport::TaggedSymbol)) } + attr_reader :create - sig { params(_: Symbol).returns(Symbol) } - def create=(_) - end + sig { params(create: FinchAPI::Models::OperationSupport::OrSymbol).void } + attr_writer :create - sig { returns(T.nilable(Symbol)) } - def delete - end + # - `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 + sig { returns(T.nilable(FinchAPI::Models::OperationSupport::TaggedSymbol)) } + attr_reader :delete - sig { params(_: Symbol).returns(Symbol) } - def delete=(_) - end + sig { params(delete: FinchAPI::Models::OperationSupport::OrSymbol).void } + attr_writer :delete - sig { returns(T.nilable(Symbol)) } - def read - end + # - `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 + sig { returns(T.nilable(FinchAPI::Models::OperationSupport::TaggedSymbol)) } + attr_reader :read - sig { params(_: Symbol).returns(Symbol) } - def read=(_) - end + sig { params(read: FinchAPI::Models::OperationSupport::OrSymbol).void } + attr_writer :read - sig { returns(T.nilable(Symbol)) } - def update - end + # - `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 + sig { returns(T.nilable(FinchAPI::Models::OperationSupport::TaggedSymbol)) } + attr_reader :update - sig { params(_: Symbol).returns(Symbol) } - def update=(_) - end + sig { params(update: FinchAPI::Models::OperationSupport::OrSymbol).void } + attr_writer :update - sig { params(create: Symbol, delete: Symbol, read: Symbol, update: Symbol).void } - def initialize(create: nil, delete: nil, read: nil, update: nil) + sig do + params( + create: FinchAPI::Models::OperationSupport::OrSymbol, + delete: FinchAPI::Models::OperationSupport::OrSymbol, + read: FinchAPI::Models::OperationSupport::OrSymbol, + update: FinchAPI::Models::OperationSupport::OrSymbol + ) + .returns(T.attached_class) + end + def self.new(create: nil, delete: nil, read: nil, update: nil) end - sig { override.returns({create: Symbol, delete: Symbol, read: Symbol, update: Symbol}) } + sig do + override + .returns( + { + create: FinchAPI::Models::OperationSupport::TaggedSymbol, + delete: FinchAPI::Models::OperationSupport::TaggedSymbol, + read: FinchAPI::Models::OperationSupport::TaggedSymbol, + update: FinchAPI::Models::OperationSupport::TaggedSymbol + } + ) + end def to_hash end end diff --git a/rbi/lib/finch-api/models/paging.rbi b/rbi/lib/finch-api/models/paging.rbi index 7de9992a..4b8b236d 100644 --- a/rbi/lib/finch-api/models/paging.rbi +++ b/rbi/lib/finch-api/models/paging.rbi @@ -3,24 +3,22 @@ module FinchAPI module Models class Paging < FinchAPI::BaseModel + # The total number of elements for the entire query (not just the given page) sig { returns(T.nilable(Integer)) } - def count - end + attr_reader :count - sig { params(_: Integer).returns(Integer) } - def count=(_) - end + sig { params(count: Integer).void } + attr_writer :count + # The current start index of the returned list of elements sig { returns(T.nilable(Integer)) } - def offset - end + attr_reader :offset - sig { params(_: Integer).returns(Integer) } - def offset=(_) - end + sig { params(offset: Integer).void } + attr_writer :offset - sig { params(count: Integer, offset: Integer).void } - def initialize(count: nil, offset: nil) + sig { params(count: Integer, offset: Integer).returns(T.attached_class) } + def self.new(count: nil, offset: nil) end sig { override.returns({count: Integer, offset: Integer}) } diff --git a/rbi/lib/finch-api/models/pay_statement_event.rbi b/rbi/lib/finch-api/models/pay_statement_event.rbi index 3393d442..db6f59f3 100644 --- a/rbi/lib/finch-api/models/pay_statement_event.rbi +++ b/rbi/lib/finch-api/models/pay_statement_event.rbi @@ -4,48 +4,56 @@ module FinchAPI module Models class PayStatementEvent < FinchAPI::Models::BaseWebhookEvent sig { returns(T.nilable(FinchAPI::Models::PayStatementEvent::Data)) } - def data - end + attr_reader :data - sig { params(_: FinchAPI::Models::PayStatementEvent::Data).returns(FinchAPI::Models::PayStatementEvent::Data) } - def data=(_) - end + sig { params(data: T.any(FinchAPI::Models::PayStatementEvent::Data, FinchAPI::Util::AnyHash)).void } + attr_writer :data - sig { returns(T.nilable(Symbol)) } - def event_type - end + sig { returns(T.nilable(FinchAPI::Models::PayStatementEvent::EventType::TaggedSymbol)) } + attr_reader :event_type - sig { params(_: Symbol).returns(Symbol) } - def event_type=(_) - end + sig { params(event_type: FinchAPI::Models::PayStatementEvent::EventType::OrSymbol).void } + attr_writer :event_type - sig { params(data: FinchAPI::Models::PayStatementEvent::Data, event_type: Symbol).void } - def initialize(data: nil, event_type: nil) + sig do + params( + data: T.any(FinchAPI::Models::PayStatementEvent::Data, FinchAPI::Util::AnyHash), + event_type: FinchAPI::Models::PayStatementEvent::EventType::OrSymbol + ) + .returns(T.attached_class) + end + def self.new(data: nil, event_type: nil) end - sig { override.returns({data: FinchAPI::Models::PayStatementEvent::Data, event_type: Symbol}) } + sig do + override + .returns( + { + data: FinchAPI::Models::PayStatementEvent::Data, + event_type: FinchAPI::Models::PayStatementEvent::EventType::TaggedSymbol + } + ) + end def to_hash end class Data < FinchAPI::BaseModel + # The ID of the individual associated with the pay statement. sig { returns(T.nilable(String)) } - def individual_id - end + attr_reader :individual_id - sig { params(_: String).returns(String) } - def individual_id=(_) - end + sig { params(individual_id: String).void } + attr_writer :individual_id + # The ID of the payment associated with the pay statement. sig { returns(T.nilable(String)) } - def payment_id - end + attr_reader :payment_id - sig { params(_: String).returns(String) } - def payment_id=(_) - end + sig { params(payment_id: String).void } + attr_writer :payment_id - sig { params(individual_id: String, payment_id: String).void } - def initialize(individual_id: nil, payment_id: nil) + sig { params(individual_id: String, payment_id: String).returns(T.attached_class) } + def self.new(individual_id: nil, payment_id: nil) end sig { override.returns({individual_id: String, payment_id: String}) } @@ -53,14 +61,20 @@ module FinchAPI end end - class EventType < FinchAPI::Enum - abstract! + module EventType + extend FinchAPI::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::PayStatementEvent::EventType) } + OrSymbol = T.type_alias { T.any(Symbol, FinchAPI::Models::PayStatementEvent::EventType::TaggedSymbol) } - PAY_STATEMENT_CREATED = :"pay_statement.created" - PAY_STATEMENT_UPDATED = :"pay_statement.updated" - PAY_STATEMENT_DELETED = :"pay_statement.deleted" + PAY_STATEMENT_CREATED = + T.let(:"pay_statement.created", FinchAPI::Models::PayStatementEvent::EventType::TaggedSymbol) + PAY_STATEMENT_UPDATED = + T.let(:"pay_statement.updated", FinchAPI::Models::PayStatementEvent::EventType::TaggedSymbol) + PAY_STATEMENT_DELETED = + T.let(:"pay_statement.deleted", FinchAPI::Models::PayStatementEvent::EventType::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig { override.returns(T::Array[FinchAPI::Models::PayStatementEvent::EventType::TaggedSymbol]) } def self.values end end diff --git a/rbi/lib/finch-api/models/payment_event.rbi b/rbi/lib/finch-api/models/payment_event.rbi index bc50e386..6937f19a 100644 --- a/rbi/lib/finch-api/models/payment_event.rbi +++ b/rbi/lib/finch-api/models/payment_event.rbi @@ -4,48 +4,50 @@ module FinchAPI module Models class PaymentEvent < FinchAPI::Models::BaseWebhookEvent sig { returns(T.nilable(FinchAPI::Models::PaymentEvent::Data)) } - def data - end + attr_reader :data - sig { params(_: FinchAPI::Models::PaymentEvent::Data).returns(FinchAPI::Models::PaymentEvent::Data) } - def data=(_) - end + sig { params(data: T.any(FinchAPI::Models::PaymentEvent::Data, FinchAPI::Util::AnyHash)).void } + attr_writer :data - sig { returns(T.nilable(Symbol)) } - def event_type - end + sig { returns(T.nilable(FinchAPI::Models::PaymentEvent::EventType::TaggedSymbol)) } + attr_reader :event_type - sig { params(_: Symbol).returns(Symbol) } - def event_type=(_) - end + sig { params(event_type: FinchAPI::Models::PaymentEvent::EventType::OrSymbol).void } + attr_writer :event_type - sig { params(data: FinchAPI::Models::PaymentEvent::Data, event_type: Symbol).void } - def initialize(data: nil, event_type: nil) + sig do + params( + data: T.any(FinchAPI::Models::PaymentEvent::Data, FinchAPI::Util::AnyHash), + event_type: FinchAPI::Models::PaymentEvent::EventType::OrSymbol + ) + .returns(T.attached_class) + end + def self.new(data: nil, event_type: nil) end - sig { override.returns({data: FinchAPI::Models::PaymentEvent::Data, event_type: Symbol}) } + sig do + override + .returns( + { + data: FinchAPI::Models::PaymentEvent::Data, + event_type: FinchAPI::Models::PaymentEvent::EventType::TaggedSymbol + } + ) + end def to_hash end class Data < FinchAPI::BaseModel + # The date of the payment. sig { returns(String) } - def pay_date - end - - sig { params(_: String).returns(String) } - def pay_date=(_) - end + attr_accessor :pay_date + # The ID of the payment. sig { returns(String) } - def payment_id - end + attr_accessor :payment_id - sig { params(_: String).returns(String) } - def payment_id=(_) - end - - sig { params(pay_date: String, payment_id: String).void } - def initialize(pay_date:, payment_id:) + sig { params(pay_date: String, payment_id: String).returns(T.attached_class) } + def self.new(pay_date:, payment_id:) end sig { override.returns({pay_date: String, payment_id: String}) } @@ -53,14 +55,17 @@ module FinchAPI end end - class EventType < FinchAPI::Enum - abstract! + module EventType + extend FinchAPI::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::PaymentEvent::EventType) } + OrSymbol = T.type_alias { T.any(Symbol, FinchAPI::Models::PaymentEvent::EventType::TaggedSymbol) } - PAYMENT_CREATED = :"payment.created" - PAYMENT_UPDATED = :"payment.updated" - PAYMENT_DELETED = :"payment.deleted" + PAYMENT_CREATED = T.let(:"payment.created", FinchAPI::Models::PaymentEvent::EventType::TaggedSymbol) + PAYMENT_UPDATED = T.let(:"payment.updated", FinchAPI::Models::PaymentEvent::EventType::TaggedSymbol) + PAYMENT_DELETED = T.let(:"payment.deleted", FinchAPI::Models::PaymentEvent::EventType::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig { override.returns(T::Array[FinchAPI::Models::PaymentEvent::EventType::TaggedSymbol]) } def self.values 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 index 26870e63..27d545d3 100644 --- a/rbi/lib/finch-api/models/payroll/pay_group_list_params.rbi +++ b/rbi/lib/finch-api/models/payroll/pay_group_list_params.rbi @@ -8,30 +8,26 @@ module FinchAPI include FinchAPI::RequestParameters sig { returns(T.nilable(String)) } - def individual_id - end + attr_reader :individual_id - sig { params(_: String).returns(String) } - def individual_id=(_) - end + sig { params(individual_id: String).void } + attr_writer :individual_id sig { returns(T.nilable(T::Array[String])) } - def pay_frequencies - end + attr_reader :pay_frequencies - sig { params(_: T::Array[String]).returns(T::Array[String]) } - def pay_frequencies=(_) - end + sig { params(pay_frequencies: T::Array[String]).void } + attr_writer :pay_frequencies sig do params( individual_id: String, pay_frequencies: T::Array[String], - request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) ) - .void + .returns(T.attached_class) end - def initialize(individual_id: nil, pay_frequencies: nil, request_options: {}) + def self.new(individual_id: nil, pay_frequencies: nil, request_options: {}) end sig do 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 index 8b0c4239..8eea3178 100644 --- a/rbi/lib/finch-api/models/payroll/pay_group_list_response.rbi +++ b/rbi/lib/finch-api/models/payroll/pay_group_list_response.rbi @@ -4,52 +4,77 @@ module FinchAPI module Models module Payroll class PayGroupListResponse < FinchAPI::BaseModel + # Finch id (uuidv4) for the pay group sig { returns(T.nilable(String)) } - def id - end + attr_reader :id - sig { params(_: String).returns(String) } - def id=(_) - end + sig { params(id: String).void } + attr_writer :id + # Name of the pay group sig { returns(T.nilable(String)) } - def name - end + attr_reader :name - sig { params(_: String).returns(String) } - def name=(_) - end + sig { params(name: String).void } + attr_writer :name - sig { returns(T.nilable(T::Array[Symbol])) } - def pay_frequencies - end + # List of pay frequencies associated with this pay group + sig { returns(T.nilable(T::Array[FinchAPI::Models::Payroll::PayGroupListResponse::PayFrequency::TaggedSymbol])) } + attr_reader :pay_frequencies - sig { params(_: T::Array[Symbol]).returns(T::Array[Symbol]) } - def pay_frequencies=(_) + sig do + params(pay_frequencies: T::Array[FinchAPI::Models::Payroll::PayGroupListResponse::PayFrequency::OrSymbol]) + .void end + attr_writer :pay_frequencies - sig { params(id: String, name: String, pay_frequencies: T::Array[Symbol]).void } - def initialize(id: nil, name: nil, pay_frequencies: nil) + sig do + params( + id: String, + name: String, + pay_frequencies: T::Array[FinchAPI::Models::Payroll::PayGroupListResponse::PayFrequency::OrSymbol] + ) + .returns(T.attached_class) + end + def self.new(id: nil, name: nil, pay_frequencies: nil) end - sig { override.returns({id: String, name: String, pay_frequencies: T::Array[Symbol]}) } + sig do + override + .returns( + { + id: String, + name: String, + pay_frequencies: T::Array[FinchAPI::Models::Payroll::PayGroupListResponse::PayFrequency::TaggedSymbol] + } + ) + end def to_hash end - class PayFrequency < FinchAPI::Enum - abstract! + module PayFrequency + extend FinchAPI::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::Payroll::PayGroupListResponse::PayFrequency) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Payroll::PayGroupListResponse::PayFrequency::TaggedSymbol) } - ANNUALLY = :annually - SEMI_ANNUALLY = :semi_annually - QUARTERLY = :quarterly - MONTHLY = :monthly - SEMI_MONTHLY = :semi_monthly - BI_WEEKLY = :bi_weekly - WEEKLY = :weekly - DAILY = :daily - OTHER = :other + ANNUALLY = T.let(:annually, FinchAPI::Models::Payroll::PayGroupListResponse::PayFrequency::TaggedSymbol) + SEMI_ANNUALLY = + T.let(:semi_annually, FinchAPI::Models::Payroll::PayGroupListResponse::PayFrequency::TaggedSymbol) + QUARTERLY = + T.let(:quarterly, FinchAPI::Models::Payroll::PayGroupListResponse::PayFrequency::TaggedSymbol) + MONTHLY = T.let(:monthly, FinchAPI::Models::Payroll::PayGroupListResponse::PayFrequency::TaggedSymbol) + SEMI_MONTHLY = + T.let(:semi_monthly, FinchAPI::Models::Payroll::PayGroupListResponse::PayFrequency::TaggedSymbol) + BI_WEEKLY = + T.let(:bi_weekly, FinchAPI::Models::Payroll::PayGroupListResponse::PayFrequency::TaggedSymbol) + WEEKLY = T.let(:weekly, FinchAPI::Models::Payroll::PayGroupListResponse::PayFrequency::TaggedSymbol) + DAILY = T.let(:daily, FinchAPI::Models::Payroll::PayGroupListResponse::PayFrequency::TaggedSymbol) + OTHER = T.let(:other, FinchAPI::Models::Payroll::PayGroupListResponse::PayFrequency::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig { override.returns(T::Array[FinchAPI::Models::Payroll::PayGroupListResponse::PayFrequency::TaggedSymbol]) } def self.values 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 index 42a0b78a..c8bc2f5d 100644 --- a/rbi/lib/finch-api/models/payroll/pay_group_retrieve_params.rbi +++ b/rbi/lib/finch-api/models/payroll/pay_group_retrieve_params.rbi @@ -7,8 +7,15 @@ module FinchAPI 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: {}) + sig do + params( + request_options: T.any( + FinchAPI::RequestOptions, + FinchAPI::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) end sig { override.returns({request_options: FinchAPI::RequestOptions}) } 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 index 9c9ee374..8d529f59 100644 --- a/rbi/lib/finch-api/models/payroll/pay_group_retrieve_response.rbi +++ b/rbi/lib/finch-api/models/payroll/pay_group_retrieve_response.rbi @@ -4,75 +4,74 @@ module FinchAPI module Models module Payroll class PayGroupRetrieveResponse < FinchAPI::BaseModel + # Finch id (uuidv4) for the pay group sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id sig { returns(T::Array[String]) } - def individual_ids - end - - sig { params(_: T::Array[String]).returns(T::Array[String]) } - def individual_ids=(_) - end + attr_accessor :individual_ids + # Name of the pay group sig { returns(String) } - def name - end + attr_accessor :name - 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 + # List of pay frequencies associated with this pay group + sig { returns(T::Array[FinchAPI::Models::Payroll::PayGroupRetrieveResponse::PayFrequency::TaggedSymbol]) } + attr_accessor :pay_frequencies sig do params( id: String, individual_ids: T::Array[String], name: String, - pay_frequencies: T::Array[Symbol] - ).void + pay_frequencies: T::Array[FinchAPI::Models::Payroll::PayGroupRetrieveResponse::PayFrequency::OrSymbol] + ) + .returns(T.attached_class) end - def initialize(id:, individual_ids:, name:, pay_frequencies:) + def self.new(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] - }) + .returns( + { + id: String, + individual_ids: T::Array[String], + name: String, + pay_frequencies: T::Array[FinchAPI::Models::Payroll::PayGroupRetrieveResponse::PayFrequency::TaggedSymbol] + } + ) end def to_hash end - class PayFrequency < FinchAPI::Enum - abstract! + module PayFrequency + extend FinchAPI::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::Payroll::PayGroupRetrieveResponse::PayFrequency) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Payroll::PayGroupRetrieveResponse::PayFrequency::TaggedSymbol) } - ANNUALLY = :annually - SEMI_ANNUALLY = :semi_annually - QUARTERLY = :quarterly - MONTHLY = :monthly - SEMI_MONTHLY = :semi_monthly - BI_WEEKLY = :bi_weekly - WEEKLY = :weekly - DAILY = :daily - OTHER = :other + ANNUALLY = + T.let(:annually, FinchAPI::Models::Payroll::PayGroupRetrieveResponse::PayFrequency::TaggedSymbol) + SEMI_ANNUALLY = + T.let(:semi_annually, FinchAPI::Models::Payroll::PayGroupRetrieveResponse::PayFrequency::TaggedSymbol) + QUARTERLY = + T.let(:quarterly, FinchAPI::Models::Payroll::PayGroupRetrieveResponse::PayFrequency::TaggedSymbol) + MONTHLY = + T.let(:monthly, FinchAPI::Models::Payroll::PayGroupRetrieveResponse::PayFrequency::TaggedSymbol) + SEMI_MONTHLY = + T.let(:semi_monthly, FinchAPI::Models::Payroll::PayGroupRetrieveResponse::PayFrequency::TaggedSymbol) + BI_WEEKLY = + T.let(:bi_weekly, FinchAPI::Models::Payroll::PayGroupRetrieveResponse::PayFrequency::TaggedSymbol) + WEEKLY = T.let(:weekly, FinchAPI::Models::Payroll::PayGroupRetrieveResponse::PayFrequency::TaggedSymbol) + DAILY = T.let(:daily, FinchAPI::Models::Payroll::PayGroupRetrieveResponse::PayFrequency::TaggedSymbol) + OTHER = T.let(:other, FinchAPI::Models::Payroll::PayGroupRetrieveResponse::PayFrequency::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig do + override.returns(T::Array[FinchAPI::Models::Payroll::PayGroupRetrieveResponse::PayFrequency::TaggedSymbol]) + end def self.values end end diff --git a/rbi/lib/finch-api/models/provider.rbi b/rbi/lib/finch-api/models/provider.rbi index 8bda9b52..483d1529 100644 --- a/rbi/lib/finch-api/models/provider.rbi +++ b/rbi/lib/finch-api/models/provider.rbi @@ -3,93 +3,87 @@ module FinchAPI module Models class Provider < FinchAPI::BaseModel + # The id of the payroll provider used in Connect. sig { returns(T.nilable(String)) } - def id - end + attr_reader :id - sig { params(_: String).returns(String) } - def id=(_) - end + sig { params(id: String).void } + attr_writer :id + # The list of authentication methods supported by the provider. sig { returns(T.nilable(T::Array[FinchAPI::Models::Provider::AuthenticationMethod])) } - def authentication_methods - end + attr_reader :authentication_methods sig do - params(_: T::Array[FinchAPI::Models::Provider::AuthenticationMethod]) - .returns(T::Array[FinchAPI::Models::Provider::AuthenticationMethod]) - end - def authentication_methods=(_) + params( + authentication_methods: T::Array[T.any(FinchAPI::Models::Provider::AuthenticationMethod, FinchAPI::Util::AnyHash)] + ) + .void end + attr_writer :authentication_methods + # `true` if the integration is in a beta state, `false` otherwise sig { returns(T.nilable(T::Boolean)) } - def beta - end + attr_reader :beta - sig { params(_: T::Boolean).returns(T::Boolean) } - def beta=(_) - end + sig { params(beta: T::Boolean).void } + attr_writer :beta + # The display name of the payroll provider. sig { returns(T.nilable(String)) } - def display_name - end + attr_reader :display_name - sig { params(_: String).returns(String) } - def display_name=(_) - end + sig { params(display_name: String).void } + attr_writer :display_name + # The url to the official icon of the payroll provider. sig { returns(T.nilable(String)) } - def icon - end + attr_reader :icon - sig { params(_: String).returns(String) } - def icon=(_) - end + sig { params(icon: String).void } + attr_writer :icon + # The url to the official logo of the payroll provider. sig { returns(T.nilable(String)) } - def logo - end + attr_reader :logo - sig { params(_: String).returns(String) } - def logo=(_) - end + sig { params(logo: String).void } + attr_writer :logo + # [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. sig { returns(T.nilable(T::Boolean)) } - def manual - end + attr_reader :manual - sig { params(_: T::Boolean).returns(T::Boolean) } - def manual=(_) - end + sig { params(manual: T::Boolean).void } + attr_writer :manual + # whether MFA is required for the provider. sig { returns(T.nilable(T::Boolean)) } - def mfa_required - end + attr_reader :mfa_required - sig { params(_: T::Boolean).returns(T::Boolean) } - def mfa_required=(_) - end + sig { params(mfa_required: T::Boolean).void } + attr_writer :mfa_required + # The hex code for the primary color of the payroll provider. sig { returns(T.nilable(String)) } - def primary_color - end + attr_reader :primary_color - sig { params(_: String).returns(String) } - def primary_color=(_) - end + sig { params(primary_color: String).void } + attr_writer :primary_color + # The list of Finch products supported on this payroll provider. sig { returns(T.nilable(T::Array[String])) } - def products - end + attr_reader :products - sig { params(_: T::Array[String]).returns(T::Array[String]) } - def products=(_) - end + sig { params(products: T::Array[String]).void } + attr_writer :products sig do params( id: String, - authentication_methods: T::Array[FinchAPI::Models::Provider::AuthenticationMethod], + authentication_methods: T::Array[T.any(FinchAPI::Models::Provider::AuthenticationMethod, FinchAPI::Util::AnyHash)], beta: T::Boolean, display_name: String, icon: String, @@ -99,9 +93,9 @@ module FinchAPI primary_color: String, products: T::Array[String] ) - .void + .returns(T.attached_class) end - def initialize( + def self.new( id: nil, authentication_methods: nil, beta: nil, @@ -136,45 +130,51 @@ module FinchAPI end class AuthenticationMethod < FinchAPI::BaseModel + # Each benefit type and their supported features. If the benefit type is not + # supported, the property will be null sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitsSupport)) } - def benefits_support - end + attr_reader :benefits_support sig do - params(_: T.nilable(FinchAPI::Models::HRIS::BenefitsSupport)) - .returns(T.nilable(FinchAPI::Models::HRIS::BenefitsSupport)) - end - def benefits_support=(_) + params( + benefits_support: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitsSupport, FinchAPI::Util::AnyHash)) + ) + .void end + attr_writer :benefits_support + # The supported data fields returned by our HR and payroll endpoints sig { returns(T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields)) } - def supported_fields - end + attr_reader :supported_fields sig do - params(_: T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields)) - .returns(T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields)) - end - def supported_fields=(_) + params( + supported_fields: T.nilable( + T.any(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields, FinchAPI::Util::AnyHash) + ) + ) + .void end + attr_writer :supported_fields - sig { returns(T.nilable(Symbol)) } - def type - end + # The type of authentication method. + sig { returns(T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::Type::TaggedSymbol)) } + attr_reader :type - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + sig { params(type: FinchAPI::Models::Provider::AuthenticationMethod::Type::OrSymbol).void } + attr_writer :type sig do params( - benefits_support: T.nilable(FinchAPI::Models::HRIS::BenefitsSupport), - supported_fields: T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields), - type: Symbol + benefits_support: T.nilable(T.any(FinchAPI::Models::HRIS::BenefitsSupport, FinchAPI::Util::AnyHash)), + supported_fields: T.nilable( + T.any(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields, FinchAPI::Util::AnyHash) + ), + type: FinchAPI::Models::Provider::AuthenticationMethod::Type::OrSymbol ) - .void + .returns(T.attached_class) end - def initialize(benefits_support: nil, supported_fields: nil, type: nil) + def self.new(benefits_support: nil, supported_fields: nil, type: nil) end sig do @@ -183,7 +183,7 @@ module FinchAPI { benefits_support: T.nilable(FinchAPI::Models::HRIS::BenefitsSupport), supported_fields: T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields), - type: Symbol + type: FinchAPI::Models::Provider::AuthenticationMethod::Type::TaggedSymbol } ) end @@ -192,95 +192,126 @@ module FinchAPI class SupportedFields < FinchAPI::BaseModel sig { returns(T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company)) } - def company - end + attr_reader :company sig do - params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company) - .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company) - end - def company=(_) + params( + company: T.any(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company, FinchAPI::Util::AnyHash) + ) + .void end + attr_writer :company sig { returns(T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory)) } - def directory - end + attr_reader :directory sig do - params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory) - .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory) - end - def directory=(_) + params( + directory: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory, + FinchAPI::Util::AnyHash + ) + ) + .void end + attr_writer :directory sig { returns(T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment)) } - def employment - end + attr_reader :employment sig do - params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment) - .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment) - end - def employment=(_) + params( + employment: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment, + FinchAPI::Util::AnyHash + ) + ) + .void end + attr_writer :employment sig { returns(T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual)) } - def individual - end + attr_reader :individual sig do - params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual) - .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual) - end - def individual=(_) + params( + individual: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual, + FinchAPI::Util::AnyHash + ) + ) + .void end + attr_writer :individual sig { returns(T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayGroup)) } - def pay_group - end + attr_reader :pay_group sig do - params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayGroup) - .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayGroup) - end - def pay_group=(_) + params( + pay_group: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayGroup, + FinchAPI::Util::AnyHash + ) + ) + .void end + attr_writer :pay_group sig { returns(T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement)) } - def pay_statement - end + attr_reader :pay_statement sig do - params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement) - .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement) - end - def pay_statement=(_) + params( + pay_statement: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement, + FinchAPI::Util::AnyHash + ) + ) + .void end + attr_writer :pay_statement sig { returns(T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment)) } - def payment - end + attr_reader :payment sig do - params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment) - .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment) - end - def payment=(_) + params( + payment: T.any(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment, FinchAPI::Util::AnyHash) + ) + .void end + attr_writer :payment + # The supported data fields returned by our HR and payroll endpoints 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 + company: T.any(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company, FinchAPI::Util::AnyHash), + directory: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory, + FinchAPI::Util::AnyHash + ), + employment: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment, + FinchAPI::Util::AnyHash + ), + individual: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual, + FinchAPI::Util::AnyHash + ), + pay_group: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayGroup, + FinchAPI::Util::AnyHash + ), + pay_statement: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement, + FinchAPI::Util::AnyHash + ), + payment: T.any(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment, FinchAPI::Util::AnyHash) ) - .void + .returns(T.attached_class) end - def initialize( + def self.new( company: nil, directory: nil, employment: nil, @@ -310,108 +341,122 @@ module FinchAPI class Company < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def id - end + attr_reader :id - sig { params(_: T::Boolean).returns(T::Boolean) } - def id=(_) - end + sig { params(id: T::Boolean).void } + attr_writer :id sig { returns(T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Accounts)) } - def accounts - end + attr_reader :accounts sig do - params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Accounts) - .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Accounts) - end - def accounts=(_) + params( + accounts: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Accounts, + FinchAPI::Util::AnyHash + ) + ) + .void end + attr_writer :accounts sig do returns( T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments) ) end - def departments - end + attr_reader :departments sig do - params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments) - .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments) - end - def departments=(_) + params( + departments: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments, + FinchAPI::Util::AnyHash + ) + ) + .void end + attr_writer :departments sig { returns(T.nilable(T::Boolean)) } - def ein - end + attr_reader :ein - sig { params(_: T::Boolean).returns(T::Boolean) } - def ein=(_) - end + sig { params(ein: T::Boolean).void } + attr_writer :ein sig { returns(T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Entity)) } - def entity - end + attr_reader :entity sig do - params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Entity) - .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Entity) - end - def entity=(_) + params( + entity: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Entity, + FinchAPI::Util::AnyHash + ) + ) + .void end + attr_writer :entity sig { returns(T.nilable(T::Boolean)) } - def legal_name - end + attr_reader :legal_name - sig { params(_: T::Boolean).returns(T::Boolean) } - def legal_name=(_) - end + sig { params(legal_name: T::Boolean).void } + attr_writer :legal_name sig { returns(T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Locations)) } - def locations - end + attr_reader :locations sig do - params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Locations) - .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Locations) - end - def locations=(_) + params( + locations: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Locations, + FinchAPI::Util::AnyHash + ) + ) + .void end + attr_writer :locations sig { returns(T.nilable(T::Boolean)) } - def primary_email - end + attr_reader :primary_email - sig { params(_: T::Boolean).returns(T::Boolean) } - def primary_email=(_) - end + sig { params(primary_email: T::Boolean).void } + attr_writer :primary_email sig { returns(T.nilable(T::Boolean)) } - def primary_phone_number - end + attr_reader :primary_phone_number - sig { params(_: T::Boolean).returns(T::Boolean) } - def primary_phone_number=(_) - end + sig { params(primary_phone_number: T::Boolean).void } + attr_writer :primary_phone_number sig do params( id: T::Boolean, - accounts: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Accounts, - departments: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments, + accounts: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Accounts, + FinchAPI::Util::AnyHash + ), + departments: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments, + FinchAPI::Util::AnyHash + ), ein: T::Boolean, - entity: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Entity, + entity: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Entity, + FinchAPI::Util::AnyHash + ), legal_name: T::Boolean, - locations: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Locations, + locations: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Locations, + FinchAPI::Util::AnyHash + ), primary_email: T::Boolean, primary_phone_number: T::Boolean ) - .void + .returns(T.attached_class) end - def initialize( + def self.new( id: nil, accounts: nil, departments: nil, @@ -445,44 +490,34 @@ module FinchAPI class Accounts < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def account_name - end + attr_reader :account_name - sig { params(_: T::Boolean).returns(T::Boolean) } - def account_name=(_) - end + sig { params(account_name: T::Boolean).void } + attr_writer :account_name sig { returns(T.nilable(T::Boolean)) } - def account_number - end + attr_reader :account_number - sig { params(_: T::Boolean).returns(T::Boolean) } - def account_number=(_) - end + sig { params(account_number: T::Boolean).void } + attr_writer :account_number sig { returns(T.nilable(T::Boolean)) } - def account_type - end + attr_reader :account_type - sig { params(_: T::Boolean).returns(T::Boolean) } - def account_type=(_) - end + sig { params(account_type: T::Boolean).void } + attr_writer :account_type sig { returns(T.nilable(T::Boolean)) } - def institution_name - end + attr_reader :institution_name - sig { params(_: T::Boolean).returns(T::Boolean) } - def institution_name=(_) - end + sig { params(institution_name: T::Boolean).void } + attr_writer :institution_name sig { returns(T.nilable(T::Boolean)) } - def routing_number - end + attr_reader :routing_number - sig { params(_: T::Boolean).returns(T::Boolean) } - def routing_number=(_) - end + sig { params(routing_number: T::Boolean).void } + attr_writer :routing_number sig do params( @@ -492,15 +527,9 @@ module FinchAPI institution_name: T::Boolean, routing_number: T::Boolean ) - .void + .returns(T.attached_class) end - def initialize( - account_name: nil, - account_number: nil, - account_type: nil, - institution_name: nil, - routing_number: nil - ) + def self.new(account_name: nil, account_number: nil, account_type: nil, institution_name: nil, routing_number: nil) end sig do @@ -521,36 +550,40 @@ module FinchAPI class Departments < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def name - end + attr_reader :name - sig { params(_: T::Boolean).returns(T::Boolean) } - def name=(_) - end + sig { params(name: T::Boolean).void } + attr_writer :name sig do returns( T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments::Parent) ) end - def parent - end + attr_reader :parent sig do - params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments::Parent) - .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments::Parent) - end - def parent=(_) + params( + parent: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments::Parent, + FinchAPI::Util::AnyHash + ) + ) + .void end + attr_writer :parent sig do params( name: T::Boolean, - parent: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments::Parent + parent: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments::Parent, + FinchAPI::Util::AnyHash + ) ) - .void + .returns(T.attached_class) end - def initialize(name: nil, parent: nil) + def self.new(name: nil, parent: nil) end sig do @@ -567,15 +600,13 @@ module FinchAPI class Parent < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def name - end - - sig { params(_: T::Boolean).returns(T::Boolean) } - def name=(_) - end + attr_reader :name sig { params(name: T::Boolean).void } - def initialize(name: nil) + attr_writer :name + + sig { params(name: T::Boolean).returns(T.attached_class) } + def self.new(name: nil) end sig { override.returns({name: T::Boolean}) } @@ -586,23 +617,19 @@ module FinchAPI class Entity < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def subtype - end + attr_reader :subtype - sig { params(_: T::Boolean).returns(T::Boolean) } - def subtype=(_) - end + sig { params(subtype: T::Boolean).void } + attr_writer :subtype sig { returns(T.nilable(T::Boolean)) } - def type - end + attr_reader :type - sig { params(_: T::Boolean).returns(T::Boolean) } - def type=(_) - end + sig { params(type: T::Boolean).void } + attr_writer :type - sig { params(subtype: T::Boolean, type: T::Boolean).void } - def initialize(subtype: nil, type: nil) + sig { params(subtype: T::Boolean, type: T::Boolean).returns(T.attached_class) } + def self.new(subtype: nil, type: nil) end sig { override.returns({subtype: T::Boolean, type: T::Boolean}) } @@ -612,52 +639,40 @@ module FinchAPI class Locations < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def city - end + attr_reader :city - sig { params(_: T::Boolean).returns(T::Boolean) } - def city=(_) - end + sig { params(city: T::Boolean).void } + attr_writer :city sig { returns(T.nilable(T::Boolean)) } - def country - end + attr_reader :country - sig { params(_: T::Boolean).returns(T::Boolean) } - def country=(_) - end + sig { params(country: T::Boolean).void } + attr_writer :country sig { returns(T.nilable(T::Boolean)) } - def line1 - end + attr_reader :line1 - sig { params(_: T::Boolean).returns(T::Boolean) } - def line1=(_) - end + sig { params(line1: T::Boolean).void } + attr_writer :line1 sig { returns(T.nilable(T::Boolean)) } - def line2 - end + attr_reader :line2 - sig { params(_: T::Boolean).returns(T::Boolean) } - def line2=(_) - end + sig { params(line2: T::Boolean).void } + attr_writer :line2 sig { returns(T.nilable(T::Boolean)) } - def postal_code - end + attr_reader :postal_code - sig { params(_: T::Boolean).returns(T::Boolean) } - def postal_code=(_) - end + sig { params(postal_code: T::Boolean).void } + attr_writer :postal_code sig { returns(T.nilable(T::Boolean)) } - def state - end + attr_reader :state - sig { params(_: T::Boolean).returns(T::Boolean) } - def state=(_) - end + sig { params(state: T::Boolean).void } + attr_writer :state sig do params( @@ -668,9 +683,9 @@ module FinchAPI postal_code: T::Boolean, state: T::Boolean ) - .void + .returns(T.attached_class) end - def initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil) + def self.new(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil) end sig do @@ -697,35 +712,47 @@ module FinchAPI T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals) ) end - def individuals - end + attr_reader :individuals sig do - params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals) - .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals) - end - def individuals=(_) + params( + individuals: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals, + FinchAPI::Util::AnyHash + ) + ) + .void end + attr_writer :individuals sig { returns(T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Paging)) } - def paging - end + attr_reader :paging sig do - params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Paging) - .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Paging) - end - def paging=(_) + params( + paging: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Paging, + FinchAPI::Util::AnyHash + ) + ) + .void end + attr_writer :paging sig do params( - individuals: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals, - paging: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Paging + individuals: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals, + FinchAPI::Util::AnyHash + ), + paging: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Paging, + FinchAPI::Util::AnyHash + ) ) - .void + .returns(T.attached_class) end - def initialize(individuals: nil, paging: nil) + def self.new(individuals: nil, paging: nil) end sig do @@ -742,44 +769,34 @@ module FinchAPI class Individuals < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def id - end + attr_reader :id - sig { params(_: T::Boolean).returns(T::Boolean) } - def id=(_) - end + sig { params(id: T::Boolean).void } + attr_writer :id sig { returns(T.nilable(T::Boolean)) } - def department - end + attr_reader :department - sig { params(_: T::Boolean).returns(T::Boolean) } - def department=(_) - end + sig { params(department: T::Boolean).void } + attr_writer :department sig { returns(T.nilable(T::Boolean)) } - def first_name - end + attr_reader :first_name - sig { params(_: T::Boolean).returns(T::Boolean) } - def first_name=(_) - end + sig { params(first_name: T::Boolean).void } + attr_writer :first_name sig { returns(T.nilable(T::Boolean)) } - def is_active - end + attr_reader :is_active - sig { params(_: T::Boolean).returns(T::Boolean) } - def is_active=(_) - end + sig { params(is_active: T::Boolean).void } + attr_writer :is_active sig { returns(T.nilable(T::Boolean)) } - def last_name - end + attr_reader :last_name - sig { params(_: T::Boolean).returns(T::Boolean) } - def last_name=(_) - end + sig { params(last_name: T::Boolean).void } + attr_writer :last_name sig do returns( @@ -788,27 +805,24 @@ module FinchAPI ) ) end - def manager - end + attr_reader :manager sig do params( - _: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager - ) - .returns( - FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager + manager: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager, + FinchAPI::Util::AnyHash ) + ) + .void end - def manager=(_) - end + attr_writer :manager sig { returns(T.nilable(T::Boolean)) } - def middle_name - end + attr_reader :middle_name - sig { params(_: T::Boolean).returns(T::Boolean) } - def middle_name=(_) - end + sig { params(middle_name: T::Boolean).void } + attr_writer :middle_name sig do params( @@ -817,20 +831,15 @@ module FinchAPI first_name: T::Boolean, is_active: T::Boolean, last_name: T::Boolean, - manager: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager, + manager: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals::Manager, + FinchAPI::Util::AnyHash + ), middle_name: T::Boolean ) - .void + .returns(T.attached_class) end - def initialize( - id: nil, - department: nil, - first_name: nil, - is_active: nil, - last_name: nil, - manager: nil, - middle_name: nil - ) + def self.new(id: nil, department: nil, first_name: nil, is_active: nil, last_name: nil, manager: nil, middle_name: nil) end sig do @@ -852,15 +861,13 @@ module FinchAPI class Manager < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def id - end - - sig { params(_: T::Boolean).returns(T::Boolean) } - def id=(_) - end + attr_reader :id sig { params(id: T::Boolean).void } - def initialize(id: nil) + attr_writer :id + + sig { params(id: T::Boolean).returns(T.attached_class) } + def self.new(id: nil) end sig { override.returns({id: T::Boolean}) } @@ -871,23 +878,19 @@ module FinchAPI class Paging < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def count - end + attr_reader :count - sig { params(_: T::Boolean).returns(T::Boolean) } - def count=(_) - end + sig { params(count: T::Boolean).void } + attr_writer :count sig { returns(T.nilable(T::Boolean)) } - def offset - end + attr_reader :offset - sig { params(_: T::Boolean).returns(T::Boolean) } - def offset=(_) - end + sig { params(offset: T::Boolean).void } + attr_writer :offset - sig { params(count: T::Boolean, offset: T::Boolean).void } - def initialize(count: nil, offset: nil) + sig { params(count: T::Boolean, offset: T::Boolean).returns(T.attached_class) } + def self.new(count: nil, offset: nil) end sig { override.returns({count: T::Boolean, offset: T::Boolean}) } @@ -898,191 +901,197 @@ module FinchAPI class Employment < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def id - end + attr_reader :id - sig { params(_: T::Boolean).returns(T::Boolean) } - def id=(_) - end + sig { params(id: T::Boolean).void } + attr_writer :id sig { returns(T.nilable(T::Boolean)) } - def class_code - end + attr_reader :class_code - sig { params(_: T::Boolean).returns(T::Boolean) } - def class_code=(_) - end + sig { params(class_code: T::Boolean).void } + attr_writer :class_code sig { returns(T.nilable(T::Boolean)) } - def custom_fields - end + attr_reader :custom_fields - sig { params(_: T::Boolean).returns(T::Boolean) } - def custom_fields=(_) - end + sig { params(custom_fields: T::Boolean).void } + attr_writer :custom_fields sig do returns( T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Department) ) end - def department - end + attr_reader :department sig do - params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Department) - .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Department) - end - def department=(_) + params( + department: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Department, + FinchAPI::Util::AnyHash + ) + ) + .void end + attr_writer :department sig do returns( T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Employment) ) end - def employment - end + attr_reader :employment sig do - params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Employment) - .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Employment) - end - def employment=(_) + params( + employment: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Employment, + FinchAPI::Util::AnyHash + ) + ) + .void end + attr_writer :employment sig { returns(T.nilable(T::Boolean)) } - def employment_status - end + attr_reader :employment_status - sig { params(_: T::Boolean).returns(T::Boolean) } - def employment_status=(_) - end + sig { params(employment_status: T::Boolean).void } + attr_writer :employment_status sig { returns(T.nilable(T::Boolean)) } - def end_date - end + attr_reader :end_date - sig { params(_: T::Boolean).returns(T::Boolean) } - def end_date=(_) - end + sig { params(end_date: T::Boolean).void } + attr_writer :end_date sig { returns(T.nilable(T::Boolean)) } - def first_name - end + attr_reader :first_name - sig { params(_: T::Boolean).returns(T::Boolean) } - def first_name=(_) - end + sig { params(first_name: T::Boolean).void } + attr_writer :first_name sig { returns(T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Income)) } - def income - end + attr_reader :income sig do - params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Income) - .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Income) - end - def income=(_) + params( + income: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Income, + FinchAPI::Util::AnyHash + ) + ) + .void end + attr_writer :income sig { returns(T.nilable(T::Boolean)) } - def income_history - end + attr_reader :income_history - sig { params(_: T::Boolean).returns(T::Boolean) } - def income_history=(_) - end + sig { params(income_history: T::Boolean).void } + attr_writer :income_history sig { returns(T.nilable(T::Boolean)) } - def is_active - end + attr_reader :is_active - sig { params(_: T::Boolean).returns(T::Boolean) } - def is_active=(_) - end + sig { params(is_active: T::Boolean).void } + attr_writer :is_active sig { returns(T.nilable(T::Boolean)) } - def last_name - end + attr_reader :last_name - sig { params(_: T::Boolean).returns(T::Boolean) } - def last_name=(_) - end + sig { params(last_name: T::Boolean).void } + attr_writer :last_name sig do returns( T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Location) ) end - def location - end + attr_reader :location sig do - params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Location) - .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Location) - end - def location=(_) + params( + location: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Location, + FinchAPI::Util::AnyHash + ) + ) + .void end + attr_writer :location sig { returns(T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Manager)) } - def manager - end + attr_reader :manager sig do - params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Manager) - .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Manager) - end - def manager=(_) + params( + manager: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Manager, + FinchAPI::Util::AnyHash + ) + ) + .void end + attr_writer :manager sig { returns(T.nilable(T::Boolean)) } - def middle_name - end + attr_reader :middle_name - sig { params(_: T::Boolean).returns(T::Boolean) } - def middle_name=(_) - end + sig { params(middle_name: T::Boolean).void } + attr_writer :middle_name sig { returns(T.nilable(T::Boolean)) } - def start_date - end + attr_reader :start_date - sig { params(_: T::Boolean).returns(T::Boolean) } - def start_date=(_) - end + sig { params(start_date: T::Boolean).void } + attr_writer :start_date sig { returns(T.nilable(T::Boolean)) } - def title - end + attr_reader :title - sig { params(_: T::Boolean).returns(T::Boolean) } - def title=(_) - end + sig { params(title: T::Boolean).void } + attr_writer :title 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, + department: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Department, + FinchAPI::Util::AnyHash + ), + employment: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Employment, + FinchAPI::Util::AnyHash + ), employment_status: T::Boolean, end_date: T::Boolean, first_name: T::Boolean, - income: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Income, + income: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Income, + FinchAPI::Util::AnyHash + ), 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, + location: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Location, + FinchAPI::Util::AnyHash + ), + manager: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::Manager, + FinchAPI::Util::AnyHash + ), middle_name: T::Boolean, start_date: T::Boolean, title: T::Boolean ) - .void + .returns(T.attached_class) end - def initialize( + def self.new( id: nil, class_code: nil, custom_fields: nil, @@ -1132,15 +1141,13 @@ module FinchAPI class Department < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def name - end - - sig { params(_: T::Boolean).returns(T::Boolean) } - def name=(_) - end + attr_reader :name sig { params(name: T::Boolean).void } - def initialize(name: nil) + attr_writer :name + + sig { params(name: T::Boolean).returns(T.attached_class) } + def self.new(name: nil) end sig { override.returns({name: T::Boolean}) } @@ -1150,23 +1157,19 @@ module FinchAPI class Employment < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def subtype - end + attr_reader :subtype - sig { params(_: T::Boolean).returns(T::Boolean) } - def subtype=(_) - end + sig { params(subtype: T::Boolean).void } + attr_writer :subtype sig { returns(T.nilable(T::Boolean)) } - def type - end + attr_reader :type - sig { params(_: T::Boolean).returns(T::Boolean) } - def type=(_) - end + sig { params(type: T::Boolean).void } + attr_writer :type - sig { params(subtype: T::Boolean, type: T::Boolean).void } - def initialize(subtype: nil, type: nil) + sig { params(subtype: T::Boolean, type: T::Boolean).returns(T.attached_class) } + def self.new(subtype: nil, type: nil) end sig { override.returns({subtype: T::Boolean, type: T::Boolean}) } @@ -1176,31 +1179,27 @@ module FinchAPI class Income < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def amount - end + attr_reader :amount - sig { params(_: T::Boolean).returns(T::Boolean) } - def amount=(_) - end + sig { params(amount: T::Boolean).void } + attr_writer :amount sig { returns(T.nilable(T::Boolean)) } - def currency - end + attr_reader :currency - sig { params(_: T::Boolean).returns(T::Boolean) } - def currency=(_) - end + sig { params(currency: T::Boolean).void } + attr_writer :currency sig { returns(T.nilable(T::Boolean)) } - def unit - end + attr_reader :unit - sig { params(_: T::Boolean).returns(T::Boolean) } - def unit=(_) - end + sig { params(unit: T::Boolean).void } + attr_writer :unit - sig { params(amount: T::Boolean, currency: T::Boolean, unit: T::Boolean).void } - def initialize(amount: nil, currency: nil, unit: nil) + sig do + params(amount: T::Boolean, currency: T::Boolean, unit: T::Boolean).returns(T.attached_class) + end + def self.new(amount: nil, currency: nil, unit: nil) end sig { override.returns({amount: T::Boolean, currency: T::Boolean, unit: T::Boolean}) } @@ -1210,52 +1209,40 @@ module FinchAPI class Location < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def city - end + attr_reader :city - sig { params(_: T::Boolean).returns(T::Boolean) } - def city=(_) - end + sig { params(city: T::Boolean).void } + attr_writer :city sig { returns(T.nilable(T::Boolean)) } - def country - end + attr_reader :country - sig { params(_: T::Boolean).returns(T::Boolean) } - def country=(_) - end + sig { params(country: T::Boolean).void } + attr_writer :country sig { returns(T.nilable(T::Boolean)) } - def line1 - end + attr_reader :line1 - sig { params(_: T::Boolean).returns(T::Boolean) } - def line1=(_) - end + sig { params(line1: T::Boolean).void } + attr_writer :line1 sig { returns(T.nilable(T::Boolean)) } - def line2 - end + attr_reader :line2 - sig { params(_: T::Boolean).returns(T::Boolean) } - def line2=(_) - end + sig { params(line2: T::Boolean).void } + attr_writer :line2 sig { returns(T.nilable(T::Boolean)) } - def postal_code - end + attr_reader :postal_code - sig { params(_: T::Boolean).returns(T::Boolean) } - def postal_code=(_) - end + sig { params(postal_code: T::Boolean).void } + attr_writer :postal_code sig { returns(T.nilable(T::Boolean)) } - def state - end + attr_reader :state - sig { params(_: T::Boolean).returns(T::Boolean) } - def state=(_) - end + sig { params(state: T::Boolean).void } + attr_writer :state sig do params( @@ -1266,9 +1253,9 @@ module FinchAPI postal_code: T::Boolean, state: T::Boolean ) - .void + .returns(T.attached_class) end - def initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil) + def self.new(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil) end sig do @@ -1290,15 +1277,13 @@ module FinchAPI class Manager < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def id - end - - sig { params(_: T::Boolean).returns(T::Boolean) } - def id=(_) - end + attr_reader :id sig { params(id: T::Boolean).void } - def initialize(id: nil) + attr_writer :id + + sig { params(id: T::Boolean).returns(T.attached_class) } + def self.new(id: nil) end sig { override.returns({id: T::Boolean}) } @@ -1309,145 +1294,143 @@ module FinchAPI class Individual < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def id - end + attr_reader :id - sig { params(_: T::Boolean).returns(T::Boolean) } - def id=(_) - end + sig { params(id: T::Boolean).void } + attr_writer :id sig { returns(T.nilable(T::Boolean)) } - def dob - end + attr_reader :dob - sig { params(_: T::Boolean).returns(T::Boolean) } - def dob=(_) - end + sig { params(dob: T::Boolean).void } + attr_writer :dob sig { returns(T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Emails)) } - def emails - end + attr_reader :emails sig do - params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Emails) - .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Emails) - end - def emails=(_) + params( + emails: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Emails, + FinchAPI::Util::AnyHash + ) + ) + .void end + attr_writer :emails sig { returns(T.nilable(T::Boolean)) } - def encrypted_ssn - end + attr_reader :encrypted_ssn - sig { params(_: T::Boolean).returns(T::Boolean) } - def encrypted_ssn=(_) - end + sig { params(encrypted_ssn: T::Boolean).void } + attr_writer :encrypted_ssn sig { returns(T.nilable(T::Boolean)) } - def ethnicity - end + attr_reader :ethnicity - sig { params(_: T::Boolean).returns(T::Boolean) } - def ethnicity=(_) - end + sig { params(ethnicity: T::Boolean).void } + attr_writer :ethnicity sig { returns(T.nilable(T::Boolean)) } - def first_name - end + attr_reader :first_name - sig { params(_: T::Boolean).returns(T::Boolean) } - def first_name=(_) - end + sig { params(first_name: T::Boolean).void } + attr_writer :first_name sig { returns(T.nilable(T::Boolean)) } - def gender - end + attr_reader :gender - sig { params(_: T::Boolean).returns(T::Boolean) } - def gender=(_) - end + sig { params(gender: T::Boolean).void } + attr_writer :gender sig { returns(T.nilable(T::Boolean)) } - def last_name - end + attr_reader :last_name - sig { params(_: T::Boolean).returns(T::Boolean) } - def last_name=(_) - end + sig { params(last_name: T::Boolean).void } + attr_writer :last_name sig { returns(T.nilable(T::Boolean)) } - def middle_name - end + attr_reader :middle_name - sig { params(_: T::Boolean).returns(T::Boolean) } - def middle_name=(_) - end + sig { params(middle_name: T::Boolean).void } + attr_writer :middle_name sig do returns( T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::PhoneNumbers) ) end - def phone_numbers - end + attr_reader :phone_numbers sig do - params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::PhoneNumbers) - .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::PhoneNumbers) - end - def phone_numbers=(_) + params( + phone_numbers: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::PhoneNumbers, + FinchAPI::Util::AnyHash + ) + ) + .void end + attr_writer :phone_numbers sig { returns(T.nilable(T::Boolean)) } - def preferred_name - end + attr_reader :preferred_name - sig { params(_: T::Boolean).returns(T::Boolean) } - def preferred_name=(_) - end + sig { params(preferred_name: T::Boolean).void } + attr_writer :preferred_name sig do returns( T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Residence) ) end - def residence - end + attr_reader :residence sig do - params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Residence) - .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Residence) - end - def residence=(_) + params( + residence: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Residence, + FinchAPI::Util::AnyHash + ) + ) + .void end + attr_writer :residence sig { returns(T.nilable(T::Boolean)) } - def ssn - end + attr_reader :ssn - sig { params(_: T::Boolean).returns(T::Boolean) } - def ssn=(_) - end + sig { params(ssn: T::Boolean).void } + attr_writer :ssn sig do params( id: T::Boolean, dob: T::Boolean, - emails: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Emails, + emails: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Emails, + FinchAPI::Util::AnyHash + ), 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, + phone_numbers: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::PhoneNumbers, + FinchAPI::Util::AnyHash + ), preferred_name: T::Boolean, - residence: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Residence, + residence: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::Residence, + FinchAPI::Util::AnyHash + ), ssn: T::Boolean ) - .void + .returns(T.attached_class) end - def initialize( + def self.new( id: nil, dob: nil, emails: nil, @@ -1489,23 +1472,19 @@ module FinchAPI class Emails < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def data - end + attr_reader :data - sig { params(_: T::Boolean).returns(T::Boolean) } - def data=(_) - end + sig { params(data: T::Boolean).void } + attr_writer :data sig { returns(T.nilable(T::Boolean)) } - def type - end + attr_reader :type - sig { params(_: T::Boolean).returns(T::Boolean) } - def type=(_) - end + sig { params(type: T::Boolean).void } + attr_writer :type - sig { params(data: T::Boolean, type: T::Boolean).void } - def initialize(data: nil, type: nil) + sig { params(data: T::Boolean, type: T::Boolean).returns(T.attached_class) } + def self.new(data: nil, type: nil) end sig { override.returns({data: T::Boolean, type: T::Boolean}) } @@ -1515,23 +1494,19 @@ module FinchAPI class PhoneNumbers < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def data - end + attr_reader :data - sig { params(_: T::Boolean).returns(T::Boolean) } - def data=(_) - end + sig { params(data: T::Boolean).void } + attr_writer :data sig { returns(T.nilable(T::Boolean)) } - def type - end + attr_reader :type - sig { params(_: T::Boolean).returns(T::Boolean) } - def type=(_) - end + sig { params(type: T::Boolean).void } + attr_writer :type - sig { params(data: T::Boolean, type: T::Boolean).void } - def initialize(data: nil, type: nil) + sig { params(data: T::Boolean, type: T::Boolean).returns(T.attached_class) } + def self.new(data: nil, type: nil) end sig { override.returns({data: T::Boolean, type: T::Boolean}) } @@ -1541,52 +1516,40 @@ module FinchAPI class Residence < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def city - end + attr_reader :city - sig { params(_: T::Boolean).returns(T::Boolean) } - def city=(_) - end + sig { params(city: T::Boolean).void } + attr_writer :city sig { returns(T.nilable(T::Boolean)) } - def country - end + attr_reader :country - sig { params(_: T::Boolean).returns(T::Boolean) } - def country=(_) - end + sig { params(country: T::Boolean).void } + attr_writer :country sig { returns(T.nilable(T::Boolean)) } - def line1 - end + attr_reader :line1 - sig { params(_: T::Boolean).returns(T::Boolean) } - def line1=(_) - end + sig { params(line1: T::Boolean).void } + attr_writer :line1 sig { returns(T.nilable(T::Boolean)) } - def line2 - end + attr_reader :line2 - sig { params(_: T::Boolean).returns(T::Boolean) } - def line2=(_) - end + sig { params(line2: T::Boolean).void } + attr_writer :line2 sig { returns(T.nilable(T::Boolean)) } - def postal_code - end + attr_reader :postal_code - sig { params(_: T::Boolean).returns(T::Boolean) } - def postal_code=(_) - end + sig { params(postal_code: T::Boolean).void } + attr_writer :postal_code sig { returns(T.nilable(T::Boolean)) } - def state - end + attr_reader :state - sig { params(_: T::Boolean).returns(T::Boolean) } - def state=(_) - end + sig { params(state: T::Boolean).void } + attr_writer :state sig do params( @@ -1597,9 +1560,9 @@ module FinchAPI postal_code: T::Boolean, state: T::Boolean ) - .void + .returns(T.attached_class) end - def initialize(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil) + def self.new(city: nil, country: nil, line1: nil, line2: nil, postal_code: nil, state: nil) end sig do @@ -1622,36 +1585,28 @@ module FinchAPI class PayGroup < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def id - end + attr_reader :id - sig { params(_: T::Boolean).returns(T::Boolean) } - def id=(_) - end + sig { params(id: T::Boolean).void } + attr_writer :id sig { returns(T.nilable(T::Boolean)) } - def individual_ids - end + attr_reader :individual_ids - sig { params(_: T::Boolean).returns(T::Boolean) } - def individual_ids=(_) - end + sig { params(individual_ids: T::Boolean).void } + attr_writer :individual_ids sig { returns(T.nilable(T::Boolean)) } - def name - end + attr_reader :name - sig { params(_: T::Boolean).returns(T::Boolean) } - def name=(_) - end + sig { params(name: T::Boolean).void } + attr_writer :name sig { returns(T.nilable(T::Boolean)) } - def pay_frequencies - end + attr_reader :pay_frequencies - sig { params(_: T::Boolean).returns(T::Boolean) } - def pay_frequencies=(_) - end + sig { params(pay_frequencies: T::Boolean).void } + attr_writer :pay_frequencies sig do params( @@ -1659,9 +1614,10 @@ module FinchAPI individual_ids: T::Boolean, name: T::Boolean, pay_frequencies: T::Boolean - ).void + ) + .returns(T.attached_class) end - def initialize(id: nil, individual_ids: nil, name: nil, pay_frequencies: nil) + def self.new(id: nil, individual_ids: nil, name: nil, pay_frequencies: nil) end sig do @@ -1683,39 +1639,51 @@ module FinchAPI T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::Paging) ) end - def paging - end + attr_reader :paging sig do - params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::Paging) - .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::Paging) - end - def paging=(_) + params( + paging: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::Paging, + FinchAPI::Util::AnyHash + ) + ) + .void end + attr_writer :paging sig do returns( T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements) ) end - def pay_statements - end + attr_reader :pay_statements sig do - params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements) - .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements) - end - def pay_statements=(_) + params( + pay_statements: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements, + FinchAPI::Util::AnyHash + ) + ) + .void end + attr_writer :pay_statements sig do params( - paging: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::Paging, - pay_statements: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements + paging: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::Paging, + FinchAPI::Util::AnyHash + ), + pay_statements: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements, + FinchAPI::Util::AnyHash + ) ) - .void + .returns(T.attached_class) end - def initialize(paging: nil, pay_statements: nil) + def self.new(paging: nil, pay_statements: nil) end sig do @@ -1732,23 +1700,13 @@ module FinchAPI class Paging < FinchAPI::BaseModel sig { returns(T::Boolean) } - def count - end - - sig { params(_: T::Boolean).returns(T::Boolean) } - def count=(_) - end + attr_accessor :count sig { returns(T::Boolean) } - def offset - end - - sig { params(_: T::Boolean).returns(T::Boolean) } - def offset=(_) - end + attr_accessor :offset - sig { params(count: T::Boolean, offset: T::Boolean).void } - def initialize(count:, offset:) + sig { params(count: T::Boolean, offset: T::Boolean).returns(T.attached_class) } + def self.new(count:, offset:) end sig { override.returns({count: T::Boolean, offset: T::Boolean}) } @@ -1764,19 +1722,18 @@ module FinchAPI ) ) end - def earnings - end + attr_reader :earnings sig do params( - _: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings - ) - .returns( - FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings + earnings: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings, + FinchAPI::Util::AnyHash ) + ) + .void end - def earnings=(_) - end + attr_writer :earnings sig do returns( @@ -1785,19 +1742,18 @@ module FinchAPI ) ) end - def employee_deductions - end + attr_reader :employee_deductions sig do params( - _: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployeeDeductions - ) - .returns( - FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployeeDeductions + employee_deductions: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployeeDeductions, + FinchAPI::Util::AnyHash ) + ) + .void end - def employee_deductions=(_) - end + attr_writer :employee_deductions sig do returns( @@ -1806,51 +1762,42 @@ module FinchAPI ) ) end - def employer_contributions - end + attr_reader :employer_contributions sig do params( - _: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployerContributions - ) - .returns( - FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployerContributions + employer_contributions: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployerContributions, + FinchAPI::Util::AnyHash ) + ) + .void end - def employer_contributions=(_) - end + attr_writer :employer_contributions sig { returns(T.nilable(T::Boolean)) } - def gross_pay - end + attr_reader :gross_pay - sig { params(_: T::Boolean).returns(T::Boolean) } - def gross_pay=(_) - end + sig { params(gross_pay: T::Boolean).void } + attr_writer :gross_pay sig { returns(T.nilable(T::Boolean)) } - def individual_id - end + attr_reader :individual_id - sig { params(_: T::Boolean).returns(T::Boolean) } - def individual_id=(_) - end + sig { params(individual_id: T::Boolean).void } + attr_writer :individual_id sig { returns(T.nilable(T::Boolean)) } - def net_pay - end + attr_reader :net_pay - sig { params(_: T::Boolean).returns(T::Boolean) } - def net_pay=(_) - end + sig { params(net_pay: T::Boolean).void } + attr_writer :net_pay sig { returns(T.nilable(T::Boolean)) } - def payment_method - end + attr_reader :payment_method - sig { params(_: T::Boolean).returns(T::Boolean) } - def payment_method=(_) - end + sig { params(payment_method: T::Boolean).void } + attr_writer :payment_method sig do returns( @@ -1859,52 +1806,59 @@ module FinchAPI ) ) end - def taxes - end + attr_reader :taxes sig do params( - _: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Taxes - ) - .returns( - FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Taxes + taxes: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Taxes, + FinchAPI::Util::AnyHash ) + ) + .void end - def taxes=(_) - end + attr_writer :taxes sig { returns(T.nilable(T::Boolean)) } - def total_hours - end + attr_reader :total_hours - sig { params(_: T::Boolean).returns(T::Boolean) } - def total_hours=(_) - end + sig { params(total_hours: T::Boolean).void } + attr_writer :total_hours sig { returns(T.nilable(T::Boolean)) } - def type - end + attr_reader :type - sig { params(_: T::Boolean).returns(T::Boolean) } - def type=(_) - end + sig { params(type: T::Boolean).void } + attr_writer :type 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, + earnings: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Earnings, + FinchAPI::Util::AnyHash + ), + employee_deductions: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployeeDeductions, + FinchAPI::Util::AnyHash + ), + employer_contributions: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::EmployerContributions, + FinchAPI::Util::AnyHash + ), 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, + taxes: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::Taxes, + FinchAPI::Util::AnyHash + ), total_hours: T::Boolean, type: T::Boolean ) - .void + .returns(T.attached_class) end - def initialize( + def self.new( earnings: nil, employee_deductions: nil, employer_contributions: nil, @@ -1940,41 +1894,34 @@ module FinchAPI class Earnings < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def amount - end + attr_reader :amount - sig { params(_: T::Boolean).returns(T::Boolean) } - def amount=(_) - end + sig { params(amount: T::Boolean).void } + attr_writer :amount sig { returns(T.nilable(T::Boolean)) } - def currency - end + attr_reader :currency - sig { params(_: T::Boolean).returns(T::Boolean) } - def currency=(_) - end + sig { params(currency: T::Boolean).void } + attr_writer :currency sig { returns(T.nilable(T::Boolean)) } - def name - end + attr_reader :name - sig { params(_: T::Boolean).returns(T::Boolean) } - def name=(_) - end + sig { params(name: T::Boolean).void } + attr_writer :name sig { returns(T.nilable(T::Boolean)) } - def type - end + attr_reader :type - sig { params(_: T::Boolean).returns(T::Boolean) } - def type=(_) - end + sig { params(type: T::Boolean).void } + attr_writer :type sig do - params(amount: T::Boolean, currency: T::Boolean, name: T::Boolean, type: T::Boolean).void + params(amount: T::Boolean, currency: T::Boolean, name: T::Boolean, type: T::Boolean) + .returns(T.attached_class) end - def initialize(amount: nil, currency: nil, name: nil, type: nil) + def self.new(amount: nil, currency: nil, name: nil, type: nil) end sig do @@ -1993,44 +1940,34 @@ module FinchAPI class EmployeeDeductions < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def amount - end + attr_reader :amount - sig { params(_: T::Boolean).returns(T::Boolean) } - def amount=(_) - end + sig { params(amount: T::Boolean).void } + attr_writer :amount sig { returns(T.nilable(T::Boolean)) } - def currency - end + attr_reader :currency - sig { params(_: T::Boolean).returns(T::Boolean) } - def currency=(_) - end + sig { params(currency: T::Boolean).void } + attr_writer :currency sig { returns(T.nilable(T::Boolean)) } - def name - end + attr_reader :name - sig { params(_: T::Boolean).returns(T::Boolean) } - def name=(_) - end + sig { params(name: T::Boolean).void } + attr_writer :name sig { returns(T.nilable(T::Boolean)) } - def pre_tax - end + attr_reader :pre_tax - sig { params(_: T::Boolean).returns(T::Boolean) } - def pre_tax=(_) - end + sig { params(pre_tax: T::Boolean).void } + attr_writer :pre_tax sig { returns(T.nilable(T::Boolean)) } - def type - end + attr_reader :type - sig { params(_: T::Boolean).returns(T::Boolean) } - def type=(_) - end + sig { params(type: T::Boolean).void } + attr_writer :type sig do params( @@ -2040,9 +1977,9 @@ module FinchAPI pre_tax: T::Boolean, type: T::Boolean ) - .void + .returns(T.attached_class) end - def initialize(amount: nil, currency: nil, name: nil, pre_tax: nil, type: nil) + def self.new(amount: nil, currency: nil, name: nil, pre_tax: nil, type: nil) end sig do @@ -2063,31 +2000,27 @@ module FinchAPI class EmployerContributions < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def amount - end + attr_reader :amount - sig { params(_: T::Boolean).returns(T::Boolean) } - def amount=(_) - end + sig { params(amount: T::Boolean).void } + attr_writer :amount sig { returns(T.nilable(T::Boolean)) } - def currency - end + attr_reader :currency - sig { params(_: T::Boolean).returns(T::Boolean) } - def currency=(_) - end + sig { params(currency: T::Boolean).void } + attr_writer :currency sig { returns(T.nilable(T::Boolean)) } - def name - end + attr_reader :name - sig { params(_: T::Boolean).returns(T::Boolean) } - def name=(_) - end + sig { params(name: T::Boolean).void } + attr_writer :name - sig { params(amount: T::Boolean, currency: T::Boolean, name: T::Boolean).void } - def initialize(amount: nil, currency: nil, name: nil) + sig do + params(amount: T::Boolean, currency: T::Boolean, name: T::Boolean).returns(T.attached_class) + end + def self.new(amount: nil, currency: nil, name: nil) end sig { override.returns({amount: T::Boolean, currency: T::Boolean, name: T::Boolean}) } @@ -2097,44 +2030,34 @@ module FinchAPI class Taxes < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def amount - end + attr_reader :amount - sig { params(_: T::Boolean).returns(T::Boolean) } - def amount=(_) - end + sig { params(amount: T::Boolean).void } + attr_writer :amount sig { returns(T.nilable(T::Boolean)) } - def currency - end + attr_reader :currency - sig { params(_: T::Boolean).returns(T::Boolean) } - def currency=(_) - end + sig { params(currency: T::Boolean).void } + attr_writer :currency sig { returns(T.nilable(T::Boolean)) } - def employer - end + attr_reader :employer - sig { params(_: T::Boolean).returns(T::Boolean) } - def employer=(_) - end + sig { params(employer: T::Boolean).void } + attr_writer :employer sig { returns(T.nilable(T::Boolean)) } - def name - end + attr_reader :name - sig { params(_: T::Boolean).returns(T::Boolean) } - def name=(_) - end + sig { params(name: T::Boolean).void } + attr_writer :name sig { returns(T.nilable(T::Boolean)) } - def type - end + attr_reader :type - sig { params(_: T::Boolean).returns(T::Boolean) } - def type=(_) - end + sig { params(type: T::Boolean).void } + attr_writer :type sig do params( @@ -2144,9 +2067,9 @@ module FinchAPI name: T::Boolean, type: T::Boolean ) - .void + .returns(T.attached_class) end - def initialize(amount: nil, currency: nil, employer: nil, name: nil, type: nil) + def self.new(amount: nil, currency: nil, employer: nil, name: nil, type: nil) end sig do @@ -2169,103 +2092,84 @@ module FinchAPI class Payment < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def id - end + attr_reader :id - sig { params(_: T::Boolean).returns(T::Boolean) } - def id=(_) - end + sig { params(id: T::Boolean).void } + attr_writer :id sig { returns(T.nilable(T::Boolean)) } - def company_debit - end + attr_reader :company_debit - sig { params(_: T::Boolean).returns(T::Boolean) } - def company_debit=(_) - end + sig { params(company_debit: T::Boolean).void } + attr_writer :company_debit sig { returns(T.nilable(T::Boolean)) } - def debit_date - end + attr_reader :debit_date - sig { params(_: T::Boolean).returns(T::Boolean) } - def debit_date=(_) - end + sig { params(debit_date: T::Boolean).void } + attr_writer :debit_date sig { returns(T.nilable(T::Boolean)) } - def employee_taxes - end + attr_reader :employee_taxes - sig { params(_: T::Boolean).returns(T::Boolean) } - def employee_taxes=(_) - end + sig { params(employee_taxes: T::Boolean).void } + attr_writer :employee_taxes sig { returns(T.nilable(T::Boolean)) } - def employer_taxes - end + attr_reader :employer_taxes - sig { params(_: T::Boolean).returns(T::Boolean) } - def employer_taxes=(_) - end + sig { params(employer_taxes: T::Boolean).void } + attr_writer :employer_taxes sig { returns(T.nilable(T::Boolean)) } - def gross_pay - end + attr_reader :gross_pay - sig { params(_: T::Boolean).returns(T::Boolean) } - def gross_pay=(_) - end + sig { params(gross_pay: T::Boolean).void } + attr_writer :gross_pay sig { returns(T.nilable(T::Boolean)) } - def individual_ids - end + attr_reader :individual_ids - sig { params(_: T::Boolean).returns(T::Boolean) } - def individual_ids=(_) - end + sig { params(individual_ids: T::Boolean).void } + attr_writer :individual_ids sig { returns(T.nilable(T::Boolean)) } - def net_pay - end + attr_reader :net_pay - sig { params(_: T::Boolean).returns(T::Boolean) } - def net_pay=(_) - end + sig { params(net_pay: T::Boolean).void } + attr_writer :net_pay sig { returns(T.nilable(T::Boolean)) } - def pay_date - end + attr_reader :pay_date - sig { params(_: T::Boolean).returns(T::Boolean) } - def pay_date=(_) - end + sig { params(pay_date: T::Boolean).void } + attr_writer :pay_date sig { returns(T.nilable(T::Boolean)) } - def pay_frequencies - end + attr_reader :pay_frequencies - sig { params(_: T::Boolean).returns(T::Boolean) } - def pay_frequencies=(_) - end + sig { params(pay_frequencies: T::Boolean).void } + attr_writer :pay_frequencies sig { returns(T.nilable(T::Boolean)) } - def pay_group_ids - end + attr_reader :pay_group_ids - sig { params(_: T::Boolean).returns(T::Boolean) } - def pay_group_ids=(_) - end + sig { params(pay_group_ids: T::Boolean).void } + attr_writer :pay_group_ids sig { returns(T.nilable(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment::PayPeriod)) } - def pay_period - end + attr_reader :pay_period sig do - params(_: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment::PayPeriod) - .returns(FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment::PayPeriod) - end - def pay_period=(_) + params( + pay_period: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment::PayPeriod, + FinchAPI::Util::AnyHash + ) + ) + .void end + attr_writer :pay_period sig do params( @@ -2280,11 +2184,14 @@ module FinchAPI pay_date: T::Boolean, pay_frequencies: T::Boolean, pay_group_ids: T::Boolean, - pay_period: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment::PayPeriod + pay_period: T.any( + FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment::PayPeriod, + FinchAPI::Util::AnyHash + ) ) - .void + .returns(T.attached_class) end - def initialize( + def self.new( id: nil, company_debit: nil, debit_date: nil, @@ -2324,23 +2231,19 @@ module FinchAPI class PayPeriod < FinchAPI::BaseModel sig { returns(T.nilable(T::Boolean)) } - def end_date - end + attr_reader :end_date - sig { params(_: T::Boolean).returns(T::Boolean) } - def end_date=(_) - end + sig { params(end_date: T::Boolean).void } + attr_writer :end_date sig { returns(T.nilable(T::Boolean)) } - def start_date - end + attr_reader :start_date - sig { params(_: T::Boolean).returns(T::Boolean) } - def start_date=(_) - end + sig { params(start_date: T::Boolean).void } + attr_writer :start_date - sig { params(end_date: T::Boolean, start_date: T::Boolean).void } - def initialize(end_date: nil, start_date: nil) + sig { params(end_date: T::Boolean, start_date: T::Boolean).returns(T.attached_class) } + def self.new(end_date: nil, start_date: nil) end sig { override.returns({end_date: T::Boolean, start_date: T::Boolean}) } @@ -2350,16 +2253,22 @@ module FinchAPI end end - class Type < FinchAPI::Enum - abstract! + # The type of authentication method. + module Type + extend FinchAPI::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::Provider::AuthenticationMethod::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Provider::AuthenticationMethod::Type::TaggedSymbol) } - ASSISTED = :assisted - CREDENTIAL = :credential - API_TOKEN = :api_token - API_CREDENTIAL = :api_credential - OAUTH = :oauth + ASSISTED = T.let(:assisted, FinchAPI::Models::Provider::AuthenticationMethod::Type::TaggedSymbol) + CREDENTIAL = T.let(:credential, FinchAPI::Models::Provider::AuthenticationMethod::Type::TaggedSymbol) + API_TOKEN = T.let(:api_token, FinchAPI::Models::Provider::AuthenticationMethod::Type::TaggedSymbol) + API_CREDENTIAL = + T.let(:api_credential, FinchAPI::Models::Provider::AuthenticationMethod::Type::TaggedSymbol) + OAUTH = T.let(:oauth, FinchAPI::Models::Provider::AuthenticationMethod::Type::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig { override.returns(T::Array[FinchAPI::Models::Provider::AuthenticationMethod::Type::TaggedSymbol]) } def self.values end end diff --git a/rbi/lib/finch-api/models/provider_list_params.rbi b/rbi/lib/finch-api/models/provider_list_params.rbi index f4339070..4c5e4ae7 100644 --- a/rbi/lib/finch-api/models/provider_list_params.rbi +++ b/rbi/lib/finch-api/models/provider_list_params.rbi @@ -6,8 +6,15 @@ module FinchAPI 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: {}) + sig do + params( + request_options: T.any( + FinchAPI::RequestOptions, + FinchAPI::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) end sig { override.returns({request_options: FinchAPI::RequestOptions}) } diff --git a/rbi/lib/finch-api/models/request_forwarding_forward_params.rbi b/rbi/lib/finch-api/models/request_forwarding_forward_params.rbi index ec90cff9..b45804fc 100644 --- a/rbi/lib/finch-api/models/request_forwarding_forward_params.rbi +++ b/rbi/lib/finch-api/models/request_forwarding_forward_params.rbi @@ -6,45 +6,32 @@ module FinchAPI extend FinchAPI::RequestParameters::Converter include FinchAPI::RequestParameters + # The HTTP method for the forwarded request. Valid values include: `GET` , `POST` + # , `PUT` , `DELETE` , and `PATCH`. sig { returns(String) } - def method_ - end - - sig { params(_: String).returns(String) } - def method_=(_) - end + attr_accessor :method_ + # 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. sig { returns(String) } - def route - end - - sig { params(_: String).returns(String) } - def route=(_) - end + attr_accessor :route + # The body for the forwarded request. This value must be specified as either a + # string or a valid JSON object. sig { returns(T.nilable(String)) } - def data - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def data=(_) - end + attr_accessor :data + # 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" }` sig { returns(T.nilable(T.anything)) } - def headers - end - - sig { params(_: T.nilable(T.anything)).returns(T.nilable(T.anything)) } - def headers=(_) - end + attr_accessor :headers + # The query parameters for the forwarded request. This value must be specified as + # a valid JSON object rather than a query string. sig { returns(T.nilable(T.anything)) } - def params - end - - sig { params(_: T.nilable(T.anything)).returns(T.nilable(T.anything)) } - def params=(_) - end + attr_accessor :params sig do params( @@ -53,11 +40,11 @@ module FinchAPI 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]) + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) ) - .void + .returns(T.attached_class) end - def initialize(method_:, route:, data: nil, headers: nil, params: nil, request_options: {}) + def self.new(method_:, route:, data: nil, headers: nil, params: nil, request_options: {}) end sig do diff --git a/rbi/lib/finch-api/models/request_forwarding_forward_response.rbi b/rbi/lib/finch-api/models/request_forwarding_forward_response.rbi index 653c39c3..75f52e1c 100644 --- a/rbi/lib/finch-api/models/request_forwarding_forward_response.rbi +++ b/rbi/lib/finch-api/models/request_forwarding_forward_response.rbi @@ -3,51 +3,45 @@ module FinchAPI module Models class RequestForwardingForwardResponse < FinchAPI::BaseModel + # 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. sig { returns(T.nilable(String)) } - def data - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def data=(_) - end + attr_accessor :data + # The HTTP headers of the forwarded request’s response, exactly as received from + # the underlying integration’s API. sig { returns(T.nilable(T.anything)) } - def headers - end - - sig { params(_: T.nilable(T.anything)).returns(T.nilable(T.anything)) } - def headers=(_) - end + attr_accessor :headers + # An object containing details of your original forwarded request, for your ease + # of reference. sig { returns(FinchAPI::Models::RequestForwardingForwardResponse::Request) } - def request - end + attr_reader :request sig do - params(_: FinchAPI::Models::RequestForwardingForwardResponse::Request) - .returns(FinchAPI::Models::RequestForwardingForwardResponse::Request) - end - def request=(_) + params( + request: T.any(FinchAPI::Models::RequestForwardingForwardResponse::Request, FinchAPI::Util::AnyHash) + ) + .void end + attr_writer :request + # 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. sig { returns(Integer) } - def status_code - end - - sig { params(_: Integer).returns(Integer) } - def status_code=(_) - end + attr_accessor :status_code sig do params( data: T.nilable(String), headers: T.nilable(T.anything), - request: FinchAPI::Models::RequestForwardingForwardResponse::Request, + request: T.any(FinchAPI::Models::RequestForwardingForwardResponse::Request, FinchAPI::Util::AnyHash), status_code: Integer ) - .void + .returns(T.attached_class) end - def initialize(data:, headers:, request:, status_code:) + def self.new(data:, headers:, request:, status_code:) end sig do @@ -65,46 +59,33 @@ module FinchAPI end class Request < FinchAPI::BaseModel + # 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. sig { returns(T.nilable(String)) } - def data - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def data=(_) - end + attr_accessor :data + # The specified HTTP headers that were included in the forwarded request. If no + # headers were specified, this will be returned as `null`. sig { returns(T.nilable(T.anything)) } - def headers - end - - sig { params(_: T.nilable(T.anything)).returns(T.nilable(T.anything)) } - def headers=(_) - end + attr_accessor :headers + # The HTTP method that was specified for the forwarded request. Valid values + # include: `GET` , `POST` , `PUT` , `DELETE` , and `PATCH`. sig { returns(String) } - def method_ - end - - sig { params(_: String).returns(String) } - def method_=(_) - end + attr_accessor :method_ + # The query parameters that were included in the forwarded request. If no query + # parameters were specified, this will be returned as `null`. sig { returns(T.nilable(T.anything)) } - def params - end - - sig { params(_: T.nilable(T.anything)).returns(T.nilable(T.anything)) } - def params=(_) - end + attr_accessor :params + # The URL route path that was specified for the forwarded request. sig { returns(String) } - def route - end - - sig { params(_: String).returns(String) } - def route=(_) - end + attr_accessor :route + # An object containing details of your original forwarded request, for your ease + # of reference. sig do params( data: T.nilable(String), @@ -113,9 +94,9 @@ module FinchAPI params: T.nilable(T.anything), route: String ) - .void + .returns(T.attached_class) end - def initialize(data:, headers:, method_:, params:, route:) + def self.new(data:, headers:, method_:, params:, route:) end sig do diff --git a/rbi/lib/finch-api/models/sandbox/company_update_params.rbi b/rbi/lib/finch-api/models/sandbox/company_update_params.rbi index 086cbf4d..cd28482e 100644 --- a/rbi/lib/finch-api/models/sandbox/company_update_params.rbi +++ b/rbi/lib/finch-api/models/sandbox/company_update_params.rbi @@ -7,97 +7,64 @@ module FinchAPI extend FinchAPI::RequestParameters::Converter include FinchAPI::RequestParameters + # An array of bank account objects associated with the payroll/HRIS system. 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 + attr_accessor :accounts + # The array of company departments. 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 + attr_accessor :departments + # The employer identification number. sig { returns(T.nilable(String)) } - def ein - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def ein=(_) - end + attr_accessor :ein + # The entity type object. sig { returns(T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity)) } - def entity - end + attr_reader :entity sig do - params(_: T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity)) - .returns(T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity)) - end - def entity=(_) + params( + entity: T.nilable(T.any(FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity, FinchAPI::Util::AnyHash)) + ) + .void end + attr_writer :entity + # The legal name of the company. sig { returns(T.nilable(String)) } - def legal_name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def legal_name=(_) - end + attr_accessor :legal_name 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 + attr_accessor :locations + # The email of the main administrator on the account. sig { returns(T.nilable(String)) } - def primary_email - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def primary_email=(_) - end + attr_accessor :primary_email + # The phone number of the main administrator on the account. Format: `XXXXXXXXXX` sig { returns(T.nilable(String)) } - def primary_phone_number - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def primary_phone_number=(_) - end + attr_accessor :primary_phone_number 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)]), + accounts: T.nilable( + T::Array[T.any(FinchAPI::Models::Sandbox::CompanyUpdateParams::Account, FinchAPI::Util::AnyHash)] + ), + departments: T.nilable( + T::Array[T.nilable(T.any(FinchAPI::Models::Sandbox::CompanyUpdateParams::Department, FinchAPI::Util::AnyHash))] + ), ein: T.nilable(String), - entity: T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity), + entity: T.nilable(T.any(FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity, FinchAPI::Util::AnyHash)), legal_name: T.nilable(String), - locations: T.nilable(T::Array[T.nilable(FinchAPI::Models::Location)]), + locations: T.nilable(T::Array[T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Util::AnyHash))]), primary_email: T.nilable(String), primary_phone_number: T.nilable(String), - request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) ) - .void + .returns(T.attached_class) end - def initialize( + def self.new( accounts:, departments:, ein:, @@ -130,63 +97,38 @@ module FinchAPI end class Account < FinchAPI::BaseModel + # The name of the bank associated in the payroll/HRIS system. sig { returns(T.nilable(String)) } - def account_name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def account_name=(_) - end + attr_accessor :account_name + # 10-12 digit number to specify the bank account 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 + attr_accessor :account_number - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def account_type=(_) - end + # The type of bank account. + sig { returns(T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateParams::Account::AccountType::OrSymbol)) } + attr_accessor :account_type + # Name of the banking institution. sig { returns(T.nilable(String)) } - def institution_name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def institution_name=(_) - end + attr_accessor :institution_name + # A nine-digit code that's based on the U.S. Bank location where your account was + # opened. sig { returns(T.nilable(String)) } - def routing_number - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def routing_number=(_) - end + attr_accessor :routing_number sig do params( account_name: T.nilable(String), account_number: T.nilable(String), - account_type: T.nilable(Symbol), + account_type: T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateParams::Account::AccountType::OrSymbol), institution_name: T.nilable(String), routing_number: T.nilable(String) ) - .void + .returns(T.attached_class) end - def initialize( - account_name: nil, - account_number: nil, - account_type: nil, - institution_name: nil, - routing_number: nil - ) + def self.new(account_name: nil, account_number: nil, account_type: nil, institution_name: nil, routing_number: nil) end sig do @@ -195,7 +137,7 @@ module FinchAPI { account_name: T.nilable(String), account_number: T.nilable(String), - account_type: T.nilable(Symbol), + account_type: T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateParams::Account::AccountType::OrSymbol), institution_name: T.nilable(String), routing_number: T.nilable(String) } @@ -204,46 +146,58 @@ module FinchAPI def to_hash end - class AccountType < FinchAPI::Enum - abstract! + # The type of bank account. + module AccountType + extend FinchAPI::Enum - CHECKING = T.let(:checking, T.nilable(Symbol)) - SAVINGS = T.let(:savings, T.nilable(Symbol)) + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::Sandbox::CompanyUpdateParams::Account::AccountType) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Sandbox::CompanyUpdateParams::Account::AccountType::TaggedSymbol) } - sig { override.returns(T::Array[Symbol]) } + CHECKING = + T.let(:checking, FinchAPI::Models::Sandbox::CompanyUpdateParams::Account::AccountType::TaggedSymbol) + SAVINGS = + T.let(:savings, FinchAPI::Models::Sandbox::CompanyUpdateParams::Account::AccountType::TaggedSymbol) + + sig do + override + .returns(T::Array[FinchAPI::Models::Sandbox::CompanyUpdateParams::Account::AccountType::TaggedSymbol]) + end def self.values end end end class Department < FinchAPI::BaseModel + # The department name. sig { returns(T.nilable(String)) } - def name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def name=(_) - end + attr_accessor :name + # The parent department, if present. sig { returns(T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateParams::Department::Parent)) } - def parent - end + attr_reader :parent sig do - params(_: T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateParams::Department::Parent)) - .returns(T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateParams::Department::Parent)) - end - def parent=(_) + params( + parent: T.nilable( + T.any(FinchAPI::Models::Sandbox::CompanyUpdateParams::Department::Parent, FinchAPI::Util::AnyHash) + ) + ) + .void end + attr_writer :parent sig do params( name: T.nilable(String), - parent: T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateParams::Department::Parent) + parent: T.nilable( + T.any(FinchAPI::Models::Sandbox::CompanyUpdateParams::Department::Parent, FinchAPI::Util::AnyHash) + ) ) - .void + .returns(T.attached_class) end - def initialize(name: nil, parent: nil) + def self.new(name: nil, parent: nil) end sig do @@ -259,16 +213,13 @@ module FinchAPI end class Parent < FinchAPI::BaseModel + # The parent department's name. sig { returns(T.nilable(String)) } - def name - end + attr_accessor :name - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def name=(_) - end - - sig { params(name: T.nilable(String)).void } - def initialize(name: nil) + # The parent department, if present. + sig { params(name: T.nilable(String)).returns(T.attached_class) } + def self.new(name: nil) end sig { override.returns({name: T.nilable(String)}) } @@ -278,54 +229,81 @@ module FinchAPI end class Entity < FinchAPI::BaseModel - sig { returns(T.nilable(Symbol)) } - def subtype - end + # The tax payer subtype of the company. + sig { returns(T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::Subtype::OrSymbol)) } + attr_accessor :subtype - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def subtype=(_) - end + # The tax payer type of the company. + sig { returns(T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::Type::OrSymbol)) } + attr_accessor :type - sig { returns(T.nilable(Symbol)) } - def type + # The entity type object. + sig do + params( + subtype: T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::Subtype::OrSymbol), + type: T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::Type::OrSymbol) + ) + .returns(T.attached_class) end - - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def type=(_) + def self.new(subtype: nil, type: nil) end - sig { params(subtype: T.nilable(Symbol), type: T.nilable(Symbol)).void } - def initialize(subtype: nil, type: nil) + sig do + override + .returns( + { + subtype: T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::Subtype::OrSymbol), + type: T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::Type::OrSymbol) + } + ) end - - sig { override.returns({subtype: T.nilable(Symbol), type: T.nilable(Symbol)}) } def to_hash end - class Subtype < FinchAPI::Enum - abstract! + # The tax payer subtype of the company. + module Subtype + extend FinchAPI::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::Subtype) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::Subtype::TaggedSymbol) } - 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)) + S_CORPORATION = + T.let(:s_corporation, FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::Subtype::TaggedSymbol) + C_CORPORATION = + T.let(:c_corporation, FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::Subtype::TaggedSymbol) + B_CORPORATION = + T.let(:b_corporation, FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::Subtype::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig { override.returns(T::Array[FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::Subtype::TaggedSymbol]) } 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]) } + # The tax payer type of the company. + module Type + extend FinchAPI::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::Type::TaggedSymbol) } + + LLC = T.let(:llc, FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::Type::TaggedSymbol) + LP = T.let(:lp, FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::Type::TaggedSymbol) + CORPORATION = + T.let(:corporation, FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::Type::TaggedSymbol) + SOLE_PROPRIETOR = + T.let(:sole_proprietor, FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::Type::TaggedSymbol) + NON_PROFIT = + T.let(:non_profit, FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::Type::TaggedSymbol) + PARTNERSHIP = + T.let(:partnership, FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::Type::TaggedSymbol) + COOPERATIVE = + T.let(:cooperative, FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::Type::TaggedSymbol) + + sig { override.returns(T::Array[FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::Type::TaggedSymbol]) } def self.values 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 index 5f86de5e..e5f7c40c 100644 --- a/rbi/lib/finch-api/models/sandbox/company_update_response.rbi +++ b/rbi/lib/finch-api/models/sandbox/company_update_response.rbi @@ -4,105 +4,63 @@ module FinchAPI module Models module Sandbox class CompanyUpdateResponse < FinchAPI::BaseModel + # An array of bank account objects associated with the payroll/HRIS system. 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 + attr_accessor :accounts + # The array of company departments. 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 + attr_accessor :departments + # The employer identification number. sig { returns(T.nilable(String)) } - def ein - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def ein=(_) - end + attr_accessor :ein + # The entity type object. sig { returns(T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity)) } - def entity - end + attr_reader :entity sig do - params(_: T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity)) - .returns(T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity)) - end - def entity=(_) + params( + entity: T.nilable(T.any(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity, FinchAPI::Util::AnyHash)) + ) + .void end + attr_writer :entity + # The legal name of the company. sig { returns(T.nilable(String)) } - def legal_name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def legal_name=(_) - end + attr_accessor :legal_name 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 + attr_accessor :locations + # The email of the main administrator on the account. sig { returns(T.nilable(String)) } - def primary_email - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def primary_email=(_) - end + attr_accessor :primary_email + # The phone number of the main administrator on the account. Format: `XXXXXXXXXX` sig { returns(T.nilable(String)) } - def primary_phone_number - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def primary_phone_number=(_) - end + attr_accessor :primary_phone_number 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)]), + accounts: T.nilable( + T::Array[T.any(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Account, FinchAPI::Util::AnyHash)] + ), + departments: T.nilable( + T::Array[T.nilable(T.any(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department, FinchAPI::Util::AnyHash))] + ), ein: T.nilable(String), - entity: T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity), + entity: T.nilable(T.any(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity, FinchAPI::Util::AnyHash)), legal_name: T.nilable(String), - locations: T.nilable(T::Array[T.nilable(FinchAPI::Models::Location)]), + locations: T.nilable(T::Array[T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Util::AnyHash))]), primary_email: T.nilable(String), primary_phone_number: T.nilable(String) ) - .void + .returns(T.attached_class) end - def initialize( - accounts:, - departments:, - ein:, - entity:, - legal_name:, - locations:, - primary_email:, - primary_phone_number: - ) + def self.new(accounts:, departments:, ein:, entity:, legal_name:, locations:, primary_email:, primary_phone_number:) end sig do @@ -124,63 +82,38 @@ module FinchAPI end class Account < FinchAPI::BaseModel + # The name of the bank associated in the payroll/HRIS system. sig { returns(T.nilable(String)) } - def account_name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def account_name=(_) - end + attr_accessor :account_name + # 10-12 digit number to specify the bank account sig { returns(T.nilable(String)) } - def account_number - end + attr_accessor :account_number - 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 + # The type of bank account. + sig { returns(T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Account::AccountType::TaggedSymbol)) } + attr_accessor :account_type + # Name of the banking institution. sig { returns(T.nilable(String)) } - def institution_name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def institution_name=(_) - end + attr_accessor :institution_name + # A nine-digit code that's based on the U.S. Bank location where your account was + # opened. sig { returns(T.nilable(String)) } - def routing_number - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def routing_number=(_) - end + attr_accessor :routing_number sig do params( account_name: T.nilable(String), account_number: T.nilable(String), - account_type: T.nilable(Symbol), + account_type: T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Account::AccountType::OrSymbol), institution_name: T.nilable(String), routing_number: T.nilable(String) ) - .void + .returns(T.attached_class) end - def initialize( - account_name: nil, - account_number: nil, - account_type: nil, - institution_name: nil, - routing_number: nil - ) + def self.new(account_name: nil, account_number: nil, account_type: nil, institution_name: nil, routing_number: nil) end sig do @@ -189,7 +122,7 @@ module FinchAPI { account_name: T.nilable(String), account_number: T.nilable(String), - account_type: T.nilable(Symbol), + account_type: T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Account::AccountType::TaggedSymbol), institution_name: T.nilable(String), routing_number: T.nilable(String) } @@ -198,46 +131,58 @@ module FinchAPI def to_hash end - class AccountType < FinchAPI::Enum - abstract! + # The type of bank account. + module AccountType + extend FinchAPI::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::Sandbox::CompanyUpdateResponse::Account::AccountType) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Sandbox::CompanyUpdateResponse::Account::AccountType::TaggedSymbol) } - CHECKING = T.let(:checking, T.nilable(Symbol)) - SAVINGS = T.let(:savings, T.nilable(Symbol)) + CHECKING = + T.let(:checking, FinchAPI::Models::Sandbox::CompanyUpdateResponse::Account::AccountType::TaggedSymbol) + SAVINGS = + T.let(:savings, FinchAPI::Models::Sandbox::CompanyUpdateResponse::Account::AccountType::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig do + override + .returns(T::Array[FinchAPI::Models::Sandbox::CompanyUpdateResponse::Account::AccountType::TaggedSymbol]) + end def self.values end end end class Department < FinchAPI::BaseModel + # The department name. sig { returns(T.nilable(String)) } - def name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def name=(_) - end + attr_accessor :name + # The parent department, if present. sig { returns(T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department::Parent)) } - def parent - end + attr_reader :parent sig do - params(_: T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department::Parent)) - .returns(T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department::Parent)) - end - def parent=(_) + params( + parent: T.nilable( + T.any(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department::Parent, FinchAPI::Util::AnyHash) + ) + ) + .void end + attr_writer :parent sig do params( name: T.nilable(String), - parent: T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department::Parent) + parent: T.nilable( + T.any(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department::Parent, FinchAPI::Util::AnyHash) + ) ) - .void + .returns(T.attached_class) end - def initialize(name: nil, parent: nil) + def self.new(name: nil, parent: nil) end sig do @@ -253,16 +198,13 @@ module FinchAPI end class Parent < FinchAPI::BaseModel + # The parent department's name. sig { returns(T.nilable(String)) } - def name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def name=(_) - end + attr_accessor :name - sig { params(name: T.nilable(String)).void } - def initialize(name: nil) + # The parent department, if present. + sig { params(name: T.nilable(String)).returns(T.attached_class) } + def self.new(name: nil) end sig { override.returns({name: T.nilable(String)}) } @@ -272,54 +214,83 @@ module FinchAPI end class Entity < FinchAPI::BaseModel - sig { returns(T.nilable(Symbol)) } - def subtype - end + # The tax payer subtype of the company. + sig { returns(T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::Subtype::TaggedSymbol)) } + attr_accessor :subtype - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def subtype=(_) - end + # The tax payer type of the company. + sig { returns(T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::Type::TaggedSymbol)) } + attr_accessor :type - sig { returns(T.nilable(Symbol)) } - def type + # The entity type object. + sig do + params( + subtype: T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::Subtype::OrSymbol), + type: T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::Type::OrSymbol) + ) + .returns(T.attached_class) end - - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def type=(_) + def self.new(subtype: nil, type: nil) end - sig { params(subtype: T.nilable(Symbol), type: T.nilable(Symbol)).void } - def initialize(subtype: nil, type: nil) + sig do + override + .returns( + { + subtype: T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::Subtype::TaggedSymbol), + type: T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::Type::TaggedSymbol) + } + ) end - - sig { override.returns({subtype: T.nilable(Symbol), type: T.nilable(Symbol)}) } def to_hash end - class Subtype < FinchAPI::Enum - abstract! + # The tax payer subtype of the company. + module Subtype + extend FinchAPI::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::Subtype) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::Subtype::TaggedSymbol) } - 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)) + S_CORPORATION = + T.let(:s_corporation, FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::Subtype::TaggedSymbol) + C_CORPORATION = + T.let(:c_corporation, FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::Subtype::TaggedSymbol) + B_CORPORATION = + T.let(:b_corporation, FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::Subtype::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig do + override.returns(T::Array[FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::Subtype::TaggedSymbol]) + end 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]) } + # The tax payer type of the company. + module Type + extend FinchAPI::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::Type::TaggedSymbol) } + + LLC = T.let(:llc, FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::Type::TaggedSymbol) + LP = T.let(:lp, FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::Type::TaggedSymbol) + CORPORATION = + T.let(:corporation, FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::Type::TaggedSymbol) + SOLE_PROPRIETOR = + T.let(:sole_proprietor, FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::Type::TaggedSymbol) + NON_PROFIT = + T.let(:non_profit, FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::Type::TaggedSymbol) + PARTNERSHIP = + T.let(:partnership, FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::Type::TaggedSymbol) + COOPERATIVE = + T.let(:cooperative, FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::Type::TaggedSymbol) + + sig { override.returns(T::Array[FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::Type::TaggedSymbol]) } def self.values 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 index 8f2ad1a0..46d30729 100644 --- a/rbi/lib/finch-api/models/sandbox/connection_create_params.rbi +++ b/rbi/lib/finch-api/models/sandbox/connection_create_params.rbi @@ -7,55 +7,47 @@ module FinchAPI extend FinchAPI::RequestParameters::Converter include FinchAPI::RequestParameters + # The provider associated with the connection sig { returns(String) } - def provider_id - end - - sig { params(_: String).returns(String) } - def provider_id=(_) - end + attr_accessor :provider_id - sig { returns(T.nilable(Symbol)) } - def authentication_type - end + sig { returns(T.nilable(FinchAPI::Models::Sandbox::ConnectionCreateParams::AuthenticationType::OrSymbol)) } + attr_reader :authentication_type - sig { params(_: Symbol).returns(Symbol) } - def authentication_type=(_) + sig do + params( + authentication_type: FinchAPI::Models::Sandbox::ConnectionCreateParams::AuthenticationType::OrSymbol + ) + .void end + attr_writer :authentication_type + # 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. sig { returns(T.nilable(Integer)) } - def employee_size - end + attr_reader :employee_size - sig { params(_: Integer).returns(Integer) } - def employee_size=(_) - end + sig { params(employee_size: Integer).void } + attr_writer :employee_size sig { returns(T.nilable(T::Array[String])) } - def products - end + attr_reader :products - sig { params(_: T::Array[String]).returns(T::Array[String]) } - def products=(_) - end + sig { params(products: T::Array[String]).void } + attr_writer :products sig do params( provider_id: String, - authentication_type: Symbol, + authentication_type: FinchAPI::Models::Sandbox::ConnectionCreateParams::AuthenticationType::OrSymbol, employee_size: Integer, products: T::Array[String], - request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) ) - .void + .returns(T.attached_class) end - def initialize( - provider_id:, - authentication_type: nil, - employee_size: nil, - products: nil, - request_options: {} - ) + def self.new(provider_id:, authentication_type: nil, employee_size: nil, products: nil, request_options: {}) end sig do @@ -63,7 +55,7 @@ module FinchAPI .returns( { provider_id: String, - authentication_type: Symbol, + authentication_type: FinchAPI::Models::Sandbox::ConnectionCreateParams::AuthenticationType::OrSymbol, employee_size: Integer, products: T::Array[String], request_options: FinchAPI::RequestOptions @@ -73,15 +65,27 @@ module FinchAPI def to_hash end - class AuthenticationType < FinchAPI::Enum - abstract! + module AuthenticationType + extend FinchAPI::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::Sandbox::ConnectionCreateParams::AuthenticationType) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Sandbox::ConnectionCreateParams::AuthenticationType::TaggedSymbol) } - CREDENTIAL = :credential - API_TOKEN = :api_token - OAUTH = :oauth - ASSISTED = :assisted + CREDENTIAL = + T.let(:credential, FinchAPI::Models::Sandbox::ConnectionCreateParams::AuthenticationType::TaggedSymbol) + API_TOKEN = + T.let(:api_token, FinchAPI::Models::Sandbox::ConnectionCreateParams::AuthenticationType::TaggedSymbol) + OAUTH = + T.let(:oauth, FinchAPI::Models::Sandbox::ConnectionCreateParams::AuthenticationType::TaggedSymbol) + ASSISTED = + T.let(:assisted, FinchAPI::Models::Sandbox::ConnectionCreateParams::AuthenticationType::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig do + override + .returns(T::Array[FinchAPI::Models::Sandbox::ConnectionCreateParams::AuthenticationType::TaggedSymbol]) + end def self.values 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 index 21a1d9ad..a05ba85a 100644 --- a/rbi/lib/finch-api/models/sandbox/connection_create_response.rbi +++ b/rbi/lib/finch-api/models/sandbox/connection_create_response.rbi @@ -5,83 +5,50 @@ module FinchAPI module Sandbox class ConnectionCreateResponse < FinchAPI::BaseModel sig { returns(String) } - def access_token - end - - sig { params(_: String).returns(String) } - def access_token=(_) - end + attr_accessor :access_token + # [DEPRECATED] Use `connection_id` to associate a connection with an access token sig { returns(String) } - def account_id - end + attr_accessor :account_id - 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(FinchAPI::Models::Sandbox::ConnectionCreateResponse::AuthenticationType::TaggedSymbol) } + attr_accessor :authentication_type + # [DEPRECATED] Use `connection_id` to associate a connection with an access token sig { returns(String) } - def company_id - end - - sig { params(_: String).returns(String) } - def company_id=(_) - end + attr_accessor :company_id + # The ID of the new connection sig { returns(String) } - def connection_id - end - - sig { params(_: String).returns(String) } - def connection_id=(_) - end + attr_accessor :connection_id sig { returns(T::Array[String]) } - def products - end - - sig { params(_: T::Array[String]).returns(T::Array[String]) } - def products=(_) - end + attr_accessor :products + # The ID of the provider associated with the `access_token`. sig { returns(String) } - def provider_id - end - - sig { params(_: String).returns(String) } - def provider_id=(_) - end + attr_accessor :provider_id sig { returns(T.nilable(String)) } - def token_type - end + attr_reader :token_type - sig { params(_: String).returns(String) } - def token_type=(_) - end + sig { params(token_type: String).void } + attr_writer :token_type sig do params( access_token: String, account_id: String, - authentication_type: Symbol, + authentication_type: FinchAPI::Models::Sandbox::ConnectionCreateResponse::AuthenticationType::OrSymbol, company_id: String, connection_id: String, products: T::Array[String], provider_id: String, token_type: String ) - .void + .returns(T.attached_class) end - def initialize( + def self.new( access_token:, account_id:, authentication_type:, @@ -99,7 +66,7 @@ module FinchAPI { access_token: String, account_id: String, - authentication_type: Symbol, + authentication_type: FinchAPI::Models::Sandbox::ConnectionCreateResponse::AuthenticationType::TaggedSymbol, company_id: String, connection_id: String, products: T::Array[String], @@ -111,15 +78,27 @@ module FinchAPI def to_hash end - class AuthenticationType < FinchAPI::Enum - abstract! + module AuthenticationType + extend FinchAPI::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::Sandbox::ConnectionCreateResponse::AuthenticationType) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Sandbox::ConnectionCreateResponse::AuthenticationType::TaggedSymbol) } - CREDENTIAL = :credential - API_TOKEN = :api_token - OAUTH = :oauth - ASSISTED = :assisted + CREDENTIAL = + T.let(:credential, FinchAPI::Models::Sandbox::ConnectionCreateResponse::AuthenticationType::TaggedSymbol) + API_TOKEN = + T.let(:api_token, FinchAPI::Models::Sandbox::ConnectionCreateResponse::AuthenticationType::TaggedSymbol) + OAUTH = + T.let(:oauth, FinchAPI::Models::Sandbox::ConnectionCreateResponse::AuthenticationType::TaggedSymbol) + ASSISTED = + T.let(:assisted, FinchAPI::Models::Sandbox::ConnectionCreateResponse::AuthenticationType::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig do + override + .returns(T::Array[FinchAPI::Models::Sandbox::ConnectionCreateResponse::AuthenticationType::TaggedSymbol]) + end def self.values 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 index 9022f32e..60c89844 100644 --- a/rbi/lib/finch-api/models/sandbox/connections/account_create_params.rbi +++ b/rbi/lib/finch-api/models/sandbox/connections/account_create_params.rbi @@ -9,54 +9,46 @@ module FinchAPI include FinchAPI::RequestParameters sig { returns(String) } - def company_id - end - - sig { params(_: String).returns(String) } - def company_id=(_) - end + attr_accessor :company_id + # The provider associated with the `access_token` sig { returns(String) } - def provider_id - end - - sig { params(_: String).returns(String) } - def provider_id=(_) - end + attr_accessor :provider_id - sig { returns(T.nilable(Symbol)) } - def authentication_type + sig do + returns( + T.nilable(FinchAPI::Models::Sandbox::Connections::AccountCreateParams::AuthenticationType::OrSymbol) + ) end + attr_reader :authentication_type - sig { params(_: Symbol).returns(Symbol) } - def authentication_type=(_) + sig do + params( + authentication_type: FinchAPI::Models::Sandbox::Connections::AccountCreateParams::AuthenticationType::OrSymbol + ) + .void end + attr_writer :authentication_type + # Optional, defaults to Organization products (`company`, `directory`, + # `employment`, `individual`) sig { returns(T.nilable(T::Array[String])) } - def products - end + attr_reader :products - sig { params(_: T::Array[String]).returns(T::Array[String]) } - def products=(_) - end + sig { params(products: T::Array[String]).void } + attr_writer :products sig do params( company_id: String, provider_id: String, - authentication_type: Symbol, + authentication_type: FinchAPI::Models::Sandbox::Connections::AccountCreateParams::AuthenticationType::OrSymbol, products: T::Array[String], - request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) ) - .void + .returns(T.attached_class) end - def initialize( - company_id:, - provider_id:, - authentication_type: nil, - products: nil, - request_options: {} - ) + def self.new(company_id:, provider_id:, authentication_type: nil, products: nil, request_options: {}) end sig do @@ -65,7 +57,7 @@ module FinchAPI { company_id: String, provider_id: String, - authentication_type: Symbol, + authentication_type: FinchAPI::Models::Sandbox::Connections::AccountCreateParams::AuthenticationType::OrSymbol, products: T::Array[String], request_options: FinchAPI::RequestOptions } @@ -74,15 +66,46 @@ module FinchAPI def to_hash end - class AuthenticationType < FinchAPI::Enum - abstract! + module AuthenticationType + extend FinchAPI::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::Sandbox::Connections::AccountCreateParams::AuthenticationType) } + OrSymbol = + T.type_alias do + T.any( + Symbol, + FinchAPI::Models::Sandbox::Connections::AccountCreateParams::AuthenticationType::TaggedSymbol + ) + end - CREDENTIAL = :credential - API_TOKEN = :api_token - OAUTH = :oauth - ASSISTED = :assisted + CREDENTIAL = + T.let( + :credential, + FinchAPI::Models::Sandbox::Connections::AccountCreateParams::AuthenticationType::TaggedSymbol + ) + API_TOKEN = + T.let( + :api_token, + FinchAPI::Models::Sandbox::Connections::AccountCreateParams::AuthenticationType::TaggedSymbol + ) + OAUTH = + T.let( + :oauth, + FinchAPI::Models::Sandbox::Connections::AccountCreateParams::AuthenticationType::TaggedSymbol + ) + ASSISTED = + T.let( + :assisted, + FinchAPI::Models::Sandbox::Connections::AccountCreateParams::AuthenticationType::TaggedSymbol + ) - sig { override.returns(T::Array[Symbol]) } + sig do + override + .returns( + T::Array[FinchAPI::Models::Sandbox::Connections::AccountCreateParams::AuthenticationType::TaggedSymbol] + ) + end def self.values 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 index dc7eb0cd..abd032b9 100644 --- a/rbi/lib/finch-api/models/sandbox/connections/account_create_response.rbi +++ b/rbi/lib/finch-api/models/sandbox/connections/account_create_response.rbi @@ -6,82 +6,43 @@ module FinchAPI module Connections class AccountCreateResponse < FinchAPI::BaseModel sig { returns(String) } - def access_token - end - - sig { params(_: String).returns(String) } - def access_token=(_) - end + attr_accessor :access_token + # [DEPRECATED] Use `connection_id` to associate a connection with an access token sig { returns(String) } - def account_id - end - - sig { params(_: String).returns(String) } - def account_id=(_) - end - - sig { returns(Symbol) } - def authentication_type - end + attr_accessor :account_id - sig { params(_: Symbol).returns(Symbol) } - def authentication_type=(_) - end + sig { returns(FinchAPI::Models::Sandbox::Connections::AccountCreateResponse::AuthenticationType::TaggedSymbol) } + attr_accessor :authentication_type + # [DEPRECATED] Use `connection_id` to associate a connection with an access token sig { returns(String) } - def company_id - end - - sig { params(_: String).returns(String) } - def company_id=(_) - end + attr_accessor :company_id + # The ID of the new connection sig { returns(String) } - def connection_id - end - - sig { params(_: String).returns(String) } - def connection_id=(_) - end + attr_accessor :connection_id sig { returns(T::Array[String]) } - def products - end - - sig { params(_: T::Array[String]).returns(T::Array[String]) } - def products=(_) - end + attr_accessor :products + # The ID of the provider associated with the `access_token` sig { returns(String) } - def provider_id - end - - sig { params(_: String).returns(String) } - def provider_id=(_) - end + attr_accessor :provider_id sig do params( access_token: String, account_id: String, - authentication_type: Symbol, + authentication_type: FinchAPI::Models::Sandbox::Connections::AccountCreateResponse::AuthenticationType::OrSymbol, company_id: String, connection_id: String, products: T::Array[String], provider_id: String ) - .void + .returns(T.attached_class) end - def initialize( - access_token:, - account_id:, - authentication_type:, - company_id:, - connection_id:, - products:, - provider_id: - ) + def self.new(access_token:, account_id:, authentication_type:, company_id:, connection_id:, products:, provider_id:) end sig do @@ -90,7 +51,7 @@ module FinchAPI { access_token: String, account_id: String, - authentication_type: Symbol, + authentication_type: FinchAPI::Models::Sandbox::Connections::AccountCreateResponse::AuthenticationType::TaggedSymbol, company_id: String, connection_id: String, products: T::Array[String], @@ -101,15 +62,46 @@ module FinchAPI def to_hash end - class AuthenticationType < FinchAPI::Enum - abstract! + module AuthenticationType + extend FinchAPI::Enum - CREDENTIAL = :credential - API_TOKEN = :api_token - OAUTH = :oauth - ASSISTED = :assisted + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::Sandbox::Connections::AccountCreateResponse::AuthenticationType) } + OrSymbol = + T.type_alias do + T.any( + Symbol, + FinchAPI::Models::Sandbox::Connections::AccountCreateResponse::AuthenticationType::TaggedSymbol + ) + end - sig { override.returns(T::Array[Symbol]) } + CREDENTIAL = + T.let( + :credential, + FinchAPI::Models::Sandbox::Connections::AccountCreateResponse::AuthenticationType::TaggedSymbol + ) + API_TOKEN = + T.let( + :api_token, + FinchAPI::Models::Sandbox::Connections::AccountCreateResponse::AuthenticationType::TaggedSymbol + ) + OAUTH = + T.let( + :oauth, + FinchAPI::Models::Sandbox::Connections::AccountCreateResponse::AuthenticationType::TaggedSymbol + ) + ASSISTED = + T.let( + :assisted, + FinchAPI::Models::Sandbox::Connections::AccountCreateResponse::AuthenticationType::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[FinchAPI::Models::Sandbox::Connections::AccountCreateResponse::AuthenticationType::TaggedSymbol] + ) + end def self.values 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 index 68e7e533..a02e3d99 100644 --- a/rbi/lib/finch-api/models/sandbox/connections/account_update_params.rbi +++ b/rbi/lib/finch-api/models/sandbox/connections/account_update_params.rbi @@ -8,25 +8,31 @@ module FinchAPI extend FinchAPI::RequestParameters::Converter include FinchAPI::RequestParameters - sig { returns(T.nilable(Symbol)) } - def connection_status - end + sig { returns(T.nilable(FinchAPI::Models::ConnectionStatusType::OrSymbol)) } + attr_reader :connection_status - sig { params(_: Symbol).returns(Symbol) } - def connection_status=(_) - end + sig { params(connection_status: FinchAPI::Models::ConnectionStatusType::OrSymbol).void } + attr_writer :connection_status sig do params( - connection_status: Symbol, - request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + connection_status: FinchAPI::Models::ConnectionStatusType::OrSymbol, + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) ) - .void + .returns(T.attached_class) end - def initialize(connection_status: nil, request_options: {}) + def self.new(connection_status: nil, request_options: {}) end - sig { override.returns({connection_status: Symbol, request_options: FinchAPI::RequestOptions}) } + sig do + override + .returns( + { + connection_status: FinchAPI::Models::ConnectionStatusType::OrSymbol, + request_options: FinchAPI::RequestOptions + } + ) + end def to_hash 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 index a78fca46..541cdff4 100644 --- a/rbi/lib/finch-api/models/sandbox/connections/account_update_response.rbi +++ b/rbi/lib/finch-api/models/sandbox/connections/account_update_response.rbi @@ -5,73 +5,43 @@ module FinchAPI module Sandbox module Connections class AccountUpdateResponse < FinchAPI::BaseModel + # [DEPRECATED] Use `connection_id` to associate a connection with an access token sig { returns(String) } - def account_id - end - - sig { params(_: String).returns(String) } - def account_id=(_) - end + attr_accessor :account_id - sig { returns(Symbol) } - def authentication_type - end - - sig { params(_: Symbol).returns(Symbol) } - def authentication_type=(_) - end + sig { returns(FinchAPI::Models::Sandbox::Connections::AccountUpdateResponse::AuthenticationType::TaggedSymbol) } + attr_accessor :authentication_type + # [DEPRECATED] Use `connection_id` to associate a connection with an access token sig { returns(String) } - def company_id - end - - sig { params(_: String).returns(String) } - def company_id=(_) - end + attr_accessor :company_id sig { returns(T::Array[String]) } - def products - end - - sig { params(_: T::Array[String]).returns(T::Array[String]) } - def products=(_) - end + attr_accessor :products + # The ID of the provider associated with the `access_token` sig { returns(String) } - def provider_id - end - - sig { params(_: String).returns(String) } - def provider_id=(_) - end + attr_accessor :provider_id + # The ID of the new connection sig { returns(T.nilable(String)) } - def connection_id - end + attr_reader :connection_id - sig { params(_: String).returns(String) } - def connection_id=(_) - end + sig { params(connection_id: String).void } + attr_writer :connection_id sig do params( account_id: String, - authentication_type: Symbol, + authentication_type: FinchAPI::Models::Sandbox::Connections::AccountUpdateResponse::AuthenticationType::OrSymbol, company_id: String, products: T::Array[String], provider_id: String, connection_id: String ) - .void + .returns(T.attached_class) end - def initialize( - account_id:, - authentication_type:, - company_id:, - products:, - provider_id:, - connection_id: nil - ) + def self.new(account_id:, authentication_type:, company_id:, products:, provider_id:, connection_id: nil) end sig do @@ -79,7 +49,7 @@ module FinchAPI .returns( { account_id: String, - authentication_type: Symbol, + authentication_type: FinchAPI::Models::Sandbox::Connections::AccountUpdateResponse::AuthenticationType::TaggedSymbol, company_id: String, products: T::Array[String], provider_id: String, @@ -90,15 +60,46 @@ module FinchAPI def to_hash end - class AuthenticationType < FinchAPI::Enum - abstract! + module AuthenticationType + extend FinchAPI::Enum - CREDENTIAL = :credential - API_TOKEN = :api_token - OAUTH = :oauth - ASSISTED = :assisted + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::Sandbox::Connections::AccountUpdateResponse::AuthenticationType) } + OrSymbol = + T.type_alias do + T.any( + Symbol, + FinchAPI::Models::Sandbox::Connections::AccountUpdateResponse::AuthenticationType::TaggedSymbol + ) + end - sig { override.returns(T::Array[Symbol]) } + CREDENTIAL = + T.let( + :credential, + FinchAPI::Models::Sandbox::Connections::AccountUpdateResponse::AuthenticationType::TaggedSymbol + ) + API_TOKEN = + T.let( + :api_token, + FinchAPI::Models::Sandbox::Connections::AccountUpdateResponse::AuthenticationType::TaggedSymbol + ) + OAUTH = + T.let( + :oauth, + FinchAPI::Models::Sandbox::Connections::AccountUpdateResponse::AuthenticationType::TaggedSymbol + ) + ASSISTED = + T.let( + :assisted, + FinchAPI::Models::Sandbox::Connections::AccountUpdateResponse::AuthenticationType::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[FinchAPI::Models::Sandbox::Connections::AccountUpdateResponse::AuthenticationType::TaggedSymbol] + ) + end def self.values 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 index 9b66a4da..f5ea7ad9 100644 --- a/rbi/lib/finch-api/models/sandbox/directory_create_params.rbi +++ b/rbi/lib/finch-api/models/sandbox/directory_create_params.rbi @@ -7,25 +7,27 @@ module FinchAPI extend FinchAPI::RequestParameters::Converter include FinchAPI::RequestParameters + # Array of individuals to create. Takes all combined fields from `/individual` and + # `/employment` endpoints. All fields are optional. sig { returns(T.nilable(T::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body])) } - def body - end + attr_reader :body sig do - params(_: T::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body]) - .returns(T::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body]) - end - def body=(_) + params( + body: T::Array[T.any(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body, FinchAPI::Util::AnyHash)] + ) + .void end + attr_writer :body sig do params( - body: T::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body], - request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + body: T::Array[T.any(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body, FinchAPI::Util::AnyHash)], + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) ) - .void + .returns(T.attached_class) end - def initialize(body: nil, request_options: {}) + def self.new(body: nil, request_options: {}) end sig do @@ -41,284 +43,212 @@ module FinchAPI end class Body < FinchAPI::BaseModel + # Worker's compensation classification code for this employee sig { returns(T.nilable(String)) } - def class_code - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def class_code=(_) - end + attr_accessor :class_code + # 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. sig { returns(T.nilable(T::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::CustomField])) } - def custom_fields - end + attr_reader :custom_fields sig do - params(_: T::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::CustomField]) - .returns(T::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::CustomField]) - end - def custom_fields=(_) + params( + custom_fields: T::Array[T.any(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::CustomField, FinchAPI::Util::AnyHash)] + ) + .void end + attr_writer :custom_fields + # The department object. sig { returns(T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Department)) } - def department - end + attr_reader :department sig do - params(_: T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Department)) - .returns(T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Department)) - end - def department=(_) + params( + department: T.nilable( + T.any(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Department, FinchAPI::Util::AnyHash) + ) + ) + .void end + attr_writer :department sig { returns(T.nilable(String)) } - def dob - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def dob=(_) - end + attr_accessor :dob 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 + attr_accessor :emails + # The employment object. sig { returns(T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment)) } - def employment - end + attr_reader :employment 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 + params( + employment: T.nilable( + T.any(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment, FinchAPI::Util::AnyHash) + ) + ) + .void end + attr_writer :employment - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def employment_status=(_) - end + # The detailed employment status of the individual. + sig { returns(T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::EmploymentStatus::OrSymbol)) } + attr_accessor :employment_status + # 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. sig { returns(T.nilable(String)) } - def encrypted_ssn - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def encrypted_ssn=(_) - end + attr_accessor :encrypted_ssn 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 + attr_accessor :end_date - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def ethnicity=(_) - end + # The EEOC-defined ethnicity of the individual. + sig { returns(T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Ethnicity::OrSymbol)) } + attr_accessor :ethnicity + # The legal first name of the individual. sig { returns(T.nilable(String)) } - def first_name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def first_name=(_) - end + attr_accessor :first_name - sig { returns(T.nilable(Symbol)) } - def gender - end - - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def gender=(_) - end + # The gender of the individual. + sig { returns(T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Gender::OrSymbol)) } + attr_accessor :gender + # 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. sig { returns(T.nilable(FinchAPI::Models::Income)) } - def income - end + attr_reader :income - sig { params(_: T.nilable(FinchAPI::Models::Income)).returns(T.nilable(FinchAPI::Models::Income)) } - def income=(_) - end + sig { params(income: T.nilable(T.any(FinchAPI::Models::Income, FinchAPI::Util::AnyHash))).void } + attr_writer :income + # The array of income history. 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 + attr_accessor :income_history + # `true` if the individual an an active employee or contractor at the company. 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 + attr_accessor :is_active + # The legal last name of the individual. sig { returns(T.nilable(String)) } - def last_name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def last_name=(_) - end + attr_accessor :last_name sig { returns(T.nilable(String)) } - def latest_rehire_date - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def latest_rehire_date=(_) - end + attr_accessor :latest_rehire_date sig { returns(T.nilable(FinchAPI::Models::Location)) } - def location - end + attr_reader :location - sig { params(_: T.nilable(FinchAPI::Models::Location)).returns(T.nilable(FinchAPI::Models::Location)) } - def location=(_) - end + sig { params(location: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Util::AnyHash))).void } + attr_writer :location + # The manager object representing the manager of the individual within the org. sig { returns(T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Manager)) } - def manager - end + attr_reader :manager sig do - params(_: T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Manager)) - .returns(T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Manager)) - end - def manager=(_) + params( + manager: T.nilable(T.any(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Manager, FinchAPI::Util::AnyHash)) + ) + .void end + attr_writer :manager + # The legal middle name of the individual. sig { returns(T.nilable(String)) } - def middle_name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def middle_name=(_) - end + attr_accessor :middle_name 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 + attr_accessor :phone_numbers + # The preferred name of the individual. sig { returns(T.nilable(String)) } - def preferred_name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def preferred_name=(_) - end + attr_accessor :preferred_name sig { returns(T.nilable(FinchAPI::Models::Location)) } - def residence - end + attr_reader :residence - sig { params(_: T.nilable(FinchAPI::Models::Location)).returns(T.nilable(FinchAPI::Models::Location)) } - def residence=(_) - end + sig { params(residence: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Util::AnyHash))).void } + attr_writer :residence + # The source system's unique employment identifier for this individual sig { returns(T.nilable(String)) } - def source_id - end + attr_reader :source_id - sig { params(_: String).returns(String) } - def source_id=(_) - end + sig { params(source_id: String).void } + attr_writer :source_id + # 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). sig { returns(T.nilable(String)) } - def ssn - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def ssn=(_) - end + attr_accessor :ssn sig { returns(T.nilable(String)) } - def start_date - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def start_date=(_) - end + attr_accessor :start_date + # The current title of the individual. sig { returns(T.nilable(String)) } - def title - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def title=(_) - end + attr_accessor :title 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), + custom_fields: T::Array[T.any(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::CustomField, FinchAPI::Util::AnyHash)], + department: T.nilable( + T.any(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Department, FinchAPI::Util::AnyHash) + ), 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), + emails: T.nilable( + T::Array[T.any(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Email, FinchAPI::Util::AnyHash)] + ), + employment: T.nilable( + T.any(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment, FinchAPI::Util::AnyHash) + ), + employment_status: T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::EmploymentStatus::OrSymbol), encrypted_ssn: T.nilable(String), end_date: T.nilable(String), - ethnicity: T.nilable(Symbol), + ethnicity: T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Ethnicity::OrSymbol), 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)]), + gender: T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Gender::OrSymbol), + income: T.nilable(T.any(FinchAPI::Models::Income, FinchAPI::Util::AnyHash)), + income_history: T.nilable(T::Array[T.nilable(T.any(FinchAPI::Models::Income, FinchAPI::Util::AnyHash))]), 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), + location: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Util::AnyHash)), + manager: T.nilable(T.any(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Manager, FinchAPI::Util::AnyHash)), middle_name: T.nilable(String), - phone_numbers: T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::PhoneNumber)]), + phone_numbers: T.nilable( + T::Array[ + T.nilable( + T.any(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::PhoneNumber, FinchAPI::Util::AnyHash) + ) + ] + ), preferred_name: T.nilable(String), - residence: T.nilable(FinchAPI::Models::Location), + residence: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Util::AnyHash)), source_id: String, ssn: T.nilable(String), start_date: T.nilable(String), title: T.nilable(String) ) - .void + .returns(T.attached_class) end - def initialize( + def self.new( class_code: nil, custom_fields: nil, department: nil, @@ -359,12 +289,12 @@ module FinchAPI 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), + employment_status: T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::EmploymentStatus::OrSymbol), encrypted_ssn: T.nilable(String), end_date: T.nilable(String), - ethnicity: T.nilable(Symbol), + ethnicity: T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Ethnicity::OrSymbol), first_name: T.nilable(String), - gender: T.nilable(Symbol), + gender: T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Gender::OrSymbol), income: T.nilable(FinchAPI::Models::Income), income_history: T.nilable(T::Array[T.nilable(FinchAPI::Models::Income)]), is_active: T.nilable(T::Boolean), @@ -388,23 +318,16 @@ module FinchAPI class CustomField < FinchAPI::BaseModel sig { returns(T.nilable(String)) } - def name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def name=(_) - end + attr_accessor :name sig { returns(T.nilable(T.anything)) } - def value - end + attr_reader :value - sig { params(_: T.anything).returns(T.anything) } - def value=(_) - end + sig { params(value: T.anything).void } + attr_writer :value - sig { params(name: T.nilable(String), value: T.anything).void } - def initialize(name: nil, value: nil) + sig { params(name: T.nilable(String), value: T.anything).returns(T.attached_class) } + def self.new(name: nil, value: nil) end sig { override.returns({name: T.nilable(String), value: T.anything}) } @@ -413,16 +336,13 @@ module FinchAPI end class Department < FinchAPI::BaseModel + # The name of the department associated with the individual. sig { returns(T.nilable(String)) } - def name - end + attr_accessor :name - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def name=(_) - end - - sig { params(name: T.nilable(String)).void } - def initialize(name: nil) + # The department object. + sig { params(name: T.nilable(String)).returns(T.attached_class) } + def self.new(name: nil) end sig { override.returns({name: T.nilable(String)}) } @@ -432,153 +352,264 @@ module FinchAPI class Email < FinchAPI::BaseModel sig { returns(T.nilable(String)) } - def data - end + attr_reader :data - sig { params(_: String).returns(String) } - def data=(_) - end + sig { params(data: String).void } + attr_writer :data - sig { returns(T.nilable(Symbol)) } - def type - end + sig { returns(T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Email::Type::OrSymbol)) } + attr_accessor :type - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def type=(_) + sig do + params( + data: String, + type: T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Email::Type::OrSymbol) + ) + .returns(T.attached_class) end - - sig { params(data: String, type: T.nilable(Symbol)).void } - def initialize(data: nil, type: nil) + def self.new(data: nil, type: nil) end - sig { override.returns({data: String, type: T.nilable(Symbol)}) } + sig do + override + .returns( + {data: String, type: T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Email::Type::OrSymbol)} + ) + end def to_hash end - class Type < FinchAPI::Enum - abstract! + module Type + extend FinchAPI::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Email::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Email::Type::TaggedSymbol) } - WORK = T.let(:work, T.nilable(Symbol)) - PERSONAL = T.let(:personal, T.nilable(Symbol)) + WORK = T.let(:work, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Email::Type::TaggedSymbol) + PERSONAL = + T.let(:personal, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Email::Type::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig do + override + .returns(T::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Email::Type::TaggedSymbol]) + end 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=(_) + # The secondary employment type of the individual. Options: `full_time`, + # `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`. + sig { returns(T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::Subtype::OrSymbol)) } + attr_accessor :subtype + + # The main employment type of the individual. + sig { returns(T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::Type::OrSymbol)) } + attr_accessor :type + + # The employment object. + sig do + params( + subtype: T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::Subtype::OrSymbol), + type: T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::Type::OrSymbol) + ) + .returns(T.attached_class) end - - sig { returns(T.nilable(Symbol)) } - def type + def self.new(subtype: nil, type: nil) end - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def type=(_) + sig do + override + .returns( + { + subtype: T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::Subtype::OrSymbol), + type: T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::Type::OrSymbol) + } + ) 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]) } + # The secondary employment type of the individual. Options: `full_time`, + # `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`. + module Subtype + extend FinchAPI::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::Subtype) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::Subtype::TaggedSymbol) } + + FULL_TIME = + T.let( + :full_time, + FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::Subtype::TaggedSymbol + ) + INTERN = + T.let(:intern, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::Subtype::TaggedSymbol) + PART_TIME = + T.let( + :part_time, + FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::Subtype::TaggedSymbol + ) + TEMP = + T.let(:temp, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::Subtype::TaggedSymbol) + SEASONAL = + T.let( + :seasonal, + FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::Subtype::TaggedSymbol + ) + INDIVIDUAL_CONTRACTOR = + T.let( + :individual_contractor, + FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::Subtype::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::Subtype::TaggedSymbol] + ) + end def self.values end end - class Type < FinchAPI::Enum - abstract! + # The main employment type of the individual. + module Type + extend FinchAPI::Enum - EMPLOYEE = T.let(:employee, T.nilable(Symbol)) - CONTRACTOR = T.let(:contractor, T.nilable(Symbol)) + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::Type::TaggedSymbol) } - sig { override.returns(T::Array[Symbol]) } + EMPLOYEE = + T.let(:employee, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::Type::TaggedSymbol) + CONTRACTOR = + T.let(:contractor, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::Type::TaggedSymbol) + + sig do + override + .returns(T::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::Type::TaggedSymbol]) + end def self.values end end end - class EmploymentStatus < FinchAPI::Enum - abstract! + # The detailed employment status of the individual. + module EmploymentStatus + extend FinchAPI::Enum - 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)) + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::EmploymentStatus) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::EmploymentStatus::TaggedSymbol) } - sig { override.returns(T::Array[Symbol]) } + ACTIVE = + T.let(:active, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::EmploymentStatus::TaggedSymbol) + DECEASED = + T.let(:deceased, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::EmploymentStatus::TaggedSymbol) + LEAVE = + T.let(:leave, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::EmploymentStatus::TaggedSymbol) + ONBOARDING = + T.let(:onboarding, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::EmploymentStatus::TaggedSymbol) + PREHIRE = + T.let(:prehire, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::EmploymentStatus::TaggedSymbol) + RETIRED = + T.let(:retired, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::EmploymentStatus::TaggedSymbol) + TERMINATED = + T.let(:terminated, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::EmploymentStatus::TaggedSymbol) + + sig do + override + .returns(T::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::EmploymentStatus::TaggedSymbol]) + end def self.values end end - class Ethnicity < FinchAPI::Enum - abstract! + # The EEOC-defined ethnicity of the individual. + module Ethnicity + extend FinchAPI::Enum - 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)) + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Ethnicity) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Ethnicity::TaggedSymbol) } + + ASIAN = T.let(:asian, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Ethnicity::TaggedSymbol) + WHITE = T.let(:white, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Ethnicity::TaggedSymbol) + BLACK_OR_AFRICAN_AMERICAN = + T.let( + :black_or_african_american, + FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Ethnicity::TaggedSymbol + ) + NATIVE_HAWAIIAN_OR_PACIFIC_ISLANDER = + T.let( + :native_hawaiian_or_pacific_islander, + FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Ethnicity::TaggedSymbol + ) + AMERICAN_INDIAN_OR_ALASKA_NATIVE = + T.let( + :american_indian_or_alaska_native, + FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Ethnicity::TaggedSymbol + ) + HISPANIC_OR_LATINO = + T.let( + :hispanic_or_latino, + FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Ethnicity::TaggedSymbol + ) + TWO_OR_MORE_RACES = + T.let(:two_or_more_races, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Ethnicity::TaggedSymbol) + DECLINE_TO_SPECIFY = + T.let( + :decline_to_specify, + FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Ethnicity::TaggedSymbol + ) - sig { override.returns(T::Array[Symbol]) } + sig do + override.returns(T::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Ethnicity::TaggedSymbol]) + end def self.values end end - class Gender < FinchAPI::Enum - abstract! + # The gender of the individual. + module Gender + extend FinchAPI::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Gender) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Gender::TaggedSymbol) } - 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)) + FEMALE = T.let(:female, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Gender::TaggedSymbol) + MALE = T.let(:male, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Gender::TaggedSymbol) + OTHER = T.let(:other, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Gender::TaggedSymbol) + DECLINE_TO_SPECIFY = + T.let(:decline_to_specify, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Gender::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig { override.returns(T::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Gender::TaggedSymbol]) } def self.values end end class Manager < FinchAPI::BaseModel + # A stable Finch `id` (UUID v4) for an individual in the company. sig { returns(T.nilable(String)) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_reader :id sig { params(id: String).void } - def initialize(id: nil) + attr_writer :id + + # The manager object representing the manager of the individual within the org. + sig { params(id: String).returns(T.attached_class) } + def self.new(id: nil) end sig { override.returns({id: String}) } @@ -588,36 +619,53 @@ module FinchAPI class PhoneNumber < FinchAPI::BaseModel sig { returns(T.nilable(String)) } - def data - end + attr_reader :data - sig { params(_: String).returns(String) } - def data=(_) - end + sig { params(data: String).void } + attr_writer :data - sig { returns(T.nilable(Symbol)) } - def type - end + sig { returns(T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::PhoneNumber::Type::OrSymbol)) } + attr_accessor :type - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def type=(_) + sig do + params( + data: String, + type: T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::PhoneNumber::Type::OrSymbol) + ) + .returns(T.attached_class) end - - sig { params(data: String, type: T.nilable(Symbol)).void } - def initialize(data: nil, type: nil) + def self.new(data: nil, type: nil) end - sig { override.returns({data: String, type: T.nilable(Symbol)}) } + sig do + override + .returns( + { + data: String, + type: T.nilable(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::PhoneNumber::Type::OrSymbol) + } + ) + end def to_hash end - class Type < FinchAPI::Enum - abstract! + module Type + extend FinchAPI::Enum - WORK = T.let(:work, T.nilable(Symbol)) - PERSONAL = T.let(:personal, T.nilable(Symbol)) + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::PhoneNumber::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::PhoneNumber::Type::TaggedSymbol) } - sig { override.returns(T::Array[Symbol]) } + WORK = + T.let(:work, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::PhoneNumber::Type::TaggedSymbol) + PERSONAL = + T.let(:personal, FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::PhoneNumber::Type::TaggedSymbol) + + sig do + override + .returns(T::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::PhoneNumber::Type::TaggedSymbol]) + end def self.values 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 index 5098437d..94d3faa9 100644 --- a/rbi/lib/finch-api/models/sandbox/directory_create_response.rbi +++ b/rbi/lib/finch-api/models/sandbox/directory_create_response.rbi @@ -3,7 +3,7 @@ module FinchAPI module Models module Sandbox - DirectoryCreateResponse = T.type_alias { T::Array[T.anything] } + DirectoryCreateResponse = T.let(FinchAPI::ArrayOf[FinchAPI::Unknown], FinchAPI::Converter) 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 index 97e7af6b..e5ea2b98 100644 --- a/rbi/lib/finch-api/models/sandbox/employment_update_params.rbi +++ b/rbi/lib/finch-api/models/sandbox/employment_update_params.rbi @@ -7,190 +7,144 @@ module FinchAPI extend FinchAPI::RequestParameters::Converter include FinchAPI::RequestParameters + # Worker's compensation classification code for this employee sig { returns(T.nilable(String)) } - def class_code - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def class_code=(_) - end + attr_accessor :class_code + # 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. sig { returns(T.nilable(T::Array[FinchAPI::Models::Sandbox::EmploymentUpdateParams::CustomField])) } - def custom_fields - end + attr_reader :custom_fields sig do - params(_: T::Array[FinchAPI::Models::Sandbox::EmploymentUpdateParams::CustomField]) - .returns(T::Array[FinchAPI::Models::Sandbox::EmploymentUpdateParams::CustomField]) - end - def custom_fields=(_) + params( + custom_fields: T::Array[T.any(FinchAPI::Models::Sandbox::EmploymentUpdateParams::CustomField, FinchAPI::Util::AnyHash)] + ) + .void end + attr_writer :custom_fields + # The department object. sig { returns(T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Department)) } - def department - end + attr_reader :department sig do - params(_: T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Department)) - .returns(T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Department)) - end - def department=(_) + params( + department: T.nilable(T.any(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Department, FinchAPI::Util::AnyHash)) + ) + .void end + attr_writer :department + # The employment object. sig { returns(T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment)) } - def employment - end + attr_reader :employment 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 + params( + employment: T.nilable(T.any(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment, FinchAPI::Util::AnyHash)) + ) + .void end + attr_writer :employment - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def employment_status=(_) - end + # The detailed employment status of the individual. + sig { returns(T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateParams::EmploymentStatus::OrSymbol)) } + attr_accessor :employment_status sig { returns(T.nilable(String)) } - def end_date - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def end_date=(_) - end + attr_accessor :end_date + # The legal first name of the individual. sig { returns(T.nilable(String)) } - def first_name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def first_name=(_) - end + attr_accessor :first_name + # 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. sig { returns(T.nilable(FinchAPI::Models::Income)) } - def income - end + attr_reader :income - sig { params(_: T.nilable(FinchAPI::Models::Income)).returns(T.nilable(FinchAPI::Models::Income)) } - def income=(_) - end + sig { params(income: T.nilable(T.any(FinchAPI::Models::Income, FinchAPI::Util::AnyHash))).void } + attr_writer :income + # The array of income history. 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 + attr_accessor :income_history + # `true` if the individual an an active employee or contractor at the company. 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 + attr_accessor :is_active + # The legal last name of the individual. sig { returns(T.nilable(String)) } - def last_name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def last_name=(_) - end + attr_accessor :last_name sig { returns(T.nilable(String)) } - def latest_rehire_date - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def latest_rehire_date=(_) - end + attr_accessor :latest_rehire_date sig { returns(T.nilable(FinchAPI::Models::Location)) } - def location - end + attr_reader :location - sig { params(_: T.nilable(FinchAPI::Models::Location)).returns(T.nilable(FinchAPI::Models::Location)) } - def location=(_) - end + sig { params(location: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Util::AnyHash))).void } + attr_writer :location + # The manager object representing the manager of the individual within the org. sig { returns(T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Manager)) } - def manager - end + attr_reader :manager sig do - params(_: T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Manager)) - .returns(T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Manager)) - end - def manager=(_) + params( + manager: T.nilable(T.any(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Manager, FinchAPI::Util::AnyHash)) + ) + .void end + attr_writer :manager + # The legal middle name of the individual. sig { returns(T.nilable(String)) } - def middle_name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def middle_name=(_) - end + attr_accessor :middle_name + # The source system's unique employment identifier for this individual sig { returns(T.nilable(String)) } - def source_id - end + attr_reader :source_id - sig { params(_: String).returns(String) } - def source_id=(_) - end + sig { params(source_id: String).void } + attr_writer :source_id sig { returns(T.nilable(String)) } - def start_date - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def start_date=(_) - end + attr_accessor :start_date + # The current title of the individual. sig { returns(T.nilable(String)) } - def title - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def title=(_) - end + attr_accessor :title 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), + custom_fields: T::Array[T.any(FinchAPI::Models::Sandbox::EmploymentUpdateParams::CustomField, FinchAPI::Util::AnyHash)], + department: T.nilable(T.any(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Department, FinchAPI::Util::AnyHash)), + employment: T.nilable(T.any(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment, FinchAPI::Util::AnyHash)), + employment_status: T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateParams::EmploymentStatus::OrSymbol), 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)]), + income: T.nilable(T.any(FinchAPI::Models::Income, FinchAPI::Util::AnyHash)), + income_history: T.nilable(T::Array[T.nilable(T.any(FinchAPI::Models::Income, FinchAPI::Util::AnyHash))]), 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), + location: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Util::AnyHash)), + manager: T.nilable(T.any(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Manager, FinchAPI::Util::AnyHash)), 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]) + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) ) - .void + .returns(T.attached_class) end - def initialize( + def self.new( class_code: nil, custom_fields: nil, department: nil, @@ -221,7 +175,7 @@ module FinchAPI 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), + employment_status: T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateParams::EmploymentStatus::OrSymbol), end_date: T.nilable(String), first_name: T.nilable(String), income: T.nilable(FinchAPI::Models::Income), @@ -244,23 +198,16 @@ module FinchAPI class CustomField < FinchAPI::BaseModel sig { returns(T.nilable(String)) } - def name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def name=(_) - end + attr_accessor :name sig { returns(T.nilable(T.anything)) } - def value - end + attr_reader :value - sig { params(_: T.anything).returns(T.anything) } - def value=(_) - end + sig { params(value: T.anything).void } + attr_writer :value - sig { params(name: T.nilable(String), value: T.anything).void } - def initialize(name: nil, value: nil) + sig { params(name: T.nilable(String), value: T.anything).returns(T.attached_class) } + def self.new(name: nil, value: nil) end sig { override.returns({name: T.nilable(String), value: T.anything}) } @@ -269,16 +216,13 @@ module FinchAPI end class Department < FinchAPI::BaseModel + # The name of the department associated with the individual. sig { returns(T.nilable(String)) } - def name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def name=(_) - end + attr_accessor :name - sig { params(name: T.nilable(String)).void } - def initialize(name: nil) + # The department object. + sig { params(name: T.nilable(String)).returns(T.attached_class) } + def self.new(name: nil) end sig { override.returns({name: T.nilable(String)}) } @@ -287,84 +231,136 @@ module FinchAPI 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 + # The secondary employment type of the individual. Options: `full_time`, + # `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`. + sig { returns(T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::Subtype::OrSymbol)) } + attr_accessor :subtype + + # The main employment type of the individual. + sig { returns(T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::Type::OrSymbol)) } + attr_accessor :type + + # The employment object. + sig do + params( + subtype: T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::Subtype::OrSymbol), + type: T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::Type::OrSymbol) + ) + .returns(T.attached_class) end - - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def type=(_) + def self.new(subtype: nil, type: nil) end - sig { params(subtype: T.nilable(Symbol), type: T.nilable(Symbol)).void } - def initialize(subtype: nil, type: nil) + sig do + override + .returns( + { + subtype: T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::Subtype::OrSymbol), + type: T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::Type::OrSymbol) + } + ) 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]) } + # The secondary employment type of the individual. Options: `full_time`, + # `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`. + module Subtype + extend FinchAPI::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::Subtype) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::Subtype::TaggedSymbol) } + + FULL_TIME = + T.let(:full_time, FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::Subtype::TaggedSymbol) + INTERN = + T.let(:intern, FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::Subtype::TaggedSymbol) + PART_TIME = + T.let(:part_time, FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::Subtype::TaggedSymbol) + TEMP = T.let(:temp, FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::Subtype::TaggedSymbol) + SEASONAL = + T.let(:seasonal, FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::Subtype::TaggedSymbol) + INDIVIDUAL_CONTRACTOR = + T.let( + :individual_contractor, + FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::Subtype::TaggedSymbol + ) + + sig do + override + .returns(T::Array[FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::Subtype::TaggedSymbol]) + end def self.values end end - class Type < FinchAPI::Enum - abstract! + # The main employment type of the individual. + module Type + extend FinchAPI::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::Type::TaggedSymbol) } - EMPLOYEE = T.let(:employee, T.nilable(Symbol)) - CONTRACTOR = T.let(:contractor, T.nilable(Symbol)) + EMPLOYEE = + T.let(:employee, FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::Type::TaggedSymbol) + CONTRACTOR = + T.let(:contractor, FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::Type::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig do + override + .returns(T::Array[FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::Type::TaggedSymbol]) + end 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]) } + # The detailed employment status of the individual. + module EmploymentStatus + extend FinchAPI::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::Sandbox::EmploymentUpdateParams::EmploymentStatus) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Sandbox::EmploymentUpdateParams::EmploymentStatus::TaggedSymbol) } + + ACTIVE = + T.let(:active, FinchAPI::Models::Sandbox::EmploymentUpdateParams::EmploymentStatus::TaggedSymbol) + DECEASED = + T.let(:deceased, FinchAPI::Models::Sandbox::EmploymentUpdateParams::EmploymentStatus::TaggedSymbol) + LEAVE = T.let(:leave, FinchAPI::Models::Sandbox::EmploymentUpdateParams::EmploymentStatus::TaggedSymbol) + ONBOARDING = + T.let(:onboarding, FinchAPI::Models::Sandbox::EmploymentUpdateParams::EmploymentStatus::TaggedSymbol) + PREHIRE = + T.let(:prehire, FinchAPI::Models::Sandbox::EmploymentUpdateParams::EmploymentStatus::TaggedSymbol) + RETIRED = + T.let(:retired, FinchAPI::Models::Sandbox::EmploymentUpdateParams::EmploymentStatus::TaggedSymbol) + TERMINATED = + T.let(:terminated, FinchAPI::Models::Sandbox::EmploymentUpdateParams::EmploymentStatus::TaggedSymbol) + + sig do + override + .returns(T::Array[FinchAPI::Models::Sandbox::EmploymentUpdateParams::EmploymentStatus::TaggedSymbol]) + end def self.values end end class Manager < FinchAPI::BaseModel + # A stable Finch `id` (UUID v4) for an individual in the company. sig { returns(T.nilable(String)) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_reader :id sig { params(id: String).void } - def initialize(id: nil) + attr_writer :id + + # The manager object representing the manager of the individual within the org. + sig { params(id: String).returns(T.attached_class) } + def self.new(id: nil) end sig { override.returns({id: String}) } diff --git a/rbi/lib/finch-api/models/sandbox/employment_update_response.rbi b/rbi/lib/finch-api/models/sandbox/employment_update_response.rbi index 8b3d459d..9e2859e2 100644 --- a/rbi/lib/finch-api/models/sandbox/employment_update_response.rbi +++ b/rbi/lib/finch-api/models/sandbox/employment_update_response.rbi @@ -4,198 +4,151 @@ module FinchAPI module Models module Sandbox class EmploymentUpdateResponse < FinchAPI::BaseModel + # A stable Finch `id` (UUID v4) for an individual in the company. sig { returns(T.nilable(String)) } - def id - end + attr_reader :id - sig { params(_: String).returns(String) } - def id=(_) - end + sig { params(id: String).void } + attr_writer :id + # Worker's compensation classification code for this employee sig { returns(T.nilable(String)) } - def class_code - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def class_code=(_) - end + attr_accessor :class_code + # 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. sig { returns(T.nilable(T::Array[FinchAPI::Models::Sandbox::EmploymentUpdateResponse::CustomField])) } - def custom_fields - end + attr_reader :custom_fields sig do - params(_: T::Array[FinchAPI::Models::Sandbox::EmploymentUpdateResponse::CustomField]) - .returns(T::Array[FinchAPI::Models::Sandbox::EmploymentUpdateResponse::CustomField]) - end - def custom_fields=(_) + params( + custom_fields: T::Array[T.any(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::CustomField, FinchAPI::Util::AnyHash)] + ) + .void end + attr_writer :custom_fields + # The department object. sig { returns(T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Department)) } - def department - end + attr_reader :department sig do - params(_: T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Department)) - .returns(T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Department)) - end - def department=(_) + params( + department: T.nilable(T.any(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Department, FinchAPI::Util::AnyHash)) + ) + .void end + attr_writer :department + # The employment object. sig { returns(T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment)) } - def employment - end + attr_reader :employment 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 + params( + employment: T.nilable(T.any(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment, FinchAPI::Util::AnyHash)) + ) + .void end + attr_writer :employment - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def employment_status=(_) - end + # The detailed employment status of the individual. + sig { returns(T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::EmploymentStatus::TaggedSymbol)) } + attr_accessor :employment_status sig { returns(T.nilable(String)) } - def end_date - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def end_date=(_) - end + attr_accessor :end_date + # The legal first name of the individual. sig { returns(T.nilable(String)) } - def first_name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def first_name=(_) - end + attr_accessor :first_name + # 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. sig { returns(T.nilable(FinchAPI::Models::Income)) } - def income - end + attr_reader :income - sig { params(_: T.nilable(FinchAPI::Models::Income)).returns(T.nilable(FinchAPI::Models::Income)) } - def income=(_) - end + sig { params(income: T.nilable(T.any(FinchAPI::Models::Income, FinchAPI::Util::AnyHash))).void } + attr_writer :income + # The array of income history. 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 + attr_accessor :income_history + # `true` if the individual an an active employee or contractor at the company. 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 + attr_accessor :is_active + # The legal last name of the individual. sig { returns(T.nilable(String)) } - def last_name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def last_name=(_) - end + attr_accessor :last_name sig { returns(T.nilable(String)) } - def latest_rehire_date - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def latest_rehire_date=(_) - end + attr_accessor :latest_rehire_date sig { returns(T.nilable(FinchAPI::Models::Location)) } - def location - end + attr_reader :location - sig { params(_: T.nilable(FinchAPI::Models::Location)).returns(T.nilable(FinchAPI::Models::Location)) } - def location=(_) - end + sig { params(location: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Util::AnyHash))).void } + attr_writer :location + # The manager object representing the manager of the individual within the org. sig { returns(T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Manager)) } - def manager - end + attr_reader :manager sig do - params(_: T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Manager)) - .returns(T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Manager)) - end - def manager=(_) + params( + manager: T.nilable(T.any(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Manager, FinchAPI::Util::AnyHash)) + ) + .void end + attr_writer :manager + # The legal middle name of the individual. sig { returns(T.nilable(String)) } - def middle_name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def middle_name=(_) - end + attr_accessor :middle_name + # The source system's unique employment identifier for this individual sig { returns(T.nilable(String)) } - def source_id - end + attr_reader :source_id - sig { params(_: String).returns(String) } - def source_id=(_) - end + sig { params(source_id: String).void } + attr_writer :source_id sig { returns(T.nilable(String)) } - def start_date - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def start_date=(_) - end + attr_accessor :start_date + # The current title of the individual. sig { returns(T.nilable(String)) } - def title - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def title=(_) - end + attr_accessor :title 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), + custom_fields: T::Array[T.any(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::CustomField, FinchAPI::Util::AnyHash)], + department: T.nilable(T.any(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Department, FinchAPI::Util::AnyHash)), + employment: T.nilable(T.any(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment, FinchAPI::Util::AnyHash)), + employment_status: T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::EmploymentStatus::OrSymbol), 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)]), + income: T.nilable(T.any(FinchAPI::Models::Income, FinchAPI::Util::AnyHash)), + income_history: T.nilable(T::Array[T.nilable(T.any(FinchAPI::Models::Income, FinchAPI::Util::AnyHash))]), 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), + location: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Util::AnyHash)), + manager: T.nilable(T.any(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Manager, FinchAPI::Util::AnyHash)), middle_name: T.nilable(String), source_id: String, start_date: T.nilable(String), title: T.nilable(String) ) - .void + .returns(T.attached_class) end - def initialize( + def self.new( id: nil, class_code: nil, custom_fields: nil, @@ -227,7 +180,7 @@ module FinchAPI 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), + employment_status: T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::EmploymentStatus::TaggedSymbol), end_date: T.nilable(String), first_name: T.nilable(String), income: T.nilable(FinchAPI::Models::Income), @@ -249,23 +202,16 @@ module FinchAPI class CustomField < FinchAPI::BaseModel sig { returns(T.nilable(String)) } - def name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def name=(_) - end + attr_accessor :name sig { returns(T.nilable(T.anything)) } - def value - end + attr_reader :value - sig { params(_: T.anything).returns(T.anything) } - def value=(_) - end + sig { params(value: T.anything).void } + attr_writer :value - sig { params(name: T.nilable(String), value: T.anything).void } - def initialize(name: nil, value: nil) + sig { params(name: T.nilable(String), value: T.anything).returns(T.attached_class) } + def self.new(name: nil, value: nil) end sig { override.returns({name: T.nilable(String), value: T.anything}) } @@ -274,16 +220,13 @@ module FinchAPI end class Department < FinchAPI::BaseModel + # The name of the department associated with the individual. sig { returns(T.nilable(String)) } - def name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def name=(_) - end + attr_accessor :name - sig { params(name: T.nilable(String)).void } - def initialize(name: nil) + # The department object. + sig { params(name: T.nilable(String)).returns(T.attached_class) } + def self.new(name: nil) end sig { override.returns({name: T.nilable(String)}) } @@ -292,84 +235,138 @@ module FinchAPI 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 + # The secondary employment type of the individual. Options: `full_time`, + # `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`. + sig { returns(T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::Subtype::TaggedSymbol)) } + attr_accessor :subtype + + # The main employment type of the individual. + sig { returns(T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::Type::TaggedSymbol)) } + attr_accessor :type + + # The employment object. + sig do + params( + subtype: T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::Subtype::OrSymbol), + type: T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::Type::OrSymbol) + ) + .returns(T.attached_class) end - - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def type=(_) + def self.new(subtype: nil, type: nil) end - sig { params(subtype: T.nilable(Symbol), type: T.nilable(Symbol)).void } - def initialize(subtype: nil, type: nil) + sig do + override + .returns( + { + subtype: T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::Subtype::TaggedSymbol), + type: T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::Type::TaggedSymbol) + } + ) 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]) } + # The secondary employment type of the individual. Options: `full_time`, + # `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`. + module Subtype + extend FinchAPI::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::Subtype) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::Subtype::TaggedSymbol) } + + FULL_TIME = + T.let(:full_time, FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::Subtype::TaggedSymbol) + INTERN = + T.let(:intern, FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::Subtype::TaggedSymbol) + PART_TIME = + T.let(:part_time, FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::Subtype::TaggedSymbol) + TEMP = + T.let(:temp, FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::Subtype::TaggedSymbol) + SEASONAL = + T.let(:seasonal, FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::Subtype::TaggedSymbol) + INDIVIDUAL_CONTRACTOR = + T.let( + :individual_contractor, + FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::Subtype::TaggedSymbol + ) + + sig do + override + .returns(T::Array[FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::Subtype::TaggedSymbol]) + end def self.values end end - class Type < FinchAPI::Enum - abstract! + # The main employment type of the individual. + module Type + extend FinchAPI::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::Type::TaggedSymbol) } - EMPLOYEE = T.let(:employee, T.nilable(Symbol)) - CONTRACTOR = T.let(:contractor, T.nilable(Symbol)) + EMPLOYEE = + T.let(:employee, FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::Type::TaggedSymbol) + CONTRACTOR = + T.let(:contractor, FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::Type::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig do + override + .returns(T::Array[FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::Type::TaggedSymbol]) + end 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]) } + # The detailed employment status of the individual. + module EmploymentStatus + extend FinchAPI::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::Sandbox::EmploymentUpdateResponse::EmploymentStatus) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Sandbox::EmploymentUpdateResponse::EmploymentStatus::TaggedSymbol) } + + ACTIVE = + T.let(:active, FinchAPI::Models::Sandbox::EmploymentUpdateResponse::EmploymentStatus::TaggedSymbol) + DECEASED = + T.let(:deceased, FinchAPI::Models::Sandbox::EmploymentUpdateResponse::EmploymentStatus::TaggedSymbol) + LEAVE = + T.let(:leave, FinchAPI::Models::Sandbox::EmploymentUpdateResponse::EmploymentStatus::TaggedSymbol) + ONBOARDING = + T.let(:onboarding, FinchAPI::Models::Sandbox::EmploymentUpdateResponse::EmploymentStatus::TaggedSymbol) + PREHIRE = + T.let(:prehire, FinchAPI::Models::Sandbox::EmploymentUpdateResponse::EmploymentStatus::TaggedSymbol) + RETIRED = + T.let(:retired, FinchAPI::Models::Sandbox::EmploymentUpdateResponse::EmploymentStatus::TaggedSymbol) + TERMINATED = + T.let(:terminated, FinchAPI::Models::Sandbox::EmploymentUpdateResponse::EmploymentStatus::TaggedSymbol) + + sig do + override + .returns(T::Array[FinchAPI::Models::Sandbox::EmploymentUpdateResponse::EmploymentStatus::TaggedSymbol]) + end def self.values end end class Manager < FinchAPI::BaseModel + # A stable Finch `id` (UUID v4) for an individual in the company. sig { returns(T.nilable(String)) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_reader :id sig { params(id: String).void } - def initialize(id: nil) + attr_writer :id + + # The manager object representing the manager of the individual within the org. + sig { params(id: String).returns(T.attached_class) } + def self.new(id: nil) end sig { override.returns({id: String}) } diff --git a/rbi/lib/finch-api/models/sandbox/individual_update_params.rbi b/rbi/lib/finch-api/models/sandbox/individual_update_params.rbi index f6d5c048..ce15721f 100644 --- a/rbi/lib/finch-api/models/sandbox/individual_update_params.rbi +++ b/rbi/lib/finch-api/models/sandbox/individual_update_params.rbi @@ -8,126 +8,80 @@ module FinchAPI include FinchAPI::RequestParameters sig { returns(T.nilable(String)) } - def dob - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def dob=(_) - end + attr_accessor :dob 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 + attr_accessor :emails + # 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. sig { returns(T.nilable(String)) } - def encrypted_ssn - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def encrypted_ssn=(_) - end + attr_accessor :encrypted_ssn - sig { returns(T.nilable(Symbol)) } - def ethnicity - end - - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def ethnicity=(_) - end + # The EEOC-defined ethnicity of the individual. + sig { returns(T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateParams::Ethnicity::OrSymbol)) } + attr_accessor :ethnicity + # The legal first name of the individual. sig { returns(T.nilable(String)) } - def first_name - end + attr_accessor :first_name - 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 + # The gender of the individual. + sig { returns(T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateParams::Gender::OrSymbol)) } + attr_accessor :gender + # The legal last name of the individual. sig { returns(T.nilable(String)) } - def last_name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def last_name=(_) - end + attr_accessor :last_name + # The legal middle name of the individual. sig { returns(T.nilable(String)) } - def middle_name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def middle_name=(_) - end + attr_accessor :middle_name 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 + attr_accessor :phone_numbers + # The preferred name of the individual. sig { returns(T.nilable(String)) } - def preferred_name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def preferred_name=(_) - end + attr_accessor :preferred_name sig { returns(T.nilable(FinchAPI::Models::Location)) } - def residence - end + attr_reader :residence - sig { params(_: T.nilable(FinchAPI::Models::Location)).returns(T.nilable(FinchAPI::Models::Location)) } - def residence=(_) - end + sig { params(residence: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Util::AnyHash))).void } + attr_writer :residence + # 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). sig { returns(T.nilable(String)) } - def ssn - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def ssn=(_) - end + attr_accessor :ssn sig do params( dob: T.nilable(String), - emails: T.nilable(T::Array[FinchAPI::Models::Sandbox::IndividualUpdateParams::Email]), + emails: T.nilable( + T::Array[T.any(FinchAPI::Models::Sandbox::IndividualUpdateParams::Email, FinchAPI::Util::AnyHash)] + ), encrypted_ssn: T.nilable(String), - ethnicity: T.nilable(Symbol), + ethnicity: T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateParams::Ethnicity::OrSymbol), first_name: T.nilable(String), - gender: T.nilable(Symbol), + gender: T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateParams::Gender::OrSymbol), last_name: T.nilable(String), middle_name: T.nilable(String), - phone_numbers: T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber)]), + phone_numbers: T.nilable( + T::Array[T.nilable(T.any(FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber, FinchAPI::Util::AnyHash))] + ), preferred_name: T.nilable(String), - residence: T.nilable(FinchAPI::Models::Location), + residence: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Util::AnyHash)), ssn: T.nilable(String), - request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) ) - .void + .returns(T.attached_class) end - def initialize( + def self.new( dob: nil, emails: nil, encrypted_ssn: nil, @@ -151,9 +105,9 @@ module FinchAPI dob: T.nilable(String), emails: T.nilable(T::Array[FinchAPI::Models::Sandbox::IndividualUpdateParams::Email]), encrypted_ssn: T.nilable(String), - ethnicity: T.nilable(Symbol), + ethnicity: T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateParams::Ethnicity::OrSymbol), first_name: T.nilable(String), - gender: T.nilable(Symbol), + gender: T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateParams::Gender::OrSymbol), last_name: T.nilable(String), middle_name: T.nilable(String), phone_numbers: T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber)]), @@ -169,103 +123,155 @@ module FinchAPI class Email < FinchAPI::BaseModel sig { returns(T.nilable(String)) } - def data - end + attr_reader :data - sig { params(_: String).returns(String) } - def data=(_) - end + sig { params(data: String).void } + attr_writer :data - sig { returns(T.nilable(Symbol)) } - def type - end + sig { returns(T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateParams::Email::Type::OrSymbol)) } + attr_accessor :type - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def type=(_) + sig do + params( + data: String, + type: T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateParams::Email::Type::OrSymbol) + ) + .returns(T.attached_class) end - - sig { params(data: String, type: T.nilable(Symbol)).void } - def initialize(data: nil, type: nil) + def self.new(data: nil, type: nil) end - sig { override.returns({data: String, type: T.nilable(Symbol)}) } + sig do + override + .returns( + {data: String, type: T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateParams::Email::Type::OrSymbol)} + ) + end def to_hash end - class Type < FinchAPI::Enum - abstract! + module Type + extend FinchAPI::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::Sandbox::IndividualUpdateParams::Email::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Sandbox::IndividualUpdateParams::Email::Type::TaggedSymbol) } - WORK = T.let(:work, T.nilable(Symbol)) - PERSONAL = T.let(:personal, T.nilable(Symbol)) + WORK = T.let(:work, FinchAPI::Models::Sandbox::IndividualUpdateParams::Email::Type::TaggedSymbol) + PERSONAL = T.let(:personal, FinchAPI::Models::Sandbox::IndividualUpdateParams::Email::Type::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig { override.returns(T::Array[FinchAPI::Models::Sandbox::IndividualUpdateParams::Email::Type::TaggedSymbol]) } def self.values end end end - class Ethnicity < FinchAPI::Enum - abstract! + # The EEOC-defined ethnicity of the individual. + module Ethnicity + extend FinchAPI::Enum - 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)) + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::Sandbox::IndividualUpdateParams::Ethnicity) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Sandbox::IndividualUpdateParams::Ethnicity::TaggedSymbol) } - sig { override.returns(T::Array[Symbol]) } + ASIAN = T.let(:asian, FinchAPI::Models::Sandbox::IndividualUpdateParams::Ethnicity::TaggedSymbol) + WHITE = T.let(:white, FinchAPI::Models::Sandbox::IndividualUpdateParams::Ethnicity::TaggedSymbol) + BLACK_OR_AFRICAN_AMERICAN = + T.let( + :black_or_african_american, + FinchAPI::Models::Sandbox::IndividualUpdateParams::Ethnicity::TaggedSymbol + ) + NATIVE_HAWAIIAN_OR_PACIFIC_ISLANDER = + T.let( + :native_hawaiian_or_pacific_islander, + FinchAPI::Models::Sandbox::IndividualUpdateParams::Ethnicity::TaggedSymbol + ) + AMERICAN_INDIAN_OR_ALASKA_NATIVE = + T.let( + :american_indian_or_alaska_native, + FinchAPI::Models::Sandbox::IndividualUpdateParams::Ethnicity::TaggedSymbol + ) + HISPANIC_OR_LATINO = + T.let(:hispanic_or_latino, FinchAPI::Models::Sandbox::IndividualUpdateParams::Ethnicity::TaggedSymbol) + TWO_OR_MORE_RACES = + T.let(:two_or_more_races, FinchAPI::Models::Sandbox::IndividualUpdateParams::Ethnicity::TaggedSymbol) + DECLINE_TO_SPECIFY = + T.let(:decline_to_specify, FinchAPI::Models::Sandbox::IndividualUpdateParams::Ethnicity::TaggedSymbol) + + sig { override.returns(T::Array[FinchAPI::Models::Sandbox::IndividualUpdateParams::Ethnicity::TaggedSymbol]) } def self.values end end - class Gender < FinchAPI::Enum - abstract! + # The gender of the individual. + module Gender + extend FinchAPI::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::Sandbox::IndividualUpdateParams::Gender) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Sandbox::IndividualUpdateParams::Gender::TaggedSymbol) } - 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)) + FEMALE = T.let(:female, FinchAPI::Models::Sandbox::IndividualUpdateParams::Gender::TaggedSymbol) + MALE = T.let(:male, FinchAPI::Models::Sandbox::IndividualUpdateParams::Gender::TaggedSymbol) + OTHER = T.let(:other, FinchAPI::Models::Sandbox::IndividualUpdateParams::Gender::TaggedSymbol) + DECLINE_TO_SPECIFY = + T.let(:decline_to_specify, FinchAPI::Models::Sandbox::IndividualUpdateParams::Gender::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig { override.returns(T::Array[FinchAPI::Models::Sandbox::IndividualUpdateParams::Gender::TaggedSymbol]) } def self.values end end class PhoneNumber < FinchAPI::BaseModel sig { returns(T.nilable(String)) } - def data - end + attr_reader :data - sig { params(_: String).returns(String) } - def data=(_) - end + sig { params(data: String).void } + attr_writer :data - sig { returns(T.nilable(Symbol)) } - def type - end + sig { returns(T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber::Type::OrSymbol)) } + attr_accessor :type - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def type=(_) + sig do + params( + data: String, + type: T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber::Type::OrSymbol) + ) + .returns(T.attached_class) end - - sig { params(data: String, type: T.nilable(Symbol)).void } - def initialize(data: nil, type: nil) + def self.new(data: nil, type: nil) end - sig { override.returns({data: String, type: T.nilable(Symbol)}) } + sig do + override + .returns( + { + data: String, + type: T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber::Type::OrSymbol) + } + ) + end def to_hash end - class Type < FinchAPI::Enum - abstract! + module Type + extend FinchAPI::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber::Type::TaggedSymbol) } - WORK = T.let(:work, T.nilable(Symbol)) - PERSONAL = T.let(:personal, T.nilable(Symbol)) + WORK = T.let(:work, FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber::Type::TaggedSymbol) + PERSONAL = + T.let(:personal, FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber::Type::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig do + override + .returns(T::Array[FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber::Type::TaggedSymbol]) + end def self.values 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 index ff29b8b1..b369f2f0 100644 --- a/rbi/lib/finch-api/models/sandbox/individual_update_response.rbi +++ b/rbi/lib/finch-api/models/sandbox/individual_update_response.rbi @@ -4,137 +4,92 @@ module FinchAPI module Models module Sandbox class IndividualUpdateResponse < FinchAPI::BaseModel + # A stable Finch `id` (UUID v4) for an individual in the company. sig { returns(T.nilable(String)) } - def id - end + attr_reader :id - sig { params(_: String).returns(String) } - def id=(_) - end + sig { params(id: String).void } + attr_writer :id sig { returns(T.nilable(String)) } - def dob - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def dob=(_) - end + attr_accessor :dob 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 + attr_accessor :emails + # 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. 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 + attr_accessor :encrypted_ssn - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def ethnicity=(_) - end + # The EEOC-defined ethnicity of the individual. + sig { returns(T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateResponse::Ethnicity::TaggedSymbol)) } + attr_accessor :ethnicity + # The legal first name of the individual. 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 + attr_accessor :first_name - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def gender=(_) - end + # The gender of the individual. + sig { returns(T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateResponse::Gender::TaggedSymbol)) } + attr_accessor :gender + # The legal last name of the individual. sig { returns(T.nilable(String)) } - def last_name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def last_name=(_) - end + attr_accessor :last_name + # The legal middle name of the individual. sig { returns(T.nilable(String)) } - def middle_name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def middle_name=(_) - end + attr_accessor :middle_name 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 + attr_accessor :phone_numbers + # The preferred name of the individual. sig { returns(T.nilable(String)) } - def preferred_name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def preferred_name=(_) - end + attr_accessor :preferred_name sig { returns(T.nilable(FinchAPI::Models::Location)) } - def residence - end + attr_reader :residence - sig { params(_: T.nilable(FinchAPI::Models::Location)).returns(T.nilable(FinchAPI::Models::Location)) } - def residence=(_) - end + sig { params(residence: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Util::AnyHash))).void } + attr_writer :residence + # 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). sig { returns(T.nilable(String)) } - def ssn - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def ssn=(_) - end + attr_accessor :ssn sig do params( id: String, dob: T.nilable(String), - emails: T.nilable(T::Array[FinchAPI::Models::Sandbox::IndividualUpdateResponse::Email]), + emails: T.nilable( + T::Array[T.any(FinchAPI::Models::Sandbox::IndividualUpdateResponse::Email, FinchAPI::Util::AnyHash)] + ), encrypted_ssn: T.nilable(String), - ethnicity: T.nilable(Symbol), + ethnicity: T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateResponse::Ethnicity::OrSymbol), first_name: T.nilable(String), - gender: T.nilable(Symbol), + gender: T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateResponse::Gender::OrSymbol), last_name: T.nilable(String), middle_name: T.nilable(String), - phone_numbers: T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateResponse::PhoneNumber)]), + phone_numbers: T.nilable( + T::Array[ + T.nilable( + T.any(FinchAPI::Models::Sandbox::IndividualUpdateResponse::PhoneNumber, FinchAPI::Util::AnyHash) + ) + ] + ), preferred_name: T.nilable(String), - residence: T.nilable(FinchAPI::Models::Location), + residence: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Util::AnyHash)), ssn: T.nilable(String) ) - .void + .returns(T.attached_class) end - def initialize( + def self.new( id: nil, dob: nil, emails: nil, @@ -159,9 +114,9 @@ module FinchAPI dob: T.nilable(String), emails: T.nilable(T::Array[FinchAPI::Models::Sandbox::IndividualUpdateResponse::Email]), encrypted_ssn: T.nilable(String), - ethnicity: T.nilable(Symbol), + ethnicity: T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateResponse::Ethnicity::TaggedSymbol), first_name: T.nilable(String), - gender: T.nilable(Symbol), + gender: T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateResponse::Gender::TaggedSymbol), last_name: T.nilable(String), middle_name: T.nilable(String), phone_numbers: T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateResponse::PhoneNumber)]), @@ -176,103 +131,160 @@ module FinchAPI class Email < FinchAPI::BaseModel sig { returns(T.nilable(String)) } - def data - end + attr_reader :data - sig { params(_: String).returns(String) } - def data=(_) - end + sig { params(data: String).void } + attr_writer :data - sig { returns(T.nilable(Symbol)) } - def type - end + sig { returns(T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateResponse::Email::Type::TaggedSymbol)) } + attr_accessor :type - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def type=(_) + sig do + params( + data: String, + type: T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateResponse::Email::Type::OrSymbol) + ) + .returns(T.attached_class) end - - sig { params(data: String, type: T.nilable(Symbol)).void } - def initialize(data: nil, type: nil) + def self.new(data: nil, type: nil) end - sig { override.returns({data: String, type: T.nilable(Symbol)}) } + sig do + override + .returns( + { + data: String, + type: T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateResponse::Email::Type::TaggedSymbol) + } + ) + end def to_hash end - class Type < FinchAPI::Enum - abstract! + module Type + extend FinchAPI::Enum - WORK = T.let(:work, T.nilable(Symbol)) - PERSONAL = T.let(:personal, T.nilable(Symbol)) + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::Sandbox::IndividualUpdateResponse::Email::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Sandbox::IndividualUpdateResponse::Email::Type::TaggedSymbol) } - sig { override.returns(T::Array[Symbol]) } + WORK = T.let(:work, FinchAPI::Models::Sandbox::IndividualUpdateResponse::Email::Type::TaggedSymbol) + PERSONAL = + T.let(:personal, FinchAPI::Models::Sandbox::IndividualUpdateResponse::Email::Type::TaggedSymbol) + + sig { override.returns(T::Array[FinchAPI::Models::Sandbox::IndividualUpdateResponse::Email::Type::TaggedSymbol]) } def self.values end end end - class Ethnicity < FinchAPI::Enum - abstract! + # The EEOC-defined ethnicity of the individual. + module Ethnicity + extend FinchAPI::Enum - 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)) + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::Sandbox::IndividualUpdateResponse::Ethnicity) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Sandbox::IndividualUpdateResponse::Ethnicity::TaggedSymbol) } - sig { override.returns(T::Array[Symbol]) } + ASIAN = T.let(:asian, FinchAPI::Models::Sandbox::IndividualUpdateResponse::Ethnicity::TaggedSymbol) + WHITE = T.let(:white, FinchAPI::Models::Sandbox::IndividualUpdateResponse::Ethnicity::TaggedSymbol) + BLACK_OR_AFRICAN_AMERICAN = + T.let( + :black_or_african_american, + FinchAPI::Models::Sandbox::IndividualUpdateResponse::Ethnicity::TaggedSymbol + ) + NATIVE_HAWAIIAN_OR_PACIFIC_ISLANDER = + T.let( + :native_hawaiian_or_pacific_islander, + FinchAPI::Models::Sandbox::IndividualUpdateResponse::Ethnicity::TaggedSymbol + ) + AMERICAN_INDIAN_OR_ALASKA_NATIVE = + T.let( + :american_indian_or_alaska_native, + FinchAPI::Models::Sandbox::IndividualUpdateResponse::Ethnicity::TaggedSymbol + ) + HISPANIC_OR_LATINO = + T.let(:hispanic_or_latino, FinchAPI::Models::Sandbox::IndividualUpdateResponse::Ethnicity::TaggedSymbol) + TWO_OR_MORE_RACES = + T.let(:two_or_more_races, FinchAPI::Models::Sandbox::IndividualUpdateResponse::Ethnicity::TaggedSymbol) + DECLINE_TO_SPECIFY = + T.let(:decline_to_specify, FinchAPI::Models::Sandbox::IndividualUpdateResponse::Ethnicity::TaggedSymbol) + + sig { override.returns(T::Array[FinchAPI::Models::Sandbox::IndividualUpdateResponse::Ethnicity::TaggedSymbol]) } def self.values end end - class Gender < FinchAPI::Enum - abstract! + # The gender of the individual. + module Gender + extend FinchAPI::Enum - 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)) + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::Sandbox::IndividualUpdateResponse::Gender) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Sandbox::IndividualUpdateResponse::Gender::TaggedSymbol) } - sig { override.returns(T::Array[Symbol]) } + FEMALE = T.let(:female, FinchAPI::Models::Sandbox::IndividualUpdateResponse::Gender::TaggedSymbol) + MALE = T.let(:male, FinchAPI::Models::Sandbox::IndividualUpdateResponse::Gender::TaggedSymbol) + OTHER = T.let(:other, FinchAPI::Models::Sandbox::IndividualUpdateResponse::Gender::TaggedSymbol) + DECLINE_TO_SPECIFY = + T.let(:decline_to_specify, FinchAPI::Models::Sandbox::IndividualUpdateResponse::Gender::TaggedSymbol) + + sig { override.returns(T::Array[FinchAPI::Models::Sandbox::IndividualUpdateResponse::Gender::TaggedSymbol]) } def self.values end end class PhoneNumber < FinchAPI::BaseModel sig { returns(T.nilable(String)) } - def data - end + attr_reader :data - sig { params(_: String).returns(String) } - def data=(_) - end + sig { params(data: String).void } + attr_writer :data - sig { returns(T.nilable(Symbol)) } - def type - end + sig { returns(T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateResponse::PhoneNumber::Type::TaggedSymbol)) } + attr_accessor :type - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def type=(_) + sig do + params( + data: String, + type: T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateResponse::PhoneNumber::Type::OrSymbol) + ) + .returns(T.attached_class) end - - sig { params(data: String, type: T.nilable(Symbol)).void } - def initialize(data: nil, type: nil) + def self.new(data: nil, type: nil) end - sig { override.returns({data: String, type: T.nilable(Symbol)}) } + sig do + override + .returns( + { + data: String, + type: T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateResponse::PhoneNumber::Type::TaggedSymbol) + } + ) + end def to_hash end - class Type < FinchAPI::Enum - abstract! + module Type + extend FinchAPI::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::Sandbox::IndividualUpdateResponse::PhoneNumber::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Sandbox::IndividualUpdateResponse::PhoneNumber::Type::TaggedSymbol) } - WORK = T.let(:work, T.nilable(Symbol)) - PERSONAL = T.let(:personal, T.nilable(Symbol)) + WORK = T.let(:work, FinchAPI::Models::Sandbox::IndividualUpdateResponse::PhoneNumber::Type::TaggedSymbol) + PERSONAL = + T.let(:personal, FinchAPI::Models::Sandbox::IndividualUpdateResponse::PhoneNumber::Type::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig do + override + .returns(T::Array[FinchAPI::Models::Sandbox::IndividualUpdateResponse::PhoneNumber::Type::TaggedSymbol]) + end def self.values 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 index 732117ba..8db17e55 100644 --- a/rbi/lib/finch-api/models/sandbox/job_create_params.rbi +++ b/rbi/lib/finch-api/models/sandbox/job_create_params.rbi @@ -7,36 +7,39 @@ module FinchAPI extend FinchAPI::RequestParameters::Converter include FinchAPI::RequestParameters - sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + # The type of job to start. Currently the only supported type is `data_sync_all` + sig { returns(FinchAPI::Models::Sandbox::JobCreateParams::Type::OrSymbol) } + attr_accessor :type sig do params( - type: Symbol, - request_options: T.any( - FinchAPI::RequestOptions, - T::Hash[Symbol, T.anything] - ) - ).void + type: FinchAPI::Models::Sandbox::JobCreateParams::Type::OrSymbol, + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) + ) + .returns(T.attached_class) end - def initialize(type:, request_options: {}) + def self.new(type:, request_options: {}) end - sig { override.returns({type: Symbol, request_options: FinchAPI::RequestOptions}) } + sig do + override + .returns( + {type: FinchAPI::Models::Sandbox::JobCreateParams::Type::OrSymbol, request_options: FinchAPI::RequestOptions} + ) + end def to_hash end - class Type < FinchAPI::Enum - abstract! + # The type of job to start. Currently the only supported type is `data_sync_all` + module Type + extend FinchAPI::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, FinchAPI::Models::Sandbox::JobCreateParams::Type) } + OrSymbol = T.type_alias { T.any(Symbol, FinchAPI::Models::Sandbox::JobCreateParams::Type::TaggedSymbol) } - DATA_SYNC_ALL = :data_sync_all + DATA_SYNC_ALL = T.let(:data_sync_all, FinchAPI::Models::Sandbox::JobCreateParams::Type::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig { override.returns(T::Array[FinchAPI::Models::Sandbox::JobCreateParams::Type::TaggedSymbol]) } def self.values 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 index cdbcda55..a49b5e91 100644 --- a/rbi/lib/finch-api/models/sandbox/job_create_response.rbi +++ b/rbi/lib/finch-api/models/sandbox/job_create_response.rbi @@ -4,47 +4,27 @@ module FinchAPI module Models module Sandbox class JobCreateResponse < FinchAPI::BaseModel + # The number of allowed refreshes per hour (per hour, fixed window) sig { returns(Integer) } - def allowed_refreshes - end - - sig { params(_: Integer).returns(Integer) } - def allowed_refreshes=(_) - end + attr_accessor :allowed_refreshes + # The id of the job that has been created. sig { returns(String) } - def job_id - end - - sig { params(_: String).returns(String) } - def job_id=(_) - end + attr_accessor :job_id + # The url that can be used to retrieve the job status sig { returns(String) } - def job_url - end - - sig { params(_: String).returns(String) } - def job_url=(_) - end + attr_accessor :job_url + # The number of remaining refreshes available (per hour, fixed window) sig { returns(Integer) } - def remaining_refreshes - end - - sig { params(_: Integer).returns(Integer) } - def remaining_refreshes=(_) - end + attr_accessor :remaining_refreshes sig do - params( - allowed_refreshes: Integer, - job_id: String, - job_url: String, - remaining_refreshes: Integer - ).void + params(allowed_refreshes: Integer, job_id: String, job_url: String, remaining_refreshes: Integer) + .returns(T.attached_class) end - def initialize(allowed_refreshes:, job_id:, job_url:, remaining_refreshes:) + def self.new(allowed_refreshes:, job_id:, job_url:, remaining_refreshes:) end sig do 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 index 3c2ebe25..4f636988 100644 --- a/rbi/lib/finch-api/models/sandbox/jobs/configuration_retrieve_params.rbi +++ b/rbi/lib/finch-api/models/sandbox/jobs/configuration_retrieve_params.rbi @@ -8,8 +8,15 @@ module FinchAPI 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: {}) + sig do + params( + request_options: T.any( + FinchAPI::RequestOptions, + FinchAPI::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) end sig { override.returns({request_options: FinchAPI::RequestOptions}) } 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 index 98458307..6c4fca76 100644 --- a/rbi/lib/finch-api/models/sandbox/jobs/configuration_retrieve_response.rbi +++ b/rbi/lib/finch-api/models/sandbox/jobs/configuration_retrieve_response.rbi @@ -4,7 +4,8 @@ module FinchAPI module Models module Sandbox module Jobs - ConfigurationRetrieveResponse = T.type_alias { T::Array[FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration] } + ConfigurationRetrieveResponse = + T.let(FinchAPI::ArrayOf[FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration], FinchAPI::Converter) 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 index e4437abf..01b47b93 100644 --- a/rbi/lib/finch-api/models/sandbox/jobs/configuration_update_params.rbi +++ b/rbi/lib/finch-api/models/sandbox/jobs/configuration_update_params.rbi @@ -8,8 +8,15 @@ module FinchAPI 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: {}) + sig do + params( + request_options: T.any( + FinchAPI::RequestOptions, + FinchAPI::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) end sig { override.returns({request_options: FinchAPI::RequestOptions}) } 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 index 24b3eae4..1a526172 100644 --- a/rbi/lib/finch-api/models/sandbox/jobs/sandbox_job_configuration.rbi +++ b/rbi/lib/finch-api/models/sandbox/jobs/sandbox_job_configuration.rbi @@ -5,49 +5,79 @@ module FinchAPI module Sandbox module Jobs class SandboxJobConfiguration < FinchAPI::BaseModel - sig { returns(Symbol) } - def completion_status - end + sig { returns(FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::CompletionStatus::TaggedSymbol) } + attr_accessor :completion_status - sig { params(_: Symbol).returns(Symbol) } - def completion_status=(_) - end + sig { returns(FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::Type::TaggedSymbol) } + attr_accessor :type - sig { returns(Symbol) } - def type + sig do + params( + completion_status: FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::CompletionStatus::OrSymbol, + type: FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::Type::OrSymbol + ) + .returns(T.attached_class) end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) + def self.new(completion_status:, type:) end - sig { params(completion_status: Symbol, type: Symbol).void } - def initialize(completion_status:, type:) + sig do + override + .returns( + { + completion_status: FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::CompletionStatus::TaggedSymbol, + type: FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::Type::TaggedSymbol + } + ) end - - sig { override.returns({completion_status: Symbol, type: Symbol}) } def to_hash end - class CompletionStatus < FinchAPI::Enum - abstract! + module CompletionStatus + extend FinchAPI::Enum - COMPLETE = :complete - REAUTH_ERROR = :reauth_error - PERMISSIONS_ERROR = :permissions_error - ERROR = :error + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::CompletionStatus) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::CompletionStatus::TaggedSymbol) } - sig { override.returns(T::Array[Symbol]) } + COMPLETE = + T.let(:complete, FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::CompletionStatus::TaggedSymbol) + REAUTH_ERROR = + T.let( + :reauth_error, + FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::CompletionStatus::TaggedSymbol + ) + PERMISSIONS_ERROR = + T.let( + :permissions_error, + FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::CompletionStatus::TaggedSymbol + ) + ERROR = + T.let(:error, FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::CompletionStatus::TaggedSymbol) + + sig do + override + .returns( + T::Array[FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::CompletionStatus::TaggedSymbol] + ) + end def self.values end end - class Type < FinchAPI::Enum - abstract! + module Type + extend FinchAPI::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::Type::TaggedSymbol) } - DATA_SYNC_ALL = :data_sync_all + DATA_SYNC_ALL = + T.let(:data_sync_all, FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::Type::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig { override.returns(T::Array[FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::Type::TaggedSymbol]) } def self.values 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 index 57fdc6e4..4bce37f4 100644 --- a/rbi/lib/finch-api/models/sandbox/payment_create_params.rbi +++ b/rbi/lib/finch-api/models/sandbox/payment_create_params.rbi @@ -8,42 +8,38 @@ module FinchAPI include FinchAPI::RequestParameters sig { returns(T.nilable(String)) } - def end_date - end + attr_reader :end_date - sig { params(_: String).returns(String) } - def end_date=(_) - end + sig { params(end_date: String).void } + attr_writer :end_date sig { returns(T.nilable(T::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement])) } - def pay_statements - end + attr_reader :pay_statements sig do - params(_: T::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement]) - .returns(T::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement]) - end - def pay_statements=(_) + params( + pay_statements: T::Array[T.any(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement, FinchAPI::Util::AnyHash)] + ) + .void end + attr_writer :pay_statements sig { returns(T.nilable(String)) } - def start_date - end + attr_reader :start_date - sig { params(_: String).returns(String) } - def start_date=(_) - end + sig { params(start_date: String).void } + attr_writer :start_date sig do params( end_date: String, - pay_statements: T::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement], + pay_statements: T::Array[T.any(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement, FinchAPI::Util::AnyHash)], start_date: String, - request_options: T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]) + request_options: T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash) ) - .void + .returns(T.attached_class) end - def initialize(end_date: nil, pay_statements: nil, start_date: nil, request_options: {}) + def self.new(end_date: nil, pay_statements: nil, start_date: nil, request_options: {}) end sig do @@ -61,25 +57,15 @@ module FinchAPI end class PayStatement < FinchAPI::BaseModel + # The array of earnings objects associated with this pay statement 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 + attr_accessor :earnings + # The array of deductions objects associated with this pay statement. sig do returns( T.nilable( @@ -87,23 +73,7 @@ module FinchAPI ) ) 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 + attr_accessor :employee_deductions sig do returns( @@ -112,105 +82,89 @@ module FinchAPI ) ) 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 + attr_accessor :employer_contributions sig { returns(T.nilable(FinchAPI::Models::Money)) } - def gross_pay - end + attr_reader :gross_pay - sig { params(_: T.nilable(FinchAPI::Models::Money)).returns(T.nilable(FinchAPI::Models::Money)) } - def gross_pay=(_) - end + sig { params(gross_pay: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Util::AnyHash))).void } + attr_writer :gross_pay + # A stable Finch `id` (UUID v4) for an individual in the company sig { returns(T.nilable(String)) } - def individual_id - end + attr_reader :individual_id - sig { params(_: String).returns(String) } - def individual_id=(_) - end + sig { params(individual_id: String).void } + attr_writer :individual_id 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 + attr_reader :net_pay - sig { returns(T.nilable(Symbol)) } - def payment_method - end + sig { params(net_pay: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Util::AnyHash))).void } + attr_writer :net_pay - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def payment_method=(_) - end + # The payment method. + sig { returns(T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::PaymentMethod::OrSymbol)) } + attr_accessor :payment_method + # The array of taxes objects associated with this pay statement. 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 + attr_accessor :taxes + # The number of hours worked for this pay period sig { returns(T.nilable(Float)) } - def total_hours - end + attr_accessor :total_hours - 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 + # The type of the payment associated with the pay statement. + sig { returns(T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Type::OrSymbol)) } + attr_accessor :type sig do params( - earnings: T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning)]), + earnings: T.nilable( + T::Array[ + T.nilable( + T.any(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning, FinchAPI::Util::AnyHash) + ) + ] + ), employee_deductions: T.nilable( - T::Array[T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction)] + T::Array[ + T.nilable( + T.any( + FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction, + FinchAPI::Util::AnyHash + ) + ) + ] ), employer_contributions: T.nilable( - T::Array[T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution)] + T::Array[ + T.nilable( + T.any( + FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution, + FinchAPI::Util::AnyHash + ) + ) + ] ), - gross_pay: T.nilable(FinchAPI::Models::Money), + gross_pay: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Util::AnyHash)), 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)]), + net_pay: T.nilable(T.any(FinchAPI::Models::Money, FinchAPI::Util::AnyHash)), + payment_method: T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::PaymentMethod::OrSymbol), + taxes: T.nilable( + T::Array[ + T.nilable( + T.any(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax, FinchAPI::Util::AnyHash) + ) + ] + ), total_hours: T.nilable(Float), - type: T.nilable(Symbol) + type: T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Type::OrSymbol) ) - .void + .returns(T.attached_class) end - def initialize( + def self.new( earnings: nil, employee_deductions: nil, employer_contributions: nil, @@ -238,10 +192,10 @@ module FinchAPI gross_pay: T.nilable(FinchAPI::Models::Money), individual_id: String, net_pay: T.nilable(FinchAPI::Models::Money), - payment_method: T.nilable(Symbol), + payment_method: T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::PaymentMethod::OrSymbol), taxes: T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax)]), total_hours: T.nilable(Float), - type: T.nilable(Symbol) + type: T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Type::OrSymbol) } ) end @@ -249,69 +203,60 @@ module FinchAPI end class Earning < FinchAPI::BaseModel + # The earnings amount in cents. sig { returns(T.nilable(Integer)) } - def amount - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def amount=(_) - end + attr_accessor :amount sig { returns(T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes)) } - def attributes - end + attr_reader :attributes 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=(_) + params( + attributes: T.nilable( + T.any( + FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes, + FinchAPI::Util::AnyHash + ) + ) + ) + .void end + attr_writer :attributes + # The earnings currency code. sig { returns(T.nilable(String)) } - def currency - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def currency=(_) - end + attr_accessor :currency + # 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). sig { returns(T.nilable(Float)) } - def hours - end - - sig { params(_: T.nilable(Float)).returns(T.nilable(Float)) } - def hours=(_) - end + attr_accessor :hours + # The exact name of the deduction from the pay statement. sig { returns(T.nilable(String)) } - def name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def name=(_) - end + attr_accessor :name - sig { returns(T.nilable(Symbol)) } - def type - end - - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def type=(_) - end + # The type of earning. + sig { returns(T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Type::OrSymbol)) } + attr_accessor :type sig do params( amount: T.nilable(Integer), - attributes: T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes), + attributes: T.nilable( + T.any( + FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes, + FinchAPI::Util::AnyHash + ) + ), currency: T.nilable(String), hours: T.nilable(Float), name: T.nilable(String), - type: T.nilable(Symbol) + type: T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Type::OrSymbol) ) - .void + .returns(T.attached_class) end - def initialize(amount: nil, attributes: nil, currency: nil, hours: nil, name: nil, type: nil) + def self.new(amount: nil, attributes: nil, currency: nil, hours: nil, name: nil, type: nil) end sig do @@ -323,7 +268,7 @@ module FinchAPI currency: T.nilable(String), hours: T.nilable(Float), name: T.nilable(String), - type: T.nilable(Symbol) + type: T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Type::OrSymbol) } ) end @@ -336,23 +281,29 @@ module FinchAPI T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes::Metadata) ) end - def metadata - end + attr_reader :metadata sig do - params(_: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes::Metadata) - .returns(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes::Metadata) - end - def metadata=(_) + params( + metadata: T.any( + FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes::Metadata, + FinchAPI::Util::AnyHash + ) + ) + .void end + attr_writer :metadata sig do params( - metadata: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes::Metadata + metadata: T.any( + FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes::Metadata, + FinchAPI::Util::AnyHash + ) ) - .void + .returns(T.attached_class) end - def initialize(metadata: nil) + def self.new(metadata: nil) end sig do @@ -365,16 +316,17 @@ module FinchAPI end class Metadata < FinchAPI::BaseModel + # 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.). 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 + attr_reader :metadata sig { params(metadata: T::Hash[Symbol, T.anything]).void } - def initialize(metadata: nil) + attr_writer :metadata + + sig { params(metadata: T::Hash[Symbol, T.anything]).returns(T.attached_class) } + def self.new(metadata: nil) end sig { override.returns({metadata: T::Hash[Symbol, T.anything]}) } @@ -383,101 +335,126 @@ module FinchAPI end end - class Type < FinchAPI::Enum - abstract! + # The type of earning. + module Type + extend FinchAPI::Enum - 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)) + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Type::TaggedSymbol) } - sig { override.returns(T::Array[Symbol]) } + SALARY = + T.let(:salary, FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Type::TaggedSymbol) + WAGE = + T.let(:wage, FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Type::TaggedSymbol) + REIMBURSEMENT = + T.let( + :reimbursement, + FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Type::TaggedSymbol + ) + OVERTIME = + T.let( + :overtime, + FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Type::TaggedSymbol + ) + SEVERANCE = + T.let( + :severance, + FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Type::TaggedSymbol + ) + DOUBLE_OVERTIME = + T.let( + :double_overtime, + FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Type::TaggedSymbol + ) + PTO = + T.let(:pto, FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Type::TaggedSymbol) + SICK = + T.let(:sick, FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Type::TaggedSymbol) + BONUS = + T.let(:bonus, FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Type::TaggedSymbol) + COMMISSION = + T.let( + :commission, + FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Type::TaggedSymbol + ) + TIPS = + T.let(:tips, FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Type::TaggedSymbol) + NUMBER_1099 = + T.let(:"1099", FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Type::TaggedSymbol) + OTHER = + T.let(:other, FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Type::TaggedSymbol) + + sig do + override + .returns( + T::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Type::TaggedSymbol] + ) + end def self.values end end end class EmployeeDeduction < FinchAPI::BaseModel + # The deduction amount in cents. sig { returns(T.nilable(Integer)) } - def amount - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def amount=(_) - end + attr_accessor :amount sig do returns( T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes) ) end - def attributes - end + attr_reader :attributes sig do params( - _: T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes) - ) - .returns( - T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes) + attributes: T.nilable( + T.any( + FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes, + FinchAPI::Util::AnyHash + ) ) + ) + .void end - def attributes=(_) - end + attr_writer :attributes + # The deduction currency. sig { returns(T.nilable(String)) } - def currency - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def currency=(_) - end + attr_accessor :currency + # The deduction name from the pay statement. sig { returns(T.nilable(String)) } - def name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def name=(_) - end + attr_accessor :name + # Boolean indicating if the deduction is pre-tax. 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 + attr_accessor :pre_tax - sig { returns(T.nilable(Symbol)) } - def type - end - - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def type=(_) - end + # Type of benefit. + sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitType::OrSymbol)) } + attr_accessor :type sig do params( amount: T.nilable(Integer), - attributes: T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes), + attributes: T.nilable( + T.any( + FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes, + FinchAPI::Util::AnyHash + ) + ), currency: T.nilable(String), name: T.nilable(String), pre_tax: T.nilable(T::Boolean), - type: T.nilable(Symbol) + type: T.nilable(FinchAPI::Models::HRIS::BenefitType::OrSymbol) ) - .void + .returns(T.attached_class) end - def initialize(amount: nil, attributes: nil, currency: nil, name: nil, pre_tax: nil, type: nil) + def self.new(amount: nil, attributes: nil, currency: nil, name: nil, pre_tax: nil, type: nil) end sig do @@ -489,7 +466,7 @@ module FinchAPI currency: T.nilable(String), name: T.nilable(String), pre_tax: T.nilable(T::Boolean), - type: T.nilable(Symbol) + type: T.nilable(FinchAPI::Models::HRIS::BenefitType::OrSymbol) } ) end @@ -504,27 +481,29 @@ module FinchAPI ) ) end - def metadata - end + attr_reader :metadata sig do params( - _: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes::Metadata - ) - .returns( - FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes::Metadata + metadata: T.any( + FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes::Metadata, + FinchAPI::Util::AnyHash ) + ) + .void end - def metadata=(_) - end + attr_writer :metadata sig do params( - metadata: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes::Metadata + metadata: T.any( + FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes::Metadata, + FinchAPI::Util::AnyHash + ) ) - .void + .returns(T.attached_class) end - def initialize(metadata: nil) + def self.new(metadata: nil) end sig do @@ -539,16 +518,17 @@ module FinchAPI end class Metadata < FinchAPI::BaseModel + # 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.). 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 + attr_reader :metadata sig { params(metadata: T::Hash[Symbol, T.anything]).void } - def initialize(metadata: nil) + attr_writer :metadata + + sig { params(metadata: T::Hash[Symbol, T.anything]).returns(T.attached_class) } + def self.new(metadata: nil) end sig { override.returns({metadata: T::Hash[Symbol, T.anything]}) } @@ -559,68 +539,58 @@ module FinchAPI end class EmployerContribution < FinchAPI::BaseModel + # The contribution amount in cents. sig { returns(T.nilable(Integer)) } - def amount - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def amount=(_) - end + attr_accessor :amount sig do returns( T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes) ) end - def attributes - end + attr_reader :attributes sig do params( - _: T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes) - ) - .returns( - T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes) + attributes: T.nilable( + T.any( + FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes, + FinchAPI::Util::AnyHash + ) ) + ) + .void end - def attributes=(_) - end + attr_writer :attributes + # The contribution currency. sig { returns(T.nilable(String)) } - def currency - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def currency=(_) - end + attr_accessor :currency + # The contribution name from the pay statement. sig { returns(T.nilable(String)) } - def name - end + attr_accessor :name - 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 + # Type of benefit. + sig { returns(T.nilable(FinchAPI::Models::HRIS::BenefitType::OrSymbol)) } + attr_accessor :type sig do params( amount: T.nilable(Integer), - attributes: T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes), + attributes: T.nilable( + T.any( + FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes, + FinchAPI::Util::AnyHash + ) + ), currency: T.nilable(String), name: T.nilable(String), - type: T.nilable(Symbol) + type: T.nilable(FinchAPI::Models::HRIS::BenefitType::OrSymbol) ) - .void + .returns(T.attached_class) end - def initialize(amount: nil, attributes: nil, currency: nil, name: nil, type: nil) + def self.new(amount: nil, attributes: nil, currency: nil, name: nil, type: nil) end sig do @@ -631,7 +601,7 @@ module FinchAPI attributes: T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes), currency: T.nilable(String), name: T.nilable(String), - type: T.nilable(Symbol) + type: T.nilable(FinchAPI::Models::HRIS::BenefitType::OrSymbol) } ) end @@ -646,27 +616,29 @@ module FinchAPI ) ) end - def metadata - end + attr_reader :metadata sig do params( - _: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes::Metadata - ) - .returns( - FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes::Metadata + metadata: T.any( + FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes::Metadata, + FinchAPI::Util::AnyHash ) + ) + .void end - def metadata=(_) - end + attr_writer :metadata sig do params( - metadata: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes::Metadata + metadata: T.any( + FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes::Metadata, + FinchAPI::Util::AnyHash + ) ) - .void + .returns(T.attached_class) end - def initialize(metadata: nil) + def self.new(metadata: nil) end sig do @@ -681,16 +653,17 @@ module FinchAPI end class Metadata < FinchAPI::BaseModel + # 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.). 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 + attr_reader :metadata sig { params(metadata: T::Hash[Symbol, T.anything]).void } - def initialize(metadata: nil) + attr_writer :metadata + + sig { params(metadata: T::Hash[Symbol, T.anything]).returns(T.attached_class) } + def self.new(metadata: nil) end sig { override.returns({metadata: T::Hash[Symbol, T.anything]}) } @@ -700,81 +673,87 @@ module FinchAPI end end - class PaymentMethod < FinchAPI::Enum - abstract! + # The payment method. + module PaymentMethod + extend FinchAPI::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::PaymentMethod) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::PaymentMethod::TaggedSymbol) } - CHECK = T.let(:check, T.nilable(Symbol)) - DIRECT_DEPOSIT = T.let(:direct_deposit, T.nilable(Symbol)) + CHECK = + T.let(:check, FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::PaymentMethod::TaggedSymbol) + DIRECT_DEPOSIT = + T.let( + :direct_deposit, + FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::PaymentMethod::TaggedSymbol + ) - sig { override.returns(T::Array[Symbol]) } + sig do + override + .returns( + T::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::PaymentMethod::TaggedSymbol] + ) + end def self.values end end class Tax < FinchAPI::BaseModel + # The tax amount in cents. sig { returns(T.nilable(Integer)) } - def amount - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def amount=(_) - end + attr_accessor :amount sig { returns(T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes)) } - def attributes - end + attr_reader :attributes 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=(_) + params( + attributes: T.nilable( + T.any( + FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes, + FinchAPI::Util::AnyHash + ) + ) + ) + .void end + attr_writer :attributes + # The currency code. sig { returns(T.nilable(String)) } - def currency - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def currency=(_) - end + attr_accessor :currency + # `true` if the amount is paid by the employers. sig { returns(T.nilable(T::Boolean)) } - def employer - end - - sig { params(_: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } - def employer=(_) - end + attr_accessor :employer + # The exact name of tax from the pay statement. 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 + attr_accessor :name - sig { params(_: T.nilable(Symbol)).returns(T.nilable(Symbol)) } - def type=(_) - end + # The type of taxes. + sig { returns(T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Type::OrSymbol)) } + attr_accessor :type sig do params( amount: T.nilable(Integer), - attributes: T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes), + attributes: T.nilable( + T.any( + FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes, + FinchAPI::Util::AnyHash + ) + ), currency: T.nilable(String), employer: T.nilable(T::Boolean), name: T.nilable(String), - type: T.nilable(Symbol) + type: T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Type::OrSymbol) ) - .void + .returns(T.attached_class) end - def initialize(amount: nil, attributes: nil, currency: nil, employer: nil, name: nil, type: nil) + def self.new(amount: nil, attributes: nil, currency: nil, employer: nil, name: nil, type: nil) end sig do @@ -786,7 +765,7 @@ module FinchAPI currency: T.nilable(String), employer: T.nilable(T::Boolean), name: T.nilable(String), - type: T.nilable(Symbol) + type: T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Type::OrSymbol) } ) end @@ -799,21 +778,29 @@ module FinchAPI T.nilable(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes::Metadata) ) end - def metadata - end + attr_reader :metadata sig do - params(_: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes::Metadata) - .returns(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes::Metadata) - end - def metadata=(_) + params( + metadata: T.any( + FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes::Metadata, + FinchAPI::Util::AnyHash + ) + ) + .void end + attr_writer :metadata sig do - params(metadata: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes::Metadata) - .void + params( + metadata: T.any( + FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes::Metadata, + FinchAPI::Util::AnyHash + ) + ) + .returns(T.attached_class) end - def initialize(metadata: nil) + def self.new(metadata: nil) end sig do @@ -826,16 +813,17 @@ module FinchAPI end class Metadata < FinchAPI::BaseModel + # 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.). 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 + attr_reader :metadata sig { params(metadata: T::Hash[Symbol, T.anything]).void } - def initialize(metadata: nil) + attr_writer :metadata + + sig { params(metadata: T::Hash[Symbol, T.anything]).returns(T.attached_class) } + def self.new(metadata: nil) end sig { override.returns({metadata: T::Hash[Symbol, T.anything]}) } @@ -844,28 +832,56 @@ module FinchAPI end end - class Type < FinchAPI::Enum - abstract! + # The type of taxes. + module Type + extend FinchAPI::Enum - 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)) + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Type::TaggedSymbol) } - sig { override.returns(T::Array[Symbol]) } + STATE = + T.let(:state, FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Type::TaggedSymbol) + FEDERAL = + T.let(:federal, FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Type::TaggedSymbol) + LOCAL = + T.let(:local, FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Type::TaggedSymbol) + FICA = + T.let(:fica, FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Type::TaggedSymbol) + + sig do + override + .returns(T::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Type::TaggedSymbol]) + end def self.values end end end - class Type < FinchAPI::Enum - abstract! + # The type of the payment associated with the pay statement. + module Type + extend FinchAPI::Enum - 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)) + TaggedSymbol = + T.type_alias { T.all(Symbol, FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Type::TaggedSymbol) } + + REGULAR_PAYROLL = + T.let(:regular_payroll, FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Type::TaggedSymbol) + OFF_CYCLE_PAYROLL = + T.let( + :off_cycle_payroll, + FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Type::TaggedSymbol + ) + ONE_TIME_PAYMENT = + T.let(:one_time_payment, FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Type::TaggedSymbol) - sig { override.returns(T::Array[Symbol]) } + sig do + override + .returns(T::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Type::TaggedSymbol]) + end def self.values 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 index a0321cec..efc39ac5 100644 --- a/rbi/lib/finch-api/models/sandbox/payment_create_response.rbi +++ b/rbi/lib/finch-api/models/sandbox/payment_create_response.rbi @@ -4,24 +4,16 @@ module FinchAPI module Models module Sandbox class PaymentCreateResponse < FinchAPI::BaseModel + # The date of the payment. sig { returns(String) } - def pay_date - end - - sig { params(_: String).returns(String) } - def pay_date=(_) - end + attr_accessor :pay_date + # The ID of the payment. sig { returns(String) } - def payment_id - end - - sig { params(_: String).returns(String) } - def payment_id=(_) - end + attr_accessor :payment_id - sig { params(pay_date: String, payment_id: String).void } - def initialize(pay_date:, payment_id:) + sig { params(pay_date: String, payment_id: String).returns(T.attached_class) } + def self.new(pay_date:, payment_id:) end sig { override.returns({pay_date: String, payment_id: String}) } diff --git a/rbi/lib/finch-api/models/webhook_event.rbi b/rbi/lib/finch-api/models/webhook_event.rbi index 432e6317..4a20469c 100644 --- a/rbi/lib/finch-api/models/webhook_event.rbi +++ b/rbi/lib/finch-api/models/webhook_event.rbi @@ -2,16 +2,16 @@ module FinchAPI module Models - class WebhookEvent < FinchAPI::Union - abstract! + module WebhookEvent + extend FinchAPI::Union 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]] + [FinchAPI::Models::AccountUpdateEvent, FinchAPI::Models::CompanyEvent, FinchAPI::Models::JobCompletionEvent, FinchAPI::Models::DirectoryEvent, FinchAPI::Models::EmploymentEvent, FinchAPI::Models::IndividualEvent, FinchAPI::Models::PaymentEvent, FinchAPI::Models::PayStatementEvent] ) end - private_class_method def self.variants + def self.variants end end end diff --git a/rbi/lib/finch-api/page.rbi b/rbi/lib/finch-api/page.rbi index 3ff8f43e..f1019dbe 100644 --- a/rbi/lib/finch-api/page.rbi +++ b/rbi/lib/finch-api/page.rbi @@ -6,32 +6,14 @@ module FinchAPI 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(T.nilable(T::Array[Elem])) } + attr_accessor :data sig { returns(FinchAPI::Models::Paging) } - def paging - end + attr_accessor :paging - 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:) + sig { returns(String) } + def inspect end end end diff --git a/rbi/lib/finch-api/pooled_net_requester.rbi b/rbi/lib/finch-api/pooled_net_requester.rbi index 3d103567..5ec8a478 100644 --- a/rbi/lib/finch-api/pooled_net_requester.rbi +++ b/rbi/lib/finch-api/pooled_net_requester.rbi @@ -1,36 +1,59 @@ # typed: strong module FinchAPI + # @api private class PooledNetRequester - RequestShape = T.type_alias do - {method: Symbol, url: URI::Generic, headers: T::Hash[String, String], body: T.anything, deadline: Float} - end + 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 + # from the golang stdlib + # https://github.com/golang/go/blob/c8eced8580028328fde7c03cbfcb720ce15b2358/src/net/http/transport.go#L49 + KEEP_ALIVE_TIMEOUT = 30 - sig { params(conn: Net::HTTP, deadline: Float).void } - def self.calibrate_socket_timeout(conn, deadline) - end + class << self + # @api private + sig { params(url: URI::Generic).returns(Net::HTTP) } + def connect(url) + end + + # @api private + sig { params(conn: Net::HTTP, deadline: Float).void } + def calibrate_socket_timeout(conn, deadline) + end - sig { params(request: FinchAPI::PooledNetRequester::RequestShape).returns(Net::HTTPGenericRequest) } - def self.build_request(request) + # @api private + sig do + params(request: FinchAPI::PooledNetRequester::RequestShape, blk: T.proc.params(arg0: String).void) + .returns(Net::HTTPGenericRequest) + end + def build_request(request, &blk) + end end - sig { params(url: URI::Generic, blk: T.proc.params(arg0: Net::HTTP).void).void } - private def with_pool(url, &blk) + # @api private + sig { params(url: URI::Generic, deadline: Float, blk: T.proc.params(arg0: Net::HTTP).void).void } + private def with_pool(url, deadline:, &blk) end + # @api private sig do params(request: FinchAPI::PooledNetRequester::RequestShape) - .returns([Net::HTTPResponse, T::Enumerable[String]]) + .returns([Integer, Net::HTTPResponse, T::Enumerable[String]]) end def execute(request) end - sig { void } - def initialize + # @api private + sig { params(size: Integer).returns(T.attached_class) } + def self.new(size: Etc.nprocessors) end end end diff --git a/rbi/lib/finch-api/request_options.rbi b/rbi/lib/finch-api/request_options.rbi index 68b232aa..9c6d0e10 100644 --- a/rbi/lib/finch-api/request_options.rbi +++ b/rbi/lib/finch-api/request_options.rbi @@ -1,84 +1,63 @@ # typed: strong module FinchAPI + # @api private 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 + # Options to specify HTTP behaviour for this request. + sig { returns(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) } + attr_accessor :request_options + # @api private module Converter - sig { params(params: T.anything).returns([T.anything, T::Hash[Symbol, T.anything]]) } + # @api private + sig { params(params: T.anything).returns([T.anything, FinchAPI::Util::AnyHash]) } def dump_request(params) 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 + # @api private sig { params(opts: T.any(T.self_type, T::Hash[Symbol, T.anything])).void } def self.validate!(opts) end + # Idempotency key to send with request and all associated retries. Will only be + # sent for write requests. sig { returns(T.nilable(String)) } - def idempotency_key - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def idempotency_key=(_) - end + attr_accessor :idempotency_key + # Extra query params to send with the request. These are `.merge`’d into any + # `query` given at the client level. 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 + attr_accessor :extra_query + # Extra headers to send with the request. These are `.merged`’d into any + # `extra_headers` given at the client level. 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 + attr_accessor :extra_headers - 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 + # Extra data to send with the request. These are deep merged into any data + # generated as part of the normal request. + sig { returns(T.nilable(T.anything)) } + attr_accessor :extra_body + # Maximum number of retries to attempt after a failed initial request. sig { returns(T.nilable(Integer)) } - def max_retries - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def max_retries=(_) - end + attr_accessor :max_retries + # Request timeout in seconds. sig { returns(T.nilable(Float)) } - def timeout - end + attr_accessor :timeout - sig { params(_: T.nilable(Float)).returns(T.nilable(Float)) } - def timeout=(_) + # Returns a new instance of RequestOptions. + sig { params(values: FinchAPI::Util::AnyHash).returns(T.attached_class) } + def self.new(values = {}) end end end diff --git a/rbi/lib/finch-api/resources/access_tokens.rbi b/rbi/lib/finch-api/resources/access_tokens.rbi index 2f4987c0..858bb967 100644 --- a/rbi/lib/finch-api/resources/access_tokens.rbi +++ b/rbi/lib/finch-api/resources/access_tokens.rbi @@ -3,21 +3,22 @@ module FinchAPI module Resources class AccessTokens + # Exchange the authorization code for an access token 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])) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) ) .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:) + sig { params(client: FinchAPI::Client).returns(T.attached_class) } + def self.new(client:) end end end diff --git a/rbi/lib/finch-api/resources/account.rbi b/rbi/lib/finch-api/resources/account.rbi index f38446bf..273fc622 100644 --- a/rbi/lib/finch-api/resources/account.rbi +++ b/rbi/lib/finch-api/resources/account.rbi @@ -3,22 +3,24 @@ module FinchAPI module Resources class Account + # Disconnect one or more `access_token`s from your application. sig do - params(request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]))) + params(request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash))) .returns(FinchAPI::Models::DisconnectResponse) end def disconnect(request_options: {}) end + # Read account information associated with an `access_token` sig do - params(request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]))) + params(request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash))) .returns(FinchAPI::Models::Introspection) end def introspect(request_options: {}) end - sig { params(client: FinchAPI::Client).void } - def initialize(client:) + sig { params(client: FinchAPI::Client).returns(T.attached_class) } + def self.new(client:) end end end diff --git a/rbi/lib/finch-api/resources/connect.rbi b/rbi/lib/finch-api/resources/connect.rbi index 40e87df2..9cf5a0bf 100644 --- a/rbi/lib/finch-api/resources/connect.rbi +++ b/rbi/lib/finch-api/resources/connect.rbi @@ -4,11 +4,10 @@ module FinchAPI module Resources class Connect sig { returns(FinchAPI::Resources::Connect::Sessions) } - def sessions - end + attr_reader :sessions - sig { params(client: FinchAPI::Client).void } - def initialize(client:) + sig { params(client: FinchAPI::Client).returns(T.attached_class) } + def self.new(client:) end end end diff --git a/rbi/lib/finch-api/resources/connect/sessions.rbi b/rbi/lib/finch-api/resources/connect/sessions.rbi index e4f411dc..e52ad833 100644 --- a/rbi/lib/finch-api/resources/connect/sessions.rbi +++ b/rbi/lib/finch-api/resources/connect/sessions.rbi @@ -4,18 +4,19 @@ module FinchAPI module Resources class Connect class Sessions + # Create a new connect session for an employer sig do params( customer_id: String, customer_name: String, - products: T::Array[Symbol], + products: T::Array[FinchAPI::Models::Connect::SessionNewParams::Product::OrSymbol], customer_email: T.nilable(String), - integration: T.nilable(FinchAPI::Models::Connect::SessionNewParams::Integration), + integration: T.nilable(T.any(FinchAPI::Models::Connect::SessionNewParams::Integration, FinchAPI::Util::AnyHash)), 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])) + sandbox: T.nilable(FinchAPI::Models::Connect::SessionNewParams::Sandbox::OrSymbol), + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) ) .returns(FinchAPI::Models::Connect::SessionNewResponse) end @@ -26,6 +27,8 @@ module FinchAPI customer_email: nil, integration: nil, manual: nil, + # The number of minutes until the session expires (defaults to 43,200, which is 30 + # days) minutes_to_expire: nil, redirect_uri: nil, sandbox: nil, @@ -33,27 +36,33 @@ module FinchAPI ) end + # Create a new Connect session for reauthenticating an existing connection sig do params( connection_id: String, minutes_to_expire: T.nilable(Integer), - products: T.nilable(T::Array[Symbol]), + products: T.nilable(T::Array[FinchAPI::Models::Connect::SessionReauthenticateParams::Product::OrSymbol]), redirect_uri: T.nilable(String), - request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) ) .returns(FinchAPI::Models::Connect::SessionReauthenticateResponse) end def reauthenticate( + # The ID of the existing connection to reauthenticate connection_id:, + # The number of minutes until the session expires (defaults to 43,200, which is 30 + # days) minutes_to_expire: nil, + # The products to request access to (optional for reauthentication) products: nil, + # The URI to redirect to after the Connect flow is completed redirect_uri: nil, request_options: {} ) end - sig { params(client: FinchAPI::Client).void } - def initialize(client:) + sig { params(client: FinchAPI::Client).returns(T.attached_class) } + def self.new(client:) end end end diff --git a/rbi/lib/finch-api/resources/hris.rbi b/rbi/lib/finch-api/resources/hris.rbi index dbb1355d..0273e083 100644 --- a/rbi/lib/finch-api/resources/hris.rbi +++ b/rbi/lib/finch-api/resources/hris.rbi @@ -4,39 +4,31 @@ module FinchAPI module Resources class HRIS sig { returns(FinchAPI::Resources::HRIS::Company) } - def company - end + attr_reader :company sig { returns(FinchAPI::Resources::HRIS::Directory) } - def directory - end + attr_reader :directory sig { returns(FinchAPI::Resources::HRIS::Individuals) } - def individuals - end + attr_reader :individuals sig { returns(FinchAPI::Resources::HRIS::Employments) } - def employments - end + attr_reader :employments sig { returns(FinchAPI::Resources::HRIS::Payments) } - def payments - end + attr_reader :payments sig { returns(FinchAPI::Resources::HRIS::PayStatements) } - def pay_statements - end + attr_reader :pay_statements sig { returns(FinchAPI::Resources::HRIS::Documents) } - def documents - end + attr_reader :documents sig { returns(FinchAPI::Resources::HRIS::Benefits) } - def benefits - end + attr_reader :benefits - sig { params(client: FinchAPI::Client).void } - def initialize(client:) + sig { params(client: FinchAPI::Client).returns(T.attached_class) } + def self.new(client:) end end end diff --git a/rbi/lib/finch-api/resources/hris/benefits.rbi b/rbi/lib/finch-api/resources/hris/benefits.rbi index 25af1e23..26b286c5 100644 --- a/rbi/lib/finch-api/resources/hris/benefits.rbi +++ b/rbi/lib/finch-api/resources/hris/benefits.rbi @@ -5,58 +5,77 @@ module FinchAPI class HRIS class Benefits sig { returns(FinchAPI::Resources::HRIS::Benefits::Individuals) } - def individuals - end + attr_reader :individuals + # Creates a new company-wide deduction or contribution. Please use the + # `/providers` endpoint to view available types for each provider. 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])) + frequency: T.nilable(FinchAPI::Models::HRIS::BenefitFrequency::OrSymbol), + type: T.nilable(FinchAPI::Models::HRIS::BenefitType::OrSymbol), + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) ) .returns(FinchAPI::Models::HRIS::CreateCompanyBenefitsResponse) end - def create(description: nil, frequency: nil, type: nil, request_options: {}) + def create( + # 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). + description: nil, + frequency: nil, + # Type of benefit. + type: nil, + request_options: {} + ) end + # Lists deductions and contributions information for a given item sig do params( benefit_id: String, - request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) ) .returns(FinchAPI::Models::HRIS::CompanyBenefit) end def retrieve(benefit_id, request_options: {}) end + # Updates an existing company-wide deduction or contribution sig do params( benefit_id: String, description: String, - request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) ) .returns(FinchAPI::Models::HRIS::UpdateCompanyBenefitResponse) end - def update(benefit_id, description: nil, request_options: {}) + def update( + benefit_id, + # Updated name or description. + description: nil, + request_options: {} + ) end + # List all company-wide deductions and contributions. sig do - params(request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]))) + params(request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash))) .returns(FinchAPI::SinglePage[FinchAPI::Models::HRIS::CompanyBenefit]) end def list(request_options: {}) end + # Get deductions metadata sig do - params(request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]))) + params(request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash))) .returns(FinchAPI::SinglePage[FinchAPI::Models::HRIS::SupportedBenefit]) end def list_supported_benefits(request_options: {}) end - sig { params(client: FinchAPI::Client).void } - def initialize(client:) + sig { params(client: FinchAPI::Client).returns(T.attached_class) } + def self.new(client:) 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 index b4afcec1..cc51fa97 100644 --- a/rbi/lib/finch-api/resources/hris/benefits/individuals.rbi +++ b/rbi/lib/finch-api/resources/hris/benefits/individuals.rbi @@ -5,51 +5,74 @@ module FinchAPI 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. 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])) + individuals: T::Array[T.any(FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual, FinchAPI::Util::AnyHash)], + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) ) .returns(FinchAPI::SinglePage[FinchAPI::Models::HRIS::Benefits::EnrolledIndividual]) end - def enroll_many(benefit_id, individuals: nil, request_options: {}) + def enroll_many( + benefit_id, + # Array of the individual_id to enroll and a configuration object. + individuals: nil, + request_options: {} + ) end + # Lists individuals currently enrolled in a given deduction. sig do params( benefit_id: String, - request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) ) .returns(FinchAPI::Models::HRIS::Benefits::IndividualEnrolledIDsResponse) end def enrolled_ids(benefit_id, request_options: {}) end + # Get enrollment information for the given individuals. sig do params( benefit_id: String, individual_ids: String, - request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) ) .returns(FinchAPI::SinglePage[FinchAPI::Models::HRIS::Benefits::IndividualBenefit]) end - def retrieve_many_benefits(benefit_id, individual_ids: nil, request_options: {}) + def retrieve_many_benefits( + benefit_id, + # comma-delimited list of stable Finch uuids for each individual. If empty, + # defaults to all individuals + individual_ids: nil, + request_options: {} + ) end + # Unenroll individuals from a deduction or contribution sig do params( benefit_id: String, individual_ids: T::Array[String], - request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) ) .returns(FinchAPI::SinglePage[FinchAPI::Models::HRIS::Benefits::UnenrolledIndividual]) end - def unenroll_many(benefit_id, individual_ids: nil, request_options: {}) + def unenroll_many( + benefit_id, + # Array of individual_ids to unenroll. + individual_ids: nil, + request_options: {} + ) end - sig { params(client: FinchAPI::Client).void } - def initialize(client:) + sig { params(client: FinchAPI::Client).returns(T.attached_class) } + def self.new(client:) end end end diff --git a/rbi/lib/finch-api/resources/hris/company.rbi b/rbi/lib/finch-api/resources/hris/company.rbi index ea45c69e..2a1d768a 100644 --- a/rbi/lib/finch-api/resources/hris/company.rbi +++ b/rbi/lib/finch-api/resources/hris/company.rbi @@ -4,15 +4,16 @@ module FinchAPI module Resources class HRIS class Company + # Read basic company data sig do - params(request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]))) + params(request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash))) .returns(FinchAPI::Models::HRIS::HRISCompany) end def retrieve(request_options: {}) end - sig { params(client: FinchAPI::Client).void } - def initialize(client:) + sig { params(client: FinchAPI::Client).returns(T.attached_class) } + def self.new(client:) end end end diff --git a/rbi/lib/finch-api/resources/hris/directory.rbi b/rbi/lib/finch-api/resources/hris/directory.rbi index e6f9b8ab..484c94fc 100644 --- a/rbi/lib/finch-api/resources/hris/directory.rbi +++ b/rbi/lib/finch-api/resources/hris/directory.rbi @@ -4,30 +4,26 @@ module FinchAPI module Resources class HRIS class Directory + # Read company directory and organization structure sig do params( limit: Integer, offset: Integer, - request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) ) .returns(FinchAPI::IndividualsPage[FinchAPI::Models::HRIS::IndividualInDirectory]) end - def list(limit: nil, offset: nil, request_options: {}) + def list( + # Number of employees to return (defaults to all) + limit: nil, + # Index to start from (defaults to 0) + 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:) + sig { params(client: FinchAPI::Client).returns(T.attached_class) } + def self.new(client:) end end end diff --git a/rbi/lib/finch-api/resources/hris/documents.rbi b/rbi/lib/finch-api/resources/hris/documents.rbi index 67236063..3dc10bc1 100644 --- a/rbi/lib/finch-api/resources/hris/documents.rbi +++ b/rbi/lib/finch-api/resources/hris/documents.rbi @@ -4,31 +4,51 @@ module FinchAPI module Resources class HRIS class Documents + # **Beta:** This endpoint is in beta and may change. Retrieve a list of + # company-wide 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])) + types: T::Array[FinchAPI::Models::HRIS::DocumentListParams::Type::OrSymbol], + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) ) .returns(FinchAPI::Models::HRIS::DocumentListResponse) end - def list(individual_ids: nil, limit: nil, offset: nil, types: nil, request_options: {}) + def list( + # Comma-delimited list of stable Finch uuids for each individual. If empty, + # defaults to all individuals + individual_ids: nil, + # Number of documents to return (defaults to all) + limit: nil, + # Index to start from (defaults to 0) + offset: nil, + # Comma-delimited list of document types to filter on. If empty, defaults to all + # types + types: nil, + request_options: {} + ) end + # **Beta:** This endpoint is in beta and may change. Retrieve details of a + # specific document by its ID. sig do params( document_id: String, - request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) ) .returns(T.any(FinchAPI::Models::HRIS::W42020, FinchAPI::Models::HRIS::W42005)) end - def retreive(document_id, request_options: {}) + def retreive( + # The unique identifier of the document. + document_id, + request_options: {} + ) end - sig { params(client: FinchAPI::Client).void } - def initialize(client:) + sig { params(client: FinchAPI::Client).returns(T.attached_class) } + def self.new(client:) end end end diff --git a/rbi/lib/finch-api/resources/hris/employments.rbi b/rbi/lib/finch-api/resources/hris/employments.rbi index bf594782..332e2560 100644 --- a/rbi/lib/finch-api/resources/hris/employments.rbi +++ b/rbi/lib/finch-api/resources/hris/employments.rbi @@ -4,18 +4,23 @@ module FinchAPI module Resources class HRIS class Employments + # Read individual employment and income data sig do params( - requests: T::Array[FinchAPI::Models::HRIS::EmploymentRetrieveManyParams::Request], - request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + requests: T::Array[T.any(FinchAPI::Models::HRIS::EmploymentRetrieveManyParams::Request, FinchAPI::Util::AnyHash)], + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) ) .returns(FinchAPI::ResponsesPage[FinchAPI::Models::HRIS::EmploymentDataResponse]) end - def retrieve_many(requests:, request_options: {}) + def retrieve_many( + # The array of batch requests. + requests:, + request_options: {} + ) end - sig { params(client: FinchAPI::Client).void } - def initialize(client:) + sig { params(client: FinchAPI::Client).returns(T.attached_class) } + def self.new(client:) end end end diff --git a/rbi/lib/finch-api/resources/hris/individuals.rbi b/rbi/lib/finch-api/resources/hris/individuals.rbi index f13687c9..cc6e017c 100644 --- a/rbi/lib/finch-api/resources/hris/individuals.rbi +++ b/rbi/lib/finch-api/resources/hris/individuals.rbi @@ -4,19 +4,20 @@ module FinchAPI module Resources class HRIS class Individuals + # Read individual data, excluding income and employment data 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])) + options: T.nilable(T.any(FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Options, FinchAPI::Util::AnyHash)), + requests: T::Array[T.any(FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Request, FinchAPI::Util::AnyHash)], + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) ) .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:) + sig { params(client: FinchAPI::Client).returns(T.attached_class) } + def self.new(client:) 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 index 6e317654..0feb644d 100644 --- a/rbi/lib/finch-api/resources/hris/pay_statements.rbi +++ b/rbi/lib/finch-api/resources/hris/pay_statements.rbi @@ -4,18 +4,26 @@ 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. sig do params( - requests: T::Array[FinchAPI::Models::HRIS::PayStatementRetrieveManyParams::Request], - request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + requests: T::Array[T.any(FinchAPI::Models::HRIS::PayStatementRetrieveManyParams::Request, FinchAPI::Util::AnyHash)], + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) ) .returns(FinchAPI::ResponsesPage[FinchAPI::Models::HRIS::PayStatementResponse]) end - def retrieve_many(requests:, request_options: {}) + def retrieve_many( + # The array of batch requests. + requests:, + request_options: {} + ) end - sig { params(client: FinchAPI::Client).void } - def initialize(client:) + sig { params(client: FinchAPI::Client).returns(T.attached_class) } + def self.new(client:) end end end diff --git a/rbi/lib/finch-api/resources/hris/payments.rbi b/rbi/lib/finch-api/resources/hris/payments.rbi index dfe5b0b0..29559d86 100644 --- a/rbi/lib/finch-api/resources/hris/payments.rbi +++ b/rbi/lib/finch-api/resources/hris/payments.rbi @@ -4,19 +4,28 @@ module FinchAPI module Resources class HRIS class Payments + # Read payroll and contractor related payments by the company. sig do params( end_date: Date, start_date: Date, - request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) ) .returns(FinchAPI::SinglePage[FinchAPI::Models::HRIS::Payment]) end - def list(end_date:, start_date:, request_options: {}) + def list( + # The end date to retrieve payments by a company (inclusive) in `YYYY-MM-DD` + # format. + end_date:, + # The start date to retrieve payments by a company (inclusive) in `YYYY-MM-DD` + # format. + start_date:, + request_options: {} + ) end - sig { params(client: FinchAPI::Client).void } - def initialize(client:) + sig { params(client: FinchAPI::Client).returns(T.attached_class) } + def self.new(client:) end end end diff --git a/rbi/lib/finch-api/resources/jobs.rbi b/rbi/lib/finch-api/resources/jobs.rbi index f5213482..3bdb92d1 100644 --- a/rbi/lib/finch-api/resources/jobs.rbi +++ b/rbi/lib/finch-api/resources/jobs.rbi @@ -4,15 +4,13 @@ module FinchAPI module Resources class Jobs sig { returns(FinchAPI::Resources::Jobs::Automated) } - def automated - end + attr_reader :automated sig { returns(FinchAPI::Resources::Jobs::Manual) } - def manual - end + attr_reader :manual - sig { params(client: FinchAPI::Client).void } - def initialize(client:) + sig { params(client: FinchAPI::Client).returns(T.attached_class) } + def self.new(client:) end end end diff --git a/rbi/lib/finch-api/resources/jobs/automated.rbi b/rbi/lib/finch-api/resources/jobs/automated.rbi index cfe326ca..5e90492a 100644 --- a/rbi/lib/finch-api/resources/jobs/automated.rbi +++ b/rbi/lib/finch-api/resources/jobs/automated.rbi @@ -4,40 +4,69 @@ 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. sig do params( - type: Symbol, - params: FinchAPI::Models::Jobs::AutomatedCreateParams::Params, - request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + type: FinchAPI::Models::Jobs::AutomatedCreateParams::Type::OrSymbol, + params: T.any(FinchAPI::Models::Jobs::AutomatedCreateParams::Params, FinchAPI::Util::AnyHash), + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) ) .returns(FinchAPI::Models::Jobs::AutomatedCreateResponse) end - def create(type:, params:, request_options: {}) + def create( + # The type of job to start. + type:, + params:, + request_options: {} + ) end + # Get an automated job by `job_id`. sig do params( job_id: String, - request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) ) .returns(FinchAPI::Models::Jobs::AutomatedAsyncJob) end def retrieve(job_id, 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. sig do params( limit: Integer, offset: Integer, - request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) ) - .returns(FinchAPI::Page[FinchAPI::Models::Jobs::AutomatedAsyncJob]) + .returns(FinchAPI::Models::Jobs::AutomatedListResponse) end - def list(limit: nil, offset: nil, request_options: {}) + def list( + # Number of items to return + limit: nil, + # Index to start from (defaults to 0) + offset: nil, + request_options: {} + ) end - sig { params(client: FinchAPI::Client).void } - def initialize(client:) + sig { params(client: FinchAPI::Client).returns(T.attached_class) } + def self.new(client:) end end end diff --git a/rbi/lib/finch-api/resources/jobs/manual.rbi b/rbi/lib/finch-api/resources/jobs/manual.rbi index da55b586..d297bc2a 100644 --- a/rbi/lib/finch-api/resources/jobs/manual.rbi +++ b/rbi/lib/finch-api/resources/jobs/manual.rbi @@ -4,18 +4,20 @@ 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. sig do params( job_id: String, - request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) ) .returns(FinchAPI::Models::Jobs::ManualAsyncJob) end def retrieve(job_id, request_options: {}) end - sig { params(client: FinchAPI::Client).void } - def initialize(client:) + sig { params(client: FinchAPI::Client).returns(T.attached_class) } + def self.new(client:) end end end diff --git a/rbi/lib/finch-api/resources/payroll.rbi b/rbi/lib/finch-api/resources/payroll.rbi index d3dacfd8..f2405820 100644 --- a/rbi/lib/finch-api/resources/payroll.rbi +++ b/rbi/lib/finch-api/resources/payroll.rbi @@ -4,11 +4,10 @@ module FinchAPI module Resources class Payroll sig { returns(FinchAPI::Resources::Payroll::PayGroups) } - def pay_groups - end + attr_reader :pay_groups - sig { params(client: FinchAPI::Client).void } - def initialize(client:) + sig { params(client: FinchAPI::Client).returns(T.attached_class) } + def self.new(client:) 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 index b3584857..ea721705 100644 --- a/rbi/lib/finch-api/resources/payroll/pay_groups.rbi +++ b/rbi/lib/finch-api/resources/payroll/pay_groups.rbi @@ -4,29 +4,31 @@ module FinchAPI module Resources class Payroll class PayGroups + # Read information from a single pay group sig do params( pay_group_id: String, - request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) ) .returns(FinchAPI::Models::Payroll::PayGroupRetrieveResponse) end def retrieve(pay_group_id, request_options: {}) end + # Read company pay groups and frequencies sig do params( individual_id: String, pay_frequencies: T::Array[String], - request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) ) .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:) + sig { params(client: FinchAPI::Client).returns(T.attached_class) } + def self.new(client:) end end end diff --git a/rbi/lib/finch-api/resources/providers.rbi b/rbi/lib/finch-api/resources/providers.rbi index 716c3454..f8e8922a 100644 --- a/rbi/lib/finch-api/resources/providers.rbi +++ b/rbi/lib/finch-api/resources/providers.rbi @@ -3,15 +3,16 @@ module FinchAPI module Resources class Providers + # Return details on all available payroll and HR systems. sig do - params(request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]))) + params(request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash))) .returns(FinchAPI::SinglePage[FinchAPI::Models::Provider]) end def list(request_options: {}) end - sig { params(client: FinchAPI::Client).void } - def initialize(client:) + sig { params(client: FinchAPI::Client).returns(T.attached_class) } + def self.new(client:) end end end diff --git a/rbi/lib/finch-api/resources/request_forwarding.rbi b/rbi/lib/finch-api/resources/request_forwarding.rbi index 998c93e6..80e9893d 100644 --- a/rbi/lib/finch-api/resources/request_forwarding.rbi +++ b/rbi/lib/finch-api/resources/request_forwarding.rbi @@ -3,6 +3,10 @@ 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. sig do params( method_: String, @@ -10,15 +14,34 @@ module FinchAPI 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])) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) ) .returns(FinchAPI::Models::RequestForwardingForwardResponse) end - def forward(method_:, route:, data: nil, headers: nil, params: nil, request_options: {}) + def forward( + # The HTTP method for the forwarded request. Valid values include: `GET` , `POST` + # , `PUT` , `DELETE` , and `PATCH`. + method_:, + # 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. + route:, + # The body for the forwarded request. This value must be specified as either a + # string or a valid JSON object. + data: nil, + # 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" }` + headers: nil, + # The query parameters for the forwarded request. This value must be specified as + # a valid JSON object rather than a query string. + params: nil, + request_options: {} + ) end - sig { params(client: FinchAPI::Client).void } - def initialize(client:) + sig { params(client: FinchAPI::Client).returns(T.attached_class) } + def self.new(client:) end end end diff --git a/rbi/lib/finch-api/resources/sandbox.rbi b/rbi/lib/finch-api/resources/sandbox.rbi index 39fb2ff4..794ac209 100644 --- a/rbi/lib/finch-api/resources/sandbox.rbi +++ b/rbi/lib/finch-api/resources/sandbox.rbi @@ -4,35 +4,28 @@ module FinchAPI module Resources class Sandbox sig { returns(FinchAPI::Resources::Sandbox::Connections) } - def connections - end + attr_reader :connections sig { returns(FinchAPI::Resources::Sandbox::Company) } - def company - end + attr_reader :company sig { returns(FinchAPI::Resources::Sandbox::Directory) } - def directory - end + attr_reader :directory sig { returns(FinchAPI::Resources::Sandbox::Individual) } - def individual - end + attr_reader :individual sig { returns(FinchAPI::Resources::Sandbox::Employment) } - def employment - end + attr_reader :employment sig { returns(FinchAPI::Resources::Sandbox::Payment) } - def payment - end + attr_reader :payment sig { returns(FinchAPI::Resources::Sandbox::Jobs) } - def jobs - end + attr_reader :jobs - sig { params(client: FinchAPI::Client).void } - def initialize(client:) + sig { params(client: FinchAPI::Client).returns(T.attached_class) } + def self.new(client:) end end end diff --git a/rbi/lib/finch-api/resources/sandbox/company.rbi b/rbi/lib/finch-api/resources/sandbox/company.rbi index 483d2c4c..779911d1 100644 --- a/rbi/lib/finch-api/resources/sandbox/company.rbi +++ b/rbi/lib/finch-api/resources/sandbox/company.rbi @@ -4,35 +4,47 @@ module FinchAPI module Resources class Sandbox class Company + # Update a sandbox company's data 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)]), + accounts: T.nilable( + T::Array[T.any(FinchAPI::Models::Sandbox::CompanyUpdateParams::Account, FinchAPI::Util::AnyHash)] + ), + departments: T.nilable( + T::Array[T.nilable(T.any(FinchAPI::Models::Sandbox::CompanyUpdateParams::Department, FinchAPI::Util::AnyHash))] + ), ein: T.nilable(String), - entity: T.nilable(FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity), + entity: T.nilable(T.any(FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity, FinchAPI::Util::AnyHash)), legal_name: T.nilable(String), - locations: T.nilable(T::Array[T.nilable(FinchAPI::Models::Location)]), + locations: T.nilable(T::Array[T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Util::AnyHash))]), primary_email: T.nilable(String), primary_phone_number: T.nilable(String), - request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) ) .returns(FinchAPI::Models::Sandbox::CompanyUpdateResponse) end def update( + # An array of bank account objects associated with the payroll/HRIS system. accounts:, + # The array of company departments. departments:, + # The employer identification number. ein:, + # The entity type object. entity:, + # The legal name of the company. legal_name:, locations:, + # The email of the main administrator on the account. primary_email:, + # The phone number of the main administrator on the account. Format: `XXXXXXXXXX` primary_phone_number:, request_options: {} ) end - sig { params(client: FinchAPI::Client).void } - def initialize(client:) + sig { params(client: FinchAPI::Client).returns(T.attached_class) } + def self.new(client:) end end end diff --git a/rbi/lib/finch-api/resources/sandbox/connections.rbi b/rbi/lib/finch-api/resources/sandbox/connections.rbi index be9afce1..0f6fcb32 100644 --- a/rbi/lib/finch-api/resources/sandbox/connections.rbi +++ b/rbi/lib/finch-api/resources/sandbox/connections.rbi @@ -5,30 +5,34 @@ module FinchAPI class Sandbox class Connections sig { returns(FinchAPI::Resources::Sandbox::Connections::Accounts) } - def accounts - end + attr_reader :accounts + # Create a new connection (new company/provider pair) with a new account sig do params( provider_id: String, - authentication_type: Symbol, + authentication_type: FinchAPI::Models::Sandbox::ConnectionCreateParams::AuthenticationType::OrSymbol, employee_size: Integer, products: T::Array[String], - request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) ) .returns(FinchAPI::Models::Sandbox::ConnectionCreateResponse) end def create( + # The provider associated with the connection provider_id:, authentication_type: nil, + # 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. employee_size: nil, products: nil, request_options: {} ) end - sig { params(client: FinchAPI::Client).void } - def initialize(client:) + sig { params(client: FinchAPI::Client).returns(T.attached_class) } + def self.new(client:) 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 index bd825c8c..b9c04168 100644 --- a/rbi/lib/finch-api/resources/sandbox/connections/accounts.rbi +++ b/rbi/lib/finch-api/resources/sandbox/connections/accounts.rbi @@ -5,31 +5,43 @@ module FinchAPI class Sandbox class Connections class Accounts + # Create a new account for an existing connection (company/provider pair) sig do params( company_id: String, provider_id: String, - authentication_type: Symbol, + authentication_type: FinchAPI::Models::Sandbox::Connections::AccountCreateParams::AuthenticationType::OrSymbol, products: T::Array[String], - request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) ) .returns(FinchAPI::Models::Sandbox::Connections::AccountCreateResponse) end - def create(company_id:, provider_id:, authentication_type: nil, products: nil, request_options: {}) + def create( + company_id:, + # The provider associated with the `access_token` + provider_id:, + authentication_type: nil, + # Optional, defaults to Organization products (`company`, `directory`, + # `employment`, `individual`) + products: nil, + request_options: {} + ) end + # Update an existing sandbox account. Change the connection status to understand + # how the Finch API responds. sig do params( - connection_status: Symbol, - request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + connection_status: FinchAPI::Models::ConnectionStatusType::OrSymbol, + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) ) .returns(FinchAPI::Models::Sandbox::Connections::AccountUpdateResponse) end def update(connection_status: nil, request_options: {}) end - sig { params(client: FinchAPI::Client).void } - def initialize(client:) + sig { params(client: FinchAPI::Client).returns(T.attached_class) } + def self.new(client:) end end end diff --git a/rbi/lib/finch-api/resources/sandbox/directory.rbi b/rbi/lib/finch-api/resources/sandbox/directory.rbi index b2e56c8f..03bae430 100644 --- a/rbi/lib/finch-api/resources/sandbox/directory.rbi +++ b/rbi/lib/finch-api/resources/sandbox/directory.rbi @@ -4,18 +4,24 @@ module FinchAPI module Resources class Sandbox class Directory + # Add new individuals to a sandbox company sig do params( - body: T::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body], - request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + body: T::Array[T.any(FinchAPI::Models::Sandbox::DirectoryCreateParams::Body, FinchAPI::Util::AnyHash)], + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) ) - .returns(FinchAPI::Models::Sandbox::DirectoryCreateResponse) + .returns(T::Array[T.anything]) end - def create(body: nil, request_options: {}) + def create( + # Array of individuals to create. Takes all combined fields from `/individual` and + # `/employment` endpoints. All fields are optional. + body: nil, + request_options: {} + ) end - sig { params(client: FinchAPI::Client).void } - def initialize(client:) + sig { params(client: FinchAPI::Client).returns(T.attached_class) } + def self.new(client:) end end end diff --git a/rbi/lib/finch-api/resources/sandbox/employment.rbi b/rbi/lib/finch-api/resources/sandbox/employment.rbi index 55ace8c4..9c5dffb0 100644 --- a/rbi/lib/finch-api/resources/sandbox/employment.rbi +++ b/rbi/lib/finch-api/resources/sandbox/employment.rbi @@ -4,57 +4,76 @@ module FinchAPI module Resources class Sandbox class Employment + # Update sandbox 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), + custom_fields: T::Array[T.any(FinchAPI::Models::Sandbox::EmploymentUpdateParams::CustomField, FinchAPI::Util::AnyHash)], + department: T.nilable(T.any(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Department, FinchAPI::Util::AnyHash)), + employment: T.nilable(T.any(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment, FinchAPI::Util::AnyHash)), + employment_status: T.nilable(FinchAPI::Models::Sandbox::EmploymentUpdateParams::EmploymentStatus::OrSymbol), 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)]), + income: T.nilable(T.any(FinchAPI::Models::Income, FinchAPI::Util::AnyHash)), + income_history: T.nilable(T::Array[T.nilable(T.any(FinchAPI::Models::Income, FinchAPI::Util::AnyHash))]), 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), + location: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Util::AnyHash)), + manager: T.nilable(T.any(FinchAPI::Models::Sandbox::EmploymentUpdateParams::Manager, FinchAPI::Util::AnyHash)), 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])) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) ) .returns(FinchAPI::Models::Sandbox::EmploymentUpdateResponse) end def update( individual_id, + # Worker's compensation classification code for this employee class_code: nil, + # 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. custom_fields: nil, + # The department object. department: nil, + # The employment object. employment: nil, + # The detailed employment status of the individual. employment_status: nil, end_date: nil, + # The legal first name of the individual. first_name: nil, + # 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. income: nil, + # The array of income history. income_history: nil, + # `true` if the individual an an active employee or contractor at the company. is_active: nil, + # The legal last name of the individual. last_name: nil, latest_rehire_date: nil, location: nil, + # The manager object representing the manager of the individual within the org. manager: nil, + # The legal middle name of the individual. middle_name: nil, + # The source system's unique employment identifier for this individual source_id: nil, start_date: nil, + # The current title of the individual. title: nil, request_options: {} ) end - sig { params(client: FinchAPI::Client).void } - def initialize(client:) + sig { params(client: FinchAPI::Client).returns(T.attached_class) } + def self.new(client:) end end end diff --git a/rbi/lib/finch-api/resources/sandbox/individual.rbi b/rbi/lib/finch-api/resources/sandbox/individual.rbi index 5826ec6c..b5e76f3f 100644 --- a/rbi/lib/finch-api/resources/sandbox/individual.rbi +++ b/rbi/lib/finch-api/resources/sandbox/individual.rbi @@ -4,22 +4,27 @@ module FinchAPI module Resources class Sandbox class Individual + # Update sandbox individual sig do params( individual_id: String, dob: T.nilable(String), - emails: T.nilable(T::Array[FinchAPI::Models::Sandbox::IndividualUpdateParams::Email]), + emails: T.nilable( + T::Array[T.any(FinchAPI::Models::Sandbox::IndividualUpdateParams::Email, FinchAPI::Util::AnyHash)] + ), encrypted_ssn: T.nilable(String), - ethnicity: T.nilable(Symbol), + ethnicity: T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateParams::Ethnicity::OrSymbol), first_name: T.nilable(String), - gender: T.nilable(Symbol), + gender: T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateParams::Gender::OrSymbol), last_name: T.nilable(String), middle_name: T.nilable(String), - phone_numbers: T.nilable(T::Array[T.nilable(FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber)]), + phone_numbers: T.nilable( + T::Array[T.nilable(T.any(FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber, FinchAPI::Util::AnyHash))] + ), preferred_name: T.nilable(String), - residence: T.nilable(FinchAPI::Models::Location), + residence: T.nilable(T.any(FinchAPI::Models::Location, FinchAPI::Util::AnyHash)), ssn: T.nilable(String), - request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) ) .returns(FinchAPI::Models::Sandbox::IndividualUpdateResponse) end @@ -27,22 +32,35 @@ module FinchAPI individual_id, dob: nil, emails: nil, + # 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. encrypted_ssn: nil, + # The EEOC-defined ethnicity of the individual. ethnicity: nil, + # The legal first name of the individual. first_name: nil, + # The gender of the individual. gender: nil, + # The legal last name of the individual. last_name: nil, + # The legal middle name of the individual. middle_name: nil, phone_numbers: nil, + # The preferred name of the individual. preferred_name: nil, residence: nil, + # 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). ssn: nil, request_options: {} ) end - sig { params(client: FinchAPI::Client).void } - def initialize(client:) + sig { params(client: FinchAPI::Client).returns(T.attached_class) } + def self.new(client:) end end end diff --git a/rbi/lib/finch-api/resources/sandbox/jobs.rbi b/rbi/lib/finch-api/resources/sandbox/jobs.rbi index da174818..063921b6 100644 --- a/rbi/lib/finch-api/resources/sandbox/jobs.rbi +++ b/rbi/lib/finch-api/resources/sandbox/jobs.rbi @@ -5,21 +5,25 @@ module FinchAPI class Sandbox class Jobs sig { returns(FinchAPI::Resources::Sandbox::Jobs::Configuration) } - def configuration - end + attr_reader :configuration + # Enqueue a new sandbox job sig do params( - type: Symbol, - request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + type: FinchAPI::Models::Sandbox::JobCreateParams::Type::OrSymbol, + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) ) .returns(FinchAPI::Models::Sandbox::JobCreateResponse) end - def create(type:, request_options: {}) + def create( + # The type of job to start. Currently the only supported type is `data_sync_all` + type:, + request_options: {} + ) end - sig { params(client: FinchAPI::Client).void } - def initialize(client:) + sig { params(client: FinchAPI::Client).returns(T.attached_class) } + def self.new(client:) 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 index 8cc6491d..627d34aa 100644 --- a/rbi/lib/finch-api/resources/sandbox/jobs/configuration.rbi +++ b/rbi/lib/finch-api/resources/sandbox/jobs/configuration.rbi @@ -5,26 +5,28 @@ module FinchAPI class Sandbox class Jobs class Configuration + # Get configurations for sandbox jobs sig do - params(request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything]))) - .returns(FinchAPI::Models::Sandbox::Jobs::ConfigurationRetrieveResponse) + params(request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash))) + .returns(T::Array[FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration]) end def retrieve(request_options: {}) end + # Update configurations for sandbox jobs sig do params( - completion_status: Symbol, - type: Symbol, - request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + completion_status: FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::CompletionStatus::OrSymbol, + type: FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::Type::OrSymbol, + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) ) .returns(FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration) end def update(completion_status:, type:, request_options: {}) end - sig { params(client: FinchAPI::Client).void } - def initialize(client:) + sig { params(client: FinchAPI::Client).returns(T.attached_class) } + def self.new(client:) end end end diff --git a/rbi/lib/finch-api/resources/sandbox/payment.rbi b/rbi/lib/finch-api/resources/sandbox/payment.rbi index 9cca17f8..e9f1e1be 100644 --- a/rbi/lib/finch-api/resources/sandbox/payment.rbi +++ b/rbi/lib/finch-api/resources/sandbox/payment.rbi @@ -4,20 +4,21 @@ module FinchAPI module Resources class Sandbox class Payment + # Add a new sandbox payment sig do params( end_date: String, - pay_statements: T::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement], + pay_statements: T::Array[T.any(FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement, FinchAPI::Util::AnyHash)], start_date: String, - request_options: T.nilable(T.any(FinchAPI::RequestOptions, T::Hash[Symbol, T.anything])) + request_options: T.nilable(T.any(FinchAPI::RequestOptions, FinchAPI::Util::AnyHash)) ) .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:) + sig { params(client: FinchAPI::Client).returns(T.attached_class) } + def self.new(client:) end end end diff --git a/rbi/lib/finch-api/resources/webhooks.rbi b/rbi/lib/finch-api/resources/webhooks.rbi index ea96b9fa..f2ba07c8 100644 --- a/rbi/lib/finch-api/resources/webhooks.rbi +++ b/rbi/lib/finch-api/resources/webhooks.rbi @@ -3,8 +3,8 @@ module FinchAPI module Resources class Webhooks - sig { params(client: FinchAPI::Client).void } - def initialize(client:) + sig { params(client: FinchAPI::Client).returns(T.attached_class) } + def self.new(client:) end end end diff --git a/rbi/lib/finch-api/responses_page.rbi b/rbi/lib/finch-api/responses_page.rbi index a2d3aefe..e30b83c1 100644 --- a/rbi/lib/finch-api/responses_page.rbi +++ b/rbi/lib/finch-api/responses_page.rbi @@ -6,24 +6,11 @@ module FinchAPI Elem = type_member - sig { returns(T::Array[Elem]) } - def responses - end - - sig { params(_: T::Array[Elem]).returns(T::Array[Elem]) } - def responses=(_) - end + sig { returns(T.nilable(T::Array[Elem])) } + attr_accessor :responses - 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:) + sig { returns(String) } + def inspect end end end diff --git a/rbi/lib/finch-api/single_page.rbi b/rbi/lib/finch-api/single_page.rbi index 25050792..cc98a43f 100644 --- a/rbi/lib/finch-api/single_page.rbi +++ b/rbi/lib/finch-api/single_page.rbi @@ -6,18 +6,6 @@ module FinchAPI 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 @@ -29,5 +17,9 @@ module FinchAPI sig { override.params(blk: T.proc.params(arg0: Elem).void).void } def auto_paging_each(&blk) end + + sig { returns(String) } + def inspect + end end end diff --git a/rbi/lib/finch-api/util.rbi b/rbi/lib/finch-api/util.rbi index ccc5b64c..e005e5d8 100644 --- a/rbi/lib/finch-api/util.rbi +++ b/rbi/lib/finch-api/util.rbi @@ -1,167 +1,280 @@ # typed: strong module FinchAPI + # @api private module Util + # Due to the current WIP status of Shapes support in Sorbet, types referencing + # this alias might be refined in the future. + AnyHash = T.type_alias { T::Hash[Symbol, T.anything] } + + # @api private sig { returns(Float) } def self.monotonic_secs end - sig { returns(String) } - def self.arch - end + class << self + # @api private + sig { returns(String) } + def arch + end - sig { returns(String) } - def self.os + # @api private + sig { returns(String) } + def os + end end - sig { params(input: T.anything).returns(T.any(T::Boolean, T.anything)) } - def self.primitive?(input) - end + class << self + # @api private + sig { params(input: T.anything).returns(T::Boolean) } + def primitive?(input) + end - sig { params(input: T.anything).returns(T.any(T::Boolean, T.anything)) } - def self.coerce_boolean(input) - end + # @api private + sig { params(input: T.anything).returns(T.any(T::Boolean, T.anything)) } + def coerce_boolean(input) + end - sig { params(input: T.anything).returns(T.nilable(T::Boolean)) } - def self.coerce_boolean!(input) - end + # @api private + sig { params(input: T.anything).returns(T.nilable(T::Boolean)) } + def coerce_boolean!(input) + end - sig { params(input: T.anything).returns(T.any(Integer, T.anything)) } - def self.coerce_integer(input) - end + # @api private + sig { params(input: T.anything).returns(T.any(Integer, T.anything)) } + def coerce_integer(input) + end - sig { params(input: T.anything).returns(T.any(Float, T.anything)) } - def self.coerce_float(input) - end + # @api private + sig { params(input: T.anything).returns(T.any(Float, T.anything)) } + def 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) + # @api private + sig { params(input: T.anything).returns(T.any(T::Hash[T.anything, T.anything], T.anything)) } + def coerce_hash(input) + 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 = 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 + class << self + # @api private + sig { params(lhs: T.anything, rhs: T.anything, concat: T::Boolean).returns(T.anything) } + private def 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)) + # @api private + # + # Recursively merge one hash with another. If the values at a given key are not + # both hashes, just take the new value. + sig do + params(values: T::Array[T.anything], sentinel: T.nilable(T.anything), concat: T::Boolean) + .returns(T.anything) + end + def deep_merge( + *values, + # the value to return if no values are provided. + sentinel: nil, + # whether to merge sequences by concatenation. + concat: false ) - .returns(T.nilable(T.anything)) - end - def self.dig(data, pick, sentinel = nil, &blk) - end + end - sig { params(uri: URI::Generic).returns(String) } - def self.uri_origin(uri) + # @api private + sig do + params( + data: T.any(FinchAPI::Util::AnyHash, 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 dig(data, pick, sentinel = nil, &blk) + end end - sig { params(path: T.any(String, T::Array[String])).returns(String) } - def self.interpolate_path(path) - end + class << self + # @api private + sig { params(uri: URI::Generic).returns(String) } + def uri_origin(uri) + end - sig { params(query: T.nilable(String)).returns(T::Hash[String, T::Array[String]]) } - def self.decode_query(query) + # @api private + sig { params(path: T.any(String, T::Array[String])).returns(String) } + def interpolate_path(path) + end 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 + class << self + # @api private + sig { params(query: T.nilable(String)).returns(T::Hash[String, T::Array[String]]) } + def decode_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]] - } + # @api private + sig do + params(query: T.nilable(T::Hash[String, T.nilable(T.any(T::Array[String], String))])) + .returns(T.nilable(String)) + end + def encode_query(query) + end end - sig { params(url: T.any(URI::Generic, String)).returns(FinchAPI::Util::ParsedUriShape) } - def self.parse_uri(url) - 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(parsed: FinchAPI::Util::ParsedUriShape).returns(URI::Generic) } - def self.unparse_uri(parsed) - end + class << self + # @api private + sig { params(url: T.any(URI::Generic, String)).returns(FinchAPI::Util::ParsedUriShape) } + def parse_uri(url) + end - sig do - params(lhs: FinchAPI::Util::ParsedUriShape, rhs: FinchAPI::Util::ParsedUriShape).returns(URI::Generic) - end - def self.join_parsed_uri(lhs, rhs) - end + # @api private + sig { params(parsed: FinchAPI::Util::ParsedUriShape).returns(URI::Generic) } + def unparse_uri(parsed) + 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) + # @api private + sig do + params(lhs: FinchAPI::Util::ParsedUriShape, rhs: FinchAPI::Util::ParsedUriShape).returns(URI::Generic) + end + def join_parsed_uri(lhs, rhs) + end 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:) + class << self + # @api private + 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 normalized_headers(*headers) + end end - sig { params(headers: T::Hash[String, String], body: T.anything).returns(T.anything) } - def self.encode_content(headers, body) - end + # @api private + # + # An adapter that satisfies the IO interface required by `::IO.copy_stream` + class ReadIOAdapter + # @api private + sig { params(max_len: T.nilable(Integer)).returns(String) } + private def read_enum(max_len) + 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 + # @api private + sig { params(max_len: T.nilable(Integer), out_string: T.nilable(String)).returns(T.nilable(String)) } + def read(max_len = nil, out_string = nil) + end - sig { params(enum: T::Enumerable[T.anything], close: T.proc.void).returns(T::Enumerable[T.anything]) } - def self.fused_enum(enum, &close) + # @api private + sig do + params( + stream: T.any(String, IO, StringIO, T::Enumerable[String]), + blk: T.proc.params(arg0: String).void + ) + .returns(T.attached_class) + end + def self.new(stream, &blk) + end end - sig { params(enum: T.nilable(T::Enumerable[T.anything])).void } - def self.close_fused!(enum) + class << self + sig { params(blk: T.proc.params(y: Enumerator::Yielder).void).returns(T::Enumerable[String]) } + def string_io(&blk) + end 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 + class << self + # @api private + sig do + params(y: Enumerator::Yielder, boundary: String, key: T.any(Symbol, String), val: T.anything).void + end + private def encode_multipart_formdata(y, boundary:, key:, val:) + end + + # @api private + sig { params(body: T.anything).returns([String, T::Enumerable[String]]) } + private def encode_multipart_streaming(body) + end + + # @api private + sig { params(headers: T::Hash[String, String], body: T.anything).returns(T.anything) } + def encode_content(headers, body) + end - SSEMessage = T.type_alias do - {event: T.nilable(String), data: T.nilable(String), id: T.nilable(String), retry: T.nilable(Integer)} + # @api private + 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 decode_content(headers, stream:, suppress_error: false) + end end - sig { params(enum: T::Enumerable[String]).returns(T::Enumerable[String]) } - def self.enum_lines(enum) + class << self + # @api private + # + # https://doc.rust-lang.org/std/iter/trait.FusedIterator.html + sig do + params(enum: T::Enumerable[T.anything], external: T::Boolean, close: T.proc.void) + .returns(T::Enumerable[T.anything]) + end + def fused_enum(enum, external: false, &close) + end + + # @api private + sig { params(enum: T.nilable(T::Enumerable[T.anything])).void } + def close_fused!(enum) + end + + # @api private + sig do + params(enum: T.nilable(T::Enumerable[T.anything]), blk: T.proc.params(arg0: Enumerator::Yielder).void) + .returns(T::Enumerable[T.anything]) + end + def chain_fused(enum, &blk) + end end - sig { params(lines: T::Enumerable[String]).returns(FinchAPI::Util::SSEMessage) } - def self.parse_sse(lines) + ServerSentEvent = + T.type_alias do + {event: T.nilable(String), data: T.nilable(String), id: T.nilable(String), retry: T.nilable(Integer)} + end + + class << self + # @api private + sig { params(enum: T::Enumerable[String]).returns(T::Enumerable[String]) } + def decode_lines(enum) + end + + # @api private + # + # https://html.spec.whatwg.org/multipage/server-sent-events.html#parsing-an-event-stream + sig { params(lines: T::Enumerable[String]).returns(FinchAPI::Util::ServerSentEvent) } + def decode_sse(lines) + end end end end diff --git a/rbi/lib/finch-api/version.rbi b/rbi/lib/finch-api/version.rbi index 772681c6..1a41f4f1 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.1.0-alpha.1" + VERSION = "0.1.0-alpha.2" end diff --git a/scripts/bootstrap b/scripts/bootstrap index 0b65ccb0..88566757 100755 --- a/scripts/bootstrap +++ b/scripts/bootstrap @@ -4,7 +4,7 @@ set -e cd "$(dirname "$0")/.." -if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then +if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ]; then brew bundle check >/dev/null 2>&1 || { echo "==> Installing Homebrew dependencies…" brew bundle diff --git a/sig/finch-api/base_client.rbs b/sig/finch-api/base_client.rbs index f6581c39..d63a83c0 100644 --- a/sig/finch-api/base_client.rbs +++ b/sig/finch-api/base_client.rbs @@ -43,19 +43,24 @@ module FinchAPI response_headers: ::Hash[String, String] ) -> FinchAPI::BaseClient::request_input - # @private + def self.reap_connection!: ( + Integer | FinchAPI::APIConnectionError status, + stream: Enumerable[String]? + ) -> void + + # @api 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 + ?timeout: Float, + ?max_retries: Integer, + ?initial_retry_delay: Float, + ?max_retry_delay: Float, + ?headers: ::Hash[String, (String | Integer | ::Array[(String | Integer)?])?], - idempotency_header: String? + ?idempotency_header: String? ) -> void private def auth_headers: -> ::Hash[String, String] @@ -83,16 +88,16 @@ module FinchAPI ( Symbol method, String | ::Array[String] path, - query: ::Hash[String, (::Array[String] | String)?]?, - headers: ::Hash[String, (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? + ?body: top?, + ?unwrap: Symbol?, + ?page: Class?, + ?stream: Class?, + ?model: FinchAPI::Converter::input?, + ?options: FinchAPI::request_opts? ) -> top | (FinchAPI::BaseClient::request_components req) -> top diff --git a/sig/finch-api/base_model.rbs b/sig/finch-api/base_model.rbs index a535259c..1844dafe 100644 --- a/sig/finch-api/base_model.rbs +++ b/sig/finch-api/base_model.rbs @@ -62,32 +62,34 @@ module FinchAPI ) -> ([true, top, nil] | [false, bool, Integer]) end - class Enum - extend FinchAPI::Converter + module Enum + include FinchAPI::Converter def self.values: -> ::Array[(nil | bool | Integer | Float | Symbol)] private def self.finalize!: -> void - def self.===: (top other) -> bool + def ===: (top other) -> bool - def self.==: (top other) -> bool + def ==: (top other) -> bool - def self.coerce: (String | Symbol | top value) -> (Symbol | top) + def coerce: (String | Symbol | top value) -> (Symbol | top) - def self.dump: (Symbol | top value) -> (Symbol | top) + def dump: (Symbol | top value) -> (Symbol | top) - def self.try_strict_coerce: ( + def try_strict_coerce: ( top value ) -> ([true, top, nil] | [false, bool, Integer]) end - class Union - extend FinchAPI::Converter + module Union + include FinchAPI::Converter - private def self.known_variants: -> ::Array[[Symbol?, Proc]] + private def self.known_variants: -> ::Array[[Symbol?, (^-> FinchAPI::Converter::input)]] - def self.variants: -> ::Array[[Symbol?, top]] + def self.derefed_variants: -> ::Array[[Symbol?, top]] + + def self.variants: -> ::Array[top] private def self.discriminator: (Symbol property) -> void @@ -103,15 +105,15 @@ module FinchAPI private def self.resolve_variant: (top value) -> FinchAPI::Converter::input? - def self.===: (top other) -> bool + def ===: (top other) -> bool - def self.==: (top other) -> bool + def ==: (top other) -> bool - def self.coerce: (top value) -> top + def coerce: (top value) -> top - def self.dump: (top value) -> top + def dump: (top value) -> top - def self.try_strict_coerce: ( + def try_strict_coerce: ( top value ) -> ([true, top, nil] | [false, bool, Integer]) end @@ -119,6 +121,13 @@ module FinchAPI class ArrayOf include FinchAPI::Converter + def self.[]: ( + ::Hash[Symbol, top] + | ^-> FinchAPI::Converter::input + | FinchAPI::Converter::input type_info, + ?::Hash[Symbol, top] spec + ) -> instance + def ===: (top other) -> bool def ==: (top other) -> bool @@ -131,7 +140,7 @@ module FinchAPI top value ) -> ([true, top, nil] | [false, bool, Integer]) - def item_type: -> FinchAPI::Converter::input + def item_type: -> top def initialize: ( ::Hash[Symbol, top] @@ -144,6 +153,13 @@ module FinchAPI class HashOf include FinchAPI::Converter + def self.[]: ( + ::Hash[Symbol, top] + | ^-> FinchAPI::Converter::input + | FinchAPI::Converter::input type_info, + ?::Hash[Symbol, top] spec + ) -> instance + def ===: (top other) -> bool def ==: (top other) -> bool @@ -156,7 +172,7 @@ module FinchAPI top value ) -> ([true, top, nil] | [false, bool, Integer]) - def item_type: -> FinchAPI::Converter::input + def item_type: -> top def initialize: ( ::Hash[Symbol, top] @@ -174,6 +190,8 @@ module FinchAPI def self.known_fields: -> ::Hash[Symbol, (FinchAPI::BaseModel::known_field & { type_fn: (^-> FinchAPI::Converter::input) })] + def self.reverse_map: -> ::Hash[Symbol, Symbol] + def self.fields: -> ::Hash[Symbol, (FinchAPI::BaseModel::known_field & { type: FinchAPI::Converter::input })] diff --git a/sig/finch-api/base_page.rbs b/sig/finch-api/base_page.rbs index 1ba129aa..091a57cd 100644 --- a/sig/finch-api/base_page.rbs +++ b/sig/finch-api/base_page.rbs @@ -14,7 +14,7 @@ module FinchAPI client: FinchAPI::BaseClient, req: FinchAPI::BaseClient::request_components, headers: ::Hash[String, String], - unwrapped: top + page_data: top ) -> void end end diff --git a/sig/finch-api/client.rbs b/sig/finch-api/client.rbs index 48cde6a1..cb5dfcfe 100644 --- a/sig/finch-api/client.rbs +++ b/sig/finch-api/client.rbs @@ -41,14 +41,14 @@ module FinchAPI 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 + ?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 index 933a0b2d..41e363d8 100644 --- a/sig/finch-api/errors.rbs +++ b/sig/finch-api/errors.rbs @@ -1,47 +1,47 @@ module FinchAPI class Error < StandardError - attr_reader cause: StandardError? + attr_accessor cause: StandardError? end class ConversionError < FinchAPI::Error end class APIError < FinchAPI::Error - attr_reader url: URI::Generic + attr_accessor url: URI::Generic - attr_reader status: Integer? + attr_accessor status: Integer? - attr_reader body: top? + attr_accessor body: top? def initialize: ( url: URI::Generic, - status: Integer?, - body: Object?, - request: nil, - response: nil, - message: String? + ?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? + ?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? + ?status: nil, + ?body: nil, + ?request: nil, + ?response: nil, + ?message: String? ) -> void end @@ -52,7 +52,7 @@ module FinchAPI body: Object?, request: nil, response: nil, - message: String? + ?message: String? ) -> instance def initialize: ( @@ -61,7 +61,7 @@ module FinchAPI body: Object?, request: nil, response: nil, - message: String? + ?message: String? ) -> void end diff --git a/sig/finch-api/individuals_page.rbs b/sig/finch-api/individuals_page.rbs index c9e6da1e..410416e8 100644 --- a/sig/finch-api/individuals_page.rbs +++ b/sig/finch-api/individuals_page.rbs @@ -2,15 +2,10 @@ module FinchAPI class IndividualsPage[Elem] include FinchAPI::BasePage[Elem] - attr_accessor individuals: ::Array[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 + def inspect: -> String end end diff --git a/sig/finch-api/models/access_token_create_params.rbs b/sig/finch-api/models/access_token_create_params.rbs index 8a2d5ac9..429c58fa 100644 --- a/sig/finch-api/models/access_token_create_params.rbs +++ b/sig/finch-api/models/access_token_create_params.rbs @@ -27,18 +27,13 @@ module FinchAPI 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 initialize: ( + code: String, + ?client_id: String, + ?client_secret: String, + ?redirect_uri: String, + ?request_options: FinchAPI::request_opts + ) -> void def to_hash: -> FinchAPI::Models::access_token_create_params end diff --git a/sig/finch-api/models/account_disconnect_params.rbs b/sig/finch-api/models/account_disconnect_params.rbs index 58661542..a0ef5609 100644 --- a/sig/finch-api/models/account_disconnect_params.rbs +++ b/sig/finch-api/models/account_disconnect_params.rbs @@ -6,12 +6,7 @@ module FinchAPI 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 initialize: (?request_options: FinchAPI::request_opts) -> void def to_hash: -> FinchAPI::Models::account_disconnect_params end diff --git a/sig/finch-api/models/account_introspect_params.rbs b/sig/finch-api/models/account_introspect_params.rbs index 278c1428..2068708e 100644 --- a/sig/finch-api/models/account_introspect_params.rbs +++ b/sig/finch-api/models/account_introspect_params.rbs @@ -6,12 +6,7 @@ module FinchAPI 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 initialize: (?request_options: FinchAPI::request_opts) -> void def to_hash: -> FinchAPI::Models::account_introspect_params end diff --git a/sig/finch-api/models/account_update_event.rbs b/sig/finch-api/models/account_update_event.rbs index 9e10be9e..383bffef 100644 --- a/sig/finch-api/models/account_update_event.rbs +++ b/sig/finch-api/models/account_update_event.rbs @@ -7,26 +7,22 @@ module FinchAPI } class AccountUpdateEvent < FinchAPI::Models::BaseWebhookEvent - attr_reader data: FinchAPI::Models::AccountUpdateEvent::Data? + def data: -> FinchAPI::Models::AccountUpdateEvent::Data? def data=: ( - FinchAPI::Models::AccountUpdateEvent::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? def event_type=: ( - FinchAPI::Models::AccountUpdateEvent::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 initialize: ( + ?data: FinchAPI::Models::AccountUpdateEvent::Data, + ?event_type: FinchAPI::Models::AccountUpdateEvent::event_type + ) -> void def to_hash: -> FinchAPI::Models::account_update_event @@ -41,15 +37,10 @@ module FinchAPI 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 initialize: ( + authentication_method: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod, + status: FinchAPI::Models::connection_status_type + ) -> void def to_hash: -> FinchAPI::Models::AccountUpdateEvent::data @@ -71,16 +62,11 @@ module FinchAPI 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 initialize: ( + ?benefits_support: FinchAPI::Models::HRIS::BenefitsSupport?, + ?supported_fields: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields?, + ?type: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::type_ + ) -> void def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::authentication_method @@ -138,20 +124,15 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::supported_fields @@ -213,22 +194,17 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::company @@ -262,18 +238,13 @@ module FinchAPI 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 initialize: ( + ?account_name: bool, + ?account_number: bool, + ?account_type: bool, + ?institution_name: bool, + ?routing_number: bool + ) -> void def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::accounts end @@ -295,15 +266,10 @@ module FinchAPI 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 initialize: ( + ?name: bool, + ?parent: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments::Parent + ) -> void def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::departments @@ -314,12 +280,7 @@ module FinchAPI def name=: (bool) -> bool - def initialize: - (name: bool) -> void - | ( - ?FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments::parent - | FinchAPI::BaseModel data - ) -> void + def initialize: (?name: bool) -> void def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::Departments::parent end @@ -336,12 +297,7 @@ module FinchAPI def type=: (bool) -> bool - def initialize: - (subtype: bool, type: bool) -> void - | ( - ?FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::entity - | FinchAPI::BaseModel data - ) -> void + def initialize: (?subtype: bool, ?type: bool) -> void def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::entity end @@ -381,19 +337,14 @@ module FinchAPI 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 initialize: ( + ?city: bool, + ?country: bool, + ?line1: bool, + ?line2: bool, + ?postal_code: bool, + ?state: bool + ) -> void def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Company::locations end @@ -418,15 +369,10 @@ module FinchAPI 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 initialize: ( + ?individuals: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals, + ?paging: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Paging + ) -> void def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::directory @@ -472,20 +418,15 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::individuals @@ -496,12 +437,7 @@ module FinchAPI def id=: (bool) -> bool - def initialize: - (id: bool) -> void - | ( - ?FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals::manager - | FinchAPI::BaseModel data - ) -> void + def initialize: (?id: bool) -> void def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::Individuals::manager end @@ -518,12 +454,7 @@ module FinchAPI def offset=: (bool) -> bool - def initialize: - (count: bool, offset: bool) -> void - | ( - ?FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::paging - | FinchAPI::BaseModel data - ) -> void + def initialize: (?count: bool, ?offset: bool) -> void def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Directory::paging end @@ -629,30 +560,25 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::employment @@ -663,12 +589,7 @@ module FinchAPI def name=: (bool) -> bool - def initialize: - (name: bool) -> void - | ( - ?FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::department - | FinchAPI::BaseModel data - ) -> void + def initialize: (?name: bool) -> void def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::department end @@ -684,12 +605,7 @@ module FinchAPI def type=: (bool) -> bool - def initialize: - (subtype: bool, type: bool) -> void - | ( - ?FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::employment - | FinchAPI::BaseModel data - ) -> void + def initialize: (?subtype: bool, ?type: bool) -> void def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::employment end @@ -709,12 +625,11 @@ module FinchAPI 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 initialize: ( + ?amount: bool, + ?currency: bool, + ?unit: bool + ) -> void def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::income end @@ -754,19 +669,14 @@ module FinchAPI 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 initialize: ( + ?city: bool, + ?country: bool, + ?line1: bool, + ?line2: bool, + ?postal_code: bool, + ?state: bool + ) -> void def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::location end @@ -778,12 +688,7 @@ module FinchAPI def id=: (bool) -> bool - def initialize: - (id: bool) -> void - | ( - ?FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::manager - | FinchAPI::BaseModel data - ) -> void + def initialize: (?id: bool) -> void def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Employment::manager end @@ -865,26 +770,21 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::individual @@ -899,12 +799,7 @@ module FinchAPI def type=: (bool) -> bool - def initialize: - (data: bool, type: bool) -> void - | ( - ?FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::emails - | FinchAPI::BaseModel data - ) -> void + def initialize: (?data: bool, ?type: bool) -> void def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::emails end @@ -920,12 +815,7 @@ module FinchAPI 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 initialize: (?data: bool, ?type: bool) -> void def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::phone_numbers end @@ -965,19 +855,14 @@ module FinchAPI 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 initialize: ( + ?city: bool, + ?country: bool, + ?line1: bool, + ?line2: bool, + ?postal_code: bool, + ?state: bool + ) -> void def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Individual::residence end @@ -1008,17 +893,12 @@ module FinchAPI 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 initialize: ( + ?id: bool, + ?individual_ids: bool, + ?name: bool, + ?pay_frequencies: bool + ) -> void def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::pay_group end @@ -1042,15 +922,10 @@ module FinchAPI 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 initialize: ( + ?paging: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::Paging, + ?pay_statements: FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements + ) -> void def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::pay_statement @@ -1061,12 +936,7 @@ module FinchAPI attr_accessor offset: bool - def initialize: - (count: bool, offset: bool) -> void - | ( - ?FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::paging - | FinchAPI::BaseModel data - ) -> void + def initialize: (count: bool, offset: bool) -> void def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::paging end @@ -1134,23 +1004,18 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::pay_statements @@ -1174,17 +1039,12 @@ module FinchAPI 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 initialize: ( + ?amount: bool, + ?currency: bool, + ?name: bool, + ?type: bool + ) -> void def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::earnings end @@ -1219,18 +1079,13 @@ module FinchAPI 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 initialize: ( + ?amount: bool, + ?currency: bool, + ?name: bool, + ?pre_tax: bool, + ?type: bool + ) -> void def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::employee_deductions end @@ -1251,12 +1106,11 @@ module FinchAPI 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 initialize: ( + ?amount: bool, + ?currency: bool, + ?name: bool + ) -> void def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::employer_contributions end @@ -1291,18 +1145,13 @@ module FinchAPI 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 initialize: ( + ?amount: bool, + ?currency: bool, + ?employer: bool, + ?name: bool, + ?type: bool + ) -> void def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::taxes end @@ -1376,25 +1225,20 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::payment @@ -1409,12 +1253,7 @@ module FinchAPI 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 initialize: (?end_date: bool, ?start_date: bool) -> void def to_hash: -> FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::SupportedFields::Payment::pay_period end @@ -1424,24 +1263,28 @@ module FinchAPI type type_ = :assisted | :credential | :api_token | :api_credential | :oauth - class Type < FinchAPI::Enum + module Type + extend 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_] + def self?.values: -> ::Array[FinchAPI::Models::AccountUpdateEvent::Data::AuthenticationMethod::type_] end end end type event_type = :"account.updated" - class EventType < FinchAPI::Enum + module EventType + extend FinchAPI::Enum + ACCOUNT_UPDATED: :"account.updated" - def self.values: -> ::Array[FinchAPI::Models::AccountUpdateEvent::event_type] + def self?.values: -> ::Array[FinchAPI::Models::AccountUpdateEvent::event_type] end end end diff --git a/sig/finch-api/models/base_webhook_event.rbs b/sig/finch-api/models/base_webhook_event.rbs index a7d4c2b9..1645bf72 100644 --- a/sig/finch-api/models/base_webhook_event.rbs +++ b/sig/finch-api/models/base_webhook_event.rbs @@ -12,11 +12,11 @@ module FinchAPI 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 initialize: ( + account_id: String, + company_id: String, + ?connection_id: String + ) -> void def to_hash: -> FinchAPI::Models::base_webhook_event end diff --git a/sig/finch-api/models/company_event.rbs b/sig/finch-api/models/company_event.rbs index 508fd63f..21e92e2d 100644 --- a/sig/finch-api/models/company_event.rbs +++ b/sig/finch-api/models/company_event.rbs @@ -7,29 +7,31 @@ module FinchAPI } class CompanyEvent < FinchAPI::Models::BaseWebhookEvent - attr_accessor data: ::Hash[Symbol, top]? + def data: -> ::Hash[Symbol, top]? - attr_reader event_type: FinchAPI::Models::CompanyEvent::event_type? + def data=: (::Hash[Symbol, top]? _) -> ::Hash[Symbol, top]? + + def event_type: -> FinchAPI::Models::CompanyEvent::event_type? def event_type=: ( - FinchAPI::Models::CompanyEvent::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 initialize: ( + ?data: ::Hash[Symbol, top]?, + ?event_type: FinchAPI::Models::CompanyEvent::event_type + ) -> void def to_hash: -> FinchAPI::Models::company_event type event_type = :"company.updated" - class EventType < FinchAPI::Enum + module EventType + extend FinchAPI::Enum + COMPANY_UPDATED: :"company.updated" - def self.values: -> ::Array[FinchAPI::Models::CompanyEvent::event_type] + def self?.values: -> ::Array[FinchAPI::Models::CompanyEvent::event_type] 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 index dc87fe43..e5d31aa1 100644 --- a/sig/finch-api/models/connect/session_new_params.rbs +++ b/sig/finch-api/models/connect/session_new_params.rbs @@ -37,23 +37,18 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::Connect::session_new_params @@ -67,7 +62,9 @@ module FinchAPI | :benefits | :ssn - class Product < FinchAPI::Enum + module Product + extend FinchAPI::Enum + COMPANY: :company DIRECTORY: :directory INDIVIDUAL: :individual @@ -77,7 +74,7 @@ module FinchAPI BENEFITS: :benefits SSN: :ssn - def self.values: -> ::Array[FinchAPI::Models::Connect::SessionNewParams::product] + def self?.values: -> ::Array[FinchAPI::Models::Connect::SessionNewParams::product] end type integration = @@ -91,37 +88,36 @@ module FinchAPI 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 initialize: ( + ?auth_method: FinchAPI::Models::Connect::SessionNewParams::Integration::auth_method?, + ?provider: String? + ) -> void def to_hash: -> FinchAPI::Models::Connect::SessionNewParams::integration type auth_method = :assisted | :credential | :oauth | :api_token - class AuthMethod < FinchAPI::Enum + module AuthMethod + extend FinchAPI::Enum + ASSISTED: :assisted CREDENTIAL: :credential OAUTH: :oauth API_TOKEN: :api_token - def self.values: -> ::Array[FinchAPI::Models::Connect::SessionNewParams::Integration::auth_method] + def self?.values: -> ::Array[FinchAPI::Models::Connect::SessionNewParams::Integration::auth_method] end end type sandbox = :finch | :provider - class Sandbox < FinchAPI::Enum + module Sandbox + extend FinchAPI::Enum + FINCH: :finch PROVIDER: :provider - def self.values: -> ::Array[FinchAPI::Models::Connect::SessionNewParams::sandbox] + def self?.values: -> ::Array[FinchAPI::Models::Connect::SessionNewParams::sandbox] 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 index fe604178..cf174be8 100644 --- a/sig/finch-api/models/connect/session_new_response.rbs +++ b/sig/finch-api/models/connect/session_new_response.rbs @@ -8,12 +8,7 @@ module FinchAPI 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 initialize: (connect_url: String, session_id: String) -> void def to_hash: -> FinchAPI::Models::Connect::session_new_response end diff --git a/sig/finch-api/models/connect/session_reauthenticate_params.rbs b/sig/finch-api/models/connect/session_reauthenticate_params.rbs index bedefb51..33d3d200 100644 --- a/sig/finch-api/models/connect/session_reauthenticate_params.rbs +++ b/sig/finch-api/models/connect/session_reauthenticate_params.rbs @@ -22,18 +22,13 @@ module FinchAPI 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 initialize: ( + connection_id: String, + ?minutes_to_expire: Integer?, + ?products: ::Array[FinchAPI::Models::Connect::SessionReauthenticateParams::product]?, + ?redirect_uri: String?, + ?request_options: FinchAPI::request_opts + ) -> void def to_hash: -> FinchAPI::Models::Connect::session_reauthenticate_params @@ -47,7 +42,9 @@ module FinchAPI | :benefits | :ssn - class Product < FinchAPI::Enum + module Product + extend FinchAPI::Enum + COMPANY: :company DIRECTORY: :directory INDIVIDUAL: :individual @@ -57,7 +54,7 @@ module FinchAPI BENEFITS: :benefits SSN: :ssn - def self.values: -> ::Array[FinchAPI::Models::Connect::SessionReauthenticateParams::product] + def self?.values: -> ::Array[FinchAPI::Models::Connect::SessionReauthenticateParams::product] 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 index dc1c9b89..2c9ccee7 100644 --- a/sig/finch-api/models/connect/session_reauthenticate_response.rbs +++ b/sig/finch-api/models/connect/session_reauthenticate_response.rbs @@ -9,12 +9,7 @@ module FinchAPI 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 initialize: (connect_url: String, session_id: String) -> void def to_hash: -> FinchAPI::Models::Connect::session_reauthenticate_response end diff --git a/sig/finch-api/models/connection_status_type.rbs b/sig/finch-api/models/connection_status_type.rbs index 61e10a78..3116a419 100644 --- a/sig/finch-api/models/connection_status_type.rbs +++ b/sig/finch-api/models/connection_status_type.rbs @@ -8,7 +8,9 @@ module FinchAPI | :error_permissions | :reauth - class ConnectionStatusType < FinchAPI::Enum + module ConnectionStatusType + extend FinchAPI::Enum + PENDING: :pending PROCESSING: :processing CONNECTED: :connected @@ -16,7 +18,7 @@ module FinchAPI ERROR_PERMISSIONS: :error_permissions REAUTH: :reauth - def self.values: -> ::Array[FinchAPI::Models::connection_status_type] + 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 index d35b63b9..affd7a36 100644 --- a/sig/finch-api/models/create_access_token_response.rbs +++ b/sig/finch-api/models/create_access_token_response.rbs @@ -37,43 +37,42 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::create_access_token_response type client_type = :production | :development | :sandbox - class ClientType < FinchAPI::Enum + module ClientType + extend FinchAPI::Enum + PRODUCTION: :production DEVELOPMENT: :development SANDBOX: :sandbox - def self.values: -> ::Array[FinchAPI::Models::CreateAccessTokenResponse::client_type] + def self?.values: -> ::Array[FinchAPI::Models::CreateAccessTokenResponse::client_type] end type connection_type = :provider | :finch - class ConnectionType < FinchAPI::Enum + module ConnectionType + extend FinchAPI::Enum + PROVIDER: :provider FINCH: :finch - def self.values: -> ::Array[FinchAPI::Models::CreateAccessTokenResponse::connection_type] + def self?.values: -> ::Array[FinchAPI::Models::CreateAccessTokenResponse::connection_type] end end end diff --git a/sig/finch-api/models/directory_event.rbs b/sig/finch-api/models/directory_event.rbs index 47f64336..8abf30fc 100644 --- a/sig/finch-api/models/directory_event.rbs +++ b/sig/finch-api/models/directory_event.rbs @@ -7,26 +7,22 @@ module FinchAPI } class DirectoryEvent < FinchAPI::Models::BaseWebhookEvent - attr_reader data: FinchAPI::Models::DirectoryEvent::Data? + def data: -> FinchAPI::Models::DirectoryEvent::Data? def data=: ( - FinchAPI::Models::DirectoryEvent::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? def event_type=: ( - FinchAPI::Models::DirectoryEvent::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 initialize: ( + ?data: FinchAPI::Models::DirectoryEvent::Data, + ?event_type: FinchAPI::Models::DirectoryEvent::event_type + ) -> void def to_hash: -> FinchAPI::Models::directory_event @@ -37,11 +33,7 @@ module FinchAPI def individual_id=: (String) -> String - def initialize: - (individual_id: String) -> void - | ( - ?FinchAPI::Models::DirectoryEvent::data | FinchAPI::BaseModel data - ) -> void + def initialize: (?individual_id: String) -> void def to_hash: -> FinchAPI::Models::DirectoryEvent::data end @@ -49,12 +41,14 @@ module FinchAPI type event_type = :"directory.created" | :"directory.updated" | :"directory.deleted" - class EventType < FinchAPI::Enum + module EventType + extend FinchAPI::Enum + DIRECTORY_CREATED: :"directory.created" DIRECTORY_UPDATED: :"directory.updated" DIRECTORY_DELETED: :"directory.deleted" - def self.values: -> ::Array[FinchAPI::Models::DirectoryEvent::event_type] + def self?.values: -> ::Array[FinchAPI::Models::DirectoryEvent::event_type] end end end diff --git a/sig/finch-api/models/disconnect_response.rbs b/sig/finch-api/models/disconnect_response.rbs index c91409c7..41ded8a0 100644 --- a/sig/finch-api/models/disconnect_response.rbs +++ b/sig/finch-api/models/disconnect_response.rbs @@ -5,11 +5,7 @@ module FinchAPI class DisconnectResponse < FinchAPI::BaseModel attr_accessor status: String - def initialize: - (status: String) -> void - | ( - ?FinchAPI::Models::disconnect_response | FinchAPI::BaseModel data - ) -> void + def initialize: (status: String) -> void def to_hash: -> FinchAPI::Models::disconnect_response end diff --git a/sig/finch-api/models/employment_event.rbs b/sig/finch-api/models/employment_event.rbs index 5417368d..70ac8f5d 100644 --- a/sig/finch-api/models/employment_event.rbs +++ b/sig/finch-api/models/employment_event.rbs @@ -7,26 +7,22 @@ module FinchAPI } class EmploymentEvent < FinchAPI::Models::BaseWebhookEvent - attr_reader data: FinchAPI::Models::EmploymentEvent::Data? + def data: -> FinchAPI::Models::EmploymentEvent::Data? def data=: ( - FinchAPI::Models::EmploymentEvent::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? def event_type=: ( - FinchAPI::Models::EmploymentEvent::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 initialize: ( + ?data: FinchAPI::Models::EmploymentEvent::Data, + ?event_type: FinchAPI::Models::EmploymentEvent::event_type + ) -> void def to_hash: -> FinchAPI::Models::employment_event @@ -37,11 +33,7 @@ module FinchAPI def individual_id=: (String) -> String - def initialize: - (individual_id: String) -> void - | ( - ?FinchAPI::Models::EmploymentEvent::data | FinchAPI::BaseModel data - ) -> void + def initialize: (?individual_id: String) -> void def to_hash: -> FinchAPI::Models::EmploymentEvent::data end @@ -49,12 +41,14 @@ module FinchAPI type event_type = :"employment.created" | :"employment.updated" | :"employment.deleted" - class EventType < FinchAPI::Enum + module EventType + extend FinchAPI::Enum + EMPLOYMENT_CREATED: :"employment.created" EMPLOYMENT_UPDATED: :"employment.updated" EMPLOYMENT_DELETED: :"employment.deleted" - def self.values: -> ::Array[FinchAPI::Models::EmploymentEvent::event_type] + def self?.values: -> ::Array[FinchAPI::Models::EmploymentEvent::event_type] end end end diff --git a/sig/finch-api/models/hris/benefit_contribution.rbs b/sig/finch-api/models/hris/benefit_contribution.rbs index e1a06a2e..2ef78933 100644 --- a/sig/finch-api/models/hris/benefit_contribution.rbs +++ b/sig/finch-api/models/hris/benefit_contribution.rbs @@ -12,25 +12,22 @@ module FinchAPI 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 initialize: ( + ?amount: Integer?, + ?type: FinchAPI::Models::HRIS::BenefitContribution::type_? + ) -> void def to_hash: -> FinchAPI::Models::HRIS::benefit_contribution type type_ = :fixed | :percent - class Type < FinchAPI::Enum + module Type + extend FinchAPI::Enum + FIXED: :fixed PERCENT: :percent - def self.values: -> ::Array[FinchAPI::Models::HRIS::BenefitContribution::type_] + def self?.values: -> ::Array[FinchAPI::Models::HRIS::BenefitContribution::type_] 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 index eb2e7630..1408032f 100644 --- a/sig/finch-api/models/hris/benefit_create_params.rbs +++ b/sig/finch-api/models/hris/benefit_create_params.rbs @@ -21,17 +21,12 @@ module FinchAPI 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 initialize: ( + ?description: String, + ?frequency: FinchAPI::Models::HRIS::benefit_frequency?, + ?type: FinchAPI::Models::HRIS::benefit_type?, + ?request_options: FinchAPI::request_opts + ) -> void def to_hash: -> FinchAPI::Models::HRIS::benefit_create_params 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 index 0e4cbf01..4173cfde 100644 --- a/sig/finch-api/models/hris/benefit_features_and_operations.rbs +++ b/sig/finch-api/models/hris/benefit_features_and_operations.rbs @@ -20,15 +20,10 @@ module FinchAPI 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 initialize: ( + ?supported_features: FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures, + ?supported_operations: FinchAPI::Models::HRIS::SupportPerBenefitType + ) -> void def to_hash: -> FinchAPI::Models::HRIS::benefit_features_and_operations @@ -62,48 +57,49 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::supported_features type company_contribution = :fixed | :percent - class CompanyContribution < FinchAPI::Enum + module CompanyContribution + extend FinchAPI::Enum + FIXED: :fixed PERCENT: :percent - def self.values: -> ::Array[FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::company_contribution] + def self?.values: -> ::Array[FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::company_contribution] end type employee_deduction = :fixed | :percent - class EmployeeDeduction < FinchAPI::Enum + module EmployeeDeduction + extend FinchAPI::Enum + FIXED: :fixed PERCENT: :percent - def self.values: -> ::Array[FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::employee_deduction] + def self?.values: -> ::Array[FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::employee_deduction] end type hsa_contribution_limit = :individual | :family - class HsaContributionLimit < FinchAPI::Enum + module HsaContributionLimit + extend FinchAPI::Enum + INDIVIDUAL: :individual FAMILY: :family - def self.values: -> ::Array[FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::hsa_contribution_limit] + def self?.values: -> ::Array[FinchAPI::Models::HRIS::BenefitFeaturesAndOperations::SupportedFeatures::hsa_contribution_limit] end end end diff --git a/sig/finch-api/models/hris/benefit_frequency.rbs b/sig/finch-api/models/hris/benefit_frequency.rbs index 9e9b73df..849ad28c 100644 --- a/sig/finch-api/models/hris/benefit_frequency.rbs +++ b/sig/finch-api/models/hris/benefit_frequency.rbs @@ -3,12 +3,14 @@ module FinchAPI module HRIS type benefit_frequency = :one_time | :every_paycheck | :monthly - class BenefitFrequency < FinchAPI::Enum + module BenefitFrequency + extend FinchAPI::Enum + ONE_TIME: :one_time EVERY_PAYCHECK: :every_paycheck MONTHLY: :monthly - def self.values: -> ::Array[FinchAPI::Models::HRIS::benefit_frequency] + def self?.values: -> ::Array[FinchAPI::Models::HRIS::benefit_frequency] 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 index 1f1704f1..ece372b4 100644 --- a/sig/finch-api/models/hris/benefit_list_params.rbs +++ b/sig/finch-api/models/hris/benefit_list_params.rbs @@ -7,12 +7,7 @@ module FinchAPI 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 initialize: (?request_options: FinchAPI::request_opts) -> void def to_hash: -> FinchAPI::Models::HRIS::benefit_list_params 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 index 7db1f506..d159fa20 100644 --- a/sig/finch-api/models/hris/benefit_list_supported_benefits_params.rbs +++ b/sig/finch-api/models/hris/benefit_list_supported_benefits_params.rbs @@ -8,12 +8,7 @@ module FinchAPI 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 initialize: (?request_options: FinchAPI::request_opts) -> void def to_hash: -> FinchAPI::Models::HRIS::benefit_list_supported_benefits_params end diff --git a/sig/finch-api/models/hris/benefit_retrieve_params.rbs b/sig/finch-api/models/hris/benefit_retrieve_params.rbs index 889acf32..06135267 100644 --- a/sig/finch-api/models/hris/benefit_retrieve_params.rbs +++ b/sig/finch-api/models/hris/benefit_retrieve_params.rbs @@ -7,12 +7,7 @@ module FinchAPI 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 initialize: (?request_options: FinchAPI::request_opts) -> void def to_hash: -> FinchAPI::Models::HRIS::benefit_retrieve_params end diff --git a/sig/finch-api/models/hris/benefit_type.rbs b/sig/finch-api/models/hris/benefit_type.rbs index 4040241c..d3c1d48b 100644 --- a/sig/finch-api/models/hris/benefit_type.rbs +++ b/sig/finch-api/models/hris/benefit_type.rbs @@ -22,7 +22,9 @@ module FinchAPI | :custom_post_tax | :custom_pre_tax - class BenefitType < FinchAPI::Enum + module BenefitType + extend FinchAPI::Enum + NUMBER_401K: :"401k" NUMBER_401K_ROTH: :"401k_roth" NUMBER_401K_LOAN: :"401k_loan" @@ -43,7 +45,7 @@ module FinchAPI CUSTOM_POST_TAX: :custom_post_tax CUSTOM_PRE_TAX: :custom_pre_tax - def self.values: -> ::Array[FinchAPI::Models::HRIS::benefit_type] + def self?.values: -> ::Array[FinchAPI::Models::HRIS::benefit_type] 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 index 5cbc2d80..2061368d 100644 --- a/sig/finch-api/models/hris/benefit_update_params.rbs +++ b/sig/finch-api/models/hris/benefit_update_params.rbs @@ -12,12 +12,10 @@ module FinchAPI 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 initialize: ( + ?description: String, + ?request_options: FinchAPI::request_opts + ) -> void def to_hash: -> FinchAPI::Models::HRIS::benefit_update_params end diff --git a/sig/finch-api/models/hris/benefits/enrolled_individual.rbs b/sig/finch-api/models/hris/benefits/enrolled_individual.rbs index 7c2dcc61..d1656d6c 100644 --- a/sig/finch-api/models/hris/benefits/enrolled_individual.rbs +++ b/sig/finch-api/models/hris/benefits/enrolled_individual.rbs @@ -26,16 +26,11 @@ module FinchAPI 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 initialize: ( + ?body: FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::Body, + ?code: FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::code, + ?individual_id: String + ) -> void def to_hash: -> FinchAPI::Models::HRIS::Benefits::enrolled_individual @@ -48,25 +43,26 @@ module FinchAPI 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 initialize: ( + ?finch_code: String?, + ?message: String?, + ?name: String? + ) -> void def to_hash: -> FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::body end type code = 200 | 201 | 404 | 403 - class Code < FinchAPI::Enum + module Code + extend FinchAPI::Enum + OK: 200 CREATED: 201 NOT_FOUND: 404 FORBIDDEN: 403 - def self.values: -> ::Array[FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::code] + def self?.values: -> ::Array[FinchAPI::Models::HRIS::Benefits::EnrolledIndividual::code] 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 index f2a37288..598e1822 100644 --- a/sig/finch-api/models/hris/benefits/individual_benefit.rbs +++ b/sig/finch-api/models/hris/benefits/individual_benefit.rbs @@ -1,7 +1,6 @@ module FinchAPI module Models module HRIS - class IndividualBenefit = Benefits::IndividualBenefit module Benefits @@ -27,16 +26,11 @@ module FinchAPI 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 initialize: ( + ?body: FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body, + ?code: Integer, + ?individual_id: String + ) -> void def to_hash: -> FinchAPI::Models::HRIS::Benefits::individual_benefit @@ -60,28 +54,25 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::HRIS::Benefits::IndividualBenefit::body type hsa_contribution_limit = :individual | :family - class HsaContributionLimit < FinchAPI::Enum + module HsaContributionLimit + extend FinchAPI::Enum + INDIVIDUAL: :individual FAMILY: :family - def self.values: -> ::Array[FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::hsa_contribution_limit] + def self?.values: -> ::Array[FinchAPI::Models::HRIS::Benefits::IndividualBenefit::Body::hsa_contribution_limit] 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 index a2e16d68..b1c8ac0b 100644 --- a/sig/finch-api/models/hris/benefits/individual_enroll_many_params.rbs +++ b/sig/finch-api/models/hris/benefits/individual_enroll_many_params.rbs @@ -18,15 +18,10 @@ module FinchAPI ::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 initialize: ( + ?individuals: ::Array[FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual], + ?request_options: FinchAPI::request_opts + ) -> void def to_hash: -> FinchAPI::Models::HRIS::Benefits::individual_enroll_many_params @@ -47,15 +42,10 @@ module FinchAPI 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 initialize: ( + ?configuration: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration, + ?individual_id: String + ) -> void def to_hash: -> FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::individual @@ -93,28 +83,25 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::configuration type annual_contribution_limit = :individual | :family - class AnnualContributionLimit < FinchAPI::Enum + module AnnualContributionLimit + extend FinchAPI::Enum + INDIVIDUAL: :individual FAMILY: :family - def self.values: -> ::Array[FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::annual_contribution_limit] + def self?.values: -> ::Array[FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::annual_contribution_limit] end type company_contribution = @@ -134,25 +121,22 @@ module FinchAPI 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 initialize: ( + ?amount: Integer, + ?type: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution::type_ + ) -> void def to_hash: -> FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::company_contribution type type_ = :fixed | :percent - class Type < FinchAPI::Enum + module Type + extend FinchAPI::Enum + FIXED: :fixed PERCENT: :percent - def self.values: -> ::Array[FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution::type_] + def self?.values: -> ::Array[FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::CompanyContribution::type_] end end @@ -173,25 +157,22 @@ module FinchAPI 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 initialize: ( + ?amount: Integer, + ?type: FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction::type_ + ) -> void def to_hash: -> FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::employee_deduction type type_ = :fixed | :percent - class Type < FinchAPI::Enum + module Type + extend FinchAPI::Enum + FIXED: :fixed PERCENT: :percent - def self.values: -> ::Array[FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction::type_] + def self?.values: -> ::Array[FinchAPI::Models::HRIS::Benefits::IndividualEnrollManyParams::Individual::Configuration::EmployeeDeduction::type_] 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 index d75239d2..2eab6aaa 100644 --- a/sig/finch-api/models/hris/benefits/individual_enrolled_ids_params.rbs +++ b/sig/finch-api/models/hris/benefits/individual_enrolled_ids_params.rbs @@ -9,12 +9,7 @@ module FinchAPI 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 initialize: (?request_options: FinchAPI::request_opts) -> void def to_hash: -> FinchAPI::Models::HRIS::Benefits::individual_enrolled_ids_params 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 index d0a223a4..7e6fd361 100644 --- a/sig/finch-api/models/hris/benefits/individual_enrolled_ids_response.rbs +++ b/sig/finch-api/models/hris/benefits/individual_enrolled_ids_response.rbs @@ -10,12 +10,10 @@ module FinchAPI 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 initialize: ( + benefit_id: String, + individual_ids: ::Array[String] + ) -> void def to_hash: -> FinchAPI::Models::HRIS::Benefits::individual_enrolled_ids_response 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 index 72be7af0..108977cb 100644 --- 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 @@ -13,15 +13,10 @@ module FinchAPI 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 initialize: ( + ?individual_ids: String, + ?request_options: FinchAPI::request_opts + ) -> void def to_hash: -> FinchAPI::Models::HRIS::Benefits::individual_retrieve_many_benefits_params 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 index b4988cc8..fb69c98c 100644 --- a/sig/finch-api/models/hris/benefits/individual_unenroll_many_params.rbs +++ b/sig/finch-api/models/hris/benefits/individual_unenroll_many_params.rbs @@ -13,15 +13,10 @@ module FinchAPI 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 initialize: ( + ?individual_ids: ::Array[String], + ?request_options: FinchAPI::request_opts + ) -> void def to_hash: -> FinchAPI::Models::HRIS::Benefits::individual_unenroll_many_params end diff --git a/sig/finch-api/models/hris/benefits/unenrolled_individual.rbs b/sig/finch-api/models/hris/benefits/unenrolled_individual.rbs index d1edb58b..3d5aed66 100644 --- a/sig/finch-api/models/hris/benefits/unenrolled_individual.rbs +++ b/sig/finch-api/models/hris/benefits/unenrolled_individual.rbs @@ -24,16 +24,11 @@ module FinchAPI 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 initialize: ( + ?body: FinchAPI::Models::HRIS::Benefits::UnenrolledIndividual::Body, + ?code: Integer, + ?individual_id: String + ) -> void def to_hash: -> FinchAPI::Models::HRIS::Benefits::unenrolled_individual @@ -46,12 +41,11 @@ module FinchAPI 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 initialize: ( + ?finch_code: String?, + ?message: String?, + ?name: String? + ) -> void def to_hash: -> FinchAPI::Models::HRIS::Benefits::UnenrolledIndividual::body end diff --git a/sig/finch-api/models/hris/benefits_support.rbs b/sig/finch-api/models/hris/benefits_support.rbs index 8ee7e3e1..3715523e 100644 --- a/sig/finch-api/models/hris/benefits_support.rbs +++ b/sig/finch-api/models/hris/benefits_support.rbs @@ -42,24 +42,20 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::HRIS::benefits_support end diff --git a/sig/finch-api/models/hris/benfit_contribution.rbs b/sig/finch-api/models/hris/benfit_contribution.rbs index 7a2dac1c..429686d0 100644 --- a/sig/finch-api/models/hris/benfit_contribution.rbs +++ b/sig/finch-api/models/hris/benfit_contribution.rbs @@ -1,7 +1,6 @@ module FinchAPI module Models module HRIS - class BenfitContribution = FinchAPI::Models::HRIS::BenefitContribution end end diff --git a/sig/finch-api/models/hris/company.rbs b/sig/finch-api/models/hris/company.rbs index e2a470b9..79f8aa6b 100644 --- a/sig/finch-api/models/hris/company.rbs +++ b/sig/finch-api/models/hris/company.rbs @@ -33,21 +33,17 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::HRIS::hris_company @@ -71,28 +67,25 @@ module FinchAPI 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 initialize: ( + ?account_name: String?, + ?account_number: String?, + ?account_type: FinchAPI::Models::HRIS::HRISCompany::Account::account_type?, + ?institution_name: String?, + ?routing_number: String? + ) -> void def to_hash: -> FinchAPI::Models::HRIS::HRISCompany::account type account_type = :checking | :savings - class AccountType < FinchAPI::Enum + module AccountType + extend FinchAPI::Enum + CHECKING: :checking SAVINGS: :savings - def self.values: -> ::Array[FinchAPI::Models::HRIS::HRISCompany::Account::account_type] + def self?.values: -> ::Array[FinchAPI::Models::HRIS::HRISCompany::Account::account_type] end end @@ -107,15 +100,10 @@ module FinchAPI 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 initialize: ( + ?name: String?, + ?parent: FinchAPI::Models::HRIS::HRISCompany::Department::Parent? + ) -> void def to_hash: -> FinchAPI::Models::HRIS::HRISCompany::department @@ -124,12 +112,7 @@ module FinchAPI class Parent < FinchAPI::BaseModel attr_accessor name: String? - def initialize: - (name: String?) -> void - | ( - ?FinchAPI::Models::HRIS::HRISCompany::Department::parent - | FinchAPI::BaseModel data - ) -> void + def initialize: (?name: String?) -> void def to_hash: -> FinchAPI::Models::HRIS::HRISCompany::Department::parent end @@ -146,26 +129,23 @@ module FinchAPI 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 initialize: ( + ?subtype: FinchAPI::Models::HRIS::HRISCompany::Entity::subtype?, + ?type: FinchAPI::Models::HRIS::HRISCompany::Entity::type_? + ) -> void def to_hash: -> FinchAPI::Models::HRIS::HRISCompany::entity type subtype = :s_corporation | :c_corporation | :b_corporation - class Subtype < FinchAPI::Enum + module Subtype + extend FinchAPI::Enum + S_CORPORATION: :s_corporation C_CORPORATION: :c_corporation B_CORPORATION: :b_corporation - def self.values: -> ::Array[FinchAPI::Models::HRIS::HRISCompany::Entity::subtype] + def self?.values: -> ::Array[FinchAPI::Models::HRIS::HRISCompany::Entity::subtype] end type type_ = @@ -177,7 +157,9 @@ module FinchAPI | :partnership | :cooperative - class Type < FinchAPI::Enum + module Type + extend FinchAPI::Enum + LLC: :llc LP: :lp CORPORATION: :corporation @@ -186,7 +168,7 @@ module FinchAPI PARTNERSHIP: :partnership COOPERATIVE: :cooperative - def self.values: -> ::Array[FinchAPI::Models::HRIS::HRISCompany::Entity::type_] + def self?.values: -> ::Array[FinchAPI::Models::HRIS::HRISCompany::Entity::type_] end end end diff --git a/sig/finch-api/models/hris/company_benefit.rbs b/sig/finch-api/models/hris/company_benefit.rbs index f752768e..5315f436 100644 --- a/sig/finch-api/models/hris/company_benefit.rbs +++ b/sig/finch-api/models/hris/company_benefit.rbs @@ -18,16 +18,12 @@ module FinchAPI 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 initialize: ( + benefit_id: String, + description: String?, + frequency: FinchAPI::Models::HRIS::benefit_frequency?, + type: FinchAPI::Models::HRIS::benefit_type? + ) -> void def to_hash: -> FinchAPI::Models::HRIS::company_benefit end diff --git a/sig/finch-api/models/hris/company_retrieve_params.rbs b/sig/finch-api/models/hris/company_retrieve_params.rbs index 22edfeaa..4dbe3c88 100644 --- a/sig/finch-api/models/hris/company_retrieve_params.rbs +++ b/sig/finch-api/models/hris/company_retrieve_params.rbs @@ -7,12 +7,7 @@ module FinchAPI 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 initialize: (?request_options: FinchAPI::request_opts) -> void def to_hash: -> FinchAPI::Models::HRIS::company_retrieve_params 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 index bf25635a..5d28b37f 100644 --- a/sig/finch-api/models/hris/create_company_benefits_response.rbs +++ b/sig/finch-api/models/hris/create_company_benefits_response.rbs @@ -6,12 +6,7 @@ module FinchAPI 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 initialize: (benefit_id: String) -> void def to_hash: -> FinchAPI::Models::HRIS::create_company_benefits_response 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 index 8571ddaf..05187495 100644 --- a/sig/finch-api/models/hris/directory_list_individuals_params.rbs +++ b/sig/finch-api/models/hris/directory_list_individuals_params.rbs @@ -16,16 +16,11 @@ module FinchAPI 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 initialize: ( + ?limit: Integer, + ?offset: Integer, + ?request_options: FinchAPI::request_opts + ) -> void def to_hash: -> FinchAPI::Models::HRIS::directory_list_individuals_params end diff --git a/sig/finch-api/models/hris/directory_list_params.rbs b/sig/finch-api/models/hris/directory_list_params.rbs index a24a1024..340ad765 100644 --- a/sig/finch-api/models/hris/directory_list_params.rbs +++ b/sig/finch-api/models/hris/directory_list_params.rbs @@ -16,16 +16,11 @@ module FinchAPI 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 initialize: ( + ?limit: Integer, + ?offset: Integer, + ?request_options: FinchAPI::request_opts + ) -> void def to_hash: -> FinchAPI::Models::HRIS::directory_list_params end diff --git a/sig/finch-api/models/hris/document_list_params.rbs b/sig/finch-api/models/hris/document_list_params.rbs index 58bd146d..99b460c9 100644 --- a/sig/finch-api/models/hris/document_list_params.rbs +++ b/sig/finch-api/models/hris/document_list_params.rbs @@ -32,28 +32,25 @@ module FinchAPI ::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 initialize: ( + ?individual_ids: ::Array[String], + ?limit: Integer, + ?offset: Integer, + ?types: ::Array[FinchAPI::Models::HRIS::DocumentListParams::type_], + ?request_options: FinchAPI::request_opts + ) -> void def to_hash: -> FinchAPI::Models::HRIS::document_list_params type type_ = :w4_2020 | :w4_2005 - class Type < FinchAPI::Enum + module Type + extend FinchAPI::Enum + W4_2020: :w4_2020 W4_2005: :w4_2005 - def self.values: -> ::Array[FinchAPI::Models::HRIS::DocumentListParams::type_] + def self?.values: -> ::Array[FinchAPI::Models::HRIS::DocumentListParams::type_] 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 index 1a1717c2..d8acfc87 100644 --- a/sig/finch-api/models/hris/document_list_response.rbs +++ b/sig/finch-api/models/hris/document_list_response.rbs @@ -12,15 +12,10 @@ module FinchAPI 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 initialize: ( + documents: ::Array[FinchAPI::Models::HRIS::DocumentResponse], + paging: FinchAPI::Models::Paging + ) -> void def to_hash: -> FinchAPI::Models::HRIS::document_list_response end diff --git a/sig/finch-api/models/hris/document_response.rbs b/sig/finch-api/models/hris/document_response.rbs index 23489f8c..e2506e98 100644 --- a/sig/finch-api/models/hris/document_response.rbs +++ b/sig/finch-api/models/hris/document_response.rbs @@ -29,28 +29,25 @@ module FinchAPI 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 initialize: ( + ?id: String, + ?individual_id: String?, + ?type: FinchAPI::Models::HRIS::DocumentResponse::type_, + ?url: String, + ?year: Float? + ) -> void def to_hash: -> FinchAPI::Models::HRIS::document_response type type_ = :w4_2020 | :w4_2005 - class Type < FinchAPI::Enum + module Type + extend FinchAPI::Enum + W4_2020: :w4_2020 W4_2005: :w4_2005 - def self.values: -> ::Array[FinchAPI::Models::HRIS::DocumentResponse::type_] + def self?.values: -> ::Array[FinchAPI::Models::HRIS::DocumentResponse::type_] 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 index a1ef05fb..bd91a63b 100644 --- a/sig/finch-api/models/hris/document_retreive_params.rbs +++ b/sig/finch-api/models/hris/document_retreive_params.rbs @@ -7,12 +7,7 @@ module FinchAPI 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 initialize: (?request_options: FinchAPI::request_opts) -> void def to_hash: -> FinchAPI::Models::HRIS::document_retreive_params end diff --git a/sig/finch-api/models/hris/document_retreive_response.rbs b/sig/finch-api/models/hris/document_retreive_response.rbs index 4a429ff9..e0e55858 100644 --- a/sig/finch-api/models/hris/document_retreive_response.rbs +++ b/sig/finch-api/models/hris/document_retreive_response.rbs @@ -4,8 +4,10 @@ module FinchAPI 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]] + module DocumentRetreiveResponse + extend FinchAPI::Union + + def self?.variants: -> [FinchAPI::Models::HRIS::W42020, FinchAPI::Models::HRIS::W42005] end end end diff --git a/sig/finch-api/models/hris/employment_data.rbs b/sig/finch-api/models/hris/employment_data.rbs index d2344da3..88bafd33 100644 --- a/sig/finch-api/models/hris/employment_data.rbs +++ b/sig/finch-api/models/hris/employment_data.rbs @@ -68,32 +68,28 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::HRIS::employment_data @@ -108,12 +104,7 @@ module FinchAPI def value=: (top) -> top - def initialize: - (name: String, value: top) -> void - | ( - ?FinchAPI::Models::HRIS::EmploymentData::custom_field - | FinchAPI::BaseModel data - ) -> void + def initialize: (?name: String, ?value: top) -> void def to_hash: -> FinchAPI::Models::HRIS::EmploymentData::custom_field end @@ -123,12 +114,7 @@ module FinchAPI class Department < FinchAPI::BaseModel attr_accessor name: String? - def initialize: - (name: String?) -> void - | ( - ?FinchAPI::Models::HRIS::EmploymentData::department - | FinchAPI::BaseModel data - ) -> void + def initialize: (?name: String?) -> void def to_hash: -> FinchAPI::Models::HRIS::EmploymentData::department end @@ -144,15 +130,10 @@ module FinchAPI 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 initialize: ( + ?subtype: FinchAPI::Models::HRIS::EmploymentData::Employment::subtype?, + ?type: FinchAPI::Models::HRIS::EmploymentData::Employment::type_? + ) -> void def to_hash: -> FinchAPI::Models::HRIS::EmploymentData::employment @@ -164,7 +145,9 @@ module FinchAPI | :seasonal | :individual_contractor - class Subtype < FinchAPI::Enum + module Subtype + extend FinchAPI::Enum + FULL_TIME: :full_time INTERN: :intern PART_TIME: :part_time @@ -172,16 +155,18 @@ module FinchAPI SEASONAL: :seasonal INDIVIDUAL_CONTRACTOR: :individual_contractor - def self.values: -> ::Array[FinchAPI::Models::HRIS::EmploymentData::Employment::subtype] + def self?.values: -> ::Array[FinchAPI::Models::HRIS::EmploymentData::Employment::subtype] end type type_ = :employee | :contractor - class Type < FinchAPI::Enum + module Type + extend FinchAPI::Enum + EMPLOYEE: :employee CONTRACTOR: :contractor - def self.values: -> ::Array[FinchAPI::Models::HRIS::EmploymentData::Employment::type_] + def self?.values: -> ::Array[FinchAPI::Models::HRIS::EmploymentData::Employment::type_] end end @@ -194,7 +179,9 @@ module FinchAPI | :retired | :terminated - class EmploymentStatus < FinchAPI::Enum + module EmploymentStatus + extend FinchAPI::Enum + ACTIVE: :active DECEASED: :deceased LEAVE: :leave @@ -203,7 +190,7 @@ module FinchAPI RETIRED: :retired TERMINATED: :terminated - def self.values: -> ::Array[FinchAPI::Models::HRIS::EmploymentData::employment_status] + def self?.values: -> ::Array[FinchAPI::Models::HRIS::EmploymentData::employment_status] end type manager = { id: String } @@ -213,12 +200,7 @@ module FinchAPI def id=: (String) -> String - def initialize: - (id: String) -> void - | ( - ?FinchAPI::Models::HRIS::EmploymentData::manager - | FinchAPI::BaseModel data - ) -> void + def initialize: (?id: String) -> void def to_hash: -> FinchAPI::Models::HRIS::EmploymentData::manager end diff --git a/sig/finch-api/models/hris/employment_data_response.rbs b/sig/finch-api/models/hris/employment_data_response.rbs index 48609ee5..b543ac26 100644 --- a/sig/finch-api/models/hris/employment_data_response.rbs +++ b/sig/finch-api/models/hris/employment_data_response.rbs @@ -23,16 +23,11 @@ module FinchAPI 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 initialize: ( + ?body: FinchAPI::Models::HRIS::EmploymentData, + ?code: Integer, + ?individual_id: String + ) -> void def to_hash: -> FinchAPI::Models::HRIS::employment_data_response 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 index 092825c1..0c3efcf7 100644 --- a/sig/finch-api/models/hris/employment_retrieve_many_params.rbs +++ b/sig/finch-api/models/hris/employment_retrieve_many_params.rbs @@ -13,15 +13,10 @@ module FinchAPI 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 initialize: ( + requests: ::Array[FinchAPI::Models::HRIS::EmploymentRetrieveManyParams::Request], + ?request_options: FinchAPI::request_opts + ) -> void def to_hash: -> FinchAPI::Models::HRIS::employment_retrieve_many_params @@ -30,12 +25,7 @@ module FinchAPI 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 initialize: (individual_id: String) -> void def to_hash: -> FinchAPI::Models::HRIS::EmploymentRetrieveManyParams::request end diff --git a/sig/finch-api/models/hris/individual.rbs b/sig/finch-api/models/hris/individual.rbs index 74bec152..cb5aa9f4 100644 --- a/sig/finch-api/models/hris/individual.rbs +++ b/sig/finch-api/models/hris/individual.rbs @@ -47,25 +47,21 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::HRIS::individual @@ -82,25 +78,22 @@ module FinchAPI 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 initialize: ( + ?data: String, + ?type: FinchAPI::Models::HRIS::Individual::Email::type_? + ) -> void def to_hash: -> FinchAPI::Models::HRIS::Individual::email type type_ = :work | :personal - class Type < FinchAPI::Enum + module Type + extend FinchAPI::Enum + WORK: :work PERSONAL: :personal - def self.values: -> ::Array[FinchAPI::Models::HRIS::Individual::Email::type_] + def self?.values: -> ::Array[FinchAPI::Models::HRIS::Individual::Email::type_] end end @@ -114,7 +107,9 @@ module FinchAPI | :two_or_more_races | :decline_to_specify - class Ethnicity < FinchAPI::Enum + module Ethnicity + extend FinchAPI::Enum + ASIAN: :asian WHITE: :white BLACK_OR_AFRICAN_AMERICAN: :black_or_african_american @@ -124,18 +119,20 @@ module FinchAPI TWO_OR_MORE_RACES: :two_or_more_races DECLINE_TO_SPECIFY: :decline_to_specify - def self.values: -> ::Array[FinchAPI::Models::HRIS::Individual::ethnicity] + def self?.values: -> ::Array[FinchAPI::Models::HRIS::Individual::ethnicity] end type gender = :female | :male | :other | :decline_to_specify - class Gender < FinchAPI::Enum + module Gender + extend FinchAPI::Enum + FEMALE: :female MALE: :male OTHER: :other DECLINE_TO_SPECIFY: :decline_to_specify - def self.values: -> ::Array[FinchAPI::Models::HRIS::Individual::gender] + def self?.values: -> ::Array[FinchAPI::Models::HRIS::Individual::gender] end type phone_number = @@ -149,25 +146,22 @@ module FinchAPI 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 initialize: ( + ?data: String?, + ?type: FinchAPI::Models::HRIS::Individual::PhoneNumber::type_? + ) -> void def to_hash: -> FinchAPI::Models::HRIS::Individual::phone_number type type_ = :work | :personal - class Type < FinchAPI::Enum + module Type + extend FinchAPI::Enum + WORK: :work PERSONAL: :personal - def self.values: -> ::Array[FinchAPI::Models::HRIS::Individual::PhoneNumber::type_] + def self?.values: -> ::Array[FinchAPI::Models::HRIS::Individual::PhoneNumber::type_] 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 index 20b009fe..9557dba9 100644 --- a/sig/finch-api/models/hris/individual_in_directory.rbs +++ b/sig/finch-api/models/hris/individual_in_directory.rbs @@ -29,20 +29,15 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::HRIS::individual_in_directory @@ -51,12 +46,7 @@ module FinchAPI class Department < FinchAPI::BaseModel attr_accessor name: String? - def initialize: - (name: String?) -> void - | ( - ?FinchAPI::Models::HRIS::IndividualInDirectory::department - | FinchAPI::BaseModel data - ) -> void + def initialize: (?name: String?) -> void def to_hash: -> FinchAPI::Models::HRIS::IndividualInDirectory::department end @@ -68,12 +58,7 @@ module FinchAPI def id=: (String) -> String - def initialize: - (id: String) -> void - | ( - ?FinchAPI::Models::HRIS::IndividualInDirectory::manager - | FinchAPI::BaseModel data - ) -> void + def initialize: (?id: String) -> void def to_hash: -> FinchAPI::Models::HRIS::IndividualInDirectory::manager end diff --git a/sig/finch-api/models/hris/individual_response.rbs b/sig/finch-api/models/hris/individual_response.rbs index 43c26e17..fd03877f 100644 --- a/sig/finch-api/models/hris/individual_response.rbs +++ b/sig/finch-api/models/hris/individual_response.rbs @@ -23,16 +23,11 @@ module FinchAPI 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 initialize: ( + ?body: FinchAPI::Models::HRIS::Individual, + ?code: Integer, + ?individual_id: String + ) -> void def to_hash: -> FinchAPI::Models::HRIS::individual_response 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 index dbc9ecba..d49d4158 100644 --- a/sig/finch-api/models/hris/individual_retrieve_many_params.rbs +++ b/sig/finch-api/models/hris/individual_retrieve_many_params.rbs @@ -20,16 +20,11 @@ module FinchAPI ::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 initialize: ( + ?options: FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Options?, + ?requests: ::Array[FinchAPI::Models::HRIS::IndividualRetrieveManyParams::Request], + ?request_options: FinchAPI::request_opts + ) -> void def to_hash: -> FinchAPI::Models::HRIS::individual_retrieve_many_params @@ -40,12 +35,7 @@ module FinchAPI def include=: (::Array[String]) -> ::Array[String] - def initialize: - (include: ::Array[String]) -> void - | ( - ?FinchAPI::Models::HRIS::IndividualRetrieveManyParams::options - | FinchAPI::BaseModel data - ) -> void + def initialize: (?include: ::Array[String]) -> void def to_hash: -> FinchAPI::Models::HRIS::IndividualRetrieveManyParams::options end @@ -57,12 +47,7 @@ module FinchAPI def individual_id=: (String) -> String - def initialize: - (individual_id: String) -> void - | ( - ?FinchAPI::Models::HRIS::IndividualRetrieveManyParams::request - | FinchAPI::BaseModel data - ) -> void + def initialize: (?individual_id: String) -> void def to_hash: -> FinchAPI::Models::HRIS::IndividualRetrieveManyParams::request end diff --git a/sig/finch-api/models/hris/pay_statement.rbs b/sig/finch-api/models/hris/pay_statement.rbs index 7880d31f..f11db80e 100644 --- a/sig/finch-api/models/hris/pay_statement.rbs +++ b/sig/finch-api/models/hris/pay_statement.rbs @@ -38,22 +38,18 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::HRIS::pay_statement @@ -80,19 +76,14 @@ module FinchAPI 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 initialize: ( + ?amount: Integer?, + ?attributes: FinchAPI::Models::HRIS::PayStatement::Earning::Attributes?, + ?currency: String?, + ?hours: Float?, + ?name: String?, + ?type: FinchAPI::Models::HRIS::PayStatement::Earning::type_? + ) -> void def to_hash: -> FinchAPI::Models::HRIS::PayStatement::earning @@ -108,14 +99,9 @@ module FinchAPI 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 initialize: ( + ?metadata: FinchAPI::Models::HRIS::PayStatement::Earning::Attributes::Metadata + ) -> void def to_hash: -> FinchAPI::Models::HRIS::PayStatement::Earning::attributes @@ -126,12 +112,7 @@ module FinchAPI 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 initialize: (?metadata: ::Hash[Symbol, top]) -> void def to_hash: -> FinchAPI::Models::HRIS::PayStatement::Earning::Attributes::metadata end @@ -152,7 +133,9 @@ module FinchAPI | :"1099" | :other - class Type < FinchAPI::Enum + module Type + extend FinchAPI::Enum + SALARY: :salary WAGE: :wage REIMBURSEMENT: :reimbursement @@ -167,7 +150,7 @@ module FinchAPI NUMBER_1099: :"1099" OTHER: :other - def self.values: -> ::Array[FinchAPI::Models::HRIS::PayStatement::Earning::type_] + def self?.values: -> ::Array[FinchAPI::Models::HRIS::PayStatement::Earning::type_] end end @@ -194,19 +177,14 @@ module FinchAPI 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 initialize: ( + ?amount: Integer?, + ?attributes: FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes?, + ?currency: String?, + ?name: String?, + ?pre_tax: bool?, + ?type: FinchAPI::Models::HRIS::benefit_type? + ) -> void def to_hash: -> FinchAPI::Models::HRIS::PayStatement::employee_deduction @@ -222,14 +200,9 @@ module FinchAPI 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 initialize: ( + ?metadata: FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes::Metadata + ) -> void def to_hash: -> FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::attributes @@ -240,12 +213,7 @@ module FinchAPI 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 initialize: (?metadata: ::Hash[Symbol, top]) -> void def to_hash: -> FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes::metadata end @@ -272,18 +240,13 @@ module FinchAPI 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 initialize: ( + ?amount: Integer?, + ?attributes: FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes?, + ?currency: String?, + ?name: String?, + ?type: FinchAPI::Models::HRIS::benefit_type? + ) -> void def to_hash: -> FinchAPI::Models::HRIS::PayStatement::employer_contribution @@ -299,14 +262,9 @@ module FinchAPI 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 initialize: ( + ?metadata: FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes::Metadata + ) -> void def to_hash: -> FinchAPI::Models::HRIS::PayStatement::EmployerContribution::attributes @@ -317,12 +275,7 @@ module FinchAPI 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 initialize: (?metadata: ::Hash[Symbol, top]) -> void def to_hash: -> FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes::metadata end @@ -331,11 +284,13 @@ module FinchAPI type payment_method = :check | :direct_deposit - class PaymentMethod < FinchAPI::Enum + module PaymentMethod + extend FinchAPI::Enum + CHECK: :check DIRECT_DEPOSIT: :direct_deposit - def self.values: -> ::Array[FinchAPI::Models::HRIS::PayStatement::payment_method] + def self?.values: -> ::Array[FinchAPI::Models::HRIS::PayStatement::payment_method] end type tax = @@ -361,19 +316,14 @@ module FinchAPI 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 initialize: ( + ?amount: Integer?, + ?attributes: FinchAPI::Models::HRIS::PayStatement::Tax::Attributes?, + ?currency: String?, + ?employer: bool?, + ?name: String?, + ?type: FinchAPI::Models::HRIS::PayStatement::Tax::type_? + ) -> void def to_hash: -> FinchAPI::Models::HRIS::PayStatement::tax @@ -389,14 +339,9 @@ module FinchAPI 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 initialize: ( + ?metadata: FinchAPI::Models::HRIS::PayStatement::Tax::Attributes::Metadata + ) -> void def to_hash: -> FinchAPI::Models::HRIS::PayStatement::Tax::attributes @@ -407,12 +352,7 @@ module FinchAPI 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 initialize: (?metadata: ::Hash[Symbol, top]) -> void def to_hash: -> FinchAPI::Models::HRIS::PayStatement::Tax::Attributes::metadata end @@ -420,24 +360,28 @@ module FinchAPI type type_ = :state | :federal | :local | :fica - class Type < FinchAPI::Enum + module Type + extend FinchAPI::Enum + STATE: :state FEDERAL: :federal LOCAL: :local FICA: :fica - def self.values: -> ::Array[FinchAPI::Models::HRIS::PayStatement::Tax::type_] + 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 + module Type + extend 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_] + def self?.values: -> ::Array[FinchAPI::Models::HRIS::PayStatement::type_] 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 index 71bcfaa1..7896ecb1 100644 --- a/sig/finch-api/models/hris/pay_statement_response.rbs +++ b/sig/finch-api/models/hris/pay_statement_response.rbs @@ -23,16 +23,11 @@ module FinchAPI 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 initialize: ( + ?body: FinchAPI::Models::HRIS::PayStatementResponseBody, + ?code: Integer, + ?payment_id: String + ) -> void def to_hash: -> FinchAPI::Models::HRIS::pay_statement_response 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 index cb7a710b..6fecade4 100644 --- a/sig/finch-api/models/hris/pay_statement_response_body.rbs +++ b/sig/finch-api/models/hris/pay_statement_response_body.rbs @@ -18,15 +18,10 @@ module FinchAPI ::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 initialize: ( + ?paging: FinchAPI::Models::Paging, + ?pay_statements: ::Array[FinchAPI::Models::HRIS::PayStatement] + ) -> void def to_hash: -> FinchAPI::Models::HRIS::pay_statement_response_body 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 index 646aa19d..c58f5ce7 100644 --- a/sig/finch-api/models/hris/pay_statement_retrieve_many_params.rbs +++ b/sig/finch-api/models/hris/pay_statement_retrieve_many_params.rbs @@ -13,15 +13,10 @@ module FinchAPI 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 initialize: ( + requests: ::Array[FinchAPI::Models::HRIS::PayStatementRetrieveManyParams::Request], + ?request_options: FinchAPI::request_opts + ) -> void def to_hash: -> FinchAPI::Models::HRIS::pay_statement_retrieve_many_params @@ -38,12 +33,11 @@ module FinchAPI def offset=: (Integer) -> Integer - def initialize: - (payment_id: String, limit: Integer, offset: Integer) -> void - | ( - ?FinchAPI::Models::HRIS::PayStatementRetrieveManyParams::request - | FinchAPI::BaseModel data - ) -> void + def initialize: ( + payment_id: String, + ?limit: Integer, + ?offset: Integer + ) -> void def to_hash: -> FinchAPI::Models::HRIS::PayStatementRetrieveManyParams::request end diff --git a/sig/finch-api/models/hris/payment.rbs b/sig/finch-api/models/hris/payment.rbs index 30eaa5a5..385ece1c 100644 --- a/sig/finch-api/models/hris/payment.rbs +++ b/sig/finch-api/models/hris/payment.rbs @@ -44,24 +44,20 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::HRIS::payment @@ -76,7 +72,9 @@ module FinchAPI | :daily | :other - class PayFrequency < FinchAPI::Enum + module PayFrequency + extend FinchAPI::Enum + ANNUALLY: :annually SEMI_ANNUALLY: :semi_annually QUARTERLY: :quarterly @@ -87,7 +85,7 @@ module FinchAPI DAILY: :daily OTHER: :other - def self.values: -> ::Array[FinchAPI::Models::HRIS::Payment::pay_frequency] + def self?.values: -> ::Array[FinchAPI::Models::HRIS::Payment::pay_frequency] end type pay_period = { end_date: String?, start_date: String? } @@ -97,12 +95,7 @@ module FinchAPI 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 initialize: (?end_date: String?, ?start_date: String?) -> void def to_hash: -> FinchAPI::Models::HRIS::Payment::pay_period end diff --git a/sig/finch-api/models/hris/payment_list_params.rbs b/sig/finch-api/models/hris/payment_list_params.rbs index c4225a9f..92ed6229 100644 --- a/sig/finch-api/models/hris/payment_list_params.rbs +++ b/sig/finch-api/models/hris/payment_list_params.rbs @@ -12,16 +12,11 @@ module FinchAPI 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 initialize: ( + end_date: Date, + start_date: Date, + ?request_options: FinchAPI::request_opts + ) -> void def to_hash: -> FinchAPI::Models::HRIS::payment_list_params 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 index 87dc360e..02c28d56 100644 --- a/sig/finch-api/models/hris/support_per_benefit_type.rbs +++ b/sig/finch-api/models/hris/support_per_benefit_type.rbs @@ -20,15 +20,10 @@ module FinchAPI 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 initialize: ( + ?company_benefits: FinchAPI::Models::OperationSupportMatrix, + ?individual_benefits: FinchAPI::Models::OperationSupportMatrix + ) -> void def to_hash: -> FinchAPI::Models::HRIS::support_per_benefit_type end diff --git a/sig/finch-api/models/hris/supported_benefit.rbs b/sig/finch-api/models/hris/supported_benefit.rbs index d1e60b98..8aab6ca1 100644 --- a/sig/finch-api/models/hris/supported_benefit.rbs +++ b/sig/finch-api/models/hris/supported_benefit.rbs @@ -34,49 +34,50 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::HRIS::supported_benefit type company_contribution = :fixed | :percent - class CompanyContribution < FinchAPI::Enum + module CompanyContribution + extend FinchAPI::Enum + FIXED: :fixed PERCENT: :percent - def self.values: -> ::Array[FinchAPI::Models::HRIS::SupportedBenefit::company_contribution] + def self?.values: -> ::Array[FinchAPI::Models::HRIS::SupportedBenefit::company_contribution] end type employee_deduction = :fixed | :percent - class EmployeeDeduction < FinchAPI::Enum + module EmployeeDeduction + extend FinchAPI::Enum + FIXED: :fixed PERCENT: :percent - def self.values: -> ::Array[FinchAPI::Models::HRIS::SupportedBenefit::employee_deduction] + def self?.values: -> ::Array[FinchAPI::Models::HRIS::SupportedBenefit::employee_deduction] end type hsa_contribution_limit = :individual | :family - class HsaContributionLimit < FinchAPI::Enum + module HsaContributionLimit + extend FinchAPI::Enum + INDIVIDUAL: :individual FAMILY: :family - def self.values: -> ::Array[FinchAPI::Models::HRIS::SupportedBenefit::hsa_contribution_limit] + def self?.values: -> ::Array[FinchAPI::Models::HRIS::SupportedBenefit::hsa_contribution_limit] 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 index 8b0fca4f..7eb00d42 100644 --- a/sig/finch-api/models/hris/update_company_benefit_response.rbs +++ b/sig/finch-api/models/hris/update_company_benefit_response.rbs @@ -6,12 +6,7 @@ module FinchAPI 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 initialize: (benefit_id: String) -> void def to_hash: -> FinchAPI::Models::HRIS::update_company_benefit_response end diff --git a/sig/finch-api/models/hris/w42005.rbs b/sig/finch-api/models/hris/w42005.rbs index 8390845d..4b60d8eb 100644 --- a/sig/finch-api/models/hris/w42005.rbs +++ b/sig/finch-api/models/hris/w42005.rbs @@ -23,13 +23,11 @@ module FinchAPI 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 initialize: ( + ?data: FinchAPI::Models::HRIS::W42005::Data, + ?type: FinchAPI::Models::HRIS::W42005::type_, + ?year: Float? + ) -> void def to_hash: -> FinchAPI::Models::HRIS::w42005 @@ -37,7 +35,7 @@ module FinchAPI { additional_withholding: Integer?, exemption: FinchAPI::Models::HRIS::W42005::Data::exemption, - filing_status: FinchAPI::Models::HRIS::W42005::Data::filing_status, + filing_status: FinchAPI::Models::HRIS::W42005::Data::filing_status?, individual_id: String, total_number_of_allowances: Integer? } @@ -51,11 +49,7 @@ module FinchAPI 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_accessor filing_status: FinchAPI::Models::HRIS::W42005::Data::filing_status? attr_reader individual_id: String? @@ -63,47 +57,49 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::HRIS::W42005::data type exemption = :exempt | :non_exempt - class Exemption < FinchAPI::Enum + module Exemption + extend FinchAPI::Enum + EXEMPT: :exempt NON_EXEMPT: :non_exempt - def self.values: -> ::Array[FinchAPI::Models::HRIS::W42005::Data::exemption] + 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 + module FilingStatus + extend 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] + def self?.values: -> ::Array[FinchAPI::Models::HRIS::W42005::Data::filing_status] end end type type_ = :w4_2005 - class Type < FinchAPI::Enum + module Type + extend FinchAPI::Enum + W4_2005: :w4_2005 - def self.values: -> ::Array[FinchAPI::Models::HRIS::W42005::type_] + def self?.values: -> ::Array[FinchAPI::Models::HRIS::W42005::type_] end end end diff --git a/sig/finch-api/models/hris/w42020.rbs b/sig/finch-api/models/hris/w42020.rbs index a7ef901f..93732b3f 100644 --- a/sig/finch-api/models/hris/w42020.rbs +++ b/sig/finch-api/models/hris/w42020.rbs @@ -23,13 +23,11 @@ module FinchAPI 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 initialize: ( + ?data: FinchAPI::Models::HRIS::W42020::Data, + ?type: FinchAPI::Models::HRIS::W42020::type_, + ?year: Float? + ) -> void def to_hash: -> FinchAPI::Models::HRIS::w42020 @@ -64,20 +62,16 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::HRIS::W42020::data @@ -86,21 +80,25 @@ module FinchAPI | :married_filing_jointly_or_qualifying_surviving_spouse | :single_or_married_filing_separately - class FilingStatus < FinchAPI::Enum + module FilingStatus + extend 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] + def self?.values: -> ::Array[FinchAPI::Models::HRIS::W42020::Data::filing_status] end end type type_ = :w4_2020 - class Type < FinchAPI::Enum + module Type + extend FinchAPI::Enum + W4_2020: :w4_2020 - def self.values: -> ::Array[FinchAPI::Models::HRIS::W42020::type_] + def self?.values: -> ::Array[FinchAPI::Models::HRIS::W42020::type_] end end end diff --git a/sig/finch-api/models/income.rbs b/sig/finch-api/models/income.rbs index 25c623b7..47357e64 100644 --- a/sig/finch-api/models/income.rbs +++ b/sig/finch-api/models/income.rbs @@ -17,14 +17,12 @@ module FinchAPI 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 initialize: ( + ?amount: Integer?, + ?currency: String?, + ?effective_date: String?, + ?unit: FinchAPI::Models::Income::unit? + ) -> void def to_hash: -> FinchAPI::Models::income @@ -39,7 +37,9 @@ module FinchAPI | :hourly | :fixed - class Unit < FinchAPI::Enum + module Unit + extend FinchAPI::Enum + YEARLY: :yearly QUARTERLY: :quarterly MONTHLY: :monthly @@ -50,7 +50,7 @@ module FinchAPI HOURLY: :hourly FIXED: :fixed - def self.values: -> ::Array[FinchAPI::Models::Income::unit] + def self?.values: -> ::Array[FinchAPI::Models::Income::unit] end end end diff --git a/sig/finch-api/models/individual_event.rbs b/sig/finch-api/models/individual_event.rbs index 3a765997..4f8e6783 100644 --- a/sig/finch-api/models/individual_event.rbs +++ b/sig/finch-api/models/individual_event.rbs @@ -7,26 +7,22 @@ module FinchAPI } class IndividualEvent < FinchAPI::Models::BaseWebhookEvent - attr_reader data: FinchAPI::Models::IndividualEvent::Data? + def data: -> FinchAPI::Models::IndividualEvent::Data? def data=: ( - FinchAPI::Models::IndividualEvent::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? def event_type=: ( - FinchAPI::Models::IndividualEvent::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 initialize: ( + ?data: FinchAPI::Models::IndividualEvent::Data, + ?event_type: FinchAPI::Models::IndividualEvent::event_type + ) -> void def to_hash: -> FinchAPI::Models::individual_event @@ -37,11 +33,7 @@ module FinchAPI def individual_id=: (String) -> String - def initialize: - (individual_id: String) -> void - | ( - ?FinchAPI::Models::IndividualEvent::data | FinchAPI::BaseModel data - ) -> void + def initialize: (?individual_id: String) -> void def to_hash: -> FinchAPI::Models::IndividualEvent::data end @@ -49,12 +41,14 @@ module FinchAPI type event_type = :"individual.created" | :"individual.updated" | :"individual.deleted" - class EventType < FinchAPI::Enum + module EventType + extend FinchAPI::Enum + INDIVIDUAL_CREATED: :"individual.created" INDIVIDUAL_UPDATED: :"individual.updated" INDIVIDUAL_DELETED: :"individual.deleted" - def self.values: -> ::Array[FinchAPI::Models::IndividualEvent::event_type] + def self?.values: -> ::Array[FinchAPI::Models::IndividualEvent::event_type] end end end diff --git a/sig/finch-api/models/introspection.rbs b/sig/finch-api/models/introspection.rbs index 2fdbb059..257a8217 100644 --- a/sig/finch-api/models/introspection.rbs +++ b/sig/finch-api/models/introspection.rbs @@ -53,26 +53,24 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::introspection @@ -100,16 +98,11 @@ module FinchAPI 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 initialize: ( + ?connection_status: FinchAPI::Models::Introspection::AuthenticationMethod::ConnectionStatus, + ?products: ::Array[String], + ?type: FinchAPI::Models::Introspection::AuthenticationMethod::type_ + ) -> void def to_hash: -> FinchAPI::Models::Introspection::authentication_method @@ -127,15 +120,10 @@ module FinchAPI 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 initialize: ( + ?message: String, + ?status: FinchAPI::Models::connection_status_type + ) -> void def to_hash: -> FinchAPI::Models::Introspection::AuthenticationMethod::connection_status end @@ -143,25 +131,29 @@ module FinchAPI type type_ = :assisted | :credential | :api_token | :api_credential | :oauth - class Type < FinchAPI::Enum + module Type + extend 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_] + def self?.values: -> ::Array[FinchAPI::Models::Introspection::AuthenticationMethod::type_] end end type client_type = :production | :development | :sandbox - class ClientType < FinchAPI::Enum + module ClientType + extend FinchAPI::Enum + PRODUCTION: :production DEVELOPMENT: :development SANDBOX: :sandbox - def self.values: -> ::Array[FinchAPI::Models::Introspection::client_type] + def self?.values: -> ::Array[FinchAPI::Models::Introspection::client_type] end type connection_status = @@ -178,26 +170,23 @@ module FinchAPI 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 initialize: ( + ?message: String, + ?status: FinchAPI::Models::connection_status_type + ) -> void def to_hash: -> FinchAPI::Models::Introspection::connection_status end type connection_type = :provider | :finch - class ConnectionType < FinchAPI::Enum + module ConnectionType + extend FinchAPI::Enum + PROVIDER: :provider FINCH: :finch - def self.values: -> ::Array[FinchAPI::Models::Introspection::connection_type] + def self?.values: -> ::Array[FinchAPI::Models::Introspection::connection_type] end end end diff --git a/sig/finch-api/models/job_completion_event.rbs b/sig/finch-api/models/job_completion_event.rbs index fd27ee8a..e45bbf89 100644 --- a/sig/finch-api/models/job_completion_event.rbs +++ b/sig/finch-api/models/job_completion_event.rbs @@ -7,26 +7,22 @@ module FinchAPI } class JobCompletionEvent < FinchAPI::Models::BaseWebhookEvent - attr_reader data: FinchAPI::Models::JobCompletionEvent::Data? + def data: -> FinchAPI::Models::JobCompletionEvent::Data? def data=: ( - FinchAPI::Models::JobCompletionEvent::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? def event_type=: ( - FinchAPI::Models::JobCompletionEvent::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 initialize: ( + ?data: FinchAPI::Models::JobCompletionEvent::Data, + ?event_type: FinchAPI::Models::JobCompletionEvent::event_type + ) -> void def to_hash: -> FinchAPI::Models::job_completion_event @@ -37,12 +33,7 @@ module FinchAPI attr_accessor job_url: String - def initialize: - (job_id: String, job_url: String) -> void - | ( - ?FinchAPI::Models::JobCompletionEvent::data - | FinchAPI::BaseModel data - ) -> void + def initialize: (job_id: String, job_url: String) -> void def to_hash: -> FinchAPI::Models::JobCompletionEvent::data end @@ -55,7 +46,9 @@ module FinchAPI | :"job.benefit_update.completed" | :"job.data_sync_all.completed" - class EventType < FinchAPI::Enum + module EventType + extend 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" @@ -63,7 +56,7 @@ module FinchAPI 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] + def self?.values: -> ::Array[FinchAPI::Models::JobCompletionEvent::event_type] 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 index f43c9400..78d7ee27 100644 --- a/sig/finch-api/models/jobs/automated_async_job.rbs +++ b/sig/finch-api/models/jobs/automated_async_job.rbs @@ -33,22 +33,17 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::Jobs::automated_async_job @@ -59,12 +54,7 @@ module FinchAPI def individual_id=: (String) -> String - def initialize: - (individual_id: String) -> void - | ( - ?FinchAPI::Models::Jobs::AutomatedAsyncJob::params - | FinchAPI::BaseModel data - ) -> void + def initialize: (?individual_id: String) -> void def to_hash: -> FinchAPI::Models::Jobs::AutomatedAsyncJob::params end @@ -77,7 +67,9 @@ module FinchAPI | :reauth_error | :permissions_error - class Status < FinchAPI::Enum + module Status + extend FinchAPI::Enum + PENDING: :pending IN_PROGRESS: :in_progress COMPLETE: :complete @@ -85,16 +77,18 @@ module FinchAPI REAUTH_ERROR: :reauth_error PERMISSIONS_ERROR: :permissions_error - def self.values: -> ::Array[FinchAPI::Models::Jobs::AutomatedAsyncJob::status] + def self?.values: -> ::Array[FinchAPI::Models::Jobs::AutomatedAsyncJob::status] end type type_ = :data_sync_all | :w4_form_employee_sync - class Type < FinchAPI::Enum + module Type + extend 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_] + def self?.values: -> ::Array[FinchAPI::Models::Jobs::AutomatedAsyncJob::type_] 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 index 9ffa5248..3338797d 100644 --- a/sig/finch-api/models/jobs/automated_create_params.rbs +++ b/sig/finch-api/models/jobs/automated_create_params.rbs @@ -16,25 +16,22 @@ module FinchAPI 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 initialize: ( + type: FinchAPI::Models::Jobs::AutomatedCreateParams::type_, + params: FinchAPI::Models::Jobs::AutomatedCreateParams::Params, + ?request_options: FinchAPI::request_opts + ) -> void def to_hash: -> FinchAPI::Models::Jobs::automated_create_params type type_ = :w4_form_employee_sync - class Type < FinchAPI::Enum + module Type + extend FinchAPI::Enum + W4_FORM_EMPLOYEE_SYNC: :w4_form_employee_sync - def self.values: -> ::Array[FinchAPI::Models::Jobs::AutomatedCreateParams::type_] + def self?.values: -> ::Array[FinchAPI::Models::Jobs::AutomatedCreateParams::type_] end type params = { individual_id: String } @@ -42,12 +39,7 @@ module FinchAPI 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 initialize: (individual_id: String) -> void def to_hash: -> FinchAPI::Models::Jobs::AutomatedCreateParams::params end diff --git a/sig/finch-api/models/jobs/automated_create_response.rbs b/sig/finch-api/models/jobs/automated_create_response.rbs index 6f49847f..9fc44570 100644 --- a/sig/finch-api/models/jobs/automated_create_response.rbs +++ b/sig/finch-api/models/jobs/automated_create_response.rbs @@ -18,17 +18,12 @@ module FinchAPI 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 initialize: ( + allowed_refreshes: Integer, + job_id: String, + job_url: String, + remaining_refreshes: Integer + ) -> void def to_hash: -> FinchAPI::Models::Jobs::automated_create_response end diff --git a/sig/finch-api/models/jobs/automated_list_params.rbs b/sig/finch-api/models/jobs/automated_list_params.rbs index 539995b5..c0685155 100644 --- a/sig/finch-api/models/jobs/automated_list_params.rbs +++ b/sig/finch-api/models/jobs/automated_list_params.rbs @@ -16,16 +16,11 @@ module FinchAPI 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 initialize: ( + ?limit: Integer, + ?offset: Integer, + ?request_options: FinchAPI::request_opts + ) -> void def to_hash: -> FinchAPI::Models::Jobs::automated_list_params end diff --git a/sig/finch-api/models/jobs/automated_list_response.rbs b/sig/finch-api/models/jobs/automated_list_response.rbs new file mode 100644 index 00000000..db32886c --- /dev/null +++ b/sig/finch-api/models/jobs/automated_list_response.rbs @@ -0,0 +1,82 @@ +module FinchAPI + module Models + module Jobs + type automated_list_response = + { + data: ::Array[FinchAPI::Models::Jobs::AutomatedAsyncJob], + meta: FinchAPI::Models::Jobs::AutomatedListResponse::Meta + } + + class AutomatedListResponse < FinchAPI::BaseModel + attr_accessor data: ::Array[FinchAPI::Models::Jobs::AutomatedAsyncJob] + + attr_accessor meta: FinchAPI::Models::Jobs::AutomatedListResponse::Meta + + def initialize: ( + data: ::Array[FinchAPI::Models::Jobs::AutomatedAsyncJob], + meta: FinchAPI::Models::Jobs::AutomatedListResponse::Meta + ) -> void + + def to_hash: -> FinchAPI::Models::Jobs::automated_list_response + + type meta = + { + quotas: FinchAPI::Models::Jobs::AutomatedListResponse::Meta::Quotas + } + + class Meta < FinchAPI::BaseModel + attr_reader quotas: FinchAPI::Models::Jobs::AutomatedListResponse::Meta::Quotas? + + def quotas=: ( + FinchAPI::Models::Jobs::AutomatedListResponse::Meta::Quotas + ) -> FinchAPI::Models::Jobs::AutomatedListResponse::Meta::Quotas + + def initialize: ( + ?quotas: FinchAPI::Models::Jobs::AutomatedListResponse::Meta::Quotas + ) -> void + + def to_hash: -> FinchAPI::Models::Jobs::AutomatedListResponse::meta + + type quotas = + { + data_sync_all: FinchAPI::Models::Jobs::AutomatedListResponse::Meta::Quotas::DataSyncAll + } + + class Quotas < FinchAPI::BaseModel + attr_reader data_sync_all: FinchAPI::Models::Jobs::AutomatedListResponse::Meta::Quotas::DataSyncAll? + + def data_sync_all=: ( + FinchAPI::Models::Jobs::AutomatedListResponse::Meta::Quotas::DataSyncAll + ) -> FinchAPI::Models::Jobs::AutomatedListResponse::Meta::Quotas::DataSyncAll + + def initialize: ( + ?data_sync_all: FinchAPI::Models::Jobs::AutomatedListResponse::Meta::Quotas::DataSyncAll + ) -> void + + def to_hash: -> FinchAPI::Models::Jobs::AutomatedListResponse::Meta::quotas + + type data_sync_all = + { allowed_refreshes: Integer, remaining_refreshes: Integer } + + class DataSyncAll < FinchAPI::BaseModel + attr_reader allowed_refreshes: Integer? + + def allowed_refreshes=: (Integer) -> Integer + + attr_reader remaining_refreshes: Integer? + + def remaining_refreshes=: (Integer) -> Integer + + def initialize: ( + ?allowed_refreshes: Integer, + ?remaining_refreshes: Integer + ) -> void + + def to_hash: -> FinchAPI::Models::Jobs::AutomatedListResponse::Meta::Quotas::data_sync_all + end + end + end + 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 index 0f4a887c..9a06a75c 100644 --- a/sig/finch-api/models/jobs/automated_retrieve_params.rbs +++ b/sig/finch-api/models/jobs/automated_retrieve_params.rbs @@ -7,12 +7,7 @@ module FinchAPI 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 initialize: (?request_options: FinchAPI::request_opts) -> void def to_hash: -> FinchAPI::Models::Jobs::automated_retrieve_params end diff --git a/sig/finch-api/models/jobs/manual_async_job.rbs b/sig/finch-api/models/jobs/manual_async_job.rbs index f34b7368..aadf6f21 100644 --- a/sig/finch-api/models/jobs/manual_async_job.rbs +++ b/sig/finch-api/models/jobs/manual_async_job.rbs @@ -15,27 +15,25 @@ module FinchAPI 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 initialize: ( + body: ::Array[top]?, + job_id: String, + status: FinchAPI::Models::Jobs::ManualAsyncJob::status + ) -> void def to_hash: -> FinchAPI::Models::Jobs::manual_async_job type status = :pending | :in_progress | :error | :complete - class Status < FinchAPI::Enum + module Status + extend FinchAPI::Enum + PENDING: :pending IN_PROGRESS: :in_progress ERROR: :error COMPLETE: :complete - def self.values: -> ::Array[FinchAPI::Models::Jobs::ManualAsyncJob::status] + def self?.values: -> ::Array[FinchAPI::Models::Jobs::ManualAsyncJob::status] 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 index 83f56492..4bfcc450 100644 --- a/sig/finch-api/models/jobs/manual_retrieve_params.rbs +++ b/sig/finch-api/models/jobs/manual_retrieve_params.rbs @@ -7,12 +7,7 @@ module FinchAPI 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 initialize: (?request_options: FinchAPI::request_opts) -> void def to_hash: -> FinchAPI::Models::Jobs::manual_retrieve_params end diff --git a/sig/finch-api/models/location.rbs b/sig/finch-api/models/location.rbs index 861e5e81..a77a748a 100644 --- a/sig/finch-api/models/location.rbs +++ b/sig/finch-api/models/location.rbs @@ -29,18 +29,16 @@ module FinchAPI 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 initialize: ( + ?city: String?, + ?country: String?, + ?line1: String?, + ?line2: String?, + ?name: String?, + ?postal_code: String?, + ?source_id: String?, + ?state: String? + ) -> void def to_hash: -> FinchAPI::Models::location end diff --git a/sig/finch-api/models/money.rbs b/sig/finch-api/models/money.rbs index 93ba9be1..bc163b02 100644 --- a/sig/finch-api/models/money.rbs +++ b/sig/finch-api/models/money.rbs @@ -9,9 +9,7 @@ module FinchAPI def currency=: (String) -> String - def initialize: - (amount: Integer?, currency: String) -> void - | (?FinchAPI::Models::money | FinchAPI::BaseModel data) -> void + def initialize: (?amount: Integer?, ?currency: String) -> void def to_hash: -> FinchAPI::Models::money end diff --git a/sig/finch-api/models/operation_support.rbs b/sig/finch-api/models/operation_support.rbs index 29596ac6..55fd1aab 100644 --- a/sig/finch-api/models/operation_support.rbs +++ b/sig/finch-api/models/operation_support.rbs @@ -6,13 +6,15 @@ module FinchAPI | :not_supported_by_provider | :client_access_only - class OperationSupport < FinchAPI::Enum + module OperationSupport + extend 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] + 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 index 4de3319e..d75af6e9 100644 --- a/sig/finch-api/models/operation_support_matrix.rbs +++ b/sig/finch-api/models/operation_support_matrix.rbs @@ -33,16 +33,12 @@ module FinchAPI 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 initialize: ( + ?create: FinchAPI::Models::operation_support, + ?delete: FinchAPI::Models::operation_support, + ?read: FinchAPI::Models::operation_support, + ?update: FinchAPI::Models::operation_support + ) -> void def to_hash: -> FinchAPI::Models::operation_support_matrix end diff --git a/sig/finch-api/models/paging.rbs b/sig/finch-api/models/paging.rbs index 39a39337..5c2ec264 100644 --- a/sig/finch-api/models/paging.rbs +++ b/sig/finch-api/models/paging.rbs @@ -11,9 +11,7 @@ module FinchAPI def offset=: (Integer) -> Integer - def initialize: - (count: Integer, offset: Integer) -> void - | (?FinchAPI::Models::paging | FinchAPI::BaseModel data) -> void + def initialize: (?count: Integer, ?offset: Integer) -> void def to_hash: -> FinchAPI::Models::paging end diff --git a/sig/finch-api/models/pay_statement_event.rbs b/sig/finch-api/models/pay_statement_event.rbs index d63c7ee0..8ecfbf4a 100644 --- a/sig/finch-api/models/pay_statement_event.rbs +++ b/sig/finch-api/models/pay_statement_event.rbs @@ -7,26 +7,22 @@ module FinchAPI } class PayStatementEvent < FinchAPI::Models::BaseWebhookEvent - attr_reader data: FinchAPI::Models::PayStatementEvent::Data? + def data: -> FinchAPI::Models::PayStatementEvent::Data? def data=: ( - FinchAPI::Models::PayStatementEvent::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? def event_type=: ( - FinchAPI::Models::PayStatementEvent::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 initialize: ( + ?data: FinchAPI::Models::PayStatementEvent::Data, + ?event_type: FinchAPI::Models::PayStatementEvent::event_type + ) -> void def to_hash: -> FinchAPI::Models::pay_statement_event @@ -41,12 +37,7 @@ module FinchAPI def payment_id=: (String) -> String - def initialize: - (individual_id: String, payment_id: String) -> void - | ( - ?FinchAPI::Models::PayStatementEvent::data - | FinchAPI::BaseModel data - ) -> void + def initialize: (?individual_id: String, ?payment_id: String) -> void def to_hash: -> FinchAPI::Models::PayStatementEvent::data end @@ -56,12 +47,14 @@ module FinchAPI | :"pay_statement.updated" | :"pay_statement.deleted" - class EventType < FinchAPI::Enum + module EventType + extend 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] + def self?.values: -> ::Array[FinchAPI::Models::PayStatementEvent::event_type] end end end diff --git a/sig/finch-api/models/payment_event.rbs b/sig/finch-api/models/payment_event.rbs index cd15675a..252c7d00 100644 --- a/sig/finch-api/models/payment_event.rbs +++ b/sig/finch-api/models/payment_event.rbs @@ -7,24 +7,22 @@ module FinchAPI } class PaymentEvent < FinchAPI::Models::BaseWebhookEvent - attr_reader data: FinchAPI::Models::PaymentEvent::Data? + def data: -> FinchAPI::Models::PaymentEvent::Data? def data=: ( - FinchAPI::Models::PaymentEvent::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? def event_type=: ( - FinchAPI::Models::PaymentEvent::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 initialize: ( + ?data: FinchAPI::Models::PaymentEvent::Data, + ?event_type: FinchAPI::Models::PaymentEvent::event_type + ) -> void def to_hash: -> FinchAPI::Models::payment_event @@ -35,11 +33,7 @@ module FinchAPI attr_accessor payment_id: String - def initialize: - (pay_date: String, payment_id: String) -> void - | ( - ?FinchAPI::Models::PaymentEvent::data | FinchAPI::BaseModel data - ) -> void + def initialize: (pay_date: String, payment_id: String) -> void def to_hash: -> FinchAPI::Models::PaymentEvent::data end @@ -47,12 +41,14 @@ module FinchAPI type event_type = :"payment.created" | :"payment.updated" | :"payment.deleted" - class EventType < FinchAPI::Enum + module EventType + extend FinchAPI::Enum + PAYMENT_CREATED: :"payment.created" PAYMENT_UPDATED: :"payment.updated" PAYMENT_DELETED: :"payment.deleted" - def self.values: -> ::Array[FinchAPI::Models::PaymentEvent::event_type] + def self?.values: -> ::Array[FinchAPI::Models::PaymentEvent::event_type] 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 index 16422c5c..678483f7 100644 --- a/sig/finch-api/models/payroll/pay_group_list_params.rbs +++ b/sig/finch-api/models/payroll/pay_group_list_params.rbs @@ -17,16 +17,11 @@ module FinchAPI 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 initialize: ( + ?individual_id: String, + ?pay_frequencies: ::Array[String], + ?request_options: FinchAPI::request_opts + ) -> void def to_hash: -> FinchAPI::Models::Payroll::pay_group_list_params 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 index b05254c2..4604e029 100644 --- a/sig/finch-api/models/payroll/pay_group_list_response.rbs +++ b/sig/finch-api/models/payroll/pay_group_list_response.rbs @@ -23,16 +23,11 @@ module FinchAPI ::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 initialize: ( + ?id: String, + ?name: String, + ?pay_frequencies: ::Array[FinchAPI::Models::Payroll::PayGroupListResponse::pay_frequency] + ) -> void def to_hash: -> FinchAPI::Models::Payroll::pay_group_list_response @@ -47,7 +42,9 @@ module FinchAPI | :daily | :other - class PayFrequency < FinchAPI::Enum + module PayFrequency + extend FinchAPI::Enum + ANNUALLY: :annually SEMI_ANNUALLY: :semi_annually QUARTERLY: :quarterly @@ -58,7 +55,7 @@ module FinchAPI DAILY: :daily OTHER: :other - def self.values: -> ::Array[FinchAPI::Models::Payroll::PayGroupListResponse::pay_frequency] + def self?.values: -> ::Array[FinchAPI::Models::Payroll::PayGroupListResponse::pay_frequency] 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 index 73f7c953..11199b48 100644 --- a/sig/finch-api/models/payroll/pay_group_retrieve_params.rbs +++ b/sig/finch-api/models/payroll/pay_group_retrieve_params.rbs @@ -7,12 +7,7 @@ module FinchAPI 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 initialize: (?request_options: FinchAPI::request_opts) -> void def to_hash: -> FinchAPI::Models::Payroll::pay_group_retrieve_params 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 index a044159b..25ef7ffd 100644 --- a/sig/finch-api/models/payroll/pay_group_retrieve_response.rbs +++ b/sig/finch-api/models/payroll/pay_group_retrieve_response.rbs @@ -18,17 +18,12 @@ module FinchAPI 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 initialize: ( + id: String, + individual_ids: ::Array[String], + name: String, + pay_frequencies: ::Array[FinchAPI::Models::Payroll::PayGroupRetrieveResponse::pay_frequency] + ) -> void def to_hash: -> FinchAPI::Models::Payroll::pay_group_retrieve_response @@ -43,7 +38,9 @@ module FinchAPI | :daily | :other - class PayFrequency < FinchAPI::Enum + module PayFrequency + extend FinchAPI::Enum + ANNUALLY: :annually SEMI_ANNUALLY: :semi_annually QUARTERLY: :quarterly @@ -54,7 +51,7 @@ module FinchAPI DAILY: :daily OTHER: :other - def self.values: -> ::Array[FinchAPI::Models::Payroll::PayGroupRetrieveResponse::pay_frequency] + def self?.values: -> ::Array[FinchAPI::Models::Payroll::PayGroupRetrieveResponse::pay_frequency] end end end diff --git a/sig/finch-api/models/provider.rbs b/sig/finch-api/models/provider.rbs index 7b923ce5..10f6b411 100644 --- a/sig/finch-api/models/provider.rbs +++ b/sig/finch-api/models/provider.rbs @@ -57,20 +57,18 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::provider @@ -92,16 +90,11 @@ module FinchAPI 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 initialize: ( + ?benefits_support: FinchAPI::Models::HRIS::BenefitsSupport?, + ?supported_fields: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields?, + ?type: FinchAPI::Models::Provider::AuthenticationMethod::type_ + ) -> void def to_hash: -> FinchAPI::Models::Provider::authentication_method @@ -159,20 +152,15 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::supported_fields @@ -234,22 +222,17 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::company @@ -283,18 +266,13 @@ module FinchAPI 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 initialize: ( + ?account_name: bool, + ?account_number: bool, + ?account_type: bool, + ?institution_name: bool, + ?routing_number: bool + ) -> void def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::accounts end @@ -316,15 +294,10 @@ module FinchAPI 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 initialize: ( + ?name: bool, + ?parent: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments::Parent + ) -> void def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::departments @@ -335,12 +308,7 @@ module FinchAPI def name=: (bool) -> bool - def initialize: - (name: bool) -> void - | ( - ?FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments::parent - | FinchAPI::BaseModel data - ) -> void + def initialize: (?name: bool) -> void def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::Departments::parent end @@ -357,12 +325,7 @@ module FinchAPI def type=: (bool) -> bool - def initialize: - (subtype: bool, type: bool) -> void - | ( - ?FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::entity - | FinchAPI::BaseModel data - ) -> void + def initialize: (?subtype: bool, ?type: bool) -> void def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::entity end @@ -402,19 +365,14 @@ module FinchAPI 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 initialize: ( + ?city: bool, + ?country: bool, + ?line1: bool, + ?line2: bool, + ?postal_code: bool, + ?state: bool + ) -> void def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Company::locations end @@ -439,15 +397,10 @@ module FinchAPI 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 initialize: ( + ?individuals: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals, + ?paging: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Paging + ) -> void def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::directory @@ -493,20 +446,15 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::individuals @@ -517,12 +465,7 @@ module FinchAPI def id=: (bool) -> bool - def initialize: - (id: bool) -> void - | ( - ?FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals::manager - | FinchAPI::BaseModel data - ) -> void + def initialize: (?id: bool) -> void def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::Individuals::manager end @@ -539,12 +482,7 @@ module FinchAPI def offset=: (bool) -> bool - def initialize: - (count: bool, offset: bool) -> void - | ( - ?FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::paging - | FinchAPI::BaseModel data - ) -> void + def initialize: (?count: bool, ?offset: bool) -> void def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Directory::paging end @@ -650,30 +588,25 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::employment @@ -684,12 +617,7 @@ module FinchAPI def name=: (bool) -> bool - def initialize: - (name: bool) -> void - | ( - ?FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::department - | FinchAPI::BaseModel data - ) -> void + def initialize: (?name: bool) -> void def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::department end @@ -705,12 +633,7 @@ module FinchAPI def type=: (bool) -> bool - def initialize: - (subtype: bool, type: bool) -> void - | ( - ?FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::employment - | FinchAPI::BaseModel data - ) -> void + def initialize: (?subtype: bool, ?type: bool) -> void def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::employment end @@ -730,12 +653,11 @@ module FinchAPI 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 initialize: ( + ?amount: bool, + ?currency: bool, + ?unit: bool + ) -> void def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::income end @@ -775,19 +697,14 @@ module FinchAPI 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 initialize: ( + ?city: bool, + ?country: bool, + ?line1: bool, + ?line2: bool, + ?postal_code: bool, + ?state: bool + ) -> void def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::location end @@ -799,12 +716,7 @@ module FinchAPI def id=: (bool) -> bool - def initialize: - (id: bool) -> void - | ( - ?FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::manager - | FinchAPI::BaseModel data - ) -> void + def initialize: (?id: bool) -> void def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Employment::manager end @@ -886,26 +798,21 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::individual @@ -920,12 +827,7 @@ module FinchAPI def type=: (bool) -> bool - def initialize: - (data: bool, type: bool) -> void - | ( - ?FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::emails - | FinchAPI::BaseModel data - ) -> void + def initialize: (?data: bool, ?type: bool) -> void def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::emails end @@ -941,12 +843,7 @@ module FinchAPI def type=: (bool) -> bool - def initialize: - (data: bool, type: bool) -> void - | ( - ?FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::phone_numbers - | FinchAPI::BaseModel data - ) -> void + def initialize: (?data: bool, ?type: bool) -> void def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::phone_numbers end @@ -986,19 +883,14 @@ module FinchAPI 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 initialize: ( + ?city: bool, + ?country: bool, + ?line1: bool, + ?line2: bool, + ?postal_code: bool, + ?state: bool + ) -> void def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Individual::residence end @@ -1029,17 +921,12 @@ module FinchAPI 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 initialize: ( + ?id: bool, + ?individual_ids: bool, + ?name: bool, + ?pay_frequencies: bool + ) -> void def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::pay_group end @@ -1063,15 +950,10 @@ module FinchAPI 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 initialize: ( + ?paging: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::Paging, + ?pay_statements: FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements + ) -> void def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::pay_statement @@ -1082,12 +964,7 @@ module FinchAPI attr_accessor offset: bool - def initialize: - (count: bool, offset: bool) -> void - | ( - ?FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::paging - | FinchAPI::BaseModel data - ) -> void + def initialize: (count: bool, offset: bool) -> void def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::paging end @@ -1155,23 +1032,18 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::pay_statements @@ -1195,12 +1067,12 @@ module FinchAPI 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 initialize: ( + ?amount: bool, + ?currency: bool, + ?name: bool, + ?type: bool + ) -> void def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::earnings end @@ -1235,18 +1107,13 @@ module FinchAPI 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 initialize: ( + ?amount: bool, + ?currency: bool, + ?name: bool, + ?pre_tax: bool, + ?type: bool + ) -> void def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::employee_deductions end @@ -1267,12 +1134,11 @@ module FinchAPI 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 initialize: ( + ?amount: bool, + ?currency: bool, + ?name: bool + ) -> void def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::employer_contributions end @@ -1307,18 +1173,13 @@ module FinchAPI 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 initialize: ( + ?amount: bool, + ?currency: bool, + ?employer: bool, + ?name: bool, + ?type: bool + ) -> void def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::PayStatement::PayStatements::taxes end @@ -1392,25 +1253,20 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::payment @@ -1425,12 +1281,7 @@ module FinchAPI 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 initialize: (?end_date: bool, ?start_date: bool) -> void def to_hash: -> FinchAPI::Models::Provider::AuthenticationMethod::SupportedFields::Payment::pay_period end @@ -1440,14 +1291,16 @@ module FinchAPI type type_ = :assisted | :credential | :api_token | :api_credential | :oauth - class Type < FinchAPI::Enum + module Type + extend 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_] + def self?.values: -> ::Array[FinchAPI::Models::Provider::AuthenticationMethod::type_] end end end diff --git a/sig/finch-api/models/provider_list_params.rbs b/sig/finch-api/models/provider_list_params.rbs index 13195874..08a78938 100644 --- a/sig/finch-api/models/provider_list_params.rbs +++ b/sig/finch-api/models/provider_list_params.rbs @@ -6,11 +6,7 @@ module FinchAPI 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 initialize: (?request_options: FinchAPI::request_opts) -> void def to_hash: -> FinchAPI::Models::provider_list_params end diff --git a/sig/finch-api/models/request_forwarding_forward_params.rbs b/sig/finch-api/models/request_forwarding_forward_params.rbs index 22f59027..1551bffb 100644 --- a/sig/finch-api/models/request_forwarding_forward_params.rbs +++ b/sig/finch-api/models/request_forwarding_forward_params.rbs @@ -24,19 +24,14 @@ module FinchAPI 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 initialize: ( + method_: String, + route: String, + ?data: String?, + ?headers: top?, + ?params: top?, + ?request_options: FinchAPI::request_opts + ) -> void def to_hash: -> FinchAPI::Models::request_forwarding_forward_params end diff --git a/sig/finch-api/models/request_forwarding_forward_response.rbs b/sig/finch-api/models/request_forwarding_forward_response.rbs index 3e822ec2..f610a1d2 100644 --- a/sig/finch-api/models/request_forwarding_forward_response.rbs +++ b/sig/finch-api/models/request_forwarding_forward_response.rbs @@ -17,17 +17,12 @@ module FinchAPI 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 initialize: ( + data: String?, + headers: top?, + request: FinchAPI::Models::RequestForwardingForwardResponse::Request, + status_code: Integer + ) -> void def to_hash: -> FinchAPI::Models::request_forwarding_forward_response @@ -51,18 +46,13 @@ module FinchAPI 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 initialize: ( + data: String?, + headers: top?, + method_: String, + params: top?, + route: String + ) -> void def to_hash: -> FinchAPI::Models::RequestForwardingForwardResponse::request end diff --git a/sig/finch-api/models/sandbox/company_update_params.rbs b/sig/finch-api/models/sandbox/company_update_params.rbs index 4e1fbf00..6ed708e3 100644 --- a/sig/finch-api/models/sandbox/company_update_params.rbs +++ b/sig/finch-api/models/sandbox/company_update_params.rbs @@ -34,22 +34,17 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::Sandbox::company_update_params @@ -73,28 +68,25 @@ module FinchAPI 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 initialize: ( + ?account_name: String?, + ?account_number: String?, + ?account_type: FinchAPI::Models::Sandbox::CompanyUpdateParams::Account::account_type?, + ?institution_name: String?, + ?routing_number: String? + ) -> void def to_hash: -> FinchAPI::Models::Sandbox::CompanyUpdateParams::account type account_type = :checking | :savings - class AccountType < FinchAPI::Enum + module AccountType + extend FinchAPI::Enum + CHECKING: :checking SAVINGS: :savings - def self.values: -> ::Array[FinchAPI::Models::Sandbox::CompanyUpdateParams::Account::account_type] + def self?.values: -> ::Array[FinchAPI::Models::Sandbox::CompanyUpdateParams::Account::account_type] end end @@ -109,15 +101,10 @@ module FinchAPI 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 initialize: ( + ?name: String?, + ?parent: FinchAPI::Models::Sandbox::CompanyUpdateParams::Department::Parent? + ) -> void def to_hash: -> FinchAPI::Models::Sandbox::CompanyUpdateParams::department @@ -126,12 +113,7 @@ module FinchAPI class Parent < FinchAPI::BaseModel attr_accessor name: String? - def initialize: - (name: String?) -> void - | ( - ?FinchAPI::Models::Sandbox::CompanyUpdateParams::Department::parent - | FinchAPI::BaseModel data - ) -> void + def initialize: (?name: String?) -> void def to_hash: -> FinchAPI::Models::Sandbox::CompanyUpdateParams::Department::parent end @@ -148,26 +130,23 @@ module FinchAPI 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 initialize: ( + ?subtype: FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::subtype?, + ?type: FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::type_? + ) -> void def to_hash: -> FinchAPI::Models::Sandbox::CompanyUpdateParams::entity type subtype = :s_corporation | :c_corporation | :b_corporation - class Subtype < FinchAPI::Enum + module Subtype + extend FinchAPI::Enum + S_CORPORATION: :s_corporation C_CORPORATION: :c_corporation B_CORPORATION: :b_corporation - def self.values: -> ::Array[FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::subtype] + def self?.values: -> ::Array[FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::subtype] end type type_ = @@ -179,7 +158,9 @@ module FinchAPI | :partnership | :cooperative - class Type < FinchAPI::Enum + module Type + extend FinchAPI::Enum + LLC: :llc LP: :lp CORPORATION: :corporation @@ -188,7 +169,7 @@ module FinchAPI PARTNERSHIP: :partnership COOPERATIVE: :cooperative - def self.values: -> ::Array[FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::type_] + def self?.values: -> ::Array[FinchAPI::Models::Sandbox::CompanyUpdateParams::Entity::type_] 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 index 09108745..f1c9dc63 100644 --- a/sig/finch-api/models/sandbox/company_update_response.rbs +++ b/sig/finch-api/models/sandbox/company_update_response.rbs @@ -30,21 +30,16 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::Sandbox::company_update_response @@ -68,28 +63,25 @@ module FinchAPI 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 initialize: ( + ?account_name: String?, + ?account_number: String?, + ?account_type: FinchAPI::Models::Sandbox::CompanyUpdateResponse::Account::account_type?, + ?institution_name: String?, + ?routing_number: String? + ) -> void def to_hash: -> FinchAPI::Models::Sandbox::CompanyUpdateResponse::account type account_type = :checking | :savings - class AccountType < FinchAPI::Enum + module AccountType + extend FinchAPI::Enum + CHECKING: :checking SAVINGS: :savings - def self.values: -> ::Array[FinchAPI::Models::Sandbox::CompanyUpdateResponse::Account::account_type] + def self?.values: -> ::Array[FinchAPI::Models::Sandbox::CompanyUpdateResponse::Account::account_type] end end @@ -104,15 +96,10 @@ module FinchAPI 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 initialize: ( + ?name: String?, + ?parent: FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department::Parent? + ) -> void def to_hash: -> FinchAPI::Models::Sandbox::CompanyUpdateResponse::department @@ -121,12 +108,7 @@ module FinchAPI class Parent < FinchAPI::BaseModel attr_accessor name: String? - def initialize: - (name: String?) -> void - | ( - ?FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department::parent - | FinchAPI::BaseModel data - ) -> void + def initialize: (?name: String?) -> void def to_hash: -> FinchAPI::Models::Sandbox::CompanyUpdateResponse::Department::parent end @@ -143,26 +125,23 @@ module FinchAPI 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 initialize: ( + ?subtype: FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::subtype?, + ?type: FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::type_? + ) -> void def to_hash: -> FinchAPI::Models::Sandbox::CompanyUpdateResponse::entity type subtype = :s_corporation | :c_corporation | :b_corporation - class Subtype < FinchAPI::Enum + module Subtype + extend FinchAPI::Enum + S_CORPORATION: :s_corporation C_CORPORATION: :c_corporation B_CORPORATION: :b_corporation - def self.values: -> ::Array[FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::subtype] + def self?.values: -> ::Array[FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::subtype] end type type_ = @@ -174,7 +153,9 @@ module FinchAPI | :partnership | :cooperative - class Type < FinchAPI::Enum + module Type + extend FinchAPI::Enum + LLC: :llc LP: :lp CORPORATION: :corporation @@ -183,7 +164,7 @@ module FinchAPI PARTNERSHIP: :partnership COOPERATIVE: :cooperative - def self.values: -> ::Array[FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::type_] + def self?.values: -> ::Array[FinchAPI::Models::Sandbox::CompanyUpdateResponse::Entity::type_] 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 index 9e0f18eb..67a6b792 100644 --- a/sig/finch-api/models/sandbox/connection_create_params.rbs +++ b/sig/finch-api/models/sandbox/connection_create_params.rbs @@ -30,30 +30,27 @@ module FinchAPI 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 initialize: ( + provider_id: String, + ?authentication_type: FinchAPI::Models::Sandbox::ConnectionCreateParams::authentication_type, + ?employee_size: Integer, + ?products: ::Array[String], + ?request_options: FinchAPI::request_opts + ) -> void def to_hash: -> FinchAPI::Models::Sandbox::connection_create_params type authentication_type = :credential | :api_token | :oauth | :assisted - class AuthenticationType < FinchAPI::Enum + module AuthenticationType + extend FinchAPI::Enum + CREDENTIAL: :credential API_TOKEN: :api_token OAUTH: :oauth ASSISTED: :assisted - def self.values: -> ::Array[FinchAPI::Models::Sandbox::ConnectionCreateParams::authentication_type] + def self?.values: -> ::Array[FinchAPI::Models::Sandbox::ConnectionCreateParams::authentication_type] 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 index 9fb7be9d..a42a0068 100644 --- a/sig/finch-api/models/sandbox/connection_create_response.rbs +++ b/sig/finch-api/models/sandbox/connection_create_response.rbs @@ -32,33 +32,30 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::Sandbox::connection_create_response type authentication_type = :credential | :api_token | :oauth | :assisted - class AuthenticationType < FinchAPI::Enum + module AuthenticationType + extend FinchAPI::Enum + CREDENTIAL: :credential API_TOKEN: :api_token OAUTH: :oauth ASSISTED: :assisted - def self.values: -> ::Array[FinchAPI::Models::Sandbox::ConnectionCreateResponse::authentication_type] + def self?.values: -> ::Array[FinchAPI::Models::Sandbox::ConnectionCreateResponse::authentication_type] 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 index a8972f84..e0269f75 100644 --- a/sig/finch-api/models/sandbox/connections/account_create_params.rbs +++ b/sig/finch-api/models/sandbox/connections/account_create_params.rbs @@ -29,31 +29,28 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::Sandbox::Connections::account_create_params type authentication_type = :credential | :api_token | :oauth | :assisted - class AuthenticationType < FinchAPI::Enum + module AuthenticationType + extend FinchAPI::Enum + CREDENTIAL: :credential API_TOKEN: :api_token OAUTH: :oauth ASSISTED: :assisted - def self.values: -> ::Array[FinchAPI::Models::Sandbox::Connections::AccountCreateParams::authentication_type] + def self?.values: -> ::Array[FinchAPI::Models::Sandbox::Connections::AccountCreateParams::authentication_type] 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 index c0104e87..1dda3ee7 100644 --- a/sig/finch-api/models/sandbox/connections/account_create_response.rbs +++ b/sig/finch-api/models/sandbox/connections/account_create_response.rbs @@ -28,33 +28,30 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::Sandbox::Connections::account_create_response type authentication_type = :credential | :api_token | :oauth | :assisted - class AuthenticationType < FinchAPI::Enum + module AuthenticationType + extend FinchAPI::Enum + CREDENTIAL: :credential API_TOKEN: :api_token OAUTH: :oauth ASSISTED: :assisted - def self.values: -> ::Array[FinchAPI::Models::Sandbox::Connections::AccountCreateResponse::authentication_type] + def self?.values: -> ::Array[FinchAPI::Models::Sandbox::Connections::AccountCreateResponse::authentication_type] 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 index 0a957a3d..bf37b69b 100644 --- a/sig/finch-api/models/sandbox/connections/account_update_params.rbs +++ b/sig/finch-api/models/sandbox/connections/account_update_params.rbs @@ -16,15 +16,10 @@ module FinchAPI 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 initialize: ( + ?connection_status: FinchAPI::Models::connection_status_type, + ?request_options: FinchAPI::request_opts + ) -> void def to_hash: -> FinchAPI::Models::Sandbox::Connections::account_update_params 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 index 7f5dc7d6..09d2e17c 100644 --- a/sig/finch-api/models/sandbox/connections/account_update_response.rbs +++ b/sig/finch-api/models/sandbox/connections/account_update_response.rbs @@ -27,32 +27,29 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::Sandbox::Connections::account_update_response type authentication_type = :credential | :api_token | :oauth | :assisted - class AuthenticationType < FinchAPI::Enum + module AuthenticationType + extend FinchAPI::Enum + CREDENTIAL: :credential API_TOKEN: :api_token OAUTH: :oauth ASSISTED: :assisted - def self.values: -> ::Array[FinchAPI::Models::Sandbox::Connections::AccountUpdateResponse::authentication_type] + def self?.values: -> ::Array[FinchAPI::Models::Sandbox::Connections::AccountUpdateResponse::authentication_type] 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 index b10a9b2a..9bf5b78c 100644 --- a/sig/finch-api/models/sandbox/directory_create_params.rbs +++ b/sig/finch-api/models/sandbox/directory_create_params.rbs @@ -17,15 +17,10 @@ module FinchAPI ::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 initialize: ( + ?body: ::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body], + ?request_options: FinchAPI::request_opts + ) -> void def to_hash: -> FinchAPI::Models::Sandbox::directory_create_params @@ -121,40 +116,35 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::Sandbox::DirectoryCreateParams::body @@ -167,12 +157,7 @@ module FinchAPI def value=: (top) -> top - def initialize: - (name: String?, value: top) -> void - | ( - ?FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::custom_field - | FinchAPI::BaseModel data - ) -> void + def initialize: (?name: String?, ?value: top) -> void def to_hash: -> FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::custom_field end @@ -182,12 +167,7 @@ module FinchAPI class Department < FinchAPI::BaseModel attr_accessor name: String? - def initialize: - (name: String?) -> void - | ( - ?FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::department - | FinchAPI::BaseModel data - ) -> void + def initialize: (?name: String?) -> void def to_hash: -> FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::department end @@ -205,25 +185,22 @@ module FinchAPI 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 initialize: ( + ?data: String, + ?type: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Email::type_? + ) -> void def to_hash: -> FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::email type type_ = :work | :personal - class Type < FinchAPI::Enum + module Type + extend FinchAPI::Enum + WORK: :work PERSONAL: :personal - def self.values: -> ::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Email::type_] + def self?.values: -> ::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Email::type_] end end @@ -238,15 +215,10 @@ module FinchAPI 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 initialize: ( + ?subtype: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::subtype?, + ?type: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::type_? + ) -> void def to_hash: -> FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::employment @@ -258,7 +230,9 @@ module FinchAPI | :seasonal | :individual_contractor - class Subtype < FinchAPI::Enum + module Subtype + extend FinchAPI::Enum + FULL_TIME: :full_time INTERN: :intern PART_TIME: :part_time @@ -266,16 +240,18 @@ module FinchAPI SEASONAL: :seasonal INDIVIDUAL_CONTRACTOR: :individual_contractor - def self.values: -> ::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::subtype] + def self?.values: -> ::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::subtype] end type type_ = :employee | :contractor - class Type < FinchAPI::Enum + module Type + extend FinchAPI::Enum + EMPLOYEE: :employee CONTRACTOR: :contractor - def self.values: -> ::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::type_] + def self?.values: -> ::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::Employment::type_] end end @@ -288,7 +264,9 @@ module FinchAPI | :retired | :terminated - class EmploymentStatus < FinchAPI::Enum + module EmploymentStatus + extend FinchAPI::Enum + ACTIVE: :active DECEASED: :deceased LEAVE: :leave @@ -297,7 +275,7 @@ module FinchAPI RETIRED: :retired TERMINATED: :terminated - def self.values: -> ::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::employment_status] + def self?.values: -> ::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::employment_status] end type ethnicity = @@ -310,7 +288,9 @@ module FinchAPI | :two_or_more_races | :decline_to_specify - class Ethnicity < FinchAPI::Enum + module Ethnicity + extend FinchAPI::Enum + ASIAN: :asian WHITE: :white BLACK_OR_AFRICAN_AMERICAN: :black_or_african_american @@ -320,18 +300,20 @@ module FinchAPI TWO_OR_MORE_RACES: :two_or_more_races DECLINE_TO_SPECIFY: :decline_to_specify - def self.values: -> ::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::ethnicity] + def self?.values: -> ::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::ethnicity] end type gender = :female | :male | :other | :decline_to_specify - class Gender < FinchAPI::Enum + module Gender + extend FinchAPI::Enum + FEMALE: :female MALE: :male OTHER: :other DECLINE_TO_SPECIFY: :decline_to_specify - def self.values: -> ::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::gender] + def self?.values: -> ::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::gender] end type manager = { id: String } @@ -341,12 +323,7 @@ module FinchAPI def id=: (String) -> String - def initialize: - (id: String) -> void - | ( - ?FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::manager - | FinchAPI::BaseModel data - ) -> void + def initialize: (?id: String) -> void def to_hash: -> FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::manager end @@ -364,25 +341,22 @@ module FinchAPI 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 initialize: ( + ?data: String, + ?type: FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::PhoneNumber::type_? + ) -> void def to_hash: -> FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::phone_number type type_ = :work | :personal - class Type < FinchAPI::Enum + module Type + extend FinchAPI::Enum + WORK: :work PERSONAL: :personal - def self.values: -> ::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::PhoneNumber::type_] + def self?.values: -> ::Array[FinchAPI::Models::Sandbox::DirectoryCreateParams::Body::PhoneNumber::type_] 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 index 0e17c6c9..d47b4a39 100644 --- a/sig/finch-api/models/sandbox/employment_update_params.rbs +++ b/sig/finch-api/models/sandbox/employment_update_params.rbs @@ -70,32 +70,27 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::Sandbox::employment_update_params @@ -108,12 +103,7 @@ module FinchAPI def value=: (top) -> top - def initialize: - (name: String?, value: top) -> void - | ( - ?FinchAPI::Models::Sandbox::EmploymentUpdateParams::custom_field - | FinchAPI::BaseModel data - ) -> void + def initialize: (?name: String?, ?value: top) -> void def to_hash: -> FinchAPI::Models::Sandbox::EmploymentUpdateParams::custom_field end @@ -123,12 +113,7 @@ module FinchAPI class Department < FinchAPI::BaseModel attr_accessor name: String? - def initialize: - (name: String?) -> void - | ( - ?FinchAPI::Models::Sandbox::EmploymentUpdateParams::department - | FinchAPI::BaseModel data - ) -> void + def initialize: (?name: String?) -> void def to_hash: -> FinchAPI::Models::Sandbox::EmploymentUpdateParams::department end @@ -144,15 +129,10 @@ module FinchAPI 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 initialize: ( + ?subtype: FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::subtype?, + ?type: FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::type_? + ) -> void def to_hash: -> FinchAPI::Models::Sandbox::EmploymentUpdateParams::employment @@ -164,7 +144,9 @@ module FinchAPI | :seasonal | :individual_contractor - class Subtype < FinchAPI::Enum + module Subtype + extend FinchAPI::Enum + FULL_TIME: :full_time INTERN: :intern PART_TIME: :part_time @@ -172,16 +154,18 @@ module FinchAPI SEASONAL: :seasonal INDIVIDUAL_CONTRACTOR: :individual_contractor - def self.values: -> ::Array[FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::subtype] + def self?.values: -> ::Array[FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::subtype] end type type_ = :employee | :contractor - class Type < FinchAPI::Enum + module Type + extend FinchAPI::Enum + EMPLOYEE: :employee CONTRACTOR: :contractor - def self.values: -> ::Array[FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::type_] + def self?.values: -> ::Array[FinchAPI::Models::Sandbox::EmploymentUpdateParams::Employment::type_] end end @@ -194,7 +178,9 @@ module FinchAPI | :retired | :terminated - class EmploymentStatus < FinchAPI::Enum + module EmploymentStatus + extend FinchAPI::Enum + ACTIVE: :active DECEASED: :deceased LEAVE: :leave @@ -203,7 +189,7 @@ module FinchAPI RETIRED: :retired TERMINATED: :terminated - def self.values: -> ::Array[FinchAPI::Models::Sandbox::EmploymentUpdateParams::employment_status] + def self?.values: -> ::Array[FinchAPI::Models::Sandbox::EmploymentUpdateParams::employment_status] end type manager = { id: String } @@ -213,12 +199,7 @@ module FinchAPI def id=: (String) -> String - def initialize: - (id: String) -> void - | ( - ?FinchAPI::Models::Sandbox::EmploymentUpdateParams::manager - | FinchAPI::BaseModel data - ) -> void + def initialize: (?id: String) -> void def to_hash: -> FinchAPI::Models::Sandbox::EmploymentUpdateParams::manager end diff --git a/sig/finch-api/models/sandbox/employment_update_response.rbs b/sig/finch-api/models/sandbox/employment_update_response.rbs index a4091f01..9360ac59 100644 --- a/sig/finch-api/models/sandbox/employment_update_response.rbs +++ b/sig/finch-api/models/sandbox/employment_update_response.rbs @@ -71,32 +71,27 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::Sandbox::employment_update_response @@ -109,12 +104,7 @@ module FinchAPI def value=: (top) -> top - def initialize: - (name: String?, value: top) -> void - | ( - ?FinchAPI::Models::Sandbox::EmploymentUpdateResponse::custom_field - | FinchAPI::BaseModel data - ) -> void + def initialize: (?name: String?, ?value: top) -> void def to_hash: -> FinchAPI::Models::Sandbox::EmploymentUpdateResponse::custom_field end @@ -124,12 +114,7 @@ module FinchAPI class Department < FinchAPI::BaseModel attr_accessor name: String? - def initialize: - (name: String?) -> void - | ( - ?FinchAPI::Models::Sandbox::EmploymentUpdateResponse::department - | FinchAPI::BaseModel data - ) -> void + def initialize: (?name: String?) -> void def to_hash: -> FinchAPI::Models::Sandbox::EmploymentUpdateResponse::department end @@ -145,15 +130,10 @@ module FinchAPI 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 initialize: ( + ?subtype: FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::subtype?, + ?type: FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::type_? + ) -> void def to_hash: -> FinchAPI::Models::Sandbox::EmploymentUpdateResponse::employment @@ -165,7 +145,9 @@ module FinchAPI | :seasonal | :individual_contractor - class Subtype < FinchAPI::Enum + module Subtype + extend FinchAPI::Enum + FULL_TIME: :full_time INTERN: :intern PART_TIME: :part_time @@ -173,16 +155,18 @@ module FinchAPI SEASONAL: :seasonal INDIVIDUAL_CONTRACTOR: :individual_contractor - def self.values: -> ::Array[FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::subtype] + def self?.values: -> ::Array[FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::subtype] end type type_ = :employee | :contractor - class Type < FinchAPI::Enum + module Type + extend FinchAPI::Enum + EMPLOYEE: :employee CONTRACTOR: :contractor - def self.values: -> ::Array[FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::type_] + def self?.values: -> ::Array[FinchAPI::Models::Sandbox::EmploymentUpdateResponse::Employment::type_] end end @@ -195,7 +179,9 @@ module FinchAPI | :retired | :terminated - class EmploymentStatus < FinchAPI::Enum + module EmploymentStatus + extend FinchAPI::Enum + ACTIVE: :active DECEASED: :deceased LEAVE: :leave @@ -204,7 +190,7 @@ module FinchAPI RETIRED: :retired TERMINATED: :terminated - def self.values: -> ::Array[FinchAPI::Models::Sandbox::EmploymentUpdateResponse::employment_status] + def self?.values: -> ::Array[FinchAPI::Models::Sandbox::EmploymentUpdateResponse::employment_status] end type manager = { id: String } @@ -214,12 +200,7 @@ module FinchAPI def id=: (String) -> String - def initialize: - (id: String) -> void - | ( - ?FinchAPI::Models::Sandbox::EmploymentUpdateResponse::manager - | FinchAPI::BaseModel data - ) -> void + def initialize: (?id: String) -> void def to_hash: -> FinchAPI::Models::Sandbox::EmploymentUpdateResponse::manager end diff --git a/sig/finch-api/models/sandbox/individual_update_params.rbs b/sig/finch-api/models/sandbox/individual_update_params.rbs index a1806106..b2a3240a 100644 --- a/sig/finch-api/models/sandbox/individual_update_params.rbs +++ b/sig/finch-api/models/sandbox/individual_update_params.rbs @@ -46,26 +46,21 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::Sandbox::individual_update_params @@ -82,25 +77,22 @@ module FinchAPI 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 initialize: ( + ?data: String, + ?type: FinchAPI::Models::Sandbox::IndividualUpdateParams::Email::type_? + ) -> void def to_hash: -> FinchAPI::Models::Sandbox::IndividualUpdateParams::email type type_ = :work | :personal - class Type < FinchAPI::Enum + module Type + extend FinchAPI::Enum + WORK: :work PERSONAL: :personal - def self.values: -> ::Array[FinchAPI::Models::Sandbox::IndividualUpdateParams::Email::type_] + def self?.values: -> ::Array[FinchAPI::Models::Sandbox::IndividualUpdateParams::Email::type_] end end @@ -114,7 +106,9 @@ module FinchAPI | :two_or_more_races | :decline_to_specify - class Ethnicity < FinchAPI::Enum + module Ethnicity + extend FinchAPI::Enum + ASIAN: :asian WHITE: :white BLACK_OR_AFRICAN_AMERICAN: :black_or_african_american @@ -124,18 +118,20 @@ module FinchAPI TWO_OR_MORE_RACES: :two_or_more_races DECLINE_TO_SPECIFY: :decline_to_specify - def self.values: -> ::Array[FinchAPI::Models::Sandbox::IndividualUpdateParams::ethnicity] + def self?.values: -> ::Array[FinchAPI::Models::Sandbox::IndividualUpdateParams::ethnicity] end type gender = :female | :male | :other | :decline_to_specify - class Gender < FinchAPI::Enum + module Gender + extend FinchAPI::Enum + FEMALE: :female MALE: :male OTHER: :other DECLINE_TO_SPECIFY: :decline_to_specify - def self.values: -> ::Array[FinchAPI::Models::Sandbox::IndividualUpdateParams::gender] + def self?.values: -> ::Array[FinchAPI::Models::Sandbox::IndividualUpdateParams::gender] end type phone_number = @@ -151,25 +147,22 @@ module FinchAPI 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 initialize: ( + ?data: String, + ?type: FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber::type_? + ) -> void def to_hash: -> FinchAPI::Models::Sandbox::IndividualUpdateParams::phone_number type type_ = :work | :personal - class Type < FinchAPI::Enum + module Type + extend FinchAPI::Enum + WORK: :work PERSONAL: :personal - def self.values: -> ::Array[FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber::type_] + def self?.values: -> ::Array[FinchAPI::Models::Sandbox::IndividualUpdateParams::PhoneNumber::type_] 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 index bee43ce3..5de3d53b 100644 --- a/sig/finch-api/models/sandbox/individual_update_response.rbs +++ b/sig/finch-api/models/sandbox/individual_update_response.rbs @@ -47,26 +47,21 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::Sandbox::individual_update_response @@ -83,25 +78,22 @@ module FinchAPI 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 initialize: ( + ?data: String, + ?type: FinchAPI::Models::Sandbox::IndividualUpdateResponse::Email::type_? + ) -> void def to_hash: -> FinchAPI::Models::Sandbox::IndividualUpdateResponse::email type type_ = :work | :personal - class Type < FinchAPI::Enum + module Type + extend FinchAPI::Enum + WORK: :work PERSONAL: :personal - def self.values: -> ::Array[FinchAPI::Models::Sandbox::IndividualUpdateResponse::Email::type_] + def self?.values: -> ::Array[FinchAPI::Models::Sandbox::IndividualUpdateResponse::Email::type_] end end @@ -115,7 +107,9 @@ module FinchAPI | :two_or_more_races | :decline_to_specify - class Ethnicity < FinchAPI::Enum + module Ethnicity + extend FinchAPI::Enum + ASIAN: :asian WHITE: :white BLACK_OR_AFRICAN_AMERICAN: :black_or_african_american @@ -125,18 +119,20 @@ module FinchAPI TWO_OR_MORE_RACES: :two_or_more_races DECLINE_TO_SPECIFY: :decline_to_specify - def self.values: -> ::Array[FinchAPI::Models::Sandbox::IndividualUpdateResponse::ethnicity] + def self?.values: -> ::Array[FinchAPI::Models::Sandbox::IndividualUpdateResponse::ethnicity] end type gender = :female | :male | :other | :decline_to_specify - class Gender < FinchAPI::Enum + module Gender + extend FinchAPI::Enum + FEMALE: :female MALE: :male OTHER: :other DECLINE_TO_SPECIFY: :decline_to_specify - def self.values: -> ::Array[FinchAPI::Models::Sandbox::IndividualUpdateResponse::gender] + def self?.values: -> ::Array[FinchAPI::Models::Sandbox::IndividualUpdateResponse::gender] end type phone_number = @@ -152,25 +148,22 @@ module FinchAPI 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 initialize: ( + ?data: String, + ?type: FinchAPI::Models::Sandbox::IndividualUpdateResponse::PhoneNumber::type_? + ) -> void def to_hash: -> FinchAPI::Models::Sandbox::IndividualUpdateResponse::phone_number type type_ = :work | :personal - class Type < FinchAPI::Enum + module Type + extend FinchAPI::Enum + WORK: :work PERSONAL: :personal - def self.values: -> ::Array[FinchAPI::Models::Sandbox::IndividualUpdateResponse::PhoneNumber::type_] + def self?.values: -> ::Array[FinchAPI::Models::Sandbox::IndividualUpdateResponse::PhoneNumber::type_] 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 index d631c377..0e7b8862 100644 --- a/sig/finch-api/models/sandbox/job_create_params.rbs +++ b/sig/finch-api/models/sandbox/job_create_params.rbs @@ -11,24 +11,21 @@ module FinchAPI 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 initialize: ( + type: FinchAPI::Models::Sandbox::JobCreateParams::type_, + ?request_options: FinchAPI::request_opts + ) -> void def to_hash: -> FinchAPI::Models::Sandbox::job_create_params type type_ = :data_sync_all - class Type < FinchAPI::Enum + module Type + extend FinchAPI::Enum + DATA_SYNC_ALL: :data_sync_all - def self.values: -> ::Array[FinchAPI::Models::Sandbox::JobCreateParams::type_] + def self?.values: -> ::Array[FinchAPI::Models::Sandbox::JobCreateParams::type_] 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 index 424a465d..29eb4877 100644 --- a/sig/finch-api/models/sandbox/job_create_response.rbs +++ b/sig/finch-api/models/sandbox/job_create_response.rbs @@ -18,17 +18,12 @@ module FinchAPI 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 initialize: ( + allowed_refreshes: Integer, + job_id: String, + job_url: String, + remaining_refreshes: Integer + ) -> void def to_hash: -> FinchAPI::Models::Sandbox::job_create_response 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 index f70d8c91..767087b0 100644 --- a/sig/finch-api/models/sandbox/jobs/configuration_retrieve_params.rbs +++ b/sig/finch-api/models/sandbox/jobs/configuration_retrieve_params.rbs @@ -8,12 +8,7 @@ module FinchAPI 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 initialize: (?request_options: FinchAPI::request_opts) -> void def to_hash: -> FinchAPI::Models::Sandbox::Jobs::configuration_retrieve_params 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 index c5390dc7..77d39bf2 100644 --- a/sig/finch-api/models/sandbox/jobs/configuration_update_params.rbs +++ b/sig/finch-api/models/sandbox/jobs/configuration_update_params.rbs @@ -8,12 +8,7 @@ module FinchAPI 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 initialize: (?request_options: FinchAPI::request_opts) -> void def to_hash: -> FinchAPI::Models::Sandbox::Jobs::configuration_update_params 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 index 21ccda50..c3c09985 100644 --- a/sig/finch-api/models/sandbox/jobs/sandbox_job_configuration.rbs +++ b/sig/finch-api/models/sandbox/jobs/sandbox_job_configuration.rbs @@ -13,36 +13,35 @@ module FinchAPI 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 initialize: ( + completion_status: FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::completion_status, + type: FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::type_ + ) -> void def to_hash: -> FinchAPI::Models::Sandbox::Jobs::sandbox_job_configuration type completion_status = :complete | :reauth_error | :permissions_error | :error - class CompletionStatus < FinchAPI::Enum + module CompletionStatus + extend 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] + def self?.values: -> ::Array[FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::completion_status] end type type_ = :data_sync_all - class Type < FinchAPI::Enum + module Type + extend FinchAPI::Enum + DATA_SYNC_ALL: :data_sync_all - def self.values: -> ::Array[FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::type_] + def self?.values: -> ::Array[FinchAPI::Models::Sandbox::Jobs::SandboxJobConfiguration::type_] 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 index f33ec80f..d858d2ba 100644 --- a/sig/finch-api/models/sandbox/payment_create_params.rbs +++ b/sig/finch-api/models/sandbox/payment_create_params.rbs @@ -27,17 +27,12 @@ module FinchAPI 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 initialize: ( + ?end_date: String, + ?pay_statements: ::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement], + ?start_date: String, + ?request_options: FinchAPI::request_opts + ) -> void def to_hash: -> FinchAPI::Models::Sandbox::payment_create_params @@ -78,23 +73,18 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::Sandbox::PaymentCreateParams::pay_statement @@ -121,19 +111,14 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::earning @@ -149,14 +134,9 @@ module FinchAPI 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 initialize: ( + ?metadata: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes::Metadata + ) -> void def to_hash: -> FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::attributes @@ -167,12 +147,7 @@ module FinchAPI 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 initialize: (?metadata: ::Hash[Symbol, top]) -> void def to_hash: -> FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::Attributes::metadata end @@ -193,7 +168,9 @@ module FinchAPI | :"1099" | :other - class Type < FinchAPI::Enum + module Type + extend FinchAPI::Enum + SALARY: :salary WAGE: :wage REIMBURSEMENT: :reimbursement @@ -208,7 +185,7 @@ module FinchAPI NUMBER_1099: :"1099" OTHER: :other - def self.values: -> ::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::type_] + def self?.values: -> ::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Earning::type_] end end @@ -235,19 +212,14 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::employee_deduction @@ -263,14 +235,9 @@ module FinchAPI 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 initialize: ( + ?metadata: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes::Metadata + ) -> void def to_hash: -> FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::attributes @@ -281,12 +248,7 @@ module FinchAPI 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 initialize: (?metadata: ::Hash[Symbol, top]) -> void def to_hash: -> FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployeeDeduction::Attributes::metadata end @@ -313,18 +275,13 @@ module FinchAPI 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 initialize: ( + ?amount: Integer?, + ?attributes: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes?, + ?currency: String?, + ?name: String?, + ?type: FinchAPI::Models::HRIS::benefit_type? + ) -> void def to_hash: -> FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::employer_contribution @@ -340,14 +297,9 @@ module FinchAPI 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 initialize: ( + ?metadata: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes::Metadata + ) -> void def to_hash: -> FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::attributes @@ -358,12 +310,7 @@ module FinchAPI 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 initialize: (?metadata: ::Hash[Symbol, top]) -> void def to_hash: -> FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::EmployerContribution::Attributes::metadata end @@ -372,11 +319,13 @@ module FinchAPI type payment_method = :check | :direct_deposit - class PaymentMethod < FinchAPI::Enum + module PaymentMethod + extend FinchAPI::Enum + CHECK: :check DIRECT_DEPOSIT: :direct_deposit - def self.values: -> ::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::payment_method] + def self?.values: -> ::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::payment_method] end type tax = @@ -402,19 +351,14 @@ module FinchAPI 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 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 def to_hash: -> FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::tax @@ -430,14 +374,9 @@ module FinchAPI 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 initialize: ( + ?metadata: FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes::Metadata + ) -> void def to_hash: -> FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::attributes @@ -448,12 +387,7 @@ module FinchAPI 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 initialize: (?metadata: ::Hash[Symbol, top]) -> void def to_hash: -> FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::Attributes::metadata end @@ -461,24 +395,28 @@ module FinchAPI type type_ = :state | :federal | :local | :fica - class Type < FinchAPI::Enum + module Type + extend FinchAPI::Enum + STATE: :state FEDERAL: :federal LOCAL: :local FICA: :fica - def self.values: -> ::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::Tax::type_] + 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 + module Type + extend 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_] + def self?.values: -> ::Array[FinchAPI::Models::Sandbox::PaymentCreateParams::PayStatement::type_] 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 index cf449f8f..d26afe86 100644 --- a/sig/finch-api/models/sandbox/payment_create_response.rbs +++ b/sig/finch-api/models/sandbox/payment_create_response.rbs @@ -8,12 +8,7 @@ module FinchAPI 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 initialize: (pay_date: String, payment_id: String) -> void def to_hash: -> FinchAPI::Models::Sandbox::payment_create_response end diff --git a/sig/finch-api/models/webhook_event.rbs b/sig/finch-api/models/webhook_event.rbs index aa6a84b3..b6870bda 100644 --- a/sig/finch-api/models/webhook_event.rbs +++ b/sig/finch-api/models/webhook_event.rbs @@ -2,16 +2,18 @@ module FinchAPI module Models type webhook_event = FinchAPI::Models::AccountUpdateEvent - | FinchAPI::Models::JobCompletionEvent | FinchAPI::Models::CompanyEvent + | FinchAPI::Models::JobCompletionEvent | 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]] + module WebhookEvent + extend FinchAPI::Union + + def self?.variants: -> [FinchAPI::Models::AccountUpdateEvent, FinchAPI::Models::CompanyEvent, FinchAPI::Models::JobCompletionEvent, FinchAPI::Models::DirectoryEvent, FinchAPI::Models::EmploymentEvent, FinchAPI::Models::IndividualEvent, FinchAPI::Models::PaymentEvent, FinchAPI::Models::PayStatementEvent] end end end diff --git a/sig/finch-api/page.rbs b/sig/finch-api/page.rbs index fb9b1943..4da9a16c 100644 --- a/sig/finch-api/page.rbs +++ b/sig/finch-api/page.rbs @@ -2,15 +2,10 @@ module FinchAPI class Page[Elem] include FinchAPI::BasePage[Elem] - attr_accessor data: ::Array[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 + def inspect: -> String end end diff --git a/sig/finch-api/pooled_net_requester.rbs b/sig/finch-api/pooled_net_requester.rbs index 80a36fd0..32ebb5b5 100644 --- a/sig/finch-api/pooled_net_requester.rbs +++ b/sig/finch-api/pooled_net_requester.rbs @@ -9,20 +9,29 @@ module FinchAPI deadline: Float } + KEEP_ALIVE_TIMEOUT: 30 + 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 + ) { + (String arg0) -> void + } -> top - private def with_pool: (URI::Generic url) { (top arg0) -> void } -> void + private def with_pool: ( + URI::Generic url, + deadline: Float + ) { + (top arg0) -> void + } -> void def execute: ( FinchAPI::PooledNetRequester::request request - ) -> [top, Enumerable[String]] + ) -> [Integer, top, Enumerable[String]] - def initialize: -> void + def initialize: (?size: Integer) -> void end end diff --git a/sig/finch-api/request_options.rbs b/sig/finch-api/request_options.rbs index 6c85d582..32a98342 100644 --- a/sig/finch-api/request_options.rbs +++ b/sig/finch-api/request_options.rbs @@ -17,7 +17,7 @@ module FinchAPI idempotency_key: String?, extra_query: ::Hash[String, (::Array[String] | String)?]?, extra_headers: ::Hash[String, String?]?, - extra_body: ::Hash[Symbol, top]?, + extra_body: top?, max_retries: Integer?, timeout: Float? } @@ -31,10 +31,14 @@ module FinchAPI attr_accessor extra_headers: ::Hash[String, String?]? - attr_accessor extra_body: ::Hash[Symbol, top]? + attr_accessor extra_body: top? attr_accessor max_retries: Integer? attr_accessor timeout: Float? + + def initialize: ( + ?FinchAPI::request_options | ::Hash[Symbol, top] values + ) -> void end end diff --git a/sig/finch-api/resources/access_tokens.rbs b/sig/finch-api/resources/access_tokens.rbs index a5f8e6ce..a7a785ef 100644 --- a/sig/finch-api/resources/access_tokens.rbs +++ b/sig/finch-api/resources/access_tokens.rbs @@ -1,17 +1,13 @@ 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 create: ( + 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 diff --git a/sig/finch-api/resources/account.rbs b/sig/finch-api/resources/account.rbs index 4731d4d7..71434068 100644 --- a/sig/finch-api/resources/account.rbs +++ b/sig/finch-api/resources/account.rbs @@ -1,23 +1,13 @@ 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 disconnect: ( + ?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 introspect: ( + ?request_options: FinchAPI::request_opts + ) -> FinchAPI::Models::Introspection def initialize: (client: FinchAPI::Client) -> void end diff --git a/sig/finch-api/resources/connect/sessions.rbs b/sig/finch-api/resources/connect/sessions.rbs index ba88be0e..3b43e61a 100644 --- a/sig/finch-api/resources/connect/sessions.rbs +++ b/sig/finch-api/resources/connect/sessions.rbs @@ -2,36 +2,26 @@ 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 new: ( + 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 reauthenticate: ( + 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 diff --git a/sig/finch-api/resources/hris/benefits.rbs b/sig/finch-api/resources/hris/benefits.rbs index 8d95c109..6c8e932f 100644 --- a/sig/finch-api/resources/hris/benefits.rbs +++ b/sig/finch-api/resources/hris/benefits.rbs @@ -4,58 +4,31 @@ module FinchAPI 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 create: ( + ?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 retrieve: ( + 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 update: ( + 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: ( + ?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 list_supported_benefits: ( + ?request_options: FinchAPI::request_opts + ) -> FinchAPI::SinglePage[FinchAPI::Models::HRIS::SupportedBenefit] def initialize: (client: FinchAPI::Client) -> void end diff --git a/sig/finch-api/resources/hris/benefits/individuals.rbs b/sig/finch-api/resources/hris/benefits/individuals.rbs index 465d2e76..7da70cdf 100644 --- a/sig/finch-api/resources/hris/benefits/individuals.rbs +++ b/sig/finch-api/resources/hris/benefits/individuals.rbs @@ -3,52 +3,28 @@ module FinchAPI 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 enroll_many: ( + 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 enrolled_ids: ( + 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 retrieve_many_benefits: ( + 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 unenroll_many: ( + 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 diff --git a/sig/finch-api/resources/hris/company.rbs b/sig/finch-api/resources/hris/company.rbs index 2bcf0434..d4772d93 100644 --- a/sig/finch-api/resources/hris/company.rbs +++ b/sig/finch-api/resources/hris/company.rbs @@ -2,14 +2,9 @@ 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 retrieve: ( + ?request_options: FinchAPI::request_opts + ) -> FinchAPI::Models::HRIS::HRISCompany def initialize: (client: FinchAPI::Client) -> void end diff --git a/sig/finch-api/resources/hris/directory.rbs b/sig/finch-api/resources/hris/directory.rbs index acb8b868..2c8d548f 100644 --- a/sig/finch-api/resources/hris/directory.rbs +++ b/sig/finch-api/resources/hris/directory.rbs @@ -2,27 +2,13 @@ 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: ( + ?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] + alias list_individuals list def initialize: (client: FinchAPI::Client) -> void end diff --git a/sig/finch-api/resources/hris/documents.rbs b/sig/finch-api/resources/hris/documents.rbs index 330be456..f760d678 100644 --- a/sig/finch-api/resources/hris/documents.rbs +++ b/sig/finch-api/resources/hris/documents.rbs @@ -2,29 +2,18 @@ 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 list: ( + ?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 retreive: ( + String document_id, + ?request_options: FinchAPI::request_opts + ) -> FinchAPI::Models::HRIS::document_retreive_response def initialize: (client: FinchAPI::Client) -> void end diff --git a/sig/finch-api/resources/hris/employments.rbs b/sig/finch-api/resources/hris/employments.rbs index 81511729..b8b1a3dc 100644 --- a/sig/finch-api/resources/hris/employments.rbs +++ b/sig/finch-api/resources/hris/employments.rbs @@ -2,15 +2,10 @@ 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 retrieve_many: ( + 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 diff --git a/sig/finch-api/resources/hris/individuals.rbs b/sig/finch-api/resources/hris/individuals.rbs index a7880ccd..68edce8b 100644 --- a/sig/finch-api/resources/hris/individuals.rbs +++ b/sig/finch-api/resources/hris/individuals.rbs @@ -2,16 +2,11 @@ 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 retrieve_many: ( + ?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 diff --git a/sig/finch-api/resources/hris/pay_statements.rbs b/sig/finch-api/resources/hris/pay_statements.rbs index 310292ca..16c8f9c0 100644 --- a/sig/finch-api/resources/hris/pay_statements.rbs +++ b/sig/finch-api/resources/hris/pay_statements.rbs @@ -2,15 +2,10 @@ 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 retrieve_many: ( + 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 diff --git a/sig/finch-api/resources/hris/payments.rbs b/sig/finch-api/resources/hris/payments.rbs index a62fcd29..ad46cd22 100644 --- a/sig/finch-api/resources/hris/payments.rbs +++ b/sig/finch-api/resources/hris/payments.rbs @@ -2,16 +2,11 @@ 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 list: ( + end_date: Date, + start_date: Date, + ?request_options: FinchAPI::request_opts + ) -> FinchAPI::SinglePage[FinchAPI::Models::HRIS::Payment] def initialize: (client: FinchAPI::Client) -> void end diff --git a/sig/finch-api/resources/jobs/automated.rbs b/sig/finch-api/resources/jobs/automated.rbs index 93150c5f..21a263c6 100644 --- a/sig/finch-api/resources/jobs/automated.rbs +++ b/sig/finch-api/resources/jobs/automated.rbs @@ -2,38 +2,22 @@ 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 create: ( + 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 retrieve: ( + 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 list: ( + ?limit: Integer, + ?offset: Integer, + ?request_options: FinchAPI::request_opts + ) -> FinchAPI::Models::Jobs::AutomatedListResponse def initialize: (client: FinchAPI::Client) -> void end diff --git a/sig/finch-api/resources/jobs/manual.rbs b/sig/finch-api/resources/jobs/manual.rbs index 503befd6..dd060893 100644 --- a/sig/finch-api/resources/jobs/manual.rbs +++ b/sig/finch-api/resources/jobs/manual.rbs @@ -2,16 +2,10 @@ 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 retrieve: ( + String job_id, + ?request_options: FinchAPI::request_opts + ) -> FinchAPI::Models::Jobs::ManualAsyncJob def initialize: (client: FinchAPI::Client) -> void end diff --git a/sig/finch-api/resources/payroll/pay_groups.rbs b/sig/finch-api/resources/payroll/pay_groups.rbs index c65a495a..d45e3439 100644 --- a/sig/finch-api/resources/payroll/pay_groups.rbs +++ b/sig/finch-api/resources/payroll/pay_groups.rbs @@ -2,27 +2,16 @@ 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 retrieve: ( + 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 list: ( + ?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 diff --git a/sig/finch-api/resources/providers.rbs b/sig/finch-api/resources/providers.rbs index 3df737da..b7d3a9af 100644 --- a/sig/finch-api/resources/providers.rbs +++ b/sig/finch-api/resources/providers.rbs @@ -1,13 +1,9 @@ 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 list: ( + ?request_options: FinchAPI::request_opts + ) -> FinchAPI::SinglePage[FinchAPI::Models::Provider] def initialize: (client: FinchAPI::Client) -> void end diff --git a/sig/finch-api/resources/request_forwarding.rbs b/sig/finch-api/resources/request_forwarding.rbs index 7b7d4ee4..a27debf7 100644 --- a/sig/finch-api/resources/request_forwarding.rbs +++ b/sig/finch-api/resources/request_forwarding.rbs @@ -1,19 +1,14 @@ 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 forward: ( + 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 diff --git a/sig/finch-api/resources/sandbox/company.rbs b/sig/finch-api/resources/sandbox/company.rbs index a9591830..61ba0f8b 100644 --- a/sig/finch-api/resources/sandbox/company.rbs +++ b/sig/finch-api/resources/sandbox/company.rbs @@ -2,22 +2,17 @@ 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 update: ( + 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 diff --git a/sig/finch-api/resources/sandbox/connections.rbs b/sig/finch-api/resources/sandbox/connections.rbs index 7e750f44..9f358336 100644 --- a/sig/finch-api/resources/sandbox/connections.rbs +++ b/sig/finch-api/resources/sandbox/connections.rbs @@ -4,18 +4,13 @@ module FinchAPI 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 create: ( + 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 diff --git a/sig/finch-api/resources/sandbox/connections/accounts.rbs b/sig/finch-api/resources/sandbox/connections/accounts.rbs index c200782e..7c2c8c23 100644 --- a/sig/finch-api/resources/sandbox/connections/accounts.rbs +++ b/sig/finch-api/resources/sandbox/connections/accounts.rbs @@ -3,28 +3,18 @@ module FinchAPI 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 create: ( + 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 update: ( + ?connection_status: FinchAPI::Models::connection_status_type, + ?request_options: FinchAPI::request_opts + ) -> FinchAPI::Models::Sandbox::Connections::AccountUpdateResponse def initialize: (client: FinchAPI::Client) -> void end diff --git a/sig/finch-api/resources/sandbox/directory.rbs b/sig/finch-api/resources/sandbox/directory.rbs index bc3cd7ca..e2a5a437 100644 --- a/sig/finch-api/resources/sandbox/directory.rbs +++ b/sig/finch-api/resources/sandbox/directory.rbs @@ -2,15 +2,10 @@ 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 create: ( + ?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 diff --git a/sig/finch-api/resources/sandbox/employment.rbs b/sig/finch-api/resources/sandbox/employment.rbs index e5c02114..fa8f2880 100644 --- a/sig/finch-api/resources/sandbox/employment.rbs +++ b/sig/finch-api/resources/sandbox/employment.rbs @@ -2,34 +2,28 @@ 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 update: ( + 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 diff --git a/sig/finch-api/resources/sandbox/individual.rbs b/sig/finch-api/resources/sandbox/individual.rbs index c1cfa425..76b23fa1 100644 --- a/sig/finch-api/resources/sandbox/individual.rbs +++ b/sig/finch-api/resources/sandbox/individual.rbs @@ -2,28 +2,22 @@ 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 update: ( + 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 diff --git a/sig/finch-api/resources/sandbox/jobs.rbs b/sig/finch-api/resources/sandbox/jobs.rbs index 6b39676f..252eb40c 100644 --- a/sig/finch-api/resources/sandbox/jobs.rbs +++ b/sig/finch-api/resources/sandbox/jobs.rbs @@ -4,15 +4,10 @@ module FinchAPI 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 create: ( + type: FinchAPI::Models::Sandbox::JobCreateParams::type_, + ?request_options: FinchAPI::request_opts + ) -> FinchAPI::Models::Sandbox::JobCreateResponse def initialize: (client: FinchAPI::Client) -> void end diff --git a/sig/finch-api/resources/sandbox/jobs/configuration.rbs b/sig/finch-api/resources/sandbox/jobs/configuration.rbs index c6bcdef1..23b6afdc 100644 --- a/sig/finch-api/resources/sandbox/jobs/configuration.rbs +++ b/sig/finch-api/resources/sandbox/jobs/configuration.rbs @@ -3,25 +3,15 @@ module FinchAPI 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 retrieve: ( + ?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 update: ( + 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 diff --git a/sig/finch-api/resources/sandbox/payment.rbs b/sig/finch-api/resources/sandbox/payment.rbs index f68c17da..6c30fa7d 100644 --- a/sig/finch-api/resources/sandbox/payment.rbs +++ b/sig/finch-api/resources/sandbox/payment.rbs @@ -2,17 +2,12 @@ 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 create: ( + ?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 diff --git a/sig/finch-api/responses_page.rbs b/sig/finch-api/responses_page.rbs index dfe5d3e0..ed66e5c0 100644 --- a/sig/finch-api/responses_page.rbs +++ b/sig/finch-api/responses_page.rbs @@ -2,13 +2,8 @@ module FinchAPI class ResponsesPage[Elem] include FinchAPI::BasePage[Elem] - attr_accessor responses: ::Array[Elem] + attr_accessor responses: ::Array[Elem]? - def initialize: ( - client: FinchAPI::BaseClient, - req: FinchAPI::BaseClient::request_components, - headers: ::Hash[String, String], - unwrapped: ::Array[top] - ) -> void + def inspect: -> String end end diff --git a/sig/finch-api/single_page.rbs b/sig/finch-api/single_page.rbs index ed1aed9d..80e999db 100644 --- a/sig/finch-api/single_page.rbs +++ b/sig/finch-api/single_page.rbs @@ -2,17 +2,12 @@ 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 + + def inspect: -> String end end diff --git a/sig/finch-api/util.rbs b/sig/finch-api/util.rbs index 0b823e57..26b7fe56 100644 --- a/sig/finch-api/util.rbs +++ b/sig/finch-api/util.rbs @@ -6,7 +6,7 @@ module FinchAPI def self?.os: -> String - def self?.primitive?: (top input) -> (bool | top) + def self?.primitive?: (top input) -> bool def self?.coerce_boolean: (top input) -> (bool | top) @@ -20,12 +20,12 @@ module FinchAPI OMIT: top - def self?.deep_merge_lr: (top lhs, top rhs, concat: bool) -> top + def self?.deep_merge_lr: (top lhs, top rhs, ?concat: bool) -> top def self?.deep_merge: ( *::Array[top] values, - sentinel: top?, - concat: bool + ?sentinel: top?, + ?concat: bool ) -> top def self?.dig: ( @@ -72,22 +72,47 @@ module FinchAPI | ::Array[(String | Integer)?])?] headers ) -> ::Hash[String, String] + class ReadIOAdapter + private def read_enum: (Integer? max_len) -> String + + def read: (?Integer? max_len, ?String? out_string) -> String? + + def initialize: ( + String | IO | StringIO | Enumerable[String] stream + ) { + (String arg0) -> void + } -> void + end + + def self?.string_io: { + (Enumerator::Yielder y) -> void + } -> Enumerable[String] + def self?.encode_multipart_formdata: ( - StringIO io, + Enumerator::Yielder y, boundary: String, key: Symbol | String, val: top ) -> void + def self?.encode_multipart_streaming: ( + top body + ) -> [String, Enumerable[String]] + 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 + ?suppress_error: bool ) -> top - def self?.fused_enum: (Enumerable[top] enum) { -> void } -> Enumerable[top] + def self?.fused_enum: ( + Enumerable[top] enum, + ?external: bool + ) { + -> void + } -> Enumerable[top] def self?.close_fused!: (Enumerable[top]? enum) -> void @@ -95,15 +120,15 @@ module FinchAPI Enumerable[top]? enum ) { (Enumerator::Yielder arg0) -> void - } -> void + } -> Enumerable[top] - type sse_message = + type server_sent_event = { event: String?, data: String?, id: String?, retry: Integer? } - def self?.enum_lines: (Enumerable[String] enum) -> Enumerable[String] + def self?.decode_lines: (Enumerable[String] enum) -> Enumerable[String] - def self?.parse_sse: ( + def self?.decode_sse: ( Enumerable[String] lines - ) -> FinchAPI::Util::sse_message + ) -> FinchAPI::Util::server_sent_event end end diff --git a/sig/finch-api/version.rbs b/sig/finch-api/version.rbs index 80866030..31b24595 100644 --- a/sig/finch-api/version.rbs +++ b/sig/finch-api/version.rbs @@ -1,3 +1,3 @@ module FinchAPI - VERSION: "0.0.1-alpha.0" + VERSION: "0.1.0-alpha.1" end diff --git a/sorbet/config b/sorbet/config new file mode 100644 index 00000000..538c1528 --- /dev/null +++ b/sorbet/config @@ -0,0 +1,2 @@ +--dir=rbi +--ignore=test/ diff --git a/test/finch-api/base_model_test.rb b/test/finch-api/base_model_test.rb index f1002ea7..53ea4094 100644 --- a/test/finch-api/base_model_test.rb +++ b/test/finch-api/base_model_test.rb @@ -3,7 +3,9 @@ require_relative "test_helper" class FinchAPI::Test::BaseModelTest < Minitest::Test - class E1 < FinchAPI::Enum + module E1 + extend FinchAPI::Enum + A = :a B = :b end @@ -22,7 +24,7 @@ def test_basic_coerce end assert_pattern do - FinchAPI::Converter.coerce(A2, %w[a b c]) => [:a, :b, :c] + FinchAPI::Converter.coerce(A2, %w[a b c]) => [:a, :b, "c"] end end @@ -222,19 +224,37 @@ def test_nested_model_dump end end + class M4 < M2 + required :c, M1 + required :d, FinchAPI::ArrayOf[M4] + required :e, M2, api_name: :f + end + + def test_model_to_h + model = M4.new(a: "wow", c: {}, d: [{}, 2, {c: {}}], f: {}) + assert_pattern do + model.to_h => {a: "wow", c: M1, d: [M4, 2, M4 => child], f: M2} + assert_equal({c: M1.new}, child.to_h) + end + end + A3 = FinchAPI::ArrayOf[A1] class M3 < M1 optional :b, E1, api_name: :renamed_again end - class U1 < FinchAPI::Union + module U1 + extend FinchAPI::Union + discriminator :type variant :a, M1 variant :b, M3 end - class U2 < FinchAPI::Union + module U2 + extend FinchAPI::Union + variant A1 variant A3 end @@ -316,12 +336,16 @@ def test_basic_const end end - class E2 < FinchAPI::Enum + module E2 + extend FinchAPI::Enum + A = :a B = :b end - class U3 < FinchAPI::Union + module U3 + extend FinchAPI::Union + discriminator :type variant :a, M1 variant :b, M3 @@ -338,4 +362,20 @@ def test_basic_eql refute_equal(U1, U2) assert_equal(U1, U3) end + + module U4 + extend FinchAPI::Union + + variant :a, const: :a + variant :b, const: :b + end + + def test_basic_const_union + assert_pattern do + U4.coerce(nil) => nil + U4.coerce("") => "" + U4.coerce(:a) => :a + U4.coerce("a") => :a + end + end end diff --git a/test/finch-api/client_test.rb b/test/finch-api/client_test.rb index 4f8f5268..f8776415 100644 --- a/test/finch-api/client_test.rb +++ b/test/finch-api/client_test.rb @@ -11,35 +11,6 @@ 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 @@ -56,7 +27,6 @@ class MockRequester # @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 @@ -65,11 +35,11 @@ def initialize(response_code, response_headers, response_data) 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] + headers = {"content-type" => "application/json", **response_headers} + [response_code, headers, response_data.grapheme_clusters] end end @@ -86,11 +56,8 @@ def test_client_default_request_default_retry_attempts 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 - ) + finch = + FinchAPI::Client.new(base_url: "http://localhost:4010", access_token: "My Access Token", max_retries: 3) requester = MockRequester.new(500, {}, {}) finch.requester = requester @@ -114,11 +81,8 @@ def test_client_default_request_given_retry_attempts 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 - ) + finch = + FinchAPI::Client.new(base_url: "http://localhost:4010", access_token: "My Access Token", max_retries: 3) requester = MockRequester.new(500, {}, {}) finch.requester = requester @@ -130,11 +94,8 @@ def test_client_given_request_given_retry_attempts end def test_client_retry_after_seconds - finch = FinchAPI::Client.new( - base_url: "http://localhost:4010", - access_token: "My Access Token", - max_retries: 1 - ) + 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 @@ -147,11 +108,8 @@ def test_client_retry_after_seconds end def test_client_retry_after_date - finch = FinchAPI::Client.new( - base_url: "http://localhost:4010", - access_token: "My Access Token", - max_retries: 1 - ) + 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 @@ -166,11 +124,8 @@ def test_client_retry_after_date end def test_client_retry_after_ms - finch = FinchAPI::Client.new( - base_url: "http://localhost:4010", - access_token: "My Access Token", - max_retries: 1 - ) + 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 diff --git a/test/finch-api/resources/hris/benefits/individuals_test.rb b/test/finch-api/resources/hris/benefits/individuals_test.rb index c38a05af..eab27de2 100644 --- a/test/finch-api/resources/hris/benefits/individuals_test.rb +++ b/test/finch-api/resources/hris/benefits/individuals_test.rb @@ -11,6 +11,8 @@ def test_enroll_many end row = response.to_enum.first + return if row.nil? + assert_pattern do row => FinchAPI::Models::HRIS::Benefits::EnrolledIndividual end @@ -47,6 +49,8 @@ def test_retrieve_many_benefits end row = response.to_enum.first + return if row.nil? + assert_pattern do row => FinchAPI::Models::HRIS::Benefits::IndividualBenefit end @@ -68,6 +72,8 @@ def test_unenroll_many end row = response.to_enum.first + return if row.nil? + assert_pattern do row => FinchAPI::Models::HRIS::Benefits::UnenrolledIndividual end diff --git a/test/finch-api/resources/hris/benefits_test.rb b/test/finch-api/resources/hris/benefits_test.rb index ab07d369..2ab6ec42 100644 --- a/test/finch-api/resources/hris/benefits_test.rb +++ b/test/finch-api/resources/hris/benefits_test.rb @@ -56,6 +56,8 @@ def test_list end row = response.to_enum.first + return if row.nil? + assert_pattern do row => FinchAPI::Models::HRIS::CompanyBenefit end @@ -78,6 +80,8 @@ def test_list_supported_benefits end row = response.to_enum.first + return if row.nil? + assert_pattern do row => FinchAPI::Models::HRIS::SupportedBenefit end diff --git a/test/finch-api/resources/hris/directory_test.rb b/test/finch-api/resources/hris/directory_test.rb index 1e40cbe6..e463f67a 100644 --- a/test/finch-api/resources/hris/directory_test.rb +++ b/test/finch-api/resources/hris/directory_test.rb @@ -11,6 +11,8 @@ def test_list end row = response.to_enum.first + return if row.nil? + assert_pattern do row => FinchAPI::Models::HRIS::IndividualInDirectory end @@ -36,6 +38,8 @@ def test_list_individuals end row = response.to_enum.first + return if row.nil? + assert_pattern do row => FinchAPI::Models::HRIS::IndividualInDirectory end diff --git a/test/finch-api/resources/hris/documents_test.rb b/test/finch-api/resources/hris/documents_test.rb index c76aade7..7232d55c 100644 --- a/test/finch-api/resources/hris/documents_test.rb +++ b/test/finch-api/resources/hris/documents_test.rb @@ -24,5 +24,19 @@ def test_retreive assert_pattern do response => FinchAPI::Models::HRIS::DocumentRetreiveResponse end + + assert_pattern do + case response + in FinchAPI::Models::HRIS::W42020 + in FinchAPI::Models::HRIS::W42005 + end + end + + assert_pattern do + case response + in {type: :w4_2020, data: FinchAPI::Models::HRIS::W42020::Data | nil, year: Float | nil} + in {type: :w4_2005, data: FinchAPI::Models::HRIS::W42005::Data | nil, year: Float | nil} + end + end end end diff --git a/test/finch-api/resources/hris/employments_test.rb b/test/finch-api/resources/hris/employments_test.rb index a1355ca5..f207e5e6 100644 --- a/test/finch-api/resources/hris/employments_test.rb +++ b/test/finch-api/resources/hris/employments_test.rb @@ -11,6 +11,8 @@ def test_retrieve_many_required_params end row = response.to_enum.first + return if row.nil? + assert_pattern do row => FinchAPI::Models::HRIS::EmploymentDataResponse end diff --git a/test/finch-api/resources/hris/individuals_test.rb b/test/finch-api/resources/hris/individuals_test.rb index 3a382ade..efc4a612 100644 --- a/test/finch-api/resources/hris/individuals_test.rb +++ b/test/finch-api/resources/hris/individuals_test.rb @@ -11,6 +11,8 @@ def test_retrieve_many end row = response.to_enum.first + return if row.nil? + assert_pattern do row => FinchAPI::Models::HRIS::IndividualResponse end diff --git a/test/finch-api/resources/hris/pay_statements_test.rb b/test/finch-api/resources/hris/pay_statements_test.rb index 11920211..cfcc147c 100644 --- a/test/finch-api/resources/hris/pay_statements_test.rb +++ b/test/finch-api/resources/hris/pay_statements_test.rb @@ -11,6 +11,8 @@ def test_retrieve_many_required_params end row = response.to_enum.first + return if row.nil? + assert_pattern do row => FinchAPI::Models::HRIS::PayStatementResponse end diff --git a/test/finch-api/resources/hris/payments_test.rb b/test/finch-api/resources/hris/payments_test.rb index 9462cc3b..7410f95d 100644 --- a/test/finch-api/resources/hris/payments_test.rb +++ b/test/finch-api/resources/hris/payments_test.rb @@ -11,6 +11,8 @@ def test_list_required_params end row = response.to_enum.first + return if row.nil? + assert_pattern do row => FinchAPI::Models::HRIS::Payment end diff --git a/test/finch-api/resources/jobs/automated_test.rb b/test/finch-api/resources/jobs/automated_test.rb index d5a1f007..22538498 100644 --- a/test/finch-api/resources/jobs/automated_test.rb +++ b/test/finch-api/resources/jobs/automated_test.rb @@ -4,10 +4,8 @@ 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 - ) + response = + @finch.jobs.automated.create(params: {individual_id: "individual_id"}, type: :w4_form_employee_sync) assert_pattern do response => FinchAPI::Models::Jobs::AutomatedCreateResponse @@ -49,25 +47,13 @@ def test_list response = @finch.jobs.automated.list assert_pattern do - response => FinchAPI::Page + response => FinchAPI::Models::Jobs::AutomatedListResponse 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 + response => { + data: ^(FinchAPI::ArrayOf[FinchAPI::Models::Jobs::AutomatedAsyncJob]), + meta: FinchAPI::Models::Jobs::AutomatedListResponse::Meta } end end diff --git a/test/finch-api/resources/payroll/pay_groups_test.rb b/test/finch-api/resources/payroll/pay_groups_test.rb index e1493647..c69b7544 100644 --- a/test/finch-api/resources/payroll/pay_groups_test.rb +++ b/test/finch-api/resources/payroll/pay_groups_test.rb @@ -28,6 +28,8 @@ def test_list end row = response.to_enum.first + return if row.nil? + assert_pattern do row => FinchAPI::Models::Payroll::PayGroupListResponse end diff --git a/test/finch-api/resources/providers_test.rb b/test/finch-api/resources/providers_test.rb index e754d341..13fa06b0 100644 --- a/test/finch-api/resources/providers_test.rb +++ b/test/finch-api/resources/providers_test.rb @@ -11,6 +11,8 @@ def test_list end row = response.to_enum.first + return if row.nil? + assert_pattern do row => FinchAPI::Models::Provider end diff --git a/test/finch-api/resources/sandbox/company_test.rb b/test/finch-api/resources/sandbox/company_test.rb index 3727b65f..40bd3dfe 100644 --- a/test/finch-api/resources/sandbox/company_test.rb +++ b/test/finch-api/resources/sandbox/company_test.rb @@ -4,16 +4,17 @@ 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" - ) + response = + @finch.sandbox.company.update( + accounts: [{}], + departments: [{}], + ein: "ein", + entity: {}, + legal_name: "legal_name", + locations: [{}], + primary_email: "dev@stainless.com", + primary_phone_number: "primary_phone_number" + ) assert_pattern do response => FinchAPI::Models::Sandbox::CompanyUpdateResponse diff --git a/test/finch-api/resources/sandbox/connections/accounts_test.rb b/test/finch-api/resources/sandbox/connections/accounts_test.rb index 16ed49d7..7f92b645 100644 --- a/test/finch-api/resources/sandbox/connections/accounts_test.rb +++ b/test/finch-api/resources/sandbox/connections/accounts_test.rb @@ -4,10 +4,11 @@ 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" - ) + 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 diff --git a/test/finch-api/util_test.rb b/test/finch-api/util_test.rb index 24d9972d..969d487e 100644 --- a/test/finch-api/util_test.rb +++ b/test/finch-api/util_test.rb @@ -161,7 +161,10 @@ class FinchAPI::Test::UtilFormDataEncodingTest < Minitest::Test class FakeCGI < CGI def initialize(headers, io) @ctype = headers["content-type"] - @io = io + # rubocop:disable Lint/EmptyBlock + @io = FinchAPI::Util::ReadIOAdapter.new(io) {} + # rubocop:enable Lint/EmptyBlock + @c_len = io.to_a.join.bytesize.to_s super() end @@ -171,7 +174,7 @@ def env_table { "REQUEST_METHOD" => "POST", "CONTENT_TYPE" => @ctype, - "CONTENT_LENGTH" => stdinput.string.length + "CONTENT_LENGTH" => @c_len } end end @@ -208,6 +211,36 @@ def test_hash_encode end end +class FinchAPI::Test::UtilIOAdapterTest < Minitest::Test + def test_copy_read + cases = { + StringIO.new("abc") => "abc", + Enumerator.new { _1 << "abc" } => "abc" + } + cases.each do |input, expected| + io = StringIO.new + # rubocop:disable Lint/EmptyBlock + adapter = FinchAPI::Util::ReadIOAdapter.new(input) {} + # rubocop:enable Lint/EmptyBlock + IO.copy_stream(adapter, io) + assert_equal(expected, io.string) + end + end + + def test_copy_write + cases = { + StringIO.new => "", + StringIO.new("abc") => "abc" + } + cases.each do |input, expected| + enum = FinchAPI::Util.string_io do |y| + IO.copy_stream(input, y) + end + assert_equal(expected, enum.to_a.join) + end + end +end + class FinchAPI::Test::UtilFusedEnumTest < Minitest::Test def test_closing arr = [1, 2, 3] @@ -244,7 +277,7 @@ def test_rewind_chain def test_external_iteration it = [1, 2, 3].to_enum first = it.next - fused = FinchAPI::Util.fused_enum(it) + fused = FinchAPI::Util.fused_enum(it, external: true) assert_equal(1, first) assert_equal([2, 3], fused.to_a) @@ -320,8 +353,8 @@ def test_close_fused_sse_chain .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) + fused_2 = FinchAPI::Util.decode_lines(fused_1) + fused_3 = FinchAPI::Util.decode_sse(fused_2) assert_equal(0, taken) FinchAPI::Util.close_fused!(fused_3) @@ -330,7 +363,7 @@ def test_close_fused_sse_chain end class FinchAPI::Test::UtilSseTest < Minitest::Test - def test_enum_lines + def test_decode_lines cases = { %w[] => %w[], %W[\n\n] => %W[\n \n], @@ -340,15 +373,37 @@ def test_enum_lines %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] + %W[\na b] => %W[\n ab], + %W[\u1F62E\u200D\u1F4A8] => %W[\u1F62E\u200D\u1F4A8], + %W[\u1F62E \u200D \u1F4A8] => %W[\u1F62E\u200D\u1F4A8] } + eols = %W[\n \r \r\n] cases.each do |enum, expected| - lines = FinchAPI::Util.enum_lines(enum) + eols.each do |eol| + lines = FinchAPI::Util.decode_lines(enum.map { _1.gsub("\n", eol) }) + assert_equal(expected.map { _1.gsub("\n", eol) }, lines.to_a, "eol=#{JSON.generate(eol)}") + end + end + end + + def test_mixed_decode_lines + cases = { + %w[] => %w[], + %W[\r\r] => %W[\r \r], + %W[\r \r] => %W[\r \r], + %W[\r\r\r] => %W[\r \r \r], + %W[\r\r \r] => %W[\r \r \r], + %W[\r \n] => %W[\r\n], + %W[\r\r\n] => %W[\r \r\n], + %W[\n\r] => %W[\n \r] + } + cases.each do |enum, expected| + lines = FinchAPI::Util.decode_lines(enum) assert_equal(expected, lines.to_a) end end - def test_parse_sse + def test_decode_sse cases = { "empty input" => { [] => [] @@ -372,8 +427,8 @@ def test_parse_sse }, "complete event" => { [ - "event: update\n", "id: 123\n", + "event: update\n", "data: hello world\n", "retry: 5000\n", "\n" @@ -454,12 +509,19 @@ def test_parse_sse {data: "first\n"}, {data: "second\n"} ] + }, + "multibyte unicode" => { + [ + "data: \u1F62E\u200D\u1F4A8\n" + ] => [ + {data: "\u1F62E\u200D\u1F4A8\n"} + ] } } cases.each do |name, test_cases| test_cases.each do |input, expected| - actual = FinchAPI::Util.parse_sse(input).map(&:compact) + actual = FinchAPI::Util.decode_sse(input).map(&:compact) assert_equal(expected, actual, name) end end